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

Global Entity


gregmax17
 Share

Recommended Posts

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

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

 Share

  • Recently Browsing   0 members

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