//Dan Packman //Project 3 //drawing function int xmove = 0; int gogo = 0; int r,g,b; int x =0 , y=0; float color_r = 54; void setup(){ noCursor(); size(600, 600); r=round (random (0,255)); g=round (random (0,255)); b=round (random (0,255)); background(r,g,b); smooth(); strokeWeight(12); frameRate(30); } void mousePressed(){ color_r =(255); x=mouseX; y=mouseY; } //redraw the screen according to the framerate void draw(){ strokeJoin(ROUND); if(mousePressed && mouseButton == LEFT){ stroke(random (0,255),random (0,255),random (0,255)); line(mouseX, mouseY, x, y); x = mouseX; y= mouseY; } else if (mousePressed && mouseButton == RIGHT){ stroke(r,g,b); line(mouseX, mouseY, x, y); x = mouseX; y= mouseY; } else if (mousePressed && mouseButton == CENTER){ r=round(random(0,255)); g=round(random(0,255)); b=round(random(0,255)); background (r,g,b); } }