I want to add background to my app in python pygame but its not working help? heres the code
import pygame
import sys
import os
# initial pygame
pygame.init()
# frame :
screen = pygame.display.set_mode((800, 600))
# Background
background = pygame.image.load('background.png')
# the title
pygame.display.set_caption("Untitled")
# Loop
running = True
while True:
screen.blit(background, (0, 0))
for event in pygame.event.get():
if event.type == pygame.QUIT:
pygame.quit()
exit()
also i haven't finish the whole app yet
You must update the display:
running = True
while True:
screen.blit(background, (0, 0))
for event in pygame.event.get():
if event.type == pygame.QUIT:
pygame.quit()
exit()
pygame.display.update()
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments