Esempio n. 1
0
 public void Collect()
 {
     sprite      = ItemSpriteFactory.Instance.CreateDisappearedSprite();
     IsCollected = true;
     SoundManager.Instance.PlayCoinSound();
     CoinSystem.Instance.AddCoin();
     ScoringSystem.AddPointsForCoin(this);
 }
Esempio n. 2
0
 public void Trigger()
 {
     if (coinNum > 0)
     {
         Location = new Vector2(Location.X, initialLocation.Y - 5);
         coinNum--;
         coinAnimation[coinNum].StartAnimation();
         CoinSystem.Instance.AddCoin();
         ScoringSystem.AddPointsForCoin(this);
     }
     else
     {
         state.BeTriggered();
     }
 }
Esempio n. 3
0
        public void Trigger()
        {
            if (Used)
            {
                return;
            }
            IGameObject newObject = null;

            switch (QuestionmarkBlockType)
            {
            case QuestionmarkBlockTypeEnums.Flower:
                newObject = new Flower(new Vector2(Location.X, Location.Y - 2));
                SoundManager.Instance.PlayPowerUpAppearsSound();
                break;

            case QuestionmarkBlockTypeEnums.GreenMushroom:
                newObject = new GreenMushroom(new Vector2(Location.X, Location.Y - 2));
                SoundManager.Instance.PlayPowerUpAppearsSound();
                break;

            case QuestionmarkBlockTypeEnums.RedMushroom:
                newObject = new RedMushroom(new Vector2(Location.X, Location.Y - 2));
                SoundManager.Instance.PlayPowerUpAppearsSound();
                break;

            case QuestionmarkBlockTypeEnums.Star:
                newObject = new Star(new Vector2(Location.X, Location.Y - 2));
                SoundManager.Instance.PlayPowerUpAppearsSound();
                break;

            default:
                coinAnimation.StartAnimation();
                CoinSystem.Instance.AddCoin();
                ScoringSystem.AddPointsForCoin(this);
                break;
            }
            if (newObject != null)
            {
                newObject.Location = new Vector2(Location.X, Location.Y - 2);
                GameUtilities.GameObjectManager.AddItem(newObject);
            }

            stateMachine.BeTriggered();
        }
Esempio n. 4
0
        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();
        }