mirror of
https://github.com/Stone-Red-Code/LargeGridPathfinding.git
synced 2026-09-04 09:06:12 +02:00
Change saturation of zone rectangles and outline weighted cells when zones visible
This commit is contained in:
@@ -461,7 +461,8 @@ public class LargeGridPathfindingGame : Game
|
|||||||
{
|
{
|
||||||
Color color = colorLookup[label % 28];
|
Color color = colorLookup[label % 28];
|
||||||
|
|
||||||
spriteBatch.FillRectangle(new Rectangle(rectangle.X * 10, rectangle.Y * 10, rectangle.Width * 10, rectangle.Height * 10), color, layerDepth: 0.2f);
|
spriteBatch.FillRectangle(new Rectangle(rectangle.X * 10, rectangle.Y * 10, rectangle.Width * 10, rectangle.Height * 10), Color.Lerp(color, Color.Gray, 0.55f), layerDepth: 0.2f);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -479,8 +480,16 @@ public class LargeGridPathfindingGame : Game
|
|||||||
{
|
{
|
||||||
float blendFactor = Math.Clamp((cellWeight - 1) / 8f, 0f, 1f);
|
float blendFactor = Math.Clamp((cellWeight - 1) / 8f, 0f, 1f);
|
||||||
Color weightColor = Color.Lerp(Color.LightYellow, Color.DarkOrange, blendFactor);
|
Color weightColor = Color.Lerp(Color.LightYellow, Color.DarkOrange, blendFactor);
|
||||||
|
|
||||||
|
if (showZones)
|
||||||
|
{
|
||||||
|
spriteBatch.DrawRectangle(cellRect, weightColor * 0.75f, layerDepth: 0.25f);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
spriteBatch.FillRectangle(cellRect, weightColor * 0.75f, layerDepth: 0.25f);
|
spriteBatch.FillRectangle(cellRect, weightColor * 0.75f, layerDepth: 0.25f);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (cellValue < 0)
|
if (cellValue < 0)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user