From 51629376f298de972f9d81f0aeaf705c71fa435f Mon Sep 17 00:00:00 2001 From: Kistaro Windrider Date: Sun, 18 Aug 2024 01:10:20 -0700 Subject: [PATCH] adjust HUD Health and shields now share one bar. one hit point is (about) the same size in each. There is an indicator splitting the two categories of HP. --- vacuum_gambit.p8 | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/vacuum_gambit.p8 b/vacuum_gambit.p8 index 7d47de8..6f4113f 100644 --- a/vacuum_gambit.p8 +++ b/vacuum_gambit.p8 @@ -328,19 +328,23 @@ function drawhud() line(113,127) draw_gun_info("❎",1,116,3,primary_ship.main_gun) - draw_gun_info("🅾️",2,116,31,primary_ship.special_gun) + draw_gun_info("🅾️",1,116,31,primary_ship.special_gun) - dropshadow("pwr",114,59,1) + dropshadow("p h",114,59,1) inset(114,66,119,125) fillp(0x5a5a) vertmeter(115,67,118,124,primary_ship.power, primary_ship.max_power, powcols) inset(120,66,125,125) - line(120,96,125,96,119) - line(120,97,125,97,85) - pset(120, 125, 119) - vertmeter(121,67,124,95,primary_ship.shield, primary_ship.maxshield,{204,220,221}) - vertmeter(121,98,124,124,primary_ship.hp, primary_ship.maxhp, hpcols) + --line(120,96,125,96,119) + --line(120,97,125,97,85) + --pset(120, 125, 119) + -- 57 px vertically + local mxs, mxh = primary_ship.maxshield, primary_ship.maxhp + local split = 57 * (mxs / (mxs + mxh)) \ 1 + 66 + line(121, split, 124, split, 0xba) + vertmeter(121,67,124,split-1,primary_ship.shield, primary_ship.maxshield,{204,220,221}) + vertmeter(121,split+1,124,124,primary_ship.hp, primary_ship.maxhp, hpcols) fillp(0) end