diff options
author | coadde [Márcio Alexandre Silva Delgado] <coadde@parabola.nu> | 2016-11-21 23:23:52 -0300 |
---|---|---|
committer | coadde [Márcio Alexandre Silva Delgado] <coadde@parabola.nu> | 2016-11-21 23:23:52 -0300 |
commit | e05c0137e0d03187b857b36c6b2abb4f041205cc (patch) | |
tree | f087613f58da3520691531707a4423aeeec3a0f9 | |
parent | fd319e82d87f2d2af013b0c9ba39069819b412f8 (diff) |
Minor fix on window collisions
-rw-r--r-- | test0/main.lua | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/test0/main.lua b/test0/main.lua index cb1fbfd..461137d 100644 --- a/test0/main.lua +++ b/test0/main.lua @@ -191,27 +191,27 @@ function love.update(dt) } if love.keyboard.isDown(button.left) then + character.bola.acceleration = character.bola.acceleration + dt if character.bola.position.x >= character.bola.origin.x then - character.bola.acceleration = character.bola.acceleration + dt if character.bola.acceleration < 3 then character.bola.position.x = character.bola.position.x - (character.bola.speed * dt) - character.bola.acceleration else character.bola.position.x = character.bola.position.x - (character.bola.speed * dt) - 3 end - quad = character.bola.spriteWalk[animation.bola.spriteWalk] - character.bola.scale.x = -1 end + quad = character.bola.spriteWalk[animation.bola.spriteWalk] + character.bola.scale.x = -1 elseif love.keyboard.isDown(button.right) then + character.bola.acceleration = character.bola.acceleration + dt if character.bola.position.x <= windowProfile.mode.width - character.bola.origin.x then - character.bola.acceleration = character.bola.acceleration + dt if character.bola.acceleration < 3 then character.bola.position.x = character.bola.position.x + (character.bola.speed * dt) + character.bola.acceleration else character.bola.position.x = character.bola.position.x + (character.bola.speed * dt) + 3 end - quad = character.bola.spriteWalk[animation.bola.spriteWalk] - character.bola.scale.x = 1 end + quad = character.bola.spriteWalk[animation.bola.spriteWalk] + character.bola.scale.x = 1 elseif love.keyboard.isDown(button.down) then character.bola.acceleration = 0 transform.bola.origin.y = character.bola.origin.y - character.bola.origin.y |