Loading a new level?

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
Dark_Exodus
Posts: 23
Joined: Thu Jan 29, 2004 4:07 pm
Location: Birmingham, UK
Contact:

Loading a new level?

Post by Dark_Exodus »

Hi

How I do I load a new map? e.g. the player has completed the first level and now wants to move onto the second one.

At the moment when I try loading the second map the game crashes. I'm using a switch statement to state we're now entering the second level.

any help?
Tyn
Posts: 932
Joined: Thu Nov 20, 2003 7:53 pm
Location: England
Contact:

Post by Tyn »

Code: Select all

smgr->clear();
This function deletes all the scene nodes in the scene.
I recommend you incorporate this into your own function so that any other information ( timers, counters, arrays containing pointers to scene nodes ) is saved if necessary and cleared before removing all the scene nodes.

This is what I am planning to put in my code to clear the whole interface:

Code: Select all

bool isLevelCleared = level[currentLevel]->clearLevel();

if ( isLevelCleared == true )
     requestGameState(NextLevel);

else
    // Display level clearance error
Dark_Exodus
Posts: 23
Joined: Thu Jan 29, 2004 4:07 pm
Location: Birmingham, UK
Contact:

Post by Dark_Exodus »

i'll give that a shot and see what happens.
Dark_Exodus
Posts: 23
Joined: Thu Jan 29, 2004 4:07 pm
Location: Birmingham, UK
Contact:

Post by Dark_Exodus »

Ok, using clear, clears the screen but the game still crashes :( .

I get a runtime error this time (pure virtual function call), which I'm guessing refers to the clear function.

Any ideas?
Electron
Posts: 874
Joined: Sun Mar 14, 2004 12:05 am
Location: Massachusetts USA

Post by Electron »

I'm planning to just drop the device and recreate
Post Reply