...
| Code Block | ||
|---|---|---|
| ||
function setup(){
createCanvas(300,300);
background(0);
stroke(255);
strokeWeight(10);
}
function draw(){
point(mouseX, mouseY);
}
function mousePressed(){
print("x:" + mouseX + ", y:" + mouseY);
clear();
background(0);
} |
Exercise 4
Write a sketch where a unique shape follows the mouse position. When you click the mouse, the shape should change in some way (form, colour, size).