Tut­o­r­i­a­l 15

by Giselle Gray

Playing with keys

  • Show Code
/** @peep sketch */
 
color lightBlue = color(66, 168, 237);
color darkBlue = color(0, 102, 153);
color orange = color(204, 102, 0);
 
void setup() {
  size(200, 200);
  strokeWeight(4);
  stroke (lightBlue);
}
 
void draw() {
  background(204);
  if (keyPressed == false) {
    fill(orange);
    rect (50, 50, 100, 100);
  } else {
    line (1, 1, 200, 200);
    line (200, 1, 1, 200);
 
  }
 
}

Comments

Nobody has said anything yet.