diff options
author | André Fabian Silva Delgado <emulatorman@parabola.nu> | 2016-11-23 23:03:47 -0300 |
---|---|---|
committer | André Fabian Silva Delgado <emulatorman@parabola.nu> | 2016-11-23 23:03:47 -0300 |
commit | 06ac50db0f813a2954651600760f6ff30c6fd5d1 (patch) | |
tree | af2d7534985444853b20fc0f5c0f2d0a70ba0a01 /src/gnu_and_bola_-_the_libre_beat_em_up_game/scripts/bola | |
parent | 5a76611deb0b74cba12a108d1786d0e49b36733b (diff) |
Modularize bola animation (bolaAnimation) in scripts/bola/animation.lua
Diffstat (limited to 'src/gnu_and_bola_-_the_libre_beat_em_up_game/scripts/bola')
-rw-r--r-- | src/gnu_and_bola_-_the_libre_beat_em_up_game/scripts/bola/animation.lua | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/gnu_and_bola_-_the_libre_beat_em_up_game/scripts/bola/animation.lua b/src/gnu_and_bola_-_the_libre_beat_em_up_game/scripts/bola/animation.lua new file mode 100644 index 0000000..bd1e8de --- /dev/null +++ b/src/gnu_and_bola_-_the_libre_beat_em_up_game/scripts/bola/animation.lua @@ -0,0 +1,29 @@ +local animationModule = {} + +function animationModule.animation(dt) + character.bola.stand.start = character.bola.stand.start + (dt * character.bola.stand.fps) + character.bola.walk.start = character.bola.walk.start + (dt * character.bola.walk.fps) + + frames = { + bola = require 'scripts.bola.frames' + } + + game = { + animation = function(start, frames) + if math.floor(start) > frames then + start = 1 + end + return start + end + } + + character.bola.stand.start = game.animation(character.bola.stand.start, frames.bola.stand) + character.bola.walk.start = game.animation(character.bola.walk.start, frames.bola.walk) + + transform = { + bola = require 'scripts.bola.transform' + } + +end + +return animationModule |