Catch the yellow atoms, don't touch red ones. Move left and right touching your screen or using keyboard.
_='Wa.w,Ha.height,ZWHHW,O[{t:2,d:L=R=1}],Q)1e3,S0,G4,K[];for(M _ c)c[M+(M[6]||MF)]=c[M];onkeydown^which-37]1};a.addEv`tLiq`er("Vqart"^Ves.cli`tX<w?0:2]=1}0zsetInterval(wiA (MaA) {PPI18;wiA(c){svfc(W*2H*2Color"#0f0",Blur5,Cap"round",sT("Score: "S~6~6ta(WHrt(GPJ4.5sa(ZZ.8U"#"(999JU50 % 900N0i.3Ue3 % .1i1)W4iZi@srii4;baW2Z,i27i46)mv(0ln(s_Yi2;srKG--G,KFG9++G,KKF0,O.xG,jj--(L3))fill!"#f00#ff0#08f".subqr(t44ix227s_dYd25Z(jdL)@flj(d -(UJT)60)1(x =G & $tS++(L.5)O.splice(j~)zreTU,QT &&(QT ($1e3R100O[]{x: 10Nd: 25t: .7N0},R1e-4z}}}~5z * O[j]. / , function(w){),new Date().valueOf( random() && ;while ( < qroke!+idA0 ? : [0](PO.l`gA= > (i)l_e,baac( shadow!Style$L3.5@36AthF[2]J - N | VtouchYcos^K[w._in`enqstz);~12';for(Y in $='~zq`_^YVNJFA@$! ')with(_.split($[Y]))_=join(pop());eval(_)
Xz0nVwFhLncRfyxIAWEuaGVpZ2h0fyxaAVcaSBNIFFcsTwFbe3Q6MixkOkw9Uj0xfV0sUQgpHjFlMyxTATAsRwE0LEsBW107Zm9yKE0gXyBjKWNbTRUrKE1bNl18fE1GKV09Y1tNXTtvbmtleWRvd24BXndoaWNoLTM3XQExfTthLmFkZEV2YHRMaXFgZXIoIlZxYXJ0IgVeVmVzFS5jbGlgdFg8dxE/MDoyXT0xfQUwenNldEludGVydmFsKAZ3aUEgKE1hQSkge1ABUEkEMTg7d2lBKGMpe3N2FmZjKBISVyoyBUgqMg8fQ29sb3IBIiMwZjAiLB9CbHVyATUsHENhcAEicm91bmQiLHNUKCJTY29yZTogIh5TfjZ+Ngd0YShXBUgHcnQoRwJQShc0LjUHc2EoWgVaAi44B1UIDyIjIh4oOTk5SlV/NTAgJSA5MDBOMAdpAS4zHlV/ZTMgJSAuMQxpDjEpHFcRATQCaQRaHRISaUBzchZpEBlpBDQ7YmEWHFcRATIEWixpARcyNwxpDhc0NiltdigSMAdsbihzXxtZB2kQGRcyO3NyFksVC0cLLS1HLEtGC0cOOQsrK0csSxUBS0YBMCxPFS54AUcsagEYDGotLRooTBozKSlmaWxsISIjZjAwI2ZmMCMwOGYiLnN1YnFyKAN0AjQFNAdpAQN4AhcyHhcyNx1zXxsEA2RZBANkBTI1BFoEKGoTA2QUTClAZmwWagsoA2QgLRkoVUpUKQQ2MCkOMQsoA3ggPRlHICYgJAN0E1MrKxQoTBAZLjUpFBJPLnNwbGljZShqfil6cmUWVAFVLFEOVCAmJihRAVQQCQIoJDFlMwRSFDEwMAdPWxhdAXt4OgkCMTBOEmQ6IDI1BXQ6CRouN04wfSxSEBkxZS00en19fX41egEgGQIgKiADT1tqXS4EIC8gBSwgBmZ1bmN0aW9uKHcpewcpLAgBbmV3IERhdGUoKS52YWx1ZU9mKAkgcmFuZG9tKCkLICYmIAw7d2hpbGUgKA4gPCAPB3Fyb2tlIR4rEWlkQRIwBRMgPyAUIDogFVswXRYoBxdQAhhPLmxgZ0EZPSAaID4gGyhpKRxsX2UdLGJhFmFjKB4QIB9zaGFkb3chU3R5bGUBJEwOMy41E0AFEhczNgdBdGhGWzJdSiAtIE4gfCBWdG91Y2hZBWNvcxteBktbdy5faW5gZW5xc3R6KTt+BTF/BDInO2ZvcihZIGluICQ9J39+enFgX15ZVk5KRkFAJCEfHh0cGxoZGBcWFRQTEhEQDw4MCwkIBwYFBAMCAScpd2l0aChfLnNwbGl0KCRbWV0pKV89am9pbihwb3AoKSk7ZXZhbChfKQ==
// Elemental master (Mar/13/2016) by Oscar Toledo G. http://nanochess.org/
// Catch the yellow atoms, don't touch the red ones.
// Use keyboard or touch your screen.
// Size
W = a.width / 2,
H = a.height / 2,
Z = W > H ? H : W,
// Coming elements, lifes / difficulty
O = [{t:2,d:L=R=1}],
// Time for next one
Q = new Date().valueOf() + 1e3,
// Score
S = 0,
// Start angle
G = 4,
// Keys
K = [];
// Compression of <canvas> function names
for(M in c)c[M[0]+(M[6]||M[2])]=c[M];
onkeydown = function(w){K[w.which-37] = 1};
a.addEventListener("touchstart", function(w){K[w.touches[0].clientX<width?0:2]=1}, 0);
setInterval(function(w){
with (Math) {
P = PI / 18;
with(c){
sv(),
// Clear canvas
fc(0, 0, W*2, H*2),
// Show score
strokeStyle = shadowColor = "#0f0",
shadowBlur = 5,
lineCap = "round",
sT("Score: " + S, 16, 16),
// Prepare rotated canvas
ta(W, H),
rt(G * P - P * 4.5),
sa(Z, Z * .8),
// Draw border
U = new Date().valueOf(),
strokeStyle = "#" + (999 - U / 250 % 900 | 0),
i = .3 + U / 2e3 % .1;
while (i < 1)
lineWidth = 4 * i / Z,
ba(),
ac(0, 0, i, 0, P * 36),
sr(),
i += i / 4;
// Draw perspective lines
ba(),
lineWidth = 2 / Z,
i = P * 27;
while (i < P * 46)
mv(0, 0),
ln(sin(i), cos(i)),
i += P * 2;
sr(),
// Move player
K[0] && G && --G,
K[2] && G < 9 && ++G,
K[0] = K[2] = 0,
// Draw atoms
O[0].x = G,
j = O.length;
while (j-- > (L > 3))
fillStyle = "#f00#ff0#08f".substr(O[j].t * 4, 4),
i = O[j].x * P * 2 + P * 27,
ba(),
ac(sin(i) / O[j].d, cos(i) / O[j].d, 25 / Z / (j ? O[j].d : L), 0, P * 36),
fl(),
j && (O[j].d -= (U - T) / 60) < 1 && (
O[j].x == G & L < 3.5 ? O[j].t ? S++ : (L += .5) : 0, O.splice(j, 1));
re(),
T = U,
// Add new atoms
Q < T &&
(Q = T + random() * (L < 3.5 ? 1e3 / R : 100),
O[O.length] = {x: random() * 10 | 0, d: 25, t: random() > .7 | 0},
R += 1e-4);
}}
}, 15);