put ebullet moves inside the collision check loop

This commit is contained in:
2025-06-20 16:01:59 -07:00
parent 325d7444e7
commit 1c8bcae44c

View File

@ -234,7 +234,7 @@ function updategame()
end end
events:vore(new_events) events:vore(new_events)
events:strip(call_move) 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) lst:strip(call_move)
end end
@ -247,6 +247,8 @@ function updategame()
return es:hitship(ps) return es:hitship(ps)
end) end)
ebullets:strip(function(eb) ebullets:strip(function(eb)
-- loopify this when split moves implemented
eb:move()
if (not collides(pbox, hurtbox(eb))) return if (not collides(pbox, hurtbox(eb))) return
ps:hitbullet(eb) ps:hitbullet(eb)
return eb:hitship(ps) return eb:hitship(ps)
@ -257,15 +259,7 @@ function updategame()
-- use bucket collider for efficiency -- use bucket collider for efficiency
local eship_collider = collider.new() local eship_collider = collider.new()
-- save tokens, lose time: eships:strip(function(s) eship_collider:insert(s) end)
-- 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
-- lose tokens, save time: -- lose tokens, save time:
-- unroll `strip` to avoid -- unroll `strip` to avoid