From c40d8c52960539cd14ba33e68810fbc6a16e7fd4 Mon Sep 17 00:00:00 2001 From: Jorge Lopez Seijas Date: Thu, 15 Dec 2016 20:37:56 +0100 Subject: Keep the code KISS 2 --- src/gnu_and_bola_brawlers/keyreleased/default.lua | 37 +++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 src/gnu_and_bola_brawlers/keyreleased/default.lua (limited to 'src/gnu_and_bola_brawlers/keyreleased/default.lua') diff --git a/src/gnu_and_bola_brawlers/keyreleased/default.lua b/src/gnu_and_bola_brawlers/keyreleased/default.lua new file mode 100644 index 0000000..7295131 --- /dev/null +++ b/src/gnu_and_bola_brawlers/keyreleased/default.lua @@ -0,0 +1,37 @@ +local keyreleased = {} + +keyreleased.trigger = function(character, key, controller, scancode) + if scancode == controller.a then + character.actionA = false + end + + if scancode == controller.left then + character.actionLeft = false + end + + if scancode == controller.right then + character.actionRight = false + end + + if scancode == controller.up then + character.actionUp = false + end + + if scancode == controller.down then + character.actionDown = false + end + + if scancode == controller.b then + character.actionB = false + end + + if scancode == controller.a then + character.actionA = false + + if character.jump.velocity ~= 0 then + character.jump.limitButtonJump = true + end + end +end + +return keyreleased -- cgit v1.2.3-54-g00ecf