split the objects in cocos2d
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.
精彩评论