public void Trigger() { if (Used) { return; } UpMushroom newObject = new UpMushroom(new Vector2(Location.X, Location.Y - 2)); SoundManager.Instance.PlayMushStarSound(); //Need to Add to List stateMachine.BeTriggered(); }
public void Trigger() { if (Used) { return; } IGameObject newObject = null; switch (hiddenItem) { case ItemType.Flower: newObject = new FireFlower(new Vector2(Location.X, Location.Y - 2)); SoundManager.Instance.PlayMushStarSound(); break; case ItemType.UpMushroom: newObject = new UpMushroom(new Vector2(Location.X, Location.Y - 16)); SoundManager.Instance.PlayMushStarSound(); break; case ItemType.SuperMushroom: newObject = new SuperMushroom(new Vector2(Location.X, Location.Y - 16)); SoundManager.Instance.PlayMushStarSound(); break; case ItemType.Star: newObject = new Star(new Vector2(Location.X, Location.Y - 16)); SoundManager.Instance.PlayMushStarSound(); break; default: coinAnimation.StartAnimation(); CoinSystem.Instance.AddCoin(); ScoringSystem.AddPointsForCoin(this); break; } if (newObject != null) { GameObjectManager.itemList.Add(newObject); } stateMachine.BeTriggered(); }