HRA: FASTEST LAP

ID
Nazov / Name:
Popis / Description:
Dlzka / Length:
Testovane pod / Tested under:

 

130
p130.html / p130.zip
Simulator malej pretekarskej formuly.
13622b
NN 4.04

UKAZKA / CLICK HERE

Zdrojovy tvar / Source code (p130.html):

<HTML> <HEAD> <TITLE>JavaScript DESTINATION - P130</TITLE> </HEAD> <FRAMESET COLS="400,*"> <FRAMESET ROWS="300,*"> <FRAME SRC="index3.html" NAME="main" NORESIZE SCROLLING="NO"> <FRAME SRC="sub1.html" NAME="sub1" NORESIZE SCROLLING="NO"> </FRAMESET> <FRAME SRC="sub2.html" NAME="sub2" SCROLLING="NO"> </FRAMESET> </HTML>

Zdrojovy tvar / Source code (index3.html):

<HTML> <HEAD> <TITLE>FASTEST LAP</TITLE> <SCRIPT LANGUAGE="JavaScript"> <!-- var timerID = null var vsync = 150 var cx = new Array(50) var cy = new Array(50) var cvx = new Array(100) var cvy = new Array(100) var v=0 var dv=0 var Lmax=3 var cmx = 0 var cmy = 0 var cmz = 0 var Nx = new Array(1000) var Ny = new Array(1000) var Nz = new Array(1000) var Bx = new Array(1000) var By = new Array(1000) var Bz = new Array(1000) cx[0]=3;cy[0]=20 cx[1]=3;cy[1]=18 cx[2]=3;cy[2]=16 cx[3]=3;cy[3]=14 cx[4]=3;cy[4]=12 cx[5]=3;cy[5]=10 cx[6]=4;cy[6]=8 cx[7]=6;cy[7]=7 cx[8]=8;cy[8]=8 cx[9]=9;cy[9]=10 cx[10]=9;cy[10]=12 cx[11]=9;cy[11]=14 cx[12]=10;cy[12]=16 cx[13]=11;cy[13]=18 cx[14]=13;cy[14]=19 cx[15]=15;cy[15]=19 cx[16]=17;cy[16]=20 cx[17]=18;cy[17]=22 cx[18]=17;cy[18]=24 cx[19]=16;cy[19]=26 cx[20]=17;cy[20]=28 cx[21]=19;cy[21]=29 cx[22]=21;cy[22]=29 cx[23]=23;cy[23]=29 cx[24]=25;cy[24]=29 cx[25]=27;cy[25]=27 cx[26]=29;cy[26]=26 cx[27]=31;cy[27]=27 cx[28]=32;cy[28]=29 cx[29]=31;cy[29]=31 cx[30]=30;cy[30]=33 cx[31]=28;cy[31]=34 cx[32]=26;cy[32]=34 cx[33]=24;cy[33]=34 cx[34]=22;cy[34]=34 cx[35]=20;cy[35]=34 cx[36]=18;cy[36]=34 cx[37]=16;cy[37]=34 cx[38]=14;cy[38]=34 cx[39]=12;cy[39]=34 cx[40]=10;cy[40]=34 cx[41]=8;cy[41]=33 cx[42]=6;cy[42]=31 cx[43]=5;cy[43]=30 cx[44]=4;cy[44]=28 cx[45]=3;cy[45]=26 cx[46]=3;cy[46]=24 cx[47]=3;cy[47]=22 cvx[94]=75;cvy[94]=550 cvx[95]=75;cvy[95]=525 cvx[96]=18;cvy[96]=465 function goclk(){ Lmax=3 LapTime=0 TOTAL=0 bstflg=0 v=0 cmx=80 cmy=-330 cmz=0 cmzf=0 cflag=0 document.layers["LAYTOP"].moveTo(-1000,0) for (ia=0; ia < 1001; ia++){ Nx[ia]=0 Ny[ia]=0 Nz[ia]=0 } timerID = setTimeout("interval1()",vsync) } function cff(){dv=3;cmzf=0} function crr(){dv=3;cmzf=-1} function crf(){dv=3;cmzf=-0.5} function clf(){dv=3;cmzf=0.5} function cll(){dv=3;cmzf=1} function hff(){dv=0;cmzf=0} function hrr(){dv=0;cmzf=-1} function hrf(){dv=0;cmzf=-0.5} function hlf(){dv=0;cmzf=0.5} function hll(){dv=0;cmzf=1} function bff(){dv=-3;cmzf=0} function brr(){dv=-3;cmzf=-1} function brf(){dv=-3;cmzf=-0.5} function blf(){dv=-3;cmzf=0.5} function bll(){dv=-3;cmzf=1} function imgch(){ if (navigator.appVersion.charAt(0) >= 4){ BestLap=10000 REC=10000 blv="--.-" rlv="--.-" for (tmp1=0; tmp1<47; tmp1++){ cvx[tmp1*2]=cx[tmp1]*25 cvy[tmp1*2]=cy[tmp1]*25 cvx[tmp1*2+1]=(cx[tmp1]+cx[tmp1+1])*12.5 cvy[tmp1*2+1]=(cy[tmp1]+cy[tmp1+1])*12.5 } ib=0 for (ia=0; ia<97; ia++){ tmpcx=cvx[ia]+80 tmpcy=cvy[ia]-330 document.layers[ia].moveTo(tmpcx,tmpcy) } } } function gameset(){ clearTimeout(timerID) clearTimeout(timerID) clearTimeout(timerID) clearTimeout(timerID) clearTimeout(timerID) clearTimeout(timerID) clearTimeout(timerID) clearTimeout(timerID) clearTimeout(timerID) clearTimeout(timerID) Rep=0 document.layers["STAR2"].visibility="HIDE" document.layers["LAYTOP"].moveTo(0,-970) if (REC > TOTAL){REC=TOTAL;rlv=TotH+"."+TotL for (ia=0; ia < 1001; ia++){ Bx[ia]=Nx[ia] By[ia]=Ny[ia] Bz[ia]=Nz[ia] } } parent.sub2.document.f_sub2.REC.value=rlv } function IR(){ if (Rep == 0){document.layers["LAYTOP"].moveTo(0,-1180)} clearTimeout(timerID) clearTimeout(timerID) clearTimeout(timerID) clearTimeout(timerID) clearTimeout(timerID) clearTimeout(timerID) clearTimeout(timerID) clearTimeout(timerID) clearTimeout(timerID) clearTimeout(timerID) Rep=Rep+1 if (Rep <= 1000){ for (ia=0; ia<97; ia++){ tmpcx=cvx[ia]+Nx[Rep]-150 tmpcy=cvy[ia]+Ny[Rep]-150 with (Math) {tmpcvx = floor(cos(PI/16*Nz[Rep])*tmpcx-sin(PI/16*Nz[Rep])*tmpcy)+150} with (Math) {tmpcvy = floor(sin(PI/16*Nz[Rep])*tmpcx+cos(PI/16*Nz[Rep])*tmpcy)+150} document.layers[ia].moveTo(tmpcvx,tmpcvy) } } if (Rep <= TOTAL/2-1){timerID = setTimeout("IR()",vsync) }else{gameset() } } function VR(){ if (Rep == 0){document.layers["LAYTOP"].moveTo(0,-1180)} clearTimeout(timerID) clearTimeout(timerID) clearTimeout(timerID) clearTimeout(timerID) clearTimeout(timerID) clearTimeout(timerID) clearTimeout(timerID) clearTimeout(timerID) clearTimeout(timerID) clearTimeout(timerID) Rep=Rep+1 if (Rep <= 1000){ for (ia=0; ia<97; ia++){ tmpcx=cvx[ia]+Bx[Rep]-150 tmpcy=cvy[ia]+By[Rep]-150 with (Math) {tmpcvx = floor(cos(PI/16*Bz[Rep])*tmpcx-sin(PI/16*Bz[Rep])*tmpcy)+150} with (Math) {tmpcvy = floor(sin(PI/16*Bz[Rep])*tmpcx+cos(PI/16*Bz[Rep])*tmpcy)+150} document.layers[ia].moveTo(tmpcvx,tmpcvy) } } if (Rep <= REC/2-1){timerID = setTimeout("VR()",vsync) }else{gameset() } } function qit(){ clearTimeout(timerID) clearTimeout(timerID) clearTimeout(timerID) clearTimeout(timerID) clearTimeout(timerID) clearTimeout(timerID) clearTimeout(timerID) clearTimeout(timerID) clearTimeout(timerID) clearTimeout(timerID) gameset() } function interval1(){ clearTimeout(timerID) clearTimeout(timerID) clearTimeout(timerID) clearTimeout(timerID) clearTimeout(timerID) clearTimeout(timerID) clearTimeout(timerID) clearTimeout(timerID) clearTimeout(timerID) clearTimeout(timerID) LapTime=LapTime+2 TOTAL=TOTAL+2 with (Math) {v = floor(v-1+dv)} if (v >= 20){v=20} if (v <= 0){v=0} if (v == 0){cmzf=0} cmz=cmz-cmzf if (cmz >= 32){cmz=cmz-32} if (cmz <= -1){cmz=cmz+32} with (Math) {cmx = floor(sin(PI/16*(cmz))*v)+cmx} with (Math) {cmy = floor(cos(PI/16*(cmz))*v)+cmy} if (TOTAL <= 2000){ Nx[TOTAL/2]=cmx Ny[TOTAL/2]=cmy Nz[TOTAL/2]=cmz } tmpmin=10000000 minNo=-1 for (ia=0; ia<96; ia++){ tmpcx=cvx[ia]+cmx-150 tmpcy=cvy[ia]+cmy-150 tmpdis = tmpcx*tmpcx+tmpcy*tmpcy if (tmpdis <= tmpmin){tmpmin=tmpdis;minNo=ia} } if (tmpmin >= 2700){v=v-5;if(v <= 0){v=0}} with (Math){LapH=floor(LapTime/10)} LapL=LapTime- LapH*10 with (Math){TotH=floor(TOTAL/10)} TotL=TOTAL- TotH*10 if (bstflg == 0){if (minNo == 58){bstflg=1} if (minNo == 60){bstflg=1} if (minNo >= 61){if(bstflg == 0){LapH="";LapL=".Short Cut!"}} }else{if (minNo == 1){bstflg=0 Lmax=Lmax-1 if (BestLap >= LapTime){BestLap=LapTime blv=LapH+"."+LapL} LapTime=0}} parent.sub2.document.f_sub2.SPEED.value=v*10 parent.sub2.document.f_sub2.LAP.value=LapH+"."+LapL parent.sub2.document.f_sub2.BEST.value=blv parent.sub2.document.f_sub2.TOTAL.value=TotH+"."+TotL parent.sub2.document.f_sub2.REC.value=rlv parent.sub2.document.f_sub2.Lmax.value=Lmax for (ia=0; ia<97; ia++){ tmpcx=cvx[ia]+cmx-150 tmpcy=cvy[ia]+cmy-150 with (Math) {tmpcvx = floor(cos(PI/16*cmz)*tmpcx-sin(PI/16*cmz)*tmpcy)+150} with (Math) {tmpcvy = floor(sin(PI/16*cmz)*tmpcx+cos(PI/16*cmz)*tmpcy)+150} document.layers[ia].moveTo(tmpcvx,tmpcvy) } if (REC != 10000){if (TOTAL <= REC){ document.layers["STAR"].visibility="SHOW" document.layers["STAR2"].visibility="SHOW" tmpcx=cmx-Bx[TOTAL/2] tmpcy=cmy-By[TOTAL/2] with (Math) {tmpcvx = floor(cos(PI/16*cmz)*tmpcx-sin(PI/16*cmz)*tmpcy)+192} with (Math) {tmpcvy = floor(sin(PI/16*cmz)*tmpcx+cos(PI/16*cmz)*tmpcy)+192} document.layers["STAR"].moveTo(tmpcvx,tmpcvy) }else{document.layers["STAR"].visibility="HIDE"}} if (Lmax >= 1){timerID = setTimeout("interval1()",vsync) }else{gameset() } } //--> </SCRIPT> </HEAD> <BODY BGCOLOR="#3FEF3F" onLoad="imgch()"> <SCRIPT LANGUAGE="JavaScript"> <!-- for (ia=0; ia<96; ia++){ document.write("<LAYER LEFT='-1000' TOP='0'><IMG WIDTH=100 HEIGHT=100 SRC='ci0.gif'></LAYER>") } //--> </SCRIPT> <LAYER LEFT='-1000' TOP='0'><IMG WIDTH=100 HEIGHT=100 SRC='ci1.gif'></LAYER> <LAYER NAME='STAR' LEFT='-1000' TOP='0'><IMG WIDTH=16 HEIGHT=16 SRC='star.gif'></LAYER> <LAYER NAME='STAR2' LEFT='0' TOP='0' visibility="HIDE"><IMG WIDTH=16 HEIGHT=16 SRC='star.gif'><FONT SIZE="-1">RECORD RUN</FONT></LAYER> <LAYER LEFT="184" TOP="184"><IMG WIDTH=32 HEIGHT=32 SRC="f00.gif"></LAYER> <LAYER LEFT="0" TOP="0" onMouseOver="crr()"><IMG WIDTH=100 HEIGHT=150 SRC="null.gif"></LAYER> <LAYER LEFT="100" TOP="0" onMouseOver="crf()"><IMG WIDTH=50 HEIGHT=150 SRC="null.gif"></LAYER> <LAYER LEFT="150" TOP="0" onMouseOver="cff()"><IMG WIDTH=100 HEIGHT=150 SRC="null.gif"></LAYER> <LAYER LEFT="250" TOP="0" onMouseOver="clf()"><IMG WIDTH=50 HEIGHT=150 SRC="null.gif"></LAYER> <LAYER LEFT="300" TOP="0" onMouseOver="cll()"><IMG WIDTH=100 HEIGHT=150 SRC="null.gif"></LAYER> <LAYER LEFT="0" TOP="150" onMouseOver="hrr()"><IMG WIDTH=100 HEIGHT=90 SRC="null.gif"></LAYER> <LAYER LEFT="100" TOP="150" onMouseOver="hrf()"><IMG WIDTH=50 HEIGHT=90 SRC="null.gif"></LAYER> <LAYER LEFT="150" TOP="150" onMouseOver="hff()"><IMG WIDTH=100 HEIGHT=90 SRC="null.gif"></LAYER> <LAYER LEFT="250" TOP="150" onMouseOver="hlf()"><IMG WIDTH=50 HEIGHT=90 SRC="null.gif"></LAYER> <LAYER LEFT="300" TOP="150" onMouseOver="hll()"><IMG WIDTH=100 HEIGHT=90 SRC="null.gif"></LAYER> <LAYER LEFT="0" TOP="240" onMouseOver="brr()"><IMG WIDTH=100 HEIGHT=60 SRC="null.gif"></LAYER> <LAYER LEFT="100" TOP="240" onMouseOver="brf()"><IMG WIDTH=50 HEIGHT=60 SRC="null.gif"></LAYER> <LAYER LEFT="150" TOP="240" onMouseOver="bff()"><IMG WIDTH=100 HEIGHT=60 SRC="null.gif"></LAYER> <LAYER LEFT="250" TOP="240" onMouseOver="blf()"><IMG WIDTH=50 HEIGHT=60 SRC="null.gif"></LAYER> <LAYER LEFT="300" TOP="240" onMouseOver="bll()"><IMG WIDTH=100 HEIGHT=60 SRC="null.gif"></LAYER> <LAYER NAME="LAYTOP" LEFT="0" TOP="100" visibility="SHOW"> <FORM NAME="btnform"> <CENTER><INPUT TYPE="button" VALUE="GO" ONCLICK="goclk()"></CENTER> <IMG WIDTH=1 HEIGHT=970 SRC="null.gif"> <CENTER><INPUT TYPE="button" VALUE="Ukazka Replay" ONCLICK="IR()"></CENTER> <IMG WIDTH=1 HEIGHT=10 SRC="null.gif"> <CENTER><INPUT TYPE="button" VALUE="Ukaz rekord" ONCLICK="VR()"></CENTER> <IMG WIDTH=1 HEIGHT=10 SRC="null.gif"> <CENTER><INPUT TYPE="button" VALUE="Restart" ONCLICK="goclk()"></CENTER> <IMG WIDTH=1 HEIGHT=300 SRC="null.gif"> <INPUT TYPE="button" VALUE="Koniec" ONCLICK="qit()"> </LAYER> </FORM> </BODY> </FORM> </HTML>

