summaryrefslogtreecommitdiff
path: root/src/gnu_and_bola_-_the_libre_beat_em_up_game/scripts/bola/motion/motion.lua
diff options
context:
space:
mode:
Diffstat (limited to 'src/gnu_and_bola_-_the_libre_beat_em_up_game/scripts/bola/motion/motion.lua')
-rw-r--r--src/gnu_and_bola_-_the_libre_beat_em_up_game/scripts/bola/motion/motion.lua7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/gnu_and_bola_-_the_libre_beat_em_up_game/scripts/bola/motion/motion.lua b/src/gnu_and_bola_-_the_libre_beat_em_up_game/scripts/bola/motion/motion.lua
index 2da8f69..89d3832 100644
--- a/src/gnu_and_bola_-_the_libre_beat_em_up_game/scripts/bola/motion/motion.lua
+++ b/src/gnu_and_bola_-_the_libre_beat_em_up_game/scripts/bola/motion/motion.lua
@@ -1,7 +1,7 @@
local motionModule = {}
function motionModule.motion(dt)
- if love.keyboard.isScancodeDown(button.a) then
+ if character.bola.jump.higher > 0 and love.keyboard.isScancodeDown(button.a) then
jump(dt)
end
if love.keyboard.isScancodeDown(button.left) then
@@ -12,9 +12,8 @@ function motionModule.motion(dt)
end
function jump(dt)
- if character.bola.jump.velocity == 0 then
- character.bola.jump.velocity = character.bola.jump.height
- end
+ 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)]
end