I’m writing tetris right now, I have a method that drops figures one by one onto the same position on the screen, that methods starts working after double tapping the screen and it is called in while loop:
while (gameState == gamePlaying) {}
The problem is that I donn’t know how to make my moveLeft or moveRight methods work by UISwipeGesture or even just by using a button, because while dropping method works I’m not able to use any buttons or gestures (if I understand it right)
So how can I create a button which would have higher priorty than the method that works at the moment?!(or how to use UISwipeGestures in this situation?)
I would also suggest using a NSTimer for the scheduling of the game logic. If you simply want to perform an action in a background thread such that the user interface doesn’t block you can use for example:
NSTimer variant: