You have functions such as
def car1 (x1,y1):
gameDisplay.blit(car1IMG,(x1,y1))
which will blit the global image car1IMG
. Then in your game_loop
function you write car1IMG = pygame.image.load('textures\car1.png')
which creates a local variable with the same name. So everything in your game_loop
function will always use the local variable instead of the global, unless you specify that car1IMG
is a global variable. As such:
def game_loop():
gloabl car1IMG
...
solved The if statement is not registering variables changing