Is it possible to check if there are actions currently running in a CCNode class in Cocos2d? I’d like to know if a CCMoveBy is still running or not.
Is it possible to check if there are actions currently running in a CCNode
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can always add a method to indicate when the method is finished, and then toggle some BOOL or something like that to indicate it is not running, and put a start method to toggle the BOOL to indicate it started:
Modified from here.
In the two @selector methods:
and:
where ccmoveByIsRunning is the BOOL I’m referring to.
EDIT: As xus has pointed out, you should actually not do this and instead use
[self numberOfRunningActions]as others have pointed out.