improvement: add blue-colored damage nbr for pp
This commit is contained in:
parent
4bf4fdb541
commit
3353ae7d37
1 changed files with 7 additions and 2 deletions
|
@ -44,8 +44,9 @@ function Battler:getDamageNumberY()
|
|||
return 32
|
||||
end
|
||||
|
||||
function Battler:setDamageNumber(number)
|
||||
function Battler:setDamageNumber(number, isPP)
|
||||
self.damageNumber.isBad = number < 0
|
||||
self.damageNumber.isPP = (isPP == true)
|
||||
self.damageNumber.num = math.abs(math.floor(number))
|
||||
self.damageY = self:getDamageNumberY() - 8
|
||||
self.tweens:newTween(0, 0.4, {damageY = self:getDamageNumberY()}, "outBack")
|
||||
|
@ -264,7 +265,11 @@ function Battler:drawDamageNumber()
|
|||
if (self.damageNumber.isBad) then
|
||||
love.graphics.setColor(1, 0, 0, 1)
|
||||
else
|
||||
love.graphics.setColor(0, 1, 0, 1)
|
||||
if (self.damageNumber.isPP) then
|
||||
love.graphics.setColor(0.3, 0.8, 1, 1)
|
||||
else
|
||||
love.graphics.setColor(0, 1, 0, 1)
|
||||
end
|
||||
end
|
||||
|
||||
self.assets.fonts["hudnbrs_small"]:print(self.damageNumber.num, x, y - self.damageY, "center")
|
||||
|
|
Loading…
Reference in a new issue