home *** CD-ROM | disk | FTP | other *** search
/ 404 Jogos / CLJG.iso / Diversos / hedgehog-launch.swf / scripts / frame_5 / DoAction.as
Encoding:
Text File  |  2008-09-11  |  22.3 KB  |  920 lines

  1. function pauseGame()
  2. {
  3.    if(cStatus != 10)
  4.    {
  5.       cHolder = cStatus;
  6.       cStatus = 10;
  7.       trace("HE");
  8.    }
  9.    else if(cStatus == 10)
  10.    {
  11.       cStatus = cHolder;
  12.       trace("SHE");
  13.    }
  14. }
  15. function checkElevation()
  16. {
  17.    if(elevation > 4500)
  18.    {
  19.       stopAllSounds();
  20.       onMouseDown = null;
  21.       onMouseUp = null;
  22.       onEnterFrame = null;
  23.       _root._x = 0;
  24.       _root._y = 0;
  25.       killSwitch();
  26.       gotoAndStop("win");
  27.    }
  28. }
  29. function moveRocketThing()
  30. {
  31.    rocketThing._x = player._x;
  32.    rocketThing._y = player._y;
  33. }
  34. function controlRadar()
  35. {
  36.    radar._x = - _root._x + radarX;
  37.    radar._y = - _root._y + radarY;
  38.    radar.smallhedge._rotation = player._rotation;
  39.    radar.blips._x = _root._x + 275;
  40.    radar.blips._y = _root._y + 275;
  41. }
  42. function addMapJumper(mov, pip)
  43. {
  44.    cat = radar.blips.attachMovie("jumper-blip",mov._name,k++);
  45.    cat._x = mov._x;
  46.    cat._y = mov._y;
  47.    if(radarLevel == 0)
  48.    {
  49.       radar._visible = false;
  50.    }
  51.    if(radarLevel == 1)
  52.    {
  53.       switch(pip)
  54.       {
  55.          case 0:
  56.             cat._visible = true;
  57.             break;
  58.          case 1:
  59.             cat._visible = false;
  60.             break;
  61.          case 2:
  62.             cat._visible = false;
  63.       }
  64.    }
  65.    if(radarLevel == 2)
  66.    {
  67.    }
  68.    if(radarLevel == 3)
  69.    {
  70.       maltColor = new Color(cat);
  71.       switch(pip)
  72.       {
  73.          case 0:
  74.             maltColor.setRGB(255);
  75.             break;
  76.          case 1:
  77.             maltColor.setRGB(65280);
  78.             break;
  79.          case 2:
  80.             maltColor.setRGB(16776960);
  81.       }
  82.    }
  83. }
  84. function removeMapJumper(mov)
  85. {
  86.    radar.blips[mov._name].removeMovieClip();
  87. }
  88. function checkSlowDown()
  89. {
  90.    if(Math.abs(xVel) < 1 && Math.abs(yVel) < 1 && player._y > 400)
  91.    {
  92.       cStatus = 5;
  93.       stopAllSounds();
  94.       shel = attachMovie("victoryScreen","victoryScreen",k++);
  95.       shel._x = - _root._x + 275;
  96.       shel._y = - _root._y + 275;
  97.    }
  98. }
  99. function stats()
  100. {
  101.    elevation = Math.floor((- player._y + 450) / 5);
  102.    if(elevation < 0)
  103.    {
  104.       elevation = 0;
  105.    }
  106.    gotta = Math.round((levelCash - Math.floor(levelCash)) * 100);
  107.    if(gotta == 0)
  108.    {
  109.       _root.levelCashDisp = levelCash + ".00";
  110.    }
  111.    else if(gotta % 10 == 0)
  112.    {
  113.       _root.levelCashDisp = levelCash + "0";
  114.    }
  115.    else
  116.    {
  117.       _root.levelCashDisp = levelCash;
  118.    }
  119.    gotta = Math.round((totalCash - Math.floor(totalCash)) * 100);
  120.    if(gotta == 0)
  121.    {
  122.       _root.totalCashDisp = totalCash + ".00";
  123.    }
  124.    else if(gotta % 10 == 0)
  125.    {
  126.       _root.totalCashDisp = totalCash + "0";
  127.    }
  128.    else
  129.    {
  130.       _root.totalCashDisp = totalCash;
  131.    }
  132.    _root.totalCashDispDisp = "$" + _root.totalCashDisp + " Total";
  133.    if(elevation > levelElevation)
  134.    {
  135.       levelElevation = elevation;
  136.       lence = true;
  137.    }
  138.    else if(lence)
  139.    {
  140.       bar.bounce.play();
  141.       lence = false;
  142.    }
  143.    elevationDisp = commaMonger(elevation);
  144.    levelElevationDisp = commaMonger(levelElevation) + " ft Best";
  145.    if(cStatus == 4)
  146.    {
  147.       mph = Math.floor(dist(oldMX,oldMY,player._x,player._y));
  148.       distTraveled += Math.floor(mph / 5);
  149.       distTraveledDisp = commaMonger(distTraveled) + " ft traveled";
  150.       mphDisp = mph + " MPH";
  151.       oldMX = player._x;
  152.       oldMY = player._y;
  153.    }
  154. }
  155. function mainTimer()
  156. {
  157.    miliSeconds += 3.125;
  158.    if(miliSeconds >= 100)
  159.    {
  160.       miliSeconds = 0;
  161.       seconds++;
  162.    }
  163.    if(seconds >= 60)
  164.    {
  165.       seconds = 0;
  166.       minutes++;
  167.    }
  168.    clockDisp = loopTen(minutes) + ":" + loopTen(seconds) + "." + loopTen(Math.floor(miliSeconds));
  169. }
  170. function loopTen(num)
  171. {
  172.    if(num < 10)
  173.    {
  174.       return "0" + num;
  175.    }
  176.    return num;
  177. }
  178. function moveBar()
  179. {
  180.    bar._x = - _root._x;
  181.    bar._y = - _root._y;
  182.    whiteFade._x = bar._x;
  183.    whiteFade._y = bar._y;
  184. }
  185. function nextDay()
  186. {
  187.    stopAllSounds();
  188.    onMouseDown = null;
  189.    onMouseUp = null;
  190.    _root._x = 0;
  191.    _root._y = 0;
  192.    day++;
  193.    gotoAndStop("upgrade");
  194.    killSwitch();
  195. }
  196. function control()
  197. {
  198.    if(myFuel > 0 && !eRocketDeployed)
  199.    {
  200.       if(Key.isDown(37))
  201.       {
  202.          rocketThing.leftBurst._visible = true;
  203.          xVel -= lInc;
  204.          drainFuel();
  205.          loadFire("left");
  206.       }
  207.       else
  208.       {
  209.          rocketThing.leftBurst._visible = false;
  210.       }
  211.       if(Key.isDown(39))
  212.       {
  213.          xVel += rInc;
  214.          drainFuel();
  215.          loadFire("right");
  216.          rocketThing.rightBurst._visible = true;
  217.       }
  218.       else
  219.       {
  220.          rocketThing.rightBurst._visible = false;
  221.       }
  222.       if(xVel > RMax)
  223.       {
  224.          xVel = RMax;
  225.       }
  226.       if(xVel < - LMax)
  227.       {
  228.          xVel = - LMax;
  229.       }
  230.    }
  231.    else
  232.    {
  233.       rocketThing.leftBurst._visible = false;
  234.       rocketThing.rightBurst._visible = false;
  235.    }
  236.    if(Key.isDown(40) && !downKey && !eRocketDeployed && parachuteDeployed == false && yVel > 0 && paraUses > 0)
  237.    {
  238.       paraUses--;
  239.       parachuteDeployed = true;
  240.       rocketThing.parachute.gotoAndPlay(2);
  241.       downKey = true;
  242.    }
  243.    if(Key.isDown(40) && !downKey && !eRocketDeployed && parachuteDeployed)
  244.    {
  245.       closeParachute();
  246.       downKey = true;
  247.    }
  248.    if(!Key.isDown(40))
  249.    {
  250.       downKey = false;
  251.    }
  252.    if(Key.isDown(38) && !parachuteDeployed && eRocketDeployed == false && eRocketUses > 0)
  253.    {
  254.       eRocketUses--;
  255.       rockety.start(0,1);
  256.       eRocketDeployed = true;
  257.       player._rotation = -90;
  258.    }
  259.    bar.fuelBar._xscale = myFuel / totalFuel * 100;
  260. }
  261. function closeParachute()
  262. {
  263.    if(parachuteDeployed)
  264.    {
  265.       parachuteDeployed = false;
  266.       rocketThing.parachute.gotoAndPlay(12);
  267.    }
  268. }
  269. function loadFire(str)
  270. {
  271.    i = 0;
  272.    while(i < totalParts)
  273.    {
  274.       shel = rocketThing.attachMovie("star2","star" + k,k++);
  275.       switch(str)
  276.       {
  277.          case "left":
  278.             shel._x = 10;
  279.             shel.xVel = Math.abs(xVel) + random(20);
  280.             shel._y = 0;
  281.             shel.yVel = - random(10);
  282.             break;
  283.          case "right":
  284.             shel._x = -10;
  285.             shel.xVel = - (Math.abs(xVel) + random(20));
  286.             shel._y = 0;
  287.             shel.yVel = - random(10);
  288.             break;
  289.          case "down":
  290.             shel._y = 10;
  291.             shel.yVel = Math.abs(yVel) + random(20);
  292.             shel._x = 0;
  293.             shel.xVel = 10 - random(20);
  294.       }
  295.       shel.onEnterFrame = function()
  296.       {
  297.          this._x += this.xVel;
  298.          this._y += this.yVel;
  299.          this.yVel += gravity;
  300.       };
  301.       i++;
  302.    }
  303. }
  304. function drainFuel()
  305. {
  306.    myFuel -= baseDrain;
  307. }
  308. function backgrounds()
  309. {
  310.    curQuad = Math.floor(player._x / 1000);
  311.    bgs.bg0.removeMovieClip();
  312.    bgs.bg1.removeMovieClip();
  313.    bgs.bg2.removeMovieClip();
  314.    shel = bgs.attachMovie("bg","bg0",k++);
  315.    shel._x = (curQuad - 1) * 1000;
  316.    shel._y = 550;
  317.    shel = bgs.attachMovie("bg","bg1",k++);
  318.    shel._x = curQuad * 1000;
  319.    shel._y = 550;
  320.    shel = bgs.attachMovie("bg","bg2",k++);
  321.    shel._x = (curQuad + 1) * 1000;
  322.    shel._y = 550;
  323.    curQuad = Math.floor((player._x - bbgs._x) / 800);
  324.    bbgs.bg0.removeMovieClip();
  325.    bbgs.bg1.removeMovieClip();
  326.    bbgs.bg2.removeMovieClip();
  327.    shel = bbgs.attachMovie("longSky","bg0",k++);
  328.    shel._x = (curQuad - 1) * 800;
  329.    shel._y = 550;
  330.    shel = bbgs.attachMovie("longSky","bg1",k++);
  331.    shel._x = curQuad * 800;
  332.    shel._y = 550;
  333.    shel = bbgs.attachMovie("longSky","bg2",k++);
  334.    shel._x = (curQuad + 1) * 800;
  335.    shel._y = 550;
  336. }
  337. function depths()
  338. {
  339.    bbgs.swapDepths(k++);
  340.    bgs.swapDepths(k++);
  341.    launcher.swapDepths(k++);
  342.    particles.swapDepths(k++);
  343.    rocketThing.swapDepths(k++);
  344.    rocketThing.fwoop.swapDepths(k++);
  345.    player.swapDepths(k++);
  346.    bungieArea.swapDepths(k++);
  347.    bungie.swapDepths(k++);
  348.    pUps.swapDepths(k++);
  349.    particles.swapDepths(k++);
  350.    yoyo.swapDepths(k++);
  351.    bar.swapDepths(k++);
  352.    firstWarning.swapDepths(k++);
  353.    radar.swapDepths(k++);
  354.    victoryScreen.swapDepths(k++);
  355.    whiteFade.swapDepths(k++);
  356. }
  357. function placeJumpers()
  358. {
  359.    curQuad = Math.floor(player._x / 1000);
  360.    if(curQuad != puQuad)
  361.    {
  362.       if(curQuad < puQuad)
  363.       {
  364.          targetQuad = curQuad - 1;
  365.       }
  366.       else
  367.       {
  368.          targetQuad = curQuad + 1;
  369.       }
  370.       loadIn(targetQuad);
  371.       puQuad = curQuad;
  372.       for(var _loc1_ in pUps)
  373.       {
  374.          if(typeof pUps[_loc1_] == "movieclip")
  375.          {
  376.             if(pUps[_loc1_]._x > (curQuad + 2) * 1000)
  377.             {
  378.                removeMapJumper(pUps[_loc1_]);
  379.                pUps[_loc1_].removeMovieClip();
  380.             }
  381.             if(pUps[_loc1_]._x < (curQuad - 2) * 1000)
  382.             {
  383.                removeMapJumper(pUps[_loc1_]);
  384.                pUps[_loc1_].removeMovieClip();
  385.             }
  386.          }
  387.       }
  388.    }
  389. }
  390. function loadIn(tar)
  391. {
  392.    i = 0;
  393.    while(i < 10)
  394.    {
  395.       shel = pUps.attachMovie("jumper0","jump" + k,k++);
  396.       shel._x = tar * 1000 + random(1000);
  397.       shel._y = 500 - random(20000);
  398.       shel.type = 0;
  399.       addMapJumper(shel,shel.type);
  400.       i++;
  401.    }
  402.    i = 0;
  403.    while(i < 2)
  404.    {
  405.       shel = pUps.attachMovie("jumper1","jump" + k,k++);
  406.       shel._x = tar * 1000 + random(1000);
  407.       shel._y = 500 - random(20000);
  408.       shel.type = 1;
  409.       addMapJumper(shel,shel.type);
  410.       i++;
  411.    }
  412.    i = 0;
  413.    while(i < 2)
  414.    {
  415.       shel = pUps.attachMovie("jumper2","jump" + k,k++);
  416.       shel._x = tar * 1000 + random(1000);
  417.       shel._y = 500 - random(20000);
  418.       shel.type = 2;
  419.       addMapJumper(shel,shel.type);
  420.       i++;
  421.    }
  422.    i = 0;
  423.    while(i < 40)
  424.    {
  425.       shel = pUps.attachMovie("coin0","coin" + k,k++);
  426.       shel._x = tar * 1000 + random(1000);
  427.       shel._y = 500 - random(20000);
  428.       shel.coin = true;
  429.       shel.type = 1;
  430.       i++;
  431.    }
  432.    i = 0;
  433.    while(i < 20)
  434.    {
  435.       shel = pUps.attachMovie("coin1","coin" + k,k++);
  436.       shel._x = tar * 1000 + random(1000);
  437.       shel._y = 500 - random(20000);
  438.       shel.coin = true;
  439.       shel.type = 2;
  440.       i++;
  441.    }
  442.    i = 0;
  443.    while(i < 5)
  444.    {
  445.       shel = pUps.attachMovie("coin2","coin" + k,k++);
  446.       shel._x = tar * 1000 + random(1000);
  447.       shel._y = 500 - random(20000);
  448.       shel.coin = true;
  449.       shel.type = 3;
  450.       i++;
  451.    }
  452. }
  453. function addVal(num)
  454. {
  455.    levelCash += num;
  456.    shel = yoyo.attachMovie("showVal","sh" + k,k++);
  457.    shel._x = player._x;
  458.    shel._y = player._y - 100;
  459.    shel.val = "+$" + num;
  460. }
  461. function powerUps()
  462. {
  463.    for(var _loc1_ in pUps)
  464.    {
  465.       if(typeof pUps[_loc1_] == "movieclip")
  466.       {
  467.          if(pUps[_loc1_].hitTest(player))
  468.          {
  469.             if(!pUps[_loc1_].coin)
  470.             {
  471.                switch(pUps[_loc1_].type)
  472.                {
  473.                   case 0:
  474.                      if(yVel > 0)
  475.                      {
  476.                         yVel = -20;
  477.                         addVal(1);
  478.                         closeParachute();
  479.                         moveIt(pUps[_loc1_]);
  480.                         plat1.start(0,1);
  481.                         removeMapJumper(pUps[_loc1_]);
  482.                      }
  483.                      break;
  484.                   case 1:
  485.                      if(yVel > 0)
  486.                      {
  487.                         yVel = -35;
  488.                         addVal(5);
  489.                         closeParachute();
  490.                         moveIt(pUps[_loc1_]);
  491.                         plat2.start(0,1);
  492.                         removeMapJumper(pUps[_loc1_]);
  493.                      }
  494.                      break;
  495.                   case 2:
  496.                      if(yVel > 0)
  497.                      {
  498.                         yVel = -50;
  499.                         addVal(10);
  500.                         closeParachute();
  501.                         moveIt(pUps[_loc1_]);
  502.                         plat3.start(0,1);
  503.                         removeMapJumper(pUps[_loc1_]);
  504.                      }
  505.                }
  506.             }
  507.             else
  508.             {
  509.                switch(pUps[_loc1_].type)
  510.                {
  511.                   case 1:
  512.                      addVal(0.25);
  513.                      coinSound.start(0,1);
  514.                      break;
  515.                   case 2:
  516.                      addVal(1);
  517.                      coinSound.start(0,1);
  518.                      break;
  519.                   case 3:
  520.                      addVal(5);
  521.                      coinSound.start(0,1);
  522.                }
  523.                j = 0;
  524.                while(j < 10)
  525.                {
  526.                   shel = particles.attachMovie("burst","burst" + k,k++);
  527.                   shel._x = pUps[_loc1_]._x;
  528.                   shel._y = pUps[_loc1_]._y;
  529.                   shel.inside.gotoAndStop(pUps[_loc1_].type);
  530.                   shel._yscale = _loc0_ = random(100) + 50;
  531.                   shel._xscale = _loc0_;
  532.                   shel._rotation = random(360);
  533.                   j++;
  534.                }
  535.                pUps[_loc1_].removeMovieClip();
  536.             }
  537.          }
  538.       }
  539.    }
  540. }
  541. function moveIt(mov)
  542. {
  543.    mov.rotSpeed = (player._x - mov._x) / 20;
  544.    mov.yMov = yVel / 2;
  545.    mov.xMov = 0;
  546.    mov.onEnterFrame = function()
  547.    {
  548.       this._y += this.yMov;
  549.       this.yMov += gravity;
  550.       this._x += this.xMov;
  551.       this._rotation += this.rotSpeed;
  552.    };
  553. }
  554. function killSwitch()
  555. {
  556.    for(var _loc2_ in _root)
  557.    {
  558.       if(typeof _root[_loc2_] == "movieclip")
  559.       {
  560.          _root[_loc2_].removeMovieClip();
  561.       }
  562.    }
  563. }
  564. function movePlayer()
  565. {
  566.    player.filters = new Array(new flash.filters.BlurFilter(Math.abs(xVel / 50),Math.abs(yVel / 50),5));
  567.    player._xscale = 100 - Math.abs(xVel / 3);
  568.    player._yscale = 100 + Math.abs(yVel / 3);
  569.    newPX = player._x;
  570.    newPY = player._y;
  571.    player._rotation = rot(oldPX,oldPY,newPX,newPY);
  572.    player._x += xVel;
  573.    player._y += yVel;
  574.    yVel += gravity;
  575.    if(player._y > 500)
  576.    {
  577.       player._y = 500;
  578.       yVel *= -0.4;
  579.       xVel *= 0.4;
  580.       closeParachute();
  581.    }
  582.    oldPX = newPX;
  583.    oldPY = newPY;
  584.    rocketThing._x = player._x;
  585.    rocketThing._y = player._y;
  586.    if(parachuteDeployed)
  587.    {
  588.       if(yVel > 5)
  589.       {
  590.          yVel /= 2;
  591.       }
  592.       else
  593.       {
  594.          yVel = 4;
  595.       }
  596.    }
  597.    if(eRocketDeployed == true)
  598.    {
  599.       rocketCounter++;
  600.       xVel = 0;
  601.       yVel = -50;
  602.       loadFire("down");
  603.       if(rocketCounter > 20)
  604.       {
  605.          rocketCounter = 0;
  606.          eRocketDeployed = false;
  607.       }
  608.    }
  609. }
  610. function trail()
  611. {
  612.    if(yVel < 0)
  613.    {
  614.       shel = particles.attachMovie("star","particles" + k,k++);
  615.       shel._x = player._x + 20 - random(40);
  616.       shel._y = player._y;
  617.       shel._rotation = random(360);
  618.       shel._yscale = shel._xscale = random(50) + 50;
  619.       tap = Math.round(Math.random() * 16777215);
  620.       altColor = new Color(shel);
  621.       altColor.setRGB(tap);
  622.    }
  623. }
  624. function calcVelocity()
  625. {
  626.    newX = bungie._x;
  627.    newY = bungie._y;
  628.    txVel = newX - oldX;
  629.    tyVel = newY - oldY;
  630.    if(tyVel < bestVel)
  631.    {
  632.       bestVel = tyVel;
  633.    }
  634.    else
  635.    {
  636.       cStatus = 4;
  637.       yVel = tyVel;
  638.       xVel = txVel;
  639.       oldPX = player._x;
  640.       oldPY = player._y;
  641.    }
  642.    oldX = newX;
  643.    oldY = newY;
  644. }
  645. function drawBungie()
  646. {
  647.    if(cStatus == 2)
  648.    {
  649.       bungie._rotation = - (bungie._x - 275) / 6;
  650.       player._rotation = bungie._rotation;
  651.    }
  652.    if(cStatus == 4 || cStatus == 5)
  653.    {
  654.       easing("rotation",bungie,0,0.04);
  655.    }
  656.    bungieArea.clear();
  657.    bungieArea.lineStyle(7,0,100);
  658.    bungieArea.moveTo(launcher._x + 8,launcher._y + 8);
  659.    var _loc2_ = {};
  660.    _loc2_.x = bungie.lG._x;
  661.    _loc2_.y = bungie.lG._y;
  662.    bungie.localToGlobal(_loc2_);
  663.    bungieArea.lineTo(_loc2_.x - _root._x,_loc2_.y - _root._y);
  664.    bungieArea.moveTo(launcher._x + launcher._width - 8,launcher._y + 8);
  665.    _loc2_ = {};
  666.    _loc2_.x = bungie.rG._x;
  667.    _loc2_.y = bungie.rG._y;
  668.    bungie.localToGlobal(_loc2_);
  669.    bungieArea.lineTo(_loc2_.x - _root._x,_loc2_.y - _root._y);
  670.    bungieArea.lineStyle(5,bandColor,100);
  671.    bungieArea.moveTo(launcher._x + 8,launcher._y + 8);
  672.    _loc2_ = {};
  673.    _loc2_.x = bungie.lG._x;
  674.    _loc2_.y = bungie.lG._y;
  675.    bungie.localToGlobal(_loc2_);
  676.    bungieArea.lineTo(_loc2_.x - _root._x,_loc2_.y - _root._y);
  677.    bungieArea.moveTo(launcher._x + launcher._width - 8,launcher._y + 8);
  678.    _loc2_ = {};
  679.    _loc2_.x = bungie.rG._x;
  680.    _loc2_.y = bungie.rG._y;
  681.    bungie.localToGlobal(_loc2_);
  682.    bungieArea.lineTo(_loc2_.x - _root._x,_loc2_.y - _root._y);
  683. }
  684. function moveBungie()
  685. {
  686.    xspeed += (launcher._x + launcher._width / 2 - bungie._x) / ease;
  687.    yspeed += (launcher._y - bungie._y) / ease;
  688.    xspeed *= fric;
  689.    yspeed *= fric;
  690.    bungie._x += xspeed;
  691.    bungie._y += yspeed;
  692. }
  693. function prePlayer()
  694. {
  695.    player._x = bungie._x;
  696.    player._y = bungie._y;
  697. }
  698. function dynCamera()
  699. {
  700.    xCalc = (550 - 550 * (_root._xscale / 100)) / 2;
  701.    yCalc = (550 - 550 * (_root._yscale / 100)) / 2;
  702.    offsetX = 275 - player._x - _root._x;
  703.    offsetY = 275 - player._y - _root._y;
  704.    _root._x += offsetX;
  705.    _root._y += offsetY;
  706.    if(_root._y < 550 - bb._y)
  707.    {
  708.       _root._y = 550 - bb._y;
  709.    }
  710.    bbgs._y = - _root._y / 1.2;
  711.    bbgs._x = - _root._x / 1.2;
  712. }
  713. function easing(pro, mov1, mov2, drift)
  714. {
  715.    switch(pro)
  716.    {
  717.       case "x":
  718.          mov1._x -= drift * ((mov1._x - mov2) / 2);
  719.          break;
  720.       case "y":
  721.          mov1._y -= drift * ((mov1._y - mov2) / 2);
  722.          break;
  723.       case "xscale":
  724.          mov1._xscale -= drift * ((mov1._xscale - mov2) / 2);
  725.          break;
  726.       case "yscale":
  727.          mov1._yscale -= drift * ((mov1._yscale - mov2) / 2);
  728.          break;
  729.       case "width":
  730.          mov1._width -= drift * ((mov1._width - mov2) / 2);
  731.          break;
  732.       case "height":
  733.          mov1._height -= drift * ((mov1._height - mov2) / 2);
  734.          break;
  735.       case "alpha":
  736.          mov1._alpha -= drift * ((mov1._alpha - mov2) / 2);
  737.          break;
  738.       case "rotation":
  739.          mov1._rotation -= drift * ((mov1._rotation - mov2) / 2);
  740.    }
  741. }
  742. function dist(x1, y1, x2, y2)
  743. {
  744.    return Math.sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1));
  745. }
  746. function rot(circx, circy, prevx, prevy)
  747. {
  748.    if(circx < prevx && circy < prevy)
  749.    {
  750.       angle = Math.atan(Math.abs(circy - prevy) / Math.abs(circx - prevx));
  751.       degrees = angle * 180 / 3.141592653589793;
  752.       return degrees + 90;
  753.    }
  754.    if(circx < prevx && circy > prevy)
  755.    {
  756.       angle = Math.atan(Math.abs(circy - prevy) / Math.abs(circx - prevx));
  757.       degrees = angle * 180 / 3.141592653589793;
  758.       return 90 - degrees;
  759.    }
  760.    if(circx > prevx && circy < prevy)
  761.    {
  762.       angle = Math.atan(Math.abs(circx - prevx) / Math.abs(circy - prevy));
  763.       degrees = angle * 180 / 3.141592653589793;
  764.       return - (180 - degrees);
  765.    }
  766.    if(circx > prevx && circy > prevy)
  767.    {
  768.       angle = Math.atan(Math.abs(circy - prevy) / Math.abs(circx - prevx));
  769.       degrees = angle * 180 / 3.141592653589793;
  770.       return - (90 - degrees);
  771.    }
  772. }
  773. var k = 2;
  774. _root.createEmptyMovieClip("bungieArea",k++);
  775. Mouse.show();
  776. cursor._visible = false;
  777. cursor.stopDrag();
  778. var cStatus = 1;
  779. var paraUses = parachuteLevel;
  780. var eRocketUses = eRocketLevel;
  781. var bandColor = bandColors[bandLevel];
  782. onEnterFrame = function()
  783. {
  784.    switch(cStatus)
  785.    {
  786.       case 1:
  787.          prePlayer();
  788.          moveRocketThing();
  789.          break;
  790.       case 2:
  791.          prePlayer();
  792.          moveRocketThing();
  793.          break;
  794.       case 3:
  795.          firstWarning._visible = false;
  796.          moveBungie();
  797.          prePlayer();
  798.          dynCamera();
  799.          calcVelocity();
  800.          moveRocketThing();
  801.          break;
  802.       case 4:
  803.          control();
  804.          moveBungie();
  805.          movePlayer();
  806.          trail();
  807.          dynCamera();
  808.          placeJumpers();
  809.          powerUps();
  810.          mainTimer();
  811.          magnet();
  812.          checkSlowDown();
  813.          moveRocketThing();
  814.          checkElevation();
  815.          break;
  816.       case 5:
  817.          moveBungie();
  818.    }
  819.    controlRadar();
  820.    moveBar();
  821.    drawBungie();
  822.    stats();
  823.    backgrounds();
  824.    depths();
  825. };
  826. var levelCash = 0;
  827. var mphDisp;
  828. player.goggles.gotoAndStop(gogglesLevel + 1);
  829. launcher._y = 350 - launchSize[launcherLevel] * 5;
  830. radarX = radar._x;
  831. radarY = radar._y;
  832. var oldMX = 0;
  833. var oldMY = 0;
  834. var mph = 0;
  835. var distTraveled = 0;
  836. var lence = false;
  837. var levelElevation = 0;
  838. var seconds = 0;
  839. var miliSeconds = 0;
  840. var minutes = 0;
  841. _root.createEmptyMovieClip("particles",k++);
  842. _root.createEmptyMovieClip("bgs",k++);
  843. _root.createEmptyMovieClip("bbgs",k++);
  844. bungie._y = launcher._y;
  845. var totalParts = 3;
  846. var parachuteDeployed = false;
  847. var eRocketDeployed = false;
  848. var rockety = new Sound(this);
  849. rockety.attachSound("rocket_sound2");
  850. var downKey = false;
  851. var baseRocketFuel = 200;
  852. var totalFuel = baseRocketFuel + rocketSize[rocketPackLevel] * baseRocketFuel;
  853. var myFuel = totalFuel;
  854. var baseDrain = 1;
  855. var baseLMax = 25;
  856. var baseRMax = baseLMax;
  857. var LMax = baseLMax + baseLMax * lRocketSize[leftRocketLevel];
  858. var RMax = baseRMax + baseRMax * rRocketSize[rightRocketLevel];
  859. var lInc = LMax / 20;
  860. var rInc = RMax / 20;
  861. var puQuad = 0;
  862. if(day > 1)
  863. {
  864.    firstWarning.swapDepths(k++);
  865.    firstWarning.removeMovieClip();
  866. }
  867. var coinSound = new Sound(this);
  868. coinSound.attachSound("cling_1");
  869. var plat1 = new Sound(this);
  870. var plat2 = new Sound(this);
  871. var plat3 = new Sound(this);
  872. plat1.attachSound("ns-signal-0");
  873. plat2.attachSound("ns-signal-3");
  874. plat3.attachSound("ns-signal-5");
  875. _root.createEmptyMovieClip("particles",k++);
  876. _root.createEmptyMovieClip("pUps",k++);
  877. _root.createEmptyMovieClip("yoyo",k++);
  878. var jumpCounter = 1;
  879. var bestVel = 1000;
  880. var gravity = 0.6;
  881. var oldPX = 0;
  882. var oldPY = 0;
  883. var newPX = 0;
  884. var newPY = 0;
  885. var rocketCounter = 0;
  886. onMouseDown = function()
  887. {
  888.    if(bungie.hitTest(_xmouse,_ymouse) && cStatus == 1)
  889.    {
  890.       bungie.startDrag();
  891.       cStatus = 2;
  892.    }
  893. };
  894. onMouseUp = function()
  895. {
  896.    if(cStatus == 2)
  897.    {
  898.       bungie.stopDrag();
  899.       dragging = false;
  900.       cStatus = 3;
  901.       oldX = bungie._x;
  902.       oldY = bungie._y;
  903.       stopAllSounds();
  904.       mainTheme.start(0,2000);
  905.    }
  906. };
  907. var mainTheme = new Sound(this);
  908. mainTheme.attachSound("mindMaster");
  909. var xspeed = 0;
  910. var yspeed = 0;
  911. var fric = 0.95;
  912. var baseEase = 20;
  913. var ease = 50 - baseEase - baseEase * bandPower[bandLevel];
  914. var angle = 0;
  915. var degrees = 0;
  916. loadIn(-1);
  917. loadIn(1);
  918. loadIn(0);
  919. stop();
  920.