public bool checkCollisionWithBullet(Unit unit)
{
// If shot is still in play, check for collisions
for (int j = 0; j < monsters.Count; ++j)
{
if (monsters[j].unit.alive && unit.collideWith(monsters[j].unit))
{
monsters[j].health -= myGame.difficultyConstants.MONSTER_HEALTH_PER_BULLET;
hpBillBoardSystem.setTexture(j);
if (monsters[j].health <= 0)
{
monsters[j].Die();
monsters[j].unit.alive = false;
myGame.mediator.fireEvent(MyEvent.M_DIE);
}
else
{
monsters[j].TakeDamage();
((MonsterUnit)monsters[j].unit).moving = true;
}
return true;
}
}
return false;
}