SzabiSch / bootcamp-schedule

0 stars 0 forks source link

P5 Kata: Twin Brush #66

Closed codingbootcampseu closed 3 years ago

codingbootcampseu commented 3 years ago

twin-brush

Bonus

The mousePressed() function is called by p5 every time the mouse is pressed.

function mousePressed() {
  // set random fill color
}

Change the size of the brush (diameter) using the keyboard. If + is pressed the diameter is increased and if - is pressed the diameter is decreased. You can use the keyPressed() function for that. p5 will call the keyPressed() function.

function keyPressed() {
  if(key === '+') {
    // increase diameter
  } else if (...) {
    // decrease diameter
  }
}
SzabiSch commented 3 years ago

gute Übung für die Einanderschachtelung von Functionen, zeigt den Unterschied, wann die Farbe sich ändert