home *** CD-ROM | disk | FTP | other *** search
- function flight()
- {
- var _loc1_ = _root;
- myx = _X;
- myy = _Y;
- myw = _width * 0.5;
- myh = _height * 0.5;
- _loc1_.playerT = myy - myh;
- _loc1_.playerB = myy + myh;
- _loc1_.playerR = myx + myw;
- _loc1_.playerL = myx - myw;
- _loc1_.playerX = myx;
- _loc1_.playerY = myy;
- buty = "false";
- butx = "false";
- if(key.isdown(key.up))
- {
- chopper.jet.gotoAndPlay(2);
- buty = "true";
- if(ymove > -12)
- {
- ymove -= 2;
- }
- else
- {
- ymove = -12;
- }
- }
- else if(key.isdown(key.down))
- {
- buty = "true";
- if(ymove < 12)
- {
- ymove += 2;
- }
- else
- {
- ymove = 12;
- }
- }
- if(direct > 0)
- {
- if(key.isdown(key.left))
- {
- butx = "true";
- chopper.jet.gotoAndPlay(2);
- if(xmove > -10)
- {
- xmove -= 3;
- }
- else
- {
- xmove = -10;
- }
- if(_X < 430)
- {
- _X = _X + 12;
- }
- if(chopper._rotation > -30)
- {
- chopper._rotation -= 5;
- chopper.jet._rotation -= 5;
- }
- }
- else
- {
- if(chopper._rotation < 0)
- {
- chopper._rotation += 5;
- chopper.jet._rotation += 5;
- }
- if(key.isdown(key.right))
- {
- chopper._xscale *= -1;
- chopper._rotation *= -1;
- direct *= -1;
- }
- }
- }
- else if(key.isdown(key.right))
- {
- butx = "true";
- chopper.jet.gotoAndPlay(2);
- if(xmove < 10)
- {
- xmove += 3;
- }
- else
- {
- xmove = 10;
- }
- if(_X > 180)
- {
- _X = _X - 11;
- }
- if(chopper._rotation < 30)
- {
- chopper._rotation += 5;
- chopper.jet._rotation -= 5;
- }
- }
- else
- {
- if(chopper._rotation > 0)
- {
- chopper._rotation -= 5;
- chopper.jet._rotation += 5;
- }
- if(key.isdown(key.left))
- {
- chopper._xscale *= -1;
- chopper._rotation *= -1;
- direct *= -1;
- }
- }
- offset = random(6);
- bulletxmove = Math.cos(0.017453292519943295 * chopper._rotation) * (20 + offset) * direct;
- bulletymove = Math.sin(0.017453292519943295 * chopper._rotation) * (20 + offset) * direct;
- bulletxorg = Math.cos(0.017453292519943295 * (chopper._rotation - 90)) * 14;
- bulletyorg = Math.sin(0.017453292519943295 * (chopper._rotation - 90)) * 14;
- testx = _X + xmove;
- testy = _Y + ymove;
- if(testx > 300 and testx < _loc1_.stagew - 300)
- {
- if(direct > 0)
- {
- _loc1_.movevar = -3;
- }
- else
- {
- _loc1_.movevar = 3;
- }
- }
- else
- {
- testx2 = _loc1_.scanner.targbox._x + xmove * 0.1;
- if(testx2 > 450 and testx2 < 550)
- {
- xmove = 0;
- _loc1_.movevar = 0;
- }
- else if(testx2 < 0 and testx2 > -100)
- {
- xmove = 0;
- _loc1_.movevar = 0;
- }
- else
- {
- _loc1_.movevar = xmove * -1;
- _loc1_.scanner.targbox._x = testx2;
- }
- }
- if(testy > 24 and testy < _loc1_.stageh - 50)
- {
- _Y = testy;
- }
- if(butx eq "false")
- {
- if(Math.abs(xmove) > 1)
- {
- xmove *= 0.9;
- }
- else
- {
- xmove = 0;
- }
- }
- if(buty eq "false")
- {
- if(Math.abs(ymove) > 1)
- {
- ymove *= 0.7;
- }
- else
- {
- ymove = 0;
- }
- }
- }
- move = 10;
- cnt = 0;
- flip = "false";
- blink = "false";
- _root.collide = "true";
- direct = 1;
- hits = 20;
- hitvar = 50 / hits;
- ymove = 0;
- xmove = 0;
- buty = "false";
- butx = "false";
- _root.arrows.gotoAndStop("blank");
-