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];
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];
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.