Start the hero on the down stairs of the level

This commit is contained in:
Eryn Wells 2023-02-10 22:36:10 -08:00
parent 6c9d01771f
commit 2f9864edd8

View file

@ -74,7 +74,12 @@ class Engine:
self.entities: MutableSet[Entity] = set()
self.hero = Hero(position=self.map.random_walkable_position())
try:
hero_start_position = self.map.up_stairs[0]
except IndexError:
hero_start_position = self.map.random_walkable_position()
self.hero = Hero(position=hero_start_position)
self.entities.add(self.hero)
while len(self.entities) < 25: