- Author:
- Ioannis Cherouvim
- Twitter:
- @
- GitHub:
- cherouvim
- Facebook:
- Google+:
- +IoannisCherouvim
- Reddit:
- /r/cherouvim
- Pouet:
- Website:
- cherouvim.com
- Compo:
- canvas
- Demo link:
- https://js1k.com/2017-magic/demo/2853
- Shortlink:
- https://js1k.com/2853
- Blog post:
- please update here!
- Bytes:
- 963
- Chars:
- 961
- Submission
s=90;o=[];_=Math;r=_.random;f=_.floor;a.width=a.height=x=y=300;h=x/2;k=13,l=0;for(i=s;i--;)o.push({X:h,Y:h,i:0});function m(i){c.fillStyle="rgba(0,0,0,.1)";if(l++%4==0)c.fillRect(0,0,x,y);c.fillStyle="rgba(255,255,0,0.2)";c.font='bold 99px Arial';c.fillText('฿',115+r()*4,178+r()*4);c.font='28px Courier';c.fillText('Magic',107+r()*4,90+r()*4);c.fillText('Money',107+r()*4,208+r()*4);c.font='12px Courier';c.fillStyle=["#fff","#f93","#8f8","#9af","#aaa"][f(i/2000%5)];c.fillText(['1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa','1XPTgDRhN8RFnzniWCddobD9iKZatrvH4','1HB5XMLmzFVj8ALj6mfBsbifRoD4miY36v','1EBHA1ckUWzNKN7BMfDwGTx6GKEbADUozX','15irp9ntbP54mvzjsSnBnTcuyUJBV5dpwG',][f(i/2000%5)],27,280);for(j=s;j--;){p=o[j];if(p.i++%k<1)for(q=7;p.d=f(r()*4),q--;)if(c.getImageData(p.X+(p.d-2)%2,p.Y+(p.d-1)%2,1,1).data[0]<7)break;if(p.X<0||p.X>=x)p.X=h;if(p.Y<0||p.Y>=y)p.Y=h;p.X+=(p.d-2)%2;p.Y+=(p.d-1)%2;c.fillStyle="#ff0";c.fillRect(p.X,p.Y,1,1)}requestAnimationFrame(m)}m()
- Description
- Bitcoin = Magic Internet Money
- Base64 encoded
cz05MDtvPVtdO189TWF0aDtyPV8ucmFuZG9tO2Y9Xy5mbG9vcjthLndpZHRoPWEuaGVpZ2h0PXg9eT0zMDA7aD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KHAuZC0yKSUyO3AuWSs9KHAuZC0xKSUyO2MuZmlsbFN0eWxlPSIjZmYwIjtjLmZpbGxSZWN0KHAuWCxwLlksMSwxKX1yZXF1ZXN0QW5pbWF0aW9uRnJhbWUobSl9bSgp
- Original source
s=90;o=[];_=Math;r=_.random;f=_.floor;a.width=a.height=x=y=300;h=x/2;k=13,l=0;
for(i=s;i--;) o.push({X:h,Y:h,i:0});
function m(i) {
// darken
c.fillStyle="rgba(0,0,0,.1)";
if(l++%4==0) c.fillRect(0,0,x,y);
//logo
c.fillStyle="rgba(255,255,0,0.2)";
c.font='bold 99px Arial';
c.fillText('฿', 115+r()*4, 178+r()*4);
c.font='28px Courier';
c.fillText('Magic', 107+r()*4, 90+r()*4);
c.fillText('Money', 107+r()*4, 208+r()*4);
c.font='12px Courier';
c.fillStyle=["#fff","#f93","#8f8","#9af","#aaa"][f(i/2000%5)];
c.fillText(['1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa', // genesis
'1XPTgDRhN8RFnzniWCddobD9iKZatrvH4', // pizza
'1HB5XMLmzFVj8ALj6mfBsbifRoD4miY36v', // wikileaks
'1EBHA1ckUWzNKN7BMfDwGTx6GKEbADUozX', // rich person
'15irp9ntbP54mvzjsSnBnTcuyUJBV5dpwG', // cherouvim <= donate here!!!1
][f(i/2000%5)], 27, 280);
// points
for(j=s;j--;){
p=o[j];
// collision detection
if(p.i++%k<1)
for(q=7;p.d=f(r()*4),q--;) if (c.getImageData(p.X+(p.d-2)%2,p.Y+(p.d-1)%2,1,1).data[0]<7) break;
if (p.X<0||p.X>=x)p.X=h;
if (p.Y<0||p.Y>=y)p.Y=h;
// 0 -2 ^
// 1 -1 <
// 2 0 \/
// 3 1 >
p.X+=(p.d-2)%2;
p.Y+=(p.d-1)%2;
c.fillStyle="#ff0";
c.fillRect(p.X,p.Y, 1, 1);
}
requestAnimationFrame(m)
}
m()