summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcoadde [Márcio Alexandre Silva Delgado] <coadde@parabola.nu>2016-11-26 12:14:43 -0300
committercoadde [Márcio Alexandre Silva Delgado] <coadde@parabola.nu>2016-11-26 12:16:00 -0300
commit92c07997b40551a7cbdb91b48ff40829e6eece26 (patch)
tree88c20456333c364082d4c975becfc17ea3c0d483
parenta823e60d78dafcc177604976dfb9753a84950b33 (diff)
Replace *.isDown() to *.isScancodeDown(), rm extra functions and fix jumping movement when jump button is pressed
-rw-r--r--src/gnu_and_bola_-_the_libre_beat_em_up_game/scripts/bola/motion/motion.lua96
1 files changed, 6 insertions, 90 deletions
diff --git a/src/gnu_and_bola_-_the_libre_beat_em_up_game/scripts/bola/motion/motion.lua b/src/gnu_and_bola_-_the_libre_beat_em_up_game/scripts/bola/motion/motion.lua
index 355e09a..89bc2e9 100644
--- a/src/gnu_and_bola_-_the_libre_beat_em_up_game/scripts/bola/motion/motion.lua
+++ b/src/gnu_and_bola_-_the_libre_beat_em_up_game/scripts/bola/motion/motion.lua
@@ -1,104 +1,20 @@
local motionModule = {}
-menu = false
-
function motionModule.motion(dt)
- if love.keyboard.isDown(button.start) then
- if menu == true then
- accept(dt)
- elseif menu == false then
- pause(dt)
- end
- elseif love.keyboard.isDown(button.select) then
- if arcade == true then
- coin(dt)
- elseif arcade == false then
- if menu == true then
- select(dt)
- end
- end
- elseif love.keyboard.isDown(button.a) then
- if menu == true then
- accept(dt)
- elseif menu == false then
+ if love.keyboard.isScancodeDown(button.a, button.left, button.right) then
+ if love.keyboard.isScancodeDown(button.a) then
jump(dt)
end
- elseif love.keyboard.isDown(button.b) then
- if menu == true then
- if acceptOnly == true then
- accept(dt)
- elseif acceptOnly == false then
- if gameContinue == true then
- dropContinueCount(dt)
- elseif gameContinue == false then
- cancel(dt)
- end
- end
- elseif menu == false then
- if ground == true then
- hitGround(dt)
- elseif ground == false then
- hitAir(dt)
- end
- end
- elseif love.keyboard.isDown(button.left, button.right) then
- if menu == true then
- if love.keyboard.isDown(button.left) then
- selectLeft(dt)
- elseif love.keyboard.isScancodeDown(button.right) then
- selectRight(dt)
- end
- elseif menu == false then
- if love.keyboard.isDown(button.left) then
- walkLeft(dt)
- elseif love.keyboard.isScancodeDown(button.right) then
- walkRight(dt)
- end
+ if love.keyboard.isScancodeDown(button.left) then
+ walkLeft(dt)
+ elseif love.keyboard.isScancodeDown(button.right) then
+ walkRight(dt)
end
else
stand(dt)
end
end
-function configuration(dt)
-end
-
-function coin(dt)
-end
-
-function accept(dt)
-end
-
-function cancel(dt)
-end
-
-function select(dt)
-end
-
-function dropContinueCount(dt)
-end
-
-function pause(dt)
-end
-
-function hitGround(dt)
-end
-
-function hitAir(dt)
-end
-
-function selectLeft(dt)
-end
-
-function selectRight(dt)
-end
-
-function selectUp(dt)
-end
-
-function selectDown(dt)
-end
-
function jump(dt)
if character.bola.jump.velocity == 0 then
character.bola.jump.velocity = character.bola.jump.height