mardi 29 janvier 2019

Does the if sentence on python execute only once?

im new on this, and im using an if statement to load an image in case X thing happens, this is my code:

if  self.puntos > 0:
        self.fondo = load_image('Fondo2.png', IMG_DIR)
        self.primera_vez = True

So when puntos (points) get over 0 the background changes, the problem is that the new image loads constantly causing low framerates, is this because the if statement executes constantly or what? Thanks

Aucun commentaire:

Enregistrer un commentaire