/// <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) { graphics.GraphicsDevice.Clear(Color.CornflowerBlue); spriteBatch.Begin(); if (flock != null) { flock.Draw(spriteBatch, gameTime); } if (cat != null) { cat.Draw(spriteBatch, gameTime); } // Draw all the HUD elements DrawBar(barDetectionDistance, flockParams.DetectionDistance / 100f, "Detection Distance:", gameTime, selectionNum == 0); DrawBar(barSeparationDistance, flockParams.SeparationDistance / 100f, "Separation Distance:", gameTime, selectionNum == 1); spriteBatch.Draw(bButton, new Vector2(hudLocX + 110.0f, hudLocY), Color.White); spriteBatch.Draw(xButton, new Vector2(hudLocX + 110.0f, hudLocY + 20.0f), Color.White); spriteBatch.Draw(yButton, new Vector2(hudLocX + 110.0f, hudLocY + 40.0f), Color.White); spriteBatch.DrawString(hudFont, "Reset Distances", new Vector2(hudLocX + 135.0f, hudLocY), Color.White); spriteBatch.DrawString(hudFont, "Reset flock", new Vector2(hudLocX + 135.0f, hudLocY + 20.0f), Color.White); spriteBatch.DrawString(hudFont, "Spawn/remove cat", new Vector2(hudLocX + 135.0f, hudLocY + 40.0f), Color.White); spriteBatch.End(); base.Draw(gameTime); }