public override void Update()
        {
            if (counter > 0)
            {
                counter--;
            }
            else if (counter == 0)
            {
                this.Mario.Velocity     = new Vector2(0, marioDeathVelocity);
                this.Mario.Acceleration = new Vector2(0, marioDeathAcceleration);
                counter--;
            }

            if (this.Mario.Destination.Y > 1000)
            {
                MarioInfo.StopTimer();
                if (MarioInfo.MarioLife[0] == 0)
                {
                    Game1.State.GameOver();
                }
                else
                {
                    Game1.State.MarioDied();
                }
            }
        }
Beispiel #2
0
 private void CheckEndGame()
 {
     if (!isLevelComplete)
     {
         if (IsEndGame())
         {
             Game1.State.Proceed();
             MarioInfo.StopTimer();
             isLevelComplete = true;
             ScoringSystem.AddPointsForPole(mario.Destination);
             IItem flag_ = null;
             foreach (IGameObject obj in itemList)
             {
                 if (obj.GetType() == typeof(Flag))
                 {
                     flag_ = (IItem)obj;
                 }
             }
             victoryAnimation       = new VictoryAnimation(mario, flag_);
             victoryAnimation.State = AnimationState.IsPlaying;
         }
     }
     else
     {
         victoryAnimation.Update();
     }
 }