/// <summary> /// Allows the game to run logic such as updating the world, /// checking for collisions, gathering input, and playing audio. /// </summary> /// <param name="gameTime">Provides a snapshot of timing values.</param> protected override void Update(GameTime gameTime) { // Update frame time _dt = (float)gameTime.ElapsedGameTime.TotalSeconds; _fps.Update(gameTime); // Update the current scene if (_scenes.Top != null) { _bgColor = _scenes.Top.WindowBackgroundColor; _scenes.Top.DeltaTime = _dt; } // Check for quit request if (ForceQuit) { Exit(); } _scenes.Update(); _debugConsole.Update(); base.Update(gameTime); // Monogame update }
public void Update(GameTime gameTime) { scenes.Update(gameTime); if (scenes.Count == 0) { NoMoreScenes?.Invoke(); } }
/// <summary> /// Allows the game to run logic such as updating the world, /// checking for collisions, gathering input, and playing audio. /// </summary> /// <param name="gameTime">Provides a snapshot of timing values.</param> protected override void Update(GameTime gameTime) { if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed || Keyboard.GetState().IsKeyDown(Keys.Escape)) { Exit(); } scenes.Update(gameTime); base.Update(gameTime); }
public void Update(GameTime gameTime) { sceneStack.Update(gameTime); }
public void Update(GameTime gameTime) { consoleManager.Update(gameTime); scenes.Update(gameTime); }