Compare commits

...

2 Commits

Author SHA1 Message Date
06eac128c2 LinesOfSight: make vision cones red 2020-03-09 14:59:14 -04:00
437130ab55 Scene: always draw LinesOfSight 2020-03-09 14:57:39 -04:00
2 changed files with 3 additions and 7 deletions

View File

@ -19,7 +19,7 @@ namespace SemiColinGames {
// The number of total triangles drawn is one less than the number of edge points.
readonly int[] indices = new int[(NUM_EDGE_VERTICES - 1) * 3];
Color color = Color.FromNonPremultiplied(new Vector4(0, 0, 1, 0.6f));
Color color = Color.FromNonPremultiplied(new Vector4(1, 0, 0, 0.5f));
public LinesOfSight(GraphicsDevice graphics) {
for (int i = 0; i < MAX_NPCS; i++) {
@ -88,9 +88,7 @@ namespace SemiColinGames {
}
}
float tint = 0.6f - hitTime / 2;
Color tinted = Color.FromNonPremultiplied(new Vector4(0, 0, 1, tint));
coneVertices[index][i + 1] = new VertexPositionColor(new Vector3(closestHit, 0), tinted);
coneVertices[index][i + 1] = new VertexPositionColor(new Vector3(closestHit, 0), color);
}
}

View File

@ -86,9 +86,7 @@ namespace SemiColinGames {
// Draw lines of sight.
basicEffect.Projection = camera.Projection;
if (Debug.Enabled) {
world.LinesOfSight.Draw(graphics, basicEffect);
}
world.LinesOfSight.Draw(graphics, basicEffect);
// Set up transformation matrix for drawing world objects.
Matrix transform = Matrix.CreateTranslation(-camera.Left, -camera.Top, 0);