home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Acao / staticshock.swf / scripts / frame_23 / DoAction_8.as < prev    next >
Encoding:
Text File  |  2005-11-09  |  36.6 KB  |  1,603 lines

  1. function playerInit()
  2. {
  3.    bullFlag1 = bullFlag2 = false;
  4.    bullet1._visible = bullet2._visible = false;
  5.    bulletCollideFlag1 = bulletCollideFlag2 = false;
  6.    reloadCnt = playerCollisionFlipFlop = playingDyingCnt = sbReloadCnt = staticNRGInc = 0;
  7.    activeBullets = new Array();
  8.    tellTarget(smartBombMC)
  9.    {
  10.       _visible = false;
  11.       _xscale = _yscale = _alpha = 100;
  12.       _X = -1000;
  13.    }
  14.    numberOfSBUsed = numberOfSaves = 0;
  15.    inertiaHMax = 30;
  16.    inertiaUMax = 10;
  17.    inertiaDMax = 8;
  18.    levelCompletedFlag = false;
  19.    playerPrevSpeed = playerPrevSpeedOld = 0;
  20.    inertia = vInertia = vertSpeed = gravity = 0;
  21.    playerInputFunc = playerInputWalking;
  22.    scrollSpeed = 2;
  23.    prevDir = Right;
  24.    prevVDir = 0;
  25.    takeOffCnt = 0;
  26.    runningAnimation = false;
  27.    jumpingAnimation = false;
  28.    grounded = true;
  29.    jumpingPossibleFlag = true;
  30.    myVerticalFunction = null;
  31.    playerHeartMC = null;
  32.    tellTarget(player)
  33.    {
  34.       _Y = 200;
  35.       _X = 268;
  36.       _visible = true;
  37.       colour.reset();
  38.       gotoAndStop("standingRight");
  39.       play();
  40.       staticBlast._visible = false;
  41.       staticBlast.gotoAndStop(1);
  42.    }
  43.    radarSurround._x = 258;
  44.    playerRadarBlip._x = 294;
  45.    playerRadarBlip._y = player._y / 7 + 354;
  46.    invincibleFlag = true;
  47.    invincibleCnt = invincibleCnt2 = invincibleBright = 0;
  48.    baddieToPlayerFunc = baddieToPlayerCheck;
  49.    playerRadarBlip._visible = true;
  50.    infoBar.livesText.text = lives;
  51.    infoBar.zapCap.text = smartBombs;
  52. }
  53. function playerHide()
  54. {
  55.    tellTarget(player)
  56.    {
  57.       _visible = false;
  58.       gotoAndStop(1);
  59.    }
  60.    playerRadarBlip._visible = false;
  61.    bullFlag1 = bullFlag2 = false;
  62.    bullet1._visible = bullet2._visible = false;
  63. }
  64. function playerInput()
  65. {
  66.    if(levelSkip == true)
  67.    {
  68.       if(inkey(76))
  69.       {
  70.          playerInputFunc = null;
  71.          playerDyingCnt = 0;
  72.          arrowIndicator._visible = true;
  73.          arrowIndicator.gotoAndStop(3);
  74.          arrowIndicatorFunc = null;
  75.          levelCompletedSetUp();
  76.       }
  77.    }
  78.    var _loc1_ = false;
  79.    if(inkey(37))
  80.    {
  81.       moveLeft();
  82.       _loc1_ = true;
  83.    }
  84.    else if(inkey(65))
  85.    {
  86.       moveLeft();
  87.       _loc1_ = true;
  88.    }
  89.    else if(inkey(39))
  90.    {
  91.       moveRight();
  92.       _loc1_ = true;
  93.    }
  94.    else if(inkey(68))
  95.    {
  96.       moveRight();
  97.       _loc1_ = true;
  98.    }
  99.    if(_loc1_ == false)
  100.    {
  101.       handleInertia();
  102.    }
  103.    var _loc2_ = false;
  104.    if(inkey(38))
  105.    {
  106.       moveUp();
  107.       _loc2_ = true;
  108.    }
  109.    else if(inkey(87))
  110.    {
  111.       moveUp();
  112.       _loc2_ = true;
  113.    }
  114.    else if(inkey(40))
  115.    {
  116.       moveDown();
  117.       _loc2_ = true;
  118.    }
  119.    else if(inkey(83))
  120.    {
  121.       moveDown();
  122.       _loc2_ = true;
  123.    }
  124.    if(_loc2_ == false)
  125.    {
  126.       handleGravity();
  127.    }
  128.    checkForShooting();
  129. }
  130. function checkForShooting()
  131. {
  132.    if(reloadCnt <= 0)
  133.    {
  134.       if(inkey(32))
  135.       {
  136.          shoot();
  137.       }
  138.    }
  139.    else
  140.    {
  141.       reloadCnt--;
  142.    }
  143.    if(++staticNRGInc == 15)
  144.    {
  145.       staticNRGInc = 0;
  146.       staticNRG++;
  147.       if(staticNRG >= 200)
  148.       {
  149.          staticNRG = 200;
  150.          infoBar.staticEnergy.gotoAndStop(1);
  151.       }
  152.       else
  153.       {
  154.          infoBar.staticEnergy.gotoAndStop(20 - int(staticNRG / 10));
  155.       }
  156.    }
  157.    if(sbReloadCnt <= 0)
  158.    {
  159.       if(inkey(88))
  160.       {
  161.          smartBombInit();
  162.       }
  163.       else if(inkey(191))
  164.       {
  165.          smartBombInit();
  166.       }
  167.    }
  168.    else
  169.    {
  170.       sbReloadCnt--;
  171.    }
  172. }
  173. function playerInputWalking()
  174. {
  175.    if(levelSkip == true)
  176.    {
  177.       if(inkey(76))
  178.       {
  179.          playerInputFunc = null;
  180.          playerDyingCnt = 0;
  181.          arrowIndicator._visible = true;
  182.          arrowIndicator.gotoAndStop(3);
  183.          arrowIndicatorFunc = null;
  184.          levelCompletedSetUp();
  185.       }
  186.    }
  187.    var _loc1_ = false;
  188.    if(inkey(37))
  189.    {
  190.       moveLeftW();
  191.       _loc1_ = true;
  192.    }
  193.    else if(inkey(65))
  194.    {
  195.       moveLeftW();
  196.       _loc1_ = true;
  197.    }
  198.    else if(inkey(39))
  199.    {
  200.       moveRightW();
  201.       _loc1_ = true;
  202.    }
  203.    else if(inkey(68))
  204.    {
  205.       moveRightW();
  206.       _loc1_ = true;
  207.    }
  208.    if(_loc1_ == false)
  209.    {
  210.       if(handleInertia() == true)
  211.       {
  212.          if(jumpingAnimation != true)
  213.          {
  214.             if(runningAnimation != false)
  215.             {
  216.                runningAnimation = false;
  217.                if(prevDir == Right)
  218.                {
  219.                   player.gotoAndPlay("standingRight");
  220.                }
  221.                else
  222.                {
  223.                   player.gotoAndPlay("standingLeft");
  224.                }
  225.             }
  226.          }
  227.       }
  228.    }
  229.    var _loc2_ = false;
  230.    if(inkey(38))
  231.    {
  232.       moveUpW();
  233.       _loc2_ = true;
  234.    }
  235.    else if(inkey(87))
  236.    {
  237.       moveUpW();
  238.       _loc2_ = true;
  239.    }
  240.    if(_loc2_ == false)
  241.    {
  242.       handleGravityW();
  243.    }
  244.    checkForShooting();
  245. }
  246. function moveUpW()
  247. {
  248.    if(jumpingPossibleFlag)
  249.    {
  250.       if(staticNRG <= 25)
  251.       {
  252.          speedVert = 0;
  253.          jumpingPossibleFlag = false;
  254.          jumpingSFX.start();
  255.          if(prevDir == Right)
  256.          {
  257.             player.gotoAndPlay("jumpingRight");
  258.          }
  259.          else
  260.          {
  261.             player.gotoAndPlay("jumpingLeft");
  262.          }
  263.          runningAnimation = false;
  264.          jumpingAnimation = true;
  265.          myVerticalFunction = jumping;
  266.       }
  267.       else
  268.       {
  269.          diskPowerUpSFX.start();
  270.          if(prevDir == Right)
  271.          {
  272.             player.gotoAndPlay("liftingOffRight");
  273.          }
  274.          else
  275.          {
  276.             player.gotoAndPlay("liftingOffLeft");
  277.          }
  278.          player._y -= 8;
  279.          inertia = scrollSpeed = 0;
  280.          jumpingPossibleFlag = true;
  281.          grounded = false;
  282.          myVerticalFunction = null;
  283.          takeOffCnt = 0;
  284.          playerInputFunc = waitingToTakeOff;
  285.       }
  286.    }
  287. }
  288. function waitingToTakeOff()
  289. {
  290.    if(++takeOffCnt == 16)
  291.    {
  292.       takeOffCnt = 0;
  293.       runningAnimation = false;
  294.       playerInputFunc = playerInput;
  295.    }
  296. }
  297. function waitingToLand()
  298. {
  299.    if(++takeOffCnt == 18)
  300.    {
  301.       takeOffCnt = 0;
  302.       runningAnimation = false;
  303.       if(levelCompletedFlag != true)
  304.       {
  305.          playerInputFunc = playerInputWalking;
  306.       }
  307.       else
  308.       {
  309.          levelCompletedFlag = false;
  310.          playerInputFunc = null;
  311.          grounded = true;
  312.          if(prevDir == Right)
  313.          {
  314.             player.gotoAndPlay("victoryRight");
  315.             vicTestFrame = 275;
  316.          }
  317.          else
  318.          {
  319.             player.gotoAndStop("victoryLeft");
  320.             vicTestFrame = 299;
  321.          }
  322.       }
  323.    }
  324. }
  325. function jumping()
  326. {
  327.    if(speedVert == vertSpeedMax)
  328.    {
  329.       if(prevDir == Right)
  330.       {
  331.          player.gotoAndStop("jumpEndingRight");
  332.       }
  333.       else
  334.       {
  335.          player.gotoAndStop("jumpEndingLeft");
  336.       }
  337.       jumpingPossibleFlag = false;
  338.       myVerticalFunction = falling;
  339.    }
  340.    else
  341.    {
  342.       player._y -= jumpSinus[speedVert++];
  343.    }
  344. }
  345. function falling()
  346. {
  347.    if(--speedVert < 0)
  348.    {
  349.       speedVert = 0;
  350.    }
  351.    player._y += jumpSinus[speedVert];
  352.    if(player._y >= 200)
  353.    {
  354.       player._y = 200;
  355.       grounded = true;
  356.       speedVert = 0;
  357.       jumpingPossibleFlag = true;
  358.       myVerticalFunction = null;
  359.       if(playerInputFunc == null)
  360.       {
  361.          if(prevDir == Right)
  362.          {
  363.             player.gotoAndPlay("gettingUpRight");
  364.          }
  365.          else
  366.          {
  367.             player.gotoAndPlay("gettingUpLeft");
  368.          }
  369.          takeOffCnt = 14;
  370.          playerInputFunc = waitingToLand;
  371.       }
  372.       else if(prevDir == Right)
  373.       {
  374.          player.gotoAndPlay("jumpEndingRight2");
  375.       }
  376.       else
  377.       {
  378.          player.gotoAndPlay("jumpEndingLeft2");
  379.       }
  380.       jumpingAnimation = runningAnimation = false;
  381.    }
  382. }
  383. function moveLeftW()
  384. {
  385.    if(prevDir != Right)
  386.    {
  387.       if(runningAnimation == false)
  388.       {
  389.          if(jumpingAnimation != true)
  390.          {
  391.             runningAnimation = true;
  392.             player.gotoAndPlay("runningLeft");
  393.          }
  394.       }
  395.       prevDir = Left;
  396.       if(++inertia > inertiaHMax)
  397.       {
  398.          inertia = inertiaHMax;
  399.       }
  400.       if(inertia % 3 == true)
  401.       {
  402.          if(++scrollSpeed > 6)
  403.          {
  404.             scrollSpeed = 6;
  405.          }
  406.       }
  407.       scroller.scrollLeft(scrollSpeed);
  408.       artplayField._x += scrollSpeed;
  409.       if(artplayField._x > 2292)
  410.       {
  411.          artplayField._x -= 4584;
  412.       }
  413.       if(enhanced == true)
  414.       {
  415.          backgroundMC.skyLine._x += int(scrollSpeed / 4);
  416.          if(backgroundMC.skyLine._x >= 0)
  417.          {
  418.             backgroundMC.skyLine._x -= 600;
  419.          }
  420.       }
  421.    }
  422.    else
  423.    {
  424.       inertia -= 4;
  425.       if(inertia % 4 == true)
  426.       {
  427.          if(--scrollSpeed < 2)
  428.          {
  429.             scrollSpeed = 2;
  430.          }
  431.       }
  432.       if(inertia <= 0)
  433.       {
  434.          inertia = 0;
  435.          scrollSpeed = 2;
  436.          prevDir = Left;
  437.          if(jumpingAnimation != true)
  438.          {
  439.             player.gotoAndPlay("turningLeft");
  440.          }
  441.       }
  442.       scroller.scrollRight(scrollSpeed);
  443.       artplayField._x -= scrollSpeed;
  444.       if(artplayField._x < -2292)
  445.       {
  446.          artplayField._x += 4584;
  447.       }
  448.       if(enhanced == true)
  449.       {
  450.          backgroundMC.skyLine._x -= int(scrollSpeed / 4);
  451.          if(backgroundMC.skyLine._x <= -600)
  452.          {
  453.             backgroundMC.skyLine._x += 600;
  454.          }
  455.       }
  456.    }
  457. }
  458. function moveRightW()
  459. {
  460.    if(prevDir != Left)
  461.    {
  462.       if(runningAnimation == false)
  463.       {
  464.          if(jumpingAnimation != true)
  465.          {
  466.             runningAnimation = true;
  467.             player.gotoAndPlay("runningRight");
  468.          }
  469.       }
  470.       prevDir = Right;
  471.       if(++inertia > inertiaHMax)
  472.       {
  473.          inertia = inertiaHMax;
  474.       }
  475.       if(inertia % 3 == true)
  476.       {
  477.          if(++scrollSpeed > 6)
  478.          {
  479.             scrollSpeed = 6;
  480.          }
  481.       }
  482.       scroller.scrollRight(scrollSpeed);
  483.       artplayField._x -= scrollSpeed;
  484.       if(artplayField._x < -2292)
  485.       {
  486.          artplayField._x += 4584;
  487.       }
  488.       if(enhanced == true)
  489.       {
  490.          backgroundMC.skyLine._x -= int(scrollSpeed / 4);
  491.          if(backgroundMC.skyLine._x <= -600)
  492.          {
  493.             backgroundMC.skyLine._x += 600;
  494.          }
  495.       }
  496.    }
  497.    else
  498.    {
  499.       inertia -= 4;
  500.       if(inertia % 4 == true)
  501.       {
  502.          if(--scrollSpeed < 2)
  503.          {
  504.             scrollSpeed = 2;
  505.          }
  506.       }
  507.       if(inertia <= 0)
  508.       {
  509.          inertia = 0;
  510.          scrollSpeed = 2;
  511.          prevDir = Right;
  512.          if(jumpingAnimation != true)
  513.          {
  514.             player.gotoAndPlay("turningRight");
  515.          }
  516.       }
  517.       scroller.scrollLeft(scrollSpeed);
  518.       artplayField._x += scrollSpeed;
  519.       if(artplayField._x > 2292)
  520.       {
  521.          artplayField._x -= 4584;
  522.       }
  523.       if(enhanced == true)
  524.       {
  525.          backgroundMC.skyLine._x += int(scrollSpeed / 4);
  526.          if(backgroundMC.skyLine._x >= 0)
  527.          {
  528.             backgroundMC.skyLine._x -= 600;
  529.          }
  530.       }
  531.    }
  532. }
  533. function moveUp()
  534. {
  535.    prevVDir = Up;
  536.    if(++vInertia > inertiaUMax)
  537.    {
  538.       vInertia = inertiaUMax;
  539.    }
  540.    if(vInertia % 2 == true)
  541.    {
  542.       if(++vertSpeed > 8)
  543.       {
  544.          vertSpeed = 8;
  545.       }
  546.    }
  547.    player._y -= vertSpeed;
  548.    if(player._y <= 8)
  549.    {
  550.       player._y = 8;
  551.    }
  552.    if(infStaticJuice == false)
  553.    {
  554.       staticNRG -= 0.5;
  555.    }
  556.    if(staticNRG <= 0)
  557.    {
  558.       staticNRG = 0;
  559.       infoBar.staticEnergy.gotoAndStop(21);
  560.       speedVert = vertSpeedMax;
  561.       myVerticalFunction = falling;
  562.       inertia = scrollSpeed = 0;
  563.       diskPowerDownSFX.start();
  564.       if(prevDir == Right)
  565.       {
  566.          player.gotoAndPlay("noStaticRight");
  567.       }
  568.       else
  569.       {
  570.          player.gotoAndPlay("noStaticLeft");
  571.       }
  572.       playerInputFunc = null;
  573.    }
  574.    else
  575.    {
  576.       infoBar.staticEnergy.gotoAndStop(20 - int(staticNRG / 10));
  577.    }
  578.    staticNRGInc = 0;
  579.    gravity = 0;
  580. }
  581. function moveDown()
  582. {
  583.    prevVDir = Down;
  584.    if(++vertSpeed > inertiaDMax)
  585.    {
  586.       vertSpeed = inertiaDMax;
  587.    }
  588.    player._y += vertSpeed;
  589.    if(player._y > 200)
  590.    {
  591.       diskPowerDownSFX.start();
  592.       player._y = 200;
  593.       if(prevDir == Right)
  594.       {
  595.          player.gotoAndPlay("landingRight");
  596.       }
  597.       else
  598.       {
  599.          player.gotoAndPlay("landingLeft");
  600.       }
  601.       inertia = scrollSpeed = 0;
  602.       grounded = true;
  603.       playerInputFunc = waitingToLand;
  604.    }
  605.    gravity = 0;
  606. }
  607. function handleGravity()
  608. {
  609.    if(vInertia > 0)
  610.    {
  611.       vInertia--;
  612.       if(vInertia % 2 == true)
  613.       {
  614.          if(--vertSpeed < 0)
  615.          {
  616.             vertSpeed = vInertia = 0;
  617.          }
  618.       }
  619.       if(prevVDir == Up)
  620.       {
  621.          player._y -= vertSpeed;
  622.          if(player._y <= 8)
  623.          {
  624.             player._y = 8;
  625.          }
  626.       }
  627.    }
  628.    else
  629.    {
  630.       gravity += 0.05;
  631.       player._y += gravity;
  632.       if(player._y > 200)
  633.       {
  634.          diskPowerDownSFX.start();
  635.          player._y = 200;
  636.          if(prevDir == Right)
  637.          {
  638.             player.gotoAndPlay("landingRight");
  639.          }
  640.          else
  641.          {
  642.             player.gotoAndPlay("landingLeft");
  643.          }
  644.          inertia = scrollSpeed = 0;
  645.          playerInputFunc = waitingToLand;
  646.       }
  647.    }
  648. }
  649. function moveRight()
  650. {
  651.    if(prevDir != Left)
  652.    {
  653.       prevDir = Right;
  654.       if(++inertia > inertiaHMax)
  655.       {
  656.          inertia = inertiaHMax;
  657.       }
  658.       if(inertia % 3 == true)
  659.       {
  660.          if(++scrollSpeed > 14)
  661.          {
  662.             scrollSpeed = 14;
  663.          }
  664.       }
  665.       scroller.scrollRight(scrollSpeed);
  666.       artplayField._x -= scrollSpeed;
  667.       if(artplayField._x < -2292)
  668.       {
  669.          artplayField._x += 4584;
  670.       }
  671.       if(enhanced == true)
  672.       {
  673.          backgroundMC.skyLine._x -= int(scrollSpeed / 4);
  674.          if(backgroundMC.skyLine._x <= -600)
  675.          {
  676.             backgroundMC.skyLine._x += 600;
  677.          }
  678.       }
  679.    }
  680.    else
  681.    {
  682.       inertia -= 4;
  683.       if(inertia % 4 == true)
  684.       {
  685.          if(--scrollSpeed < 2)
  686.          {
  687.             scrollSpeed = 2;
  688.          }
  689.       }
  690.       if(inertia <= 0)
  691.       {
  692.          inertia = 0;
  693.          scrollSpeed = 2;
  694.          prevDir = Right;
  695.          player.gotoAndPlay("turningRightFlying");
  696.       }
  697.       scroller.scrollLeft(scrollSpeed);
  698.       artplayField._x += scrollSpeed;
  699.       if(artplayField._x > 2292)
  700.       {
  701.          artplayField._x -= 4584;
  702.       }
  703.       if(enhanced == true)
  704.       {
  705.          backgroundMC.skyLine._x += int(scrollSpeed / 4);
  706.          if(backgroundMC.skyLine._x >= 0)
  707.          {
  708.             backgroundMC.skyLine._x -= 600;
  709.          }
  710.       }
  711.    }
  712. }
  713. function moveLeft()
  714. {
  715.    if(prevDir != Right)
  716.    {
  717.       prevDir = Left;
  718.       if(++inertia > inertiaHMax)
  719.       {
  720.          inertia = inertiaHMax;
  721.       }
  722.       if(inertia % 3 == true)
  723.       {
  724.          if(++scrollSpeed > 14)
  725.          {
  726.             scrollSpeed = 14;
  727.          }
  728.       }
  729.       scroller.scrollLeft(scrollSpeed);
  730.       artplayField._x += scrollSpeed;
  731.       if(artplayField._x > 2292)
  732.       {
  733.          artplayField._x -= 4584;
  734.       }
  735.       if(enhanced == true)
  736.       {
  737.          backgroundMC.skyLine._x += int(scrollSpeed / 4);
  738.          if(backgroundMC.skyLine._x >= 0)
  739.          {
  740.             backgroundMC.skyLine._x -= 600;
  741.          }
  742.       }
  743.    }
  744.    else
  745.    {
  746.       inertia -= 4;
  747.       if(inertia % 4 == true)
  748.       {
  749.          if(--scrollSpeed < 2)
  750.          {
  751.             scrollSpeed = 2;
  752.          }
  753.       }
  754.       if(inertia <= 0)
  755.       {
  756.          inertia = 0;
  757.          scrollSpeed = 2;
  758.          prevDir = Left;
  759.          player.gotoAndPlay("turningLeftFlying");
  760.       }
  761.       scroller.scrollRight(scrollSpeed);
  762.       artplayField._x -= scrollSpeed;
  763.       if(artplayField._x < -2292)
  764.       {
  765.          artplayField._x += 4584;
  766.       }
  767.       if(enhanced == true)
  768.       {
  769.          backgroundMC.skyLine._x -= int(scrollSpeed / 4);
  770.          if(backgroundMC.skyLine._x <= -600)
  771.          {
  772.             backgroundMC.skyLine._x += 600;
  773.          }
  774.       }
  775.    }
  776. }
  777. function handleInertia()
  778. {
  779.    if(--inertia <= 0)
  780.    {
  781.       inertia = 0;
  782.       scrollSpeed = 2;
  783.       return true;
  784.    }
  785.    if(inertia % 6 == true)
  786.    {
  787.       if(--scrollSpeed < 2)
  788.       {
  789.          scrollSpeed = 2;
  790.          inertia = 0;
  791.       }
  792.    }
  793.    if(prevDir == Right)
  794.    {
  795.       scroller.scrollRight(scrollSpeed);
  796.       artplayField._x -= scrollSpeed;
  797.       if(artplayField._x < -2292)
  798.       {
  799.          artplayField._x += 4584;
  800.       }
  801.       if(enhanced == true)
  802.       {
  803.          backgroundMC.skyLine._x -= int(scrollSpeed / 4);
  804.          if(backgroundMC.skyLine._x <= -600)
  805.          {
  806.             backgroundMC.skyLine._x += 600;
  807.          }
  808.       }
  809.       if(grounded == true)
  810.       {
  811.          if(jumpingAnimation != true)
  812.          {
  813.             if(runningAnimation == false)
  814.             {
  815.                runningAnimation = true;
  816.                player.gotoAndPlay("runningRight");
  817.             }
  818.          }
  819.       }
  820.    }
  821.    else
  822.    {
  823.       scroller.scrollLeft(scrollSpeed);
  824.       artplayField._x += scrollSpeed;
  825.       if(artplayField._x > 2292)
  826.       {
  827.          artplayField._x -= 4584;
  828.       }
  829.       if(enhanced == true)
  830.       {
  831.          backgroundMC.skyLine._x += int(scrollSpeed / 4);
  832.          if(backgroundMC.skyLine._x >= 0)
  833.          {
  834.             backgroundMC.skyLine._x -= 600;
  835.          }
  836.       }
  837.       if(grounded == true)
  838.       {
  839.          if(jumpingAnimation != true)
  840.          {
  841.             if(runningAnimation == false)
  842.             {
  843.                runningAnimation = true;
  844.                player.gotoAndPlay("runningLeft");
  845.             }
  846.          }
  847.       }
  848.    }
  849. }
  850. function shoot()
  851. {
  852.    var _loc1_ = checkFreeBullet();
  853.    if(_loc1_ != false)
  854.    {
  855.       if(infStaticJuice == false)
  856.       {
  857.          staticNRG -= 2;
  858.       }
  859.       if(staticNRG <= 0)
  860.       {
  861.          staticNRG = 0;
  862.          infoBar.staticEnergy.gotoAndStop(21);
  863.          if(grounded != true)
  864.          {
  865.             speedVert = vertSpeedMax;
  866.             myVerticalFunction = falling;
  867.             inertia = scrollSpeed = 0;
  868.             diskPowerDownSFX.start();
  869.             if(prevDir == Right)
  870.             {
  871.                player.gotoAndPlay("noStaticRight");
  872.             }
  873.             else
  874.             {
  875.                player.gotoAndPlay("noStaticLeft");
  876.             }
  877.             playerInputFunc = null;
  878.          }
  879.       }
  880.       else
  881.       {
  882.          infoBar.staticEnergy.gotoAndStop(20 - int(staticNRG / 10));
  883.       }
  884.       staticNRGInc = 0;
  885.       playerShootSFX.start();
  886.       reloadCnt = 12;
  887.       _loc1_._y = player._y + 184;
  888.       _loc1_._visible = true;
  889.       _loc1_.gotoAndPlay(1);
  890.       if(prevDir == Right)
  891.       {
  892.          if(grounded != true)
  893.          {
  894.             _loc1_._x = player._x + 360;
  895.          }
  896.          else
  897.          {
  898.             _loc1_._x = player._x + 340;
  899.             _loc1_._y = player._y + 188;
  900.          }
  901.          _loc1_.movePlayerBulletFunc = moveBulletRight;
  902.          _loc1_._xscale = 100;
  903.       }
  904.       else
  905.       {
  906.          if(grounded != true)
  907.          {
  908.             _loc1_._x = player._x - 268;
  909.          }
  910.          else
  911.          {
  912.             _loc1_._x = player._x - 248;
  913.             _loc1_._y = player._y + 188;
  914.          }
  915.          _loc1_.movePlayerBulletFunc = moveBulletLeft;
  916.          _loc1_._xscale = -100;
  917.       }
  918.       this["bulletCollideFlag" + _loc1_.num] = false;
  919.       activeBullets.push(_loc1_);
  920.    }
  921. }
  922. function checkFreeBullet()
  923. {
  924.    if(bullFlag1 == false)
  925.    {
  926.       bullFlag1 = true;
  927.       return bullet1;
  928.    }
  929.    if(bullFlag2 == false)
  930.    {
  931.       bullFlag2 = true;
  932.       return bullet2;
  933.    }
  934.    return false;
  935. }
  936. function bulletHandler()
  937. {
  938.    var _loc3_ = this;
  939.    if(activeBullets.length != 0)
  940.    {
  941.       var _loc1_ = undefined;
  942.       var _loc2_ = -1;
  943.       while((_loc2_ = _loc2_ + 1) < activeBullets.length)
  944.       {
  945.          _loc1_ = activeBullets[_loc2_];
  946.          if(_loc1_.movePlayerBulletFunc(_loc1_) == "dead")
  947.          {
  948.             _loc1_._visible = _loc3_["bullFlag" + _loc1_.num] = false;
  949.             _loc3_["bulletCollideFlag" + _loc1_.num] = false;
  950.             _loc1_.gotoAndStop(1);
  951.             activeBullets.splice(_loc2_,1);
  952.             _loc2_ = _loc2_ - 1;
  953.          }
  954.       }
  955.    }
  956. }
  957. function moveBulletRight(mc)
  958. {
  959.    var _loc2_ = mc;
  960.    if(_loc2_._currentframe == _loc2_._totalframes)
  961.    {
  962.       return "dead";
  963.    }
  964.    if(_root["bulletCollideFlag" + _loc2_.num] != true)
  965.    {
  966.       if(onScreenBaddies.length != 0)
  967.       {
  968.          var _loc1_ = undefined;
  969.          var _loc3_ = -1;
  970.          while((_loc3_ = _loc3_ + 1) != onScreenBaddies.length)
  971.          {
  972.             _loc1_ = onScreenBaddies[_loc3_];
  973.             if(_loc1_.currentStatus == 1)
  974.             {
  975.                if(_loc2_.hitTest(_loc1_.hitAreaMC2))
  976.                {
  977.                   baddieHit(_loc1_,1);
  978.                   _root["bulletCollideFlag" + _loc2_.num] = true;
  979.                   break;
  980.                }
  981.             }
  982.          }
  983.       }
  984.    }
  985. }
  986. function moveBulletLeft(mc)
  987. {
  988.    var _loc2_ = mc;
  989.    if(_loc2_._currentframe == _loc2_._totalframes)
  990.    {
  991.       return "dead";
  992.    }
  993.    if(_root["bulletCollideFlag" + _loc2_.num] != true)
  994.    {
  995.       if(onScreenBaddies.length != 0)
  996.       {
  997.          var _loc1_ = undefined;
  998.          var _loc3_ = -1;
  999.          while((_loc3_ = _loc3_ + 1) != onScreenBaddies.length)
  1000.          {
  1001.             _loc1_ = onScreenBaddies[_loc3_];
  1002.             if(_loc1_.currentStatus == 1)
  1003.             {
  1004.                if(_loc2_.hitTest(_loc1_.hitAreaMC2))
  1005.                {
  1006.                   baddieHit(_loc1_,1);
  1007.                   _root["bulletCollideFlag" + _loc2_.num] = true;
  1008.                   break;
  1009.                }
  1010.             }
  1011.          }
  1012.       }
  1013.    }
  1014. }
  1015. function smartBombInit()
  1016. {
  1017.    var _loc3_ = this;
  1018.    if(smartBombs != 0)
  1019.    {
  1020.       smartBombSFX.start();
  1021.       smartBombs--;
  1022.       numberOfSBUsed++;
  1023.       infoBar.zapCap.text = smartBombs;
  1024.       sbReloadCnt = 20;
  1025.       smartBombAcc = 0;
  1026.       player.gotoAndStop(player._currentframe);
  1027.       if(onScreenBaddies.length != 0)
  1028.       {
  1029.          var _loc1_ = undefined;
  1030.          var _loc2_ = -1;
  1031.          while((_loc2_ = _loc2_ + 1) != onScreenBaddies.length)
  1032.          {
  1033.             _loc1_ = onScreenBaddies[_loc2_];
  1034.             _loc1_.anim.gotoAndStop(_loc1_.anim._currentframe);
  1035.          }
  1036.       }
  1037.       tellTarget(smartBombMC)
  1038.       {
  1039.          _visible = true;
  1040.          _X = _loc3_.player._x + _width / 2;
  1041.          _Y = _loc3_.player._y + _height / 2;
  1042.       }
  1043.       _loc3_.onEnterFrame = smartBombHandler;
  1044.    }
  1045. }
  1046. function smartBombHandler()
  1047. {
  1048.    smartBombAcc += 2;
  1049.    tellTarget(smartBombMC)
  1050.    {
  1051.       _xscale = _yscale = _yscale + this.smartBombAcc;
  1052.       _alpha--;
  1053.    }
  1054.    if(smartBombMC._width >= 1000)
  1055.    {
  1056.       smartBombEnd();
  1057.    }
  1058.    else if(onScreenBaddies.length != 0)
  1059.    {
  1060.       var _loc1_ = undefined;
  1061.       var _loc2_ = -1;
  1062.       while((_loc2_ = _loc2_ + 1) != onScreenBaddies.length)
  1063.       {
  1064.          _loc1_ = onScreenBaddies[_loc2_];
  1065.          if(_loc1_.currentStatus != 3)
  1066.          {
  1067.             if(smartBombMC.hitTest(_loc1_.hitAreaMC))
  1068.             {
  1069.                baddieHit(_loc1_,100);
  1070.             }
  1071.          }
  1072.       }
  1073.    }
  1074. }
  1075. function smartBombEnd()
  1076. {
  1077.    tellTarget(smartBombMC)
  1078.    {
  1079.       _visible = false;
  1080.       _xscale = _yscale = _alpha = 100;
  1081.       _X = -1000;
  1082.    }
  1083.    player.gotoAndPlay(player._currentframe);
  1084.    this.onEnterFrame = master;
  1085. }
  1086. function baddieToPlayerCheck()
  1087. {
  1088.    if(invincibleFlag == true)
  1089.    {
  1090.       if(++invincibleCnt > 2)
  1091.       {
  1092.          invincibleCnt = 0;
  1093.          if(++invincibleCnt2 == 15)
  1094.          {
  1095.             invincibleFlag = false;
  1096.             invincibleBright = 0;
  1097.             player.colour.reset();
  1098.          }
  1099.          else
  1100.          {
  1101.             if(invincibleBright == 0)
  1102.             {
  1103.                invincibleBright = 100;
  1104.             }
  1105.             else
  1106.             {
  1107.                invincibleBright = 0;
  1108.             }
  1109.             player.colour.setBrightness(invincibleBright);
  1110.          }
  1111.       }
  1112.    }
  1113.    else if(invincible != true)
  1114.    {
  1115.       if(++playerCollisionFlipFlop == 1)
  1116.       {
  1117.          if(onScreenBaddies.length != 0)
  1118.          {
  1119.             var _loc2_ = undefined;
  1120.             var _loc1_ = -1;
  1121.             while(true)
  1122.             {
  1123.                if((_loc1_ = _loc1_ + 1) != onScreenBaddies.length)
  1124.                {
  1125.                   _loc2_ = onScreenBaddies[_loc1_];
  1126.                   if(_loc2_.currentStatus != 1)
  1127.                   {
  1128.                      continue;
  1129.                   }
  1130.                   if(!player.hitAreaMC.hitTest(_loc2_.hitAreaMC))
  1131.                   {
  1132.                      continue;
  1133.                   }
  1134.                   baddieHit(_loc2_,1,true);
  1135.                   invincibleFlag = true;
  1136.                   invincibleCnt = 0;
  1137.                   invincibleCnt2 = 6;
  1138.                   if(grounded != true)
  1139.                   {
  1140.                      playerBounceFlip = false;
  1141.                      if(prevDir == Left)
  1142.                      {
  1143.                         if(_loc2_._x < playerRelativePos.x)
  1144.                         {
  1145.                            playerBounceFlip = true;
  1146.                            prevDir = Right;
  1147.                         }
  1148.                      }
  1149.                      else if(_loc2_._x > playerRelativePos.x)
  1150.                      {
  1151.                         playerBounceFlip = true;
  1152.                         prevDir = Left;
  1153.                      }
  1154.                      inertia = 14;
  1155.                      playerInputFunc = playerBounce;
  1156.                   }
  1157.                   if(difficulty == "Hard")
  1158.                   {
  1159.                      loseEnergy(40);
  1160.                   }
  1161.                   else
  1162.                   {
  1163.                      loseEnergy(25);
  1164.                   }
  1165.                }
  1166.             }
  1167.          }
  1168.       }
  1169.       else
  1170.       {
  1171.          playerCollisionFlipFlop = 0;
  1172.          if(activeBadBullets.length != 0)
  1173.          {
  1174.             _loc1_ = -1;
  1175.             while((_loc1_ = _loc1_ + 1) != activeBadBullets.length)
  1176.             {
  1177.                _loc2_ = activeBadBullets[_loc1_];
  1178.                if(player.hitAreaMC.hitTest(_loc2_.hitAreaMC))
  1179.                {
  1180.                   if(difficulty == "Hard")
  1181.                   {
  1182.                      loseEnergy(20);
  1183.                   }
  1184.                   else
  1185.                   {
  1186.                      loseEnergy(10);
  1187.                   }
  1188.                   _loc2_.gotoAndStop(2);
  1189.                   activeBadBullets[_loc1_].moveBaddieBulletFunc = bulletDying;
  1190.                   break;
  1191.                }
  1192.             }
  1193.          }
  1194.       }
  1195.    }
  1196. }
  1197. function playerBounce()
  1198. {
  1199.    if(handleInertia() == true)
  1200.    {
  1201.       if(playerBounceFlip == true)
  1202.       {
  1203.          playerBounceFlip = false;
  1204.          if(prevDir == Left)
  1205.          {
  1206.             prevDir = Right;
  1207.          }
  1208.          else
  1209.          {
  1210.             prevDir = Left;
  1211.          }
  1212.       }
  1213.       playerInputFunc = playerInput;
  1214.       gravity = 0;
  1215.    }
  1216.    gravity += 0.5;
  1217.    player._y += gravity;
  1218.    if(player._y > 200)
  1219.    {
  1220.       player._y = 200;
  1221.       if(prevDir == Right)
  1222.       {
  1223.          player.gotoAndPlay("landingRight");
  1224.       }
  1225.       else
  1226.       {
  1227.          player.gotoAndPlay("landingLeft");
  1228.       }
  1229.       inertia = scrollSpeed = 0;
  1230.       playerInputFunc = waitingToLand;
  1231.    }
  1232. }
  1233. function loseEnergy(amount)
  1234. {
  1235.    stamina -= amount;
  1236.    if(stamina < 10)
  1237.    {
  1238.       infoBar.staminaBar.gotoAndStop(21);
  1239.       playerInputFunc = playerKilled;
  1240.    }
  1241.    else
  1242.    {
  1243.       infoBar.staminaBar.gotoAndStop(20 - int(stamina / 10));
  1244.       invincibleFlag = true;
  1245.       invincibleCnt = 0;
  1246.       invincibleCnt2 = 13;
  1247.    }
  1248. }
  1249. function playerKilled()
  1250. {
  1251.    attractMode.killInGameMusic();
  1252.    baddieToPlayerFunc = null;
  1253.    invincibleFlag = false;
  1254.    invincibleBright = 0;
  1255.    player.colour.reset();
  1256.    playerRadarBlip._visible = arrowIndicator._visible = false;
  1257.    arrowIndicatorFunc = null;
  1258.    lives--;
  1259.    xtraLifeArrays[livesOffset] = 0;
  1260.    infoBar.livesText.text = lives;
  1261.    stamina = 200;
  1262.    numberOfAttempts++;
  1263.    playingDyingCnt = 0;
  1264.    if(grounded == true and myVerticalFunction == null)
  1265.    {
  1266.       if(prevDir == Right)
  1267.       {
  1268.          player.gotoAndPlay("dyingRight1");
  1269.       }
  1270.       else
  1271.       {
  1272.          player.gotoAndPlay("dyingLeft1");
  1273.       }
  1274.       playerInputFunc = playerDying;
  1275.    }
  1276.    else
  1277.    {
  1278.       diskPowerDownSFX.start();
  1279.       if(prevDir == Right)
  1280.       {
  1281.          player.gotoAndPlay("noStaticRight");
  1282.       }
  1283.       else
  1284.       {
  1285.          player.gotoAndPlay("noStaticLeft");
  1286.       }
  1287.       playerInputFunc = playerDyingFalling;
  1288.    }
  1289.    myVerticalFunction = null;
  1290. }
  1291. function playerDyingFalling()
  1292. {
  1293.    if(++vertSpeed > inertiaDMax)
  1294.    {
  1295.       vertSpeed = inertiaDMax;
  1296.    }
  1297.    player._y += vertSpeed;
  1298.    if(player._y > 200)
  1299.    {
  1300.       player._y = 200;
  1301.       if(prevDir == Right)
  1302.       {
  1303.          player.gotoAndPlay("dyingRight2");
  1304.       }
  1305.       else
  1306.       {
  1307.          player.gotoAndPlay("dyingLeft2");
  1308.       }
  1309.       playerInputFunc = playerDying;
  1310.       inertia = scrollSpeed = 0;
  1311.       grounded = true;
  1312.    }
  1313. }
  1314. function playerDying()
  1315. {
  1316.    var _loc2_ = this;
  1317.    var _loc1_ = -1;
  1318.    while((_loc1_ = _loc1_ + 1) < activeBadBullets.length)
  1319.    {
  1320.       activeBadBullets[_loc1_].gotoAndStop(2);
  1321.       activeBadBullets[_loc1_].moveBaddieBulletFunc = bulletDying;
  1322.    }
  1323.    if(++playingDyingCnt >= frameRate * 2)
  1324.    {
  1325.       playingDyingCnt = 0;
  1326.       delete _loc2_.onEnterFrame;
  1327.       if(lives != 0)
  1328.       {
  1329.          if(baddieHandlerfunc == levelCompletedDelay)
  1330.          {
  1331.             tellTarget(attractMode)
  1332.             {
  1333.                gotoAndStop("levelDone");
  1334.                play();
  1335.             }
  1336.          }
  1337.          else
  1338.          {
  1339.             wipeRunningFlag = true;
  1340.             tellTarget(attractMode.wipe)
  1341.             {
  1342.                _visible = true;
  1343.                gotoAndPlay(2);
  1344.             }
  1345.             continueGame();
  1346.          }
  1347.       }
  1348.       else
  1349.       {
  1350.          _loc2_.playingDyingCnt = 0;
  1351.          _loc2_.onEnterFrame = function()
  1352.          {
  1353.             if(++this.playingDyingCnt == frameRate)
  1354.             {
  1355.                this.playingDyingCnt = 0;
  1356.                gameOver();
  1357.             }
  1358.          };
  1359.       }
  1360.    }
  1361. }
  1362. function increaseScore(mc)
  1363. {
  1364.    score += mc.points;
  1365.    infoBar.scoreText.text = score;
  1366.    livesOffset = int(score / 25000);
  1367.    if(livesOffset > 0)
  1368.    {
  1369.       if(lives < 9)
  1370.       {
  1371.          if(xtraLifeArrays[livesOffset - 1] == 0)
  1372.          {
  1373.             xtraLifeArrays[livesOffset - 1] = 1;
  1374.             lives++;
  1375.             extralifeSpeechSFX.start();
  1376.             infoBar.livesText.text = lives;
  1377.             arrowIndicator.gotoAndStop(4);
  1378.             arrowIndicator._visible = true;
  1379.             arrowIndicatorCnt = - frameRate;
  1380.             arrowIndicatorFunc = displayArrow;
  1381.          }
  1382.       }
  1383.    }
  1384. }
  1385. function levelCompletedSetUp()
  1386. {
  1387.    if(playerInputFunc != playerDying)
  1388.    {
  1389.       attractMode.killInGameMusic();
  1390.       playerInputFunc = null;
  1391.       levelCompletedFlag = true;
  1392.       tempInvincible = invincible;
  1393.       invincible = true;
  1394.       var _loc1_ = -1;
  1395.       while((_loc1_ = _loc1_ + 1) < activeBadBullets.length)
  1396.       {
  1397.          activeBadBullets[_loc1_].gotoAndStop(2);
  1398.          activeBadBullets[_loc1_].moveBaddieBulletFunc = bulletDying;
  1399.       }
  1400.       var _loc2_ = undefined;
  1401.       _loc1_ = 0;
  1402.       while((_loc1_ = _loc1_ + 1) != 12)
  1403.       {
  1404.          _loc2_ = speedEffectHolder.attachMovie("attractStar","aS" + _loc1_,_loc1_);
  1405.       }
  1406.       speedEffectHolder._alpha = 100;
  1407.       collectAllCircuitboardsSFX.start();
  1408.       if(grounded == true)
  1409.       {
  1410.          if(prevDir == Right)
  1411.          {
  1412.             player.gotoAndPlay("victoryRight");
  1413.             vicTestFrame = 275;
  1414.          }
  1415.          else
  1416.          {
  1417.             player.gotoAndStop("victoryLeft");
  1418.             vicTestFrame = 299;
  1419.          }
  1420.       }
  1421.       baddieHandlerfunc = levelCompletedDelay;
  1422.    }
  1423. }
  1424. function levelCompletedDelay()
  1425. {
  1426.    var _loc3_ = this;
  1427.    if(grounded == true)
  1428.    {
  1429.       if(player._currentframe == vicTestFrame)
  1430.       {
  1431.          player.play();
  1432.       }
  1433.    }
  1434.    else
  1435.    {
  1436.       falling();
  1437.    }
  1438.    var _loc2_ = -1;
  1439.    while((_loc2_ = _loc2_ + 1) < grabberbaddieStorage.length)
  1440.    {
  1441.       grabberbaddieStorage[_loc2_].func();
  1442.    }
  1443.    _loc2_ = -1;
  1444.    while((_loc2_ = _loc2_ + 1) < planterbaddieStorage.length)
  1445.    {
  1446.       planterbaddieStorage[_loc2_].func();
  1447.    }
  1448.    _loc2_ = -1;
  1449.    while((_loc2_ = _loc2_ + 1) < minebaddieStorage.length)
  1450.    {
  1451.       minebaddieStorage[_loc2_].func();
  1452.    }
  1453.    if(hunterbaddieStorage.currentStatus != 3)
  1454.    {
  1455.       hunterbaddieStorage.func();
  1456.    }
  1457.    _loc2_ = -1;
  1458.    while((_loc2_ = _loc2_ + 1) < activeBadBullets.length)
  1459.    {
  1460.       activeBadBullets[_loc2_].gotoAndStop(2);
  1461.       activeBadBullets[_loc2_].moveBaddieBulletFunc = bulletDying;
  1462.    }
  1463.    if(++_loc3_.playerDyingCnt == frameRate)
  1464.    {
  1465.       var _loc1_ = undefined;
  1466.       _loc2_ = -1;
  1467.       while((_loc2_ = _loc2_ + 1) < grabberbaddieStorage.length)
  1468.       {
  1469.          _loc1_ = grabberbaddieStorage[_loc2_];
  1470.          if(_loc1_.currentStatus == 4)
  1471.          {
  1472.             _loc1_.pU_lifeSpan = 1;
  1473.          }
  1474.          else
  1475.          {
  1476.             _loc1_.func = grabberTumbling;
  1477.             _loc1_.anim.baddieAnim.gotoAndStop(10);
  1478.             _loc1_.radarBlip.gotoAndStop(2);
  1479.             _loc1_.colour.reset();
  1480.          }
  1481.       }
  1482.       _loc2_ = -1;
  1483.       while((_loc2_ = _loc2_ + 1) < planterbaddieStorage.length)
  1484.       {
  1485.          _loc1_ = planterbaddieStorage[_loc2_];
  1486.          if(_loc1_.currentStatus == 4)
  1487.          {
  1488.             _loc1_.pU_lifeSpan = 1;
  1489.          }
  1490.          else
  1491.          {
  1492.             _loc1_.func = planterTumbling;
  1493.             if(_loc1_.hdir == 1)
  1494.             {
  1495.                _loc1_.anim.baddieAnim.gotoAndStop(27);
  1496.             }
  1497.             else
  1498.             {
  1499.                _loc1_.anim.baddieAnim.gotoAndStop(26);
  1500.             }
  1501.             _loc1_.radarBlip.gotoAndStop(2);
  1502.             _loc1_.colour.reset();
  1503.          }
  1504.       }
  1505.       _loc2_ = -1;
  1506.       while((_loc2_ = _loc2_ + 1) < minebaddieStorage.length)
  1507.       {
  1508.          _loc1_ = minebaddieStorage[_loc2_];
  1509.          if(_loc1_.currentStatus == 4)
  1510.          {
  1511.             _loc1_.pU_lifeSpan = 1;
  1512.          }
  1513.          else
  1514.          {
  1515.             _loc1_.func = mineTumbling;
  1516.             _loc1_.anim.baddieAnim.gotoAndStop(3);
  1517.             _loc1_.radarBlip.gotoAndStop(2);
  1518.             _loc1_.colour.reset();
  1519.          }
  1520.       }
  1521.       _loc2_ = -1;
  1522.       while((_loc2_ = _loc2_ + 1) < walkerbaddieStorage.length)
  1523.       {
  1524.          _loc1_ = walkerbaddieStorage[_loc2_];
  1525.          if(_loc1_.currentStatus == 4)
  1526.          {
  1527.             _loc1_.pU_lifeSpan = 1;
  1528.          }
  1529.          else
  1530.          {
  1531.             _loc1_.func = null;
  1532.             if(_loc1_.hdir == 1)
  1533.             {
  1534.                _loc1_.anim.baddieAnim.gotoAndStop(19);
  1535.             }
  1536.             else
  1537.             {
  1538.                _loc1_.anim.baddieAnim.gotoAndStop(20);
  1539.             }
  1540.             _loc1_.radarBlip.gotoAndStop(2);
  1541.             _loc1_.colour.reset();
  1542.          }
  1543.       }
  1544.       if(hunterbaddieStorage.currentStatus != 3)
  1545.       {
  1546.          _loc1_ = hunterbaddieStorage;
  1547.          _loc1_.func = hunterTumbling;
  1548.          if(_loc1_.hdir == 1)
  1549.          {
  1550.             _loc1_.anim.baddieAnim.gotoAndStop(3);
  1551.          }
  1552.          else
  1553.          {
  1554.             _loc1_.anim.baddieAnim.gotoAndStop(4);
  1555.          }
  1556.          _loc1_.radarBlip.gotoAndStop(2);
  1557.          _loc1_.colour.reset();
  1558.       }
  1559.    }
  1560.    else
  1561.    {
  1562.       if(_loc3_.playerDyingCnt >= frameRate * 2)
  1563.       {
  1564.          if(speedEffectHolder._alpha > 0)
  1565.          {
  1566.             speedEffectHolder._alpha -= 2;
  1567.          }
  1568.          else if(speedEffectHolder.aS3 != undefined)
  1569.          {
  1570.             _loc2_ = 0;
  1571.             while((_loc2_ = _loc2_ + 1) != 12)
  1572.             {
  1573.                speedEffectHolder["aS" + _loc2_].removeMovieClip();
  1574.             }
  1575.          }
  1576.       }
  1577.       if(_loc3_.playerDyingCnt == frameRate * 4)
  1578.       {
  1579.          killAllBaddies();
  1580.          tellTarget(attractMode.wipe)
  1581.          {
  1582.             _visible = true;
  1583.             gotoAndPlay(2);
  1584.          }
  1585.       }
  1586.       else if(_loc3_.playerDyingCnt == frameRate * 5)
  1587.       {
  1588.          playerHide();
  1589.          invincible = tempInvincible;
  1590.          _loc3_.playingDyingCnt = 0;
  1591.          delete _loc3_.onEnterFrame;
  1592.          if(level % 2 == true)
  1593.          {
  1594.             bumpLevel2();
  1595.          }
  1596.          else
  1597.          {
  1598.             attractMode.gotoAndStop("levelDone");
  1599.          }
  1600.       }
  1601.    }
  1602. }
  1603.