Good morning, I have a game in python to which I assign a background that I want to be changed by another when I reach a number of points, the problem is that when the background is changed it is constantly loaded and the framerate is lowered, it is because Does the IF constantly execute the call to the image or that I'm not seeing?
# Clase para la escena del juego class Game():
def __init__(self):
# Cargamos el fondo.
self.fondo = load_image('Fondo1.png', IMG_DIR)
self.primera_vez = True
# Segundo nivel
if self.puntos > 1:
self.fondo = load_image('Fondo2.png', IMG_DIR)
self.primera_vez = True
You are missing a lot of things that you do not add because they are irrelevant.