public override void Enter(StatePowerup previousState)
        {
            base.Enter(previousState);

            this.StateMachine.Mario.SetSheetState(SpriteStates.Sheets.SUPER);
            SoundFactory.PlaySoundEffect(SoundFactory.PowerUp());
        }
示例#2
0
        public virtual void Enter(StatePowerup previousState)
        {
            if (previousState != null)
            {
                previousState.Exit();
            }

            this.StateMachine.CurrentState = this;
            this.StateMachine.CurrentState.PreviousState = previousState;
        }
示例#3
0
        public StateMachineMarioPowerup(SpriteMario mario)
        {
            this.Mario = mario;

            this.Normal = new StatePowerupNormal(this);
            this.Super  = new StatePowerupSuper(this);
            this.Fire   = new StatePowerupFire(this);
            this.Star   = new StatePowerupStar(this);

            this.CurrentState = this.Normal;
            this.CurrentState.Enter(null);
        }
示例#4
0
        public override void Enter(StatePowerup previousState)
        {
            base.Enter(previousState);

            this.remaining = 10;

            if (previousState is StatePowerupNormal)
            {
                this.StateMachine.Mario.SetSheetState(SpriteStates.Sheets.STAR_NORMAL);
            }
            else
            {
                this.StateMachine.Mario.SetSheetState(SpriteStates.Sheets.STAR_SUPER);
            }

            MediaPlayer.Play(this.StateMachine.Mario.game.invincibleSong);
        }
示例#5
0
        public override void Enter(StatePowerup previousState)
        {
            base.Enter(previousState);

            this.StateMachine.Mario.SetSheetState(SpriteStates.Sheets.NORMAL);
        }