Sztuczna_Inteligencja_2020/main.py

36 lines
886 B
Python
Raw Normal View History

2020-03-23 20:55:52 +01:00
import sys
from src.graphics import *
from src.waiter import *
2020-03-23 20:55:52 +01:00
if __name__ == "__main__":
# SETUP
pygame.init()
clock = pygame.time.Clock()
fps = 40
graphics = Graphics()
waiter = Waiter(graphics)
2020-04-03 00:36:09 +02:00
# init functions
2020-04-03 20:15:07 +02:00
graphics.drawBackground(waiter.matrix)
graphics.update(waiter.X, waiter.Y)
2020-03-23 20:55:52 +01:00
while True:
2020-03-23 20:55:52 +01:00
for event in pygame.event.get():
if event.type == pygame.QUIT:
pygame.quit()
sys.exit()
break
2020-04-02 22:28:30 +02:00
if event.type == pygame.KEYDOWN:
if event.key == pygame.K_ESCAPE:
pygame.quit()
sys.exit()
break
2020-04-03 20:15:07 +02:00
graphics.clear(waiter.X, waiter.Y)
waiter.update(event, graphics)
2020-04-03 20:15:07 +02:00
graphics.update(waiter.X, waiter.Y)
pygame.display.flip()
2020-04-02 22:28:30 +02:00
clock.tick(fps)