diff options
Diffstat (limited to 'src/gnu_and_bola_-_the_libre_beat_em_up_game/scripts/bola/motion/motion.lua')
-rw-r--r-- | src/gnu_and_bola_-_the_libre_beat_em_up_game/scripts/bola/motion/motion.lua | 138 |
1 files changed, 138 insertions, 0 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 new file mode 100644 index 0000000..355e09a --- /dev/null +++ b/src/gnu_and_bola_-_the_libre_beat_em_up_game/scripts/bola/motion/motion.lua @@ -0,0 +1,138 @@ +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 + 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 + 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 + end + + quad = { + bola = character.bola.jump[math.floor(character.bola.jump.start)] + } +end + +function walkLeft(dt) + if character.bola.position.x >= character.bola.origin.x then + character.bola.position.x = character.bola.position.x - (character.bola.velocity * dt) + end + quad = { + bola = character.bola.walk[math.floor(character.bola.walk.start)] + } + character.bola.scale.x = -1 +end + +function walkRight(dt) + if character.bola.position.x <= windowProfile.mode.width - character.bola.origin.x then + character.bola.position.x = character.bola.position.x + (character.bola.velocity * dt) + end + quad = { + bola = character.bola.walk[math.floor(character.bola.walk.start)] + } + character.bola.scale.x = 1 +end + +function stand(dt) + quad = { + bola = character.bola.stand[math.floor(character.bola.stand.start)] + } +end + +return motionModule |