-
Notifications
You must be signed in to change notification settings - Fork 3
/
js13.js
41 lines (41 loc) · 20.3 KB
/
js13.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
(function(){function Za(){q={x:0.15*p,y:0.8*r,move:null,button:null}}function ja(){oa(f,{x:IPX+M,y:IPY+M,z:IPZ+M,c:0,Ba:0,h:0,f:20,e:20,d:20,j:u,g:u,r:20,i:Ea,color:Fa,face:"\uff61\u25d5 \u25d5\uff61",V:"\u203f",W:-5,X:5,update:xb,o:-0.2});Ga||(Ga=N(u,u,f,!0),$a=N(u,u,f,!1));f.U=Ga;f.J=$a;y(f);pa=f.b-0.5*p;qa=f.a-0.7*r}function Ea(a){e.save();-1E7<a.k&&(e.setTransform(1,0,0,0.3,a.b+a.r-4-F,a.a-a.k+a.z+2*a.r-1-OffsetY),e.beginPath(),e.arc(0,0,a.r,0,O),e.fillStyle=yb,e.fill());e.setTransform(1,0,0,
1,a.b-F,a.a-OffsetY);e.drawImage(0>a.c?a.U:a.J,0,0);e.restore()}function N(a,b,c,d){return U(a,b,function(a){var b=c.r;a.translate(b,b);a.lineWidth=1;a.strokeStyle="#111";a.fillStyle=c.color;a.beginPath();a.arc(0,0,b,0,O);a.fill();a.scale(d?1:-1,1);a.fillStyle="#222";a.fillText(c.face,-15,1);a.fillText(c.V,c.W,c.X);a.stroke()})}function xb(a,b){var c=a.left,d=a.right,g=a.T,h=0.22*b;a.c=c?a.c-h:d?a.c+h:a.c*Math.pow(0.9,b);h=g?3.5:2.5;if(z(a.c)>h){var e=Math.pow(0.95,b);a.c=0>a.c?w(a.c*e,-h):x(a.c*
e,h)}Ha(a,b);0<a.h&&(h=Ia(a.x,a.y,a.z,20,Ja))&&(ab.play(),a.z=h.z-20,a.h*=-0.8);-1E3>a.z&&ja();h=ra(a.x,a.y,a.z,20);a.k=-Infinity;if(h.d){if(a.floor=h,a.k=h.z+M,a.z<=a.k||!a.floor.$&&g&&5>a.z-a.k&&2>z(a.h)){if(a.floor.$&&0>a.h){ja();return}-2>a.h||g?zb.play():-1>a.h&&Ab.play();a.z=a.k;a.h=g?x(z(a.h/2),6):x(z(a.h/2),z(a.c)/1.5)}}else a.floor=!1;if(h=Ia(a.x,a.y,a.z,20,0<a.c?sa:ta))a.x=0<a.c?h.x-20:h.x+h.e+20,ab.play(),a.c=10<a.z-a.k?-0.2*a.c:-0.8*a.c;y(a);a.b-=M;a.a-=M/2;if(c||d)pa=a.b-p*(0.5-a.c/20);
a.n&&(a.o-=0.01);a.m&&(a.o+=0.01);a.o=a.n||a.m?w(x(a.o,-0.5),0.5):w(x(a.o,-0.1),0.1);qa=a.a-r*(0.5-a.o)}function Ha(a,b){a.h=x(-9,a.h-0.2*b);var c=a.c,d=a.h;a.floor&&a.floor.L.c&&4>z(a.k-a.floor.z-M)&&(c+=a.floor.L.c,d+=a.floor.L.h);a.x+=c*b;a.z+=d*b}function bb(a){f.T=1;q.button=a;n.clearRect(p/2,0,p/2,r);n.beginPath();n.arc(a[1],a[2],35,0,O);n.fill()}function cb(a){q.move=a;var b=a[1];a=a[2];n.clearRect(0,0,p/2,r);n.beginPath();n.arc(q.x,q.y,20,0,O);n.moveTo(q.x,q.y);n.lineTo(b,a);n.arc(b,a,35,
0,O);n.stroke();n.fill();b<q.x-15?(f.left=1,f.right=0,f.n=0,f.m=0):b>q.x+15?(f.left=0,f.right=1,f.n=0,f.m=0):(f.left=0,f.right=0);f.left||f.right||(a<q.y-15?(f.n=1,f.m=0):a>q.y+15?(f.n=0,f.m=1):(f.n=0,f.m=0));event.preventDefault()}function db(a){Z[a.keyCode]="keydown"==a.type;f.left=Z[37];f.right=Z[39];f.n=Z[38];f.m=Z[40];f.T=Z[32];(32==a.keyCode||37<=a.keyCode&&40>=a.ya)&&a.preventDefault()}function Bb(a,b){a.floor||(a.floor=ra(a.x+G,a.y+G,a.z+G,C),a.k=a.floor.z+G,DEBUG&&-1E7>a.k&&alert("Enemy must be above floor"));
Ha(a,b);var c=0;0>a.c&&a.x+C<=a.floor.x?c=1:0<a.c&&a.x>a.floor.x+a.floor.e&&(c=2);if(0!=c){var d=ra(a.x,a.y,a.z,C);a.floor!=d&&10>z(d.z-a.floor.z)&&(a.floor=d,a.k=a.floor.z+G);d!=a.floor&&(a.x=1==c?a.floor.x-C+1:a.floor.x+a.floor.e-1,a.c*=-1)}a.z<=a.k&&(a.z=a.k,a.h=2);if(c=Ia(a.x,a.y,a.z,C,0<a.c?sa:ta))a.x=0<a.c?c.x-C:c.x+c.e+C,a.c*=-1;y(a);a.b-=G;a.a-=G/2;a.b+a.j-10>=f.b&&a.b+10<f.b+f.j&&a.a+a.g-10>=f.a&&a.a+10<f.a+f.g&&(180<H-$&&(s=0),I[s++].play(),s%=I.length,$=H,ja())}function eb(a,b,c){a={x:a+
G,y:IPY+G,z:b+G,f:P,c:c?c/-10:-1,h:0,f:C,e:C,d:C,j:P,g:P,r:C,i:Ea,update:Bb,color:Ka,face:"\u25d5` \u141f\u25d5 \u30ce",V:"\u2054",W:-8,X:9};y(a);La||(La=N(P,P,a,!0),fb=N(P,P,a,!1));a.U=La;a.J=fb;D.push(a)}function Cb(a,b){var c={x:a+16,y:IPY+16,z:b+16,f:64,c:0,h:4,f:32,e:32,d:32,j:64,g:64,r:32,i:function(a){e.strokeStyle="#221";e.fillRect(0,0,50,30);e.strokeRect(0,0,50,30);e.fillStyle="#fe7";e.font="36px arial";e.fillText("\u265b",a.b+15,a.a+2);Ea(a)},update:function(a,b){a.floor||(a.floor=ra(a.x+
16,a.y+16,a.z+16,32),a.k=a.floor.z+16,DEBUG&&-1E7>a.k&&alert("King must be above floor"));Ha(a,b);a.z<=a.k&&(a.z=a.k,a.h=z(a.h));y(a);a.b-=16;a.a-=8},color:Ma,face:"\u0ca0 \u0c8e \u0ca0",V:"\u2054",W:-8,X:9};y(c);ua||(ua=N(64,64,c,!0));c.U=ua;c.J=ua;D.push(c)}function gb(a){D=[];sa=[];ta=[];Na=[];Ja=[];F=OffsetY=0;V=[];va={};IPX=0;IPY=50;IPZ=0;BW=27;BC=hb;B=4095;Y=0;l=100;for(var b=0;b<a.length;){var c=a[b++];switch(c){case 0:IPX=a[b++];IPZ=a[b++];ja();break;case 1:Db(a[b++],a[b++]);break;case 2:eb(a[b++],
a[b++]);break;case 3:case 4:DR=3==c?wa:xa;aa(a[b++],a[b++],a[b++],a[b++]);break;case 10:var d=aa(a[b++],a[b++],a[b++],a[b++]);d.w.l.$=!0;d.t=ib;break;case 5:Y=a[b++];l=a[b++];break;case 11:var g=a[b++],h=a[b++],e=a[b++],f=a[b++],Q=a[b++];case 6:var ya=a;a=a[b++];var ha=b,p=[],Oa=D;D=p;var n,m;if(11==c){var r=1E7,q=r;m=n=-1E7;for(b=0;b<a.length;){b++;var d=a[b++],s=a[b++],r=w(r,d),q=w(q,s);n=x(n,d+a[b++]);m=x(m,s+a[b++])}n=n-r+1;m=m-q+1;h-=m;f-=m;m/=2}for(b=0;b<a.length;){var s=a[b++],d=a[b++],A=a[b++],
u=a[b++],y=a[b++];11==c&&(d=d-r+g-n,A=A-q+h-m);switch(s){case 3:case 4:DR=3==s?wa:xa;aa(d,A,u,y);break;case 10:d=aa(d,A,u,y);d.w.l.$=!0;d.t=ib;break;default:ba("Error loading level at index "+ha+" subindex "+b+" type: "+s)}}a=ya;b=ha;D=Oa;var z=Eb(p);11==c&&(v(z.s,function(a){a.w.l&&(a.w.l.L=z)}),jb(z,g-n,h-m,e-n,f-m,Q));break;case 7:case 8:DR=7==c?wa:xa;g=a[b++];h=a[b++];e=a[b++];f=a[b++];c=a[b++];ya=a[b++];Q=a[b++];d=g-c/2;A=h-ya/2;d=aa(d,A,c,ya);jb(d,g,h,e,f,Q);break;case 9:eb(a[b++],a[b++],a[b++]);
break;case 12:case 13:DR=12==c?wa:xa;Fb(a[b++],a[b++],a[b++],a[b++]);break;case 14:Gb(a[b++],a[b++],a[b++],a[b++],a[b++],a[b++],a[b++]);break;case 15:Hb(a[b++],a[b++],a[b++]);break;case 16:Cb(a[b++],a[b++]);break;case 17:Ib(a[b++],a[b++],a[b++],a[b++]);break;default:ba("Error loading level at index "+b+" type: "+c)}}}function Gb(a,b,c,d,g,h,ma){e.font=h+"pt "+g;var l=0;ma=ma.split("\\n");v(ma,function(a){l=x(l,e.measureText(a).width)});var Q=1.2*h*(ma.length+1);a={x:a,z:b,y:Y,f:Q,e:l,d:0,g:Q,j:l,
sa:ma,ba:1.2*h,color:c,stroke:d,pa:g,size:h,t:function(a){e.font=a.size+"px "+a.pa;e.textAlign="center";e.fillStyle="#"+a.color;e.strokeStyle="#"+a.stroke;var b=a.ba,c=a.e/2;v(a.sa,function(d){e.fillText(d,c,b);e.strokeText(d,c,b);b+=a.ba})},i:function(a){var b=z(f.b-(a.b+a.j/2));if(!(b>a.j+100)){var c=z(f.a-(a.a+a.g/2));c>a.g+100||(J(x(0,w(1,1.4-c/(a.g+100)-b/(a.j+100)))),Pa(a),J(1))}}};y(a);ea(a)}function Hb(a,b,c){a={x:a,z:b,y:IPY+10,f:c,e:10,d:0,g:c,j:10,D:!1,C:-1,i:function(a){e.fillStyle="#a73";
e.fillRect(a.b,a.a,a.j,a.g);a.D&&(Qa||(Qa=U(50,30,function(a){a.fillStyle="#aaf";a.strokeStyle="#000";a.fillRect(0,0,50,30);a.strokeRect(0,0,50,30);a.fillStyle="#fe7";a.font="24px arial";a.fillText("\u265b",12,12);a.drawImage(f.J,15,8,20,20)})),a.C>a.a&&(a.C-=2),e.drawImage(Qa,a.b-50,a.C))},update:function(a){!a.D&&a.b>=f.b-4&&a.b<f.b+u+4&&a.a+a.g>=f.a-4&&a.a<f.a+u+4&&(3E3<H-$&&(s=0),I[s++].play(),s%=I.length,$=H,a.C=a.a+a.g-30,a.D=!0,IPX=a.x,IPZ=a.z)}};y(a);ea(a)}function Eb(a){var b={s:a,t:function(a){v(a.s,
function(b){b.t(b,b.b-a.b,b.a-a.a)})},i:Pa,la:function(a){v(a.s,function(a){y(a)});kb(a.s,a)}};kb(a,b);ea(b);return b}function kb(a,b){var c,d,g,h,e,f,Q,l,ha,n;c=d=g=h=e=Infinity;f=Q=l=ha=n=-Infinity;v(a,function(a){h=w(h,a.b);ha=x(ha,a.b+a.j);e=w(e,a.a);n=x(n,a.a+a.g);c=w(c,a.x);f=x(f,a.x+a.e);d=w(d,a.y);Q=x(Q,a.y+a.d);g=w(g,a.z);l=x(l,a.z+a.f)});oa(b,{b:h,a:e,j:ha-h+1,g:n-e+1,x:c,y:d,z:g,e:f-c+1,f:l-g+1,d:Q-d+1})}function ib(a,b,c){e.setTransform(1,0,0,1,b||0,c||0);e.fillStyle=ca(190,190,190);e.strokeStyle=
ca(40,40,40);e.lineWidth=1;for(b=a.d/2-5;0<=b;b-=10){c=a.g-b;e.beginPath();for(var d=0;d<=a.e;d+=20)e.moveTo(d+b,c),e.lineTo(d+b+5,c-a.f),e.lineTo(d+b+10,c);e.stroke();e.fill()}}function xa(a){a.aa.i(0,0,a.A,a.B);lb(a)}function wa(a){var b=a.A,c=a.B,d=a.R,g=a.P,h=a.N;e.fillStyle=a.Q;e.fillRect(0,0,b,c);e.strokeStyle=d;d=0;e.lineWidth=h/5;y0=0;y1=h;for(e.beginPath();y1<=c;){d++;e.moveTo(0,y1);e.lineTo(b,y1);for(x0=d&1?g:g/2;x0<b;)e.moveTo(x0,y0),e.lineTo(x0,y1),x0+=g;y0=y1;y1+=h}e.stroke();lb(a)}function Jb(a){var b=
f;if(a.y+a.d<=b.y+3)return!1;if(b.y+b.d<=a.y+3||a.z+a.f<=b.z+3||a.x+a.e<=b.x+3)return!0;if(b.z+b.f<=a.z+3||b.x+b.e<=a.x+3)return!1;ba("cubes intersection: ");return null}function J(a){a!=mb&&(mb=e.globalAlpha=a)}function lb(a){var b=a.O,c=a.A,d=a.B;b&15&&(e.strokeStyle=a.M,e.beginPath(),b&1&&(e.moveTo(0,0),e.lineTo(c,0)),b&2&&(e.moveTo(c,0),e.lineTo(c,d)),b&4&&(e.moveTo(c,d),e.lineTo(0,d)),b&8&&(e.moveTo(0,d),e.lineTo(0,0)),e.stroke())}function nb(a,b,c,d,g){var h=[],e=b+d,f=c+g;v(a,function(a){a.b+
a.j>=b&&a.b<=e&&a.a+a.g-a.d/2>=c&&a.a-a.d/2<=f&&h.push(a)});return h}function Pa(a){var b=V.indexOf(a.id);-1!=b?b<V.length-1&&(V.splice(b,1),V.push(a.id)):(50<=V.length&&(b=V.shift(),ba("Removing from cache cube "+b),delete va[b]),V.push(a.id),b=U(a.j,a.g,function(b){var d=e;e=b;a.t(a);e=d}),ba("Adding to cache sprite "+a.id+" X:"+a.x+" Y:"+a.y+" Z:"+a.z+" W:"+a.e+" H:"+a.f+" D:"+a.d),va[a.id]=b);va[a.id].i(a.b,a.a-a.d/2,a.j,a.g)}function Kb(a,b,c){b=b||0;c=c||0;var d=a.d/2;a.S&&(e.setTransform(1,
0,0,1,b,c+d),a.S.i(a.S));a.top&&(e.setTransform(1,0,-0.5,0.5,b+0.4+d,c),a.top.i(a.top));a.right&&(e.setTransform(0.5,-0.5,0,1,b+a.e,c+d),a.right.i(a.right))}function ob(a,b,c,d){BH=BH||0.3*BW;a={x:a,y:Y,z:b,e:c,f:d,d:l,j:c+l/2,g:d+l/2,t:Kb,i:Pa};y(a);0<c&&0<d&&(a.S={Q:Lb,R:Mb,aa:Nb,A:c,B:d,P:BW,N:BH,M:BC,O:B,i:DR[0]||DR});0<l&&0<d&&(a.right={Q:Ob,R:Pb,aa:Qb,A:l,B:d,P:BW,N:BH,M:BC,O:B>>4,i:DR[1]||DR});0<c&&0<l&&(a.top={Q:Rb,R:Sb,aa:Tb,A:c,B:l,P:BW,N:BH,M:BC,O:B>>8,i:DR[2]||DR});ea(a);return a}function ea(a){a.id=
Ra++;D.push(a)}function ra(a,b,c,d){var g={z:-1E10};v(Na,function(h){h.z>g.z&&c+d>h.z&&a+d>h.x&&a<h.x+h.e&&b+d>h.y&&b<h.y+h.d&&(g=h)});return g}function jb(a,b,c,d,g,h){oa(a,{c:(d-b)/160*h/10,h:(g-c)/160*h/10,ga:x(c,g),ia:w(c,g),fa:x(b,d),ha:w(b,d),update:function(a,b){var c=a.x,d=a.z;a.x+=a.c*b;if(a.x>a.fa||a.x<a.ha)a.x=x(w(a.x,a.fa),a.ha),a.c*=-1;a.z+=a.h*b;if(a.z>a.ga||a.z<a.ia)a.z=x(w(a.z,a.ga),a.ia),a.h*=-1;c=a.x-c;d=a.z-d;v(a.s||[a],function(a){a.b+=c;a.a-=d;a=a.w;a.p&&(a.p.z+=d,a.p.x+=c,a.v.z+=
d,a.v.x+=c);a.l&&(a.l.x+=c,a.l.z+=d,a.u.x+=c,a.u.z+=d)});a.s&&(a.b+=c,a.a-=d)}})}function Ia(a,b,c,d,g){return Ub(g,function(g){if(a+d>g.x&&a<g.x+g.e&&b+d>g.y&&b<g.y+g.d&&c+d>g.z&&c<g.z+g.f)return g})}function Fb(a,b,c,d){var g,e,f,l;c>d?(g=w(c,40),e=d,f=0,l=x(d/5,10)):(g=c,e=w(d,40),f=x(c/5,20),l=0);for(var n=a;n+g<=a+c;n+=g)for(var p=b;p+e<=b+d;p+=e)aa(n+(0+(f-0)*K()),p+(0+(l-0)*K()),g,e),Ra--;Ra++;if(n!=a+c||p!=b+d)p==b+d?(c=c-n+a,a=n):(d=d-p+b,b=p),aa(a+(0+(f-0)*K()),b+(0+(l-0)*K()),c,d)}function Ib(a,
b,c,d){a=ob(a,b,c,d);a.i=function(a){e.fillStyle="#000";e.strokeStyle="#ff0";e.lineWidth=5;e.fillRect(a.b,a.a+a.d,a.e,a.f);e.strokeRect(a.b,a.a+a.d,a.e,a.f)};a.update=function(a){if(!a.D&&f.b+u>=a.b-10&&f.b<a.b+a.j+10&&f.a+u>=a.a-10&&f.a<a.a+a.g+10){a.D=!0;za++;za>pb.length&&(alert("You win..."),za=0);gb(pb[za]);s=0;var b=function(){I[s++].play();s%=I.length;$=H;6>s&&setTimeout(b,200)};b()}}}function aa(a,b,c,d){var g=ob(a,b,c,d);if(Y+l<IPY||Y>IPY)a={};else{var e={};16<l&&16<d&&(e.p={y:Y,z:b,d:l,
f:d,e:0,x:a},sa.push(e.p),e.v={y:Y,z:b,d:l,f:d,e:0,x:a+c},ta.push(e.v));if(16<l&&16<c){e.l={x:a,y:Y,e:c,d:l,f:0,z:b+d,L:g};if(!g)debugger;Na.push(e.l);e.u={x:a,y:Y,e:c,d:l,f:0,z:b};Ja.push(e.u)}a=e}g.w=a;return g}function y(a){a.b=a.x+a.y/2;a.a=r-a.y/2-a.f-a.z}function Sa(a){var b=e.createPattern(U(3*l,3*l,function(b){b.drawImage(a,0,0,3*l,3*l)}),"repeat");b.i=function(a,b,g,f){e.fillStyle=this;e.fillRect(a,b,g,f)};return b}function Ta(a,b,c,d,g,e,f,l,n){b=a.createImageData(b,c);c=b.data;for(var p=
0;p<c.length;p+=4){var r=c,q=p,Oa=d+K()*g,s=e+K()*f,m=l+K()*n;r[q]=Oa;r[q+1]=s;r[q+2]=m;r[q+3]=255}a.putImageData(b,0,0)}function Db(a,b){var c={x:a,z:b,y:IPY,f:10,e:10,d:0,g:10,j:10,ka:0+100*K()<<0,update:Vb,i:Wb,qa:!0};y(c);ea(c)}function Xb(){v(Ua,function(a){for(var b=0;b<D.length;b++)if(D[b].id==a){D.splice(b,1);break}});Ua=[]}function Wb(a){e.drawImage(Va[(H+a.ka)%Va.length],a.b-L/2,a.a-L/2)}function Vb(a){a.b>=f.b-4&&a.b<f.b+u+4&&a.a>=f.a-4&&a.a<f.a+u+4&&(3E3<H-$&&(s=0),I[s++].play(),s%=I.length,
$=H,Ua.push(a.id))}function da(a){Wa.F.ta(a);var b=Wa.va();a=new Uint8Array(4*((b+1)/2|0)+44);var b=2*Wa.ua(new Uint16Array(a.buffer,44),b),c=new Uint32Array(a.buffer,0,44);c[0]=1179011410;c[1]=b+36;c[2]=1163280727;c[3]=544501094;c[4]=16;c[5]=65537;c[6]=44100;c[7]=88200;c[8]=1048578;c[9]=1635017060;c[10]=b;for(var b=b+44,c=0,d="data:audio/wav;base64,";c<b;c+=3)var g=a[c]<<16|a[c+1]<<8|a[c+2],d=d+("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[g>>18]+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[g>>
12&63]+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[g>>6&63]+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[g&63]);c-=b;a=new Audio;a.src=d.slice(0,d.length-c)+"==".slice(0,c);return a}function ba(a){DEBUG||alert("Forgot a log");console.log(a)}function qb(a,b){for(var c=[],d=0;d<a.length;d++)c[d]=a[d];oa(c,b);return c}function oa(a,b){for(k in b)a[k]=b[k]}function ca(a,b,c,d){return"rgba("+a+","+b+","+c+","+(d||1)+")"}function U(a,b,c){var d=W.createElement("canvas");
d.width=a;d.height=b;c(d.getContext("2d"),d);d.i=function(a,b,c,d){e.drawImage(this,a,b,c,d)};return d}function Ub(a,b){return Yb(a.length,function(c){return b(a[c],c)})}function Yb(a,b){var c;c=c||1;for(var d=0;d<a;d+=c){var g=b(d);if(g)return g}}function Xa(a,b){var c;c=c||1;for(var d=0;d<a;d+=c)b(d)}function v(a,b){for(var c=0;c<a.length;c++)b(a[c],c)}function Zb(){this.ta=function(a){for(var b=0;24>b;b++)this[String.fromCharCode(97+b)]=a[b]||0;0.01>this.q&&(this.q=0.01);a=this.G+this.q+this.H;
0.18>a&&(a=0.18/a,this.G*=a,this.q*=a,this.H*=a)}}function rb(a){null==Ya&&(Aa=Ya=a);H=(Aa-Ya)/16|0;var b=w(3,(a-Aa)/16);Aa=a;Ba=0.9*Ba+0.1*pa;F=sb(Ba);Ca=0.9*Ca+0.1*qa;OffsetY=sb(Ca);e.setTransform(1,0,0,1,0-F,0-OffsetY);e.clearRect(F,OffsetY,p,r);a=nb(D,F-p/2,OffsetY-r/2,2*p,2*r);f.update(f,b);v(a,function(a){a.update&&a.update(a,b)});tb=nb(a,F,OffsetY,p,r);var c=[],d=[];v(tb,function(a){Jb(a)?c.push(a):d.push(a)});v(c,function(a){a.i(a)});f.i(f);v(d,function(a){a.qa?J(1):a.b-10<f.b+f.j&&a.b+10+
a.j>f.b&&a.y+a.d<f.y&&a.a-10<f.a+f.g&&a.a+10+a.g>f.a?J(0.3):J(1);a.i(a)});J(1);Xb();Da(rb)}DEBUG=!0;onerror=function(a,b,c){alert(a,b,c)};var W=document,R=[];v(["b","c","d"],function(a){R.push(W.getElementById(a))});var p=R[0].width,r=R[0].height,ub=R[1].getContext("2d"),e=ub,S=R[0].getContext("2d"),n=R[2].getContext("2d"),K=Math.random,z=Math.abs,w=Math.min,x=Math.max,sb=Math.round,O=2*Math.PI,D=[],q=0;BgCStyle="#222";S.fillStyle=BgCStyle;S.fillRect(0,0,p,r);var v=function(a,b){for(var c=0;c<a.length;c++)b(a[c],
c)},Da=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame;if(!Da)var vb=0,Da=function(a){var b=Date.now(),c=Math.max(0,16-(b-vb));window.setTimeout(function(){a(b+c)},c);vb=b+c};var Ba,Ca,F=OffsetY=0,hb=ca(15,15,15,0.3);BW=27;BH=0;B=4095;BC=hb;var Wa=new function(){this.F=new Zb;var a,b,c,d,e,f,l,n,p,r,q,s;this.reset=function(){var a=this.F;d=100/(a.oa*a.oa+0.001);e=100/(a.ca*a.ca+0.001);f=1-0.01*a.f*a.f*a.f;l=1E-6*-a.da*a.da*a.da;a.na||(q=0.5-a.za/2,
s=5E-5*-a.Aa);n=0<a.I?1-0.9*a.I*a.I:1+10*a.I*a.I;p=0;r=1==a.ea?0:2E4*(1-a.ea)*(1-a.ea)+32};this.va=function(){this.reset();var d=this.F;a=1E5*d.G*d.G;b=1E5*d.q*d.q;c=1E5*d.H*d.H+10;return a+b+c|0};this.ua=function(x,v){var m=this.F,w=1!=m.K||m.ma,u=0.1*m.ma*m.ma,y=1+3E-4*m.e,A=0.1*m.K*m.K*m.K,C=1+1E-4*m.ka,D=1!=m.K,G=m.x*m.x,I=m.ca,H=m.Y||m.Z,R=0.2*m.Z*m.Z*m.Z,F=m.Y*m.Y*(0>m.Y?-1020:1020),O=m.ja?(2E4*(1-m.ja)*(1-m.ja)|0)+32:0,U=m.d,P=m.xa/2,V=0.01*m.ra*m.ra,K=m.na,M=a,$=1/a,aa=1/b,ca=1/c,m=5/(1+20*
m.wa*m.wa)*(0.01+A);0.8<m&&(m=0.8);for(var m=1-m,T=!1,Z=0,J=0,L=0,S=0,ka=0,N,la=0,E,fa=0,ia,ba=0,t,ea=0,ga,da=0,W=Array(1024),na=Array(32),X=W.length;X--;)W[X]=0;for(X=na.length;X--;)na[X]=2*Math.random()-1;for(X=0;X<v;X++){if(T)return X;O&&++ea>=O&&(ea=0,this.reset());r&&++p>=r&&(r=0,d*=n);f+=l;d*=f;d>e&&(d=e,0<I&&(T=!0));E=d;0<P&&(da+=V,E*=1+Math.sin(da)*P);E|=0;8>E&&(E=8);K||(q+=s,0>q?q=0:0.5<q&&(q=0.5));if(++J>M)switch(J=0,++Z){case 1:M=b;break;case 2:M=c}switch(Z){case 0:L=J*$;break;case 1:L=
1+2*(1-J*aa)*U;break;case 2:L=1-J*ca;break;case 3:L=0,T=!0}H&&(F+=R,ia=F|0,0>ia?ia=-ia:1023<ia&&(ia=1023));w&&y&&(u*=y,1E-5>u?u=1E-5:0.1<u&&(u=0.1));ga=0;for(var ja=8;ja--;){fa++;if(fa>=E&&(fa%=E,3==K))for(N=na.length;N--;)na[N]=2*Math.random()-1;switch(K){case 0:t=fa/E<q?0.5:-0.5;break;case 1:t=1-2*(fa/E);break;case 2:t=fa/E;t=6.28318531*(0.5<t?t-1:t);t=0>t?1.27323954*t+0.405284735*t*t:1.27323954*t-0.405284735*t*t;t+=0.225*(t*z(t)-t);break;case 3:t=na[Math.abs(32*fa/E|0)]}w&&(N=la,A*=C,0>A?A=0:0.1<
A&&(A=0.1),D?(ka+=(t-la)*A,ka*=m):(la=t,ka=0),la+=ka,S+=la-N,t=S*=1-u);H&&(W[ba%1024]=t,t+=W[(ba-ia+1024)%1024],ba++);ga+=t}ga=0.125*ga*L*G;x[X]=1<=ga?32767:-1>=ga?-32768:32767*ga|0}return v}},wb=[0,,0.14,0.445,0.4616,0.6,,,,,,0.587,0.5406,,,,,,1,,,,,0.45],I=[];Xa(5,function(a){I.push(da(qb(wb,{5:0.6+0.05*a})))});Xa(4,function(a){I.push(da(qb(wb,{5:0.8-0.05*a})))});var s=0,$=0,Ua=[],L=80,Va=[];Xa(128,function(a){var b=z(Math.sin(O*a/128));0.1<b&&Va.push(U(L,L,function(c){c.strokeStyle="#aa6";c.shadowBlur=
30;c.lineWidth=2;c.shadowColor="#ff2";c.beginPath();c.setTransform(b,0,0,1,L/2,L/2);c.fillStyle="#fe4";c.arc(0,0,10,0,O);c.fill();c.fillStyle="#aa6";63<a?c.fillText("1",-3,3.5):c.fillText("\u265b",-5,3.5);c.stroke()}))});var l=20,$b=U(l,l,function(a){Ta(a,l,l,80,20,180,40,80,40)}),ac=U(l,l,function(a){Ta(a,l,l,120,20,110,20,40,30)}),bc=U(l,l,function(a){Ta(a,l,l,140,25,120,25,50,40)}),Tb=Sa($b),Nb=Sa(ac),Qb=Sa(bc),pa=0,qa=0,sa,ta,Na,Ja,va,V,Ra=0,Rb="#e86",Sb="#eda",Lb="#d74",Mb="#dc8",Ob="#b52",Pb=
"#ba6",mb=1,Qa=0,Ma=e.createRadialGradient(15,-9,3,15,-9,32);Ma.addColorStop(0,"#67B6FE");Ma.addColorStop(1,"#535CB3");var ua=0,fb,La=!1,Ka=e.createRadialGradient(15,-9,3,15,-9,32);Ka.addColorStop(0,"#FFD6CE");Ka.addColorStop(1,"#B34C80");var C=22,P=2*C,G=P/4,Z={};W.addEventListener("keydown",db);W.addEventListener("keyup",db);W.body.addEventListener("touchmove",function(a){a.preventDefault()},!1);n.fillStyle=ca(140,150,240,0.5);n.shadowColor=ca(170,180,250,0.5);n.shadowBlur=30;n.lineWidth=7;n.strokeStyle=
ca(80,90,140,0.5);var T=R[2];T.addEventListener("touchstart",function(a){var b=null,c=null;v(a.changedTouches,function(a){var e=a.clientX-T.offsetLeft,f=a.clientY-T.offsetTop;e<p/2-20?b=[a.identifier,e,f]:e>p/2+20&&(c=[a.identifier,e,f])});null!=b&&cb(b);null!=c&&bb(c);a.preventDefault()});T.addEventListener("touchmove",function(a){var b=null,c=null;v(a.changedTouches,function(a){var e=a.clientX-T.offsetLeft,f=a.clientY-T.offsetTop;e<p/2-20?b=[a.identifier,e,f]:e>p/2+20&&(c=[a.identifier,e,f])});
null!=b&&cb(b);null!=c&&bb(c);a.preventDefault()});T.addEventListener("touchend",function(a){v(a.changedTouches,function(a){null!=q.move&&a.identifier==q.move[0]&&(q.move=null,f.left=0,f.right=0,f.n=0,f.m=0,n.beginPath(),n.clearRect(0,0,p/2,r),n.arc(q.x,q.y,30,0,O),n.fill());null!=q.button&&a.identifier==q.button[0]&&(q.button=null,f.T=0,n.clearRect(p/2,0,p/2,r))})});var Fa=e.createRadialGradient(12,-7,3,12,-7,28);Fa.addColorStop(0,"#8ED6FF");Fa.addColorStop(1,"#004CB3");var u=40,M=u/4,zb=da([0,,
0.1453,,0.225,0.3726,,0.12,0.22,,,,,0.1547,,,,,1,,,,,0.35]),Ab=da([0,,0.1,,0.22,0.3726,,0.14,0.2,,,,0.12,0.1547,,,,,1,,,,,0.26]),ab=da([0,,0.11,0.16,0.09,0.227,0.04,-0.18,0.34,,,,,0.23,0.12,,,,1,0.2,0.16,0.1,,0.32]),yb=ca(15,15,15,0.5),$a,Ga=!1,f={};Za();var pb=[intro,[5,100,10,17,5883,-704,85,123,15,1694,-599,149,5,0,100,3,42,-232,556,125,3,41,-108,97,449,1,171,-75,1,194,-46,1,221,-71,3,320,-64,59,106,3,141,42,237,79,3,138,247,335,233,12,475,43,1355,297,1,426,94,3,598,-224,109,38,1,657,-15,1,887,
-22,1,1155,-23,1,1350,-19,1,1688,-199,3,3292,-645,130,38,3,3488,-572,109,38,3,3667,-508,260,38,3,3931,-662,260,38,3,4278,-753,260,38,15,4645,-691,124,3,3138,-900,1419,54,10,3233,-838,1349,75,1,4411,-685,9,3877,-421,38,9,4135,-569,42,9,4315,-674,30,9,4499,-678,34,15,3328,-606,149,3,4792,-521,1264,270,3,6064,-940,151,697,1,2120,-635,1,2375,-643,1,2658,-637,9,3997,-576,25,10,601,-182,110,33,3,1710,-954,194,88,10,1717,-868,179,95,12,713,-233,114,125,3,830,-223,109,38,10,831,-181,110,33,3,947,-234,150,
125,3,1101,-214,109,38,10,1097,-172,110,33,12,1214,-236,79,125,3,1294,-216,109,38,10,1295,-175,110,33,3,1409,-725,245,617,3,1656,-723,103,125,3,3121,-842,109,113,12,1859,-727,1372,54,9,3132,-595,47,9,2213,-621,38,9,1935,-621,29,9,2811,-628,20,9,2548,-616,10,3,4592,-747,1474,48,3,1835,-324,1458,478,10,5120,-698,54,51,10,5424,-695,63,50,10,5611,-694,101,47,10,4924,-696,94,44,10,5275,-698,54,51,0,201,172,3,2302,-598,148,38,3,2795,-593,148,38,5,0,10,3,46,-110,337,236]],za=0;gb(intro);window.onresize=
function(){var a=R[0].parentElement,b=p,c=r;p=w(960,a.offsetWidth);r=w(760,a.offsetHeight);var d=a.offsetLeft+(a.offsetWidth-p)/2+"px";v(R,function(a){a.style.top=0;a.style.left=d;if(b!=p||c!=r)a.width=p,a.height=r});S.fillStyle=BgCStyle;S.fillRect(0,0,p,r);if(b!=p||c!=r)v(D,function(a){a.la?a.la(a):y(a)}),Za()};onresize();navigator.userAgent.match(/Android/i)&&(window.scrollTo(0,1),S.fillStyle=BgCStyle,S.fillRect(0,0,p,r));Ba=pa=f.b-0.5*p;Ca=qa=f.a-0.8*r;var e=ub,Ya=null,H,Aa,tb=[];Da(rb)})();