2020-03-23 20:55:52 +01:00
|
|
|
import sys
|
2020-04-03 18:49:47 +02:00
|
|
|
from src.graphics import *
|
|
|
|
from src.waiter import Waiter
|
2020-03-23 20:55:52 +01:00
|
|
|
|
2020-04-03 18:49:47 +02:00
|
|
|
if __name__ == "__main__":
|
|
|
|
# SETUP
|
|
|
|
pygame.init()
|
|
|
|
clock = pygame.time.Clock()
|
|
|
|
fps = 40
|
2020-04-03 20:15:07 +02:00
|
|
|
waiter = Waiter()
|
2020-04-03 18:49:47 +02:00
|
|
|
graphics = Graphics()
|
2020-04-03 00:36:09 +02:00
|
|
|
|
2020-04-03 18:49:47 +02:00
|
|
|
# init functions
|
2020-04-03 20:15:07 +02:00
|
|
|
graphics.drawBackground(waiter.matrix)
|
|
|
|
graphics.update(waiter.X, waiter.Y)
|
2020-03-23 20:55:52 +01:00
|
|
|
|
2020-04-03 18:49:47 +02:00
|
|
|
while True:
|
2020-03-23 20:55:52 +01:00
|
|
|
for event in pygame.event.get():
|
|
|
|
if event.type == pygame.QUIT:
|
|
|
|
pygame.quit()
|
|
|
|
sys.exit()
|
2020-04-03 18:49:47 +02:00
|
|
|
break
|
|
|
|
|
2020-04-02 22:28:30 +02:00
|
|
|
if event.type == pygame.KEYDOWN:
|
2020-04-03 18:49:47 +02:00
|
|
|
if event.key == pygame.K_ESCAPE:
|
|
|
|
pygame.quit()
|
|
|
|
sys.exit()
|
|
|
|
break
|
|
|
|
|
2020-04-03 20:15:07 +02:00
|
|
|
graphics.clear(waiter.X, waiter.Y)
|
|
|
|
waiter.update(event)
|
|
|
|
graphics.update(waiter.X, waiter.Y)
|
2020-04-02 23:26:17 +02:00
|
|
|
pygame.display.flip()
|
2020-04-02 22:28:30 +02:00
|
|
|
clock.tick(fps)
|