import pygame

pygame.init()

def load_img(img_path: str, position):
    image = pygame.image.load(img_path)
    surface = image.convert()

    transparent_color = (0, 0, 0)
    surface.set_colorkey(transparent_color)

    rect = surface.get_rect(center=position)
    return [image, surface, rect]

def print_img(img_list):
    img, surface, rect  = img_list
    screen_surface.blit(surface, rect)
    pass

SCREEN_WIDTH = 800
SCREEN_HEIGHT = 600

screen_surface = pygame.display.set_mode((SCREEN_WIDTH, SCREEN_HEIGHT))

pygame.display.set_caption('Moja pierwsza gra!')

clock = pygame.time.Clock()

player_pos = [SCREEN_WIDTH // 2, SCREEN_HEIGHT // 2]
player = load_img('player.png', player_pos)

is_game_running = True

while is_game_running:

    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            is_game_running = False
            pass
        pass
    pass

    screen_surface.fill("yellow")

    print_img(player)

    pygame.display.update()
    clock.tick(60)

print('KONIEC GRY!')
pygame.quit() # zamykamy aplikację
quit() # zamykamy skrypt