put ebullet moves inside the collision check loop
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user