Fix up all the runtime errors caused by the previous refactoring

This commit is contained in:
Eryn Wells 2022-05-01 09:51:22 -07:00
parent f1b95a697e
commit a54828c7fb
4 changed files with 40 additions and 20 deletions

View file

@ -30,10 +30,11 @@ class Engine:
first_room = self.map.rooms[0]
player_start_position = first_room.midpoint
self.player = Entity('@', tcod.white, x=player_start_position.x, y=player_start_position.y)
self.player = Entity('@', position=player_start_position, fg=tcod.white)
self.entities: AbstractSet[Entity] = {self.player}
for _ in range(self.rng.randint(1, 15)):
self.entities.add(Entity('@', color=tcod.yellow, x=self.rng.randint(0, map_size.width), y=self.rng.randint(0, map_size.height)))
position = Point(self.rng.randint(0, map_size.width), self.rng.randint(0, map_size.height))
self.entities.add(Entity('@', position=position, fg=tcod.yellow))
def handle_event(self, event: tcod.event.Event):
action = self.event_handler.dispatch(event)