# 1 - Import library
import time
import pygame
from pygame.locals import *
# 2 - Initialize the game
pygame.init()
width, height = 640, 480
screen = pygame.display.set_mode((width, height))
background = pygame.image.load("resources/images/forest.png")
while True:
# 5 - clear the screen before drawing it again
screen.fill(0)
# 6 - draw the basic screen elements
screen.blit(background,(0,0))
# 8 - update the screen
pygame.display.update()
time.sleep(0.5)
When I run this I get Process finished with exit code 139 (interrupted by signal 11: SIGSEGV).
Is this something to do with not having enough RAM? Or maybe the 32bit version of python?
Also removing the loop entirely produces the same exit code.
# 1 - Import library
import time
import pygame
from pygame.locals import *
# 2 - Initialize the game
pygame.init()
width, height = 640, 480
screen = pygame.display.set_mode((width, height))
background = pygame.image.load("resources/images/forest.png")
# 5 - clear the screen before drawing it again
screen.fill(0)
# 6 - draw the basic screen elements
screen.blit(background,(0,0))
# 8 - update the screen
pygame.display.update()
time.sleep(0.5)