I need to imitate radial (planetary-) gravity when all dynamic bodies in the space are attracted to the static body situated in the center of the screen. I set
space->gravity = ccp(0, 0);
I create dynamic bodies with calling their creating methods in -init, which will fall on this central body from other sides like here http://www.youtube.com/watch?v=2BxkbXfEWg4&feature=player_embedded from 0:12.
Questions:
- how can I set gravity vector individually for every single object? I plan to real-time reassign gravity vector, based on objects coordinates changes.
- what actually have property of gravity: sprite, body or shape?
- is it a more simple way to realize this effect?