I think you should revisit the texplosion object again. The way you're coding will limit you with missile/explosions.
Your function doesn't pass any missile object so it will use whatever missile.x/y is last set regardless of whether it relates to that explosion. In addition, you can't get rid of missile while it's being used.
I see you've also gone with the 'global to program' option for HIT which is poor design.
Your function doesn't pass any missile object so it will use whatever missile.x/y is last set regardless of whether it relates to that explosion. In addition, you can't get rid of missile while it's being used.
I see you've also gone with the 'global to program' option for HIT which is poor design.