Ejemplo n.º 1
0
# This prints the menu to the user upon starting the game up
screen.showOption()
# This captures the users input key to determine which mode they requested
key = screen.getKey()
while key != 113:
    # This clears the screen at as the user's request for the mode is no process
    screen.clear()
    # If the user presses the 'r' key then they will open a live display with the alignment tool.
    if key == 114:
        camera.showDisplay(keyb) 
        screen.scrPrint("Camera re-align finished", newline=True)
        screen.continuePrompt()
    # If the user presses the 'p' key then the game will be started
    elif key == 112:
        # starts the env
        les.start()
        # creates a user a/c to store the mistakes
        user = User()
        # starts a timer
        start_time = time.time()
        # Write words
        les.writeWords(user)
        # ends the timer
        end_time = time.time() - start_time
        screen.clear()

        # returns the user data
        [screen.scrPrint(n, newline=True) for n in user.getMistake()]
        [screen.scrPrint(n, newline=True) for n in user.getData(end_time, keyb)]
        
        # The prompt does no appear until the user sees there data so they don't accidentally skip the data while it is loading
Ejemplo n.º 2
0
def start_lesson(lesson_name):
    lesson = Lesson(lesson_name)

    lesson.start()