> show canvas only <


/* built with Studio Sketchpad: 
 *   https://sketchpad.cc
 * 
 * observe the evolution of this sketch: 
 *   https://bard117f12.sketchpad.cc/sp/pad/view/ro.lEqPugR7x$A/rev.52
 * 
 * authors: 
 *   David Bull

 * license (unless otherwise specified): 
 *   creative commons attribution-share alike 3.0 license.
 *   https://creativecommons.org/licenses/by-sa/3.0/ 
 */ 



/* David Bull
 (09/23/2012)
 Self Portrait 2 */
 
 
/* This self-portrait is extremely different from my original sektch of a    smily face. This portrait is much more abstract and is much more creative. There are many more colors and the user experience will change according to the user. I created this in processing. There is a huge amount more freedom to create things on processing instead of design blocks. This portrait can do soo much more than my first portrait. This portrait reacts to your mouse movements a key presses. Enjoy! */


/*  If you just click and drag your mouse arround you are able to create white lines from two points and a bright purple circle that follows your mouse. If you hold down r the colors of thoes lines will change. */
 

/*  If you hold down the space bar 4 more points will appear and will follow your mouse and draw different collored lines. */
   
/*  If you tap the c key your drawing is errased and reset. */


   
void setup()
{
  size(500, 500);
  smooth();
  background(0);
}
void draw()
{
}
void keyPressed()
{
  if (key == 'c')
  {
    background(0);
  }
}
void mouseDragged()
{
  if (mouseButton == LEFT)
  { 
    stroke(255, 255, 255, 20);
    triangle(mouseX, mouseY, mouseX, mouseY, 500, 500);
    triangle(mouseX, mouseY, mouseX, mouseY, 200, 200);
    fill(#CF00FF, 25);
    ellipse(mouseX, mouseY, 20, 20);
  }
  if (mouseButton == LEFT && keyPressed == true && key == 'r')
  { 
    stroke(mouseX, mouseY, 255 - mouseY, 20);
    triangle(mouseX, mouseY, mouseX, mouseY, 200, 200);
    triangle(mouseX, mouseY, mouseX, mouseY, 200, 200);
  }
  if (mouseButton == RIGHT)
  {
    stroke(255, 255, 255, 20);
    triangle(mouseX, mouseY, 0, 0, 0, 0);
    triangle(mouseX, mouseY, 400, 400, 400, 400);
    triangle(mouseX, mouseY, 400, 0, 400, 0);
    triangle(mouseX, mouseY, 0, 400, 0, 400);
  }
  if (mouseButton == RIGHT && keyPressed == true && key == 'r')
  {
    stroke(mouseY, mouseX, 255 - mouseY, 20);
    triangle(mouseX, mouseY, 0, 0, 0, 0);
    triangle(mouseX, mouseY, 400, 400, 400, 400);
    triangle(mouseX, mouseY, 400, 0, 400, 0);
    triangle(mouseX, mouseY, 0, 400, 0, 400);
  }
  if (keyPressed == true && key == ' ')
  {
    stroke(mouseY, mouseX, 255 - mouseY, 20);
    triangle(mouseX, mouseY, mouseX, mouseY, 200, 200);
    triangle(mouseX, mouseY, mouseX, mouseY, 200, 200);
    stroke(mouseX, mouseY, 255 - mouseX, 20);
    triangle(mouseX, mouseY, 0, 0, 0, 0);
    triangle(mouseX, mouseY, 400, 400, 400, 400);
    triangle(mouseX, mouseY, 400, 0, 400, 0);
    triangle(mouseX, mouseY, 0, 400, 0, 400);
  }
}