I need help making it so when the balloon is tapped it goes straight up to a certain height? How do i change edit my code to make it so when i tap the ball it goes to the height i want it to go? Thank you!
function ballf(event)
if event.phase == “ended” then
vx, vy = ball:getLinearVelocity()
ball:setLinearVelocity( -vx, -vy )
end
end
ball:addEventListener(“touch”, ballf)
function ballf(event)
if event.phase == “ended” then
vx, vy = ball:getLinearVelocity()
ball:setLinearVelocity( -vx, -vy )
end
end