Monsters are hedgehogs 🦔

This commit is contained in:
Yohann D'ANELLO
2020-11-10 21:47:36 +01:00
parent 3f374d2558
commit 3f4c809db6
8 changed files with 24 additions and 15 deletions

View File

@ -14,6 +14,7 @@ class Map:
width: int
height: int
tiles: List[List["Tile"]]
entities: List["Entity"]
# coordinates of the point that should be
# on the topleft corner of the screen
currentx: int
@ -73,7 +74,7 @@ class Map:
def spawn_random_entities(self, count: int) -> None:
"""
Put randomly {count} squirrels on the map, where it is available.
Put randomly {count} hedgehogs on the map, where it is available.
"""
for _ in range(count):
y, x = 0, 0
@ -82,10 +83,10 @@ class Map:
tile = self.tiles[y][x]
if tile.can_walk():
break
from dungeonbattle.entities.monsters import Squirrel
squirrel = Squirrel()
squirrel.move(y, x)
self.add_entity(squirrel)
from dungeonbattle.entities.monsters import Hedgehog
hedgehog = Hedgehog()
hedgehog.move(y, x)
self.add_entity(hedgehog)
class Tile(Enum):