home *** CD-ROM | disk | FTP | other *** search
- _X = _X + (speed * direct + _root.movevar);
- myx = _X;
- myy = _Y;
- if(_root.restart eq "true")
- {
- gotoAndStop("off");
- play();
- }
- if(targon eq "false")
- {
- if(myx > - myw and myx < _root.stageW + myw)
- {
- listnum = _root.enlist.length;
- _root.enlist[_root.enlist.length] = _name;
- this._visible = 1;
- targon = "true";
- }
- }
- else
- {
- this;
- if(hitTest(_root.chopper))
- {
- _root.chopper.hits -= 5;
- _root.chopper.chopper.field.gotoAndPlay(2);
- if(myx > _root.playerX)
- {
- _root.chopper.xmove = -20;
- }
- else
- {
- _root.chopper.xmove = 20;
- }
- if(myy > _root.playerY)
- {
- _root.chopper.ymove = -20;
- }
- else
- {
- _root.chopper.ymove = 20;
- }
- hits = -1;
- }
- if(myx < myw * -1 or myx > _root.stageW + myw)
- {
- _root.enlist.splice(listnum,1);
- e = listnum;
- e;
- while(e < _root.enlist.length)
- {
- eval("_root." add _root.enlist[e]).listnum -= 1;
- e++;
- }
- this._visible = 0;
- targon = "false";
- }
- }
- if(targon eq "true")
- {
- chopY = _root.chopper._y;
- chopX = _root.chopper._x;
- if(_Y > chopY + 50)
- {
- _Y = _Y - speed;
- jet._rotation = -75;
- }
- else if(_Y < chopY - 50)
- {
- _Y = _Y + speed;
- jet._rotation = -75;
- }
- if(_X > chopX - 150 and _X < chopX + 150)
- {
- speed *= 0.75;
- if(_X < chopX)
- {
- if(direct == -1)
- {
- direct = 1;
- _xscale = _xscale * -1;
- }
- }
- else if(direct == 1)
- {
- direct = -1;
- _xscale = _xscale * -1;
- }
- }
- else if(speed < orgspeed)
- {
- speed += 1;
- jet._rotation = 0;
- }
- if(random(400) < firecnt)
- {
- if(_root.encnt > 10)
- {
- _root.encnt = 0;
- }
- else
- {
- _root.encnt += 1;
- }
- if(direct == 1)
- {
- myradians = Math.atan2(_root.chopper._y - _Y,_root.chopper._x - _X);
- myangle = myradians * 100 / 3.141592653589793;
- xmove = Math.cos(0.017453292519943295 * myangle) * -10;
- ymove = Math.sin(0.017453292519943295 * myangle) * -10;
- }
- else
- {
- myradians = Math.atan2(_Y - _root.chopper._y,_X - _root.chopper._x);
- myangle = myradians * 100 / 3.141592653589793;
- xmove = Math.cos(0.017453292519943295 * myangle) * 10;
- ymove = Math.sin(0.017453292519943295 * myangle) * 10;
- }
- duplicateMovieClip(_root.bullet2,"enbullet" add _root.encnt,16384 + (500 + _root.encnt));
- eval("_root.enbullet" add _root.encnt).xmove = xmove;
- eval("_root.enbullet" add _root.encnt).ymove = ymove;
- eval("_root.enbullet" add _root.encnt).xorg = _X;
- eval("_root.enbullet" add _root.encnt).yorg = _Y;
- eval("_root.enbullet" add _root.encnt).gotoAndPlay("fire");
- }
- }
- if(hits < 0)
- {
- _root.fightertocnt = _root.shiptocnt + 1;
- gotoAndStop("explode");
- play();
- }
- else
- {
- gotoAndPlay(_currentframe - 1);
- }
-