Dream Of Sleeping Posted March 14, 2014 Share Posted March 14, 2014 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 More sharing options...
rich Posted March 14, 2014 Share Posted March 14, 2014 Hmmm interesting point, yes I let you build up callbacks now, so I would use removeKey on your state end. I probably ought to call that automatically when a state is destroyed though, so will add it to the list. Link to comment Share on other sites More sharing options...
qdrj Posted March 14, 2014 Share Posted March 14, 2014 It would be handy if you will add keyboard.removeAll() method also. Link to comment Share on other sites More sharing options...
Recommended Posts