for(_='b[2*i~~+1`),__c.^.x,)};b=);c[c.fy]=n-y)/(+=sign;i--;)](=b.page(m-x/2,0,&&*o*s/30+v[=>{],gA]=*random() 30 -15b.addColorStop(=b.length/2for(i.push(a.width*sin(u)+cos(u)*k[a.height in c)c[i[0]+[i[6]]]=i;Ol=b%3;m= |0;n= |0;f=30;v=[];v.map.call(["IRJ[QTZVVMZDQFJ?IH@M","LTLPTNTLOLOHQFRFRHTHTDMCHCEGFHIELEIHIKLNHNJPJTHVNVPSPQNN","UXV[WXXSXKWEVCUETJUMUQTTRSMRJQFOCOAQBOCMFLJKRKSMSQ"][l>b.charCodeAt(w=0)-77=qv[`~]=60v[,,]s=min(,Rw(x_y(n-y_150<w++O(l+1)cL.7,"#001"1,"#115"b;fc,sS]="#fff";o=(80<w?w/4-19:1)*(1-f*f/9001/o;ff--;[l?1<l?12]:25]:0]]; in v)k=iu=PI*(y<n?n:-n)g=-k[2]1h=k[1]2u=-PI*)/(x<m?m:-m)A=h0k.x=Ak.y=gba^arc(kk.y,i<q?5/2:1,2*PI^fill(_i<q-(l-1?0:2)bk,kl-2?b0]):b13216]max(.8-hypot,.8*s))/o;!f!w.7<gA](w=1ba_m~]~].y_l`]`].y^stroke(1;requestAnimationFrame(Ronmousemovew||(xX,yYO(x=y=0R()';G=/[-^-`~]/.exec(_);)with(_.split(G))_=join(shift());with(Math)eval(_)
// Initialize the level
O=function(e) {
l=e%3;
// Randomly calculate the goal
m = a.width * Math.random()|0;
n = a.height * Math.random()|0;
f = 30;
v = [];
// Unpack star map
e=v.map.call([
"IRJ[QTZVVMZDQFJ?IH@M",
"LTLPTNTLOLOHQFRFRHTHTDMCHCEGFHIELEIHIKLNHNJPJTHVNVPSPQNN",
"UXV[WXXSXKWEVCUETJUMUQTTRSMRJQFOCOAQBOCMFLJKRKSMSQ"
][l],i=>i.charCodeAt(w=0)-77);
for (i=q=e.length/2;i--;)v.push([e[2*i 1],e[2*i], 30*Math.random()-15]);
// Decorational small stars
for (i=60;i--;)
v.push([30*Math.random()-15,30*Math.random()-15,30*Math.random()-15]);
};
s = Math.min(a.width, a.height);
R = function(e) {
if (w) {
// We won, move automatically towards the goal and stay there
x = Math.sign(m-x);
y = Math.sign(n-y);
if (w >150) O(l 1);
}
// Background gradient
e = c.createLinearGradient(0,0,0,a.height);
e.addColorStop(.7,"#001");
e.addColorStop(1,"#115");
c.fillStyle = e;
c.fillRect(0, 0, a.width, a.height);
c.fillStyle = c.strokeStyle = "#fff";
o=(w>80?(w/4 -19):1)*(1-f*f/900);
c.globalAlpha = 1/o;
if (f)f--;
// Start with end vertex (careful with multiple levels!!)
e = [l?l>1?v[12]:v[25]:v[0]];
for(i in v) {
// Apply 3D rotations
k = v[i];
u = Math.PI*(n-y)/(y<n?n:(a.height-n))/2;
g = - k[2]*Math.sin(u) Math.cos(u)*k[1];
h = k[1]*Math.sin(u) Math.cos(u)*k[2];
u = -Math.PI*(m-x)/(x<m?m:(a.width-m))/2;
j = h*Math.sin(u) Math.cos(u)*k[0];
k.x = j * o * s / 30 a.width/2;
k.y = g * o * s / 30 a.height/2;
// Paint star
c.beginPath();
c.arc(k.x, k.y, i<q?5/2:1, 0, 2*Math.PI);
c.fill();
// Store it for line rendering if necessary
if (i < q-(l-1?0:2))
e.push(k,k);
}
// Line postprocessing
if (l-2) {
e.push(v[0]);
} else {
e.push(v[13],v[2],v[16]);
}
// The line intensity depends on the distance to the goal
c.globalAlpha = Math.max(0,.8-Math.hypot(m-x, n-y)/(.8*s))/o;
// Are we close enough to win?
if(!f&&!w&&c.globalAlpha>.7)w=1;
for (i=e.length/2;i--;) {
// Draw line
c.beginPath();
c.moveTo(e[2*i].x, e[2*i].y);
c.lineTo(e[2*i 1].x, e[2*i 1].y);
c.stroke();
}
c.globalAlpha = 1;
requestAnimationFrame(R);
}
onmousemove = function(e) {
// If we won, ignore input
if (!w){
x = e.pageX;
y = e.pageY;
}
};
// Initialize game
O(x=y=0);
// Render
R();
// Change function to ES6 format
// Change 2.5 to 5/2
// Minified, ES6 and packed (with Math)