xxxxxxxxxx
27
let size = 150
function setup() {
createCanvas(windowWidth, windowHeight); //these system variables will make sure my canvas is the size of whatever screen the project is opened.
background(200);
}
function draw() {
let middleW = width/2 //variable for the X position in the middle of the width of the canvas
let middleH = height/2 // variable for the Y position in the middle of the height
//these lines will make a red square with a blue outline
rectMode(CENTER);
fill(255, 0, 0);
stroke(0, 0, 255);
strokeWeight(4);
rect(middleW, middleH, size, size);//using the variables I created to define the position and size of my rect
//these lines will make a green circle with no outline and a little bit transparent
noStroke();
fill(0, 255, 0, 95);
ellipse(middleW-size/2, middleH, size);//using the variables I created to define the position and size of my ellipse
}