No problem, take your time.
Also, my ID logic was slightly wrong. If it’s per-bullet (or whatever object), you will get conflicts in the presence of multiple bullets. Instead, a more general ID should be used:
local ID = 0 function GetCurrentID () return ID end function UpdateID () ID = ID + 1 end
and then change some of the above code:
local function GatherEnemies (cell, bullet) local id = GetCurrentID() -- was: bullet.id -- snip function BulletCollide (bullet) UpdateID() -- was: bullet.id = bullet.id + 1