From 20b23c0cd4cf613a2634cc57bf6f2430cc9fc364 Mon Sep 17 00:00:00 2001 From: Viljami Ilola <+@hix.fi> Date: Sun, 31 Mar 2024 13:47:27 +0300 Subject: Mainmenu selector sprite group --- src/sliceitoff/screens/mainmenu.py | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'src/sliceitoff/screens') diff --git a/src/sliceitoff/screens/mainmenu.py b/src/sliceitoff/screens/mainmenu.py index e4c2dc1..2eacefe 100644 --- a/src/sliceitoff/screens/mainmenu.py +++ b/src/sliceitoff/screens/mainmenu.py @@ -1,17 +1,22 @@ """ screens.mainmenu - Screen for mainmenu""" -from randon import randrange +from random import randrange from text import TextPage def mainmenu_screen(selection): """ Screen where current selection is flashing """ - color = randrange(0xe0,0xf0) + active = randrange(0xe0,0xf0) + inactive = 0xe8 return TextPage( f" Slice it off!!\n" - f"\n" - f"{color if selection == 0 else '\xe8'}New Game" - f"{color if selection == 0 else '\xe8'}High Scores\n" - f"{color if selection == 0 else '\xe8'}Instructions\n" - f"{color if selection == 0 else '\xe8'}Quit, Why?", + f"\n\n" + f"{chr(active if selection == 0 else inactive)}" + f"New Game\n\n" + f"{chr(active if selection == 1 else inactive)}" + f"High Scores\n\n" + f"{chr(active if selection == 2 else inactive)}" + f"Instructions\n\n" + f"{chr(active if selection == 3 else inactive)}" + f"Quit, Why?", font = '8x8', size = (16_000, 16_000), pos = (24_000, 32_000) ) -- cgit v1.2.3