diff options
author | coadde [Márcio Alexandre Silva Delgado] <coadde@parabola.nu> | 2016-12-01 19:49:21 -0300 |
---|---|---|
committer | coadde [Márcio Alexandre Silva Delgado] <coadde@parabola.nu> | 2016-12-01 19:53:38 -0300 |
commit | 4c2c9a5b98804b3a676b6d72a7ac07b08a58b36a (patch) | |
tree | 20bb45ce98cc22450db256ec4dabbfb561969438 /src/gnu_and_bola_-_the_libre_beat_em_up_game/scripts/bola/motion.lua | |
parent | 80875485a285be0f44727adfc55999c8989dec04 (diff) |
Minor fix in game.animation(), but needs fix animation to start in the first frame
Diffstat (limited to 'src/gnu_and_bola_-_the_libre_beat_em_up_game/scripts/bola/motion.lua')
-rw-r--r-- | src/gnu_and_bola_-_the_libre_beat_em_up_game/scripts/bola/motion.lua | 7 |
1 files changed, 6 insertions, 1 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 3b807a6..2cf232a 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 @@ -27,18 +27,21 @@ function jump(dt) character.bola.jump.higher = character.bola.jump.higher - dt character.bola.jump.velocity = character.bola.jump.velocity + character.bola.jump.height * (dt / character.bola.jump.higherMax) - -- quad.bola = character.bola.jump[math.floor(character.bola.jump.start)] + -- character.bola.jump.start = game.animation(character.bola.jump.start, character.bola.jump.fps, frames.bola.jump, 0) + -- quad.bola = character.bola.jump[math.floor(character.bola.jump.start)] end end function walkLeft(dt) character.bola.position.x = character.bola.position.x - (character.bola.velocity * dt) + character.bola.walk.start = game.animation(character.bola.walk.start, character.bola.walk.fps, frames.bola.walk, -1) quad.bola = character.bola.walk[math.floor(character.bola.walk.start)] character.bola.scale.x = -1 end function walkRight(dt) character.bola.position.x = character.bola.position.x + (character.bola.velocity * dt) + character.bola.walk.start = game.animation(character.bola.walk.start, character.bola.walk.fps, frames.bola.walk, -1) quad.bola = character.bola.walk[math.floor(character.bola.walk.start)] character.bola.scale.x = 1 end @@ -46,12 +49,14 @@ end function walkUp(dt) character.bola.position.y = character.bola.position.y - (character.bola.velocity * dt) character.bola.jump.ground = character.bola.position.y + character.bola.walk.start = game.animation(character.bola.walk.start, character.bola.walk.fps, frames.bola.walk, -1) quad.bola = character.bola.walk[math.floor(character.bola.walk.start)] end function walkDown(dt) character.bola.position.y = character.bola.position.y + (character.bola.velocity * dt) character.bola.jump.ground = character.bola.position.y + character.bola.walk.start = game.animation(character.bola.walk.start, character.bola.walk.fps, frames.bola.walk, -1) quad.bola = character.bola.walk[math.floor(character.bola.walk.start)] end |