From 61a1248e340d1c87a6c4e7dec77f1089984b87b6 Mon Sep 17 00:00:00 2001 From: Viljami Ilola <+@hix.fi> Date: Wed, 27 Mar 2024 15:06:36 +0200 Subject: slicing reduces score --- src/sliceitoff/stats/stats.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/sliceitoff/stats') 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(): -- cgit v1.2.3