From 0ebd8cbf7f022d769274af2dab6bab4a76df8c13 Mon Sep 17 00:00:00 2001 From: Jorge Lopez Seijas Date: Tue, 13 Dec 2016 22:42:45 +0100 Subject: Revert "Clean code" This reverts commit 5f53bd113305885017b5a8b95d72f66b0612dbba. --- .../main.lua | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/gnu_and_bola_-_the_libre_beat_em_up_game/main.lua b/src/gnu_and_bola_-_the_libre_beat_em_up_game/main.lua index b966c71..fff4f5d 100644 --- a/src/gnu_and_bola_-_the_libre_beat_em_up_game/main.lua +++ b/src/gnu_and_bola_-_the_libre_beat_em_up_game/main.lua @@ -155,17 +155,17 @@ function love.update(dt) if sprite.elapsedTime >= (1 / sprite.fps) then sprite.elapsedTime = sprite.elapsedTime - (1 / sprite.fps) if sprite.currentFrame == # sprite then --If current frame is equal to long sprite list - sprite.currentFrame = 1 --Return to first frame + sprite.currentFrame = 1 -- Return to first frame else sprite.currentFrame = sprite.currentFrame + 1 --Next frame end end - metaSprites.quad = sprite[sprite.currentFrame] --Update with new frame + metaSprites.quad = sprite[sprite.currentFrame] --Update with new fame end animation(sprite.bola, metaSprites.bola, dt) - motion = function(character, metaSprites, sprite, dt) + motion = function(character, metaSprites, dt) if character.jump.higher > 0 and character.actionA == true then if character.jump.limitButtonJump == false then character.jump.higher = character.jump.higher - dt @@ -174,38 +174,38 @@ function love.update(dt) end if character.actionLeft == true and character.actionRight == false then - sprite = require 'walk' + sprite.bola = require 'walk' character.position.x = character.position.x - (character.velocity * dt) character.scale.x = -1 end if character.actionRight == true and character.actionLeft == false then - sprite = require 'walk' + sprite.bola = require 'walk' character.position.x = character.position.x + (character.velocity * dt) character.scale.x = 1 end if character.actionUp == true and character.actionDown == false then - sprite = require 'walk' + sprite.bola = require '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 - sprite = require 'walk' + sprite.bola = require '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 - sprite = require 'stand' + sprite.bola = require 'stand' elseif character.actionLeft == true and character.actionRight == true then - sprite = require 'stand' + sprite.bola = require 'stand' elseif character.actionLeft == false and character.actionRight == false and character.actionUp == false and character.actionDown == false then - sprite = require 'stand' + sprite.bola = require 'stand' end end - motion(character.bola, metaSprites.bola, sprite.bola, dt) + motion(character.bola, metaSprites.bola, dt) gravity = function(character, dt) if character.jump.velocity ~= 0 then -- cgit v1.2.3-54-g00ecf