From 977a7356084026cbec1d96c8c6504fb5d9f7c920 Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Thu, 2 May 2019 20:10:41 +0200 Subject: [PATCH] examples/plateformer: make the player able to jump --- examples/gameplay/plateform/actors/player.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/gameplay/plateform/actors/player.lua b/examples/gameplay/plateform/actors/player.lua index 862bba9..e5966a0 100644 --- a/examples/gameplay/plateform/actors/player.lua +++ b/examples/gameplay/plateform/actors/player.lua @@ -10,8 +10,8 @@ end function Player:update(dt) self.xfrc = 480*3 - if self.keys["up"].isDown then - --self.ysp = -120 + if self.keys["up"].isPressed and (self.onGround) then + self.ysp = -280 end if self.keys["down"].isDown then --self.ysp = 120