float angle= 0.0; void setup(){ size(400,400); smooth(); background(255); //set background to white } void draw(){ translate(mouseX, mouseY); //square follows mouse rotate(angle); //square will rotate strokeWeight(2); //stroke is thickness of 2 rect(-15,-15,30,30); //square line(0,0,400,400); //lines coming out of square angle += 0.2; //degree of angle rotation } void mousePressed(){ fill(60,20,250); //when pressed square is red if(mouseX<200){ //if mouse is pressed <200 fill(255,0,0); //square turns blue } }