From a84f3ca830c31e5a5977ef7bf2a80fab2f4c11c7 Mon Sep 17 00:00:00 2001 From: bucketh3ad Date: Wed, 10 Jun 2015 23:12:58 -0600 Subject: [PATCH 1/2] Fix damage text --- src/player.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/player.lua b/src/player.lua index 546d4d095..0b29db0e9 100644 --- a/src/player.lua +++ b/src/player.lua @@ -830,9 +830,9 @@ function Player:draw() self.currently_held:draw() end - local health = math.ceil(self.damageTaken * -1 / 10) - - if self.rebounding and self.damageTaken > 0 then + if self.rebounding then + local health = self.damageTaken + if health > 0 then health = health * -1 end love.graphics.setColor( 255, 0, 0, 255 ) love.graphics.print(health, self.healthText.x, self.healthText.y, 0, 0.7, 0.7) end From 9972cf63185536c7738239f64f53c7ad661ff7b6 Mon Sep 17 00:00:00 2001 From: bucketh3ad Date: Wed, 10 Jun 2015 23:41:04 -0600 Subject: [PATCH 2/2] Fix damage text duration --- src/player.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/player.lua b/src/player.lua index 0b29db0e9..002360180 100644 --- a/src/player.lua +++ b/src/player.lua @@ -637,6 +637,7 @@ function Player:hurt(damage) sound.playSfx( "damage" ) self.rebounding = true self.invulnerable = true + self.showDamageText = true local color = self.color self.color = {255, 0, 0, 255} @@ -664,6 +665,7 @@ function Player:hurt(damage) Timer.add(1.5, function() self.invulnerable = false self.rebounding = false + self.showDamageText = false self.color = color end) @@ -830,7 +832,7 @@ function Player:draw() self.currently_held:draw() end - if self.rebounding then + if self.showDamageText then local health = self.damageTaken if health > 0 then health = health * -1 end love.graphics.setColor( 255, 0, 0, 255 )