From 5d34f55b237acd61467a4c9efa30c5c6158ec41d Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Tue, 4 Aug 2020 18:50:36 +0200 Subject: [PATCH] feat: improve battle hud spacing Fix #22 --- sonic-radiance.love/assets/gui/status_bar.png | Bin 4595 -> 6128 bytes .../modules/drawing/parallaxBackground.lua | 2 +- .../game/modules/gui/statusbar.lua | 6 +-- .../controllers/fighters/character.lua | 9 +++-- .../scenes/battlesystem/gui/hud.lua | 38 +++++++++--------- .../scenes/battlesystem/menu.lua | 2 +- 6 files changed, 30 insertions(+), 27 deletions(-) diff --git a/sonic-radiance.love/assets/gui/status_bar.png b/sonic-radiance.love/assets/gui/status_bar.png index a30587492fe163174ab471032afcd8793bd4d0d8..e4b9cadfe3ca9ea9f6e74d0bb5dc112834a11249 100644 GIT binary patch delta 6088 zcmV;(7dPnhBk(VfBYzW5dQ@0+Qek%>aB^>EX>4U6ba`-PAZ2)IW&i+q+U=TIb{xHO zgx|3WF9Gwg9E|7O9eDZv0@W>%6s2F+*NlN@sm>WCZ{(=Op(!vCh{xo#W}l zKyAOi7@xoBuYr7hP4GJYo+!9y0=r%V_18ebzh;il=kc03w^}|fVZB#SUq|ZmXY>?9 z@i}EzBG1v=QgY*c^)?p#wq)p;zUjI&o^if@Ht$nCHu)V~u=lw>R)*)V^H=XP)9Bm# zzVIA^yZ*I?kbhwUmbaI0xBcPGPriA-{^rO0&9YuG{}k>Y?_OzO-e1Juq(R=VGs2hX zF2r82$EzSMR3}_gEzs z&Cj5qM?Ku}CA6?e0Usu*5;*G5F)v%(owwcjrmM`n9H)B6V2(@v@nQbvq(42*Q7t+5 zl*r>S?D8r@%uwX?%xU`ayqub@gWr$O3Hb_aV6=4ITv=eZ;~8Qk_cOP`4RqkV#Oo7d zSJrdA27ijooiN4)LSVBa6SA|#`{EpqtOTe#TRnv~h=2nR7e@LRLMAp80aF{UDej)@ zlYfqbl0+hfOj%YU)CpFMiTo+Cl0!X(6oJ>AN~)=)ozX0~~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U=P;Qo}G1hF3GW0u9Va8Jg57atUah zG6#U`K+iq60~GQBn1M(aSsKgOiXA`4NY=kioQgGZ zui(MgSXpC9Dv4mmDgdoDSD{yZQc3@P`OM73%v7u)sU&Hw$@#U`qx_qNe`CO@-?aPv zeo%bedbL&5^qKRUvl-=IQUJ`H9)BUOXIX2k$c`DCvmv!r`=Z!Ovg(hiJ2{-brkCZ+ zOyd6S&++qI!hb;3ADq22m+&Xw05$kGk3^q$7w~t8c`)|k!Ji}mz>gpPXaNBJI^d5I zz_o%8@Z*9%R~G>Ik;0!t0DvDc{HX#!pC3V=-??sR-gh}4Ar9O6f50c|@po{`KnD|^ zu;KS!yXgymM?|kU`O##6$qSp{Bj>Lp?{^BI4SsFr4-3Zl`)L&XMgcSodiY}U2MY)O z$L(nNeR2ihuNZ!p002J%_)|MF0r=^{Z`%Oy6M^5f3E(FL-`@y*egu6!%{+y5n}K{J d8kl>-U-uKKlTbwQ4F&)J002ovPDHLkV1hny>PY|q diff --git a/sonic-radiance.love/game/modules/drawing/parallaxBackground.lua b/sonic-radiance.love/game/modules/drawing/parallaxBackground.lua index 9eb2e8a..c190e21 100644 --- a/sonic-radiance.love/game/modules/drawing/parallaxBackground.lua +++ b/sonic-radiance.love/game/modules/drawing/parallaxBackground.lua @@ -102,7 +102,7 @@ function ParallaxBackground:generateFloor(tile) end function ParallaxBackground:draw() - self:drawParallax(0, -self:getStartY(), 424, 240) + self:drawParallax(-maputils.CONST.STARTX, -self:getStartY(), 424, 240) end function ParallaxBackground:drawParallax(x, y, w, h) diff --git a/sonic-radiance.love/game/modules/gui/statusbar.lua b/sonic-radiance.love/game/modules/gui/statusbar.lua index 78679be..f38604a 100644 --- a/sonic-radiance.love/game/modules/gui/statusbar.lua +++ b/sonic-radiance.love/game/modules/gui/statusbar.lua @@ -37,8 +37,8 @@ function StatusBar:draw(x, y) local hpmax = self.stats.hpmax local ppmax = self.stats.ppmax - local bar1 = math.floor((self.hp/self.stats.hpmax)*107) - local bar2 = math.floor((self.pp/self.stats.ppmax)*108) + local bar1 = math.floor((self.hp/self.stats.hpmax)*58) + local bar2 = math.floor((self.pp/self.stats.ppmax)*58) love.graphics.setColor(248/255, 160/255, 0, 1) gui.drawBar(x+29, y+5, bar1, 7) @@ -56,7 +56,7 @@ function StatusBar:draw(x, y) lvl = "0" .. lvl end - love.graphics.print(lvl, x+122, y-5) + love.graphics.print(lvl, x+73, y-5) end return StatusBar diff --git a/sonic-radiance.love/scenes/battlesystem/controllers/fighters/character.lua b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/character.lua index ed63881..60de919 100644 --- a/sonic-radiance.love/scenes/battlesystem/controllers/fighters/character.lua +++ b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/character.lua @@ -9,7 +9,7 @@ local POSITIONS = {3, 1, 5} local HEROES_LINE = 2; local HUDBASE = 8 -local HUDSEP = 152 +local HUDSIZE = 91 function HeroFighter:new(owner, character, id) self.name = character @@ -44,7 +44,7 @@ function HeroFighter:getAbstract() end function HeroFighter:createActor() - local x, y = HEROES_LINE, POSITIONS[self.id] + local x, y = HEROES_LINE, ((self.id-1)*(4/(#game.characters.team-1))+1) return self.world.obj.Hero(self.world, x, y, self) end @@ -152,9 +152,10 @@ function HeroFighter:drawIcon(x, y) end function HeroFighter:drawHUD() - local x = HUDBASE + (self.id-1)*HUDSEP + local boxSize = 424 / 4 + local x = (self.id-0.5)*boxSize local y = self.turnSystem.hud:getPlayerHUDPosition() - self.statusbar:draw(x, y) + self.statusbar:draw(x - HUDSIZE/2, y) end return HeroFighter diff --git a/sonic-radiance.love/scenes/battlesystem/gui/hud.lua b/sonic-radiance.love/scenes/battlesystem/gui/hud.lua index 1916b0c..27d7026 100644 --- a/sonic-radiance.love/scenes/battlesystem/gui/hud.lua +++ b/sonic-radiance.love/scenes/battlesystem/gui/hud.lua @@ -3,6 +3,8 @@ local HUD = Object:extend() local gui = require "game.modules.gui" local TweenManager = require "game.modules.tweenmanager" +local PLAYER_HUD_HIDDEN = 240+64 +local PLAYER_HUD_VISIBLE = 240-44 function HUD:new(turns) self.turns = turns @@ -13,7 +15,7 @@ function HUD:new(turns) self.frame = gui.newBorder(424, 30, 4) self.tweens = TweenManager(self) - self.playerHUDPosition = -64 + self.playerHUDPosition = PLAYER_HUD_HIDDEN self.battlerCursor = self.turns.turns.current end @@ -23,9 +25,9 @@ end function HUD:movePlayerHUD(beginBattle) if (beginBattle) then - self.tweens:newTween(0, 0.4, {playerHUDPosition = 16}, 'inCubic') + self.tweens:newTween(0, 0.4, {playerHUDPosition = PLAYER_HUD_VISIBLE}, 'inCubic') else - self.tweens:newTween(0, 0.4, {playerHUDPosition = -64}, 'inCubic') + self.tweens:newTween(0, 0.4, {playerHUDPosition = PLAYER_HUD_HIDDEN}, 'inCubic') end end @@ -38,22 +40,9 @@ function HUD:getPlayerHUDPosition() end function HUD:draw() - for i, action in ipairs(self.turns.actionList) do - if action.fighter:canFight() then - action.fighter:drawIcon(4 + (i-1)*(20), 216) - else - self:drawEmptyIcon(4 + (i-1)*(20), 216) - end - end - local cursorx = self.battlerCursor * 20 - 8 + local x, y = 4, 5 - if #self.turns.actionList > 0 then - self.assets.images["menucursor"]:draw(cursorx, 216, math.rad(90), 1, 1, 4, 8) - end - - local x, y = 362, 225 - - love.graphics.draw(self.frame, 424, 220, 0, -1, 1) + love.graphics.draw(self.frame, 0, 24, 0, 1, -1) self.assets.images["hudturn"]:draw(x, y) self.assets.fonts["hudnbrs"]:set() local turnnbr = self.turns.turns.number @@ -61,6 +50,19 @@ function HUD:draw() turnnbr = "0" .. turnnbr end love.graphics.print(turnnbr, x + 33, y + 1) + + for i, action in ipairs(self.turns.actionList) do + if action.fighter:canFight() then + action.fighter:drawIcon(76 + (i-1)*(20), 5) + else + self:drawEmptyIcon(76 + (i-1)*(20), 5) + end + end + local cursorx = (self.battlerCursor-1) * 20 + 76 + + if #self.turns.actionList > 0 then + self.assets.images["menucursor"]:draw(cursorx, 5, math.rad(90), 1, 1, 4, 16) + end end function HUD:drawEmptyIcon(x, y) diff --git a/sonic-radiance.love/scenes/battlesystem/menu.lua b/sonic-radiance.love/scenes/battlesystem/menu.lua index 3741a7c..cc07e12 100644 --- a/sonic-radiance.love/scenes/battlesystem/menu.lua +++ b/sonic-radiance.love/scenes/battlesystem/menu.lua @@ -10,7 +10,7 @@ local SubMenuWidget = BattleWidget:extend() local BackMenuWidget = BattleWidget:extend() local SkillWidget = BattleWidget:extend() -local MENUPOS_X1, MENUPOS_X2, MENUPOS_Y = 96, 32, 96 +local MENUPOS_X1, MENUPOS_X2, MENUPOS_Y = 88, 32, 72 local MENU_WIDTH, MENU_ITEM_HEIGHT = 180, 17 local MENU_ITEM_NUMBER = 6