I'm new to processing and I'm trying to make it so the square that is drawn will rotate when a button is pressed. I'm familiar with rotate() and translate(), I'm just unsure where to place the functions. I already have it so that when a button is pressed the square will either move horizontally or vertically or change shape or color. I even added mouse functions to drag the square and change the color randomly. The following is my code. Can anybody help?
int x = 300;
int y = 300;
int s = 50;
int boxcolor = color(0, 0, 255);