Jump to content
This forum will be closing down. Please move to the respective dedicated project forums.

How to go to next level


StephenDunne
 Share

Recommended Posts

In the game im making, I have 2 separate html files, a level 1 and a level 2. Once I complete level 1 I want it to run level 2. Once the level is completed an image pops up says that the level is completed. I want the next level to load when the user clicks on this image. How would I go about this? 

 

This is the code I have.

 

function rightAnswer (num1, ground1) {
wellDone = game.add.sprite(200,100, 'wellDone');

score += 1;
scoreText.text = scoreString + score;
num1.kill();
ship.kill();
cloud.kill();
game.state.start('level2', AirQuation.level2);
}

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...