Example #1
0
        protected override void Update(GameTime gameTime)
        {
            if (IsActive && !PauseGame)
            {
                if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed || Keyboard.GetState().IsKeyDown(Keys.Escape))
                {
                    Close(true);
                }

                // Update important scripts first
                foreach (Component Scr in BaseScripts.ToList())
                {
                    Scr.Update();
                }

                MyGame.Main.Update();

                Level.Update();
            }

            base.Update(gameTime);
        }