define players and items coordinates to be used on the map

This commit is contained in:
andrea
2025-07-27 23:34:35 +02:00
parent a7fd66e9e4
commit 5e6816269b
4 changed files with 31 additions and 15 deletions

View File

@@ -15,7 +15,6 @@ class BrSimMap():
self.init_map_matrix()
def init_map_matrix(self):
# TODO map matrix:
# show a matrix representing the game's map
# 🟩 is and empty cell
# (tomorrow we can choose different colors for different locations
@@ -27,11 +26,12 @@ class BrSimMap():
width.append(self.field_sym)
for i in range(self.world_height):
self.game_map.append(width)
# TODO add players and items on map
for player in self.players:
self.game_map[player.coord_y][player.coord_x]= self.player_sym
p_coord_x, p_coord_y= players.get_player_coordinates()
self.game_map[p_coord_y][p_coord_x]= self.player_sym
for item in self.items:
self.game_map[item.coord_y][item.coord_x]= self.item_sym
i_coord_x, i_coord_y= item.get_item_coordinates()
self.game_map[i_coord_y][i_coord_x]= self.item_sym
_logs.log_debug(f'init_map_matrix: {self.game_map}')
def get_map_matrix(self):