Unit 2 – LA 1 – 1.4

There wasn’t a clear exercise this lesson, so I just played around a little bit and created something, it isn’t much special, but I think it is fun.

function setup() {
  createCanvas(600, 400);
  background(0);
  strokeColour = "white";
  
}

function draw() {
  stroke(strokeColour);
  line(mouseX, mouseY, pmouseX, pmouseY);
}

function mouseClicked() {
  if(strokeColour == "white") {
    strokeColour = "blue";
  } else if(strokeColour == "blue") {
    strokeColour = "green";
  } else {
    strokeColour = "white";
  }
}

https://editor.p5js.org/BrainyZebra5/full/KkoT-SAYU