Sztuczna_Inteligencja_2020/main.py
2020-04-26 14:14:35 +02:00

38 lines
923 B
Python

import sys
from src.graphics import *
from src.waiter import *
if __name__ == "__main__":
# SETUP
pygame.init()
clock = pygame.time.Clock()
fps = 40
graphics = Graphics()
waiter = Waiter(graphics)
# init functions
graphics.drawBackground(waiter.matrix)
graphics.update(waiter.X, waiter.Y)
print(waiter.findPath((1, 10)))
while True:
for event in pygame.event.get():
if event.type == pygame.QUIT:
pygame.quit()
sys.exit()
break
if event.type == pygame.KEYDOWN:
if event.key == pygame.K_ESCAPE:
pygame.quit()
sys.exit()
break
graphics.clear(waiter.X, waiter.Y)
waiter.update(event, graphics)
graphics.update(waiter.X, waiter.Y)
pygame.display.flip()
clock.tick(fps)