Hi, I am a new at this so I’ve been following a tutorial that teaches you how to create an endless rounner game.
function touched( event )
if hero.isAlive then
if(event.phase == “began”) then
if(onGround) then
hero.accel = hero.accel + 25
end
end
else
if(event.x < gameOver.x + 150 and event.x > gameOver.x - 150 and event.y < gameOver.y + 95 and event.y > gameOver.y - 95) then
restartGame()
end
end
From what I found out, this is the function that allows you to jump, however I would like to make it so it double jumps, which is not explained in the tutorial.
Could someone help me out?
Thanks in advance.