Hra had -
zdrojový kód
<html>
<head>
<title>Java Script ze stránky - www.jaknaweb.com</title>
<script language="JavaScript">
<!--
main=new Image();
main.src="screan.gif";
doter=new Image();
doter.src="dot.gif"
// -->
</script>
</head>
<body bgcolor="#efefef" text="#000066" onload="cantplay()">
<img src="screan.gif" style="position: absolute; left: 9; top: 9;" width="202" height="202">
<script language="JavaScript">
<!--
for(v=1;v<=100;v++){document.write("<img src='dot.gif' id='dot"+v+"' style='position: absolute; left: 0; top:-200;'>")}
// -->
</script>
<center><font face="Verdana" size="2"><strong>
<div id="bd" style="position: absolute; width: 150; left: 35; top: 15;">
<p>Obtížnost:<br>
<p><input type="button" onclick="level=1; startIt()" value="Začátečník"><br>
<p><input type="button" onclick="level=2; startIt()" value="Pokročilý"><br>
<p><input type="button" onclick="level=3; startIt()" value="Profesionální"><br>
<p><input type="button" onclick="level=4; startIt()" value="Extrémní"><br></div>
<div id="go" style="position: absolute; width: 100; left: 60; top: -200;">Konec hry</div>
<div id="ld" style="position: absolute; width: 100; left: 60; top: 30;">Nahrávám... </div>
<div id="yw" style="position: absolute; width: 100; left: 60; top: -200;">Vyhrál jsi !</div>
</strong></font></center>
<script language="JavaScript">
<!--
direct="null";
sec=0;run="get";
S=0;
var top=new Array();
var left=new Array();
var go=new Array()
for(n=2;n<=100;n++)
{
go[n]="not";
top[n]=-200;
left[n]=-200};
for(n=1;n<5;n++)
{
go[n]="yes"
}
function locatEm(turn){ar=new Array(70,160,140,10,60,70,100,30,190,180);am=new Array(10,110,190,170,60,30,60,80,150,120,20,130,180,160,200,180,70,100,90,20);test=sec;now=new Date();sec=now.getSeconds();if(test==sec){sec+=sec};left[turn]=ar[sec%10];top[turn]=am[sec%20];showEm(turn);if(turn!=5){showscore();speed-=rate}}
function SSnake(){if(go[100]=="yes"){document.all.yw.style.pixelTop=60;lost="yes"};for(i=99;i>1;i--){if(go[i]=="yes"){top[i]=top[(i-1)];left[i]=left[(i-1)]}};if(direct=="up"){top[1]-=10};if(direct=="down"){top[1]+=10};if(direct=="left"){left[1]-=10};if(direct=="right"){left[1]+=10};for(m=99;m>4;m--){if(top[1]==top[m]){if(left[1]==left[m]){if(go[m]!="yes"){go[m]="yes";locatEm((m+1))}else{lost="yes"}}}};if(top[1]==top[100]){if(left[1]==left[100]){go[100]="yes"}};for(z=1;z<=99;z++){if(go[z]=="yes"){showEm(z)}};if(top[1]==0){lost="yes"};if(top[1]==210){lost="yes"};if(left[1]==0){lost="yes"};if(left[1]==210){lost="yes"};if(lost!="yes"){setTimeout("SSnake()",speed)}else{hideEm(1);if(go[100]!="yes"){document.all.go.style.pixelTop=60;setTimeout("reaload()",2000)}}}
function showEm(turn){eval("document.all.dot"+turn+".style.pixelTop ="+top[turn]);eval("document.all.dot"+turn+".style.pixelLeft ="+left[turn])}
function keyDown(){k=window.event.keyCode;if(k==104){if(direct!="down"){direct="up"}};if(k==98){if(direct!="up"){direct="down"}};if(k==100){if(direct!="right"){direct="left"}};if(k==102){if(direct!="left"){direct="right"}};if(k==38){if(direct!="down"){direct="up"}};if(k==40){if(direct!="up"){direct="down"}};if(k==37){if(direct!="right"){direct="left"}};if(k==39){if(direct!="left"){direct="right"}}}
function startIt(){if(run=="not"){S=0;add=0;showscore();if(level==1){speed=151;rate=1.5;add=3};if(level==2){speed=101;rate=1;add=5};if(level==3){speed=51;rate=.5;add=9};if(level==4){speed=11;rate=.1;add=15};direct="null";lost="not";top[1]=100;left[1]=90;setTimeout('locatEm(5)',3000);document.all.bd.style.pixelTop=-200;run="once";SSnake()}}
function reaload(){for(n=5;n<=99;n++){go[n]="not"};for(e=1;e<=99;e++){hideEm(e)};run="not";document.all.go.style.pixelTop=-200;document.all.bd.style.pixelTop=15;document.all.yw.style.pixelTop=-200}
function hideEm(turn){top[turn]=-200;eval("document.all.dot"+turn+".style.pixelTop=-200")}
function showscore(){S+=add;score.document.write("<bo"+"dy bgcolor='#efefef' text='#000066'><center><font face='Verdana' size='2'><strong>Skóre: "+S+"</font></strong></center>");score.document.close()}
function cantplay(){if(navigator.appName=="Netscape"){document.write("<div style='position: absolute; left: 9; top: 9;'><img src='screan.gif'></div>");alert("Tato hra funguje pouze v Internet Exploreru 4 a vyšším.")}else{document.all.ld.style.pixelTop=-200;run="not"}}
document.onkeydown=keyDown
// -->
</script>
<iframe src="score.html" name="score" width="200" height="50" frameborder="0" scrolling="no" style="position: absolute; top: 215; left: 10;">
</body>
</html>