Reputation: 2367
I am trying to superimpose sprites by drag and drop and when to sprites collide I want to stick them so if one fall the other sprite stack on it will fall two. Any ideas please?
Best regards
For more precision I need help on the stick part. Thanks
Upvotes: 0
Views: 151
Reputation: 16526
I'd follow these steps.-
CCSprite
to add a property CCSprite *spriteToFollow
CGPoint
to store the offset between two sprites when they collide.CustomSprite
collides with another one, set the proper spriteToFollow
CustomSprite init
method, call to scheduleUpdate
update
method, if spriteToFollow
exists, update the current to spriteToFollow.position + offset
Hope it helps.
Upvotes: 1