/// <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 CONTENT_MANAGER.inputState = new InputState(Mouse.GetState(), Keyboard.GetState()); if (HelperFunction.IsKeyPress(Keys.F1)) { SCREEN_MANAGER.goto_screen("TestAnimationScreen"); } if (HelperFunction.IsKeyPress(Keys.F2)) { Unit.Load(); CONTENT_MANAGER.ShowMessageBox("Unit stats reloaded"); } if (HelperFunction.IsKeyPress(Keys.F3)) { SCREEN_MANAGER.goto_screen("TestConsole"); } SCREEN_MANAGER.Update(gameTime); lastInputState = inputState; base.Update(gameTime); }
/// <summary> /// LoadContent will be called once per game and is the place to load /// all of your content. /// </summary> protected override void LoadContent() { // Create a new SpriteBatch, which can be used to draw textures. CONTENT_MANAGER.spriteBatch = new SpriteBatch(GraphicsDevice); CONTENT_MANAGER.inputState = new InputState(Mouse.GetState(), Keyboard.GetState()); CONTENT_MANAGER.LoadContent(); InitScreen(); }