1 decade ago by igr
Hi,
the game I am working on finishes when the Hero is killed (naturally:).
I have the following code to go to the LevelgameOver:
The problem is that at the game launch the game instead of starting at the LevelIntro, goes directly to the LevelGameOver, since this.getHero() returns NULL when I start the game.
Is there a smart workaround?
Thank you!
the game I am working on finishes when the Hero is killed (naturally:).
I have the following code to go to the LevelgameOver:
if(!this.getHero()){ // Level restarts if Hero is killed
this.gameOver = true;
this.myDirector.jumpTo(LevelGameOver);
}
The problem is that at the game launch the game instead of starting at the LevelIntro, goes directly to the LevelGameOver, since this.getHero() returns NULL when I start the game.
Is there a smart workaround?
Thank you!
