栏目搜索
 
 
 
 
你的位置:首页 > JavaScript > JavascriptGame >
 

JavascriptGame

发布者:[本站编辑] | 来源:[]

JavascriptGame_电脑维修资料库


<html>

<head>
<title>js falcon</title>

<script language=javascript>
<!--
var flimit=9                            //for test play (fire limit 0 to 9)
var bosstm=0                            //              (boss test mode = 1)
var bosslm=700                          //              (boss appearance)
var easy=0

var timerid = null
var timecounter = 0
var int = 25                            //interval
var k=0                                 //key buffer
var x=100                               //my chr xy
var y=100
var dx=0                                //my chr move
var dy=0
var ix=0
var iy=0
var sdx=0
var sdy=0
var six=0
var siy=0
var endflg=0                            //game end flag
var ff=0                                //fire flag
var fc=0                                //fire counter
var fx = new array(12)                  //fire xy
var fy = new array(12)
var bf=0                                //bomb flag
var bc=0                                //bomb counter
var bx=0                                //bomb xy
var by=-100
var bdx=0                               //bomb fall speed
var bdy=0
var cname = new array(2)                //clash image no
var bflag=0                             //bomb flag
var gnd=0                               //scroll flag
var efx = new array(8)                  //enemy fire xy
var efy = new array(8)
var evx = new array(8)                  //enemy fire speed
var evy = new array(8)
var fmax = 3                            //enemy fire max
var emx = 200                           //enemy missile xy
var emy = 284
var ptn = 0                             //enemy missile paturn
var mvx = 0                             //enemy missile speed
var mvy = 0
var mcount = 100                        //missile timer
var ex = new array(20)                  //enemy xy
var ey = new array(20)
var ch = new array(2)                   //cobra yspeed
var cw = new array(2)                   //cobra xspeed
var tmp1 = 0
var tmp2 = 0
var endflg = 1
var bossflg = 0
var bossx = 0                           //boss x
var bossh = 0                           //boss canon h (170 to 220)
var canonx=-200                         //canon x,y,counter
var canony=-200
var canonc=0
var bossflg=0
var tmpbf=0
var sf=0                                //start flag
var spcount=0


