xxxxxxxxxx
30
let xpos = 0;
let xspeed = 10;
function setup() {
createCanvas(windowWidth, windowHeight);
}
function draw() {
// Background is black with opacity of 15
// Opacity ranges between 0 and 255
background(0, 15);
// Fill color is white with opacity of 127
fill(255, 127);
strokeWeight(10);
// Stroke color is blue with opacity of 50
stroke(21, 87, 255, 50);
ellipse(xpos, height / 2, 100, 100);
// Try changing the increment value below
xpos += xspeed;
if(xpos < 0 || xpos > width){
xspeed = -xspeed;
}
}
function windowResized() {
resizeCanvas(windowWidth, windowHeight);
}