在cocos2d中分割对象
我正在玩cocos2d游戏。在此,当玩家触摸屏幕时,我想将精灵对象分成三个对象。
am having cocos2d game. in this, when player touches the screen, i want to split the sprite object in to three object.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这是一个非常普遍的问题。所以我会笼统地回答这个问题:
你知道如何创建一个桶精灵,对吧?
当玩家触摸桶时,您只需再创建两个(或三个并删除现有的)并将其位置设置为现有桶,加上或减去一些随机因素或您需要的任何因素。
This is a very generic question. So I'll answer it generically:
You know how to create one bucket sprite, right?
When the player touches the bucket, you just create two more (or three and remove the existing one) and set their position to the existing bucket, plus or minus some random factor or whatever you need.
这个问题太含糊了,但是,据我了解:
您应该尝试使精灵由多个部分(其他精灵)组成,当事件发生时,您应该使用一些物理或类似的东西来改变所有部分的位置,具体取决于您想要做什么。
The question is too ambiguous, but, from what i understand:
You should try making the sprite formed from several pieces (others sprites), when the event occurs you should just change the position of all the pieces, with some physics or something like it, depending of what do you want exectly to do.