Advertisement
Guest User

Untitled

a guest
Dec 30th, 2010
215
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.01 KB | None | 0 0
  1. c.height=c.width=W=255;
  2. c.style.border='4px solid';
  3. V=3;
  4. T='000';
  5. G=T+T+914062108081923[s='toString'](2);
  6. Z=T+6798437144058750[s](2);
  7. $=[];
  8. s=t=L=U=0;
  9. u={38:-2,40:2};
  10. l={37:-1,39:1};
  11. h=X=10;Y=125;
  12. m=Math;
  13. K=r=m.random;
  14. with(a)j=function(v){return v>=0&&v<8},
  15. B=function(v){return m.min(m.max(0,v),W-8)},
  16. P=function(x,y){x=(x+y*W)*4;for(y=1;y<5;)I.data[x++]=y++>>2?W:9},
  17. S=function(x,y,p){for(J=0;J++<56;)p.charAt(J)&1&&P(x+J%8,y+(J>>3))},
  18. onkeydown=function(e){(v=u[e=e.which])?U=v:(v=l[e])?L=v:h&&(h=0,t=X+8,b=Y+1)},
  19. onkeyup=function(e){u[e=e.which]==U?U=0:l[e]==L?L=0:0},
  20. setInterval(function(){X+=L;Y+=U;I=createImageData(W,W);for(i=V;i>0;)S(W-i--*10,245,Z);S(X,Y,Z);h||P(t,b)&(h=t==(t=B(t+4)));
  21. $.forEach(function(v,i){S(x=--v[0],y=v[1],G);(x<1||j(x-X)&&m.abs(y-Y)<8)?$.splice(i,1)+(K=function(){fillStyle="red";fillRect(0,0,W,W);K=r})+V--:!h&&j(x-t)&&j(b-y)?h=$.splice(i,1)+(++s%20||++V):0});V>0&&S(2,3,G)+putImageData(I,0,0)+fillText(s,15,10);(g=$.length<4&&r()>.93&&25+8*~~(r()*25))&&$.push([246,g]);K()},70)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement