Restarting body/shape position
Posted: Wed Sep 24, 2008 7:49 am
Hello,
I've got the following situation...
A ball that is kicking around in a room, when it's Y component reaches a certain value it should have its own position restarted at a fixed X, Y so it can free fall and start kicking around all over again.
I've already tried the following approaches:
In the second try, that I believe that is the worst option, the shape loses itself, I can't keep track of the position, it's as if I removed the body from the space, because the position is not updated anymore.
I'm still a beginner with Chipmunk, so there's a great chance that I'm trying bad approaches to this problem. So any suggestion would be great
Please, any help is appreciated.
I've got the following situation...
A ball that is kicking around in a room, when it's Y component reaches a certain value it should have its own position restarted at a fixed X, Y so it can free fall and start kicking around all over again.
I've already tried the following approaches:
- Freeing the body and the shape and initializing it again as in first time.
- Manually setting the body's position to the initial X, Y and setting cpvzero to velocity.
In the second try, that I believe that is the worst option, the shape loses itself, I can't keep track of the position, it's as if I removed the body from the space, because the position is not updated anymore.
I'm still a beginner with Chipmunk, so there's a great chance that I'm trying bad approaches to this problem. So any suggestion would be great
Please, any help is appreciated.