Hey, can this be done? I have a standard ship which floats up and down using applyForce on touch. At the moment what happens is the player player presses on the screen for a few seconds and the ship just flies up, gathering acceleration on touch. I know this is the meaning of force (that it picks up speed) but is there a way i can lock the speed on touch?
I have also used setLinearvelocity too and found its controls to rigid and less fluid. It also jumps a tad bit on touch rather than float up.
fly function
function activateFly(ship,event) if fuel \< 60 then ship:applyForce(0, -1.4, ship.x, ship.y) elseif fuel \> 60 then ship:applyForce(0, -1.4, ship.x, ship.y) ship.gravityScale = 1.75 end end function touchScreen(event) print("touch") if event.phase == "began" then ship.enterFrame = activateFly Runtime:addEventListener("enterFrame", ship) end if event.phase == "ended" then Runtime:removeEventListener("enterFrame", ship) end end Runtime:addEventListener("touch", touchScreen)