コード例 #1
0
        /// <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
        }
コード例 #2
0
        public void Update(GameTime gameTime)
        {
            scenes.Update(gameTime);

            if (scenes.Count == 0)
            {
                NoMoreScenes?.Invoke();
            }
        }
コード例 #3
0
        /// <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);
        }
コード例 #4
0
 public void Update(GameTime gameTime)
 {
     sceneStack.Update(gameTime);
 }
コード例 #5
0
ファイル: XleProgram.cs プロジェクト: eylvisaker/Xle
        public void Update(GameTime gameTime)
        {
            consoleManager.Update(gameTime);

            scenes.Update(gameTime);
        }