internal override void Update(GameTime gameTime, InputHandler input)
 {
     if (input.WasKeyPressed(Keys.Tab))
     {
         manager.Push(new ConsoleState());
     }
 }
        /// <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();
            if (input.WasKeyPressed(Keys.Escape))
            {
                Exit();
            }

            manager.Update(gameTime, input);

            base.Update(gameTime);
        }
Example #3
0
        internal void Update(GameTime gameTime, InputHandler input)
        {
            Time_Since_Last_Cursor_Blink += (float)gameTime.ElapsedGameTime.TotalSeconds;
            if (Time_Since_Last_Cursor_Blink > CursorBlinkTime)
            {
                CursorBlink = !CursorBlink;
                Time_Since_Last_Cursor_Blink -= CursorBlinkTime;
            }

            foreach (Keys key in recognizedKeys)
            {
                if (input.WasKeyPressed(key))
                {
                    HandleInput(key);
                }
            }
        }
Example #4
0
        internal override void Update(GameTime gameTime, InputHandler input)
        {
            if (input.WasKeyPressed(Keys.Enter))
            {
                string source = console.ReadLine();

                interpreter.Interpret(source);
                if (interpreter.HasErrors)
                {
                    console.WriteLine(interpreter.PresentErrors());
                }
                else
                {
                    console.WriteLine(interpreter.result);
                }
            }

            console.Update(gameTime, input);
        }