Answers for "p5 keypressed"

0

p5 keypressed

let value = 0;
function draw() {
  fill(value);
  rect(25, 25, 50, 50);
}
function keyPressed() {
  if (value === 0) {
    value = 255;
  } else {
    value = 0;
  }
}
Posted by: Guest on February-19-2021

Browse Popular Code Answers by Language