|
@ -22,6 +22,7 @@ namespace SemiColinGames { |
|
|
public Player Player { get; private set; } |
|
|
public Player Player { get; private set; } |
|
|
public AABB[] CollisionTargets { get; } |
|
|
public AABB[] CollisionTargets { get; } |
|
|
public LinesOfSight LinesOfSight { get; private set; } |
|
|
public LinesOfSight LinesOfSight { get; private set; } |
|
|
|
|
|
public Camera Camera { get; } |
|
|
|
|
|
|
|
|
// Size of World in pixels.
|
|
|
// Size of World in pixels.
|
|
|
public int Width { |
|
|
public int Width { |
|
@ -33,6 +34,7 @@ namespace SemiColinGames { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public World(GraphicsDevice graphics, string json) { |
|
|
public World(GraphicsDevice graphics, string json) { |
|
|
|
|
|
Camera = new Camera(); |
|
|
LinesOfSight = new LinesOfSight(graphics); |
|
|
LinesOfSight = new LinesOfSight(graphics); |
|
|
|
|
|
|
|
|
JObject root = JObject.Parse(json); |
|
|
JObject root = JObject.Parse(json); |
|
@ -162,6 +164,7 @@ namespace SemiColinGames { |
|
|
Reset(); |
|
|
Reset(); |
|
|
} |
|
|
} |
|
|
LinesOfSight.Update(npcs, CollisionTargets); |
|
|
LinesOfSight.Update(npcs, CollisionTargets); |
|
|
|
|
|
Camera.Update(Player.Position, Width); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// Draws everything that's behind the player, from back to front.
|
|
|
// Draws everything that's behind the player, from back to front.
|
|
|