Zdrojovy tvar / Source code (sub1.html):

<HTML> <FORM NAME="f_sub1"> <HEAD> <TITLE>GAME CONTROL</TITLE> </HEAD> <BODY BGCOLOR="#AAAAFF" TEXT="#004400" LINK="#FFCCCC" VLINK="#FFCCCC"> <FONT SIZE="-1"><PRE><CENTER>Rychlost Hore/Dole..Dopredu/Dozadu Natocit..Strana </CENTER></PRE> </FONT> </BODY> </FORM> </HTML>

Zdrojovy tvar / Source code (sub2.html):

<HTML> <FORM NAME="f_sub2"> <HEAD> <TITLE>GAME SCORE</TITLE> </HEAD> <BODY BGCOLOR="#AAAAFF" TEXT="#000044"> <CENTER><H3>FASTEST LAP</H3></CENTER> <PRE> ZOSTAVA : <INPUT TYPE="text" NAME="Lmax" SIZE=2 VALUE = "3" >KOL RYCHLOST : <INPUT TYPE="text" NAME="SPEED" SIZE=13 VALUE = "0" > CAS ZA KOLO : <INPUT TYPE="text" NAME="LAP" SIZE=13 VALUE = "0.0" > NAJLEPSI CAS : <INPUT TYPE="text" NAME="BEST" SIZE=13 VALUE = "--.-" > TOTAL : <INPUT TYPE="text" NAME="TOTAL" SIZE=13 VALUE = "0.0" > REKORD : <INPUT TYPE="text" NAME="REC" SIZE=13 VALUE = "--.-" > </PRE> </BODY> </FORM> </HTML>
[ Navrat / BACK ]