Tut­o­r­i­a­l week 9

by Brittany Klaassens

line that goes clockwise with the press of a key

  • Show Code
/** @peep sketch */
float angle = 0;
 
void setup() {
  size(200, 200);
  rectMode(CENTER);
  strokeWeight(4);
}
 
void draw() {
  background(255);
  if (keyPressed == true) {
    angle += PI/180;
  }
  translate(width/2, height/2);
  rotate(angle);
  line(80,50);
}

Comments

Nobody has said anything yet.