Ejemplo n.º 1
0
        public void OnCollisionResponse(IItem item, CollisionSide side)
        {
            if (item == null && side != CollisionSide.None)
            {
                return;
            }

            if (item is FireFlowerItem)
            {
                state.SetFireState();
                if (this.mario.Tag == 0)
                {
                    Score.marioScore += 1000;
                }
                else
                {
                    Score.luigiScore += 1000;
                }
                SoundEffectFactory.Instance.PlayPowerUp();
            }
            else if (item is GrowMushroomItem)
            {
                state.Grow();
                if (this.mario.Tag == 0)
                {
                    Score.marioScore += 1000;
                }
                else
                {
                    Score.luigiScore += 1000;
                }
                SoundEffectFactory.Instance.PlayPowerUp();
            }
            else if (item is StarItem)
            {
                state.Star();
                if (this.mario.Tag == 0)
                {
                    Score.marioScore += 1000;
                }
                else
                {
                    Score.luigiScore += 1000;
                }
                //bgm.Play_StarMan();
            }
            else if (item is CoinItem)
            {
                Score.AddCoinMario();
                SoundEffectFactory.Instance.PlayCoin();
            }
            else if (item is LifeMushroomItem)
            {
                Score.ExtraLifeMario();
                SoundEffectFactory.Instance.GetOneUp();
            }
        }
Ejemplo n.º 2
0
 public void Star()
 {
     stateMachine.Star();
 }