diff options
author | coadde [Márcio Alexandre Silva Delgado] <coadde@parabola.nu> | 2016-11-24 15:27:16 -0300 |
---|---|---|
committer | coadde [Márcio Alexandre Silva Delgado] <coadde@parabola.nu> | 2016-11-24 15:27:16 -0300 |
commit | 003bb2b3f5a6ba2fb8b0b09c3e9f1f1c3cd4c452 (patch) | |
tree | aaa6408aba4068e81fd61905f39f9936a2a33e21 /src/gnu_and_bola_-_the_libre_beat_em_up_game/scripts | |
parent | 7ad7acfe8f53c518ba161823eb5d9ee94fa16819 (diff) |
Add more extra functions
Diffstat (limited to 'src/gnu_and_bola_-_the_libre_beat_em_up_game/scripts')
-rw-r--r-- | src/gnu_and_bola_-_the_libre_beat_em_up_game/scripts/bola/motion.lua | 84 |
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 |