Initially an attempt to recreate Battlezone in javascript, then cut down to a simple first person engine to keep it under 1k.
X=document.getElementById('c');R=X.width=X.height=600;Q=300;X=X.getContext('2d');X.strokeStyle='green';X.translate(Q,Q);H=.5;M=Math;C=M.cos;S=M.sin;P=M.PI/2;F='window.onkeyup=function(e){t=e.keyCode-31;l=t-6?t-8?l:0:-0;f=t-7?t-9?f:-0:0;t==0?[g[1]=x,g[2]=y,a=S(r),b=C(r)]:0};';B='a=b=p=l=f=r=x=y=0;o=[[c=[-.1],g=[0,R,R],d=[.1]]];for(i=14;i+16;i--){t=M.floor(M.random()*30);for(j=4;j;j--){o.push([[-H,i+H,t+H],[H,j&2?i+1:i,j+1&2?t+1:t],[H,j+1&2?i+1:i,j&2?t:t+1]]);}}T();';eval(F.replace('up','down').replace(/0/g,1)+F+B);function T(){p+=t=new Date().getTime()-p;t=p-t?t/Q:(h=p)&0;r+=t*l;r%=4*P;x+=S(r)*t*f;y+=C(r)*t*f;c[1]=d[1]=g[1];c[2]=d[2]=g[2];g[1]+=a*t*4;g[2]+=b*t*4;X.fillRect(-Q,-Q,R,R);X.beginPath();for(i in o){for(j in o[i]){t=o[i][j];m=t[1]-x;n=t[2]-y;v=(S(r)*m+C(r)*n)/Q;m=S(r+P)*m+C(r+P)*n;if(j==0){s=t[1]-g[1];w=t[2]-g[2];v=i!=0&&s<H&&s>-H&&w<H&&w>-H?o.splice(i,4)&0:v;if(v<1/Q)break;X.moveTo(m/v,t[0]/v)}else X.lineTo(m/v,t[0]/v)}}X.stroke();if(o.length==1){alert(p-h);eval(B)}setTimeout(T,33)}
WD1kb2N1bWVudC5nZXRFbGVtZW50QnlJZCgnYycpO1I9WC53aWR0aD1YLmhlaWdodD02MDA7UT0zMDA7WD1YLmdldENvbnRleHQoJzJkJyk7WC5zdHJva2VTdHlsZT0nZ3JlZW4nO1gudHJhbnNsYXRlKFEsUSk7SD0uNTtNPU1hdGg7Qz1NLmNvcztTPU0uc2luO1A9TS5QSS8yO0Y9J3dpbm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xKXthbGVydChwLWgpO2V2YWwoQil9c2V0VGltZW91dChULDMzKX0=
X = document.getElementById('c');
R = X.width = X.height = 600;
Q = 300;
X = X.getContext('2d');
X.strokeStyle='green';
X.translate(Q,Q);
H=.5;
M = Math;
C = M.cos;
S = M.sin;
P = M.PI/2;
F = 'window.onkeyup=function(e){t=e.keyCode-31;l=t-6?t-8?l:0:-0;f=t-7?t-9?f:-0:0;t==0?[g[1]=x,g[2]=y,a=S(r),b=C(r)]:0};';
B = 'a=b=p=l=f=r=x=y=0;o=[[c=[-.1],g=[0,R,R],d=[.1]]];for(i=14;i+16;i--){t=M.floor(M.random()*30);for(j=4;j;j--){o.push([[-H,i+H,t+H],[H,j&2?i+1:i,j+1&2?t+1:t],[H,j+1&2?i+1:i,j&2?t:t+1]]);}}T();';
eval(F.replace('up','down').replace(/0/g,1)+F+B);
function T(){
p += t = new Date().getTime()-p;
t = p-t?t/Q:(h=p)&0;
r += t*l;
r %= 4*P;
x += S(r)*t*f;
y += C(r)*t*f;
c[1] = d[1] = g[1];
c[2] = d[2] = g[2];
g[1] += a*t*4;
g[2] += b*t*4;
X.fillRect(-Q,-Q,R,R);
X.beginPath();
for(i in o){
for(j in o[i]){
t = o[i][j];
m = t[1]-x;
n = t[2]-y;
v = (S(r)*m+C(r)*n)/Q;
m = S(r+P)*m+C(r+P)*n;
if(j==0){
s = t[1]-g[1];
w = t[2]-g[2];
v = i!=0&&s<H&&s>-H&&w<H&&w>-H?o.splice(i,4)&0:v;
if(v<1/Q) break;
X.moveTo(m/v,t[0]/v);
}else X.lineTo(m/v,t[0]/v);
}
}
X.stroke();
if(o.length==1){alert(p-h);eval(B);}
setTimeout(T,33);
}