// Cloned by Dom on 2 Nov 2019 from World "Tutorial 2.1 " by "Coding Train" project
// Please leave this clone trail here.
/*
https://vimeo.com/channels/learningp5js/138327548
*/
function setup() {
createCanvas(600, 400); //Setup happens only once
background(200, 250, 100);
}
function draw() {
// Draw happens over and over again, it gets interupted briefly by 'mousePressed'
// background(250, 250, 100);
// ellipse
noStroke();
fill(250, 200, 200, 75);
rect(mouseX, mouseY, 50, 50);
// rectangle
//fill(200, 250, 200);
//rect(400, 100, 50, 50);
}
// try mousePressed function
function mousePressed() {
//this is an event - when the user clicks the mouse, the code is execucted
background(200, 250, 100);
}