I am developing a game where I want to implement two or multiple time collision with single object.i mean if two bullets collide to a ship then only it will explode...
If a two bullet rectangles intersect with a single ship then ,ship will explode..Here is my collision code..
foreach (Enemy e in this.em.Enemies)
{
if (e.boundingRectangle.Intersects(missiles[i].boundingRectangle))
{
shipHit = true;
pos = new Vector2(e.position.X, e.position.Y);
e.OnHit();
missiles[i].IsActive = false;
//count++;
}
//if (count == 2)
//{
// break;
//}
}
}
please helpppppp.....