When you bring the dot into the screen with the wall, the wall turns light gray to match the background color. Yet the wall is still there, and still drawn on top of the background and player.
Someone might be misled into thinking that the color change has some effect on how the collision detection works, thinking that because the background and wall are the same color, the collision detection must not work anymore. But this is not the case, the game logic is actually checking that the dot is changing the wall color in order to disable collision for the wall.
Someone might be misled into thinking that the color change has some effect on how the collision detection works, thinking that because the background and wall are the same color, the collision detection must not work anymore. But this is not the case, the game logic is actually checking that the dot is changing the wall color in order to disable collision for the wall.