From bf8297eb72ef8bb522db4bd46ea304a33b8e5923 Mon Sep 17 00:00:00 2001 From: Kistaro Windrider Date: Fri, 20 Jun 2025 16:31:18 -0700 Subject: [PATCH] prevify eships when setting up collider I will refactor this next: collider.new will take the linked list to ingest, perform the `insert` and "prevify" loops itself, then replace `hide` with `yoink`, which yoinks the item out of the original list. This pairs the `yoink` operation with the context that makes it possible to do (that is, the context when prevification was implemented); eships therefore cannot be edited in complex ways while the collider is still valid, but we can append to it as long as we don't expect those items to be procesesd correctly this frame. a new_eships+vore plan might be better if we turn out to need it, but presently we don't; flotilla spawning and raider spawning happen at a different point. --- vacuum_gambit.p8 | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/vacuum_gambit.p8 b/vacuum_gambit.p8 index 611e96f..8b73701 100644 --- a/vacuum_gambit.p8 +++ b/vacuum_gambit.p8 @@ -258,8 +258,12 @@ function updategame() -- many bullets and many enemy ships; -- use bucket collider for efficiency - local eship_collider = collider.new() - eships:strip(function(s) eship_collider:insert(s) end) + local eship_collider, pp = collider.new(), eships + eships:strip(function(s) + eship_collider:insert(s) + s.prev = pp + pp = s +end) -- lose tokens, save time: -- unroll `strip` to avoid