The Elements are attacking the Earth. Press space to defend it from them. Go!
for(_='round~erVinnVU.UHTMLR1]RQ(l)Pp[O",NorMath.randoma.y(e.y-)timetion/2,en(e.x-x)()funcN0,{})p.splice(=m/1E3*k*p.push(n();.style.=parseInt(;f. (a){p.fEach(Nch"#)+"px"var =pVfmance.now(p.lgth-requestAnimaFrame(x)c=UWidth,h=UHeight,k=c/12,m;bbackg~="#000";bovVflow="hidd"; n(a,e,g,l,q,y){f=d.createElemt("div") UHTML=a style.posi="absolute" style.lefte style.bottomg style.col=l b=q c=0 x=e y=g move=y a=1;b.appdChild(freturn f}f(p=[n("MFFF,n("0Nc-k,h-k,"#FF0],r=,t=cos,u=sin,v=0;9>v;v++)String.fromCharCode(65+25*r),r*c,r*h,"#F5"+v,0,e=x-cg=-hl.01*a,q=e*tP-g*uP,e=g*tP+e*u(lx=q+c/2;=e+h/2}) w{"|"!=OQ&&"|05FN2,+b;f(e,g=2;g;g--)if(e=Og],sq=*+*,300>sq){Og]R="";g,1=h+1;OQOQ)+100;break}>h&&1,1)}))}documt.addEvtListV("keydownNswitch(keyCode){case 32:w}} x{m=-A;A=;move(aaleftx;abottom}}setIntVval({a=~()?1:-1})},3E3A;';G=/[^ -MSTW-}]/.exec(_);)with(_.split(G))_=join(shift());eval(_)
Zm9yKF89J3JvdW5kfmVyVmlublZVLlVIVE1MUjFdUlEobClQcFtPIixOb3IfTWF0aC4eHnJhbmRvbR1hLhwceRsoZS55LRspGnRpbWUZdGlvbhgvMiwXZW4WKGUueC0ceCkVKCkUZnVuYxgTTjAsExR7fSkScC5zcGxpY2UoET1tLzFFMyprKhBwLnB1c2gobigPKTsOLnN0eWxlLgw9cGFyc2VJbnQoCztmLgkTKGEpewhwLmYfRWFjaCgIHAdOYxdoFyIjBikrInB4IgV2YXIgBD1wVmYfbWFuY2Uubm93KANwLmwWZ3RoLQIOcmVxdWVzdEFuaW1hGEZyYW1lKHgpAQRjPVVXaWR0aCxoPVVIZWlnaHQsaz1jLzEyLG07YgxiYWNrZ349IiMwMDAiO2IMb3ZWZmxvdz0iaGlkZBYiOxMgbihhLGUsZyxsLHEseSl7BGY9ZC5jcmVhdGVFbGVtFnQoImRpdiIpCVVIVE1MPWEJc3R5bGUucG9zaRg9ImFic29sdXRlIglzdHlsZS5sZWZ0C2UFCXN0eWxlLmJvdHRvbQtnBQlzdHlsZS5jb2wfPWwJYj1xCWM9MAl4PWUJeT1nCW1vdmU9eQlhPTE7Yi5hcHAWZENoaWxkKGYOcmV0dXJuIGZ9Zh8oBHA9W24oIk0GRkZGEixuKCIwTmMtayxoLWssIiNGRjASXSxyPR0sdD0eY29zLHU9HnNpbix2PTA7OT52O3YrKykPU3RyaW5nLmZyb21DaGFyQ29kZSg2NSsyNSpyFCkschQqYyxyFCpoLCIjRjUiK3YsMCwIBGU9HHgtYxdnPRstaBdsEC4wMSocYSxxPWUqdFAtZyp1UCxlPWcqdFArZSp1KGwOHHg9cStjLzI7Gz1lK2gvMn0pDhMgdxR7InwiIT1PAlEmJg8ifAYwNUZOMiwIGysQHGI7Zh8oBGUsZz0CMjtnO2ctLSlpZihlPU9nXSxzcT0VKhUrGioaLDMwMD5zcSl7T2ddUj0iIjsRZywxDhs9aCsxO09RC09RKSsxMDA7YnJlYWt9Gz5oJiYRAjEsMSl9KSl9ZG9jdW0WdC5hZGRFdhZ0TGlzdBZWKCJrZXlkb3duTghzd2l0Y2goHGtleUNvZGUpe2Nhc2UgMzI6dxR9fQ4TIHgUexkDDm09GS1BO0E9GTsHbW92ZShhDmEMbGVmdAsceAU7YQxib3R0b20LGwV9AX1zZXRJbnRWdmFsKBMUewdhPR5+KB0UKT8xOi0xfSl9LDNFMw4EQQMBOyc7Rz0vW14gLU1TVFctfV0vLmV4ZWMoXyk7KXdpdGgoXy5zcGxpdChHKSlfPWpvaW4oc2hpZnQoKSk7ZXZhbChfKQ==
var w = innerWidth;
var h = innerHeight;
var u = w/12;
var diff;
b.style.background = "#000";
b.style.overflow = "hidden";
var createElement = (ship, x, y, color, v, move) => {
var el= d.createElement('div');
el.innerHTML=ship;
el.style.position="absolute";
el.style.left = parseInt(x)+"px";
el.style.bottom = parseInt(y)+"px";
el.style.color = color;
el.v = v;
el.rv = 0;
el.x = x;
el.y = y;
el.move = move;
el.spin = 1;
b.appendChild(el);
return el;
}
var move = (el) => {
el.move(el);
el.style.left = parseInt(el.x)+"px";
el.style.bottom = parseInt(el.y)+"px";
}
var Elements = [
createElement("M", w/2, h/2, "#FFF", 0, () => {}),
createElement("0", w-u, h-u, "#FF0", 0, () => {})
];
var ra = Math.random;
var co = Math.cos;
var si = Math.sin;
for (var i=0; i < 9; i++) {
Elements.push(createElement(
String.fromCharCode(65+ra()*25), ra() * w, ra() * h, "#F5"+i, 0,
(el) => {
var x = el.x - (w/2);
var y = el.y - (h/2);
var f = u * (diff/1000) * .01 * el.spin;
var px = (x * co(f)) - (y * si(f));
var py = (y * co(f)) + (x * si(f));
el.x = px + (w/2);
el.y = py + (h/2);
})
);
}
var shoot = () => {
if (Elements[Elements.length-1].innerHTML == "|") {
return;
}
Elements.push(createElement(
"|", w/2, h/2, "#05F", 2, (el) => {
el.y += el.v * u * (diff/1000);
var e, x2, y2;
for (var i = Elements.length-2; i; i--) {
e = Elements[i];
sq = ((e.x - el.x) * (e.x - el.x)) + ((e.y - el.y) * (e.y - el.y));
if (sq < 300) {
Elements[i].innerHTML="";
Elements.splice(i, 1);
el.y=h+1;
Elements[1].innerHTML = parseInt(Elements[1].innerHTML) +100;
break;
}
}
if (el.y > h) {
Elements.splice(Elements.length - 1, 1);
}
}
));
}
document.addEventListener('keydown', function(event) {
switch(event.keyCode) {
case 32:
shoot();
break;
}
});
var loop = () => {
time = performance.now();
diff = time - old_time;
old_time = time;
Elements.forEach((v) => {
move(v);
})
requestAnimationFrame(loop);
}
setInterval(() => {
Elements.forEach((v) => {
v.spin = Math.round(Math.random())? 1: -1;
})
}, 3000);
var old_time=performance.now();
requestAnimationFrame(loop);