diff options
author | Jorge Lopez Seijas <jorginho@riseup.net> | 2016-12-15 23:15:54 +0100 |
---|---|---|
committer | Jorge Lopez Seijas <jorginho@riseup.net> | 2016-12-15 23:15:54 +0100 |
commit | 3d55fcfc58aa5b2c28be476d45745e0f9b70e51e (patch) | |
tree | bd5dcae0d91dbda083c216aa8ae3dea840047f30 /src | |
parent | 467bb5de52c8c8e39429b52f76c8106fe6d57c20 (diff) |
Made generic function update.animation(...)
Diffstat (limited to 'src')
-rw-r--r-- | src/gnu_and_bola_brawlers/update/default.lua | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/gnu_and_bola_brawlers/update/default.lua b/src/gnu_and_bola_brawlers/update/default.lua index f6fb68e..064f7d0 100644 --- a/src/gnu_and_bola_brawlers/update/default.lua +++ b/src/gnu_and_bola_brawlers/update/default.lua @@ -31,35 +31,35 @@ update.motion = function(character, images, metaSprite, dt) end if character.actionLeft == true and character.actionRight == false then - metaSprite = require 'meta_sprites/bola/walk' + metaSprite = character.walk character.position.x = character.position.x - (character.velocity * dt) character.scale.x = -1 end if character.actionRight == true and character.actionLeft == false then - metaSprite = require 'meta_sprites/bola/walk' + metaSprite = character.walk character.position.x = character.position.x + (character.velocity * dt) character.scale.x = 1 end if character.actionUp == true and character.actionDown == false then - metaSprite = require 'meta_sprites/bola/walk' + metaSprite = character.walk 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 - metaSprite = require 'meta_sprites/bola/walk' + metaSprite = character.walk 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 - metaSprite = require 'meta_sprites/bola/stand' + metaSprite = character.stand elseif character.actionLeft == true and character.actionRight == true then - metaSprite = require 'meta_sprites/bola/stand' + metaSprite = character.stand elseif character.actionLeft == false and character.actionRight == false and character.actionUp == false and character.actionDown == false then - metaSprite = require 'meta_sprites/bola/stand' + metaSprite = character.stand end return metaSprite |