let Engine = Matter.Engine;
let World = Matter.World;
let Bodies = Matter.Bodies;
engine = Engine.create();
Bodies.rectangle(width/2, 0, width, d, { isStatic: true }),
Bodies.rectangle(width/2, height/2, width/6, d, { isStatic: true }),
Bodies.rectangle(width, height/2, d, height, { isStatic: true }),
Bodies.rectangle(0, height/2, d, height, { isStatic: true })
circles.push(new Circle(width/2+random(-1,1)*width/64, random(height/8), random([1,2])));
for (let i = 0; i < circles.length; i++) {
if(circles[i].body.position.y > height+5){
function Circle(x, y, r) {
this.body = Bodies.circle(x, y, r, options);
Matter.Body.setMass(this.body, 20);
Matter.Body.setDensity(this.body, 20)
World.add(world, this.body);
this.color = rand_color();
let pos = this.body.position;
let angle = this.body.angle;
ellipse(0, 0, this.r * 2);
return color(random(["#227c9d", "#17c3b2", "#ffcb77", "#fef9ef", "#fe6d73"]));
save("img_" + month() + day() + hour() + minute() + second() + ".png");