Guest User

Untitled

a guest
Jun 24th, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.44 KB | None | 0 0
  1. local function jump(event)
  2.         if event.phase == "began" then
  3.                 jumpTimer = timer.performWithDelay(10, function() jumpHeight=jumpHeight+5 end, -1)
  4.         elseif event.phase == "ended" then
  5.                 player:setLinearVelocity(1, 500 * -1)
  6.                 player:applyAngularImpulse( 5 )
  7.                 timer.cancel(jumpTimer)
  8.                 jumpHeight = 100
  9.         end
  10. end
  11. player:addEventListener("touch", jump)
Add Comment
Please, Sign In to add comment