最近学习lua,发现执行一系列动作时,比如我有一个任务正在跑,我点击的时候想停止这个动作并执行跳跃动作,跳跃完成后继续执行跑的动作,可是我发现这样写始终不行
frameSprite:stopAllActions()
frameSprite:runAction(cc.Sequence:create(jump ,frameAction))
后面这个跑的动作始终执行不了,跳跃之后就不动了,后来查阅资料才知道不能这么写,我们在创建frameAction的时候:frameAction:retain()
需要执行的时候:
frameSprite:stopAllActions()
frameSprite:runAction(cc.Sequence:create(jump ,frameAction:clone()))这样就可以很顺利的执行了
大家轻喷
---蛋蛋