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:
@ -258,8 +258,12 @@ function updategame()
|
|||||||
-- many bullets and many enemy ships;
|
-- many bullets and many enemy ships;
|
||||||
-- use bucket collider for efficiency
|
-- use bucket collider for efficiency
|
||||||
|
|
||||||
local eship_collider = collider.new()
|
local eship_collider, pp = collider.new(), eships
|
||||||
eships:strip(function(s) eship_collider:insert(s) end)
|
eships:strip(function(s)
|
||||||
|
eship_collider:insert(s)
|
||||||
|
s.prev = pp
|
||||||
|
pp = s
|
||||||
|
end)
|
||||||
|
|
||||||
-- lose tokens, save time:
|
-- lose tokens, save time:
|
||||||
-- unroll `strip` to avoid
|
-- unroll `strip` to avoid
|
||||||
|
Reference in New Issue
Block a user