theTrav
08-04-2009 05:55:49
Within my physics space, there are many items that I only want to simulate movement along the Y axis.
That's pretty much just gravity and collision with other objects.
This means I need to prevent all rotation, and also prevent movement along the X and Z axis.
So far I've tried doing this with body.setPosition() in the collide function, but that seems to make the body stop moving completely after a collision... I'm considering doing it in a frame listener, but that seems a bit crazy.
Is there a more 'proper' way of achieving the behavior I'm describing?
That's pretty much just gravity and collision with other objects.
This means I need to prevent all rotation, and also prevent movement along the X and Z axis.
So far I've tried doing this with body.setPosition() in the collide function, but that seems to make the body stop moving completely after a collision... I'm considering doing it in a frame listener, but that seems a bit crazy.
Is there a more 'proper' way of achieving the behavior I'm describing?