//ie check
 systm=
 ver=navigator.appversion
 len=ver.length
 for(iln=0;iln<len;iln++) if(ver.charat(iln)==() break
 systm = ver.charat(iln+1).touppercase()

 


// ---------------------------------
// ======== main function ==========
// ---------------------------------

function interval1(){
 cleartimeout(timerid)

 // --------- clash image clear -----------
  ccount0=ccount0+1
  if (ccount0 >= 2){cla0.left=-100}
  ccount1=ccount1+1
  if (ccount1 >= 2){cla1.left=-100}
  ccount2=ccount2+1
  if (ccount2 >= 2){cla2.left=-100}

 // --------- enemy fire level up -----------
 timecounter=timecounter+1
 with (math){fmax=floor(timecounter/100)+3}
 if (fmax >= flimit){fmax=flimit}
 if (timecounter == blimit){bossflg=1;tmpbgc=100;tmpbgf=0}
 if (bossflg >= 1){
  tmpbgc=tmpbgc-5
  if (tmpbgc >= 0){
   if (systm!=c){}
  }
  if (tmpbgf == 0){
   if (tmpbgc <= 0){
    if (systm!=c){
     tmpbgf=1
    }else{
     tmpbgf=1
    }
   }
  }
  tmpbf=0
  for (tmp1=0; tmp1<10; tmp1++){
   if (ex >= -50){tmpbf=1}
  }
  if (tmpbf == 0){bossmode()}
 }


 // --------- gnd move ----------
 gnd=gnd-1;if (gnd <= -16){gnd=0}
 gnds.left=gnd


 // ---------- mig23 move   enemy no =0,1,2   layer no =27,28,29 ---------
 with (math) {
  for (tmp1=0; tmp1<3; tmp1++){
   ex=ex-5
   if (ex <= -30){
    if (floor(random()*12) == 3 ){
     if (bossflg == 0){ex=400;ey=floor(random()*12)*20+20}
    }
   }
  spmov(27+tmp1,ex,ey)
  with (math){if (floor(random()*5) == 3 ){efire(ex,ey)}}
  }
 }

 // ---------- cobra move  enemy no =3,4,5  layer no =30,31,32 ----------
 if (timecounter >= 300){
  with (math) {
   for (tmp1=3; tmp1<6; tmp1++){
    ex=ex-cw
    if (ey <= 5){ch=2;cw=4}
    if (ey >= 240){ch=-2;cw=2}
    ey=ey+ch
    if (ex <= -30){
     if (floor(random()*12) == 3 ){
      if (bossflg == 0){ex=400;ey=floor(random()*12)*20+20}
     }
    }
   spmov(27+tmp1,ex,ey)
   with (math){if (floor(random()*5) == 3 ){efire(ex,ey)}}
   }
  }
 }

 // ---------- shilka move  enemy no =6,7,8  layer no =33,34,35 ----------
 if (timecounter >= 200){
  with (math){tmptm=timecounter-floor(timecounter/100)*100}
  if (tmptm <= 40){tmptmx=3}else{if (tmptm <= 70){tmptmx=1}else{tmptmx=-1}}
  for (tmp1=0; tmp1<3; tmp1++){
   ex=ex-tmptmx
   if (ex <= -30){
    if (ex<6> <= 365){
     if (ex<7> <= 365){
      if (ex<8> <= 365){
       if (bossflg == 0){
        with (math){if (floor(random()*40) == 3 ){ex=400}}
       }
      }
     }
    }
   }
  spmov(33+tmp1,ex,ey)
  with (math){if (floor(random()*5) == 3 ){efire(ex,ey)}}
  }
 }

 // ---------- gecko move   enemy no =9  layer no =36 ------------
 if (ex<9> <= -600){if (bossflg == 0){ex<9>=400}}
 ex<9>=ex<9>-1;if (ex<9> <= 250){ex<9>=ex<9>-4}
 if (ex<9> == 365){emx=ex<9>+7;emy=ey<9>-10;mcount=0}
 if (ex<9> == 310){emx=ex<9>+7;emy=ey<9>-10;mcount=0}
 if (ex<9> == 255){emx=ex<9>+7;emy=ey<9>-10;mcount=0}
 spmov(36,ex<9>,ey<9>)

 // ---------- bomb move -------------
 if (bf == 1){bx=x;by=y+30;bc=1;bf=0;bdx=12}
 if (bc == 1){
  bdy=bdy+2
  if (bdy == 10){
  spmov(45+bflag,-100,-100)
   bflag=1
  }
  if (bdy >= 10){bdx=bdx+3;bx=bx+bdx}
  by=by+bdy;tmpbmx=-100;tmpbmy=-100
   for (tmp2=0; tmp2<10; tmp2++){
    if (bx >= ex-30){
     if (bx <= ex+16){
      if (by >= ey-3){
       if (by <= ey+16){
        tmpbmx=bx-8;tmpbmy=by-4
       }
      }
     }
    }
   }
  if (by >= 284){tmpbmx=bx-8;tmpbmy=244}
  if (tmpbmx != -100){
   spmov(45+bflag,-100,-100)
   spmov(50,tmpbmx,tmpbmy)
   bflag=0;ccount2=0;bc=0;by=-100;bdx=0;bdy=0
   for (tmp2=0; tmp2<10; tmp2++){
    if (bx >= ex-56){
     if (bx <= ex+40){
      if (ey >= tmpbmy-18){
       if (ey <= tmpbmy+63){
        spmov(33+tmp2,-100,-100)
        spmov(cname,ex,ey-6)
        if (cflag == 0){ccount0=0}else{ccount1=0}
        cflag=cflag+1;if (cflag >= 2){cflag=0}
        ex=-100;fx=500;score=score+50
       }
      }
     }
    }
   }
  }
  spmov(45+bflag,bx,by)
 }

 // ---------- my fire move -------------
 if (ff == 1){
  fx=x;fy=y+12
  fc=fc+1;if (fc >= 13){fc=0}
  ff=0
 }
 for (tmp1=0; tmp1<13; tmp1++){
  fx=fx+32
  for (tmp2=0; tmp2<10; tmp2++){
   if (fx >= ex-8){
    if (fx <= ex+32){
     if (fy >= ey-8){
      if (fy <= ey+19){
       spmov(27+tmp2,-100,-100)
       spmov(cname,ex,ey-6)
       if (cflag == 0){ccount0=0}else{ccount1=0}
       cflag=cflag+1;if (cflag >= 2){cflag=0}
       ex=-100;fx=500;score=score+10
      }
     }
    }
   }
  }
  spmov(tmp1+1,fx,fy)
 }


 // ---------- enemy fire/missile move ---------
 efmove()
 emiss()

 // ---------- my chr move -----------
 tmpix=ix+six;if (tmpix >= 1){tmpix=5+easy}
 tmpiy=iy+siy;if (tmpiy >= 1){tmpiy=5+easy}
 tmpdx=dx+sdx;if (tmpdx >= 1){tmpdx=5+easy}
 tmpdy=dy+sdy;if (tmpdy >= 1){tmpdy=5+easy}
 x=x+tmpix-tmpdx
 y=y+tmpiy-tmpdy
 if (x >= 368){x=368}
 if (x <=   0){x=  0}
 if (y <=   0){y=  0}
 if (y >= 258){

  mycr.visibility=hidden
  doc2c.visibility=hidden
  docc.visibility=visible
  spmov(cname,x,y)
  endflg=1;efx=-100;cflag=cflag+1;if (cflag >= 2){cflag=0}
 }
  for (tmp2=0; tmp2<10; tmp2++){
   if (x >= ex-20){
    if (x <= ex+20){
     if (y >= ey-20){
      if (y <= ey+10){
       mycr.visibility=hidden
       doc2c.visibility=hidden
       docc.visibility=visible
       spmov(cname,x,y)
       endflg=1;efx=-100;cflag=cflag+1;if (cflag >= 2){cflag=0}
      }
     }
    }
   }
  }
 spmov(0,x,y)

 //score show
 with (math) {
  s5=floor(score/10000)
  s4=floor((score-s5*10000)/1000)
  s3=floor((score-s5*10000-s4*1000)/100)
  s2=floor((score-s5*10000-s4*1000-s3*100)/10)
  s1=score-s5*10000-s4*1000-s3*100-s2*10
 }
 l7c.top=-16*s5
 l8c.top=-16*s4
 l9c.top=-16*s3
 l10c.top=-16*s2
 l11c.top=-16*s1

 // -------- timer set ----------
 if (endflg != 1){timerid = settimeout(interval1(),int)
 }else{
  if (systm!=c){
  }else{
  }
  if (hscore <= score){
   document.cookie=jsfalcon=+score+; expires=fri. 31-dec-1999 23:59:59 gmt
   hscore=score
   loadscore()
  }
 }
}


// ---------------------------
// ====== sub functions ======
// ---------------------------

// ----------- on load ----------
function onld(){
  if (systm!=c){
   w1c=document.layers
   mycr=w1c.layers
   cla0=w1c.layers
   cla1=w1c.layers
   cla2=w1c.layers
   gnds=w1c.layers
   docc=w1c.layers
   doc2c=w1c.layers
   eas=w1c.layers
   bos0=w1c.layers
   bos1=w1c.layers
   bosr=w1c.layers
   l2c=document.layers<2>
   l3c=document.layers<3>
   l4c=document.layers<4>
   l5c=document.layers<5>
   l6c=document.layers<6>
   l7c=document.layers<8>
   l8c=document.layers<9>
   l9c=document.layers<10>
   l10c=document.layers<11>
   l11c=document.layers<12>
  }else{
   w1c=document.all.w1.style
   mycr=document.all.w1.document.all.mychr.style
   cla0=document.all.w1.document.all.clash.style
   cla1=document.all.w1.document.all.clash1.style
   cla2=document.all.w1.document.all.clash2.style
   gnds=document.all.w1.document.all.gnd.style
   docc=document.all.w1.document.all.doc.style
   doc2c=document.all.w1.document.all.doc2.style
   eas=document.all.w1.document.all.easy.style
   bos0=document.all.w1.document.all.boss0.style
   bos1=document.all.w1.document.all.boss1.style
   bosr=document.all.w1.document.all.bossr.style
   l2c=l2i.style
   l3c=l3i.style
   l4c=l4i.style
   l5c=l5i.style
   l6c=l6i.style
   l7c=l7i.style
   l8c=l8i.style
   l9c=l9i.style
   l10c=l10i.style
   l11c=l11i.style
  w1c.clip=rect(118,400,418,0)
  }


 loadscore()
 sf=1
 quitplay()
}

// ---------- easy mode ---------
function easy(){
 easy=1
 eas.visibility=visible
}

// ---------- normal mode ---------
function normal(){
 easy=0
 eas.visibility=hidden
}

// ---------- boss mode ---------
function bossmode(){
  if (bossflg == 1){
   bossx=bossx-10
   if (bossx==250){
    bossflg=3
    if (flimit != 0){emx=bossx+30;emy=218;mcount=0}
    evx<0>=-5;evy<0>=-5
    evx<1>=-6;evy<1>=-4
    evx<2>=-4;evy<2>=-6
    evx<3>=-2;evy<3>=-7
    evx<8>=-7;evy<8>=-7
    efx<0>=bossx+101;efy<0>=225
    efx<1>=bossx+98;efy<1>=229
    efx<2>=bossx+104;efy<2>=222
    efx<3>=bossx+109;efy<3>=222
    efx<8>=bossx+7;efy<8>=232

   }
   if (bossx==0){bossflg=2}
  }
  if (bossflg == 2){
   bossx=bossx+10
   if (bossx==150){
    bossflg=6
    evx<4>=-5;evy<4>=-5
    evx<5>=-6;evy<5>=-4
    evx<6>=-4;evy<6>=-6
    evx<7>=-2;evy<7>=-7
    evx<8>=-7;evy<8>=-7
    efx<4>=bossx+101;efy<4>=225
    efx<5>=bossx+98;efy<5>=229
    efx<6>=bossx+104;efy<6>=222
    efx<7>=bossx+109;efy<7>=222
    efx<8>=bossx+7;efy<8>=232
   }
   if (bossx==270){bossflg=1}
  }
  bos0.left=bossx

  if (bossflg == 3){
   bossh=bossh-5
   if (bossh == 170){bossflg=4;canonc=0}
  }
  if (bossflg == 4){
   if (canonc==0){canonx=bossx+55;canony=195;canonc=1}else{
                  canonc=canonc+1;if (canonc==10){bossflg=5}
                  }
  }
  if (bossflg == 5){
   bossh=bossh+5
   if (bossh == 220){bossflg=1}
  }
  if (bossflg == 6){
   bossh=bossh-5
   if (bossh == 170){bossflg=7;canonc=0}
  }
  if (bossflg == 7){
   if (canonc==0){canonx=bossx+55;canony=195;canonc=1}else{
                  canonc=canonc+1;if (canonc==10){bossflg=8}
                  }
  }
  if (bossflg == 8){
   bossh=bossh+5
   if (bossh == 220){bossflg=2}
  }
  if (bossh == 220){tmpbhx=-200}else{tmpbhx=bossx+30}
  canonx=canonx-25;canony=canony-25
  spmov(15,tmpbhx,bossh)
  spmov(14,canonx,canony)
  fmax=flimit;efmove()

   //boss check1
  for (tmp2=0; tmp2<10; tmp2++){
   if (x >= bossx-20){
    if (x <= bossx+124){
     if (y >= 188){
       mycr.visibility=hidden
       doc2c.visibility=hidden
       docc.visibility=visible
       spmov(cname,x,y)
       endflg=1;cflag=cflag+1;if (cflag >= 2){cflag=0}
     }
    }
   }
  }

   //boss check2
  for (tmp2=0; tmp2<10; tmp2++){
   if (x >= bossx+20){
    if (x <= bossx+105){
     if (y >= bossh-16){
       mycr.visibility=hidden
       doc2c.visibility=hidden
       docc.visibility=visible
       spmov(cname,x,y)
       endflg=1;cflag=cflag+1;if (cflag >= 2){cflag=0}
     }
    }
   }
  }

  cchkflg=0
   //canon check1
   if (x >= canonx-16){
    if (x <= canonx+16){
     if (y >= canony-16){
      if (y <= canony+16){
       cchkflg=1
      }
     }
    }
   }

   //canon check2
   if (x >= canonx){
    if (x <= canonx+34){
     if (y >= canony){
      if (y <= canony+34){
       cchkflg=1
      }
     }
    }
   }

  if (cchkflg == 1){
   mycr.visibility=hidden
   doc2c.visibility=hidden
   docc.visibility=visible
   spmov(cname,x,y)
   endflg=1;cflag=cflag+1;if (cflag >= 2){cflag=0}
  }

  //my fire clear
  spmov(47,-100,-100)
  for (tmp1=0; tmp1<13; tmp1++){
   if (fx >= bossx-8){
    if (fx <= bossx+128){
     if (fy >= 216){
       fx=500
       spmov(47,bossx,fy)
     }
    }
   }
  }
  for (tmp1=0; tmp1<13; tmp1++){
   if (fx >= bossx+38){
    if (fx <= bossx+70){
     if (fy >= bossh-4){
      if (fy < 216){
       fx=500
       spmov(47,bossx+38,fy)
      }
     }
    }
   }
  }

   //bomb check
 tmpbmx=-100
  if (bx >= bossx-30){
   if (bx <= bossx+144){
    if (by >= 216){
     tmpbmx=bx-8;tmpbmy=by-4
    }
   }
  }
  if (bx >= bossx+2){
   if (bx <= bossx+94){
    if (by >= bossh-4){
     tmpbmx=bx-8;tmpbmy=by-4
    }
   }
  }

  if (by >= 284){tmpbmx=bx-8;tmpbmy=244}
  if (tmpbmx != -100){
   spmov(45+bflag,-100,-100)
   spmov(50,tmpbmx,tmpbmy)
   bflag=0;ccount2=0;bc=0;by=-100;bdx=0;bdy=0
   if (bossh != 220){
    if (tmpbmx >= bossx+25){
     if (tmpbmx <= bossx+108){
      if (tmpbmy <= bossh+22){
       if (tmpbmy <= 219){
        doc2c.visibility=visible
        bos1.left=-200
        spmov(16,tmpbhx,bossh)
        endflg=1;score=score+flimit*1000
       }
      }
     }
    }
   }
  }


}

// ---------- quit -------------
function quitplay(){
 focus()
 endflg=1
 doc2c.visibility=hidden
 docc.visibility=visible
 cleartimeout(timerid)
 }


// ----------- restart ---------
function restart(){
 docc.visibility=hidden
 doc2c.visibility=hidden
 for (tmp1=0; tmp1<50; tmp1++){spleft(tmp1,-200)}
 for (tmp1=0; tmp1<10; tmp1++){ex=0;ey=0}
 if (systm!=c){
 }else{
 }
 timecounter = 0
 score=0
 cname<0>=48
 cname<1>=49
 cname<2>=50
 cflag=0
 bossflg=bosstm
 bossx=400
 bossh=220
 blimit=bosslm
 canonx=-200
 canony=-200
 canonc=0
 x=100
 y=100
 dx=0
 dy=0
 ix=0
 iy=0
 sdx=0
 sdy=0
 six=0
 siy=0
 endflg=0
 ff=0
 fc=0
 ccount0=0
 ccount1=0
 ccount2=0
  for (tmp1=0; tmp1<13; tmp1++){fx=0;fy=-100}
 bf=0
 bc=0
 bx=0
 by=-100
 bdx=0
 bdy=0
 bflag=0
 gnd=0
 mvx=0
 mvy=0
 mcount=100
 fmax = 3
  for (tmp1=0; tmp1<9; tmp1++){efx=-100;efy=-100
  spmov(tmp1+18,efx,efy)
  }
 tmpe0 = 0
  for (tmp1=0; tmp1<3; tmp1++){
    with (math) {ex = 460 + floor(random()*200)}
    with (math) {ey = floor(random()*12)*20+20}
  }
   ex<3>=400;ex<4>=440;ex<5>=520
   ey<3>=100;ey<4>=60 ;ey<5>=200
   ch<0>=2  ;ch<1>=-2 ;ch<2>=-2
   cw<0>=4  ;cw<1>=2 ;cw<2>=2
  for (tmp1=0; tmp1<3; tmp1++){
   spmov(tmp1+30,ex,ey)
  }

   ex<6>=400;ex<7>=496;ex<8>=530;ex<9>=500
  for (tmp1=0; tmp1<4; tmp1++){
   ey<6+tmp1>=260
   spmov(tmp1+33,ex,ey)
  }

 spmov(45,-100,-100)
 spmov(46,-100,-100)
 mycr.visibility=visible
 if (bosstm != 0){for (tmp1=0; tmp1<10; tmp1++){ex=-100;blimit=5}}
 timerid = settimeout(interval1(),int)
}

// --------- enemy missile  layer no 37 to 44 -----------
function emiss(){
 mcount=mcount+1
 if (mcount == 50){
  spleft(37+ptn,-100)
  spmov(cname,emx-4,emy-4)
  if (cflag == 0){ccount0=0}else{ccount1=0}
  cflag=cflag+1;if (cflag >= 2){cflag=0}
    if (x >= emx-28){
     if (x <= emx+24){
      if (y >= emy-28){
       if (y <= emy+24){
        mycr.visibility=hidden
        doc2c.visibility=hidden
        docc.visibility=visible
        spmov(cname,x,y)
        endflg=1;efx=-100;cflag=cflag+1;if (cflag >= 2){cflag=0}
       }
      }
     }
    }
 }
 if (mcount < 50){
 tmpemx=x-emx;tmpemy=emy-y
 tmpptn=ptn
 if (tmpemx == 0){tmpemx=1}
 if (tmpemy == 0){tmpemy=1}
 tmptx=tmpemy/tmpemx
 if (tmpemx > 0){
  if (tmptx > 2.4142){ptn=2;mvx=mvx/1.4;mvy=mvy+0.7}else{
   if (tmptx > 0.4142){ptn=3;mvx=mvx+0.5;mvy=mvy+0.5}else{
    if (tmptx > -0.4142){ptn=4;mvx=mvx+0.7;mvy=mvy/1.4}else{
     if (tmptx > -2.4142){ptn=5;mvx=mvx+0.5;mvy=mvy-0.5}else{
      ptn=6;mvx=mvx/1.4;mvy=mvy-0.7
     }
    }
   }
  }
 }else{
  if (-tmptx > 2.4142){ptn=2;mvx=mvx/1.4;mvy=mvy+0.7}else{
   if (-tmptx > 0.4142){ptn=1;mvx=mvx-0.5;mvy=mvy+0.5}else{
    if (-tmptx > -0.4142){ptn=0;mvx=mvx-0.7;mvy=mvy/1.4}else{
     if (-tmptx > -2.4142){ptn=7;mvx=mvx-0.5;mvy=mvy-0.5}else{
      ptn=6;mvx=mvx/1.4;mvy=mvy-0.7
     }
    }
   }
  }
 }
 if (mcount <= 5){ptn=1;mvx=mvx-0.5;mvy=mvy+0.5}
 if (mvx >= 5){mvx=5}
 if (mvy >= 5){mvy=5}
 if (mvx <=-5){mvx=-5}
 if (mvy <=-5){mvy=-5}
 emx=emx+mvx-1;emy=emy-mvy
 spleft(37+tmpptn,-100)
 spmov(37+ptn,emx,emy)
    if (x >= emx-24){
     if (x <= emx+20){
      if (y >= emy-24){
       if (y <= emy+20){
        spleft(37+ptn,-100)
        spmov(cname,emx-4,emy-4)
        cflag=cflag+1;if (cflag >= 2){cflag=0}
        mycr.visibility=hidden
        doc2c.visibility=hidden
        docc.visibility=visible
        spmov(cname,x,y)
        cflag=cflag+1;if (cflag >= 2){cflag=0}
        endflg=1;efx=-100
       }
      }
     }
    }
 }
}

 // --------- enemy fire move     layer no =17 to 25 -------------
function efmove(){
 for (tmp1=0; tmp1<fmax; tmp1++){
  if (efx != -100){
   efx=efx+evx;efy=efy+evy
    if (efx < -16){efx=-100;evx=0;evy=0}
    if (efx > 400){efx=-100;evx=0;evy=0}
    if (efy < -16){efx=-100;evx=0;evy=0}
    if (efy > 300){efx=-100;evx=0;evy=0}
  }
   if (efx >= x-4){
    if (efx <= x+26){
     if (efy >= y+8){
      if (efy <= y+24){
       mycr.visibility=hidden
       doc2c.visibility=hidden
       docc.visibility=visible
       spmov(cname,x,y)
       endflg=1;efx=-100;cflag=cflag+1;if (cflag >= 2){cflag=0}
      }
     }
    }
   }
  spmov(tmp1+18,efx,efy)
 }
}

// --------- enemy fire   layer no =17 to 25 -----------
function efire(epx,epy){
 if (bossflg == 0){
 tmpe0=tmpe0+1;if (tmpe0 >= 9){tmpe0=0}
 if (efx == -100){
  efx=epx;efy=epy
  tmpex=x-epx;tmpey=y-epy
  with (math) {
   tmper=sqrt(tmpex*tmpex+tmpey*tmpey)
   if (tmper == 0){tmper=1}
   evx=floor((tmpex/tmper)*7);evy=floor((tmpey/tmper)*7)
  }
 }
 }
}


// ------ high score show ------
function loadscore(){
 if (document.cookie){
  falcontop = document.cookie.indexof(jsfalcon, 0)
  if (falcontop != -1){
   tscore = document.cookie.substring(falcontop+9,falcontop+14)
  }else{tscore=0}
 }else{tscore=0}
 with (math) {
  hscore=parseint(tscore,10)
  h5=floor(hscore/10000)
  h4=floor((hscore-h5*10000)/1000)
  h3=floor((hscore-h5*10000-h4*1000)/100)
  h2=floor((hscore-h5*10000-h4*1000-h3*100)/10)
  h1=hscore-h5*10000-h4*1000-h3*100-h2*10
 }
 l2c.top=-16*h5
 l3c.top=-16*h4
 l4c.top=-16*h3
 l5c.top=-16*h2
 l6c.top=-16*h1
}


// ------ key down ------
function keydown(dnevents){
 if (systm != c){
  k=dnevents.which
 }else{
  k=window.event.keycode
 }
  if (k == 50){iy=1}                    //2
  if (k == 56){dy=1}                    //8
  if (k == 54){ix=1}                    //6
  if (k == 52){dx=1}                    //4

  if (k == 98 ){iy=1}                   //2
  if (k == 104){dy=1}                   //8
  if (k == 102){ix=1}                   //6
  if (k == 100){dx=1}                   //4

  if (k == 75){iy=1}                    //k
  if (k == 73){dy=1}                    //i
  if (k == 76){ix=1}                    //l
  if (k == 74){dx=1}                    //j

  if (k == 107){iy=1}                   //k
  if (k == 105){dy=1}                   //i
  if (k == 108){ix=1}                   //l
  if (k == 106){dx=1}                   //j

  if (k == 49){sdx=1;siy=1}             //1
  if (k == 51){six=1;siy=1}             //3
  if (k == 55){sdx=1;sdy=1}             //7
  if (k == 57){six=1;sdy=1}             //9

  if (k == 32){ff=1}                    //spc
  if (k == 90){ff=1}                    //z
  if (k == 122){ff=1}                   //z
  if (k == 0){ff=1}                     //shift ctrl caps etc..

  if (k == 48){if (bc == 0){bf=1}}      //0
  if (k == 96){if (bc == 0){bf=1}}      //0

  if (k == 13){if (bc == 0){bf=1}}      //enter
  if (k == 88){if (bc == 0){bf=1}}      //x
  if (k == 120){if (bc == 0){bf=1}}     //x
  if (k == 83){if (endflg == 1){if (sf == 1){restart()}}}           //s
  if (k == 115){if (endflg == 1){if (sf == 1){restart()}}}          //s
  if (k == 69){if (endflg == 1){flimit=3;easy()}}     //e
  if (k == 101){if (endflg == 1){flimit=3;easy()}}    //e
  if (k == 78){if (endflg == 1){flimit=9;normal()}}   //n
  if (k == 110){if (endflg == 1){flimit=9;normal()}}  //n
  if (k == 81){quitplay()}              //q
  if (k == 113){quitplay()}             //q

}

// ------- key up --------
function keyup(upevents){
 if (systm != c){
  k=upevents.which
 }else{
  k=window.event.keycode
 }
  if (k == 50){iy=0}
  if (k == 56){dy=0}
  if (k == 54){ix=0}
  if (k == 52){dx=0}

  if (k == 98 ){iy=0}                   //2
  if (k == 104){dy=0}                   //8
  if (k == 102){ix=0}                   //6
  if (k == 100){dx=0}                   //4

  if (k == 75){iy=0}                    //k
  if (k == 73){dy=0}                    //i
  if (k == 76){ix=0}                    //l
  if (k == 74){dx=0}                    //j

  if (k == 107){iy=0}                   //k
  if (k == 105){dy=0}                   //i
  if (k == 108){ix=0}                   //l
  if (k == 106){dx=0}                   //j


  if (k == 49){sdx=0;siy=0}
  if (k == 51){six=0;siy=0}
  if (k == 55){sdx=0;sdy=0}
  if (k == 57){six=0;sdy=0}

}

// -------- layer setup ----------
function spini(spname,spx,spy,spw,sph,spimg){
  if (systm!=c){
   document.layers.document.write(<layer name='+spname+' left=+spx+ top=+spy+><img width=+spw+ height=+sph+ src='+spimg+'></layer>)
  }else{
   with (document) {
    write(<img id=+spname+ width=+spw+ height=+sph+ src='+spimg+' style='position:absolute'>)
    images.style.posleft = spx
    images.style.postop =  spy
   }
  }
spcount=spcount+1
}

// ------- layer move -------------
function spmov(spno,spx,spy){
 if (systm!=c){
  w1c.layers.moveto(spx,spy)
 }else{
  document.images.style.posleft = spx
  document.images.style.postop =  spy
 }
}

// ------- layer left -------------
function spleft(spno,spx){
 if (systm!=c){
  w1c.layers.left=spx
 }else{
  document.images.style.posleft = spx
 }
}


// ------- key event init --------
 document.onkeydown = keydown
 document.onkeyup = keyup
 if (systm!=c){
  document.captureevents(event.keydown|event.keyup)
 }

//-->
</script>
</head>


<body bgcolor=#00003f text=#ffffff onload=onld()>
<div id=bg></div>


<div style='position:absolute; left:16; top:0'><img width=50 height=16 src=highc.gif></div>
<div style='position:absolute; left:60; top:0'><img width=50 height=16 src=score.gif></div>
<div id=l2i style='position:absolute; left:120; top:0'>
<img width=16 height=160 src=number.gif></div>
<div id=l3i style='position:absolute; left:130; top:0'>
<img width=16 height=160 src=number.gif></div>
<div id=l4i style='position:absolute; left:140; top:0'>
<img width=16 height=160 src=number.gif></div>
<div id=l5i style='position:absolute; left:150; top:0'>
<img width=16 height=160 src=number.gif></div>
<div id=l6i style='position:absolute; left:160; top:0'>
<img width=16 height=160 src=number.gif></div>

<div style='position:absolute; left:290; top:0'><img width=50 height=16 src=score.gif></div>
<div id=l7i style='position:absolute; left:350; top:0'>
<img width=16 height=160 src=number.gif></div>
<div id=l8i style='position:absolute; left:360; top:0'>
<img width=16 height=160 src=number.gif></div>
<div id=l9i style='position:absolute; left:370; top:0'>
<img width=16 height=160 src=number.gif></div>
<div id=l10i style='position:absolute; left:380; top:0'>
<img width=16 height=160 src=number.gif></div>
<div id=l11i style='position:absolute; left:390; top:0'>
<img width=16 height=160 src=number.gif></div>
<div style='position:absolute; left:16; top:16'>
<img width=400 height=300 src=skybg.gif>
</div>


<div id=titl style='position:absolute; left:424; top:16'>
<pre>
<font color=#ffff00 size=+2><b>js falcon</b></font>

 

 

   <a href=javascript:history.back()>back</a>
</pre>
</div>


<div id=keys style='position:absolute; left:16; top:320'><pre><font size=-1>move..2,4,6,8 or k,j,l,i  /  fire..space or z  /  bomb..0 or x</font></pre></div>


<div id=w1 style='position:absolute; left:16; top:16; clip:rect(0,400,300,0)'>
<script language=javascript>
<!--
  spini(mychr,100,100,32,32,f16c.gif)

  spini(myf01,-100,0,32,8,fire0c.gif)
  spini(myf02,-100,0,32,8,fire0c.gif)
  spini(myf03,-100,0,32,8,fire0c.gif)
  spini(myf04,-100,0,32,8,fire0c.gif)
  spini(myf05,-100,0,32,8,fire0c.gif)
  spini(myf06,-100,0,32,8,fire0c.gif)
  spini(myf07,-100,0,32,8,fire0c.gif)
  spini(myf08,-100,0,32,8,fire0c.gif)
  spini(myf09,-100,0,32,8,fire0c.gif)
  spini(myf10,-100,0,32,8,fire0c.gif)
  spini(myf11,-100,0,32,8,fire0c.gif)
  spini(myf12,-100,0,32,8,fire0c.gif)
  spini(myf13,-100,0,32,8,fire0c.gif)

  spini(boss2,-180,120,50,50,boss2c.gif)
  spini(boss1,-230,170,80,50,boss1c.gif)
  spini(bossr,-230,170,80,50,boss1rc.gif)
  spini(boss0,-200,220,128,64,boss0c.gif)

  spini(enf1,-100,0,8,8,fire1c.gif)
  spini(enf2,-100,0,8,8,fire1c.gif)
  spini(enf3,-100,0,8,8,fire1c.gif)
  spini(enf4,-100,0,8,8,fire1c.gif)
  spini(enf5,-100,0,8,8,fire1c.gif)
  spini(enf6,-100,0,8,8,fire1c.gif)
  spini(enf7,-100,0,8,8,fire1c.gif)
  spini(enf8,-100,0,8,8,fire1c.gif)
  spini(enf9,-100,0,8,8,fire1c.gif)

  spini(m231,-100,0,32,19,m23c.gif)
  spini(m232,-100,0,32,19,m23c.gif)
  spini(m233,-100,0,32,19,m23c.gif)

  spini(cob1,-100,0,32,19,cobrac.gif)
  spini(cob2,-100,0,32,19,cobrac.gif)
  spini(cob3,-100,0,32,19,cobrac.gif)

  spini(shi1,-100,0,32,24,shilkac.gif)
  spini(shi2,-100,0,32,24,shilkac.gif)
  spini(shi3,-100,0,32,24,shilkac.gif)

  spini(sa81,-100,0,32,24,sa8c.gif)

  spini(msl0,-100,0,24,24,msl0c.gif)
  spini(msl1,-100,0,24,24,msl1c.gif)
  spini(msl2,-100,0,24,24,msl2c.gif)
  spini(msl3,-100,0,24,24,msl3c.gif)
  spini(msl4,-100,0,24,24,msl4c.gif)
  spini(msl5,-100,0,24,24,msl5c.gif)
  spini(msl6,-100,0,24,24,msl6c.gif)
  spini(msl7,-100,0,24,24,msl7c.gif)

  spini(bom0,-100,0,32,8,bom0c.gif)
  spini(bom1,-100,0,32,8,bom1c.gif)
  spini(miss,-100,0,16,16,clashc.gif)

  spini(clash,-100,0,32,32,clashc.gif)
  spini(clash1,-100,0,32,32,clashc.gif)
  spini(clash2,-100,0,64,64,clash2c.gif)


//-->
</script>


  <div id=gnd style='position:absolute; left:0; top:284'><img height=16 width=16 src=block.gif><img height=16 width=16 src=block.gif><img height=16 width=16 src=block.gif><img height=16 width=16 src=block.gif><img height=16 width=16 src=block.gif><img height=16 width=16 src=block.gif><img height=16 width=16 src=block.gif><img height=16 width=16 src=block.gif><img height=16 width=16 src=block.gif><img height=16 width=16 src=block.gif><img height=16 width=16 src=block.gif><img height=16 width=16 src=block.gif><img height=16 width=16 src=block.gif><img height=16 width=16 src=block.gif><img height=16 width=16 src=block.gif><img height=16 width=16 src=block.gif><img height=16 width=16 src=block.gif><img height=16 width=16 src=block.gif><img height=16 width=16 src=block.gif><img height=16 width=16 src=block.gif><img height=16 width=16 src=block.gif><img height=16 width=16 src=block.gif><img height=16 width=16 src=block.gif><img height=16 width=16 src=block.gif><img height=16 width=16 src=block.gif><img height=16 width=16 src=block.gif></div>

 <div id=doc style='position:absolute; left:0; top:150; visibility: hidden'>
 <pre>
  full <font color=#0000ff>keyboard</font> operation
     start/restart..<font color=#ff0000>hit <b>s</b> key!</font>
     <font size=-1>( easy mode ..e  / normal mode ..n )</font>
 </pre>
 </div>

 <div id=doc2 style='position:absolute; left:0; top:150; visibility: hidden'>
 <pre>
  <font color=#0000ff size=+1><b>mission complete</b></font>
     do you play again? ..<font color=#ff0000>hit <b>s</b> key!</font>
     <font size=-1>( easy mode ..e  / normal mode ..n )</font>
 </pre>
 </div>
 <div id=easy style='position:absolute; left:2; top:2; visibility: hidden'>
  <font color=#ff0000 size=-1>easy mode</font>
 </div>
</div>

</body>
</html>
</t

 
返回列表 返回JavaScript
 
  推荐文章
 
     暂无
 
 
  随机资讯
 
     暂无