public void CheckCollisions(Player player, Bullet bulletObject) { if (DetectCollision(player)) //if and of the enemy and player have collided { ResetPosition(); alive = false; player.ResetPosition(); player.DecreaseLives(); killedSound.Play(); //play the killed sound } if (DetectCollision(bulletObject)) //if enemy and bullet have collided { ResetPosition(); alive = false; player.ChangeScore(10); //add 10 points to players score bulletObject.ResetPos(); killedSound.Play(); } }
/// <summary> /// Calls the Player class' ResetPosition method. /// </summary> public void ResetPosition() { player.ResetPosition(); }