"; } //SHOT POWER VALUES var fireballPOWER=10; var uppercutPOWER=10; var GIGPOWER=4; var MEGPOWER=2; var POWERMAX=150; //SHOT DECTION RANGES var Xrange1=5; var Xrange2=25; var Yrange1=7; var Yrange2=30; var behaviorTIME=0; var behavior=1; var BGflop=true; var phauxFIREkey=false; var WHICHGUY=true; var SIMgravity=4; var FADE=1; var TIME=0.01; var fireTIME=0; var FBSWITCH=false; var explodeOK=false; var explodeGUY=0; var XexplodeLOCATION; var YexplodeLOCATION; var explodeAni=1; var explodeTIME=0; var runID=null; gamefield=new Object; gamefield.left=30; gamefield.right=355; gamefield.top=0; gamefield.bottom=224; gamefield.floor=187; gamefield.jumpmax=165; gamefield.jumpvelocity=-20; MEGAMANdata=new Object; GIGAMANdata=new Object; MEGAMANdata.uppercutOK=false; GIGAMANdata.uppercutOK=false; MEGAMANdata.UPkey=false; MEGAMANdata.DOWNkey=false; MEGAMANdata.SPACEkey=false; MEGAMANdata.LEFTkey=false; MEGAMANdata.RIGHTkey=false; MEGAMANdata.FIREkey=false; MEGAMANdata.RUNkey=false; MEGAMANdata.ObjectVelocity=0; MEGAMANdata.inAIR=false; MEGAMANdata.reachedJUMPmax=false; MEGAMANdata.runSPEED=1; MEGAMANdata.POSITION=1; MEGAMANdata.FACINGright=true; MEGAMANdata.shotNUM=1; MEGAMANdata.FIREcycle=true; MEGAMANdata.FIREkey2=false; MEGAMANdata.uppercutLEFTMOVE=false; MEGAMANdata.FIREballLEFTMOVE=1; MEGAMANdata.FIREballRIGHTMOVE=1; MEGAMANdata.FIREballFIRE=false; MEGAMANdata.hits=0; MEGAMANdata.DAMAGEtime=0; MEGAMANdata.DAMAGEposeNUM=1; MEGAMANdata.INVINCEtime=10; GIGAMANdata.UPkey=false; GIGAMANdata.DOWNkey=false; GIGAMANdata.SPACEkey=false; GIGAMANdata.LEFTkey=false; GIGAMANdata.RIGHTkey=false; GIGAMANdata.FIREkey=false; GIGAMANdata.ObjectVelocity=0; GIGAMANdata.inAIR=false; GIGAMANdata.reachedJUMPmax=false; GIGAMANdata.runSPEED=1; GIGAMANdata.POSITION=1; GIGAMANdata.FACINGright=true; GIGAMANdata.shotNUM=1; GIGAMANdata.FIREcycle=true; GIGAMANdata.hits=0; GIGAMANdata.JUMPtime=0; GIGAMANdata.DIRECTION=true; GIGAMANdata.DAMAGEtime=0; GIGAMANdata.DAMAGEposeNUM=1; GIGAMANdata.INVINCEtime=10; MEGAMANdata.EXPLODE=new Array(); MEGAMANdata.LEFTpose=new Array(); MEGAMANdata.RIGHTpose=new Array(); MEGAMANdata.JUMPpose=new Array(); MEGAMANdata.STANDpose=new Array(); MEGAMANdata.FIREpose=new Array(); MEGAMANdata.FIREBALLpose=new Array(); MEGAMANdata.DAMAGEpose=new Array(); MEGAMANdata.FIREBALL=new Array(); MEGAMANdata.UPPERCUT=new Array(); MEGAMANdata.UPPERCUT[1]=new Image(); MEGAMANdata.UPPERCUT[2]=new Image(); MEGAMANdata.UPPERCUT[3]=new Image(); MEGAMANdata.UPPERCUT[4]=new Image(); MEGAMANdata.EXPLODE[1]=new Image(); MEGAMANdata.EXPLODE[2]=new Image(); MEGAMANdata.EXPLODE[3]=new Image(); MEGAMANdata.FIREBALL[1]=new Image(); MEGAMANdata.FIREBALL[2]=new Image(); MEGAMANdata.FIREBALL[3]=new Image(); MEGAMANdata.FIREBALL[4]=new Image(); MEGAMANdata.DAMAGEpose[1]=new Image(); MEGAMANdata.DAMAGEpose[2]=new Image(); MEGAMANdata.DAMAGEpose[3]=new Image(); MEGAMANdata.DAMAGEpose[4]=new Image(); MEGAMANdata.LEFTpose[1]=new Image(); MEGAMANdata.LEFTpose[2]=new Image(); MEGAMANdata.LEFTpose[3]=new Image(); MEGAMANdata.LEFTpose[4]=new Image(); MEGAMANdata.LEFTpose[5]=new Image(); MEGAMANdata.LEFTpose[6]=new Image(); MEGAMANdata.RIGHTpose[1]=new Image(); MEGAMANdata.RIGHTpose[2]=new Image(); MEGAMANdata.RIGHTpose[3]=new Image(); MEGAMANdata.RIGHTpose[4]=new Image(); MEGAMANdata.RIGHTpose[5]=new Image(); MEGAMANdata.RIGHTpose[6]=new Image(); MEGAMANdata.JUMPpose[1]=new Image(); MEGAMANdata.JUMPpose[2]=new Image(); MEGAMANdata.JUMPpose[3]=new Image(); MEGAMANdata.JUMPpose[4]=new Image(); MEGAMANdata.FIREpose[1]=new Image(); MEGAMANdata.FIREpose[2]=new Image(); MEGAMANdata.FIREpose[3]=new Image(); MEGAMANdata.FIREpose[4]=new Image(); MEGAMANdata.FIREBALLpose[1]=new Image(); MEGAMANdata.FIREBALLpose[2]=new Image(); MEGAMANdata.FIREBALLpose[3]=new Image(); MEGAMANdata.FIREBALLpose[4]=new Image(); MEGAMANdata.STANDpose[1]=new Image(); MEGAMANdata.STANDpose[2]=new Image(); MEGAMANdata.STANDpose[3]=new Image(); MEGAMANdata.UPPERCUT[1].src="ucr1.gif"; MEGAMANdata.UPPERCUT[2].src="ucr2.gif"; MEGAMANdata.UPPERCUT[3].src="ucl1.gif"; MEGAMANdata.UPPERCUT[4].src="ucl2.gif"; MEGAMANdata.FIREBALL[1].src="mmfb1.gif"; MEGAMANdata.FIREBALL[2].src="mmfb2.gif"; MEGAMANdata.FIREBALL[3].src="mmfb3.gif"; MEGAMANdata.FIREBALL[4].src="mmfb4.gif"; MEGAMANdata.DAMAGEpose[1].src="dl1.gif"; MEGAMANdata.DAMAGEpose[2].src="dl2.gif"; MEGAMANdata.DAMAGEpose[3].src="dr1.gif"; MEGAMANdata.DAMAGEpose[4].src="dr2.gif"; MEGAMANdata.EXPLODE[1].src="e1.gif"; MEGAMANdata.EXPLODE[2].src="e2.gif"; MEGAMANdata.EXPLODE[3].src="e3.gif"; MEGAMANdata.LEFTpose[1].src="l1.gif"; MEGAMANdata.LEFTpose[2].src="l2.gif"; MEGAMANdata.LEFTpose[3].src="l3.gif"; MEGAMANdata.LEFTpose[4].src="fl1.gif"; MEGAMANdata.LEFTpose[5].src="fl2.gif"; MEGAMANdata.LEFTpose[6].src="fl3.gif"; MEGAMANdata.RIGHTpose[1].src="r1.gif"; MEGAMANdata.RIGHTpose[2].src="r2.gif"; MEGAMANdata.RIGHTpose[3].src="r3.gif"; MEGAMANdata.RIGHTpose[4].src="fr1.gif"; MEGAMANdata.RIGHTpose[5].src="fr2.gif"; MEGAMANdata.RIGHTpose[6].src="fr3.gif"; MEGAMANdata.JUMPpose[1].src="j1.gif"; MEGAMANdata.JUMPpose[2].src="j2.gif"; MEGAMANdata.JUMPpose[3].src="j1.gif"; MEGAMANdata.JUMPpose[4].src="j1.gif"; MEGAMANdata.FIREpose[1].src="f1.gif"; MEGAMANdata.FIREpose[2].src="f2.gif"; MEGAMANdata.FIREpose[3].src="j3.gif"; MEGAMANdata.FIREpose[4].src="j4.gif"; MEGAMANdata.FIREBALLpose[1].src="fb1.gif"; MEGAMANdata.FIREBALLpose[2].src="fb2.gif"; MEGAMANdata.FIREBALLpose[3].src="fbj1.gif"; MEGAMANdata.FIREBALLpose[4].src="fbj2.gif"; MEGAMANdata.STANDpose[1].src="s1.gif"; MEGAMANdata.STANDpose[2].src="s2.gif"; MEGAMANdata.STANDpose[3].src="v.gif"; function START() { document.all.MESSAGE.innerHTML="READY!"; document.all.MUSIC.innerHTML=""; screen.updateInterval=10; runID=setInterval("RUN();",10); } function explodeSCENE() { document.all.EXPLODE1.src=MEGAMANdata.EXPLODE[explodeAni].src; document.all.EXPLODE2.src=MEGAMANdata.EXPLODE[explodeAni].src; document.all.EXPLODE3.src=MEGAMANdata.EXPLODE[explodeAni].src; document.all.EXPLODE4.src=MEGAMANdata.EXPLODE[explodeAni].src; document.all.EXPLODE5.src=MEGAMANdata.EXPLODE[explodeAni].src; document.all.EXPLODE6.src=MEGAMANdata.EXPLODE[explodeAni].src; document.all.EXPLODE7.src=MEGAMANdata.EXPLODE[explodeAni].src; document.all.EXPLODE8.src=MEGAMANdata.EXPLODE[explodeAni].src; document.all.EXPLODE2.style.left=parseInt(document.all.EXPLODE2.style.left)+4; document.all.EXPLODE3.style.left=parseInt(document.all.EXPLODE3.style.left)+6; document.all.EXPLODE4.style.left=parseInt(document.all.EXPLODE4.style.left)+4; document.all.EXPLODE6.style.left=parseInt(document.all.EXPLODE6.style.left)-4; document.all.EXPLODE7.style.left=parseInt(document.all.EXPLODE7.style.left)-6; document.all.EXPLODE8.style.left=parseInt(document.all.EXPLODE8.style.left)-4; document.all.EXPLODE1.style.top=parseInt(document.all.EXPLODE1.style.top)-6; document.all.EXPLODE2.style.top=parseInt(document.all.EXPLODE2.style.top)-4; document.all.EXPLODE4.style.top=parseInt(document.all.EXPLODE4.style.top)+4; document.all.EXPLODE5.style.top=parseInt(document.all.EXPLODE5.style.top)+6; document.all.EXPLODE6.style.top=parseInt(document.all.EXPLODE6.style.top)+4; document.all.EXPLODE8.style.top=parseInt(document.all.EXPLODE8.style.top)-4; gravity(document.all.MEGAMAN,MEGAMANdata); gravity(document.all.GIGAMAN,GIGAMANdata); explodeAni++; if (explodeAni==4) explodeAni=1; } function RUN() { if (FADEPLAY AGAIN?
CLICK HERE!"; document.all.GIGAMAN.src=MEGAMANdata.STANDpose[3].src; } if (explodeGUY==2) { document.all.MESSAGE.innerHTML="MEGAMAN WINS

