3

I hope to make the ball bouncing realistic. Sometimes it will bounce, the apex will begin to decrease and then it hits the ground again and bounces even higher. Same happens when it hits the walls, it is as if the walls apply a force to the ball against my will (I do not have any force applied to the ball, besides gravity which is at default setting of 9.8 in the y-direction.

physics.addBody(bottomWall, "static", {density = 0, friction = 0, bounce = 0, isSensor = false})
physics.addBody(leftWall, "static", {density = 0, friction = 0, bounce = 0, isSensor = false})
physics.addBody(rightWall, "static", {density = 0, friction = 0, bounce = 0, isSensor = false})

local circle = display.newCircle( halfW, 20, 25 )
circle.x, circle.y = 160, -100
physics.addBody(circle, "dynamic", {bounce = 0.95})
greatwolf
  • 20,287
  • 13
  • 71
  • 105
user3342460
  • 71
  • 1
  • 4
  • 1
    Found something that works, playing around with the bounce property until it works as intended: physics.addBody(circle, "dynamic", {density=0.8, friction=0.3, bounce = 0.6}) – user3342460 Jul 16 '14 at 23:24

1 Answers1

0

Try also changing linearDamping and angularDamping of ball

circle.linearDamping = 10;
circle.angularDamping = 10;
iBad
  • 286
  • 2
  • 14