xxxxxxxxxx
46
let builders = [];
function setup() {
createCanvas(900, 900);
builders[0] = new Builder(width / 2, height);
background(0);
blendMode(ADD);
}
function draw() {
builders[0].update();
}
class Builder{
constructor(x, y){
this.pos = createVector(x, y);
this.vel = createVector(0, -1);
this.a = width / 2;
this.t = 0.5;
}
update(){
if(this.pos.y > -1 && frameCount % 10 == 0){
stroke(255, 20);
strokeWeight(1);
noFill();
// line(width, height, this.pos.x + this.a, this.pos.y);
// line(0, height, this.pos.x - this.a, this.pos.y);
bezier(this.pos.x - this.a, this.pos.y, this.pos.x - this.a, height, this.pos.x + this.a, height, this.pos.x + this.a, this.pos.y);
// line(width / 2, height, this.pos.x + this.a, this.pos.y);
// line(width / 2, height, this.pos.x - this.a, this.pos.y);
// line(width - width / 4, height, this.pos.x + this.a, this.pos.y);
// line(0 + width / 4, height, this.pos.x - this.a, this.pos.y);
bezier(width / 2, height, this.pos.x + this.a, this.pos.y, this.pos.x - this.a, this.pos.y, width / 2, height);
// line(width / 2, height, this.pos.x + this.a, this.pos.y);
// line(width / 2, height, this.pos.x - this.a, this.pos.y);
this.a = this.a - 10;
}
// this.vel.setHeading(noise(this.pos.x / 100, this.pos.y / 100));
// this.t = this.t - 0.001;
this.pos.setHeading(noise(this.pos.x / 1000, this.pos.y / 1000));
this.pos.add(this.vel);
}
}