public override void Update(GameTime gameTime)
        {
            InputManager.Instance.BeginInput();
            SceneManagement.Instance?.Update(gameTime);
            Camera.Instance.Update();
            Debug.Update();

            base.Update(gameTime);
        }
Пример #2
0
        protected override void Update(GameTime gameTime)
        {
            _currentKeyboardState = Keyboard.GetState();


            //bloom.Update();
            GUI.GUI.Draw(spriteBatch);

            if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed || Keyboard.GetState().IsKeyDown(Keys.Escape))
            {
                Exit();
            }

            if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed || Keyboard.GetState().IsKeyDown(Keys.F12))
            {
                Reset();
            }

            // Save Game
            if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed || Keyboard.GetState().IsKeyDown(Keys.F11))
            {
                GameManager.SaveGame();
            }

            // Loads Game
            if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed || Keyboard.GetState().IsKeyDown(Keys.F10))
            {
                GameManager.LoadGame();
            }
            GameManager.Update();

            mousePosition = new Vector2(Mouse.GetState().X, Mouse.GetState().Y);
            worldPosition = Vector2.Transform(mousePosition, Matrix.Invert(camera.transform));

            if (!Debug.Console.showDebug)
            {
                SceneManagement.CurrentScene.Update(gameTime);
            }
            ProjectileManager.Update(gameTime);


            ParticleSystem.Update(gameTime);

            Debug.Update();

            game = this;
            camera.Update();

            base.Update(gameTime);

            GifStuff(gameTime);

            //GifStuff(gameTime);
            _previousKeyboardState = _currentKeyboardState;
        }