Ejemplo n.º 1
0
        public void Execute(IGameObject gameObject1, IGameObject gameObject2)
        {
            IMario mario = (IMario)gameObject1;

            if (mario.State.MarioShape == MarioState.MarioShapeEnums.Dead)
            {
                return;
            }
            IItem mush = (IItem)gameObject2;

            if (!mush.IsCollected)
            {
                mush.Collect();
                switch (mario.State.MarioShape)
                {
                case MarioState.MarioShapeEnums.Small:
                    GameUtilities.GameObjectManager.MarioTransition(mario.State.MarioShape, MarioState.MarioShapeEnums.Big, mario);
                    break;

                case MarioState.MarioShapeEnums.StarSmall:
                    GameUtilities.GameObjectManager.MarioTransition(mario.State.MarioShape, MarioState.MarioShapeEnums.StarBig, mario);
                    mario.PreStarShape = MarioState.MarioShapeEnums.Big;
                    break;
                }
            }
        }
Ejemplo n.º 2
0
        public void Execute(IGameObject gameObject1, IGameObject gameObject2)
        {
            IMario mario = (IMario)gameObject1;

            if (mario.State.MarioShape == MarioState.MarioShapeEnums.Dead)
            {
                return;
            }
            IItem mush = (IItem)gameObject2;

            if (!mush.IsCollected)
            {
                mush.Collect();
            }
        }
Ejemplo n.º 3
0
        public void Execute(IGameObject gameObject1, IGameObject gameObject2)
        {
            IMario mario = (IMario)gameObject1;

            if (mario.State.MarioShape == MarioState.MarioShapeEnums.Dead)
            {
                return;
            }
            IItem star = (IItem)gameObject2;

            if (!star.IsCollected)
            {
                star.Collect();
                if (mario.State.MarioShape != MarioState.MarioShapeEnums.StarSmall &&
                    mario.State.MarioShape != MarioState.MarioShapeEnums.StarBig)
                {
                    GameUtilities.GameObjectManager.MarioTransition(mario.State.MarioShape, MarioState.MarioShapeEnums.StarSmall, mario);
                }
            }
        }
Ejemplo n.º 4
0
 public void Handle()
 {
     Sounds.GetItemObtainedSound().Play();
     item.Collect(player);
     items.Remove(item);
 }