Merge remote-tracking branch 'origin/master' into player_move
# Conflicts: # dungeonbattle/interfaces.py # dungeonbattle/interfaces_test.py
This commit is contained in:
@ -11,10 +11,11 @@ class Map:
|
||||
height: int
|
||||
tiles: list
|
||||
|
||||
def __init__(self, width: int, height: int, tiles: list):
|
||||
def __init__(self, width: int, height: int, tiles: list, entities: list):
|
||||
self.width = width
|
||||
self.height = height
|
||||
self.tiles = tiles
|
||||
self.entities = entities
|
||||
|
||||
@staticmethod
|
||||
def load(filename: str):
|
||||
@ -36,7 +37,7 @@ class Map:
|
||||
width = len(lines[0])
|
||||
tiles = [[Tile(c)
|
||||
for x, c in enumerate(line)] for y, line in enumerate(lines)]
|
||||
return Map(width, height, tiles)
|
||||
return Map(width, height, tiles, [])
|
||||
|
||||
def draw_string(self) -> str:
|
||||
"""
|
||||
@ -63,8 +64,14 @@ class Tile(Enum):
|
||||
|
||||
|
||||
class Entity:
|
||||
x: int
|
||||
y: int
|
||||
x: int
|
||||
img: str
|
||||
|
||||
def __init__(self, y: int, x: int, img: str):
|
||||
self.y = y
|
||||
self.x = x
|
||||
self.img = img
|
||||
|
||||
def move(self, x: int, y: int) -> None:
|
||||
self.x = x
|
||||
|
Reference in New Issue
Block a user