From 66076f572c2289d7522f56f864013e9a9d6d8d8d Mon Sep 17 00:00:00 2001 From: Jorge Lopez Seijas Date: Thu, 1 Dec 2016 19:59:55 +0100 Subject: Solved jetpack effect --- src/gnu_and_bola_-_the_libre_beat_em_up_game/main.lua | 8 ++++++++ .../scripts/bola/gravity.lua | 4 +++- .../scripts/bola/motion.lua | 2 -- 3 files changed, 11 insertions(+), 3 deletions(-) (limited to 'src/gnu_and_bola_-_the_libre_beat_em_up_game') diff --git a/src/gnu_and_bola_-_the_libre_beat_em_up_game/main.lua b/src/gnu_and_bola_-_the_libre_beat_em_up_game/main.lua index 409028d..a0eafdb 100644 --- a/src/gnu_and_bola_-_the_libre_beat_em_up_game/main.lua +++ b/src/gnu_and_bola_-_the_libre_beat_em_up_game/main.lua @@ -74,6 +74,14 @@ function love.keyreleased(key, scancode) if scancode == button.b then character.bola.actionB = false end + + if scancode == button.a then + character.bola.actionA = false + + if character.bola.jump.velocity ~= 0 then + character.bola.jump.limitButtonJump = true + end + end end function love.update(dt) diff --git a/src/gnu_and_bola_-_the_libre_beat_em_up_game/scripts/bola/gravity.lua b/src/gnu_and_bola_-_the_libre_beat_em_up_game/scripts/bola/gravity.lua index 9976d48..af8388a 100644 --- a/src/gnu_and_bola_-_the_libre_beat_em_up_game/scripts/bola/gravity.lua +++ b/src/gnu_and_bola_-_the_libre_beat_em_up_game/scripts/bola/gravity.lua @@ -14,7 +14,9 @@ function gravity(dt) character.bola.jump.velocity = 0 character.bola.position.y = character.bola.jump.ground character.bola.jump.higher = character.bola.jump.higherMax - character.bola.jump.limitButtonJump = true + + character.bola.jump.limitButtonJump = false + character.bola.actionA = false end end 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 c87b51b..3b807a6 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,8 +3,6 @@ local motionModule = {} function motionModule.motion(dt) if character.bola.jump.higher > 0 and character.bola.actionA == true then jump(dt) - else - character.bola.jump.limitButtonJump = false end if character.bola.actionLeft == true then -- cgit v1.2.3-54-g00ecf