In my game, I’ve got a circular body that the player can move left or right. This is accomplished by calling setLinearVelocity() on each frame that the player is pressing the left or right button, like this:
if (playerDirection == -1) then -- left
player:setLinearVelocity(-10, 0)
elseif (playerDirection == 1) then -- right
player:setLinearVelocity(10, 0)
When the player releases the left or right button, the body continues to roll at the same speed. If I change the body to a square, friction brings the body to a stop. Does anyone know how to accomplish the same effect with a circular body?
Thanks a lot!
[import]uid: 15273 topic_id: 6839 reply_id: 306839[/import]