Пример #1
0
        public void TakeDamageTransition(Peach peach)
        {
            sound = peach.Content.Load <SoundEffect>("Sound Effects/Peach Dies");
            sound.Play();
            var state = new DeadState(peach);

            peach.PowerUpState = state;
            peach.PlayerStats.LoseLife();
            var actState = new IdleState(peach); // reduce checking for dead state by making action state idle upon death -> switch anim on respawn

            peach.ActionState = actState;
            peach.Sprite.SwitchAnimation(5, 4);                                  //dead animation
            peach.Sprite.Velocity = new Vector2(Constants.ZERO, Constants.ZERO); // if dead, can't move!
            peach.Sprite.HReflect = false;                                       // no reflect anim
            peach.Sprite.SetFrame(Constants.ZERO);                               // from start of anim
            peach.Sprite.LoopFrame = true;                                       // no loop anim
        }
Пример #2
0
        public void DeadTransition(Peach peach)
        {
            var state = new DeadState(peach);

            peach.PowerUpState = state;
        }