Why does my game start to lag when i change the background image? i just change the image when my character collides with the door? heres some code..
this declares the backgrounds
bg = pygame.image.load("map.png")
bg1 = pygame.image.load("house interior.png")
bgnum = 1
this is where i switch them...
if bgnum == 1:
if x > 158 and x < 379 and y > 115 and y <295:
x_change = 0
if y > 82 and y < 295 and x > 158 and x < 379:
y_change = 0
if x > 535 and x < 749 and y > 82 and y <295:
x_change = 0
if y > 82 and y < 295 and x > 540 and x < 754:
y_change = 0
if y > 285 and y < 305 and x > 610 and x < 660:
bgnum = 2
bg = bg1
my game lags quite a bit when i enter the door and the background changes..