diff --git a/res/tiles.png b/res/tiles.png index 8ff64a6..c5f4674 100644 Binary files a/res/tiles.png and b/res/tiles.png differ diff --git a/src/agent.py b/src/agent.py index 164815d..1bacb73 100644 --- a/src/agent.py +++ b/src/agent.py @@ -1,6 +1,6 @@ class Agent: def __init__(self): - graph = [] + self.graph = [] def inform(self, coordinate_set): pass diff --git a/src/simulation.py b/src/simulation.py index 4318ccf..c5003d7 100644 --- a/src/simulation.py +++ b/src/simulation.py @@ -36,7 +36,7 @@ class TruckEntity(Entity): proposed_pos = self.position + move_vector move_valid = True - if proposed_pos not in self.state.roads_pos: + if proposed_pos not in self.state.roads_pos and proposed_pos not in self.state.houses_pos: move_valid = False if proposed_pos.x < 0 or proposed_pos.x >= self.state.world_limits.x: move_valid = False @@ -76,7 +76,6 @@ class SimulationState: if tile == "O": self.truck_origin = pg.Vector2(x, y) - self.entities.append(TruckEntity(self, self.truck_origin)) self.roads_pos.append(pg.Vector2(x, y)) if tile == "R": self.roads_pos.append(pg.Vector2(x, y)) @@ -95,6 +94,7 @@ class SimulationState: if tile == "Z": self.mixed_dump_pos = pg.Vector2(x, y) self.entities.append(DumpEntity(self, pg.Vector2(x, y), 'mixed')) + self.entities.append(TruckEntity(self, self.truck_origin)) self.world_limits = pg.Vector2(max_x, max_y)