From 54a0f4213761e11c1f21942b2a64eb5ff4ac6849 Mon Sep 17 00:00:00 2001 From: oto Date: Mon, 15 Aug 2022 07:25:25 +0300 Subject: [PATCH] Added score counting It makes no sense to keep one score for everyone, in GameMap. A design flaw. --- Player.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Player.py b/Player.py index 959c133..7cdf7d4 100644 --- a/Player.py +++ b/Player.py @@ -1,8 +1,9 @@ class Player(): - def __init__(self, name): + def __init__(self, name, personalScore=0): self.name = name self.markList = [] + self.personalScore = personalScore def __str__(self): return "Player " + self.name + ': ' + "\n " + str(self.markList) @@ -18,7 +19,7 @@ class Player(): def add_mark(self, x, y): self.markList.append((x, y)) - + self.personalScore += 10 def clear_mark_list(): self.markList = [] \ No newline at end of file