/// <summary> /// This is called when the game should draw itself. /// </summary> /// <param name="gameTime">Provides a snapshot of timing values.</param> protected override void Draw(GameTime gameTime) { GraphicsDevice.Clear(Color.Black); spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, null, null, null, null, WindowScale); MapObject.Draw(spriteBatch); ScoreBoardObject.Draw(spriteBatch); PacmanObject.Draw(spriteBatch, gameTime); GhostManager.Draw(spriteBatch, gameTime); spriteBatch.End(); base.Draw(gameTime); }
/// <summary> /// LoadContent will be called once per game and is the place to load /// all of your content. /// </summary> protected override void LoadContent() { // Flag that causes the game to restart pacmanKilled = false; // Create a new SpriteBatch, which can be used to draw textures. spriteBatch = new SpriteBatch(GraphicsDevice); // Initialize and load map and scoreboard MapObject.LoadContent(Content); ScoreBoardObject.LoadContent(Content); // Load pacman and set starting position PacmanObject.LoadContent(Content, MapObject.GetTile('S')); // Initialize the ghosts GhostManager.LoadContent(Content); }