PLAY AGAIN?
CLICK HERE!
"; document.all.MEGAMAN.src=MEGAMANdata.STANDpose[3].src; } clearInterval(runID); } } else { if (MEGAMANdata.DAMAGEtime>0) damage(document.all.MEGAMAN, MEGAMANdata); else if (MEGAMANdata.uppercutOK) { doUPPERCUT2(); } else humanIntel(); if (GIGAMANdata.DAMAGEtime>0) damage(document.all.GIGAMAN, GIGAMANdata); else { //AritficalIntelligence(); if(!GIGAMANdata.inAIR&&!GIGAMANdata.FIREkey&&!GIGAMANdata.LEFTkey&&!GIGAMANdata.RIGHTkey) { if(GIGAMANdata.FACINGright) document.all.GIGAMAN.src=MEGAMANdata.STANDpose[1].src; else document.all.GIGAMAN.src=MEGAMANdata.STANDpose[2].src; } } flopScreen(); SHOTS(); if (GIGAMANdata.INVINCEtime==10) DetectHit(document.all.GIGAMAN,GIGAMANdata,document.all.BAR1,false); else { op2=GIGAMANdata.INVINCEtime*10; if (GIGAMANdata.INVINCEtime>1) document.all.GIGAMAN.style.filter="alpha(opacity="+op2+") gray()"; else document.all.GIGAMAN.style.filter="gray"; GIGAMANdata.INVINCEtime++; } if (MEGAMANdata.INVINCEtime==10) DetectHit(document.all.MEGAMAN,MEGAMANdata,document.all.BAR2,true); else { op=MEGAMANdata.INVINCEtime*10; if (MEGAMANdata.INVINCEtime>1) document.all.MEGAMAN.style.filter="alpha(opacity="+op+")"; else document.all.MEGAMAN.style.filter="none"; MEGAMANdata.INVINCEtime++; } gravity(document.all.MEGAMAN,MEGAMANdata); gravity(document.all.GIGAMAN,GIGAMANdata); } } function doUPPERCUT1(whichObject,WHICHdata) { MEGAMANdata.uppercutOK=true; if(parseInt(whichObject.style.top) gamefield.left) &&(parseInt(document.all.MEGAMAN.style.left)+34POWERMAX) { document.all.MESSAGE.innerHTML=""; FADE=POWERMAX; } document.all.BAR2.width=FADE; document.all.BAR1.width=FADE; } function randomNumber(maxnumber) { var generatornum=Math.random(); var randomnum=Math.round(generatornum*maxnumber); return(randomnum); } function routeKey(keycodE,down) { if(keycodE==38) MEGAMANdata.UPkey=down; if(keycodE==40) MEGAMANdata.DOWNkey=down; if(keycodE==16) MEGAMANdata.RUNkey=down; if(keycodE==37) MEGAMANdata.LEFTkey=down; if(keycodE==39) MEGAMANdata.RIGHTkey=down; if(keycodE==90) MEGAMANdata.FIREkey2=down; if(keycodE==27 && !MEGAMANdata.inAIR) {doUPPERCUT1(document.all.MEGAMAN,MEGAMANdata)} if(keycodE==16) { if(!down) MEGAMANdata.FIREcycle=true; MEGAMANdata.FIREkey=down; } if(keycodE==87&&down) WHICHGUY=!WHICHGUY; } function detectuppercutLEFT() { //move1 if (MEGAMANdata.uppercutLEFTMOVE==1 && MEGAMANdata.LEFTkey && !MEGAMANdata.FIREkey2) { MEGAMANdata.uppercutLEFTMOVE=2; } //move2 if (MEGAMANdata.uppercutLEFTMOVE==2 && MEGAMANdata.LEFTkey && MEGAMANdata.DOWNkey) { MEGAMANdata.uppercutLEFTMOVE=3; } else if (MEGAMANdata.uppercutLEFTMOVE==2 && MEGAMANdata.LEFTkey) { } else if (MEGAMANdata.uppercutLEFTMOVE==2) { MEGAMANdata.uppercutLEFTMOVE=1; } //move 3 if (MEGAMANdata.uppercutLEFTMOVE==3 && MEGAMANdata.LEFTkey && !MEGAMANdata.DOWNkey) { alert(); MEGAMANdata.uppercutLEFTMOVE=4; } else if (MEGAMANdata.uppercutLEFTMOVE==3 && MEGAMANdata.DOWNkey && MEGAMANdata.LEFTkey) { MEGAMANdata.uppercutLEFTMOVE=3; } else if (MEGAMANdata.uppercutLEFTMOVE==3) { MEGAMANdata.uppercutLEFTMOVE=1; } //move 4 if ((MEGAMANdata.uppercutLEFTMOVE==4 && MEGAMANdata.LEFTkey && MEGAMANdata.FIREkey2 && !MEGAMANdata.DOWNkey && !MEGAMANdata.inAIR) || (MEGAMANdata.uppercutLEFTMOVE==4 && MEGAMANdata.FIREkey2 && !MEGAMANdata.inAIR)) { alert(); doUPPERCUT1(document.all.MEGAMAN,MEGAMANdata); MEGAMANdata.uppercutLEFTMOVE=1; return true; } else if (MEGAMANdata.uppercutLEFTMOVE==4 && MEGAMANdata.LEFTkey && !MEGAMANdata.DOWNkey) { MEGAMANdata.uppercutLEFTMOVE=4; return false; } else if (MEGAMANdata.uppercutLEFTMOVE==4) { MEGAMANdata.uppercutLEFTMOVE=1; return false; } return false; } function detectQuarterCircleLEFT() { if (MEGAMANdata.FIREballLEFTMOVE==1 && MEGAMANdata.DOWNkey && !MEGAMANdata.FIREkey2) { MEGAMANdata.FIREballLEFTMOVE=2; } if (MEGAMANdata.FIREballLEFTMOVE==2 && MEGAMANdata.DOWNkey && MEGAMANdata.LEFTkey) { MEGAMANdata.FIREballLEFTMOVE=3; } else if (MEGAMANdata.FIREballLEFTMOVE==2 && MEGAMANdata.DOWNkey) { } else if (MEGAMANdata.FIREballLEFTMOVE==2) { MEGAMANdata.FIREballLEFTMOVE=1; } if (MEGAMANdata.FIREballLEFTMOVE==3 && MEGAMANdata.LEFTkey && !MEGAMANdata.DOWNkey) { MEGAMANdata.FIREballLEFTMOVE=4; } else if (MEGAMANdata.FIREballLEFTMOVE==3 && MEGAMANdata.DOWNkey && MEGAMANdata.LEFTkey) { MEGAMANdata.FIREballLEFTMOVE=3; } else if (MEGAMANdata.FIREballLEFTMOVE==3) { MEGAMANdata.FIREballLEFTMOVE=1; } if ((MEGAMANdata.FIREballLEFTMOVE==4 && MEGAMANdata.LEFTkey && MEGAMANdata.FIREkey2 && !MEGAMANdata.DOWNkey) || (MEGAMANdata.FIREballLEFTMOVE==4 && MEGAMANdata.FIREkey2)) { strikeFIREBALLpose(document.all.MEGAMAN, MEGAMANdata); MEGAMANdata.FIREballLEFTMOVE=1; return true; } else if (MEGAMANdata.FIREballLEFTMOVE==4 && MEGAMANdata.LEFTkey && !MEGAMANdata.DOWNkey) { MEGAMANdata.FIREballLEFTMOVE=4; return false; } else if (MEGAMANdata.FIREballLEFTMOVE==4) { MEGAMANdata.FIREballLEFTMOVE=1; return false; } return false; } function detectQuarterCircleRIGHT() { if (MEGAMANdata.FIREballRIGHTMOVE==1 && MEGAMANdata.DOWNkey && !MEGAMANdata.FIREkey2) { MEGAMANdata.FIREballRIGHTMOVE=2; } if (MEGAMANdata.FIREballRIGHTMOVE==2 && MEGAMANdata.DOWNkey && MEGAMANdata.RIGHTkey) { MEGAMANdata.FIREballRIGHTMOVE=3; } else if (MEGAMANdata.FIREballRIGHTMOVE==2 && MEGAMANdata.DOWNkey) { } else if (MEGAMANdata.FIREballRIGHTMOVE==2) { MEGAMANdata.FIREballRIGHTMOVE=1; } if (MEGAMANdata.FIREballRIGHTMOVE==3 && MEGAMANdata.RIGHTkey && !MEGAMANdata.DOWNkey) { MEGAMANdata.FIREballRIGHTMOVE=4; } else if (MEGAMANdata.FIREballRIGHTMOVE==3 && MEGAMANdata.DOWNkey && MEGAMANdata.RIGHTkey) { MEGAMANdata.FIREballRIGHTMOVE=3; } else if (MEGAMANdata.FIREballRIGHTMOVE==3) { MEGAMANdata.FIREballRIGHTMOVE=1; } if ((MEGAMANdata.FIREballRIGHTMOVE==4 && MEGAMANdata.RIGHTkey && MEGAMANdata.FIREkey2 && !MEGAMANdata.DOWNkey) || (MEGAMANdata.FIREballRIGHTMOVE==4 && MEGAMANdata.FIREkey2)) { strikeFIREBALLpose(document.all.MEGAMAN, MEGAMANdata); MEGAMANdata.FIREballRIGHTMOVE=1; return true; } else if (MEGAMANdata.FIREballRIGHTMOVE==4 && MEGAMANdata.RIGHTkey && !MEGAMANdata.DOWNkey) { MEGAMANdata.FIREballRIGHTMOVE=4; return false; } else if (MEGAMANdata.FIREballRIGHTMOVE==4) { MEGAMANdata.FIREballRIGHTMOVE=1; return false; } return false; } function getCoord(coordString) { return coordString.substring(0 ,coordString.length-2); } function flopScreen() { if(BGflop) document.all.PAGE.style.background="#000000"; else document.all.PAGE.style.background="#000001"; BGflop=!BGflop; } function humanIntel() { detectuppercutLEFT(); if (detectQuarterCircleRIGHT(document.all.MEGAMAN, MEGAMANdata) || detectQuarterCircleLEFT(document.all.MEGAMAN, MEGAMANdata)) { strikeFIREBALLpose(document.all.MEGAMAN, MEGAMANdata); fireFIREBALL(document.all.FIREBALL, document.all.MEGAMAN, MEGAMANdata) fireTIME=4; } else if (fireTIME>0) { fireTIME--; } else { if(MEGAMANdata.LEFTkey&&!MEGAMANdata.RIGHTkey) { if(WHICHGUY) moveLEFT(document.all.MEGAMAN,MEGAMANdata); else moveLEFT(document.all.GIGAMAN,GIGAMANdata); } if(!MEGAMANdata.LEFTkey&&MEGAMANdata.RIGHTkey) { if(WHICHGUY) moveRIGHT(document.all.MEGAMAN,MEGAMANdata); else moveRIGHT(document.all.GIGAMAN,GIGAMANdata); } if(MEGAMANdata.UPkey) { if(!MEGAMANdata.reachedJUMPmax) moveUP(document.all.MEGAMAN,MEGAMANdata); strikeUPpose(document.all.MEGAMAN,MEGAMANdata); } if(MEGAMANdata.RUNkey) MEGAMANdata.runSPEED=2; else MEGAMANdata.runSPEED=1; if(!MEGAMANdata.FIREkey&&!MEGAMANdata.UPkey&&!MEGAMANdata.RIGHTkey&&!MEGAMANdata.LEFTkey) { if(!MEGAMANdata.inAIR) { if(MEGAMANdata.FACINGright) document.all.MEGAMAN.src=MEGAMANdata.STANDpose[1].src; else document.all.MEGAMAN.src=MEGAMANdata.STANDpose[2].src; } } if(MEGAMANdata.FIREkey) { fireSHOT1(document.all.MEGAMAN,MEGAMANdata,true); } } } function damage(WHICHobject, WHICHdata) { if (WHICHdata.FACINGright) { WHICHobject.src=MEGAMANdata.DAMAGEpose[WHICHdata.DAMAGEposeNUM+2].src; if(parseInt(WHICHobject.style.left)+10> gamefield.left) WHICHobject.style.left=parseInt(WHICHobject.style.left)-(5); } else { WHICHobject.src=MEGAMANdata.DAMAGEpose[WHICHdata.DAMAGEposeNUM].src; if(parseInt(WHICHobject.style.left)+34(gamefield.floor-23)) { WHICHdata.uppercutOK=false; WHICHdata.reachedJUMPmax=false; WHICHdata.inAIR=false; whichObject.style.top=gamefield.floor-23; if(WHICHdata.FACINGright) whichObject.src=MEGAMANdata.STANDpose[1].src; else whichObject.src=MEGAMANdata.STANDpose[2].src; WHICHdata.ObjectVelocity=0; } else if(WHICHdata.inAIR) { WHICHdata.ObjectVelocity=WHICHdata.ObjectVelocity+SIMgravity; whichObject.style.top=HOLDpos; } } function moveLEFT(whichObject,WHICHdata) { var shoot=0; if(WHICHdata.FIREkey) shoot=3; if(WHICHdata.POSITION==1&&!WHICHdata.inAIR) { whichObject.src=MEGAMANdata.LEFTpose[1+shoot].src; WHICHdata.POSITION=2 } else if(WHICHdata.POSITION==2&&!WHICHdata.inAIR) { whichObject.src=MEGAMANdata.LEFTpose[2+shoot].src; WHICHdata.POSITION=3 } else if(WHICHdata.POSITION==3&&!WHICHdata.inAIR) { whichObject.src=MEGAMANdata.LEFTpose[3+shoot].src; WHICHdata.POSITION=4 } else if(WHICHdata.POSITION==4&&!WHICHdata.inAIR) { whichObject.src=MEGAMANdata.LEFTpose[2+shoot].src; WHICHdata.POSITION=1 } if(parseInt(whichObject.style.left)+10> gamefield.left) whichObject.style.left=parseInt(whichObject.style.left)-(10*WHICHdata.runSPEED); WHICHdata.FACINGright=false; } function moveRIGHT(whichObject,WHICHdata) { var shoot=0; if(WHICHdata.FIREkey) shoot=3; if(WHICHdata.POSITION==1&&!WHICHdata.inAIR) { whichObject.src=MEGAMANdata.RIGHTpose[1+shoot].src; WHICHdata.POSITION=2 } else if(WHICHdata.POSITION==2&&!WHICHdata.inAIR) { whichObject.src=MEGAMANdata.RIGHTpose[2+shoot].src; WHICHdata.POSITION=3 } else if(WHICHdata.POSITION==3&&!WHICHdata.inAIR) { whichObject.src=MEGAMANdata.RIGHTpose[3+shoot].src; WHICHdata.POSITION=4 } else if(WHICHdata.POSITION==4&&!WHICHdata.inAIR) { whichObject.src=MEGAMANdata.RIGHTpose[2+shoot].src; WHICHdata.POSITION=1 } if(parseInt(whichObject.style.left)+348 || behavior==1) { behaviorJump(document.all.MEGAMAN,MEGAMANdata,document.all.GIGAMAN,GIGAMANdata); } if(randomNumber(100)<20) behaviorShoot(document.all.GIGAMAN,GIGAMANdata); behaviorTIME--; } function behaviorChase(VIC,VICdata,AGG,AGGdata) { var Xdiff=parseInt(VIC.style.left)-parseInt(AGG.style.left); var Ydiff=parseInt(VIC.style.top)-parseInt(AGG.style.top); if(Xdiff>70&&!AGGdata.DIRECTION||parseInt(AGG.style.left)>gamefield.right-8) { AGGdata.DIRECTION=!AGGdata.DIRECTION; } else if(Xdiff<-70&&AGGdata.DIRECTION||parseInt(AGG.style.left)0) { AGGdata.FACINGright=true; } else if(Xdiff<0) { AGGdata.FACINGright=false; } } function behaviorJump(VIC,VICdata,AGG,AGGdata) { if(!AGGdata.reachedJUMPmax) moveUP(AGG,AGGdata); strikeUPpose(AGG,AGGdata); } function behaviorShoot(AGG,AGGdata) { GIGAMANdata.FIREkey=true; strikeFIREpose(AGG,AGGdata); AGGdata.FIREcycle=true; if(AGGdata.shotNUM==1&&parseInt(document.all.GIGSHOT1.INMOTION)==0&&AGGdata.FIREcycle) { fireSHOT(document.all.GIGSHOT1,AGG,AGGdata); AGGdata.shotNUM=2; AGGdata.FIREcycle=false; } else if(AGGdata.shotNUM==2&&parseInt(document.all.GIGSHOT2.INMOTION)==0&&AGGdata.FIREcycle) { fireSHOT(document.all.GIGSHOT2,AGG,AGGdata); AGGdata.shotNUM=3; AGGdata.FIREcycle=false; } else if(AGGdata.shotNUM==3&&parseInt(document.all.GIGSHOT3.INMOTION)==0&&AGGdata.FIREcycle) { fireSHOT(document.all.GIGSHOT3,AGG,AGGdata); AGGdata.shotNUM=1; AGGdata.FIREcycle=false; } } function fireFIREBALL(whichFB, whichObject, WHICHdata) { if(WHICHdata.FACINGright) {whichFB.DIRECTION=1; whichFB.style.left=parseInt(whichObject.style.left)+12; whichFB.src=MEGAMANdata.FIREBALL[4].src; } else {whichFB.DIRECTION=(0-1); whichFB.style.left=parseInt(whichObject.style.left)+10; whichFB.src=MEGAMANdata.FIREBALL[2].src; } whichFB.style.top=parseInt(whichObject.style.top)+5; whichFB.INMOTION=1; } function fireSHOT1(whichObject,WHICHdata) { strikeFIREpose(whichObject,WHICHdata); if(WHICHdata.shotNUM==1&&parseInt(document.all.BUSTER1.INMOTION)==0&&WHICHdata.FIREcycle) { fireSHOT(document.all.BUSTER1,whichObject,WHICHdata); WHICHdata.shotNUM=2; WHICHdata.FIREcycle=false; } else if(WHICHdata.shotNUM==2&&parseInt(document.all.BUSTER2.INMOTION)==0&&WHICHdata.FIREcycle) { fireSHOT(document.all.BUSTER2,whichObject,WHICHdata); WHICHdata.shotNUM=3; WHICHdata.FIREcycle=false; } else if(WHICHdata.shotNUM==3&&parseInt(document.all.BUSTER3.INMOTION)==0&&WHICHdata.FIREcycle) { fireSHOT(document.all.BUSTER3,whichObject,WHICHdata); WHICHdata.shotNUM=1; WHICHdata.FIREcycle=false; } } function SHOTmotion(whichShot) { if(parseInt(whichShot.INMOTION)==1) whichShot.style.left=parseInt(whichShot.style.left)+(20*parseInt(whichShot.DIRECTION)); if(parseInt(whichShot.style.left)>gamefield.right+40||parseInt(whichShot.style.left)-Yrange2)&& ( Xdiff1-tempXrange2 )) returnValue=Hit(whichObject,WhichData,BAR,WhichShot,HITvalue,WHICH,ISshot); return returnValue; } function Hit(whichObject,WhichData,BAR,WhichShot,HITvalue,WHICH,ISshot) { WhichData.hits=WhichData.hits+HITvalue; if (ISshot) WhichShot.style.left=390; WhichShot.INMOTION=0; BAR.height=10; BAR.width=POWERMAX-WhichData.hits; WhichData.DAMAGEtime=4; if(WhichData.hits>=POWERMAX) { document.all.BUSTER1.style.left=400; document.all.BUSTER2.style.left=400; document.all.BUSTER3.style.left=400; document.all.FIREBALL.style.left=400; document.all.GIGSHOT1.style.left=400; document.all.GIGSHOT2.style.left=400; document.all.GIGSHOT3.style.left=400; XexplodeLOCATION=whichObject.style.left; YexplodeLOCATION=whichObject.style.top; document.all.EXPLODE1.style.left=XexplodeLOCATION; document.all.EXPLODE2.style.left=XexplodeLOCATION; document.all.EXPLODE3.style.left=XexplodeLOCATION; document.all.EXPLODE4.style.left=XexplodeLOCATION; document.all.EXPLODE5.style.left=XexplodeLOCATION; document.all.EXPLODE6.style.left=XexplodeLOCATION; document.all.EXPLODE7.style.left=XexplodeLOCATION; document.all.EXPLODE8.style.left=XexplodeLOCATION; document.all.EXPLODE1.style.top=YexplodeLOCATION; document.all.EXPLODE2.style.top=YexplodeLOCATION; document.all.EXPLODE3.style.top=YexplodeLOCATION; document.all.EXPLODE4.style.top=YexplodeLOCATION; document.all.EXPLODE5.style.top=YexplodeLOCATION; document.all.EXPLODE6.style.top=YexplodeLOCATION; document.all.EXPLODE7.style.top=YexplodeLOCATION; document.all.EXPLODE8.style.top=YexplodeLOCATION; if (WHICH) document.all.GIGAMAN.src=MEGAMANdata.STANDpose[1].src; else document.all.MEGAMAN.src=MEGAMANdata.STANDpose[1].src; document.all.GIGAMAN.style.filter="alpha(opacity=100) gray()"; document.all.MEGAMAN.style.filter="alpha(opacity=100)"; whichObject.style.left=-100; if (WHICH) explodeGUY=1; else explodeGUY=2 explodeOK=true; WhichData.hits=-1; return true; } return false; }
MEGAMAN
DARK MEGAMAN
LOADING...