So far I'm making a system where walls are placed on a 32x32 grid, all wall sprites have a width and height of 32 pixels each.
I want to be able to make it so that walls can somehow detect whether they're standing directly below, above or next to a wall (Including multiple walls at a time as well) and automatically change their sprite.
For example, once this wall in the middle is destroyed, The other walls connected to it should change their sprites to something different. The singular wall on the right side should change its sprite to the same one in the upper right corner as it isn't connected to anything.
Cheers