Jump to content

Interactive Sprite State Machine Example w/ Demo


Recommended Posts

Hello. I stumbled across Phaser last night and created a quick demo that extends a sprite to use a state machine. State and transitional animations are handled automatically. In the past I've used this system for an ImpactJS game where the playable character had 15 states.  In the demo I've included 4:


- sitting

- walking

- laying

- sleeping


Press the RIGHT key to cycle through the states. The cat will automatically lay and then sleep after a couple seconds if there is no input.



Perhaps someone will find this useful. 






GitHub Repo:


Link to comment
Share on other sites

  • 1 month later...

  • Recently Browsing   0 members

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