private void DrawPlayingState(SpriteBatch spriteBatch) { GraphicsDevice.SetRenderTarget(renderTarget01); GraphicsDevice.Clear(Color.Black); // TODO: Add your drawing code here spriteBatch.Begin(); Utility.board.Draw(spriteBatch); if (latestHoveredOverTower != null) { hud.DrawRangeIndicators(spriteBatch, new Point(latestHoveredOverTower.X, latestHoveredOverTower.Y), latestHoveredOverTower); } // Highlight needs to be drawn before the actual towers if (previewTower != null) { if (IsWithinDimensions()) { hud.DrawPlacementIndicator(spriteBatch, previewTower, IsValidTileForTower(input.MouseToGameGrid().X, input.MouseToGameGrid().Y)); } selectedTower.DrawSelectionHightlight(spriteBatch); } foreach (Tower t in Utility.TowerList) { t.Draw(spriteBatch); } foreach (Path p in Utility.board.Paths) { p.DrawMinions(spriteBatch); } // Draw projectiles and fire effect foreach (Tower t in Utility.TowerList) { if (t is Shotgun) { (t as Shotgun).DrawProjectiles(spriteBatch); } if (t is FlameThrower) { (t as FlameThrower).DrawFireEffect(spriteBatch); } } spriteBatch.End(); GraphicsDevice.SetRenderTarget(null); spriteBatch.Begin(); spriteBatch.Draw(renderTarget01, new Vector2(0, 0), Color.White); spriteBatch.End(); // Draw sideBar spriteBatch.Begin(); if (latestHoveredOverTower != null) { sidebarUI.DrawTowerInfo(spriteBatch, latestHoveredOverTower); } sidebarUI.Draw(spriteBatch); spriteBatch.End(); latestHoveredOverTower = null; }