I'm making a rpg game in pygame and I don't know how to make the background change when touching edge and when I try, it won't work and it says a syntax error at line 31
import pygame
WIDTH = 480
HEIGHT = 365
player = Actor("character.png")
player.pos = WIDTH/2, HEIGHT/2
player.posx = WIDTH/2
player.posy = HEIGHT/2
tent = Actor("tent2.png")
tent.pos = WIDTH/3, HEIGHT/1.3
campfire = Actor("campfire.png")
campfire.pos = WIDTH/5, HEIGHT/1.3
def update():
if keyboard.a and player.left > 0:
player.left -= 3
if keyboard.d and player.right < WIDTH:
player.right += 3
if keyboard.w and player.top > 0:
player.top -= 3
if keyboard.s and player.bottom < HEIGHT:
player.bottom += 3
if player.pos = WIDTH/1, HEIGHT/1:
screen.blit("bg3.png",(0,0))