diff --git a/sonic-radiance.love/assets/gui/hudbonus.png b/sonic-radiance.love/assets/gui/strings/hudbonus.png similarity index 100% rename from sonic-radiance.love/assets/gui/hudbonus.png rename to sonic-radiance.love/assets/gui/strings/hudbonus.png diff --git a/sonic-radiance.love/assets/gui/hudscore.png b/sonic-radiance.love/assets/gui/strings/hudscore.png similarity index 100% rename from sonic-radiance.love/assets/gui/hudscore.png rename to sonic-radiance.love/assets/gui/strings/hudscore.png diff --git a/sonic-radiance.love/assets/gui/hudtime.png b/sonic-radiance.love/assets/gui/strings/hudtime.png similarity index 100% rename from sonic-radiance.love/assets/gui/hudtime.png rename to sonic-radiance.love/assets/gui/strings/hudtime.png diff --git a/sonic-radiance.love/assets/gui/strings/hudturn.png b/sonic-radiance.love/assets/gui/strings/hudturn.png new file mode 100644 index 0000000..5de4459 Binary files /dev/null and b/sonic-radiance.love/assets/gui/strings/hudturn.png differ diff --git a/sonic-radiance.love/scenes/battlesystem/assets.lua b/sonic-radiance.love/scenes/battlesystem/assets.lua index 4d6f9e4..6190692 100644 --- a/sonic-radiance.love/scenes/battlesystem/assets.lua +++ b/sonic-radiance.love/scenes/battlesystem/assets.lua @@ -22,6 +22,8 @@ return { {"m_speedster", "assets/gui/emblem_speedster_mask.png"}, {"m_technic", "assets/gui/emblem_technic_mask.png"}, {"m_power", "assets/gui/emblem_power_mask.png"}, + + {"hudturn", "assets/gui/strings/hudturn.png"}, }, ["fonts"] = { {"small", "assets/gui/fonts/PixelOperator.ttf", 16}, diff --git a/sonic-radiance.love/scenes/battlesystem/init.lua b/sonic-radiance.love/scenes/battlesystem/init.lua index 752cccb..2eab6c1 100644 --- a/sonic-radiance.love/scenes/battlesystem/init.lua +++ b/sonic-radiance.love/scenes/battlesystem/init.lua @@ -5,14 +5,10 @@ local BattleSystem = Scene:extend() local World = require "scenes.battlesystem.world" local MenuSystem = require "scenes.battlesystem.menu" -local gui = require "game.modules.gui" - - function BattleSystem:new() BattleSystem.super.new(self) self.assets:batchImport("scenes.battlesystem.assets") - self.frame = gui.newBorder(424, 30, 8) self:initManagers() @@ -31,8 +27,6 @@ end function BattleSystem:draw() self.world:draw() - - love.graphics.draw(self.frame, 424, 20, 0, -1, -1) end function BattleSystem:exit() diff --git a/sonic-radiance.love/scenes/battlesystem/world.lua b/sonic-radiance.love/scenes/battlesystem/world.lua index 529932f..5696faa 100644 --- a/sonic-radiance.love/scenes/battlesystem/world.lua +++ b/sonic-radiance.love/scenes/battlesystem/world.lua @@ -10,6 +10,8 @@ local POSITIONS = { {x = 2, y = 6}, } +local gui = require "game.modules.gui" + -- INIT FUNCTIONS -- Initialize the battle world @@ -24,7 +26,7 @@ function World:new(scene, battlefile) self.turns = {} self.turns.current = 1 - self.turns.number = 1 + self.turns.number = 0 self.turns.isFinished = true self.turns.changeBattler = true self.battlers = {} @@ -40,6 +42,7 @@ function World:new(scene, battlefile) self:initHeroes() self:initEnnemies() + self:initHUD() end function World:initHeroes(battlefile) @@ -230,6 +233,10 @@ function World:drawShadows() end end +function World:initHUD() + self.frame = gui.newBorder(424, 30, 4) +end + function World:drawHUD() for i,v in ipairs(self.actionlist) do v.actor:drawIcon(4 + (i-1)*(20), 6) @@ -241,6 +248,17 @@ function World:drawHUD() for i,v in ipairs(self.battlers) do v:drawHUD() end + + local x, y = 362, 3 + + love.graphics.draw(self.frame, 424, 20, 0, -1, -1) + self.assets.images["hudturn"]:draw(x, y) + self.assets.fonts["hudnbrs"]:set() + local turnnbr = self.turns.number + if (turnnbr < 10) then + turnnbr = "0" .. turnnbr + end + love.graphics.print(turnnbr, x + 33, y + 1) end