|
|
@ -90,7 +90,7 @@ namespace SemiColinGames { |
|
|
|
public const int TileSize = 16; |
|
|
|
readonly Tile[] tiles; |
|
|
|
readonly Tile[] decorations; |
|
|
|
readonly NPC[] npcs = new NPC[1]; |
|
|
|
readonly NPC[] npcs = new NPC[4]; |
|
|
|
|
|
|
|
// Size of World in terms of tile grid.
|
|
|
|
private readonly int tileWidth; |
|
|
@ -109,7 +109,11 @@ namespace SemiColinGames { |
|
|
|
|
|
|
|
public World(string levelSpecification) { |
|
|
|
Player = new Player(); |
|
|
|
npcs[0] = new NPC(new Point(16 * 38, 16 * 12)); |
|
|
|
npcs[0] = new NPC(new Point(16 * 8, 16 * 6)); |
|
|
|
npcs[1] = new NPC(new Point(16 * 28, 16 * 6)); |
|
|
|
npcs[2] = new NPC(new Point(16 * 36, 16 * 6)); |
|
|
|
npcs[3] = new NPC(new Point(16 * 36, 16 * 12)); |
|
|
|
|
|
|
|
var tilesList = new List<Tile>(); |
|
|
|
var decorationsList = new List<Tile>(); |
|
|
|
string[] worldDesc = levelSpecification.Substring(1).Split('\n'); |
|
|
@ -158,9 +162,9 @@ namespace SemiColinGames { |
|
|
|
} |
|
|
|
|
|
|
|
public void Update(float modelTime, History<Input> input) { |
|
|
|
Player.Update(modelTime, input, CollisionTargets); |
|
|
|
Player.Update(modelTime, CollisionTargets, input); |
|
|
|
foreach (NPC npc in npcs) { |
|
|
|
npc.Update(modelTime); |
|
|
|
npc.Update(modelTime, CollisionTargets); |
|
|
|
} |
|
|
|
if (Player.Health <= 0) { |
|
|
|
Reset(); |
|
|
|