A monster who is impeding the progress of our fearless adventurer.
示例#1
0
文件: Player.cs 项目: sq/Fracture
        /// <summary>
        /// Called when the player has been killed.
        /// </summary>
        /// <param name="killedBy">
        /// The enemy who killed the player. This parameter is null if the player was
        /// not killed by an enemy (fell into a hole).
        /// </param>
        public void OnKilled(Enemy killedBy)
        {
            isAlive = false;

            if (killedBy != null)
                killedSound.Play();
            else
                fallSound.Play();

            sprite.PlayAnimation(dieAnimation);
        }
示例#2
0
文件: Level.cs 项目: sq/Fracture
 /// <summary>
 /// Called when the player is killed.
 /// </summary>
 /// <param name="killedBy">
 /// The enemy who killed the player. This is null if the player was not killed by an
 /// enemy, such as when a player falls into a hole.
 /// </param>
 private void OnPlayerKilled(Enemy killedBy)
 {
     Player.OnKilled(killedBy);
 }