nested types and deleting them.

Blitz3D Forums/Blitz3D Programming/nested types and deleting them.

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

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.



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