xxxxxxxxxx
var a = 0;
var b =0;
function setup() {
createCanvas(windowWidth, windowHeight);
background(mouseY);
}
function draw() {
const colors = ['yellow', 'white', 'HotPink', 'lime', 'magenta'];
stroke(random(colors));
point(random(width),random(height));
var speed = dist(mouseX, mouseY, pmouseX, pmouseY);
strokeWeight(speed);
fill(0,10);
stroke(0,10);
line(pmouseX, pmouseY, mouseX, mouseY);
fill(255, 0, 0, 50);
noStroke();
if(mouseIsPressed) ellipse(mouseX, mouseY, speed, speed);
snake(mouseX, mouseY);
a = a+0.05;
b = b+0.05;
}
function snake(x, y){
translate(x, y);
scale(1); // change size
// main circle:
fill(255, 192, 104, 20);
stroke("yellow");
ellipse(0, 0,100, 100);
// revolving1:
fill(25, 192, 104, 20);
stroke("blue");
push();
rotate(a);
translate(5, 50);
ellipse(0, 0, 100, 100);
pop();
//revolving2
fill(255, 12, 104, 20);
stroke("orange");
push();
rotate(b);
translate(78, 50);
ellipse(0,0,100,100);
pop();
ellipse(random(0), random(0), random(100), random(100));
}
function mousePressed(){
fill(230);
}
function keyTyped() {
if(key=='f') {
background(0);
}
}