xxxxxxxxxx
106
let particles = [];
let dots = [];
function setup() {
createCanvas(810, 500);
}
function draw() {
background(2,82,190);
strokeWeight(3);
stroke(230);
fill(245);
filter(BLUR,1);
circle(132,56,40);
let p = new Particle();
particles.push(p);
for (let i = 0; i < particles.length; i++) {
particles[i].update();
particles[i].show();
}
let d = new Dot();
dots.push(d);
for (let i = 0; i < dots.length; i++) {
dots[i].update();
dots[i].show();
}
strokeWeight(3);
stroke(0);
fill(0);
rect(0,298,300,200,5);
rect(0,180,100,300,5);
rect(38,152,10,50,2);
rect(18,152,10,50,2);
rect(297,490,600,23,2);
circle(265,240,25);
circle(766,390,25);
bezier(769,402,810,398,740,469,768,493);
line(772,408,762,424);
line(762,424,752,416);
line(754,412,746,418);
bezier(266,253,241,310,350,250,270,304);
line(266,260,277,268);
line(277,268,280,252);
line(278,248,285,250);
stroke(255,69,0);
point(285,250);
point(745,419);
// strokeWeight(0);
// fill(255);
// text(mouseX + "," + mouseY, 20,20);
}
class Particle {
constructor () {
this.x = 296;
this.y = 249;
this.vx = random(3,10);
this.vy = random(-5,-1);
// this.opaque = 255;
}
update() {
this.x += this.vx;
this.y += this.vy;
// this.opaque -= 2;
}
show () {
stroke(0);
strokeWeight(0);
fill(255,255,0);
ellipse(this.x,this.y,8);
}
}
class Dot {
constructor () {
this.x = 738;
this.y = 423;
this.vx = random(-10,-6);
this.vy = random(-10,-4);
// this.opaque = 255;
}
update() {
this.x += this.vx;
this.y += this.vy;
// this.opaque -= 2;
}
show () {
stroke(0);
strokeWeight(0);
fill(255,165,0);
ellipse(this.x,this.y,8);
}
}