xxxxxxxxxx
45
//var canvasWidth = 800;
//var canvasHeight =300;
//var count = 0;
var toggle = true;
function setup() {
createCanvas(800,300);
rectMode(CENTER);
}
function draw() {
if (mouseIsPressed === true){
toggle= !toggle;
}
// think about what is being repeated. can it go into a variable?
if (toggle===true){
background (155,20,106);
} else {
background (20,250,100);
}
var x = width /2 ;//+ count;
var y = height/2;
var size = 200;
// if (frameCount <70){
// size= size +frameCount;
// }else {
// size= size +70;
// }
//use canvasWifdth and Heifht as vasraibels to make the ellipse and
//rect fit relative to the canvas size
fill (237,34,93);
noStroke();
ellipse (x,y,size,size);
fill(255);
rect (x,y, size * 0.75, size * 0.15);
// count= count+1;
}