import pygame
pygame.init()
SCREEN_WIDTH = 800
SCREEN_HEIGHT = 600
creen_surface = pygame.display.set_mode((SCREEN_WIDTH, SCREEN_HEIGHT))
pygame.display.set_caption('Pierwsza gra')
clock = pygame.time.Clock()
game_running = True

def load_image(img_path: str, possision):
    image = pygame.image.load(img_path)
    surface = image.convert()
    transparent_color = (0, 0, 0)
    surface.set_colorkey(transparent_color)
    rect = surface.get_rect(center=possision)
    return (image,surface,rect )
palyer_pos = [SCREEN_WIDTH//2, SCREEN_HEIGHT//2]
player = load_image('heart3.png',palyer_pos)
def print_image(img_list) -> None:
    image,surface,rect = img_list
    creen_surface.blit(surface,rect)
while game_running:
    events = pygame.event.get()
    for event in events:
        print(events)
        if event.type == pygame.QUIT:
            game_running = False
    print_image(player)
    pygame.display.update()
    clock.tick(60)
pygame.quit()
quit()






























