From 003bb2b3f5a6ba2fb8b0b09c3e9f1f1c3cd4c452 Mon Sep 17 00:00:00 2001 From: "coadde [Márcio Alexandre Silva Delgado]" Date: Thu, 24 Nov 2016 15:27:16 -0300 Subject: Add more extra functions --- .../scripts/bola/motion.lua | 84 ++++++++++++++++++---- 1 file 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 -- cgit v1.2.3-54-g00ecf