sztuczna_inteligencja_2023_.../main.py
2023-03-12 16:49:32 +01:00

30 lines
773 B
Python

import pygame
from gameEventHandler import handle_game_event
from gameContext import GameContext
from gameContext import startup
from PIL import Image
pygame.init()
canvas = pygame.display.set_mode((800, 800))
pygame.display.set_caption("Inteligentna śmieciarka")
stick_man_pil = Image.open('imgs/stickMan.jpg')
game_context = GameContext()
game_context.stick_man_pil = stick_man_pil
game_context.stick_man_pygame = pygame.image.frombuffer(stick_man_pil.tobytes(), stick_man_pil.size, 'RGB')
game_context.canvas = canvas
startup(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()