demo-04-20/menu.py

33 lines
912 B
Python

from draw import *
choices = ("imagination", "tron", "image_clef_usb", "exit")
selection = 0
cursor = 0
try:
while 1:
try:
while 1:
clear_screen()
fancy_text(0, 0, choices[selection].upper().replace("_", " "))
show_screen()
cursor += 1
if cursor == 64:
cursor = 0
selection += 1
if selection == len(choices):
selection = 0
except KeyboardInterrupt:
if choices[selection] == len(choices) - 1:
assert False
draw_string(0, 16, "Loading...")
show_screen()
try:
play = __import__(choices[selection])
except KeyboardInterrupt:
pass
clear_screen()
del play
except AssertionError:
pass