summaryrefslogtreecommitdiff
path: root/src/sliceitoff/stats
diff options
context:
space:
mode:
authorViljami Ilola <+@hix.fi>2024-03-27 15:06:36 +0200
committerViljami Ilola <+@hix.fi>2024-03-27 15:06:36 +0200
commit61a1248e340d1c87a6c4e7dec77f1089984b87b6 (patch)
tree04165f605169b72aba0d83e507927ad933e7fddd /src/sliceitoff/stats
parent70c4a0e3de169d37ae1d53868d2eaa916b89034f (diff)
slicing reduces score
Diffstat (limited to 'src/sliceitoff/stats')
-rw-r--r--src/sliceitoff/stats/stats.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/sliceitoff/stats/stats.py b/src/sliceitoff/stats/stats.py
index 4024e53..79da2c9 100644
--- a/src/sliceitoff/stats/stats.py
+++ b/src/sliceitoff/stats/stats.py
@@ -32,6 +32,11 @@ class Stats:
def lose_life():
__class__.lives -= 1
return not __class__.lives
+
+ @staticmethod
+ def add_score(score_to_add):
+ __class__.score += score_to_add
+ __class__.score = max(0, __class__.score)
@staticmethod
def calc_bonus():