xxxxxxxxxx
// Define variables
var clBlack; // color black
var clWhite; // color white
var clRed; //color red
var stW; // strokeSize of each circle
var x; //horizontal position of each circle
var y; //vertical position of each circle
var rad; // radius of each circle
// Movement on Y
var deltaY;
function setup() {
//create canvas 600x600
createCanvas(600, 600);
background(100);
// assign values to variables declared above
clWhite = "#ffffff";
clPink = "#ff33ff";
clBlack='#000000';
clRed='#ff0000';
rad = 600;
stW = 4;
x = width / 2; // equals 600 / 2 = 300
y = height / 2; // equals 600 / 2 = 300
// Starting value of deltaY
deltaY = -600;
//print(x, y)
//noLoop();
}
function draw() {
background(clWhite)
/*
// Draw the first circle
circle(x, y, rad);
// Second decrease circle rad
rad = rad - 20;
circle(x, y, rad);
// Third decrease circle rad
rad = rad - 20;
circle(x, y, rad);
// Fourth decrease circle rad
rad = rad - 20;
circle(x, y, rad);
// Fifth decrease circle rad
rad = rad - 20;
circle(x, y, rad);
// Sixth decrease circle rad
rad = rad - 20;
circle(x, y, rad);
// Seventh decrease circle rad
rad = rad - 20;
circle(x, y, rad);
*/
for (let i = 0; i < 1000; i = i + 10) {
noFill()
stroke('pink')
strokeWeight(2)
circle(300, 300, i,)
stroke('red')
strokeWeight(2)
ellipse(300, y, i, i)
stroke('red')
strokeWeight(2)
ellipse(x, 300, i, i)
stroke('red')
strokeWeight(0.5)
circle(600, deltaY, 300 - i,)
stroke('red')
strokeWeight(0.5)
circle(x, 300, 300 - i,)
}
y = y + 3
x = x + 3
//x=mouseX;
//y=mouseY;
if(x>width*2) {
x = -300;
}
if(y>height*2){
y=-300;
}
}