Пример #1
0
        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);
        }