Jump
looking for a simple jump button for a platfomer P.S srry loginus for deleting the post when you replied thx tho
looking for a simple jump button for a platfomer P.S srry loginus for deleting the post when you replied thx tho
as far as I know, you'd do something like this:
init = function()
player = object
x = 0
y = 0
momentum = 0
end
end
update = function()
if player.momentum > 0 then
player.y += momentum
player.momentum -= 1
end
if keyboard.press.W then
// can also check if colliding with ground to not jump mid-air
jump(player)
end
end
jump = function(object)
object.momentum = 10
end
thanks. How would you display the sprite because i cant figure that out. plz