Hi everyone…
Look at this code
myCar1 = display.newImageRect( "images/car1.png", 50, 75 ) group:insert(myCar1) myCar1.x = display.contentCenterX myCar1.y = display.contentCenterY physics.addBody( myCar1, { density=1.0, bounce=0.01 } ) myCar1.isFixedRotation = true myCar1.gravityScale = -0.03 background:addEventListener('tap', function(e) if e.x \> myCar1.x then transition.to(myCar1, {time=100, x=e.x, y=e.y}) elseif e.x \< myCar1.x then transition.to(myCar1, {time=100, x=e.x, y=e.y}) else print("that's it") end end)
I tap on the screen, and move the car anywhere…
the car seems to move forward, because the gravity -0.03
not too fast, very slow
but as I keep playing, little by little, the car start to going faster and faster
like
gravity -0.03
gravity -0.08
gravity -0.1
gravity -0.4
gravity -0.9
and so on…
Why?