public void Draw(PointBatch pointBatch, Camera camera) { // Draw the starfield pointBatch.Begin(Matrix.Identity, camera); for (int s = 0; s < starCount; s++) { pointBatch.Draw(points[s], starRadius, new Color(brightnesses[s], brightnesses[s], brightnesses[s])); } pointBatch.End(); }
public void Draw(Ship ship, LineBatch lineBatch, PointBatch pointBatch, Camera camera) { // Draw the ship Matrix rotation = Matrix.CreateRotationZ(ship.Movement.Rotation); Matrix translation = Matrix.CreateTranslation(new Vector3(ship.Movement.Position.X, ship.Movement.Position.Y, 0.0f)); lineBatch.Begin(rotation * translation, camera); for (int v = 0; v < vertices.Count; v++) { lineBatch.Draw(vertices[v], vertices[(v + 1) % vertices.Count], lineWidth, color); } lineBatch.End(); pointBatch.Begin(translation, camera); pointBatch.Draw(Vector3.Zero, lightRadius, lightColor); pointBatch.End(); }