Info_edupage/App.py
2021-09-13 20:21:11 +02:00

28 lines
664 B
Python

from multiprocessing import Queue
from multiprocessing import Process
import pygame
from pygame.locals import *
import sys
class App:
def __init__(self, scene, edu, hands_ai):
self.scene = scene
self.edu = edu
self.hands_ai = hands_ai
def run(self):
q = Queue()
hands_ai_process = Process(target=self.hands_ai.run, args=(q,))
hands_ai_process.start()
while True:
self.scene.update()
for event in pygame.event.get():
if event.type == QUIT:
hands_ai_process.terminate()
pygame.quit()
sys.exit(0)