pygame background image doesn't pop up

Asked 2 years ago, Updated 2 years ago, 88 views

I'm a Python beginner. I'm making a game for club presentation using pygame, but the background image doesn't come up and only the black screen appears. I don't know where to start. Part of the problem.

import pygame

import sys

import random



from pygame.locals import *

pygame.init()

global background

global gamepad

size = [1080, 920]

clock = pygame.time.Clock()


gamepad = pygame.display.set_mode(size)
pygame.display.set_caption('teacherroom')
background = pygame.image.load("doorlockbefore.png")

python pygame

2022-09-20 19:16

1 Answers

I think there is an error because the background image and Python code are not in the same folder or path. And I have to explain what kind of error phrase comes out...


2022-09-20 19:16

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.