Note: This is for SpriteKit using Objective C.
I have a single scene called GameScene
in my game and I'm using a GKStateMachine
to handle the various states Play
, Pause
and ReadyToPlay
. I know you can handle all of the key presses in the keyDown:
method of GameScene
, but it can get very messy very quickly with all of the different conditions and key combinations.
Question: Is there a way to handle the key presses in each of the various state classes instead?
I've read an article that have said NSNotificationCenter is a horrible option. I don't know enough about this stuff to make an informed decision.