Jump to content

Player/Enemy objects for cross states


Flexicon
 Share

Recommended Posts

So I have a little game concept I've been making in phaser and I have the parts of it split into states such as main menu and levels, but what I have been doing is creating the Player objects and enemy objects and the such in each individual states as well as making animations for them.

 

This is very obviously inefficient I want to know how would I go about making an object for these entities to use it cross states :)

Link to comment
Share on other sites

Yeah thanks for replying!
After I posted I thought of doing something like that. Only thing is I'm not quite sure how I would go about including the entity in a new state. I suppose I would make a var in the state equaling to the player object. I suppose the thing I'm looking for would be doing something along the lines of creating a new instance of a Player class. Just not sure how to achieve this right now xD

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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