Jump to content

Best practice for handling keys phaser 2.0

Dream Of Sleeping

Recommended Posts

Hello. Just switcing over my game to version 2.0.  I use Space key  to select on the start menu state, but I use it in the play state as part of the controls. In the last version I would add the keys in the state create method. It didn't seem to matter that it would create another key with space, it would just replaced it. Now it does and when I hit space in the play state it is also been fired in the menu state.


So where is it recommended we create keys? In each state's create function, and just unregister the keys when that state is done? Or some other way?

Link to comment
Share on other sites


  • Recently Browsing   0 members

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