In mygame i have an issue. if a user touch one point, an sprite will come, AI move starts and it comes to nearest point. If the user touches very fastly, AI seems to move here and there. I need AI move to complete and then it allow user to touch. How to accomplish that
How to stop the user touching the screen till AI move is completed
(5 posts) (2 voices)-
Posted 1 year ago #
-
Easiest solution would be a simple BOOL check. Like BOOL aiIsMoving. Put an if inside your touch methods only allowing them to fire when !aiIsMoving...
Posted 1 year ago # -
For AI move, i have used CCMoveTo. Hence before reaching the destination, if an user touch the screen, AI moves is not clear in its path.How to know that AI reached destination?After that only i can allow user to touch the screen
Posted 1 year ago # -
Posted 1 year ago #
-
Well you should now the duration of your animation(?) how about this: when firing your animation set the BOOL to YES. At the same time schedule a call to a method where the BOOL is set to NO. The scheduler should be timed with the duration of your animation...
Posted 1 year ago #
Reply
You must log in to post.