diff --git a/sonic-radiance.love/assets/gui/barborder.png b/sonic-radiance.love/assets/gui/barborder.png index 4e321ef..b6de2e0 100644 Binary files a/sonic-radiance.love/assets/gui/barborder.png and b/sonic-radiance.love/assets/gui/barborder.png differ diff --git a/sonic-radiance.love/assets/gui/egghead.png b/sonic-radiance.love/assets/gui/egghead.png new file mode 100644 index 0000000..3a5e6b7 Binary files /dev/null and b/sonic-radiance.love/assets/gui/egghead.png differ diff --git a/sonic-radiance.love/assets/gui/status_bar.png b/sonic-radiance.love/assets/gui/status_bar.png index e4b9cad..bdeeda2 100644 Binary files a/sonic-radiance.love/assets/gui/status_bar.png and b/sonic-radiance.love/assets/gui/status_bar.png differ diff --git a/sonic-radiance.love/game/modules/gui/emblem.lua b/sonic-radiance.love/game/modules/gui/emblem.lua index 094a65e..b5d2e33 100644 --- a/sonic-radiance.love/game/modules/gui/emblem.lua +++ b/sonic-radiance.love/game/modules/gui/emblem.lua @@ -9,14 +9,24 @@ function Emblem:new(abstract, scene) end function Emblem:draw(x, y) - local emblem1 = "e_" .. self.abstract.data.class - local emblem2 = "m_" .. self.abstract.data.class + self:drawBackground(x, y) + self:drawForeground(x, y) +end - self.assets.images[emblem1]:draw(x, y) +function Emblem:drawForeground(x, y) + local emblem2 = "m_" .. self.abstract.data.class core.screen:setScissor(x, y-16, 32, 40) self.assets.sprites[self.charid]:drawAnimation(x+14, y+14) core.screen:resetScissor( ) self.assets.images[emblem2]:draw(x, y) end +function Emblem:drawBackground(x, y) + local emblem1 = "e_" .. self.abstract.data.class + + self.assets.images[emblem1]:draw(x, y) + +end + + return Emblem diff --git a/sonic-radiance.love/game/modules/gui/simplehpbar.lua b/sonic-radiance.love/game/modules/gui/simplehpbar.lua index c568eb2..e3b2adc 100644 --- a/sonic-radiance.love/game/modules/gui/simplehpbar.lua +++ b/sonic-radiance.love/game/modules/gui/simplehpbar.lua @@ -20,9 +20,10 @@ end function SimpleHPBar:draw(x, y) love.graphics.setColor(0, 0, 0, 1) gui.drawBar(x, y, 26, 4) + love.graphics.rectangle("fill", x, y, 24, 4) love.graphics.setColor(248/255, 160/255, 0, 1) - local bar = math.floor(24 * (self.hp / self.baseHP)) - gui.drawBar(x, y + 1, bar, 2) + local bar = math.max(0, math.floor(22 * (self.hp / self.baseHP))) + love.graphics.rectangle("fill", x + 1, y + 1, math.floor(bar), 2) love.graphics.setColor(1, 1, 1, 1) end diff --git a/sonic-radiance.love/game/modules/gui/statusbar.lua b/sonic-radiance.love/game/modules/gui/statusbar.lua index f38604a..f1b8a77 100644 --- a/sonic-radiance.love/game/modules/gui/statusbar.lua +++ b/sonic-radiance.love/game/modules/gui/statusbar.lua @@ -31,32 +31,36 @@ function StatusBar:updatePP() end function StatusBar:draw(x, y) - self.emblem:draw(x, y) - self.assets.images["statusbar"]:draw(x+12, y-6) + self.emblem:drawBackground(x, y) + self:drawStatusArea(x+10, y-8) + self.emblem:drawForeground(x, y) +end - local hpmax = self.stats.hpmax - local ppmax = self.stats.ppmax +function StatusBar:drawStatusArea(x, y) +self.assets.images["statusbar"]:draw(x, y) - local bar1 = math.floor((self.hp/self.stats.hpmax)*58) - local bar2 = math.floor((self.pp/self.stats.ppmax)*58) +local hpmax = self.stats.hpmax +local ppmax = self.stats.ppmax - love.graphics.setColor(248/255, 160/255, 0, 1) - gui.drawBar(x+29, y+5, bar1, 7) - love.graphics.setColor(0, 248/255, 248/255, 1) - gui.drawBar(x+17, y+17, bar2, 7) - utils.graphics.resetColor() +local bar1 = math.floor((self.hp/self.stats.hpmax)*58) +local bar2 = math.floor((self.pp/self.stats.ppmax)*58) - self.assets.fonts["hudnbrs_small"]:set() - love.graphics.print(math.floor(self.hp) .. "/" .. hpmax, x+34, y+5) - love.graphics.print(math.floor(self.pp) .. "/" .. ppmax, x+28, y+17) +love.graphics.setColor(248/255, 160/255, 0, 1) +gui.drawBar(x+10, y+11, bar1, 7) +love.graphics.setColor(0, 248/255, 248/255, 1) +gui.drawBar(x+22, y+23, bar2, 7) +utils.graphics.resetColor() - local lvl = self.abstract.level +self.assets.fonts["hudnbrs_small"]:set() +love.graphics.print(math.floor(self.hp) .. "/" .. hpmax, x+16, y+11) +love.graphics.print(math.floor(self.pp) .. "/" .. ppmax, x+32, y+23) - if lvl < 100 then - lvl = "0" .. lvl - end +local lvl = self.abstract.level - love.graphics.print(lvl, x+73, y-5) +if lvl < 100 then + lvl = "0" .. lvl +end + love.graphics.print(lvl, x+42, y+1) end return StatusBar diff --git a/sonic-radiance.love/scenes/battlesystem/actors/ennemy.lua b/sonic-radiance.love/scenes/battlesystem/actors/ennemy.lua index 4732d80..edac56b 100644 --- a/sonic-radiance.love/scenes/battlesystem/actors/ennemy.lua +++ b/sonic-radiance.love/scenes/battlesystem/actors/ennemy.lua @@ -14,7 +14,7 @@ function Ennemy:draw() Ennemy.super.draw(self) local x, y = self.world.map:gridToPixel(self.x, self.y, true) - self.owner:drawHUD(x - 14, y - 38) + self.owner:drawHUD(x - 12, y - 38) if (self.isSelected) then local height = 32 diff --git a/sonic-radiance.love/scenes/battlesystem/assets.lua b/sonic-radiance.love/scenes/battlesystem/assets.lua index 244881b..94dd0d1 100644 --- a/sonic-radiance.love/scenes/battlesystem/assets.lua +++ b/sonic-radiance.love/scenes/battlesystem/assets.lua @@ -25,7 +25,8 @@ return { {"m_power", "assets/gui/emblem_power_mask.png"}, {"hudturn", "assets/gui/strings/hudturn.png"}, - {"battlecompleted", "assets/gui/strings/battle_completed.png" } + {"battlecompleted", "assets/gui/strings/battle_completed.png" }, + {"egghead", "assets/gui/egghead.png"} }, ["fonts"] = { {"small", "assets/gui/fonts/PixelOperator.ttf", 16},