summaryrefslogtreecommitdiff
path: root/src/gnu_and_bola_-_the_libre_beat_em_up_game/scripts/keypressed/default.lua
diff options
context:
space:
mode:
authorcoadde [Márcio Alexandre Silva Delgado] <coadde@parabola.nu>2016-12-03 18:39:56 -0300
committercoadde [Márcio Alexandre Silva Delgado] <coadde@parabola.nu>2016-12-03 18:39:56 -0300
commitef5bce4721d1307200b1335565303a7832f77535 (patch)
treef1840a3e31dcf4cda066d5f377edb4ff2af31622 /src/gnu_and_bola_-_the_libre_beat_em_up_game/scripts/keypressed/default.lua
parent1a9e17acb3a65a98305d19363f6b4e7185356c74 (diff)
Keep the code more KISS - part 2
Diffstat (limited to 'src/gnu_and_bola_-_the_libre_beat_em_up_game/scripts/keypressed/default.lua')
-rw-r--r--src/gnu_and_bola_-_the_libre_beat_em_up_game/scripts/keypressed/default.lua29
1 files changed, 29 insertions, 0 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
new file mode 100644
index 0000000..ccf4d3b
--- /dev/null
+++ b/src/gnu_and_bola_-_the_libre_beat_em_up_game/scripts/keypressed/default.lua
@@ -0,0 +1,29 @@
+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
+
+ 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
+end