From f502b21183d307fcab9b353aa18609d15c3547f1 Mon Sep 17 00:00:00 2001 From: Viljami Ilola <+@hix.fi> Date: Thu, 28 Mar 2024 13:54:00 +0200 Subject: hiscores: loading, saving, screen --- src/sliceitoff/screens/__init__.py | 3 ++- src/sliceitoff/screens/hiscore.py | 14 -------------- src/sliceitoff/screens/hiscores.py | 9 +++++++++ src/sliceitoff/screens/initials.py | 14 ++++++++++++++ 4 files changed, 25 insertions(+), 15 deletions(-) delete mode 100644 src/sliceitoff/screens/hiscore.py create mode 100644 src/sliceitoff/screens/hiscores.py create mode 100644 src/sliceitoff/screens/initials.py (limited to 'src/sliceitoff/screens') diff --git a/src/sliceitoff/screens/__init__.py b/src/sliceitoff/screens/__init__.py index 1d373f6..d448890 100644 --- a/src/sliceitoff/screens/__init__.py +++ b/src/sliceitoff/screens/__init__.py @@ -2,4 +2,5 @@ from .welcome import welcome_screen from .levelup import levelup_screen from .gameover import gameover_screen from .level import level_screen -from .hiscore import hiscore_screen +from .initials import initials_screen +from .hiscores import hiscores_screen diff --git a/src/sliceitoff/screens/hiscore.py b/src/sliceitoff/screens/hiscore.py deleted file mode 100644 index c6f2a21..0000000 --- a/src/sliceitoff/screens/hiscore.py +++ /dev/null @@ -1,14 +0,0 @@ -from text import TextPage - -def hiscore_screen(name): - return TextPage( - f" New High Score!\n" - f"\n" - f"\n" - f"Please give name:\n" - f"\n" - f"\n" - f"{name:^17s}", - font = '8x8', - size = (16_000, 16_000), - pos = (24_000, 32_000) ) diff --git a/src/sliceitoff/screens/hiscores.py b/src/sliceitoff/screens/hiscores.py new file mode 100644 index 0000000..98bfd46 --- /dev/null +++ b/src/sliceitoff/screens/hiscores.py @@ -0,0 +1,9 @@ +from text import TextPage + +def hiscores_screen(score_text): + return TextPage( + score_text, + font = 'lcd', + size = (8_000, 16_000), + grid = (9_000, 14_000), + pos = (8_000, 0_000) ) diff --git a/src/sliceitoff/screens/initials.py b/src/sliceitoff/screens/initials.py new file mode 100644 index 0000000..aadb141 --- /dev/null +++ b/src/sliceitoff/screens/initials.py @@ -0,0 +1,14 @@ +from text import TextPage + +def initials_screen(name): + return TextPage( + f" New High Score!\n" + f"\n" + f"\n" + f"Please give name:\n" + f"\n" + f"\n" + f"{name:^17s}", + font = '8x8', + size = (16_000, 16_000), + pos = (24_000, 32_000) ) -- cgit v1.2.3