-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsketch.js
More file actions
29 lines (26 loc) · 743 Bytes
/
sketch.js
File metadata and controls
29 lines (26 loc) · 743 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
let cor;
let circuloX;
let circuloY;
let contador;
function setup() {
createCanvas (400,400);
background(color( 100,0,0))
cor = color(random(0,255), random(0,255),random (0,255));
circuloX = [0,0,0,0,0,0];
circuloY=[random(height),random(height),random(height),random(height),random(height),random(height)];
}
function draw(){
fill(cor);
for (contador in circuloX){
circle(circuloX[contador],circuloY[contador],50);
circuloX[contador]+= random(0,3);
circuloY[contador]+=random(-3,3);
if (circuloX[contador]>=width) {
circuloX[contador]= 0;
circuloY[contador]=random(height);
}
}
if( mouseIsPressed){
cor = color (random (0,255),random(0,255), random(0,255),random (0,100));
}
}