namespace Challenge005; public class Game1 : Game { private readonly GraphicsDeviceManager _graphics; private GameManager _gameManager; public Game1() { _graphics = new GraphicsDeviceManager(this); Content.RootDirectory = "Content"; IsMouseVisible = true; } protected override void Initialize() { Globals.WindowSize = new(512, 512); _graphics.PreferredBackBufferWidth = Globals.WindowSize.X; _graphics.PreferredBackBufferHeight = Globals.WindowSize.Y; _graphics.ApplyChanges(); Globals.Content = Content; base.Initialize(); } protected override void LoadContent() { Globals.SpriteBatch = new SpriteBatch(GraphicsDevice); Globals.GraphicsDevice = GraphicsDevice; _gameManager = new(); } protected override void Update(GameTime gameTime) { if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed || Keyboard.GetState().IsKeyDown(Keys.Escape)) Exit(); Globals.Update(gameTime); InputManager.Update(); _gameManager.Update(); base.Update(gameTime); } protected override void Draw(GameTime gameTime) {; GraphicsDevice.Clear(Color.Gray); _gameManager.Draw(); base.Draw(gameTime); } }