0

im having this problem with my code in pygame

the parts that are commented out are the ones i used as tests when i was starting with image loading. when i run my code the images dont display

ground2_surface = pygame.image.load('Assets/ground-export.png')
ground3_surface = pygame.image.load('Assets/ground-export.png')
ground4_surface = pygame.image.load('Assets/ground-export.png')


# floor_surface = pygame.image.load('Assets/floorbig.jpg')
# sky_surface = pygame.image.load('Assets/skyex.png')




while True:
    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            pygame.quit()
            exit()
    screen.blit(ground_surface,(0,300))
    screen.blit(ground2_surface,(100,600))   
    screen.blit(ground3_surface,(0,900)) 
    screen.blit(ground4_surface,(0,1200))     


    pygame.display.update()
    clock.tick(60)```

OlosCode
  • 1
  • 2
  • Welcome to Stack Overflow. There's not much to go by; but, please check if 1) ```Assets/ground-export.png``` file exists, 2) it is accessible (correct permisisons) 3) you are referring to the correct path. 3) You haven't defined ```ground_surface```. – ewong Jun 02 '22 at 05:24

0 Answers0