summaryrefslogtreecommitdiff
path: root/src/sliceitoff/screens
diff options
context:
space:
mode:
authorViljami Ilola <+@hix.fi>2024-03-24 01:22:39 +0200
committerViljami Ilola <+@hix.fi>2024-03-24 01:22:39 +0200
commitcd128f5bc4fae39fb7e77683758d437f64eb4203 (patch)
treef4f3efbca3e11e7f6fb73a227ad09ef11918ec48 /src/sliceitoff/screens
parent4353670f0cee67550b20dfcfd51b81386372f358 (diff)
gameover, level x and level up screens
Diffstat (limited to 'src/sliceitoff/screens')
-rw-r--r--src/sliceitoff/screens/__init__.py5
-rw-r--r--src/sliceitoff/screens/gameover.py8
-rw-r--r--src/sliceitoff/screens/level.py9
-rw-r--r--src/sliceitoff/screens/levelup.py42
4 files changed, 38 insertions, 26 deletions
diff --git a/src/sliceitoff/screens/__init__.py b/src/sliceitoff/screens/__init__.py
index 89294bd..ad49657 100644
--- a/src/sliceitoff/screens/__init__.py
+++ b/src/sliceitoff/screens/__init__.py
@@ -1,2 +1,5 @@
-#from .levelup import LevelUp
from .welcome import welcome_screen
+from .levelup import levelup_screen
+from .gameover import gameover_screen
+from .level import level_screen
+
diff --git a/src/sliceitoff/screens/gameover.py b/src/sliceitoff/screens/gameover.py
new file mode 100644
index 0000000..33bda18
--- /dev/null
+++ b/src/sliceitoff/screens/gameover.py
@@ -0,0 +1,8 @@
+from text import TextPage
+
+def gameover_screen():
+ return TextPage(
+ "Game Over!",
+ font = '8x8',
+ size = (24_000, 24_000),
+ pos = (48_000, 108_000) )
diff --git a/src/sliceitoff/screens/level.py b/src/sliceitoff/screens/level.py
new file mode 100644
index 0000000..4a63dc2
--- /dev/null
+++ b/src/sliceitoff/screens/level.py
@@ -0,0 +1,9 @@
+from text import TextPage
+from stats import Stats
+
+def level_screen():
+ return TextPage(
+ f"Level {Stats.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 178160c..0a0468b 100644
--- a/src/sliceitoff/screens/levelup.py
+++ b/src/sliceitoff/screens/levelup.py
@@ -1,27 +1,19 @@
-import os
-import pygame
-
-from display import Scaling
-from images import Images, Fonts
+from text import TextPage
from stats import Stats
-class Status():
- def __init__(self):
- self.sprites = pygame.sprite.Group()
-
- def update(self, dt):
- """ Update sprites basis of dt. dt = milliseconds from last update """
-
- score_str = (
- "{:02d}\x12 {:02d}\xfe {:02d}\x03 "
- "{:02d}\x0e {:08d}\x0f").format(
- Stats.level,
- 99 if Stats.percent == 100 else int(Stats.percent),
- Stats.lives,
- Stats.bonus // 1000,
- Stats.score)
- self.sprites = TextGroup(
- score_str,
- (0, 282_000),
- size = 16_000,
- font = '8x8')
+def levelup_screen():
+ text = (
+ " LEVEL UP BONUS!\n"
+ " ===============\n"
+ "\n"
+ f"Level{Stats.level*3000:7d}pts\n"
+ f"Time{Stats.bonus:8d}pts\n"
+ f"\n"
+ f"Total{Stats.level*3000+Stats.bonus:7d}pts")
+
+ return TextPage(
+ text,
+ font = 'hearst',
+ size = (12_000, 24_000),
+ grid = (14_000, 24_000),
+ pos = (12_000, 6_000) )