I am creating a game with pygame and an image won't show up until the window is loading to be closed. This is my code so far:
import pygame
pygame.init()
screen = pygame.display.set_mode((800, 600))
pygame.display.set_caption("ALix")
icon = pygame.image.load("nater.jpg")
pygame.display.set_icon(icon)
playerImg = pygame.image.load('nater.jpg')
playerX = 400
playerY = 300
def player():
screen.blit(playerImg, (playerX, playerY))
running = True
while running:
screen.fill((255, 255, 255))
for event in pygame.event.get():
if event.type == pygame.QUIT:
running = False
player()
pygame.display.update()