first game

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
9happy
Posts: 9
Joined: Sat Nov 11, 2006 1:29 pm

first game

Post by 9happy »

Hello forum :D

I'm making my first graphical game in C++. I plan for it to be a 2D top-down shooter game with multiplayer support.

I've got the movement down, your character stays in the middle of the screen and walks when you press W,A,S, or D or a combination of two of them. The direction he walks is relative to your cursor, so when you hold down W he walks towards your cursor.

Any suggestions? How should I do collision and maps? I was thinking about using tiled maps, but I'm not sure how to implement collision.

Also, is there any way to rotate a 2d image? I want my character to always be facing my cursor.
omar shaaban
Posts: 616
Joined: Wed Nov 01, 2006 6:26 pm
Location: Cairo,Egypt
Contact:

Post by omar shaaban »

:? will u render it with irrlicht or with gui?
Lideln
Posts: 79
Joined: Sat Jun 24, 2006 11:35 am
Location: Paris, France

Post by Lideln »

Hi,

For maps, its a good idea to use tiles-based maps (less heavy than drawing a whole level in one single texture...)

For collisions, here is a useful link found in the forums :
http://irrlicht.sourceforge.net/phpBB2/ ... hp?t=13029

For rotations, it has also been asked on the forums, so here is a link :
http://irrlicht.sourceforge.net/phpBB2/ ... php?t=9632

(I found those both with forum search, using "rotate AND sprite" :lol: )

Good luck, and good evening ! :)
--
Lideln, France
9happy
Posts: 9
Joined: Sat Nov 11, 2006 1:29 pm

Post by 9happy »

So I guess I'll be using SDL? Sort of a kludge :?
Lideln
Posts: 79
Joined: Sat Jun 24, 2006 11:35 am
Location: Paris, France

Post by Lideln »

Of course not :)

In the thread, the man posting those links said something like :
"it's for SDL, but you can use the idea to make it work for irrlicht"

:)
--
Lideln, France
9happy
Posts: 9
Joined: Sat Nov 11, 2006 1:29 pm

Post by 9happy »

Well the problem is that I'm fairly new to C++ and new to irrlicht; It's hard for me to figure out a way to make it work.
omar shaaban
Posts: 616
Joined: Wed Nov 01, 2006 6:26 pm
Location: Cairo,Egypt
Contact:

Post by omar shaaban »

did u made any console applications with c++?
9happy
Posts: 9
Joined: Sat Nov 11, 2006 1:29 pm

Post by 9happy »

Yes, and I made a few basic graphical games in BASIC a long time ago.
9happy
Posts: 9
Joined: Sat Nov 11, 2006 1:29 pm

Post by 9happy »

If nothing else, I might be able to make my own crude and inefficient collision engine and just draw eight or so sprites that change as rotation, but that would be sloppy and a lot of work...
Lideln
Posts: 79
Joined: Sat Jun 24, 2006 11:35 am
Location: Paris, France

Post by Lideln »

For rotation, in the thread I gave you the link, a person advises to use a mesh with only one face (one face = 2 triangles), and put the texture on that face.

Then, just rotate the face thanks to the 3D mesh rotation functions, and you're done ! :)

For the collision, it should not be that difficult.
There should be some rectangles collision functions in irrlicht, check the documentation.

If it is fast or not, I dunno, but it should do it.
--
Lideln, France
omar shaaban
Posts: 616
Joined: Wed Nov 01, 2006 6:26 pm
Location: Cairo,Egypt
Contact:

Post by omar shaaban »

:) well i dont see any point for making 2d games with irrlicht just make it with gui
Lideln
Posts: 79
Joined: Sat Jun 24, 2006 11:35 am
Location: Paris, France

Post by Lideln »

What Omar says is not false.

If you ONLY want to use 2D, then you should use a 2D engine, not a 3D one.

For example, SDL is not bad. But there should be other engines.
--
Lideln, France
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

Well there's no harm in using Irrlicht as it copes just fine with 2D graphics, so you wouldn't run into any problems. And just using the GUI for a 2D game... I'm not sure about that, there've been discussions before about which is better to use driver->draw2DImage or an IGUIImage and no one seemed to give any answer as to the advantage of one over the other, but im sure there are some!
Image Image Image
omar shaaban
Posts: 616
Joined: Wed Nov 01, 2006 6:26 pm
Location: Cairo,Egypt
Contact:

Post by omar shaaban »

well the best is to use 2d engine because:
1-faster and easier because irrlicht was made mainly for 3d
2-will support many 2d effects and other 2d features
3-will make programming a little more fun :wink:
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

More fun? Not sure why, may have more 2D features, as you say Irrlicht is mostly 3D i guess. Faster.. maybe, if it's got more of a focus on 2D it may have done more work on making it more efficient, but i shouldnt think Irrlicht is slow by any means and would never run into troubles in 2D as it's not very demanding. Easier? Again possibly if they've done more focus on 2D then maybe they've got easier ways of doing things.
Image Image Image
Post Reply