Update() public méthode

public Update ( ) : void
Résultat void
Exemple #1
0
        protected override void Update(GameTime time)
        {
            if (TheGame.GameStatus == GameManager.Status.RUNNING)
            {
                if (GameInput.Self.KeyPressed(Keys.Escape))
                {
                    Exit();
                }
            }

            camera.ViewportWidth  = GraphicsDevice.PresentationParameters.BackBufferWidth;
            camera.ViewportHeight = GraphicsDevice.PresentationParameters.BackBufferHeight;

            if (TheGame.Debugging)
            {
                if (GameInput.Self.KeyDown(Keys.OemPlus))
                {
                    camera.AdjustZoom(0.02f);
                }
                if (GameInput.Self.KeyDown(Keys.OemMinus))
                {
                    camera.AdjustZoom(-0.02f);
                }
            }

            // TODO: Add your update logic here
            world.Update(time);

            TheGame.Update(time);
            GameInput.Self.Update();
            gsm.Update(time);
            TimerManager.Self.Update(time);

            base.Update(time);
        }
Exemple #2
0
    protected override void Update(GameTime gameTime)
    {
        HandleInput();
        multiplayerManager.Update(gameTime);
        gameStateManager.Update(gameTime);
        ScreenFade.Update(gameTime);
        if (quitGame)
        {
            Exit();
        }

        int outputx = 0;

        for (int i = output.Count - 1; i >= 0; i--)
        {
            output[i].Update(gameTime);
            if (output[i].Timer <= 0)
            {
                output.RemoveAt(i);
            }
            else
            {
                output[i].Position = new Vector2(60, outputx);
                outputx           += 30;
            }
        }
    }
Exemple #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)
        {
            Input.Update();

            // update current scene
            GameStates.Update(gameTime);

            base.Update(gameTime);
        }
Exemple #4
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();
            }

            gameStateManager.Update(gameTime);
            base.Update(gameTime);
        }
Exemple #5
0
        /// <summary>
        /// Allows the game component to update itself and updates the active scene.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        public override void Update(GameTime gameTime)
        {
            GameTime = gameTime;
            InputManagerExtension.UpdateInputStates(gameTime);
            GameStateManager.Update(gameTime);
            EntityWorld.SystemManager.UpdateSynchronous(SystemExecutionType.Update);
            GuiManager.Update(gameTime);

            base.Update(gameTime);
        }
Exemple #6
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)
        {
            GraphicsDevice.Clear(Color.Black);

            if (StateManager.Update(gameTime) == false)
            {
                Exit();
            }
            base.Update(gameTime);
        }
Exemple #7
0
        protected override void Update(GameTime gameTime)
        {
            gsm.Update(gameTime);

            if (Data.Exit == true)
            {
                this.Exit();
            }

            base.Update(gameTime);
        }
Exemple #8
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();
            }

            // TODO: Add your update logic here

            gsm.Update(gameTime);
        }
        protected override void Update(GameTime gameTime)
        {
            if (IsActive)
            {
                VariableProvider.GameTime = gameTime;
                VariableProvider.ScriptEngine.Update(gameTime);
                InputProvider.Update();
                _stateManager.Update();
            }

            base.Update(gameTime);
        }
Exemple #10
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();
            }

            gameStateManager.Update(gameTime.ElapsedGameTime.Milliseconds);
            // TODO: Add your update logic here

            base.Update(gameTime);
        }
        /// <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)
        {
            //System.GC.Collect();

            _audioEngine.Update();

            if (IsActive && !_gameStateManager.Update(gameTime))
            {
                Exit();
            }

            base.Update(gameTime);
        }
Exemple #12
0
        protected override void Update(GameTime gameTime)
        {
            if (!IsActive)
            {
                return;
            }
            _inputManager.KeyState = Keyboard.GetState();

            GameStateManager.Update(gameTime);

            _inputManager.OldKeyState = Keyboard.GetState();
            MessageHandler.Update();
            base.Update(gameTime);
        }
Exemple #13
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)
        {
            // Allows the game to exit
            if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed)
            {
                this.Exit();
            }

            if (Keyboard.GetState().IsKeyDown(Keys.Escape))
            {
                this.Exit();
            }

            state.Update(gameTime);
            if (kinectControls != null)
            {
                kinectControls.Update(gameTime);
            }

            //Bad design, use OOD / Microsoft's GameStateManager code (which is awesome and well thought-out)
            switch (state.currentState)
            {
            case GameStateManager.GameState.Title:
                if (GamePad.GetState(PlayerIndex.One).Buttons.Start == ButtonState.Pressed)
                {
                    state.Transition(GameStateManager.GameState.Playing);
                }
                break;

            case GameStateManager.GameState.Playing:
                UpdatePhysics(gameTime);
                break;

            case GameStateManager.GameState.Score:
                //update players, nothing else
                foreach (var player in players)
                {
                    player.Update(gameTime);
                }
                break;

            case GameStateManager.GameState.Victory:
                break;

            default:
                break;
            }

            base.Update(gameTime);
        }
        /// <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 (gameStateManager.NoState)
            {
                Exit();
                return;
            }
            else
            {
                gameStateManager.HandleInput(gameTime);
                gameStateManager.Update(gameTime);
            }

            base.Update(gameTime);
        }
Exemple #15
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)
        {
            // Allows the game to exit
            if (!gameStateManager.IsActive)
            {
                this.Exit();
            }

            // TODO: Add your update logic here
            gameStateManager.Update(gameTime);

            SoundManager.Update(gameTime);

            base.Update(gameTime);
        }
