Multiple levels/stages

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.
Post Reply
Gtoknu
Posts: 9
Joined: Sat Sep 11, 2010 12:51 am

Multiple levels/stages

Post by Gtoknu »

So, I want to make my game with multiple levels. Every game has this. But, how to make one with Irrlicht?

Here is a example:

I have a game with 3 stages, first is the menu, the second is the game, the third is the gameover screen.

My solution:


Make a custom scene node to manage the levels, and another one to all the levels inherit it and do all his things.

and when I'm not using i make them invisible, so they won't draw and update.

Anything wrong?
I want some ideas to do this. I think my solution will not work. That's why I want some suggestions/hints of you before developing it.

Thanks :D
hybrid
Admin
Posts: 14144
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Custom scene node is the wrong way. It would work, but you'd use a structure which is meant for highly specific render tasks (read, completely different way of performing low-level rendering) for something related to scene managerment. Just make your own structures and objects, which refer to certain scene nodes. This is enough for this job. It might be worth using several scene managers, but that depends on the scene structures and ressource constraints.
teto
Posts: 159
Joined: Thu Dec 03, 2009 9:37 pm
Location: /home
Contact:

Post by teto »

Look for gamestates.
Basically you create a stack of gamestates with only the top one being updated/drawn.

For each state (menu,ingame,game over screen), you derive from an interface GameSate.
Using trunk with mingw/gcc 4.6, Windows 7 64 bits driver opengl
Gtoknu
Posts: 9
Joined: Sat Sep 11, 2010 12:51 am

Post by Gtoknu »

Ah thanks a lot!

I'm not at home in the moment, but, when I get in home, I'll try to do one of those. But, I think the hybrid idea is better, cuz, if I wanna reuse my scenes it will not work(maybe will work, but i'll try to allocate the scenes more than 1 time..) Thanks a lot!
serengeor
Posts: 1712
Joined: Tue Jan 13, 2009 7:34 pm
Location: Lithuania

Post by serengeor »

In my opinion it would be easier to go with gamestates
Working on game: Marrbles (Currently stopped).
Post Reply