예제 #1
0
def start():
    try:
        display.init()
        control.init()
        gameloop.start()
    finally:
        control.finish()
        display.exit()
        print("Game over! Score - ", Game.GameState().score)
예제 #2
0
def start():
    CurrentGame = Game()
    CurrentGame.spawn_apple()
    while Game.GameState().state == 0:
        step(CurrentGame)
예제 #3
0
def finish():
    Game.GameState().listener.stop()
예제 #4
0
def init():
    Game.GameState().listener = keyboard.Listener(on_press=on_press)
    Game.GameState().listener.start()