From 676a38b90443b735ddfb991192845ef732876647a5168b66489a21d7d13dfe12 Mon Sep 17 00:00:00 2001 From: andrea Date: Sat, 15 Nov 2025 18:14:05 +0100 Subject: [PATCH] items are now correcly shown on the map --- entities/gamemap.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/entities/gamemap.py b/entities/gamemap.py index 3a82710..0547975 100644 --- a/entities/gamemap.py +++ b/entities/gamemap.py @@ -6,7 +6,6 @@ from PIL import ImageDraw as _ImageDraw from utils import logs as _logs from bot_libs import syms as _bot_syms from entities import resource as _resource -from utils import logs as _logs class BrSimMap(): @@ -52,7 +51,10 @@ class BrSimMap(): #if i == 0 or i == self.world_height - 1: self.game_map.append(mon) #else: self.game_map.append(_copy.deepcopy(width)) self.game_map.append(_copy.deepcopy(width)) - _logs.log_debug(f'init_map_matrix: {self.game_map}') + #_logs.log_debug(f'init_map_matrix: {self.game_map}') + _logs.log_debug(f'players: %s'% [(p.get_name(), p.get_coordinates()) for p in self.players]) + print('##') + _logs.log_debug(f'items: %s' % [(p.get_name(), p.get_coordinates()) for p in self.items]) def populate_map(self): for player in self.players: @@ -60,7 +62,7 @@ class BrSimMap(): self.game_map[p_coord_y][p_coord_x]= player for item in self.items: i_coord_x, i_coord_y= item.get_coordinates() - self.game_map[p_coord_y][p_coord_x]= item + self.game_map[i_coord_y][i_coord_x]= item def _put_resource_on_map(self, target): #x= _random.randint(1, self.world_width -2) # from 1 to width-2 because 1 cell is occupied by the mountain