From 99323be298ac89278e2a9032adb39a23b17686f2 Mon Sep 17 00:00:00 2001 From: Kistaro Windrider Date: Fri, 20 Jun 2025 19:13:28 -0700 Subject: [PATCH] despawn shots aggressively when offscreen avoids hitting enemies before they spawn in. may need to revisit this for the X coordinate if I want to implement a "Wild Ball" kind of weapon, but I think I won't have the tokens for that anyway --- vacuum_gambit.p8 | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/vacuum_gambit.p8 b/vacuum_gambit.p8 index 866e488..4e7c806 100644 --- a/vacuum_gambit.p8 +++ b/vacuum_gambit.p8 @@ -817,7 +817,7 @@ function bullet_base:move() self.x += self.dx self.y += self.dy if (self.f) self.f -= 1 - return (self.y > 145) or (self.y < -64) or (self.f and self.f < 0) or (self.x > 256) or (self.x < -128) + return (self.y > 130) or (self.y < -self.height*8) or (self.f and self.f < 0) or (self.x > 128) or (self.x < -self.width*8) end function bullet_base:draw() @@ -1761,7 +1761,6 @@ function xp_gem:draw() end function xp_gem:move() - if not primary_ship.dead and abs(self.x + 1 - primary_ship.x - primary_ship.hurt.x_off) <= primary_ship.magnet and abs(self.y + 1 - primary_ship.y - primary_ship.hurt.y_off) <= primary_ship.magnet then if (self.x < primary_ship.x + 3) self.x += 1 if (self.x > primary_ship.x + 5) self.x -= 1 @@ -1771,9 +1770,6 @@ function xp_gem:move() return bullet_base.move(self) end --- todo: "magnetic" behavior --- when near player ship - function xp_gem:hitship(ship) if (ship ~= primary_ship or primary_ship.dead) return false primary_ship.xp += self.val