let color_pat = ["#ffffff", "#f090d0", "#408040"];
let Engine = Matter.Engine;
let World = Matter.World;
let Bodies = Matter.Bodies;
engine = Engine.create();
Bodies.rectangle(width/2, 0, width, 15, { isStatic: true }),
Bodies.rectangle(width/2, height, width, 15, { isStatic: true }),
Bodies.rectangle(width, height/2, 15, height, { isStatic: true }),
Bodies.rectangle(0, height/2, 15, height, { isStatic: true })
if(frameCount<fps*15 && frameCount%fps==0){
dangos.push(new Dango(random(width*0.1, width-width*0.1), random(height/16, height/8), random(10, 50)));
for (let i = 0; i < dangos.length; i++) {
function Dango(x, y, r) {
this.body = Bodies.rectangle(x, y, r, r*3.8, options);
World.add(world, this.body);
this.colors = rand_color();
let pos = this.body.position;
let angle = this.body.angle;
draw_dango(this.r, this.colors);
let colors = shuffle( color_pat );
function draw_dango(size, color_pat){
line(0, -size*1.8, 0, size*2);
dango(size, color_pat[0]);
dango(size, color_pat[1]);
dango(size, color_pat[2]);
function dango(size, fcolor){
ellipse(size/8*2, -size/10, size/14);
ellipse(-size/8, -size/10, size/14);
arc(size/8, size/20, size/10*1.25, size/10, -PI/2*1.25, PI/2*1.25);
arc(size/8*0.6, size/16*3.5, size/4, size/10, 0, PI);