From b379e47dbf69bbdcc1646ce662851a9ff67aa7bc Mon Sep 17 00:00:00 2001 From: Kistaro Windrider Date: Mon, 2 Sep 2024 15:22:33 -0700 Subject: [PATCH] bonus shield powerup mostly to test whether redistributing the shield and health meters works --- vacuum_gambit.p8 | 52 ++++++++++++++++++++++++++++++++++++------------ 1 file changed, 39 insertions(+), 13 deletions(-) diff --git a/vacuum_gambit.p8 b/vacuum_gambit.p8 index 16cac71..dd7bcee 100644 --- a/vacuum_gambit.p8 +++ b/vacuum_gambit.p8 @@ -1283,7 +1283,17 @@ function spawn_bonus_vulcan_chasey() end c.sprite=4 return c -end +end + +function spawn_bonus_shield_chasey() + local c = spawn_chasey() + c.die = function(self) + spawn_shield_upgrade_at(self.x-1, self.y-1) + chasey.die(self) + end + c.sprite=4 + return c +end helpers = { spawn_frownie, @@ -1374,7 +1384,7 @@ example_level_csv=[[1,spawn_frownie 115,spawn_spewy 130,spawn_bonus_frownie 145,spawn_spewy -200,spawn_chasey +200,spawn_bonus_shield_chasey 250,spawn_blocking_blocky 285,spawn_spec_gun_at,35,-11,blast_gun 310,spawn_blocking_blocky @@ -1391,8 +1401,9 @@ example_level_csv=[[1,spawn_frownie 500,multi,20,12,spawn_blocking_blocky 501,spawn_bonus_frownie 620,spawn_blocking_blocky -700,spawn_blocking_boss_chasey -701,eol]] +630,spawn_bonus_shield_chasey +720,spawn_blocking_boss_chasey +721,eol]] -->8 -- readme.md @@ -1914,13 +1925,14 @@ repair = mknew(powerup.new{ x_off = 4, y_off = 0, sprites = sheen8x8, + icon = 53, hitship = function(self, ship) if (ship ~= primary_ship) return false primary_ship.hp = min(primary_ship.maxhp, primary_ship.hp + 1) return true end, draw = function(self) - spr(53, self.x, self.y, self.width, self.height) + spr(self.icon, self.x, self.y, self.width, self.height) powerup.draw(self) end }) @@ -1929,6 +1941,20 @@ function spawn_repair_at(x, y) repair.new():spawn_at(x, y) end +shield_upgrade = mknew(repair.new{ + icon=52 +}) + +function shield_upgrade:hitship(ship) + if (ship ~= primary_ship) return false + primary_ship.maxshield += 1 + return true +end + +function spawn_shield_upgrade_at(x, y) + shield_upgrade.new():spawn_at(x,y) +end + gun_swap = mknew(powerup.new{ hurt = { x_off = -2, @@ -2010,14 +2036,14 @@ __gfx__ 00000000000000000000000000000000000000000009080000000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000cccccccc77000000007700000000770000000077000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000c11ee11d70000000077000000007700000000770000000070000000000000000000000000000000000000000 -0000000000000000000000000000000000000000c11ee11d00000000770000000077000000007700000000770000000700000000000000000000000000000000 -0000000000000000000000000000000000000000ceeeeeed00000000700000000770000000077000000007700000007700000000000000000000000000000000 -0000000000000000000000000000000000000000ceeeeeed00000000000000007700000000770000000077000000077000000007000000000000000000000000 -0000000000000000000000000000000000000000c11ee11d00000000000000007000000007700000000770000000770000000077000000000000000000000000 -0000000000000000000000000000000000000000c11ee11d00000000000000000000000077000000007700000007700000000770000000070000000000000000 -0000000000000000000000000000000000000000cddddddd00000000000000000000000070000000077000000077000000007700000000770000000000000000 +00000000000000000000000000000000cccccccccccccccc77000000007700000000770000000077000000000000000000000000000000000000000000000000 +00000000000000000000000000000000c116611dc11ee11d70000000077000000007700000000770000000070000000000000000000000000000000000000000 +00000000000000000000000000000000c1611c1dc11ee11d00000000770000000077000000007700000000770000000700000000000000000000000000000000 +00000000000000000000000000000000c61111cdceeeeeed00000000700000000770000000077000000007700000007700000000000000000000000000000000 +00000000000000000000000000000000c6111bcdceeeeeed00000000000000007700000000770000000077000000077000000007000000000000000000000000 +00000000000000000000000000000000c161bbbdc11ee11d00000000000000007000000007700000000770000000770000000077000000000000000000000000 +00000000000000000000000000000000c11ccb1dc11ee11d00000000000000000000000077000000007700000007700000000770000000070000000000000000 +00000000000000000000000000000000cdddddddcddddddd00000000000000000000000070000000077000000077000000007700000000770000000000000000 cccccccccccc0000cccccccccccc0000cccccccccccc0000cccccccccccc0000cccccccccccc0000cccccccccccc0000cccccccccccc0000cccccccccccc0000 c1111111111d0000c1111111111d0000c1111111111d0000c1111111111d0000c1111111111d0000c111eeee111d0000ceee2222eeed0000c2221111222d0000 c1111111111d0000c1111111111d0000c1111111111d0000c1111111111d0000c111eeee111d0000c1ee2222ee1d0000ce22111122ed0000c2111111112d0000