Click on the image above to run it.
I've reached
1872 Bytes using
Closure compiler, and since almost no hand-made optimization was done yet, I think I could reach the 1024 Bytes limit, necessary to enter the contest. But
I will not enter, for two reasons:
1. I don't feel this experiment visually interesting enough, and the optimizations I'd made will degrade it even more.
2. I prefer to participate in the contest with my
1024 Bytes pong. It's my original code, and not a port of someother's code.
But as usual, it really was a lot of fun! :)
later! :)
Habrá que hacer más y mejores! :) El video está disponible en
HD y para
descarga en
Vimeo.
Actualización: Un par de fotos en plan making of, cortesía de Thai :))
js1k is a new contest in which participants have to do something in Javascript in no more than 1024 Bytes.
I could not resist and took the bait, so I've done a 2-sided two player pong game, that you play clicking on the image:
The most difficult thing was to put all the code, that initially was 2029 Bytes, to 1024 Bytes. It ended preety obfuscated:
var d=document;
var C=d.getElementById('c');
d.onkeydown=kd;
d.onkeyup=ku;
d.onmousemove=mm;
var K=[], M=Math, w=500, h=w, c= C.getContext('2d'),
t, V=0, a, H=h, O, P, A, B, J=['#8cf','#c8f'], li, v=20, z=100, G=v, E=0, r=120, n=50;
C.width=w;C.height=600;
Z(0);
window.setInterval(l, 26);
function Z(q)
{
E+=q;
O=P=250;
a= M.random()*2*M.PI;
A=M.cos(a)*5;
B=M.sin(a)*5;
l();
t=30;
}
function l()
{
if(t<=0){
c.globalAlpha=0.4;
f(0,0,w,600,'#fff');
f(v,v,w-40,h-40,'#ddd');
c.globalAlpha=1;
f(250,h+v,E,5,J[E>0?1:0]);
if (K[65]) V-=3;
if (K[90]) V+=3;
V= V<-v?-v:V>v?v:V;
G+= V;
if(G<v){ G=v; V=0;}
if(G>h-r){ G=h-r; V=0;}
V*=0.8;
f(0,G,v,z,J[0]);
f(G,0,z,v,J[0]);
H= H<v?v:H>h-r?h-r:H;
f(w-v,H,v,z,J[1]);
f(H,h-v,z,v,J[1]);
O+= A;
P+= B;
if (O<v || P<v) Z(v);
if (O>w-v || P>h-v) Z(-v);
if ((O<30 && M.abs(P-(G+n))<n) || (O>w-30 && M.abs(P-(H+n))<n)) A*=-1-M.random()*0.2;
if ((P<30 && M.abs(O-(G+n))<n) || (P>h-30 && M.abs(O-(H+n))<n)) B*=-1-M.random()*0.2;
f(O-10,P-10,v,v,'#999')
}t--;
}
function f(y,u,i,o,x){c.fillStyle=x;c.fillRect(y,u,i,o);}
function kd(e){K[e.keyCode]=1;}
function ku(e){K[e.keyCode]=0;}
function mm(e){H=e.pageY-40;}
Al fin! casi un año después de que el
LUXI ganara ArtFutura, y por numerosos motivos que nos llevaron a postponer el acabado del juego, durante todo este mes de Julio le dimos duro para intentar finiquitarlo.
No está totalmente acabado, solo nos queda finalizar unas cinemáticas y acabar de pulir un par de niveles, cosa que iremos haciendo tranquilamente este mes.
Si tienes un hueco en tu apretada agenda veraniega, te invitamos a
Messing with HTML5 DnD for a small project of my own, I've done a little web for testing main events and its objects:
I put it online, maybe can be helpful for someone. Only tested in Chrome 6.0.472 and Firefox 4.0 b1. The fact is that you already can see lots of differences regarding DnD in both browsers... The
DnD Spec it's preety nice, but having to deal with browser peculiarities it's tiring and exhausting...
"Cualquier persona, en mar o en tierra, con un aparato sencillo y barato que cabe en un bolsillo, podría recibir noticias de cualquier parte del mundo o mensajes particulares destinados sólo al portador, la Tierra se asemejaría, pues, a un inconmensurable cerebro, capaz de emitir una respuesta desde cualquier punto".