sztuczna_inteligencja_2023_.../main.py
2023-04-23 16:43:32 +02:00

31 lines
878 B
Python

import pygame
from gameEventHandler import handle_game_event
from gameContext import GameContext
from startup import startup
from PIL import Image
from agentActionType import AgentActionType
from movement import collect_garbage
pygame.init()
canvas = pygame.display.set_mode((800, 800))
pygame.display.set_caption("Inteligentna śmieciarka")
dust_car_pil = Image.open('imgs/dust_car_right.png')
game_context = GameContext()
game_context.dust_car_pil = dust_car_pil
game_context.dust_car_pygame = pygame.image.frombuffer(dust_car_pil.tobytes(), dust_car_pil.size, 'RGB')
game_context.canvas = canvas
startup(game_context)
collect_garbage(game_context)
exit = False
while not exit:
for event in pygame.event.get():
if event.type == pygame.QUIT:
exit = True
else:
handle_game_event(event, game_context)
pygame.display.update()