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")
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...
© 2024 OneMinuteCode. All rights reserved.