Fallon Creech-Project-03-Dynamic-Drawing

sketch

let shape;

function setup() {
  createCanvas(640, 480);
  //shape randomly assumes Y position each time page is refreshed
  shape = random(255);
}

function draw() {
  background(shape, mouseX, 0);
  //size of ellipse is dependent on location of mouseX
  var m = max(min(mouseX, 640), 0);
  var size = m * 350.0 / 400.0;
  ellipse(size, shape, 50, mouseX);
}

For this project I wanted to experiment with basic dynamic principles that varied based on mouse position including color, position, size, and distance.

Leave a Reply