PyGame: set a background
Noteekx
-
Spirali -
Spirali -
Hello,
I tried to create a sort of game but when I try to set a background, despite the corrected errors, it still doesn't display
can someone tell me if there is a problem with my code?
I tried to create a sort of game but when I try to set a background, despite the corrected errors, it still doesn't display
can someone tell me if there is a problem with my code?
import pygame pygame.init() # generate the game window pygame.display.set_caption("Comet Fall Game") screen = pygame.display.set_mode((1080, 720)) # load the background of my game background = pygame.image.load('assets/bg.jpg') running = True # loop while the condition is true while running: # apply the background of my game screen.blit(background, (0, -200)) # update the screen pygame.display.flip() # if the player closes this window for event in pygame.event.get(): # the event is window closing if event.type == pygame.QUIT: running = False pygame.quit() print("closing the game") | EDIT: Added code tags (syntax highlighting). Explanations available here: HERE Thank you for keeping this in mind in your future messages. |