-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
1 lines (1 loc) · 24.7 KB
/
index.html
1
<!DOCTYPE html><head><meta charset="utf-8"><title>Don't Die To Ghosts</title> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css" /><style>*{touch-action: none;margin: 0;padding: 0;outline: 0;user-select: none;display: inline-block}body{overflow: hidden;background-color: #000}.a{position: absolute;z-index: 1000}.h{display: none}.d{pointer-events: none}.m{left: 0;top: 0;width: 100%;height: 100%}#b{position: absolute;z-index: 1000;filter: drop-shadow(0 0 24px #00f)}#b:hover{filter: sepia()}#b:active{transform: scale(.9)}#l{position: absolute;left: 0;top: 0;width: 100%;width: 100%;text-align: center;font-size: 3em;color: #ff0;font-family: sans-serif;filter: drop-shadow(0 0 16px #00f)}#c{position: absolute;left: 0;top: 0}#g{position: absolute;top: 0}</style></head><body oncontextmenu="return!1" ondragstart="return!1" ondrop="return!1"><div id="l"><h1><br><br>LOADING</h1></div><div id="g"></div></body><script>const e=document,t=window,i=t.localStorage,l="com.antix.ddtg",r=Math,a=r.floor,h=r.random,s=r.min,f=r.ceil,$=r.PI*2,d=r.cos,n=r.sin,c=r.abs,o=1920,g=1080,y=0,v=1,w=2,u=3,m=4,p=5,b=6,C=7,k=0,L=1,I=2,E=3,R=4,O=5,D=6,A=7,S=8,W=9,P=915,T=750,B=.01,N=500,F=4,q=2,H=3,U=4.5,G=32,Y=4,V=32;let X=y,J,K,M,Z,j,Q,_,ee,te,ie,le,re,ae,he=true,se,fe,$e,de,ne,ce,oe=[],ge,ye,ve,we=0,ue=false,me=0,xe=0,pe,ze,be,Ce,ke,Le,Ie,Ee,Re,Oe,De,Ae,Se,We=0,Pe=1e3,Te,Be,Ne,Fe,qe,He,Ue,Ge,Ye,Ve,Xe,Je,Ke,Me,Ze=[],je=t=>e.getElementById(t),Qe=(e,t,i)=>{e.style.left=`${t}px`;e.style.top=`${i}px`},_e=(e,t)=>t?e.classList.remove("h"):e.classList.add("h"),et=(e,t)=>t?e.classList.remove("d"):e.classList.add("d"),tt=t=>e.createElement(t),it=(t,i)=>{let l=e.createElement("canvas");l.width=t;l.height=i;l.ctx=l.getContext("2d");return l},lt=t=>e.body.style.opacity=`${t}`,rt=(e,t,i)=>e<t?t:e>i?i:e,at=(e,t)=>{e=f(e);return a(h()*(a(t)-e+1)+e)},ht=()=>{if(Ge){Ue.b=Pe;i.setItem(l,JSON.stringify(Ue))}},st=()=>{Ue={a:true,b:0,c:{l:{k:90,c:"Z"},r:{k:88,c:"X"}}};Ge=true;ht()},ft=t=>{if(t){if(!he)e.body.style.cursor="auto"}else{if(he)e.body.style.cursor="none"}he=t},$t=()=>{let e=s(t.innerWidth/o,t.innerHeight/g);ce.style.transform=`scale(${e})`;ce.style.left=`${a((t.innerWidth-de.getBoundingClientRect().width)/2)}px`;ce.style.top=`${a((t.innerHeight-de.getBoundingClientRect().height)/2)}px`},dt=.5,nt=44100,ct=null,ot=[],gt=e=>ot.push(mt(...e)),yt=e=>{if(Ue.a)ut(ot[e])},vt=()=>ct=new(t.AudioContext||t.webkitAudioContext),wt=()=>{ct.close();vt()},ut=e=>{if(!ct)vt();const t=ct.createBuffer(1,e.length,nt),i=ct.createBufferSource();t.getChannelData(0).set(e);i.buffer=t;i.connect(ct.destination);i.start(0)},mt=(e,t,i,l,a,h,f,o,g,y,v,w,u,m,x,p,z,b,C)=>{let k=nt,L=e=>e>0?1:-1,I=o*=500*$/k/k,E=t*=$/k,R=[],O=0,D=0,A=0,S=1,W=0,P=0,T=0,B,N;i=i*k+9;b*=k;l*=k;a*=k;p*=k;g*=500*$/k**3;m*=$/k;y*=$/k;v*=k;w=w*k|0;for(N=i+b+l+a+p|0;A<N;R[A++]=T){if(!(++P%(x*100|0))){T=h?h>1?h>2?h>3?n((O%$)**3):r.max(s(r.tan(O),1),-1):1-(2*O/$%2+2)%2:1-4*c(r.round(O/$)-O/$):n(O);T=(w?1-C+C*n($*A/w):1)*L(T)*c(T)**f*e*dt*(A<i?A/i:A<i+b?1-(A-i)/b*(1-z):A<i+b+l?z:A<N-p?(N-A-p)/a*z:0);T=p?T/2+(p>A?0:(A<N-p?1:(N-A)/p)*R[A-p|0]/2):T}B=(t+=o+=g)*d(m*D++);O+=B-B*u*(1-(n(A)+1)*1e9%2);if(S&&++S>v){t+=y;E+=y;S=0}if(w&&!(++W%w)){t=E;o=I;S=S||1}}return R};const xt='<svg width="',pt='" height="',zt='" version="1.1" xmlns="http://www.w3.org/2000/svg">',bt='<path d="',Ct='"/>',kt='" fill="#',Lt='" fill="none',It='" stroke="#',Et='" stroke-width="',Rt='" stroke-linecap="round',Ot='" stroke-linejoin="round',Dt='" opacity="',At='<g transform="translate',St='<g fill="#',Wt="</g>",Pt='" style="paint-order:normal',Tt='<circle cx="',Bt='<ellipse cx="',Nt='" cy="',Ft='" rx="',qt='" ry="',Ht=Ct,Ut='" r="',Gt="</svg>",Yt=tt("div");let Vt,Xt=e=>Yt.innerHTML+=`<img id="${e}" src="data:image/svg+xml;base64,${btoa(Vt)}">`,Jt=["m126 65a62 62 0 0 1-63 62 62 62 0 0 1-62-62 62 62 0 0 1 62-62 62 62 0 0 1 63 62l-62 0.55z","m126 75a62 62 0 0 1-67 51 62 62 0 0 1-57-62 62 62 0 0 1 57-62 62 62 0 0 1 67 51l-62 11z","m123 85a62 62 0 0 1-70 40 62 62 0 0 1-52-62 62 62 0 0 1 52-62 62 62 0 0 1 70 40l-59 21z","m118 95a62 62 0 0 1-70 29 62 62 0 0 1-46-60 62 62 0 0 1 46-60 62 62 0 0 1 70 29l-54 31z","m112 104a62 62 0 0 1-69 19 62 62 0 0 1-41-59 62 62 0 0 1 41-59 62 62 0 0 1 69 19l-48 40z"],Kt=[{i:"0",w:74,h:74,y:0,d:"m37 1c-20 0-36 16-36 36s16 36 36 36c20 0 36-16 36-36s-16-36-36-36z"},{i:"1",w:46,h:69,y:0,d:"m45 1h-32l-11 32h8.6v35h35z"},{i:"2",w:70,h:69,y:0,d:"m52 1h-50v34h11v0.67c-8.4 1.9-13 8.6-13 17v16h66v-34h-13v-0.67c9.4-1.8 15-7.4 15-16 0-8.6-7.5-17-17-17z"},{i:"3",w:62,h:69,y:0,d:"m1 1v23h14v2.9h-14v16h14v2.9h-14v23h34c24 0 34-25 19-36 11-12 0.58-31-18-31h-35z"},{i:"4",w:69,h:69,y:0,d:"m1 19c0 18 14 33 32 34v16h35v-67h-67z"},{i:"5",w:68,h:69,y:0,d:"m51 68c9.2 0 17-8.2 17-17s-5.9-14-15-16v-0.58h13v-34h-64v34h12v2.9h-12v31h50z"},{i:"6",w:73,h:72,y:0,d:"m38 22c5.6-7.8 9.5-13 15-21h-36l-11 15c-3.8 5.4-5.8 13-5.8 19 0 20 13 36 36 36 22-0.096 35-14 35-33 0-12-6.2-23-22-28l-9.2 13z"},{i:"7",w:70,h:69,y:0,d:"m1.4 68h44c7.9-22 16-45 24-67h-67v32h12z"},{i:"8",w:67,h:74,y:0,d:"m38 73c26 0 37-26 20-39 12-13-1.2-33-21-33h-8.4c-20 0-32 20-20 33-17 12-5.4 39 20 39z"},{i:"9",w:73,h:72,y:0,d:"m35 50c-5.6 7.8-9.5 13-15 21h36l11-15c3.8-5.4 5.8-13 5.8-19 0-20-13-36-36-36-22 0.096-35 14-35 33 0 12 6.2 23 22 28l9.2-13z"},{},{},{},{i:"=",w:58,h:75,y:0,d:"m49 42h-40v-15h40z"},{},{},{i:"@",w:88,h:75,y:0,d:"m56 9.7q4.3 4.3 6.7 10 2.4 5.9 2.4 13 0 5.3-1.5 11-1.5 5.5-3.8 9.1h-19l-0.61-3q-2.2 1.4-4.2 2.3-2 0.84-5.8 0.84-6.2 0-10-5.1-3.8-5.1-3.8-14 0-4.6 1.3-8.1 1.3-3.5 3.5-6.1 2.1-2.4 5.1-3.8 3-1.4 5.9-1.4 2.5 0 4.5 0.95 1.9 0.91 3 1.9v-2.4h8.8v31h6.5q1.4-3 2-6.5 0.69-3.5 0.69-6.8 0-6.4-1.8-11-1.8-4.9-5-8.1-3.2-3.3-7.6-4.9-4.3-1.6-9.4-1.6-4.8 0-9.2 1.9-4.3 1.9-7.7 5.1-3.4 3.3-5.5 8.3-2.1 5-2.1 11 0 6.5 2 11 2 5 5.3 8.3 3.3 3.3 7.7 5 4.4 1.7 9.3 1.7 3.2 0 7.4-0.61 4.2-0.57 7.4-1.5v7.4q-3.5 0.8-7 1.2-3.5 0.42-7.7 0.42-7 0-13-2.4-5.9-2.4-10-6.8-4.3-4.4-6.7-11-2.4-6.2-2.4-14 0-7.1 2.5-13 2.5-6.1 6.9-11 4.3-4.4 10-7 6-2.6 13-2.6 6.7 0 12 2.4 5.8 2.4 10 6.6zm-17 33v-19q-1.6-0.8-2.9-1.1-1.3-0.38-3-0.38-3.7 0-5.6 3.2-2 3.2-2 8.8 0 6 1.6 8.9 1.6 2.9 5.4 2.9 2 0 3.5-0.76 1.5-0.8 3-2.3z"},{i:"A",w:88,h:75,y:0,d:"m1.8 74h85l-42-72z"},{i:"B",w:62,h:69,y:0,d:"m1 1v67h34c24 0 34-25 19-36 11-12 0.58-31-18-31h-35z"},{i:"C",w:63,h:73,y:0,d:"m11 11c-14 14-14 36 0 50 14 14 36 14 50 0l-25-25 25-25c-14-14-36-14-50 0z"},{i:"D",w:69,h:69,y:0,d:"m35 68c19 0 34-15 34-34 0-19-15-34-34-34h-34v67z"},{i:"E",w:58,h:69,y:0,d:"m1 1v67h56v-23h-14v-2.9h14v-16h-14v-2.9h14v-23z"},{i:"F",w:58,h:69,y:0,d:"m1 1v67h41v-20h15v-22h-14v-2.9h14v-23z"},{i:"G",w:73,h:73,y:0,d:"m37 37 18-31c-7.1-4-15-5.6-23-4.3-17 2.8-30 17-30 35 0 20 16 36 36 36 20 0 36-16 36-36z"},{i:"H",w:69,h:69,y:0,d:"m1 1v67h32v-25h2.9v25h32v-67h-32v25h-2.9v-25z"},{i:"I",w:37,h:69,y:0,d:"m1 1v67h35v-67z"},{i:"J",w:69,h:71,y:0,d:"m68 40v-39h-32v37h-2.9v-12h-32v14c0 40 67 40 67 0z"},{i:"K",w:69,h:69,y:0,d:"m1 1v67h66l-25-34 25-34z"},{i:"L",w:54,h:69,y:0,d:"m35 35v-34h-34v67h52v-34z"},{i:"M",w:69,h:73,y:0,d:"m1.2 72h67l-0.19-70-34 25-34-25z"},{i:"N",w:69,h:72,y:0,d:"m1 2.1v69h67v-67h-33v25z"},{i:"O",w:74,h:74,y:0,d:"m37 1c-20 0-36 16-36 36s16 36 36 36 36-16 36-36-16-36-36-36z"},{i:"P",w:62,h:69,y:0,d:"m33 1h-32v67h32v-13c15 0 27-12 27-27 0-15-12-27-27-27z"},{i:"Q",w:73,h:73,y:0,d:"m36 1c-20 0-35 16-35 35 0 19 16 35 35 35h35v-0.58l-20-19 2-2 9.6 9.4c5.1-6.1 8.3-14 8.3-23 0-20-16-35-35-35z"},{i:"R",w:62,h:69,y:0,d:"m33 1h-32v67h59l-9.9-19c6.4-5 10-13 10-21 0-15-12-27-27-27z"},{i:"S",w:70,h:69,y:0,d:"m18 1c-9.2 0-17 8.1-17 17 0 8.7 5.9 15 15 16v0.67h-14v34h50c19 0 23-29 3.6-33v-0.67h12v-34z"},{i:"T",w:63,h:69,y:0,d:"m49 35h13v-34h-61v34h14v34h34z"},{i:"U",w:69,h:71,y:0,d:"m1 36c0 19 15 34 34 34s34-15 34-34v-35h-67z"},{i:"V",w:88,h:75,y:0,d:"m87 1h-85l43 72z"},{i:"W",w:124,h:75,y:0,d:"m1.8 1 42 72 16-27-6.8-12 2.1-2c8 14 16 27 24 40l42-72h-120z"},{i:"X",w:75,h:69,y:0,d:"m1.7 1 19 34-19 34h71l-19-34 19-34h-71z"},{i:"Y",w:75,h:69,y:0,d:"m54 35 19-34h-71l19 34v34h34z"},{i:"Z",w:70,h:69,y:0,d:"m1.4 68h67v-32h-12l12-35h-67v32h12z"}],Mt=["f9c","f00","3ff","fc3"],Zt=[{w:32,f:"eee",s:"999"},{w:32,f:"ff0",s:"fd0"},{w:80,f:"eee",s:"999"},{w:80,f:"ff0",s:"fd0"}];starData=[{w:12,f:"555",s:"111"},{w:18,f:"999",s:"555"},{w:24,f:"eee",s:"999"}];for(let e=0;e<Kt.length;e++){const t=Kt[e];if(t.w){Vt=`${xt}${t.w}${pt}${t.h}${zt}${bt}${t.d}${kt}ff0${It}aa0${Et}2${Ct}${Gt}`;Xt(`${t.i}`)}}for(let e=0;e<Zt.length;e++){let t=Zt[e];Vt=`${xt}${t.w}${pt}${t.w}${zt}${Tt}${t.w/2}${Nt}${t.w/2}${Ut}${t.w/2-1}${kt}${t.f}${It}${t.s}${Et}2${Ct}${Gt}`;Xt(`dot${t.w}${(e+1)%2}`)}for(let e=0;e<starData.length;e++){let t=starData[e];Vt=`${xt}${t.w}${pt}${t.w}${zt}${Tt}${t.w/2}${Nt}${t.w/2}${Ut}${t.w/2-1}${kt}${t.f}${It}${t.s}${Et}2${Ct}${Gt}`;Xt(`star${e}`)}Vt=`${xt}56${pt}54${zt}${bt}m43 52-15-8.3-16 8 3.1-17-12-12 17-2.4 7.9-16 7.6 16 17 2.6-13 12z${kt}ddd${It}888${Et}2.7${Pt}${Ct}${Gt}`;Xt("star");for(let e=0;e<Jt.length;e++){Vt=`${xt}128${pt}128${zt}${bt}${Jt[e]}${kt}ff0${It}aa0${Et}3${Ct}${Gt}`;Xt(`player${e}`)}for(let e=0;e<Mt.length;e++){Vt=`${xt}128${pt}128${zt}viewBox="0 0 128 130"<g>${bt}m0.54 64c0-62 63-62 63-62s64 0 64 62v62l-16-17-16 17-16-17-16 17-16-17-16 17-16-17-15 17z${kt}${Mt[e]}${It}000${Et}3${Ct}${Bt}26${Nt}54${Ft}15${qt}27${kt}fff${Ht}${Bt}22${Nt}52${Ft}8.1${qt}15${kt}00f${Ht}${Bt}62${Nt}54${Ft}15${qt}27${kt}fff${Ht}${Bt}59${Nt}52${Ft}8.1${qt}15${kt}00f${Ht}${Wt}${Gt}`;Xt(`ghost${e}`)}Vt=`${xt}128${pt}128${zt}<g>${bt}m0.55 64c0-62 63-62 63-62s64 0 64 62v62l-16-17-16 17-16-17-16 17-16-17-16 17-16-17-15 17z${kt}00f${It}000${Et}3.1${Ct}${Bt}22${Nt}52${Ft}8.1${qt}15${kt}fff"/><ellipse cx="59" cy="52" rx="8.1" ry="15${kt}fff"/>${Wt}<path d="m10 93c5.1-5.1 5.1-5.1 10 0 5.1 5.1 5.1 5.1 10 0 5.1-5.1 5.1-5.1 10 0 5.1 5.1 5.1 5.1 10 0 5.1-5.1 5.1-5.1 10 0 5.1 5.1 5.1 5.1 10 0 5.1-5.1 5.1-5.1 10 0${kt}fff${It}fff" stroke-linecap="round${Et}3${Ct}${Gt}`;Xt("ghost4");Vt=`${xt}128${pt}128${zt}${Bt}26${Nt}54${Ft}15${qt}27${kt}fff${Ht}${Bt}22${Nt}48${Ft}8.1${qt}15${kt}00f${Ht}${Bt}62${Nt}54${Ft}15${qt}27${kt}fff${Ht}${Bt}59${Nt}48${Ft}8.1${qt}15${kt}00f${Ht}${Gt}`;Xt("eyes");Vt=`${xt}96${pt}94${zt}${At}(0 -2)${Et}2">${Bt}70${Nt}59${Ft}25${qt}24${kt}f00${It}a00${Ht}${Bt}26${Nt}71${Ft}25${qt}24${kt}f00${It}a00${Ht}${bt}m30 54c0.15-0.36 9.9-23 26-38 15-14 17-13 17-13l3.4 3.2c-17 9.9-17 24-8 42l-4.9 2.5s-5.7-11-6.4-19c-0.65-7.7 0.65-10 0.65-10-5 4.8-14 14-23 35z${kt}0f0${It}0a0${Rt}${Ot}${Et}3${Ct}${Wt}${Bt}36${Nt}67${Ft}6.9${qt}8${kt}f88${Ht}${Bt}80${Nt}52${Ft}6.9${qt}8${kt}f88${Ht}${bt}m28 50c4.2 6.7 9.6 4.6 11 4.1${kt}none${It}a00$${Rt}${Ot}${Et}3${Ct}${bt}m61 49c0.04-0.13 6.3 1.1 9-5.6${kt}none${It}a00$${Rt}${Ot}${Et}3${Ct}${Gt}`;Xt("cherry");Vt=`${xt}128${pt}128${zt}${At}(0 -169)${Lt}${It}ff0">${bt}m128 233a64 64 0 0 1-45-19 64 64 0 0 1-19-45${Et}32${Pt}${Ct}${bt}m3e-7 233a64 64 0 0 1 64 64${Et}32${Pt}${Ct}${Wt}${Gt}`;Xt("truchet");Vt=`${xt}1300${pt}375${zt}${At}(1.3 -1.3)${kt}ff0${It}aa0${Et}4.6">${bt}m111 264 54-94c-22-12-47-17-72-13-52 8.5-92 54-92 108 0 60 49 109 109 109s109-49 109-109z${Ct}${bt}m233 161v206h99v-76h8.8v76h99v-206h-99v76h-8.8v-76z${Ct}${bt}m561 154c-61 0-110 49-110 110s49 110 110 110 110-49 110-110-49-110-110-110z${Ct}${bt}m728 161c-28 0-51 25-51 51 0 27 18 45 47 50v2.1h-41v103h153c59 0 70-87 11-101v-2.1h36v-104z${Ct}${bt}m1038 264h40v-103h-186v103h43v103h103z${Ct}${bt}m1137 161c-28 0-51 25-51 51 0 27 18 45 47 50v2.1h-41v103h153c59 0 70-87 11-101v-2.1h36v-104z${Ct}${bt}m66 140c36 0 65-29 65-65s-29-65-65-65h-65v130z${Ct}${bt}m206 4.7c-38 0-69 31-69 69s31 69 69 69 69-31 69-69-31-69-69-69z${Ct}${bt}m284 6v133h130v-130h-65v48z${Ct}${bt}m515 75h25v-65h-117v65h27v65h65z${Ct}${bt}m690 140c36 0 65-29 65-65s-29-65-65-65h-65v130z${Ct}${bt}m764 9.2v130h68v-130z${Ct}${bt}m843 9v130h108v-44h-27v-5.6h27v-31h-27v-5.6h27v-44z${Ct}${bt}m1126 75h25v-65h-117v65h27v65h65z${Ct}${bt}m1227 4.7c-38 0-69 31-69 69s31 69 69 69 69-31 69-69-31-69-69-69z${Ct}${Wt}${Gt}`;Xt("logo");Vt=`${xt}64${pt}64${zt}${St}ff0${It}880${Et}2">${bt}m1 43v20h20l-6-6 7-7-8-8-7 7z${Ct}${bt}m62 43v20h-20l6-6-7-7 8-8 7 7z${Ct}${bt}m1 22v-20h20l-6 6 7 7-8 8-7-7z${Ct}${bt}m62 22v-20h-20l6 6-7 7 8 8 7-7z${Ct}${Wt}${Gt}`;Xt("fullscreen");Vt=`${xt}64${pt}64${zt}${St}ff0${It}880${Et}2">${bt}m41 3v20h20l-6-6 7-7-8-8-7 7z${Ct}${bt}m22 3v20h-20l6-6-7-7 8-8 7 7z${Ct}${bt}m41 62v-20h20l-6 6 7 7-8 8-7-7z${Ct}${bt}m22 62v-20h-20l6 6-7 7 8 8 7-7z${Ct}${Wt}${Gt}`;Xt("windowed");let jt=()=>{let t=1,i=100,l=0,r=i,h=[],s=0,f=Yt.getElementsByTagName("*");for(let e=0;e<f.length;e++){const a=f[e];let $=a.id,d=a.width,n=a.height,c=d+2,g=n+2;if(t+c>o){if(t>l)l=t;r+=s;t=1;i+=s;s=g}if(g>s)s=g;h.push({image:a,x:t,y:i});oe[$]={id:$,x:t,y:i,width:d,height:n};t+=c}ge=e.createElement("canvas");ge.width=l;ge.height=r+s;ye=ge.getContext("2d");for(let e=0;e<h.length;e++){const t=h[e];ye.drawImage(t.image,t.x,t.y)}t=0;i=0;let $,d,n,c,g,y=200;for(let e=0;e<5;e++){g=`${y}`;n=ei(g);c=it(n.w,n.h);$=n.w/2;d=n.h/2;oe[`b${g}`]={t:g,x:t,y:i,width:$,height:d};ti(1,1,g,c.ctx);let e=c.ctx.getImageData(0,0,n.w,n.h),l=e.data,r,h,s,f;for(var v=0,w=l.length;v<w;v+=4){r=l[v];h=l[v+1];s=l[v+2];f=a((r+h+s)*1.25/3);l[v]=l[v+1]=l[v+2]=f}c.ctx.putImageData(e,0,0);ye.drawImage(c,0,0,n.w,n.h,t,0,$,d);t+=n.w;y*=2}g="GSSOC";n=ei(g);c=it(n.w,n.h);$=a(n.w/2.5);d=a(n.h/2.5);ti(0,0,g,c.ctx);g="tag";t=0;i=50;oe[g]={t:g,x:t,y:i,width:$,height:d};ye.drawImage(c,0,0,n.w,n.h,0,50,$,d)},Qt=e=>oe[e],_t=e=>{let t=0;for(let i=0;i<e.length;i++){let l=e.charCodeAt(i)-48;if(l<0||l>=Kt.length){t+=V}else{t+=Kt[l].w+Y}}return t},ei=e=>{let t=0,i=0,l,r;for(let a=0;a<e.length;a++){l=e.charCodeAt(a)-48;if(l<0||l>=Kt.length){t+=V}else{r=Kt[l];t+=r.w+Y;if(r.h>i)i=r.h}}return{w:t,h:i}},ti=(e,t,i,l)=>{let r,a,h;for(let s=0;s<i.length;s++){a=i.charCodeAt(s)-48;if(a<0||a>=Kt.length){e+=V}else{h=Kt[a];r=Qt(h.i);l.drawImage(ge,r.x,r.y,r.width,r.height,e,t,r.width,r.height);e+=r.width+Y}}},ii=e=>(o-_t(e))/2,li=e=>(o-e)/2,ri=e=>{re=e;le=1;fi(w)},ai=e=>{re=e;le=0;fi(v)},hi=()=>{if(Q.onClose)Q.onClose(Q);_e(Q.div,false);Q=null;si(_)},si=e=>{if(Q){_=e;et(Q.div,false);if(Q.beforeClose)Q.beforeClose(Q);ri(hi)}else{if(!e.created){let t,i,l,r,a=tt("div");a.classList.add("m","a","h","d");ce.appendChild(a);e.div=a;for(let h=0;h<e.widgets.length;h++){const s=e.widgets[h];s.p=e;if(s.t==="img"){s.images=[];for(let e=0;e<s.regions.length;e++){t=Qt(s.regions[e]);i=it(t.width,t.height);i.ctx.drawImage(ge,t.x,t.y,t.width,t.height,0,0,t.width,t.height);s.images.push(i.toDataURL())}l=tt(s.t);l.classList.add("a");l.src=s.images[0];Qe(l,s.c?li(t.width):s.x,s.y);a.appendChild(l);s.i=l;if(s.onClick){l.onclick=()=>{s.onClick(e)};l.id="b"}}else{r=ei(s.l);i=it(r.w,r.h);ti(0,0,s.l,i.ctx);l=tt("img");l.id=s.id;l.classList.add("a");l.src=i.toDataURL();a.appendChild(l);Qe(l,s.c?li(r.w):s.x,s.y);if(s.onClick){l.onclick=()=>{s.onClick(e)};l.id="b"}s.i=l}}e.created=true}if(e.beforeOpen)e.beforeOpen(e);_e(e.div,true);et(e.div,false);ai((()=>{Q=e;if(e.onOpen)e.onOpen(e);et(e.div,true)}))}};toggleWidgetVisibilityByIndex=(e,t)=>{for(let i=0;i<t.length;i++){let l=t[i];l<0?_e(e[-l].i,true):_e(e[l].i,false)}},setWidgetLabel=(e,t)=>{if(e.i){e.l=t;let i=e.i,l=ei(e.l),r=it(l.w,l.h);ti(0,0,e.l,r.ctx);i.src=r.toDataURL();Qe(i,e.c?li(l.w):e.x,e.y)}};e.onvisibilitychange=()=>{if(document.visibilityState==="hidden"){J=true}else{Z=Date.now();J=false}};t.onpointerdown=e=>{if(Je){if(e.clientX<t.innerWidth/2){Ke=true;Me=false}else{Me=true;Ke=false}}};t.onpointerup=e=>{if(Je){if(e.clientX<t.innerWidth/2){Ke=false}else{Me=false}}};t.onkeydown=e=>{if(Je){ft(false);let t=e.keyCode;if(t===37||t===Ue.c.l.k){Ke=true}else if(t===39||t===Ue.c.r.k){Me=true}}};t.onkeyup=e=>{let t;if(Ye){t=e.key.toUpperCase();Ve.k=e.keyCode;Ve.c=t;setWidgetLabel(Xe,t);Ye=false;for(let e=0;e<yi.widgets.length;e++){_e(yi.widgets[e].i,true)}_e(yi.widgets[10].i,false);Ge=true}else if(Je){t=e.keyCode;if(t===37||t===Ue.c.l.k){Ke=false}else if(t===39||t===Ue.c.r.k){Me=false}}};t.onresize=$t;t.onmousemove=()=>ft(true);t.onbeforeunload=ht;t.onload=()=>{ce=je("g");gt([2.07,706,.01,.01,.02,2,.87,0,0,0,0,0,0,24,0,.06,.9,.01,0]);gt([.35,1,.01,.01,.01,2,.49,0,0,0,0,.07,0,-6.6,.4,.25,1,0,0]);gt([1,568,.05,.3,.32,0,1.32,0,0,47,.08,.11,.2,0,0,0,.65,.21,0]);gt([.3,91,.02,.04,.07,2,.63,18,0,0,0,0,.9,0,0,0,.87,.01,0]);gt([1.1,684,.07,.19,.38,1,1.44,0,-3.4,-22,.03,.1,0,0,0,0,.63,.2,.08]);gt([1.03,171,.02,.24,.44,2,1.65,1.2,.9,131,.02,.02,0,0,.1,0,.72,.15,.18]);gt([1,182,.1,.27,.44,2,.16,0,0,457,.08,.04,0,7.8,0,0,.68,.2,0]);gt([1,374,.07,.28,.47,2,1.92,0,7.9,100,.02,.11,0,9.5,0,0,.98,.29,0]);gt([1,.05,262,0,.2,.35,2,1.39,9.4,0,18,.15,.11,0,0,0,0,.53,.22,0]);gt([1.19,79,.07,.15,.49,2,1.41,0,0,244,.02,.04,0,30,0,.08,.94,.27,0]);jt();Ue=i.getItem(l);!Ue?st():Ue=JSON.parse(Ue);Pe=Ue.b;for(let e=0;e<96;e++){Ze.push([h()*o,h()*870])}e.body.removeChild(je("l"));oi();de=it(o,g);de.id="c";ce.appendChild(de);ne=de.ctx;$t();si(gi);Z=Date.now();ui()};let fi=e=>X=e,$i=()=>ne.clearRect(0,0,o,g),di=e=>{We+=e;if(!Te){if(We>Pe){Te=true;yt(W);let e=0,t=600;for(let i=0;i<30;i++){He.push({x:o/2,y:G,vx:d(e)*t,vy:n(e)*t,r:28,i:"star"});e+=$/30}}}},ni=(e=false)=>{if(e){We=0;Ne=0;Oe=10;De=5;Ae=200;K=false;Te=false}Ne++;me=0;xe=0;ue=false;Ee=false;Ce=20;be=false;ze=false;Ke=false;Me=false;Se={x:o/2,y:P,r:64,f:[0,1,2,3,4,3,2,1],c:0,facingLeft:false,draw:true};Ie=[];let t=1;for(let e=0;e<4;e++){Ie.push({id:e,x:at(24,o-48),y:-at(128,g),vx:h()<.5?-Ae:Ae,vy:0,r:64,gravity:5,multiplier:t,facingLeft:false,turning:false,turningLeft:false,turnTimer:h()*Oe+De,munched:false,canCollide:true,scared:false,draw:true,frames:[e,4,e,4,e,4]});t+=.25}Oe=rt(Oe-1.97,5,10);De=rt(De-.09,3,5);Ae=rt(Ae-17,100,200);ve=[];pe=[];bonusImages=[];He=[];si(vi)};let ci=()=>{fe.clearRect(0,0,o,890);fe.save();fe.globalAlpha=.075;fe.beginPath();fe.rect(0,0,o,890);fe.clip();let e=Qt("truchet");for(let t=0;t<896/128;t++){for(let i=0;i<o/128;i++){fe.save();if(h()<.5){fe.drawImage(ge,e.x,e.y,e.width,e.height,i*128,t*128,e.width,e.height)}else{fe.translate(i*128,0);fe.scale(-1,1);fe.drawImage(ge,e.x,e.y,e.width,e.height,0,t*128,-e.width,e.height)}fe.restore()}}fe.restore()},oi=()=>{se=it(o,g);se.id="c";fe=se.ctx;ce.appendChild(se);$e=fe.createLinearGradient(0,890,0,900);$e.addColorStop(0,"#001");$e.addColorStop(.3,"#00f");$e.addColorStop(1,"#001");fe.fillStyle="#001";fe.fillRect(0,0,o,890);fe.fillStyle="#000014";fe.fillRect(0,890,o,g-890);fe.fillStyle=$e;fe.fillRect(0,890,o,10)};let gi={onOpen:()=>{fi(u)},beforeOpen:e=>{setWidgetLabel(e.widgets[1],`BEST ${Pe}`);te=true;ft(true);e.widgets[4].i.style.opacity=".4";se.ctx.clearRect(0,0,o,890)},widgets:[{t:"img",y:32,c:true,regions:["logo"]},{t:"a",y:475,c:true,l:""},{t:"a",y:615,c:true,l:"OPTIONS",onClick:()=>{yt(k);si(yi)}},{t:"a",y:750,c:true,l:"PLAY",onClick:()=>{yt(k);ft(false);ni(true)}},{t:"img",y:1024,c:true,regions:["tag"]},{t:"img",x:o-80,y:16,regions:["fullscreen","windowed"],onClick:t=>{yt(k);let i=t.widgets[5];if(ee){if(document.exitFullscreen){document.exitFullscreen()}else if(document.webkitExitFullscreen){document.webkitExitFullscreen()}i.i.src=i.images[0]}else{let t=e.documentElement;if(t.requestFullscreen){t.requestFullscreen()}else if(t.webkitRequestFullscreen){t.webkitRequestFullscreen()}i.i.src=i.images[1]}ee=!ee}}]},yi={onOpen:()=>{fi(m)},beforeOpen:e=>{setWidgetLabel(e.widgets[2],Ue.c.l.c);setWidgetLabel(e.widgets[5],Ue.c.r.c);for(let t=4;t<9;t++){_e(e.widgets[t].i,true)}_e(e.widgets[10].i,false);let t;Ue.a?t="ENABLED":t="DISABLED";setWidgetLabel(e.widgets[8],t)},widgets:[{t:"a",y:64,c:true,l:"OPTIONS"},{t:"a",x:o/2-(128+_t("LEFT")),y:250,l:"LEFT"},{t:"a",x:850,y:250,l:"",c:true,id:"lk"},{t:"a",x:1100,y:250,l:"CHANGE",onClick:e=>{yt(k);Ye=true;Ve=Ue.c.l;Xe=e.widgets[2];for(let t=4;t<9;t++){_e(e.widgets[t].i,false)}_e(e.widgets[10].i,true)}},{t:"a",x:o/2-(128+_t("RIGHT")),y:400,l:"RIGHT"},{t:"a",x:850,y:400,l:"",c:true,id:"rk"},{t:"a",x:1100,y:400,l:"CHANGE",onClick:e=>{yt(k);Ye=true;Ve=Ue.c.r;Xe=e.widgets[5];toggleWidgetVisibilityByIndex(e.widgets,[1,2,3,7,8,-10])}},{t:"a",x:530,y:550,l:"SOUND"},{t:"a",x:1040,y:550,l:"W",id:"ts",onClick:()=>{Ue.a=!Ue.a;let e;Ue.a?e="ENABLED":e="DISABLED";setWidgetLabel(yi.widgets[8],e);Ge=true;yt(k)}},{t:"a",y:750,c:true,l:"BACK",onClick:()=>{yt(k);ht();si(gi)}},{t:"a",y:550,c:true,l:"PRESS NEW KEY A=Z 0=9",h:true}]},vi={onOpen:()=>{fi(p)},beforeOpen:e=>{wt();$i();fe.clearRect(0,0,o,890);yt(O);ie=2;te=false;setWidgetLabel(e.widgets[0],`LEVEL ${Ne}`)},widgets:[{t:"a",y:750,c:true,l:"",id:"ll"}]},wi={onOpen:()=>{qe=false;Je=true;fi(C)},beforeOpen:e=>{_e(e.widgets[0].i,false);ci()},beforeClose:()=>{Je=false;ae=true;te=false},widgets:[{t:"a",y:g/2,c:true,l:"YOU DIED TO GHOSTS",h:true}]};let ui=()=>{if(!J){scoreUpdateRequired=false;M=Date.now();j=(M-Z)/1e3;Z=M;let e=()=>{for(let e=He.length-1;e>=0;e--){const t=He[e];if(t.gy){t.vy+=t.gy}t.x+=t.vx*j;t.y+=t.vy*j;if(t.y>=g+80||t.y<-80||t.x<-80||t.x>o+80){He.splice(e,1)}else{textureRegion=Qt(t.i);ne.drawImage(ge,textureRegion.x,textureRegion.y,textureRegion.width,textureRegion.height,t.x-t.r,t.y-t.r,textureRegion.width,textureRegion.height)}}};switch(X){case p:ie-=j;if(ie<=0){fi(y);si(wi)}break;case b:$i();e();postPlayCounter-=j;if(postPlayCounter<=0){fi(y);si(gi)}break;case C:let t,i,l,s;playerY=Se.y-Se.r,collidedWithPlayer=e=>{if(e.canCollide&&e.y+e.r>playerY){return r.hypot(Se.x-e.x,Se.y-e.y)<=Se.r+e.r}return false},drawActor=e=>{if(e.draw&&!K){ne.save();if(e.facingLeft){ne.translate(e.x-e.r,0);ne.scale(-1,1);ne.drawImage(ge,i.x,i.y,i.width,i.height,0,e.y-e.r,-i.width,i.height)}else{ne.drawImage(ge,i.x,i.y,i.width,i.height,e.x-e.r,e.y-e.r,i.width,i.height)}ne.restore()}};$i();if(!ue){we-=j;if(we<=0){we+=B;if(me<244){ve.push({x:at(24,o-48),y:-at(32,g),vy:N,r:16,bounced:false,gravity:F,canCollide:true,draw:true,f:[0],c:0});me++;xe++}else if(me===244){for(let e=0;e<q;e++){t={x:at(24,o-48),y:-at(32,g),vy:N,r:40,isPill:true,bounced:false,gravity:F,canCollide:true,draw:true,f:[0,0,0,0,0,0,0,1],c:h()};ve.push(t);pe.push(t)}me++;xe+=q;ue=true}}}for(let e=ve.length-1;e>=0;e--){let t=ve[e];t.vy=rt(t.vy+t.gravity,-500,500);t.y+=t.vy*j;if(t.bounced){if(t.y>=g+96){t.x=at(24,o-48);t.y=-96;t.gravity=F;t.bounced=false}}else{if(t.y>=950){t.y-=t.vy*j;t.vy=-t.vy;t.gravity=14+h();t.bounced=true}}if(collidedWithPlayer(t)){ve.splice(e,1);t.draw=false;if(t.isPill){di(50);yt(D);for(let e=0;e<pe.length;e++){pe[e].canCollide=false}Re=U;Ee=true;for(let e=0;e<Ie.length;e++){Ie[e].scared=true}Be=200}else{di(10);yt(L);l=h()*$;for(let e=0;e<3;e++){He.push({x:Se.x,y:Se.y,vx:d(l)*1500,vy:n(l)*1500,r:6,i:`star${at(1,2)}`});l+=$/3}}xe-=1;if(xe<=0){qe=true;Se.draw=false;Je=false;ae=false;yt(S);ni()}}if(t.draw&&!K){i=Qt(`dot${t.r*2}${t.f[a(t.f.length*t.c)]}`);ne.drawImage(ge,i.x,i.y,i.width,i.height,t.x-t.r,t.y-t.r,i.width,i.height);t.c+=j;if(t.c>=1)t.c-=1}}if(Ee){Re-=j;if(Re<=0){Ee=false;for(let e=0;e<pe.length;e++){pe[e].canCollide=true}for(let e=0;e<Ie.length;e++){Ie[e].scared=false}}}for(let e=Ie.length-1;e>=0;e--){let t=Ie[e];if(t.munched){t.turning=false;t.facingLeft=false;t.vx=0;t.gravity=-20}else{if(t.turning){if(t.turningLeft){t.vx-=1*t.multiplier;if(t.vx<=-Ae){t.vx=-Ae;t.turning=false}}else{t.vx+=1*t.multiplier;if(t.vx>=Ae){t.vx=Ae;t.turning=false}}}else{t.turnTimer-=j;if(t.turnTimer<=0){t.turningLeft=t.vx>0;t.turnTimer=h()*Oe+De;t.turning=true}}t.x+=t.vx*t.multiplier*j;if(t.x<=-t.r){t.x+=o+t.r*2}else if(t.x>o+t.r){t.x-=o+t.r*2}}t.vy=rt(t.vy+t.gravity*t.multiplier,-650,650);t.y+=t.vy*t.multiplier*j;if(t.y>=950){t.y-=t.vy*j;t.vy=-t.vy;yt(E)}if(t.scared){if(collidedWithPlayer(t)){yt(I);t.munched=true;t.canCollide=false;di(Be);He.push({x:t.x,y:t.y,vx:0,vy:-600,r:6,i:`b${Be}`});Be=Be*2}if(Re<=2){i=Qt(`ghost${t.frames[a(t.frames.length*(Re%1))]}`)}else{i=Qt(`ghost4`)}}else{i=Qt(`ghost${e}`);if(collidedWithPlayer(t)){for(let e=0;e<200;e++){l=h()*$;s=h()*500+1200;He.push({x:Se.x,y:Se.y,vx:d(l+$/2)*s,vy:n(l+$/2)*s,gy:h()*8+24,s:s,r:6,i:"dot320"})}yt(R);Se.draw=false;ae=false;Je=false;ae=false;K=true;if(Te){Pe=We;Ge=true}_e(wi.widgets[0].i,true);postPlayCounter=2;fi(b)}}if(t.munched){i=Qt("eyes");if(t.y<=-g/2){t.munched=false;t.canCollide=true;t.gravity=5;t.scared=false}}t.facingLeft=t.vx>0;drawActor(t)}e();if(Ke){Se.x-=T*j;if(Se.x<=-Se.r)Se.x+=o+Se.r*2;Se.facingLeft=true}else if(Me){Se.x+=T*j;if(Se.x>o+Se.r)Se.x-=o+Se.r*2;Se.facingLeft=false}i=Qt(`player${Se.f[a(Se.f.length*Se.c)]}`);Se.c+=j*8;if(Se.c>=1)Se.c=0;if(!qe)drawActor(Se);if(!ze){Ce-=j;if(Ce<=0){ke=H;Le={x:o/2,y:P,r:48,canCollide:true};ze=true}}else if(!be&&!K){ke-=j;if(ke<=0)be=true;i=Qt("cherry");ne.drawImage(ge,i.x,i.y,i.width,i.height,Le.x-Le.r,Le.y-Le.r,i.width,i.height);if(collidedWithPlayer(Le)){Le.canCollide=false;be=true;yt(A);di(3200);He.push({x:o/2,y:P,vx:0,vy:-600,r:6,i:"b3200"})}}let f=`${We}`;ti(ii(f),G,f,ne);break;case u:break;case w:le-=j*2;if(le<=0){le=0;fi(y);re()}lt(le);break;case v:le+=j*2;if(le>=1){le=1;fi(y);re()}lt(le);break;default:break}if(te){$i();let e,t,i=0;while(i<Ze.length){t=Ze[i],x=t[0],z=a(3/96*i++);x+=150*(z+1)*j;if(x>=o)x=-32;t[0]=x;e=Qt(`star${z}`);ne.drawImage(ge,e.x,e.y,e.width,e.height,x,t[1],e.width,e.height)}ne.save();ne.globalAlpha=.3;ne.translate(0,g);ne.scale(1,-.75);ne.drawImage(de,0,700,o,180,0,0,o,180);ne.restore()}}requestAnimationFrame(ui)};</script>