Beispiel #1
0
        public static void Update(double totalMS, double frameMS)
        {
            SortControlsByInfo();

            var first = Gumps.First;

            while (first != null)
            {
                var next = first.Next;

                Control g = first.Value;

                g.Update(totalMS, frameMS);

                if (g.IsDisposed)
                {
                    Gumps.Remove(first);
                }

                first = next;
            }

            GameCursor?.Update(totalMS, frameMS);
            HandleKeyboardInput();
            HandleMouseInput();
        }
        /// <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();
            }
            GameCursor.Update(gameTime);
            Screens.ScreenManager.Update(gameTime);

            base.Update(gameTime);
        }
Beispiel #3
0
        public static void Update(double totalMS, double frameMS)
        {
            SortControlsByInfo();

            for (int i = 0; i < Gumps.Count; i++)
            {
                Control g = Gumps[i];

                g.Update(totalMS, frameMS);

                if (g.IsDisposed)
                {
                    Gumps.RemoveAt(i--);
                }
            }

            GameCursor?.Update(totalMS, frameMS);
            HandleKeyboardInput();
            HandleMouseInput();
        }
Beispiel #4
0
        public static void Update(double totalMS, double frameMS)
        {
            SortControlsByInfo();

            var first = Gumps.First;

            for (var right = first.Next; first != null; first = right, right = right?.Next)
            {
                Control g = first.Value;

                g.Update(totalMS, frameMS);

                if (g.IsDisposed)
                {
                    Gumps.Remove(first);
                }
            }

            GameCursor?.Update(totalMS, frameMS);
            HandleKeyboardInput();
            HandleMouseInput();
        }
Beispiel #5
0
        public void Update(double totalMS, double frameMS)
        {
            SortControlsByInfo();

            for (int i = 0; i < _gumps.Count; i++)
            {
                Control g = _gumps[i];

                if (!g.IsInitialized && !g.IsDisposed)
                {
                    g.Initialize();
                }
                g.Update(totalMS, frameMS);

                if (g.IsDisposed)
                {
                    _gumps.RemoveAt(i--);
                }
            }

            GameCursor?.Update(totalMS, frameMS);
            HandleKeyboardInput();
            HandleMouseInput();
        }