Sztuczna_Inteligencja/run.py

55 lines
1.1 KiB
Python
Raw Normal View History

2019-03-19 23:36:06 +01:00
import pygame, sys
from waiter import Waiter
from table import Table
class Game(object):
def __init__(self):
pygame.init()
self.screen = pygame.display.set_mode((1000, 900))
self.fpsClock = pygame.time.Clock()
self.idTable = 0
pygame.display.set_caption('Automatic Waiter')
self.background = pygame.image.load("./Images/tlo.jpg")
self.waiter = Waiter(self)
self.tables = [Table(50, 50, self), Table(400, 50, self), Table(750, 50, self), Table(50, 450, self), Table(400, 450, self), Table(750, 450, self)]
for t in self.tables:
print(t.id)
while True:
for event in pygame.event.get():
if event.type == pygame.QUIT:
sys.exit(0)
#self.screen.fill((0, 0, 0))
self.screen.blit(self.background, (0, 0))
self.draw()
self.waiter.move()
pygame.display.flip()
self.fpsClock.tick(10)
def draw(self):
self.waiter.draw()
for table in self.tables:
table.draw()
if __name__ == "__main__":
Game()