Пример #1
0
        public RunningMarioState(Mario mario)
        {
            this.mario = mario;
            if (mario.marioDirection)
            {
                switch (mario.marioState)
                {
                case Mario.MARIO_SMALL:
                    marioSprite = SpriteFactories.MarioSpriteFactory.Instance.CreateLeftRunningSmallMarioSprite();

                    break;

                case Mario.MARIO_BIG:
                    marioSprite = SpriteFactories.MarioSpriteFactory.Instance.CreateLeftRunningBigMarioSprite();
                    break;

                case Mario.MARIO_FIRE:
                    marioSprite = SpriteFactories.MarioSpriteFactory.Instance.CreateLeftRunningFireMarioSprite();

                    break;
                }
            }
            else if (!mario.marioDirection)
            {
                switch (mario.marioState)
                {
                case Mario.MARIO_SMALL:
                    marioSprite = SpriteFactories.MarioSpriteFactory.Instance.CreateRightRunningSmallMarioSprite();
                    break;

                case Mario.MARIO_BIG:
                    marioSprite = SpriteFactories.MarioSpriteFactory.Instance.CreateRightRunningBigMarioSprite();
                    break;

                case Mario.MARIO_FIRE:
                    marioSprite = SpriteFactories.MarioSpriteFactory.Instance.CreateRightRunningFireMarioSprite();
                    break;
                }
            }
        }
Пример #2
0
 public DeadMarioState(Mario mario)
 {
     this.mario  = mario;
     marioSprite = SpriteFactories.MarioSpriteFactory.Instance.CreateDeadSmallMarioSprite();
 }
Пример #3
0
 public IdleMarioState(Mario mario)
 {
     this.mario = mario;
 }