- nothing should reside after pygame.quit() and sys.exit(). That is the end of the game.
- you should only have one event loop, not two
- you should only have one game loop, you should only have to type pygame.display.update() once in the whole game...even if it as big as minecraft.
- never load your images in your game loop as well as .convert() them to make it faster
- You should probably make a package and put the image in a sub-directory of the root python script, not on your directory in your desktop.
import pygame import sys screen = pygame.display.set_mode((800,600)) done = False img = pygame.image.load(os.path.join('C:/Users/Gebruiker/Desktop/Renders', 'Render.png')).convert() while not done: for event in pygame.event.get(): if event.type == pygame.QUIT: done = True elif event.type == pygame.KEYDOWN: if event.key == pygame.K_ESCAPE: done = True elif event.key == pygame.K_SPACE: pass #do something screen.fill((255,255,255)) pygame.display.update() pygame.quit() sys.exit()
Recommended Tutorials: