Dateien nach "devkit/modules" hochladen

main
Justus Jan Nico Wolff 2024-03-01 13:16:31 +01:00
parent f9b5051b6c
commit d1c647c8cf
5 changed files with 86 additions and 0 deletions

View File

@ -0,0 +1,5 @@
from modules import exists
from modules import WF
from modules import initcom
from modules import rungame
from modules import getgames

View File

@ -0,0 +1,8 @@
def check():
return """
import os
try:
os.stat("games/{}")
print("1")
except OSError:
print("0")"""

View File

@ -0,0 +1,9 @@
def check():
return """
gameman.initgames()
temp = gameman.games
temp2 = temp.copy()
for i in temp2:
temp2[i] = "PH"
print(temp2)
"""

View File

@ -0,0 +1,59 @@
def check():
return """
initlcd()
initGD()
joystick = modules.joystickc()
actionbuttons = modules.actionbuttonsc()
gameman = modules.gamemanager()
def selectoption(title, options, cover=False, covers=[]):
if cover == True and len(covers) != len(options):
raise ValueError("not enough covers!")
if cover == True:
file = open("SC.txt", 'r')
SC = file.read()
SC = eval(SC)
file.close()
selectedoption = 0
previousselect = 0
while True:
lcd.move_to(0, 0)
lcd.clear()
lcd.putstr(title)
lcd.move_to(0, 1)
lcd.putstr(options[selectedoption])
time.sleep(0.5)
while True:
temp = joystick.gethorizontal()
selected = joystick.getsel()
if selected:
break
if cover == True:
display.fill(0)
display.cover(covers[selectedoption])
if previousselect != selectedoption:
display.cover(SC)
display.show()
time.sleep(0.3)
previousselect = selectedoption
if temp == -1:
if selectedoption != 0:
selectedoption -= 1
else:
selectedoption = len(options)-1
break
elif temp == 1:
if selectedoption != len(options)-1:
selectedoption += 1
else:
selectedoption = 0
break
if selected:
break
lcd.move_to(0, 0)
lcd.clear()
if cover == True:
display.fill(0)
display.show()
return selectedoption
print("INITCOM BLM done!")
"""

View File

@ -0,0 +1,5 @@
def check():
return """
gameman.initgames()
gameman.start("{}", globals())
"""