home *** CD-ROM | disk | FTP | other *** search
Text File | 2007-09-28 | 28.2 KB | 1,134 lines |
- function updateHealth()
- {
- if(dude.hp > 0)
- {
- this.hud.bar._xscale = dude.hp / dude.maxx * 100;
- }
- else
- {
- this.hud.bar._xscale = 0;
- dude.deceased = true;
- if(!dude.onground)
- {
- dude.guts.gotoAndStop("fall");
- dude.hitcount = 0;
- dude.onground = true;
- dude.Xvel = dude.guts._xscale / 100 * 50;
- }
- }
- }
- function chkHit(who, box)
- {
- i = 0;
- while(i < badz.length)
- {
- thing = eval(badz[i]);
- if(who._y < thing._y + 10 && who._y > thing._y - 10)
- {
- if(box.hitTest(thing.guts.hitzone))
- {
- thing.guts._xscale = who.guts._xscale * -1;
- thing.hp -= 1;
- hitReact(who,thing);
- }
- }
- i++;
- }
- }
- function chkHitBig(who, box)
- {
- swish4.start();
- i = 0;
- while(i < badz.length)
- {
- thing = eval(badz[i]);
- if(who._y < thing._y + 10 && who._y > thing._y - 10)
- {
- if(box.hitTest(thing.guts.hitzone))
- {
- punch2.start();
- thing.hp -= 7;
- thing.guts._xscale = who.guts._xscale * -1;
- hitReact(who,thing,true);
- }
- }
- i++;
- }
- }
- function testAboboHit(who, block, amt, fall)
- {
- if(!dude.blinking)
- {
- if(who.ydist < 15)
- {
- if(block.hitTest(dude.guts.hitarea))
- {
- dude.guts._xscale = who.guts._xscale * -1;
- who.hitcv = 0;
- who.fcv = 0;
- dude.hp -= amt;
- updateHealth();
- if(fall)
- {
- dude.guts.gotoAndStop("fall");
- dude.hitcount = 0;
- dude.onground = true;
- dude.Xvel = dude.guts._xscale / 100 * 50;
- }
- else
- {
- dude.hitcount += 1;
- if(dude.hitcount <= 3)
- {
- dude.guts.gotoAndStop("hit");
- dude.beenhit = true;
- dude.Xvel = dude.guts._xscale / 100 * 30;
- }
- else
- {
- dude.guts.gotoAndStop("fall");
- dude.hitcount = 0;
- dude.onground = true;
- dude.Xvel = dude.guts._xscale / 100 * 50;
- }
- }
- h = _root.attachMovie("dd_hitlight","hit" + objcv,objcv + 99899);
- h._xscale = 70;
- h._yscale = h._xscale;
- h._x = who._x + who.guts._xscale / 100 * -50;
- h._y = who._y - 70;
- objcv++;
- }
- }
- }
- }
- function hitReact(who, thing, autofall)
- {
- if(autofall)
- {
- thing.hitcount = 6;
- }
- thing.hitcount += 1;
- if(thing.hitcount <= 6)
- {
- h = _root.attachMovie("dd_hitlight2","hit" + objcv,objcv + 9899999);
- h._xscale = 70;
- h._yscale = h._xscale;
- h._x = who._x + who.guts._xscale / 100 * -50;
- h._y = who._y - 70;
- objcv += 1;
- thing.beenhit = true;
- thing.Xvel = who.guts._xscale / 100 * -2;
- thing.guts.gotoAndStop("hit");
- who.fighting = true;
- thing.fighting = true;
- thing.fcv = 0;
- who.fcv = 0;
- }
- else
- {
- if(autofall)
- {
- thing.Xvel = who.guts._xscale / 100 * -30;
- }
- else
- {
- thing.Xvel = who.guts._xscale / 100 * -10;
- }
- thing.onground = true;
- thing.guts.gotoAndStop("fall");
- thing.hitcount = 0;
- }
- }
- function ptimer(who)
- {
- who.pcv += 1;
- if(who.pcv >= 12)
- {
- who.punches = 0;
- who.pcv = 0;
- clearInterval(who.myInt);
- }
- }
- function getWho()
- {
- return dude;
- }
- function initGuy(who, sp, pspeed, maxh, maxg, shp)
- {
- who.hp = shp;
- who.maxx = who.hp;
- who.Xvel = 0;
- who.Yvel = 0;
- who.speed = sp;
- who.attcv = 0;
- who.punchspeed = pspeed;
- who.hitcv = 0;
- who.maxstun = maxh;
- who.groundcv = 0;
- who.maxground = maxg;
- who.punchcv = 0;
- who.whichhand = 0;
- who.hitcount = 0;
- who.recovercv = 0;
- who.dcv = 0;
- }
- function phys(who)
- {
- who.swapDepths(who._y);
- if(who.hitcount > 0)
- {
- who.recovercv += 1;
- if(who.recovercv > 80)
- {
- who.hitcount = 0;
- who.recovercv = 0;
- }
- }
- if(who.Xvel != 0 && !who.beenhit && !who.onground && !who.punching || who.Yvel != 0 && !who.beenhit && !who.onground && !who.punching)
- {
- if(!who.attacking)
- {
- if(!who.carrying)
- {
- who.guts.gotoAndStop("walk");
- }
- else if(!who.pickingup)
- {
- if(!who.throwing)
- {
- who.guts.gotoAndStop("carry");
- }
- else
- {
- who.guts.gotoAndStop("throw");
- }
- }
- else
- {
- who.guts.gotoAndStop("pickingup");
- }
- }
- }
- who.Xvel *= 0.6;
- who.Yvel *= 0.6;
- who._x += who.Xvel;
- who._y += who.Yvel;
- who.absx = Math.abs(who.Xvel);
- if(who.absx < 0.05)
- {
- who.Xvel = 0;
- }
- who.absy = Math.abs(who.Yvel);
- if(who.absy < 0.05)
- {
- who.Yvel = 0;
- }
- if(who.absy < 1 && who.absx < 1 && !who.attacking && !who.beenhit && !who.onground && !who.punching)
- {
- if(!who.carrying)
- {
- who.guts.gotoAndStop("rest");
- }
- else if(!who.pickingup)
- {
- if(!who.throwing)
- {
- who.guts.gotoAndStop("carryrest");
- }
- else
- {
- who.guts.gotoAndStop("throw");
- }
- }
- else
- {
- who.guts.gotoAndStop("pickingup");
- }
- }
- if(!who.outofbounds)
- {
- if(who._x <= 0)
- {
- who._x = 0;
- who.goty = false;
- who.gotx = false;
- }
- if(who._x >= 480)
- {
- who._x = 480;
- who.goty = false;
- who.gotx = false;
- }
- if(who._y <= 210)
- {
- who._y = 210;
- who.goty = false;
- who.gotx = false;
- }
- if(who._y >= 400)
- {
- who._y = 400;
- who.goty = false;
- who.gotx = false;
- }
- }
- }
- function bossai(who)
- {
- if(!who.beenhit)
- {
- if(!who.onground)
- {
- if(dude._x < who._x)
- {
- if(who.xdist > 10)
- {
- who.guts._xscale = 100;
- }
- }
- else if(who.xdist > 10)
- {
- who.guts._xscale = -100;
- }
- who.fcv += 1;
- if(who.fcv >= 15)
- {
- who.fcv = 0;
- who.fighting = false;
- who.attacking = false;
- }
- who.xdist = Math.abs(who._x - dude._x);
- who.ydist = Math.abs(who._y - dude._y);
- if(who.ydist < 10 && !dude.onground)
- {
- if(who.xdist < 100)
- {
- who.fighting = true;
- }
- }
- if(who.fighting)
- {
- if(!who.punching)
- {
- who.punching = true;
- who.punchnum = random(2);
- }
- who.guts.gotoAndStop("punch" + who.punchnum);
- }
- if(!who.fighting)
- {
- who.dcv += 1;
- if(who.dcv >= 50)
- {
- who.dcv = 0;
- who.act = random(2);
- }
- if(who.act == 0 && !dude.deceased)
- {
- if(dude._x < who._x)
- {
- who.dir = -1;
- }
- else
- {
- who.dir = 1;
- }
- if(who.xdist > 50)
- {
- if(!who.wait)
- {
- who.Xvel = who.speed * who.dir;
- }
- else
- {
- who.Xvel = who.speed * who.dir / 1.075;
- }
- }
- if(dude._y < who._y)
- {
- who.ydir = -1;
- }
- else
- {
- who.ydir = 1;
- }
- if(!who.wait)
- {
- who.Yvel = who.speed * who.ydir;
- }
- else
- {
- who.Yvel = who.speed * who.ydir / 1.075;
- }
- }
- if(who.act == 1)
- {
- who.Xvel = 0;
- who.Yvel = 0;
- }
- }
- }
- else if(who.hp > 0)
- {
- who.groundcv += 1;
- if(who.groundcv >= who.maxground)
- {
- who.guts.gotoAndStop("getup");
- if(who.groundcv >= who.maxground + 10)
- {
- who.hitcount = 0;
- who.groundcv = 0;
- who.onground = false;
- }
- }
- }
- else
- {
- who.groundcv += 1;
- if(!who.dead)
- {
- who.blinkcv = 0;
- who.numblinks = 0;
- who.dead = true;
- }
- if(who.groundcv >= 25)
- {
- who.blinkcv += 1;
- if(who.blinkcv > 2)
- {
- who.blinkcv = 0;
- who.numblinks += 1;
- who._visible = !who._visible;
- if(who.numblinks >= 20)
- {
- if(who != abobo)
- {
- numdeaths += 1;
- }
- who._visible = false;
- who.dead = true;
- delete who.onEnterFrame;
- who.unloadMovie();
- who.removeMovieClip();
- if(numdeaths == 2)
- {
- readyfor2ndround = true;
- }
- if(numdeaths == 4 && !abobo._visible)
- {
- trace("YOU WIN");
- runEnd();
- }
- }
- }
- }
- }
- }
- else
- {
- who.hitcv += 1;
- if(who.hitcv >= who.maxstun)
- {
- who.hitcv = 0;
- who.beenhit = false;
- }
- }
- }
- function ai0(who)
- {
- if(who.fighting && !dude.onground)
- {
- if(!who.beenhit)
- {
- if(!who.onground)
- {
- who.attacking = true;
- who.punchcv += 1;
- if(who.punchcv >= who.punchspeed)
- {
- who.punchcv = 0;
- who.guts.gotoAndStop("punch" + who.whichhand);
- var pnummer = who.whichhand + 1;
- var thinger = eval("swish" + pnummer);
- thinger.setVolume(50);
- thinger.start();
- thinger.setVolume(50);
- who.attcv = 0;
- who.ydist = Math.abs(who._y - dude._y);
- if(who.guts.punchtest.hitTest(dude.guts.hitarea) && who.ydist <= 10)
- {
- if(!dude.blinking)
- {
- dude.guts._xscale = who.guts._xscale * -1;
- who.hitcv = 0;
- who.fcv = 0;
- if(who.whichhand == 0)
- {
- who.whichhand = 1;
- }
- else
- {
- who.whichhand = 0;
- }
- dude.hitcount += 1;
- dude.hp -= 2;
- updateHealth();
- if(dude.hitcount <= 3)
- {
- dude.guts.gotoAndStop("hit");
- dude.beenhit = true;
- dude.Xvel = dude.guts._xscale / 100 * 2;
- }
- else
- {
- dude.guts.gotoAndStop("fall");
- dude.hitcount = 0;
- dude.onground = true;
- dude.Xvel = dude.guts._xscale / 100 * 20;
- }
- h = _root.attachMovie("dd_hitlight","hit" + objcv,objcv + 777866);
- h._xscale = 70;
- h._yscale = h._xscale;
- h._x = who._x + who.guts._xscale / 100 * -50;
- h._y = who._y - 70;
- objcv++;
- }
- }
- }
- }
- }
- who.fcv += 1;
- if(who.fcv >= 15)
- {
- who.fcv = 0;
- who.fighting = false;
- who.attacking = false;
- if(!who.onground)
- {
- who.guts.gotoAndStop("rest");
- }
- }
- who.debug = "fighting";
- }
- if(!who.beenhit)
- {
- if(!who.onground)
- {
- if(who.attacking)
- {
- who.attcv += 1;
- if(who.attcv >= 10)
- {
- who.attcv = 0;
- who.guts.gotoAndStop("rest");
- }
- }
- if(dude._x > who._x)
- {
- who.guts._xscale = -100;
- }
- else
- {
- who.guts._xscale = 100;
- }
- if(!who.fighting)
- {
- who.debug = "";
- }
- who.distx = Math.abs(who._x - dude._x);
- who.disty = Math.abs(who._y - dude._y);
- if(who.disty < 10 && who.distx < 80)
- {
- who.fighting = true;
- who.fcv = 0;
- }
- if(!who.fighting)
- {
- if(!who.outofbounds)
- {
- who.dcv += 1;
- if(who.dcv >= 50)
- {
- who.dcv = random(50) - 10;
- who.dec = random(5);
- who.xgoal = random(450);
- who.ygoal = random(190) + 210;
- }
- if(who.dec == 0)
- {
- if(who._x < who.xgoal)
- {
- who.Xvel += who.speed;
- }
- if(who._x > who.xgoal)
- {
- who.Xvel -= who.speed;
- }
- if(who._y < who.ygoal)
- {
- who.Yvel += who.speed;
- }
- if(who._y > who.ygoal)
- {
- who.Yvel -= who.speed;
- }
- who.goaldistx = Math.abs(who.xgoal - who._x);
- who.goaldisty = Math.abs(who.ygoal - who._y);
- if(who.goaldistx < 5 && who.goaldisty < 5)
- {
- who.dec = 1;
- }
- }
- if(who.dec == 1)
- {
- who.Xvel = 0;
- who.Yvel = 0;
- }
- if(who.dec == 2)
- {
- who.ygoal = dude._y;
- who.xgoal = dude._x + dude.guts._xscale / 100 * 100;
- who.dec = 0;
- }
- if(who.dec == 3)
- {
- who.dec = 0;
- }
- if(who.dec == 4)
- {
- who.dec = 1;
- }
- }
- else
- {
- if(who._x < who.xgoal)
- {
- who.Xvel += who.speed;
- }
- if(who._x > who.xgoal)
- {
- who.Xvel -= who.speed;
- }
- if(who._y < who.ygoal)
- {
- who.Yvel += who.speed;
- }
- if(who._y > who.ygoal)
- {
- who.Yvel -= who.speed;
- }
- who.goaldistx = Math.abs(who.xgoal - who._x);
- who.goaldisty = Math.abs(who.ygoal - who._y);
- if(who.goaldistx < 5 && who.goaldisty < 5)
- {
- who.dec = 1;
- who.outofbounds = false;
- }
- }
- }
- }
- else if(who.hp > 0)
- {
- who.groundcv += 1;
- if(who.groundcv >= who.maxground)
- {
- who.guts.gotoAndStop("getup");
- if(who.groundcv >= who.maxground + 10)
- {
- who.hitcount = 0;
- who.groundcv = 0;
- who.onground = false;
- }
- }
- }
- else
- {
- who.groundcv += 1;
- if(!who.dead)
- {
- who.blinkcv = 0;
- who.numblinks = 0;
- who.dead = true;
- }
- if(who.groundcv >= 25)
- {
- who.blinkcv += 1;
- if(who.blinkcv > 2)
- {
- who.blinkcv = 0;
- who.numblinks += 1;
- who._visible = !who._visible;
- if(who.numblinks >= 20)
- {
- numdeaths += 1;
- who._visible = false;
- who.dead = true;
- delete who.onEnterFrame;
- who.unloadMovie();
- who.removeMovieClip();
- if(numdeaths == 2)
- {
- readyfor2ndround = true;
- }
- if(numdeaths == 4 && !abobo._visible)
- {
- trace("YOU WIN");
- runEnd();
- }
- }
- }
- }
- }
- }
- else
- {
- who.hitcv += 1;
- if(who.hitcv >= who.maxstun)
- {
- who.hitcv = 0;
- who.beenhit = false;
- }
- }
- }
- function secondRound()
- {
- b = this.attachMovie("dd_bad0","bad0",9999);
- b.outofbounds = true;
- b._xscale = 44;
- b._yscale = b._xscale;
- b._x = -100;
- b._y = 350;
- b.xgoal = 250;
- b.ygoal = 275;
- initGuy(b,2.5,12,4,40,20);
- b = this.attachMovie("dd_bad0","bad1",9998);
- b.outofbounds = true;
- b._xscale = 44;
- b._yscale = b._xscale;
- b._x = 600;
- b._y = 350;
- b.xgoal = 350;
- b.ygoal = 375;
- initGuy(b,2.5,12,4,40,50);
- this.badz = new Array(bad0,bad1,abobo);
- }
- function barrelFall(who)
- {
- barrel._x = who._x + who.guts._xscale / 100 * 30;
- barrel._y = who._y + 3;
- barrel.inair = true;
- barrel.guts._y = -350;
- barrel._visible = true;
- who.carrying = false;
- barrel.Xvel = who.guts._xscale / 100 * 2;
- barrel.Yvel = 0;
- barrel.bounce = 0;
- }
- function throwBarrel(who)
- {
- if(barrel.numthrows == undefined)
- {
- barrel.numthrows = 0;
- }
- barrel.numthrows += 1;
- barrel._x = who._x + who.guts._xscale / -100 * 50;
- barrel._y = who._y + 1;
- barrel.inair = true;
- barrel.guts._y = -350;
- barrel._visible = true;
- if(barrel.numthrows < 5)
- {
- barrel.Xvel = who.guts._xscale / -100 * 10;
- }
- else
- {
- barrel.Xvel = who.guts._xscale / -100 * 20;
- }
- barrel.Yvel = 0;
- barrel.bounce = 0;
- }
- function barrelP(who)
- {
- who.swapDepths(who._y);
- if(!who.inair)
- {
- who.shad._visible = true;
- who.xdist = Math.abs(who._x - dude._x);
- who.ydist = Math.abs(who._y - dude._y);
- if(who.xdist < 50 && who.ydist < 30 && who._visible)
- {
- who.guts.gotoAndStop("lit");
- dude.nearbarrel = true;
- }
- else
- {
- dude.nearbarrel = false;
- who.guts.gotoAndStop("norm");
- }
- }
- else
- {
- if(who.guts._y >= -150)
- {
- who.guts._y = -150;
- who.Yvel *= -0.6;
- hollowclank.start();
- who.bounce += 1;
- }
- if(who.bounce < 3)
- {
- i = 0;
- while(i < badz.length)
- {
- thing = eval(badz[i]);
- if(who._y < thing._y + 15 && who._y > thing._y - 15)
- {
- if(who.guts.hitarea.hitTest(thing.guts.hitzone))
- {
- punch2.start();
- thing.hp -= 7;
- thing.onground = true;
- thing.guts.gotoAndStop("fall");
- thing.hitcount = 0;
- thing.groundcv = 0;
- thing.Xvel = who.Xvel;
- }
- }
- i++;
- }
- }
- who._x += who.Xvel;
- who.Xvel *= 0.97;
- who.guts._y += who.Yvel;
- who.Yvel += 5;
- if(who.bounce >= 5)
- {
- who.guts._y = -150;
- who.inair = false;
- delete who.onEnterFrame;
- }
- }
- }
- function controls(who)
- {
- if(!this.pausy)
- {
- if(who.blinking)
- {
- who.blinkcv += 1;
- who.p1._visible = true;
- p1._xscale = who.guts._xscale;
- if(who.blinkcv >= 5)
- {
- who._visible = !who._visible;
- who.blinkcv = 0;
- who.deathtoll += 1;
- if(who.deathtoll >= 23)
- {
- who.deathtoll = 0;
- who.blinkcv = 0;
- who.blinking = false;
- who.p1._visible = false;
- who._visible = true;
- }
- }
- }
- if(who.beenhit)
- {
- who.hitcv += 1;
- if(who.hitcv >= who.maxstun)
- {
- who.hitcv = 0;
- who.beenhit = false;
- }
- }
- else if(!who.onground)
- {
- if(who.fighting)
- {
- who.fcv += 1;
- if(who.fcv >= 10)
- {
- who.fcv = 0;
- who.fighting = false;
- }
- }
- if(!Key.isDown(65))
- {
- who.aup = true;
- }
- if(!who.attacking)
- {
- if(Key.isDown(39))
- {
- who.Xvel += who.speed;
- who.guts._xscale = -100;
- }
- if(Key.isDown(37))
- {
- who.Xvel -= who.speed;
- who.guts._xscale = 100;
- }
- if(Key.isDown(38))
- {
- who.Yvel -= who.speed;
- }
- if(Key.isDown(40))
- {
- who.Yvel += who.speed;
- }
- }
- else
- {
- who.attcv += 1;
- if(who.attcv >= who.punchspeed)
- {
- who.attcv = 0;
- who.attacking = false;
- who.uppercut = false;
- who.gotoAndStop("rest");
- }
- }
- }
- else if(!who.deceased)
- {
- who.groundcv += 1;
- if(who.groundcv >= who.maxground)
- {
- who.guts.gotoAndStop("getup");
- if(who.groundcv >= who.maxground + 10)
- {
- who.groundcv = 0;
- who.onground = false;
- }
- }
- }
- else
- {
- who.guts.gotoAndStop("fall");
- who.groundcv += 1;
- if(who.groundcv > 15)
- {
- who.deathtoll += 1;
- if(!who.beenset)
- {
- who.blinkcv = 0;
- who.beenset = true;
- }
- }
- if(who.deathtoll >= 5)
- {
- who._visible = !who._visible;
- who.deathtoll = 0;
- who.blinkcv += 1;
- if(who.blinkcv >= 10)
- {
- if(numlives == 1)
- {
- reSpawn();
- }
- else
- {
- youLose();
- }
- }
- }
- }
- }
- }
- function reSpawn()
- {
- trace("respawn");
- who._x = 250;
- who._y = 275;
- who.blinking = true;
- who.deathtoll = 0;
- who.groundcv = 0;
- who.onground = false;
- who.beenset = false;
- who.deceased = false;
- numlives = 0;
- who.hp = who.maxx;
- updateHealth();
- }
- function youLose()
- {
- dude._visible = false;
- who.deathtoll = 0;
- who.groundcv = 0;
- who.onground = false;
- who.beenset = false;
- who.deceased = false;
- who.hp = who.maxx;
- this.pausy = true;
- numlives = 0;
- hud.numlives = 0;
- i = 0;
- while(i < badz.length)
- {
- var thing = eval(badz[i]);
- thing.gotoAndStop("rest");
- i++;
- }
- trace("YOU LOSE");
- _root.lose();
- }
- function runEnd()
- {
- this.pausy = true;
- dude.guts.gotoAndStop("rest");
- showtim = tim0;
- lif = (dude.maxx * (numlives + 1) - (dude.maxx - dude.hp)) * 10;
- _root.win(showtim,lif);
- }
- stop();
- dude.guts._xscale = -100;
- dude.pcv = 0;
- dude.which = 0;
- dude.punches = 0;
- dude.deathtoll = 0;
- dude.blinkcv = 0;
- dude.blinking = true;
- numdeaths = 0;
- numlives = 1;
- rcv = 0;
- tim0 = 5370;
- hud.swapDepths(999);
- objcv = 0;
- badz = new Array(bad0,bad1,abobo);
- this.swish1 = new Sound(this);
- swish1.attachSound("swish1.wav");
- this.swish2 = new Sound(this);
- swish2.attachSound("swish2.wav");
- this.swish3 = new Sound(this);
- swish3.attachSound("swish3.wav");
- this.swish4 = new Sound(this);
- swish4.attachSound("swish4.wav");
- this.punch2 = new Sound(this);
- punch2.attachSound("punch2.wav");
- this.hollowclank = new Sound(this);
- hollowclank.attachSound("hollowclank.wav");
- this.varoop = new Sound(this);
- varoop.attachSound("varoop");
- var keyListener = new Object();
- keyListener.onKeyDown = function()
- {
- var _loc1_ = Key.getCode();
- who = getWho();
- if(!who.beenhit && !who.onground)
- {
- if(who.aup)
- {
- who.aup = false;
- if(_loc1_ == 65)
- {
- if(!who.carrying && !who.nearbarrel || !who.carrying && who.attacking)
- {
- if(!who.uppercut)
- {
- if(who.pcv == 0)
- {
- who.myInt = setInterval(ptimer,100,who);
- }
- if(!who.attacking)
- {
- who.attacking = true;
- who.attcv = 0;
- if(who.which == 1)
- {
- who.guts.gotoAndStop("punch1");
- swish1.setVolume(50);
- swish1.start();
- swish1.setVolume(50);
- who.which = 0;
- }
- else
- {
- who.guts.gotoAndStop("punch0");
- swish2.setVolume(50);
- swish2.start();
- swish2.setVolume(50);
- who.which = 1;
- }
- who.punches += 1;
- }
- if(who.punches > 4)
- {
- who.Xvel += who.guts._xscale / 100 * -20;
- who.guts.gotoAndStop("punch2");
- who.pcv = 0;
- who.attcv = -10;
- who.uppercut = true;
- who.punches = 0;
- clearInterval(who.myInt);
- }
- }
- }
- else if(!who.nearbarrel)
- {
- if(!who.throwing && !who._parent.barrel.inair)
- {
- who.throwing = true;
- throwBarrel(who);
- }
- }
- else
- {
- who.carrying = true;
- who.pickingup = true;
- varoop.start();
- barrel._visible = false;
- }
- }
- }
- }
- };
- Key.addListener(keyListener);
- initGuy(this.dude,3,5,4,40,50);
- initGuy(this.bad0,2.5,12,4,40,20);
- initGuy(this.bad1,2.5,12,4,40,20);
- initGuy(this.abobo,1.8,12,4,40,90);
- this.onEnterFrame = function()
- {
- if(!this.pausy)
- {
- hud.numlives = this.numlives;
- phys(this.dude);
- i = 0;
- while(i < badz.length)
- {
- thing = this["bad" + i];
- phys(thing);
- ai0(thing);
- i++;
- }
- barrelP(barrel);
- phys(this.abobo);
- bossai(this.abobo);
- controls(this.dude);
- if(tim0 > 0)
- {
- tim0 -= 1;
- }
- tim = Math.floor(tim0 / 30);
- if(readyfor2ndround && !beendone)
- {
- rcv += 1;
- if(rcv > 15)
- {
- secondRound();
- beendone = true;
- }
- }
- if(abobo.hp > 0)
- {
- hud.bar2._xscale = abobo.hp / abobo.maxx * 100;
- }
- else
- {
- hud.bar2._xscale = 0;
- }
- }
- };
-