How would you go about this? I have a method now, but I don't like it at all.
I have a double loop here, and if a missle hits an enemy the enemy is removed, but I can't remove the missle, because it is looked for in the next loop around.
My current code moves the missle to an off screen area so it can be deleted later, but I don't like doing this.
I have a double loop here, and if a missle hits an enemy the enemy is removed, but I can't remove the missle, because it is looked for in the next loop around.
My current code moves the missle to an off screen area so it can be deleted later, but I don't like doing this.
For m.weapon = Each weapon m\xpos=m\xpos+m\xmov m\ypos=m\ypos+m\ymov For e.enemy = Each enemy If distance(e\mesh,m\mesh,1) ; if the missle hits the enemy ; do misc stuff here FreeEntity e\mesh ; delete the enemy mesh Delete e ; delete the enemy type ;Delete m (this is what I want to do, but can't because of the loop) EndIf Next Next