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.
This commit is contained in:
2025-06-20 16:31:18 -07:00
parent 1c8bcae44c
commit bf8297eb72

View File

@ -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