dluz Posted November 11, 2014 Share Posted November 11, 2014 Hello everyone, I am newbie with PhaserJs. I have previous experience with enchantJs. In this engine, to change the screen (for example: "gameloop" or "mainmenu") is easy, using the concept of scene.I wonder if there is a way to do it so well simplifiedin PhaserJs. Sorry for my English. Link to comment Share on other sites More sharing options...
BdR Posted November 11, 2014 Share Posted November 11, 2014 Phaser has a State class. You can implement different State objects for your menu, level select, game etc. Each state has a create and update method which you can implement. Put initialisation code in "create" and put your game logic or menu logic code in the "update" method because that method will be called for each frame. Then, to switch between states you can do something like this:this.state.start('MainMenu'); // state name is case sensitive btwAs far as I know there is no transition animations but you can add tween or something like that yourself. For more info see this excellent Getting Started With Phaser post by end3r. dluz 1 Link to comment Share on other sites More sharing options...
Recommended Posts