gregmax17 Posted February 1, 2014 Share Posted February 1, 2014 Hello, I come from a Impact JS background and I am trying to get into Phaser. In Impact, there are 'Entities' which I can load from scene to scene (or game to game). Is there a 'Entity' behavior in Phaser when I switch from one game state to the next? Whats the best way of handling this so I don't have to copy and paste my hero behavior, animations, inputs again and again? Thanks in advance Link to comment Share on other sites More sharing options...
powerfear Posted February 1, 2014 Share Posted February 1, 2014 Hello, in Phaser you would create your own class for example Player, that inherit Sprite. Then you could have an update function for the Player class where you would put the relevant logic. setting up animations for examples would be in the constructor or an iniit type of function, while checking input would be in a update type of function, function naming doesn't matter as you will call the function of the Player by yourself. Link to comment Share on other sites More sharing options...
Recommended Posts