Ejemplo n.º 1
0
 /// <summary>
 /// Picks up the designated item, despawning it and adding it to the player's inventory.
 /// </summary>
 /// <param name="item">The item that was picked up.</param>
 private void PickUpItem(GameObject item)
 {
     itemArray[(byte)item.ItemType] = true;
     item.Despawn();
     if (item.IsKey)
         soundEngine.Play(AudioEngine.SoundEffects.KeyGet);
     else if (item.IsPowerup)
     {
         soundEngine.Play(AudioEngine.SoundEffects.ItemGet);
         string info = null;
         switch (item.ObjectName)
         {
             case "DashPowerup":
                 info = "You got the dash powerup!\nUse the triggers (or Q on a keyboard) to dash, even in midair.";
                 break;
         }
         if (info != null)
             hudCallback(info, true, true);
     }
 }