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})