function setup() {
  // use full screen size
  createCanvas(displayWidth, displayHeight);
  background(255);
  col = color(random(255), random(255), random(255), random(100));
  x = mouseX;
  y = mouseY;
  cursor(CROSS);
}
draw tool. shows how to work with relations between elements.

MOUSE
drag                : draw

KEYS
1                   : draw mode 1 - fixed distance
2                   : draw mode 2 - distance threshold
del, backspace      : clear screen
arrow up            : line length +
arrow down          : line length -
s                   : save png