diff options
Diffstat (limited to 'src/gnu_and_bola_-_the_libre_beat_em_up_game/scripts/bola/motion.lua')
-rw-r--r-- | src/gnu_and_bola_-_the_libre_beat_em_up_game/scripts/bola/motion.lua | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/gnu_and_bola_-_the_libre_beat_em_up_game/scripts/bola/motion.lua b/src/gnu_and_bola_-_the_libre_beat_em_up_game/scripts/bola/motion.lua index e0d5465..109b873 100644 --- a/src/gnu_and_bola_-_the_libre_beat_em_up_game/scripts/bola/motion.lua +++ b/src/gnu_and_bola_-_the_libre_beat_em_up_game/scripts/bola/motion.lua @@ -3,7 +3,10 @@ local motionModule = {} function motionModule.motion(dt) if character.bola.jump.higher > 0 and love.keyboard.isScancodeDown(button.a) then jump(dt) + else + character.bola.jump.finishJump = false end + if love.keyboard.isScancodeDown(button.left) then walkLeft(dt) elseif love.keyboard.isScancodeDown(button.right) then @@ -17,10 +20,12 @@ function motionModule.motion(dt) end function jump(dt) - character.bola.jump.higher = character.bola.jump.higher - dt - character.bola.jump.velocity = character.bola.jump.velocity + character.bola.jump.height * (dt / character.bola.jump.higherMax) + if character.bola.jump.finishJump == false then + character.bola.jump.higher = character.bola.jump.higher - dt + character.bola.jump.velocity = character.bola.jump.velocity + character.bola.jump.height * (dt / character.bola.jump.higherMax) --- quad.bola = character.bola.jump[math.floor(character.bola.jump.start)] + -- quad.bola = character.bola.jump[math.floor(character.bola.jump.start)] + end end function walkLeft(dt) |