diff options
author | coadde [Márcio Alexandre Silva Delgado] <coadde@parabola.nu> | 2016-12-01 02:33:47 -0300 |
---|---|---|
committer | coadde [Márcio Alexandre Silva Delgado] <coadde@parabola.nu> | 2016-12-01 02:33:47 -0300 |
commit | 423af2344d0e26795ce1eb5619888930238bfef3 (patch) | |
tree | e1612bdfe36335336c8df616938f87e928fc9805 /src/gnu_and_bola_-_the_libre_beat_em_up_game/scripts | |
parent | 0244b9e8e673dd8694196220779f7f7fbb9a24ee (diff) |
Replace love.keyboard.isScancodeDown() to love.keypressed() and love.keyreleased()
Diffstat (limited to 'src/gnu_and_bola_-_the_libre_beat_em_up_game/scripts')
-rw-r--r-- | src/gnu_and_bola_-_the_libre_beat_em_up_game/scripts/bola/default.lua | 6 | ||||
-rw-r--r-- | src/gnu_and_bola_-_the_libre_beat_em_up_game/scripts/bola/motion.lua | 15 |
2 files changed, 16 insertions, 5 deletions
diff --git a/src/gnu_and_bola_-_the_libre_beat_em_up_game/scripts/bola/default.lua b/src/gnu_and_bola_-_the_libre_beat_em_up_game/scripts/bola/default.lua index aa04fac..08d7a10 100644 --- a/src/gnu_and_bola_-_the_libre_beat_em_up_game/scripts/bola/default.lua +++ b/src/gnu_and_bola_-_the_libre_beat_em_up_game/scripts/bola/default.lua @@ -10,4 +10,10 @@ return { walk = require 'scripts.bola.walk', run = require 'scripts.bola.run', jump = require 'scripts.bola.jump', + actionLeft = false, + actionRight = false, + actionUp = false, + actionDown = false, + actionA = false, + actionB = false, } 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 0b6ad46..c87b51b 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 @@ -1,20 +1,25 @@ local motionModule = {} function motionModule.motion(dt) - if character.bola.jump.higher > 0 and love.keyboard.isScancodeDown(button.a) then + if character.bola.jump.higher > 0 and character.bola.actionA == true then jump(dt) else character.bola.jump.limitButtonJump = false end - if love.keyboard.isScancodeDown(button.left) then + if character.bola.actionLeft == true then walkLeft(dt) - elseif love.keyboard.isScancodeDown(button.right) then + end + + if character.bola.actionRight == true then walkRight(dt) end - if love.keyboard.isScancodeDown(button.up) then + + if character.bola.actionUp == true then walkUp(dt) - elseif love.keyboard.isScancodeDown(button.down) then + end + + if character.bola.actionDown == true then walkDown(dt) end end |