Example #1
0
        public void RestoreStates(MarioState.ActionType actionType, MarioState.PowerType powerType, bool isFire, bool thorwBullet, bool jumpTwice)
        {
            Mario.ThrowBullet = thorwBullet;
            Mario.JumpTwice   = jumpTwice;
            switch (actionType)
            {
            case MarioState.ActionType.Crouch: Mario.ChangeToCrouch(); break;

            case MarioState.ActionType.Fall: Mario.ChangeToFalling(); break;

            case MarioState.ActionType.Idle: Mario.ChangeToIdle(); break;

            case MarioState.ActionType.Jump: Mario.ChangeToJump(Parameters.Velocity.Y); break;

            case MarioState.ActionType.Walk: Mario.ChangeToWalk(); break;

            case MarioState.ActionType.Other: Mario.MarioState.ChangeToDied(); break;

            default: break;
            }
            switch (powerType)
            {
            case MarioState.PowerType.Died: Mario.MarioState.ChangeToDied(); break;

            case MarioState.PowerType.Super:
                if (isFire)
                {
                    Mario.MarioState.ChangeToFire();
                }
                else
                {
                    Mario.MarioState.ChangeToSuper();
                }
                break;

            default: break;     //Mario default powerType is Standard.
            }
        }
Example #2
0
 public void Up(Mario mario)
 {
     mario.ChangeToJump(Mario.YVelocity);
 }