Exemple #1
0
 public void Reset()
 {
     LoadContent();
     Camera2D.ResetCamera();
     MarioAttributes.ResetTimer();
     MarioAttributes.StartTimer();
 }
Exemple #2
0
        public override void Update()
        {
            if (counter > 0)
            {
                counter--;
            }
            else if (counter == 0)
            {
                this.Mario.Velocity     = new Vector2(GameUtilities.StationaryVelocity, -marioDeathBounceVelocity);
                this.Mario.Acceleration = new Vector2(GameUtilities.StationaryAcceleration, marioDeathBounceAccel);
                counter--;
            }

            if (this.Mario.Destination.Y > GameUtilities.Game.GraphicsManager.PreferredBackBufferHeight + 500 * GameUtilities.SinglePixel)
            {
                MarioAttributes.StopTimer();

                if (GameUtilities.Game.State.Type == GameStates.Competitive)
                {
                    GameUtilities.Game.State.GameOver();
                    return;
                }

                if (MarioAttributes.MarioLife[mario.Player] == 0)
                {
                    GameUtilities.Game.State.GameOver();
                }
                else
                {
                    GameUtilities.Game.State.MarioDied();
                }
            }
        }
Exemple #3
0
        protected override void Update(GameTime gameTime)
        {
            if (IsControllerEnable)
            {
                keyboardPlayer1.Update();
                keyboardPlayer2.Update();
                gamePad1.Update();
                gamePad2.Update();
            }

            if (!(State.Type == GameStates.Pause || State.Type == GameStates.CompetitivePause))
            {
                allObjectsManager.Update();
            }

            Camera2D.Move(allObjectsManager.MarioPlayer1);
            MarioAttributes.tick(gameTime);
            HurrySoundManager.Instance.CheckForHurry();
            base.Update(gameTime);
        }