37 lines
951 B
Python
37 lines
951 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)
|
|
direction = 0
|
|
|
|
# init functions
|
|
graphics.drawBackground(waiter.matrix)
|
|
graphics.update(waiter.X, waiter.Y, waiter.direction)
|
|
|
|
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, direction)
|
|
graphics.update(waiter.X, waiter.Y, waiter.direction)
|
|
pygame.display.flip()
|
|
clock.tick(fps)
|