summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndré Fabian Silva Delgado <emulatorman@parabola.nu>2016-12-13 18:29:16 -0300
committerAndré Fabian Silva Delgado <emulatorman@parabola.nu>2016-12-13 18:29:16 -0300
commit5f53bd113305885017b5a8b95d72f66b0612dbba (patch)
treeeb54f42d0e61344b4f919904c491a98339a612a1 /src
parent012f66db6d8d01df344b44788aaece7e07ee9be6 (diff)
Clean code
Diffstat (limited to 'src')
-rw-r--r--src/gnu_and_bola_-_the_libre_beat_em_up_game/main.lua22
1 files 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 fff4f5d..b966c71 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 fame
+ metaSprites.quad = sprite[sprite.currentFrame] --Update with new frame
end
animation(sprite.bola, metaSprites.bola, dt)
- motion = function(character, metaSprites, dt)
+ motion = function(character, metaSprites, sprite, 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.bola = require 'walk'
+ sprite = 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.bola = require 'walk'
+ sprite = 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.bola = require 'walk'
+ sprite = 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.bola = require 'walk'
+ sprite = 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.bola = require 'stand'
+ sprite = require 'stand'
elseif character.actionLeft == true and character.actionRight == true then
- sprite.bola = require 'stand'
+ sprite = require 'stand'
elseif character.actionLeft == false and character.actionRight == false and character.actionUp == false and character.actionDown == false then
- sprite.bola = require 'stand'
+ sprite = require 'stand'
end
end
- motion(character.bola, metaSprites.bola, dt)
+ motion(character.bola, metaSprites.bola, sprite.bola, dt)
gravity = function(character, dt)
if character.jump.velocity ~= 0 then