Sztuczna_Inteligencja_2020/main.py

35 lines
872 B
Python
Raw Normal View History

2020-03-23 20:55:52 +01:00
import sys
from src.graphics import *
from src.waiter import Waiter
2020-03-23 20:55:52 +01:00
if __name__ == "__main__":
# SETUP
pygame.init()
clock = pygame.time.Clock()
fps = 40
2020-04-03 20:15:07 +02:00
waiter = Waiter()
graphics = 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.update(waiter.X, waiter.Y)
pygame.display.flip()
2020-04-02 22:28:30 +02:00
clock.tick(fps)