var centi; window.onload = function(){ var prog = 'sz(1,1) bg(0) NUM=(200) a=([]) for(i,0,NUM) {a[i]=vec2(rnd(w),h+rnd(h)) a[i].vx=(0) a[i].vy=(0) a[i].r=rnd(8,30) } frame() {col(0,40) rect(0,0,w,h) tree(a) for(i,0,NUM) {x=(a[i].x) y=(a[i].y) vx=(a[i].vx) vy=(a[i].vy) r=(a[i].r) b=nears(a[i],10,3600) nn=(b.length) for(j,0,nn) {p=(b[j][0]) d=sqrt(b[j][1]) if((d>0) && (dw)){x=rnd(w)} a[i].x=(x) a[i].y=(y) a[i].vx=(vx*0.9) a[i].vy=(vy*0.97) col(nn*24,nn*20+60,nn*10+150) oval(x,y,r) } }'; var canvas = document.getElementById('c'); centi = new Centi("centi"); centi.init(canvas, getAudioContext()); centi.parse(prog); centi.start(); requestAnimationFrame(update); function update(){ requestAnimationFrame(update); centi.update(); } if ( window.addEventListener ) { window.addEventListener('resize', onResize, false); } else if ( window.onresize ) { window.onresize = onResize; } function onResize(){ centi.size(centi.sizeW, centi.sizeH); } };