Sztuczna_Inteligencja_2020/main.py

38 lines
923 B
Python
Raw Normal View History

2020-04-06 22:10:21 +02:00
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)
2020-04-26 14:14:35 +02:00
print(waiter.findPath((1, 10)))
2020-04-06 22:10:21 +02:00
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)
2020-04-26 14:14:35 +02:00
2020-04-06 22:10:21 +02:00
waiter.update(event, graphics)
graphics.update(waiter.X, waiter.Y)
pygame.display.flip()
clock.tick(fps)