_G.myCircle = display.newCircle( 100, 500, 30 )
myCircle:setFillColor( 0.2,0.7,0.8 )
local button = display.newRect( 300, 900, 200, 80 )
button.alpha = 0.6
function button:touch(event)
if event.phase ==“began” then
button.alpha = 0.4
transition.to( myCircle, { time=500, x=myCircle.x, y=myCircle.y-200, 50, onComplete=button } )
isJumping=false
end
if event.phase ==“ended” then
button.alpha = 0.6
isJumping = true
transition.to( myCircle, { time=500, x=myCircle.x, y=myCircle.y+200, 50, onComplete=button } )
end
end
button:addEventListener(“touch”,button)
Can you help me modify this code so that it simulates jump under gravity please, without using the physics in corona?
I can still do double tap in between jumps and this is problematic.