Controls: arrows and space. Someone’s setting off fireworks in the forest. What happens next will…
for(_="Math.~*~sin(YYl)X*~cos(WWl)Vf.UUsT30Q(UPUc[OPz-h)Ne.LLe),LKonkeyJUZI||H=Px-r)G0,F6FE,z:D,h:B160A.fil@for($/2#(Lh#-5) &&+=12,s:--;+'%',E60~abs(*A/IPSHT)function(!!t[],x:=~sqrt(l)*return(],c@lRect(e,f){LhL~random()*c=[E10F0],L}); i*4,32F4);c@lStyle='hsla('+[Lx-Ux)+Lz-Uz)<n.some(f){n.push({c:[0+i1F5FEi*2C+fWe=7)DZ+fYe)B8Ey:) $i=Q;i)1if(!s){$n=[l=256];r=h=l)$i=,EQCV+B1,y:M=3-1DZX+2,S:M*2+16 i1M-i#+108}))f=7,i%2H-81 n[Q].p=t=s=5+6,s%16HFFLw?-Q:10Lx+6,y:LyDLzB9Fv:Ep:s?y.5}:h<?Ls3:Ly3}4 s%Q0HT==84050<1Pp=t)) Lw=0},Jdown=Jup=t[LkeyCode-32]=Ltype[5]}}l(7]-5])#Fr(e=6]-8])X,heV,t[0]20FE-5Ys)r+VDh-X,e:l-.52B2Fp:x2YKz2WKy=5- * #,Up==tLs#+T#Ph-=Uw=9) } c.translate(9F(a.height0)#-0|0);UpUp(f5n=n@ter(Lh>01220-IGX+NV n.sort(I-LZ0+5236-!UvI>AHI<8HeGV-NX)<A(O0],O1]I/6-O2]+46US?1:.8A+e-T#,0-Uy-#,T,)) s";G=/[^!%-?CMRSZ-}]/.exec(_);)with(_.split(G))_=join(shift(s=0));setInterval(_,33)
Zm9yKF89Ik1hdGgufip+c2luKFlZbClYKn5jb3MoV1dsKVZmLlVVc1QzMFEoVVBVY1tPUHotaClOZS5MTGUpLExLb25rZXlKVVpJfHxIPVB4LXIpRzAsRjZGRSx6OkQsaDpCMTYwQS5maWxAZm9yKCQvMiMoTGgjLTUpICYmHys9HjEyHSxzOhwtLTsbKyclJywaRTYwGhl+YWJzKBgqQS9JF1BTSFQpFxZmdW5jdGlvbigVISF0W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pbihzaGlmdChzPTApKTtzZXRJbnRlcnZhbChfLDMzKQ==
// add trees
for (entities = [playerA = 256]; s = playerX = playerZ = playerA--;)
for (
// create trunk
entities.push({
c: [i = 12, 60, 30],
x: X = Math.sqrt(playerA) * 12 * Math.cos(playerA) + Math.random() * 12,
h: 1,
y: Y = Math.random() * 3 - 1,
z: Z = Math.sqrt(playerA) * 12 * Math.sin(playerA) + Math.random() * 12,
s: 2,
S: Y * 2 + 16
});
i--;
// create leaf
entities.push({
c: [150, 60, i * 2],
x: X + f * Math.cos(e = Math.random() * 7),
z: Z + f * Math.sin(e),
h: 860,
y: Y - i / 2 + 10,
s: 8
})
)
// create fallen fruit
f = Math.random() * 7,
i % 2 || entities.push({
c: [50, 60, i * 2],
x: X + f * Math.cos(e = Math.random() * 7),
z: Z + f * Math.sin(e),
h: 860,
y: -8,
s: 1
});
// burn a leaf (doubles as object for active keys)
entities[30].p = burn = function (e, f) {
// update fire
e.h--;
e.c = [Math.random() * 60, 100, 0],
e.s = Math.random() * 5 + 6,
// create smoke / fireworks
s % 16 || entities.push({
c: [0, 0, e.w ? -30 : 10],
x: e.x + Math.random() * 6,
y: e.y,
z: e.z,
h: 90,
v: 60,
p:
s ? function (e, f) {
e.h--;
e.y += .5
} : function (e, f) {
e.h--;
e.c = [Math.random() * 60, 100, 0],
e.h < 12 ? e.s += 3 : e.y += 3
},
s: 4
});
// spread fire
entities.some(function (f) {
return(s % 300 || f.s == 8 && Math.abs(e.x - f.x) + Math.abs(e.z - f.z) < 40 && Math.random() * 50 < 1 && (f.p = burn))
});
e.w = 0
},
onkeydown = onkeyup = function (e, f) {
burn[e.keyCode - 32] = e.type[5]
},
setInterval(function (e, f) {
// move player
playerA += (!!burn[7] - !!burn[5]) / 20,
playerX += (e = !!burn[6] - !!burn[8]) * Math.sin(playerA),
playerZ += e * Math.cos(playerA),
// discharge water
burn[0] && entities.push({
c: [200, 60, -5 * Math.sin(s)],
x: playerX + 12 * Math.cos(playerA),
z: playerZ - 12 * Math.sin(playerA),
e: playerA - .5,
s: 2,
h: 20,
p: function (e, f) {
e.h--;
e.x += 2 * Math.sin(e.e),
e.z += 2 * Math.cos(e.e),
e.y = 5 - (e.h / 2 - 5) * (e.h / 2 - 5) / 2,
entities.some(function (f) {
f.p == burn && Math.abs(e.x - f.x) + Math.abs(e.z - f.z) < e.s / 2 + f.s / 2 && (
f.h -= f.w = 9
)
});
}
});
// prepare canvas
c.translate(90, (a.height += 0) / 2 - 120 | 0);
// update entities
entities.some(function (f) {
f.p && f.p(f)
});
// draw sky
for (i = 30; i--;)
c.fillStyle = 'hsla(' + [160, 60 + '%', 50 + i + '%', 1],
c.fillRect(0, i * 4, 320, 4);
// remove entities no longer needed
entities = entities.filter(function (e, f) {
return(e.h > 0)
});
// draw background forest
for (i = 30; i--;)
c.fillStyle = 'hsla(' + [160, 60 + '%', 10 + i + '%', 1],
c.fillRect(0, 220 - i * 4, 320, 4);
// sort entities by distance from the screen
entities.some(function (f) {
f.Z = (f.x - playerX) * Math.sin(playerA) + (f.z - playerZ) * Math.cos(playerA)
});
entities.sort(function (e, f) {
return(f.Z - e.Z)
});
// draw ground
for (i = 30; i--;)
c.fillStyle = 'hsla(' + [10 + 60, 60 + '%', 50 + i + '%', 1],
c.fillRect(0, 236 - i * 4, 320, 4);
// draw entities
entities.some(function (f) {
!f.v && f.Z > 160 || f.Z < 8 ||
Math.abs(e = (f.x - playerX) * Math.cos(playerA) * 160 / f.Z - (f.z - playerZ) * Math.sin(playerA) * 160 / f.Z) < 160 && (
c.fillStyle = 'hsla(' + [f.c[0], f.c[1] + '%', f.Z / 6 - f.c[2] + 46 + '%', f.S ? 1 : .8],
c.fillRect(
160 + e - f.s * 160 / f.Z / 2,
120 - f.y * 160 / f.Z - (f.S || f.s) * 160 / f.Z / 2,
f.s * 160 / f.Z,
(f.S || f.s) * 160 / f.Z
)
)
});
s--;
}, 33)