Exemple #16
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 (Keyboard.GetState().IsKeyDown(Keys.Escape))
            {
                Exit();
            }

            MouseEx.Update();
            KeyboardEx.Update();

            // TODO: Add your update logic here
            _gameStateManager.Update(gameTime);

            base.Update(gameTime);
        }
Exemple #17
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 (Keyboard.GetState().IsKeyDown(Keys.Escape))
            {
                Exit();
            }

            // Debug: Test state switching.
            if (Keyboard.GetState().IsKeyDown(Keys.Right))
            {
                stateManager.EnterState(2);
            }

            stateManager.Update(gameTime);
        }
Exemple #18
0
    public void Update()
    {
        //@todo find a better place for cheats
        // @todo hard coded controls
        if (Input.GetKeyDown(KeyCode.C))
        {
            QLogger.ShowOrHideGUI();
        }

        if (gameStateManager != null)
        {
            gameStateManager.Update();
        }
        if (uIManager != null)
        {
            uIManager.DoUpdate();
        }
    }
Exemple #19
0
        protected override void Update(GameTime gt)
        {
            if (!UIThreadQueue.IsEmpty && UIThreadQueue.TryDequeue(out Action a))
            {
                try
                {
                    a.Invoke();
                }
                catch (Exception ex)
                {
                    Log.Warn($"Exception on UIThreadQueue: {ex.ToString()}");
                }
            }

            InputManager.Update(gt);

            GuiManager.Update(gt);
            GameStateManager.Update(gt);
            GuiDebugHelper.Update(gt);
        }
Exemple #20
0
        static void Main(string[] args)
        {
            GameStateManager.Init();

            ConfigManager.Init();
            ScreenManager.Init(
                DefaultScreenWidth,
                DefaultScreenHeight,
                true,
                true);
            SoundManager.Init();


            while (GameStateManager.IsRunning())
            {
                GameStateManager.Update(0.0f);
            }

            SoundManager.Shutdown();
            ScreenManager.Shutdown();
            ConfigManager.Shutdown();
        }
Exemple #21
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 (!running)
            {
                Exit();
            }

            inputHelper.Update(gameTime);
            camera.Update(gameTime, inputHelper, KeyManager.Instance);

            // Update current gamestate
            GameStateManager.Update(gameTime);
            GameStateManager.HandleInput(inputHelper, KeyManager.Instance);

            //TIJDELIJKE CODE OMDAT IK GEEN IDEE HEB WAAR IK DIT ANDERS ZOU KUNNEN ZETTEN
            if (inputHelper.KeyPressed(Keys.Escape))
            {
                ToggleFullScreen();
            }
            //EINDE TIJDELIJKE CODE

            base.Update(gameTime);
        }
    void Update()
    {
        stateManager.Update(Time.deltaTime);

        // Just to be safe
        var currentState = GetCurrentState();

        if (currentState != HangingState && currentState != FallingState)
        {
            var oldPos = transform.position;

            if (oldPos.y != 0)
            {
                oldPos.y = 0;
            }
            transform.position = oldPos;
        }

        if (Vector3.Distance(transform.position, antura.transform.position) < 15.0f)
        {
            Scare(antura.transform.position, 5);
            return;
        }
    }
Exemple #23
0
 protected override void Update(GameTime gameTime)
 {
     HandleInput();
     gameStateManager.Update(gameTime);
 }
Exemple #24
0
        protected override void Update(GameTime time)
        {
            if (!IsActive)
            {
                base.Update(time);
                return;
            }

#if !DEBUG
            try
            {
#endif
            if (GumInputMapper.WasConsoleTogglePressed())
            {
                ConsoleVisible = !ConsoleVisible;

                if (ConsoleVisible)
                {
                    var commandPanel = GetConsoleTile("COMMAND");
                    commandPanel.AddCommandEntry();
                    ConsoleGui.SetFocus(commandPanel.Children[0]);
                }
            }

            if (ConsoleVisible)
            {
                ConsoleGui.Update(time);
                if (ConsoleGui.FocusItem != null)
                {
                    DwarfGame.GumInput.FireKeyboardActionsOnly(ConsoleGui);
                }
            }

            PerformanceMonitor.BeginFrame();
            PerformanceMonitor.PushFrame("Update");
            AssetManagement.Steam.Steam.Update();
            DwarfTime.LastTime.Update(time);
            GameStateManager.Update(DwarfTime.LastTime);

            lock (_actionMutex)
            {
                foreach (var action in _lazyActions)
                {
                    action.Action();
                    action.Result?.Invoke();
                }
                _lazyActions.Clear();
            }

            base.Update(time);
            PerformanceMonitor.PopFrame();
#if !DEBUG
        }

        catch (HandledException)
        {
            throw;
        }
        catch (Exception exception)
        {
            Program.CaptureException(exception);
            if (Program.ShowErrorDialog(exception.Message))
            {
                throw new HandledException(exception);
            }
        }
#endif
            HasRendered = false;
        }
 public void Update()
 {
     gameStateManager.Update();
 }
Exemple #26
0
 // Update is called once per frame
 void Update()
 {
     gameStateManager.Update(Time.deltaTime);
 }
Exemple #27
0
 public override void Update(float Dt)
 {
     StateMgr.Update(Dt);
 }
Exemple #28
0
 void Update()
 {
     GameStateManager.Update();
 }
Exemple #29
0
 void Update()
 {
     stateManager.Update(Time.deltaTime);
 }
Exemple #30
0
 public void Update()
 {
     gsm.Update();
 }