summaryrefslogtreecommitdiff
path: root/src/sliceitoff/screens
diff options
context:
space:
mode:
authorViljami Ilola <+@hix.fi>2024-03-29 00:30:39 +0200
committerViljami Ilola <+@hix.fi>2024-03-29 00:30:39 +0200
commit5c5df6e068b2957987cb51b34d6930769424f8ca (patch)
tree1f6ce6ff479ee787a3da6f51a9c337bcd24b841a /src/sliceitoff/screens
parent27c7e16e4bd808ce1176f18b7a78c02ff4fa88ee (diff)
stats as object
Diffstat (limited to 'src/sliceitoff/screens')
-rw-r--r--src/sliceitoff/screens/level.py4
-rw-r--r--src/sliceitoff/screens/levelup.py15
2 files changed, 9 insertions, 10 deletions
diff --git a/src/sliceitoff/screens/level.py b/src/sliceitoff/screens/level.py
index 4a63dc2..ea298ad 100644
--- a/src/sliceitoff/screens/level.py
+++ b/src/sliceitoff/screens/level.py
@@ -1,9 +1,9 @@
from text import TextPage
from stats import Stats
-def level_screen():
+def level_screen(level):
return TextPage(
- f"Level {Stats.level}!",
+ f"Level {level}!",
font = '8x8',
size = (24_000, 24_000),
pos = (48_000, 108_000) )
diff --git a/src/sliceitoff/screens/levelup.py b/src/sliceitoff/screens/levelup.py
index 9331020..ef48b7b 100644
--- a/src/sliceitoff/screens/levelup.py
+++ b/src/sliceitoff/screens/levelup.py
@@ -1,23 +1,22 @@
from text import TextPage
-from stats import Stats
-def levelup_screen():
+def levelup_screen(stats = None):
(
total_bonus,
level_bonus,
life_bonus,
time_bonus,
area_bonus,
- herd_bonus) = Stats.calc_bonus()
+ herd_bonus) = stats.calc_bonus()
text = (
" LEVEL UP BONUS!\n"
" ===============\n"
"\n"
- f"Level{Stats.level:3d}\xee\x12\xef{level_bonus:9d}pts\n"
- f"Lives{Stats.lives:3d}\xec\x03\xef{life_bonus:9d}pts\n"
- f"Time{int(Stats.bonus/1000):4d}\xed\x0e\xef{time_bonus:9d}pts\n"
- f"Area{int(Stats.percent):4d}\xe9\xfe\xef{area_bonus:9d}pts\n"
- f"Herd{Stats.enemies-Stats.field_count:4d}"
+ f"Level{stats.level:3d}\xee\x12\xef{level_bonus:9d}pts\n"
+ f"Lives{stats.lives:3d}\xec\x03\xef{life_bonus:9d}pts\n"
+ f"Time{int(stats.bonus/1000):4d}\xed\x0e\xef{time_bonus:9d}pts\n"
+ f"Area{int(stats.percent):4d}\xe9\xfe\xef{area_bonus:9d}pts\n"
+ f"Herd{stats.enemies-stats.field_count:4d}"
f"\xea\x0f\xef{herd_bonus:9d}pts\n"
f"\n"
f"Bonus{total_bonus:13d}pts\n")