I have been working on a simulation where a man walks through a house. My problem is that I do not know how to set variables to backgrounds. In mine, I have made it so that if I press E in front of a stove, it turns on by changing the background. If I am in a different background and I am in the same coordinates, My room will change. Is there a way to work around this, because I can't set backgrounds as variables. Here is my messy code so far:
PImage img;
PImage front;
PImage back;
PImage left;
PImage right;
PImage stove;
PImage sink;