diff options
Diffstat (limited to 'src/gnu_and_bola_-_the_libre_beat_em_up_game/scripts/game/animation.lua')
-rw-r--r-- | src/gnu_and_bola_-_the_libre_beat_em_up_game/scripts/game/animation.lua | 48 |
1 files changed, 0 insertions, 48 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 |