I'm creating a game where the players character always stays in the centre of the screen and the surrounding walls change position instead, like many top-down games.
My issue is that I have a list of the walls pygame.Rects but i cannot figure out a way to make the collisions works correctly with the static player. I have variables like so
walls = [pygame.Rect([0, 0, 20, 20]), ...]
player = pygame.Rect([100, 100, 20, 20])
where walls contains all the walls of the current level. How do I make it so when the player collides with one of these rects it adjusts correctly and stops all the other walls from moving as well. The position of the players rect never changes and hence must always be [100, 100] but the walls positions do change.