public void Reset() { LoadContent(); Camera2D.ResetCamera(); MarioAttributes.ResetTimer(); MarioAttributes.StartTimer(); }
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(); } } }
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); }