So basically, its all well and good when I have it at this stage:
import pygame
from pygame.locals import *
pygame.init()
screen_width = 1000
screen_height = 1000
screen = pygame.display.set_mode((screen_width, screen_height))
pygame.display.set_caption('Platformer')
run = True
while run:
for event in pygame.event.get():
if event.type == pygame.QUIT:
run = False
pygame.quit()
but as soon as i add something like this:
import pygame
from pygame.locals import *
pygame.init()
screen_width = 1000
screen_height = 1000
screen = pygame.display.set_mode((screen_width, screen_height))
pygame.display.set_caption('Platformer')
sun_img = pygame.image.load('img/sun.png')
bg_img = pygame.image.load('img/sky.png')
run = True
while run:
for event in pygame.event.get():
if event.type == pygame.QUIT:
run = False
pygame.quit()
it just opens and closes immediately. Im a huge novice with code and am just having some fun for now but this issue is really annoying and I would appreciate any help I could get!