diff options
Diffstat (limited to 'src/gnu_and_bola_-_the_libre_beat_em_up_game/scripts/game')
7 files changed, 0 insertions, 227 deletions
diff --git a/src/gnu_and_bola_-_the_libre_beat_em_up_game/scripts/game/animation.lua b/src/gnu_and_bola_-_the_libre_beat_em_up_game/scripts/game/animation.lua deleted file mode 100644 index 655d1a4..0000000 --- a/src/gnu_and_bola_-_the_libre_beat_em_up_game/scripts/game/animation.lua +++ /dev/null @@ -1,48 +0,0 @@ -game.animation = function(character, dt) - local frameStart = function() - character.currentFrame = 1 - end - local frameCounter = function() - character.currentFrame = character.currentFrame + 1 - end - local animationStart = function() - character.elapsedTime = character.elapsedTime + dt - end - local animationCounter = function(value) - if character.elapsedTime >= (1 / character.fps) then - character.elapsedTime = character.elapsedTime - (1 / character.fps) - if character.currentFrame == # character then - frameStart() - if value == 'start' then - loopCounter = 1 - elseif value == 'counter' then - loopCounter = loopCounter + 1 - end - else - frameCounter() - end - end - end - local animationEnd = function() - character.elapsedTime = 0 - end - - if type(character.loop) == 'number' and character.loop > 0 then - if loopCounter == nil then - animationStart() - animationCounter('start') - elseif loopCounter < character.loop then - animationStart() - animationCounter('counter') - else - animationEnd() - frameStart() - end - elseif character.loop == 0 or character.loop == false then - animationEnd() - frameStart() - elseif character.loop == -1 or character.loop == true then - animationStart() - animationCounter() - end -end diff --git a/src/gnu_and_bola_-_the_libre_beat_em_up_game/scripts/game/draw.lua b/src/gnu_and_bola_-_the_libre_beat_em_up_game/scripts/game/draw.lua deleted file mode 100644 index 0e0b603..0000000 --- a/src/gnu_and_bola_-_the_libre_beat_em_up_game/scripts/game/draw.lua +++ /dev/null @@ -1,13 +0,0 @@ -game.draw = function(metaSprites, character) - love.graphics.draw( - metaSprites.image, - metaSprites.quad, - character.position.x, - character.position.y, - character.orientation, - character.scale.x, - character.scale.y, - character.origin.x, - character.origin.y - ) -end diff --git a/src/gnu_and_bola_-_the_libre_beat_em_up_game/scripts/game/gravity.lua b/src/gnu_and_bola_-_the_libre_beat_em_up_game/scripts/game/gravity.lua deleted file mode 100644 index 42fd2d9..0000000 --- a/src/gnu_and_bola_-_the_libre_beat_em_up_game/scripts/game/gravity.lua +++ /dev/null @@ -1,23 +0,0 @@ -game.gravity = function(character, dt) - if character.jump.velocity ~= 0 then - character.jump.isJumping = true - character.position.y = character.position.y + (character.jump.velocity * dt) - character.jump.velocity = character.jump.velocity - (character.gravity * dt) - end - - if character.position.y > character.jump.ground then - character.jump.velocity = 0 - character.position.y = character.jump.ground - character.jump.higher = character.jump.higherMax - - character.jump.limitButtonJump = false - character.jump.isJumping = false - character.actionA = false - - if love.keyboard.isScancodeDown(button.up) then - character.actionUp = true - elseif love.keyboard.isScancodeDown(button.down) then - character.actionDown = true - end - end -end diff --git a/src/gnu_and_bola_-_the_libre_beat_em_up_game/scripts/game/keypressed.lua b/src/gnu_and_bola_-_the_libre_beat_em_up_game/scripts/game/keypressed.lua deleted file mode 100644 index 1035b05..0000000 --- a/src/gnu_and_bola_-_the_libre_beat_em_up_game/scripts/game/keypressed.lua +++ /dev/null @@ -1,29 +0,0 @@ -game.keypressed = function(character, key, scancode, isrepeat) - isrepeat = true - - if scancode == button.quit then - love.event.quit() - end - - if scancode == button.a then - character.actionA = true - character.actionDown = false - character.actionUp = false - end - - if scancode == button.left then - character.actionLeft = true - end - - if scancode == button.right then - character.actionRight = true - end - - if scancode == button.up and character.jump.isJumping == false then - character.actionUp = true - end - - if scancode == button.down and character.jump.isJumping == false then - character.actionDown = true - end -end diff --git a/src/gnu_and_bola_-_the_libre_beat_em_up_game/scripts/game/keyreleased.lua b/src/gnu_and_bola_-_the_libre_beat_em_up_game/scripts/game/keyreleased.lua deleted file mode 100644 index fef6cf2..0000000 --- a/src/gnu_and_bola_-_the_libre_beat_em_up_game/scripts/game/keyreleased.lua +++ /dev/null @@ -1,33 +0,0 @@ -game.keyreleased = function(character, key, scancode) - if scancode == button.a then - character.actionA = false - end - - if scancode == button.left then - character.actionLeft = false - end - - if scancode == button.right then - character.actionRight = false - end - - if scancode == button.up then - character.actionUp = false - end - - if scancode == button.down then - character.actionDown = false - end - - if scancode == button.b then - character.actionB = false - end - - if scancode == button.a then - character.actionA = false - - if character.jump.velocity ~= 0 then - character.jump.limitButtonJump = true - end - end -end diff --git a/src/gnu_and_bola_-_the_libre_beat_em_up_game/scripts/game/limit.lua b/src/gnu_and_bola_-_the_libre_beat_em_up_game/scripts/game/limit.lua deleted file mode 100644 index 4cd94f2..0000000 --- a/src/gnu_and_bola_-_the_libre_beat_em_up_game/scripts/game/limit.lua +++ /dev/null @@ -1,13 +0,0 @@ -game.limit = function(character, dt) - if character.position.x <= character.origin.x then - character.position.x = character.origin.x - elseif character.position.x >= windowProfile.mode.width - character.origin.x then - character.position.x = windowProfile.mode.width - character.origin.x - end - - if character.position.y <= character.origin.y then - character.position.y = character.origin.y - elseif character.position.y >= windowProfile.mode.height - character.origin.y then - character.position.y = windowProfile.mode.height - character.origin.y - end -end diff --git a/src/gnu_and_bola_-_the_libre_beat_em_up_game/scripts/game/motion.lua b/src/gnu_and_bola_-_the_libre_beat_em_up_game/scripts/game/motion.lua deleted file mode 100644 index c43db43..0000000 --- a/src/gnu_and_bola_-_the_libre_beat_em_up_game/scripts/game/motion.lua +++ /dev/null @@ -1,68 +0,0 @@ -require 'scripts.game.animation' - -game.motion = function(metaSprites, character, dt) - game.animation(character.stand, dt) - metaSprites.quad = character.stand[character.stand.currentFrame] - - if character.jump.higher > 0 and character.actionA == true then - if character.jump.limitButtonJump == false then ---[[ - game.animation(character.jump, dt) - metaSprites.quad = character.jump[character.jump.currentFrame] -]] - - character.jump.higher = character.jump.higher - dt - character.jump.velocity = character.jump.velocity + character.jump.height * (dt / character.jump.higherMax) - end - end - - if character.actionLeft == true and character.actionRight == false then - if character.actionUp == false and character.actionDown == false then - game.animation(character.walk, dt) - metaSprites.quad = character.walk[character.walk.currentFrame] - end - - character.position.x = character.position.x - (character.velocity * dt) - character.scale.x = -1 - end - - if character.actionRight == true and character.actionLeft == false then - if character.actionUp == false and character.actionDown == false then - game.animation(character.walk, dt) - metaSprites.quad = character.walk[character.walk.currentFrame] - end - - character.position.x = character.position.x + (character.velocity * dt) - character.scale.x = 1 - end - - if character.actionLeft == true and character.actionRight == true then - game.animation(character.stand, dt) - metaSprites.quad = character.stand[character.stand.currentFrame] - end - - if character.actionUp == true and character.actionDown == false then - game.animation(character.walk, dt) - metaSprites.quad = character.walk[character.walk.currentFrame] - - character.position.y = character.position.y - (character.velocity * dt) - character.jump.ground = character.position.y - end - - if character.actionDown == true and character.actionUp == false then - game.animation(character.walk, dt) - metaSprites.quad = character.walk[character.walk.currentFrame] - - character.position.y = character.position.y + (character.velocity * dt) - character.jump.ground = character.position.y - end - - if character.actionUp == true and character.actionDown == true then - game.animation(character.stand, dt) - metaSprites.quad = character.stand[character.stand.currentFrame] - if character.actionLeft == true then - end - if character.actionRight == true then - end - end -end |