Hi everybody,
I have a small question. I would like to implement a turn-based game
in cocos2d.
The flow is more or less like this:
init()
while not isGameEnd():
##wait for event##
changePlayer()
checkGameEnd()
endScoring()
The question is now, how can I implement the ##wait for event## part.
The idea is,
that the player, e.g. placed a tile and afterwards the control is
given back to the
main flow above. I would like to avoid having a callback mechanism as
it would
obfuscate the flow. I could implement
it with something like this:
init()
while not isGameEnd():
turnEnded = false
while not turnEnded:
None
changePlayer()
checkGameEnd()
endScoring()
and have the event (e.g. tile placing) set the turnEnded variable to
true, once the the player made his move.
But that does not look good either.
Any suggestions?
Best regards,
Dexter
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"cocos2d discuss" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cocos-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---