开发者

split the objects in cocos2d

开发者 https://www.devze.com 2023-01-31 00:57 出处:网络
am having cocos2d game. 开发者_JAVA百科in this, when player touches the screen, i want to split the sprite object in to three object.This is a very generic question. So I\'ll answer it generically:

am having cocos2d game. 开发者_JAVA百科in this, when player touches the screen, i want to split the sprite object in to three object.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消