s444427
b06e382322
Class Matrix, Waiter, Graphics All graphics in Graphics (draw, clear, update) Waiter movement moved to Waiter Main reduced to minimum
42 lines
1003 B
Python
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)
|