1
0

items are now correcly shown on the map

This commit is contained in:
andrea
2025-11-15 18:14:05 +01:00
parent 054522eaf3
commit 676a38b904

View File

@@ -6,7 +6,6 @@ from PIL import ImageDraw as _ImageDraw
from utils import logs as _logs from utils import logs as _logs
from bot_libs import syms as _bot_syms from bot_libs import syms as _bot_syms
from entities import resource as _resource from entities import resource as _resource
from utils import logs as _logs
class BrSimMap(): class BrSimMap():
@@ -52,7 +51,10 @@ class BrSimMap():
#if i == 0 or i == self.world_height - 1: self.game_map.append(mon) #if i == 0 or i == self.world_height - 1: self.game_map.append(mon)
#else: self.game_map.append(_copy.deepcopy(width)) #else: self.game_map.append(_copy.deepcopy(width))
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): def populate_map(self):
for player in self.players: for player in self.players:
@@ -60,7 +62,7 @@ class BrSimMap():
self.game_map[p_coord_y][p_coord_x]= player self.game_map[p_coord_y][p_coord_x]= player
for item in self.items: for item in self.items:
i_coord_x, i_coord_y= item.get_coordinates() 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): 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 #x= _random.randint(1, self.world_width -2) # from 1 to width-2 because 1 cell is occupied by the mountain