home *** CD-ROM | disk | FTP | other *** search
- function theEnd()
- {
- k = this._parent.attachMovie("splode","splode",this._parent.getNextHighestDepth());
- k._x = this._x;
- k._y = this._y;
- this._parent.intransition = true;
- this._parent.finalact = true;
- this._parent.pausy = true;
- this.unloadMovie();
- }
- function art(who)
- {
- who.mydist = real._x - who._x;
- if(who.mydist > 105 && !who.jumping && !who.blinking)
- {
- who.Xvel += 2;
- }
- if(who.mydist < -105 && !who.jumping && !who.blinking)
- {
- who.Xvel -= 2;
- }
- if(who.mydist < 40 && who.mydist > 0 && !who.jumping && !real.jumping && !who.blinking)
- {
- who.jumping = true;
- who.Yvel = 20;
- who.Xvel = -24;
- }
- if(who.mydist > -40 && who.mydist < 0 && !who.jumping && !real.jumping && !who.blinking)
- {
- who.jumping = true;
- who.Yvel = 20;
- who.Xvel = 24;
- }
- if(who.mydist > 40 && who.mydist < 105 && !who.blinking)
- {
- who.guts.gotoAndStop("attack");
- who.attacking = true;
- if(real.jumping && !who.jumping)
- {
- who.jumping = true;
- who.Yvel = 20;
- who.Xvel = real.Xvel;
- }
- if(real.attacking && !who.jumping)
- {
- var _loc3_ = random(5);
- if(_loc3_ == 0)
- {
- who.jumping = true;
- who.Yvel = 20;
- who.Xvel = 10;
- who.downit = true;
- }
- }
- }
- if(who.mydist < -40 && who.mydist > -105 && !who.blinking)
- {
- who.guts.gotoAndStop("attack");
- who.attacking = true;
- if(real.jumping && !who.jumping)
- {
- who.jumping = true;
- who.Yvel = 20;
- }
- if(real.attacking && !who.jumping)
- {
- _loc3_ = random(5);
- if(_loc3_ == 0)
- {
- who.jumping = true;
- who.Yvel = 20;
- who.Xvel = -10;
- who.downit = true;
- }
- }
- }
- if(real._x < who._x)
- {
- who._xscale = -100;
- }
- else
- {
- who._xscale = 100;
- }
- if(who._x < 0)
- {
- who._x = 0;
- }
- if(who._x > 550)
- {
- who._x = 550;
- }
- who.absvel = Math.abs(who.Xvel);
- who._x += who.Xvel;
- who._y -= who.Yvel;
- who.Xvel *= 0.8;
- if(who.jumping)
- {
- if(who.zenith != true)
- {
- if(who.attacking != true && who.blinking != true)
- {
- who.guts.gotoAndStop("jumpup");
- }
- if(who.Yvel <= 0)
- {
- who.zenith = true;
- }
- }
- else if(who.attacking != true)
- {
- who.guts.gotoAndStop("jumpdown");
- }
- who.Yvel -= who.grav;
- if(who._y >= who.ground && who.zenith == true)
- {
- who.jumping = false;
- who.Yvel = 0;
- who.zenith = false;
- who._y = who.ground;
- if(who.attacking != true)
- {
- who.landing = true;
- }
- }
- if(who.downit)
- {
- if(who.attacking != true)
- {
- who.guts.gotoAndStop("downthrust");
- if(real.hitTest(this._x,this._y - 5,true) && real.blinking != true)
- {
- this._parent.hurt.start();
- real.guts.gotoAndStop("hit");
- if(real.fairied != true)
- {
- real.attacking = true;
- real.blinking = true;
- real.jumping = true;
- }
- real.Xvel += 10 * (this._xscale / 100);
- real.Yvel = 15;
- if(real.shielded)
- {
- real.life -= 10;
- }
- else
- {
- real.life -= 20;
- }
- if(real.fairied)
- {
- real.life = 0;
- }
- if(real.life > 0)
- {
- this._parent.dash.hlth._xscale = real.life;
- }
- else
- {
- this._parent.dash.hlth._xscale = 0;
- real.life = 0;
- this._parent.myDeath();
- this._parent.pausy = true;
- real.guts.gotoAndStop("hit");
- }
- }
- }
- }
- }
- if(who.landing == true && who.attacking != true)
- {
- who.guts.gotoAndStop("crouch");
- who.landcount += 1;
- if(who.landcount > 4)
- {
- who.landing = false;
- who.landcount = 0;
- }
- }
- if(who.absvel > 0.5)
- {
- if(who.jumping != true)
- {
- if(who.landing != true)
- {
- who.guts.gotoAndStop("walk");
- }
- }
- }
- else if(who.jumping != true)
- {
- if(who.landing != true)
- {
- if(!who.attacking)
- {
- who.guts.gotoAndStop("rest");
- }
- }
- }
- if(who.blinking && who.hp > 0)
- {
- who.mycv += 1;
- who.guts.gotoAndStop("hit");
- if(who.mycv > 30)
- {
- who.mycv = 0;
- who.blinking = false;
- }
- }
- if(who.hp <= 0)
- {
- this.dead = true;
- }
- }
- real = this._parent.zel;
- this.ground = 330;
- this.grav = 2;
- this.Xvel = 0;
- this.Yvel = 0;
- this.landcount = 0;
- this.speed = 4;
- this.r = true;
- this.t = true;
- this.shotcounter = 0;
- this.shotfreq = 12;
- this.fbcount = 500;
- this.hp = 8;
- this.mycv = 0;
- this.finalcv = 0;
- this.newb = true;
- this.Yvel = 25;
- this.Xvel = 25;
- this.zenith = false;
- this.vuln = true;
- this.onEnterFrame = function()
- {
- if(!this._parent.pausy)
- {
- art(this);
- if(this.dead)
- {
- this.guts.gotoAndStop("hit");
- this.blinking = true;
- finalcv += 1;
- if(finalcv > 50)
- {
- theEnd();
- delete this.onEnterFrame;
- }
- }
- }
- else
- {
- this.attacking = false;
- this.guts.gotoAndStop("rest");
- }
- };
-