diff --git a/Shared/LinesOfSight.cs b/Shared/LinesOfSight.cs index 4a26d4a..81746f7 100644 --- a/Shared/LinesOfSight.cs +++ b/Shared/LinesOfSight.cs @@ -68,13 +68,12 @@ namespace SemiColinGames { Vector2 closestHit = Vector2.Add(eyePos, rotated); float hitTime = 1f; - Vector2 halfTileSize = new Vector2(World.TileSize / 2.0f, World.TileSize / 2.0f); for (int j = 0; j < collisionTargets.Length; j++) { AABB box = collisionTargets[j]; - if (Math.Abs(box.Position.X - npc.Position.X) > visionRange + halfTileSize.X) { + if (Math.Abs(box.Position.X - npc.Position.X) > visionRange + box.HalfSize.X) { continue; } - Vector2 delta = Vector2.Add(halfTileSize, Vector2.Subtract(box.Position, eyePos)); + Vector2 delta = Vector2.Add(box.HalfSize, Vector2.Subtract(box.Position, eyePos)); if (delta.LengthSquared() > visionRangeSq) { continue; } diff --git a/Shared/World.cs b/Shared/World.cs index dbfa25a..fcbaf13 100644 --- a/Shared/World.cs +++ b/Shared/World.cs @@ -8,8 +8,6 @@ namespace SemiColinGames { public sealed class World : IDisposable { - public const int TileSize = 16; - // Size of World in terms of tile grid. private int gridWidth; private int gridHeight;