/// <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.CornflowerBlue); spriteBatch.Begin(); _maze.Draw(spriteBatch); _runner.Draw(spriteBatch); _boss.Draw(spriteBatch); spriteBatch.End(); base.Draw(gameTime); }
private void MazeGame_Paint(object sender, PaintEventArgs e) { maze.Draw(e.Graphics); if (player == null) { createPlayer(); } if (target == null) { createTarget(); } player.Draw(e.Graphics); target.Draw(e.Graphics); Font myFont = new Font("ComicSans", 24); SolidBrush brush = new SolidBrush(Color.Fuchsia); String message = "Level: {0}"; Point p = new Point(730, 10); e.Graphics.DrawString(String.Format(message, levelCount.ToString()), myFont, brush, p); }