Code: Select all
for i,v in ipairs(projectiles.onscreen) do
--update positions and stuff
for n,c in ipairs(enemies.onscreen) do
--update enemy positions and stuff
for i,v in ipairs(projectiles.onscreen) do
checkforcollision(v.position, c.position)
end
end
end
I have also added random debris that can kill both you and the enemies if you run into it. At the moment there's only one type of debris, but more could easily be added in just one line (stray satellites, anyone?). I would like to add more types of enemies as well, but I haven't been able to find any good, free images to use - and I'm way too lazy to make them myself (took me long enough to make all the airforce badges). Last but not least, I added a couple of sound effects that were missing.
As always, let me know if you have any suggestions or ideas.