I am writing a game in PyGame. But when I want to load images, the background image is not loading up correctly. Also, no error message is showing up.
The code:
import pygame
from pygame.locals import *
# Images
icon = pygame.image.load("Images/icon.ico")
background = pygame.image.load("Images/sky.png")
sun = pygame.image.load("Images/sun.png")
# Setup
pygame.init()
screen = pygame.display.set_mode((700, 700))
pygame.display.set_caption("Platformer")
pygame.display.set_icon(icon)
# Game loop
running = True
while running:
screen.blit(background, (0, 0))
screen.blit(sun, (100, 100))
for event in pygame.event.get():
if event.type == pygame.QUIT:
running = False
pygame.display.update()
pygame.quit()
Here's what I got: