For one of my programing classes I have to design a maze game, that has a character moving in a maze against time. The question is how to make it so that this character, in this case a button, can not pass through the maze line. I have decided to use retangles instead of lines for the maze, but I have no idea how to make it so the button cannot not move beyond the rectangle. I would like to have it so so if the buttons touches the inner boundrais of the rectangle it goes back to a starting position or stops. If anyone here has any good ideas please message me back.