forked from Cryz/battle_royale_sim
debug.py now has a list of 2 actions, attack and move, and every player get a random action from this list
This commit is contained in:
@@ -35,6 +35,7 @@ class BrSimMap():
|
||||
# 📦 this is an item (weapon or another item)
|
||||
# 💀 this is icon when the player is dead
|
||||
# ⛰️ this is icon for the mountain (We can prevent players from passing through the mountains and thus use them for map boundaries.)
|
||||
self.game_map= []
|
||||
|
||||
width= []
|
||||
#mon = []
|
||||
@@ -88,6 +89,19 @@ class BrSimMap():
|
||||
|
||||
def get_map_matrix(self):
|
||||
return self.game_map
|
||||
|
||||
def get_player_available_directions(self, Player):
|
||||
coord_x, coord_y= Player.get_player_coordinates()
|
||||
avail_directions= []
|
||||
if self.get_map_matrix()[coord_x - 1][coord_y] not in [self.mountain_sym]:
|
||||
avail_directions.append((-1, 0, 'left'))
|
||||
if self.get_map_matrix()[coord_x + 1][coord_y] not in [self.mountain_sym]:
|
||||
avail_directions.append((1, 0, 'right'))
|
||||
if self.get_map_matrix()[coord_x][coord_y - 1] not in [self.mountain_sym]:
|
||||
avail_directions.append((0, -1, 'up'))
|
||||
if self.get_map_matrix()[coord_x][coord_y + 1] not in [self.mountain_sym]:
|
||||
avail_directions.append((0, 1, 'bottom'))
|
||||
return avail_directions
|
||||
|
||||
def get_renderized_map(self):
|
||||
res= ''
|
||||
|
||||
Reference in New Issue
Block a user