i try to load an image but when i run it the window won't stay open and shut down immediately can some one help me with this? when i delete the yellow space ship varible it run fine but when try to load it the window just stop working
import pygame
import os
width , height = 900 , 500
window = pygame.display.set_mode((width, height))
pygame.display.set_caption("first game")
teal = (153,255,255)
fps = 60
yellow_spaceship = pygame.image.load(os.path.join('Assets','spaceship_yellow.png'))
def draw_window():
window.fill(teal)
window.blit((yellow_spaceship,(300, 100)))
pygame.display.update()
#keep window running
def main():
clock = pygame.time.Clock()
run = True
draw_window()
while run:
clock.tick(fps)
for event in pygame.event.get():
if event.type == pygame.QUIT:
run = False
draw_window()
pygame.quit()
if __name__ == '__main__':
main()