views:

47

answers:

1

Hello everyone

can anyone tell the best approach to run game loop like Uno or Herats (Deck Game)

[CPU2 turn];
[CPU3 turn];
[User turn]; // Wait to get user input before proceed to [CPU4 turn]
[CPU4 turn];
+1  A: 

Perhaps you could make turns into NSOperation subclass instances placed into an NSOperationQueue, which is set to allow only one concurrent turn/operation. In this case, turns are handled in first-in-first-out (FIFO) order. You can read more about this in Apple's Managing Concurrency document.

Alex Reynolds