From 1c8bcae44c9b11c7331b7c09bd6842b84bfb825a Mon Sep 17 00:00:00 2001 From: Kistaro Windrider Date: Fri, 20 Jun 2025 16:01:59 -0700 Subject: [PATCH] put ebullet moves inside the collision check loop --- vacuum_gambit.p8 | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/vacuum_gambit.p8 b/vacuum_gambit.p8 index 5bdae5d..611e96f 100644 --- a/vacuum_gambit.p8 +++ b/vacuum_gambit.p8 @@ -234,7 +234,7 @@ function updategame() end events:vore(new_events) events:strip(call_move) - for _, lst in ipairs{intangibles_bg, eships, pbullets, ebullets} do + for _, lst in ipairs{intangibles_bg, eships, pbullets} do lst:strip(call_move) end @@ -247,6 +247,8 @@ function updategame() return es:hitship(ps) end) ebullets:strip(function(eb) + -- loopify this when split moves implemented + eb:move() if (not collides(pbox, hurtbox(eb))) return ps:hitbullet(eb) return eb:hitship(ps) @@ -257,15 +259,7 @@ function updategame() -- use bucket collider for efficiency local eship_collider = collider.new() - -- save tokens, lose time: - -- eships:strip(function(s) eship_collider:insert(s) end) - local p, n = eships, eships.next - while n do - n.prev = p - eship_collider:insert(n) - p = n - n = p.next - end + eships:strip(function(s) eship_collider:insert(s) end) -- lose tokens, save time: -- unroll `strip` to avoid