CCAction:停止和运行
在我的项目中,我创建了一个奔跑的角色。目前,我正在尝试为角色实现不同的动画。
我决定创建 2 个不同的动作
1) CCAction *walkAction;
2) CCAction *jumpAction;
当角色应该跳跃时,我调用一个方法 [self stopAllActions];
然后使其 [self runAction:jumpAction];
当角色落地时,我调用 stopAllActions,然后运行 walkAction。
但由于某种原因,应用程序冻结了。我需要有关停止和运行操作而不导致应用程序崩溃的帮助!
谢谢你!
For my project, I've created a running character. Currently, I am attempting to implement different animations for the character.
I've decided to create 2 different actions
1) CCAction *walkAction;
2) CCAction *jumpAction;
When the character is supposed to jump, I call a method that [self stopAllActions];
and then make it [self runAction:jumpAction];
When the character lands, I call stopAllActions and then run the walkAction.
For some reason, though, the application freezes up. I need help regarding stopping and running actions without the application crashing!
Thank you!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不要试图保留动作(我总是读到的内容)。
每次只需发射一个新的。 Cocos2d 会清理它。
Don't try to retain actions (what I always read).
Just fire a new one each time. Cocos2d will clean it up.