summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcoadde [Márcio Alexandre Silva Delgado] <coadde@parabola.nu>2016-11-24 15:27:16 -0300
committercoadde [Márcio Alexandre Silva Delgado] <coadde@parabola.nu>2016-11-24 15:42:39 -0300
commite6421b21b5b82e513aea5d731cd7c863c47ea9b4 (patch)
treeb26a9ed91496936bf92d5ac2fb5ea8f35959b0c4
parent217fec034d847efcd591a6cb8442ccf375f4097c (diff)
Add more extra functions
-rw-r--r--src/gnu_and_bola_-_the_libre_beat_em_up_game/scripts/bola/motion.lua84
1 files changed, 70 insertions, 14 deletions
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 c115e29..1aafddd 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,27 +1,68 @@
local motionModule = {}
+menu = false
+
function motionModule.motion(dt)
if love.keyboard.isDown(button.start) then
- walkDown(dt)
+ if menu == true then
+ accept(dt)
+ elseif menu == false then
+ pause(dt)
+ end
elseif love.keyboard.isDown(button.select) then
- walkDown(dt)
+ select(dt)
elseif love.keyboard.isDown(button.a) then
- walkDown(dt)
+ if menu == true then
+ accept(dt)
+ elseif menu == false then
+ if ground == true then
+ jump(dt)
+ end
+ end
elseif love.keyboard.isDown(button.b) then
- walkDown(dt)
- elseif love.keyboard.isDown(button.left, button.right, button.up, button.down) then
- if love.keyboard.isDown(button.left) then
- walkLeft(dt)
- elseif love.keyboard.isScancodeDown(button.right) then
- walkRight(dt)
+ 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
- if love.keyboard.isScancodeDown(button.up) then
- walkUp(dt)
- elseif love.keyboard.isScancodeDown(button.down) then
- walkDown(dt)
+ elseif love.keyboard.isDown(button.left, button.right, button.up, button.down) then
+ if menu == true then
+ if love.keyboard.isDown(button.left) then
+ selectLeft(dt)
+ elseif love.keyboard.isScancodeDown(button.right) then
+ selectRight(dt)
+ end
+ if love.keyboard.isScancodeDown(button.up) then
+ selectUp(dt)
+ elseif love.keyboard.isScancodeDown(button.down) then
+ selectDown(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.up) then
+ walkUp(dt)
+ elseif love.keyboard.isScancodeDown(button.down) then
+ walkDown(dt)
+ end
end
else
- stand(dt)
+ stand(dt)
end
end
@@ -40,6 +81,9 @@ end
function select(dt)
end
+function dropContinueCount(dt)
+end
+
function pause(dt)
end
@@ -52,6 +96,18 @@ end
function hitAir(dt)
end
+function selectLeft(dt)
+end
+
+function selectRight(dt)
+end
+
+function selectUp(dt)
+end
+
+function selectDown(dt)
+end
+
function walkLeft(dt)
character.bola.acceleration = character.bola.acceleration + dt
if character.bola.position.x >= character.bola.origin.x then