Hi everyone…
I have a circle with some bounce
local myCircle = display.newCircle( 0, 0, 30 ) group:insert(myCircle) myCircle.x = display.contentCenterX myCircle.y = display.contentCenterY - 150 myCircle:setFillColor( 1, 1, 1 ) physics.addBody(myCircle, "dinamic", {density = 1.0, friction = 0.3, bounce = .9, radius=30, isSensor = false})
Then I have a rect as abutton, when I tap on that button
I would like a function to lower the bounce property, like bounce.8, bounce.7, bounce.6 everytime I tap
local lessBounce = display.newRect( 0, 0, 20, 20 ) group:insert(lessBounce) lessBounce.x = display.contentCenterX - 100 lessBounce.y = display.contentCenterY + 165 lessBounce:setFillColor( 1, 1, 1 ) local function lessBounceListener() print("less bounce") end lessBounce:addEventListener("tap", lessBounceListener)
Or more bounce, how would I do that?
Thanks