Compare commits

..

2 Commits

Author SHA1 Message Date
RomulAugustus
521e767741 removed color property, will be in pygame's GUI 2022-07-25 16:53:56 +03:00
RomulAugustus
db23a056ec fixed conditions for adding player marks 2022-07-25 16:53:34 +03:00
2 changed files with 3 additions and 4 deletions

View File

@ -18,7 +18,7 @@ class GameMap:
def add_player_mark(self, x, y, player):
if x <= self.max_size_x and y <= self.max_size_y:
if (x <= self.max_size_x and y <= self.max_size_y) and (x >= 0 and y >= 0):
self.data[(x,y)] = player
player.record_mark(x, y)
else:

View File

@ -1,12 +1,11 @@
class Player():
def __init__(self, name, color):
def __init__(self, name):
self.name = name
self.color = color
self.markList = []
def __str__(self):
return "Player " + self.name + ': ' + "Color - " + self.color + "\n " + str(self.markList)
return "Player " + self.name + ': ' + "\n " + str(self.markList)
def record_mark(self, x, y):