xxxxxxxxxx
//define color
var cBlack;
var cWhite;
//stroke weight
var stw;
//define variable for motion
var deltaY;
function setup() {
createCanvas(600, 600);
//assign values to the defined variables
cBlack = "#000000";
cWhite = "#fffffff";
//stroke weight
stw = 1;
//assign a value to deltaY
deltaY = -620;
}
function draw() {
background(cWhite);
//stripes in the background
stripes ();
//lock down styles
push();
translate(0, deltaY);
circleShape();
pop();
//speed adjustment
deltaY = deltaY + 0.5;
if (deltaY > 600) {
deltaY = -620;
}
}
function circleShape() {
// define position values for x and y axis
var xpos = width / 2;
var ypos = height / 2;
var rad = 600;
//reset stroke weight
stw = 1;
//repeat 22 times
for (var i = 0; i < 70 ; i = i + 1) {
//no fill
noFill();
//stroke weight
strokeWeight(stw);
//defining circle
circle(xpos, ypos, rad);
rad = rad - 10;
}
}
function stripes() {
// define position values for x and y axis
var xpos1 = width / 600;
var ypos1 = height / 600;
var xpos2 = width / 1;
var ypos2 = height / 600;
//reset stroke weight
stw = 1;
//repeating
for (var i = 0; i < 120; i = i + 1) {
//no fill
noFill();
//stroke weight
strokeWeight(stw);
//draw stripes
line (xpos1, ypos1, xpos2, ypos2);
ypos1 = ypos1 + 5;
ypos2 = ypos2 + 5;
}
}