diff options
author | André Fabian Silva Delgado <emulatorman@parabola.nu> | 2016-12-04 13:37:45 -0300 |
---|---|---|
committer | André Fabian Silva Delgado <emulatorman@parabola.nu> | 2016-12-04 15:35:51 -0300 |
commit | 1e0b3afcb1074f7ca6a52ec1c3aefb76b8d2c08d (patch) | |
tree | 7968f4d186273fc31a302ecbb26a114de61fd29e /src/gnu_and_bola_-_the_libre_beat_em_up_game/scripts/update | |
parent | be92c47794d735812daca917fb1ff6b0d621f948 (diff) |
Keep the code more KISS - part 6
Diffstat (limited to 'src/gnu_and_bola_-_the_libre_beat_em_up_game/scripts/update')
8 files changed, 6 insertions, 71 deletions
diff --git a/src/gnu_and_bola_-_the_libre_beat_em_up_game/scripts/update/default.lua b/src/gnu_and_bola_-_the_libre_beat_em_up_game/scripts/update/default.lua index 877b60f..de1592f 100644 --- a/src/gnu_and_bola_-_the_libre_beat_em_up_game/scripts/update/default.lua +++ b/src/gnu_and_bola_-_the_libre_beat_em_up_game/scripts/update/default.lua @@ -1,6 +1,11 @@ +require 'scripts.update.fps' +require 'scripts.game.motion' +require 'scripts.update.gravity' +require 'scripts.update.limit' + main.update = function(dt) update.fps() - update.motion(dt) + game.motion(metaSprites.bola, character.bola, dt) update.gravity(dt) update.limit(dt) end diff --git a/src/gnu_and_bola_-_the_libre_beat_em_up_game/scripts/update/motion/default.lua b/src/gnu_and_bola_-_the_libre_beat_em_up_game/scripts/update/motion/default.lua deleted file mode 100644 index d260891..0000000 --- a/src/gnu_and_bola_-_the_libre_beat_em_up_game/scripts/update/motion/default.lua +++ /dev/null @@ -1,32 +0,0 @@ -update.motion = function(dt) - game.animation(character.bola.stand, dt) - metaSprites.bola.quad = character.bola.stand[character.bola.stand.currentFrame] - - if character.bola.jump.higher > 0 and character.bola.actionA == true then - jump(dt) - end - - if character.bola.actionLeft == true and character.bola.actionRight == false then - walkLeft(dt) - end - - if character.bola.actionRight == true and character.bola.actionLeft == false then - walkRight(dt) - end - - if character.bola.actionLeft == true and character.bola.actionRight == true then - stand(dt) - end - - if character.bola.actionUp == true and character.bola.actionDown == false then - walkUp(dt) - end - - if character.bola.actionDown == true and character.bola.actionUp == false then - walkDown(dt) - end - - if character.bola.actionUp == true and character.bola.actionDown == true then - stand(dt) - end -end diff --git a/src/gnu_and_bola_-_the_libre_beat_em_up_game/scripts/update/motion/jump.lua b/src/gnu_and_bola_-_the_libre_beat_em_up_game/scripts/update/motion/jump.lua deleted file mode 100644 index 1005a53..0000000 --- a/src/gnu_and_bola_-_the_libre_beat_em_up_game/scripts/update/motion/jump.lua +++ /dev/null @@ -1,9 +0,0 @@ -function jump(dt) - if character.bola.jump.limitButtonJump == false then - 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) - - -- game.animation(character.bola.jump, dt) - -- metaSprites.bola.quad = character.bola.jump[character.bola.jump.currentFrame] - end -end diff --git a/src/gnu_and_bola_-_the_libre_beat_em_up_game/scripts/update/motion/stand.lua b/src/gnu_and_bola_-_the_libre_beat_em_up_game/scripts/update/motion/stand.lua deleted file mode 100644 index 04010ce..0000000 --- a/src/gnu_and_bola_-_the_libre_beat_em_up_game/scripts/update/motion/stand.lua +++ /dev/null @@ -1,4 +0,0 @@ -function stand(dt) - game.animation(character.bola.stand, dt) - metaSprites.bola.quad = character.bola.stand[character.bola.stand.currentFrame] -end diff --git a/src/gnu_and_bola_-_the_libre_beat_em_up_game/scripts/update/motion/walk_down.lua b/src/gnu_and_bola_-_the_libre_beat_em_up_game/scripts/update/motion/walk_down.lua deleted file mode 100644 index ba393c7..0000000 --- a/src/gnu_and_bola_-_the_libre_beat_em_up_game/scripts/update/motion/walk_down.lua +++ /dev/null @@ -1,6 +0,0 @@ -function walkDown(dt) - character.bola.position.y = character.bola.position.y + (character.bola.velocity * dt) - character.bola.jump.ground = character.bola.position.y - game.animation(character.bola.walk, dt) - metaSprites.bola.quad = character.bola.walk[character.bola.walk.currentFrame] -end diff --git a/src/gnu_and_bola_-_the_libre_beat_em_up_game/scripts/update/motion/walk_left.lua b/src/gnu_and_bola_-_the_libre_beat_em_up_game/scripts/update/motion/walk_left.lua deleted file mode 100644 index 17f31f3..0000000 --- a/src/gnu_and_bola_-_the_libre_beat_em_up_game/scripts/update/motion/walk_left.lua +++ /dev/null @@ -1,6 +0,0 @@ -function walkLeft(dt) - character.bola.position.x = character.bola.position.x - (character.bola.velocity * dt) - game.animation(character.bola.walk, dt) - metaSprites.bola.quad = character.bola.walk[character.bola.walk.currentFrame] - character.bola.scale.x = -1 -end diff --git a/src/gnu_and_bola_-_the_libre_beat_em_up_game/scripts/update/motion/walk_right.lua b/src/gnu_and_bola_-_the_libre_beat_em_up_game/scripts/update/motion/walk_right.lua deleted file mode 100644 index 712c680..0000000 --- a/src/gnu_and_bola_-_the_libre_beat_em_up_game/scripts/update/motion/walk_right.lua +++ /dev/null @@ -1,7 +0,0 @@ -function walkRight(dt) - character.bola.position.x = character.bola.position.x + (character.bola.velocity * dt) - game.animation(character.bola.walk, dt) - metaSprites.bola.quad = character.bola.walk[character.bola.walk.currentFrame] - character.bola.scale.x = 1 -end - diff --git a/src/gnu_and_bola_-_the_libre_beat_em_up_game/scripts/update/motion/walk_up.lua b/src/gnu_and_bola_-_the_libre_beat_em_up_game/scripts/update/motion/walk_up.lua deleted file mode 100644 index a8bd29b..0000000 --- a/src/gnu_and_bola_-_the_libre_beat_em_up_game/scripts/update/motion/walk_up.lua +++ /dev/null @@ -1,6 +0,0 @@ -function walkUp(dt) - character.bola.position.y = character.bola.position.y - (character.bola.velocity * dt) - character.bola.jump.ground = character.bola.position.y - game.animation(character.bola.walk, dt) - metaSprites.bola.quad = character.bola.walk[character.bola.walk.currentFrame] -end |