sztuczna_inteligencja_2023_.../main.py

27 lines
671 B
Python
Raw Normal View History

2023-03-09 19:44:02 +01:00
import pygame
from gameEventHandler import handle_game_event
2023-03-12 16:08:54 +01:00
from gameContext import GameContext
from PIL import Image
2023-03-09 19:44:02 +01:00
pygame.init()
canvas = pygame.display.set_mode((800, 800))
pygame.display.set_caption("Inteligentna śmieciarka")
2023-03-12 16:08:54 +01:00
stick_man_pil = Image.open('imgs/sickMan.jpg')
gameContext = GameContext()
gameContext.stick_man_pygame = pygame.image.frombuffer(stick_man_pil.tobytes(), stick_man_pil.size, 'RGB')
gameContext.canvas = canvas
2023-03-09 19:44:02 +01:00
exit = False
while not exit:
for event in pygame.event.get():
if event.type == pygame.QUIT:
exit = True
else:
2023-03-12 16:08:54 +01:00
handle_game_event(event, gameContext)
2023-03-09 19:44:02 +01:00
pygame.display.update()