Cocos2d and Body with few collision shapes using chipmunk

Posted by Eimantas on Game Development See other posts from Game Development or by Eimantas
Published on 2011-03-09T12:27:02Z Indexed on 2011/03/09 16:19 UTC
Read the original article Hit count: 341

I'm using Cocos2d (0.99.5) with chipmunk physics engine. Currently I'm trying to place a body into space which is combined from few circle shapes.

Let's say I have a corresponding sprite image with displays atom (nucleus + 3 electrons around it. Something like this without orbit lines). In it's simplest form - only one circle shape at the center should be enough which would detect collisions from other objects with nucleus. Now I'd like to add other circle shapes for each electron. How can I do that?

Now when I add those shapes to the body and add the body into chipmunk space - the shapes (together with the body/sprite) start flickering and spinning with no recognizable pattern (or reason for that matter).

© Game Development or respective owner

Related posts about 2d-physics

Related posts about cocos2d-iphone