Jump to content

Multiple Levels


cmoney0927
 Share

Recommended Posts

Hey, I have recently been creating a platformer with multiple levels using Phaser. Everything has been going great until I tried to add a second level. Even though I did everything exactly the same way for level 2 as I did for level 1, I get the error that playStateTwo is not defined. I have looked everywhere and am at a loss. Any suggestions would be greatly appreciated.

Link to comment
Share on other sites

Hey, I have recently been creating a platformer with multiple levels using Phaser. Everything has been going great until I tried to add a second level. Even though I did everything exactly the same way for level 2 as I did for level 1, I get the error that playStateTwo is not defined. I have looked everywhere and am at a loss. Any suggestions would be greatly appreciated.

same

Link to comment
Share on other sites

I always forget to include the extra level's source in the index.html

<script src="js/playState2.js></script>

Or to declare the state

Game.state.add(’playState2’,BasicGame.Game);

Either in index or boot state.

Take me a couple of minutes of puzzlement before I remember. That gives this error.

If it's not this then yes the code would be essential!

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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