Sztuczna_Inteligencja_2020/main.py
s444427 b06e382322 File division,
Class Matrix, Waiter, Graphics
All graphics in Graphics (draw, clear, update)
Waiter movement moved to Waiter
Main reduced to minimum
2020-04-03 18:49:47 +02:00

42 lines
1003 B
Python

import sys
from src.graphics import *
from src.matrix import Matrix
from src.waiter import Waiter
if __name__ == "__main__":
# SETUP
pygame.init()
clock = pygame.time.Clock()
fps = 40
# matrix = []
waiterPly = Waiter()
graphics = Graphics()
# init functions
graphics.drawBackground()
graphics.update(waiterPly.moveX, waiterPly.moveY)
# matrix_creator()
matrix = Matrix()
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(waiterPly.moveX, waiterPly.moveY)
waiterPly.update(event)
graphics.update(waiterPly.moveX, waiterPly.moveY)
pygame.display.flip()
clock.tick(fps)