summaryrefslogtreecommitdiff
path: root/src/gnu_and_bola_-_the_libre_beat_em_up_game/scripts/keypressed
diff options
context:
space:
mode:
authorAndré Fabian Silva Delgado <emulatorman@parabola.nu>2016-12-04 13:37:45 -0300
committerAndré Fabian Silva Delgado <emulatorman@parabola.nu>2016-12-04 15:35:51 -0300
commit1e0b3afcb1074f7ca6a52ec1c3aefb76b8d2c08d (patch)
tree7968f4d186273fc31a302ecbb26a114de61fd29e /src/gnu_and_bola_-_the_libre_beat_em_up_game/scripts/keypressed
parentbe92c47794d735812daca917fb1ff6b0d621f948 (diff)
Keep the code more KISS - part 6
Diffstat (limited to 'src/gnu_and_bola_-_the_libre_beat_em_up_game/scripts/keypressed')
-rw-r--r--src/gnu_and_bola_-_the_libre_beat_em_up_game/scripts/keypressed/default.lua30
1 files changed, 3 insertions, 27 deletions
diff --git a/src/gnu_and_bola_-_the_libre_beat_em_up_game/scripts/keypressed/default.lua b/src/gnu_and_bola_-_the_libre_beat_em_up_game/scripts/keypressed/default.lua
index ccf4d3b..f61d64e 100644
--- a/src/gnu_and_bola_-_the_libre_beat_em_up_game/scripts/keypressed/default.lua
+++ b/src/gnu_and_bola_-_the_libre_beat_em_up_game/scripts/keypressed/default.lua
@@ -1,29 +1,5 @@
-main.keypressed = function(key, scancode, isrepeat)
- isrepeat = true
-
- if scancode == button.quit then
- love.event.quit()
- end
-
- if scancode == button.a then
- character.bola.actionA = true
- character.bola.actionDown = false
- character.bola.actionUp = false
- end
-
- if scancode == button.left then
- character.bola.actionLeft = true
- end
+require 'scripts.game.keypressed'
- if scancode == button.right then
- character.bola.actionRight = true
- end
-
- if scancode == button.up and character.bola.jump.isJumping == false then
- character.bola.actionUp = true
- end
-
- if scancode == button.down and character.bola.jump.isJumping == false then
- character.bola.actionDown = true
- end
+main.keypressed = function(key, scancode, isrepeat)
+ game.keypressed(character.bola, key, scancode, isrepeat)
end