home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Nave / gammabros.swf / scripts / __Packages / classes / misc / Intro.as < prev    next >
Encoding:
Text File  |  2007-03-28  |  26.8 KB  |  857 lines

  1. class classes.misc.Intro
  2. {
  3.    var clip;
  4.    var clip2;
  5.    var trans;
  6.    var colorTrans;
  7.    var keyListener;
  8.    var reconArray;
  9.    var mainMenu;
  10.    var reconKey;
  11.    var reconIndex;
  12.    var neonVar;
  13.    var c = 0;
  14.    var wheelBot = false;
  15.    var flyBot = false;
  16.    var wheelDoorOpen = false;
  17.    var flyDoorOpen = false;
  18.    var gameStarted = false;
  19.    var f2 = "";
  20.    var mainRoutine = "controlRoom";
  21.    var bro1EnteringShip = false;
  22.    var bro2EnteringShip = false;
  23.    var currentBro = 2;
  24.    var c2 = 0;
  25.    var reconfig = false;
  26.    var Name = "intro";
  27.    function Intro()
  28.    {
  29.       this.clip = _root.attachMovie("introScreen","introScreen",90000);
  30.       this.clip.mainClip.cacheAsBitmap = true;
  31.       this.clip.bro1._visible = false;
  32.       this.clip.bro2._visible = false;
  33.       this.clip2 = _root.attachMovie("introOverlay","introOverlay",110000);
  34.       _root.introBro1 = new classes.bro.IntroBro1(735,468);
  35.       _root.addChar("introBro1");
  36.       _root.introBro2 = new classes.bro.IntroBro2(480,462);
  37.       _root.addChar("introBro2");
  38.       this.trans = new flash.geom.Transform(this.clip.title.neon);
  39.       this.colorTrans = new flash.geom.ColorTransform(1,1,1,1,0,0,0,0);
  40.       this.trans.colorTransform = this.colorTrans;
  41.       _root.starB = new classes.fx.StarB();
  42.       _root.addFX("starB");
  43.       this.keyListener = new Object();
  44.       this.keyListener.onKeyDown = function()
  45.       {
  46.          _root.audio.playLevel5("computerBlip" + (random(16) + 1),_root.randRange(22,28));
  47.          var _loc2_ = Key.getCode();
  48.          if(_root.intro.reconfig)
  49.          {
  50.             _root.intro.sendReconKey(_loc2_,Key.getAscii());
  51.          }
  52.          else if(_loc2_ == 39)
  53.          {
  54.             _root.intro.pressRight();
  55.          }
  56.          else if(_loc2_ == 37)
  57.          {
  58.             _root.intro.pressLeft();
  59.          }
  60.          else if(_loc2_ == 40)
  61.          {
  62.             _root.intro.pressDown();
  63.          }
  64.          else if(_loc2_ == 38)
  65.          {
  66.             _root.intro.pressUp();
  67.          }
  68.          else if(_loc2_ == 13)
  69.          {
  70.             _root.intro.pressEnter();
  71.          }
  72.       };
  73.       Key.addListener(this.keyListener);
  74.       this.reconArray = [38,40,37,39,87,83,65,68];
  75.       this.mainMenu = new Object();
  76.       this.mainMenu.array = new Array();
  77.       this.mainMenu.currentIndex = 0;
  78.       this.mainMenu.focus = "mainM";
  79.       this.mainMenu.startIt = new Object();
  80.       this.mainMenu.options = new Object();
  81.       this.mainMenu.info = new Object();
  82.       this.mainMenu.options.array = new Array();
  83.       this.mainMenu.options.dif = new Object();
  84.       this.mainMenu.options.pass = new Object();
  85.       this.mainMenu.options.exit = new Object();
  86.       this.mainMenu.startIt.highlight = "startH";
  87.       this.mainMenu.options.highlight = "optionsH";
  88.       this.mainMenu.info.highlight = "infoH";
  89.       this.mainMenu.startIt.exec = "startGame";
  90.       this.mainMenu.options.exec = "optionsX";
  91.       this.mainMenu.info.exec = "infoX";
  92.       this.mainMenu.options.dif.highlight = "optionsDifH";
  93.       this.mainMenu.options.pass.highlight = "optionsPassH";
  94.       this.mainMenu.options.exit.highlight = "optionsExitH";
  95.       this.mainMenu.options.dif.exec = "optionsDifX";
  96.       this.mainMenu.options.dif.current = _root.dif.num;
  97.       this.mainMenu.options.pass.exec = "optionsPassX";
  98.       this.mainMenu.options.exit.exec = "optionsExitX";
  99.       this.mainMenu.array.push(this.mainMenu.startIt);
  100.       this.mainMenu.array.push(this.mainMenu.info);
  101.       this.mainMenu.array.push(this.mainMenu.options);
  102.       this.mainMenu.options.array.push(this.mainMenu.options.dif);
  103.       this.mainMenu.options.array.push(this.mainMenu.options.pass);
  104.       this.mainMenu.options.array.push(this.mainMenu.options.exit);
  105.       this.startH();
  106.       this.clip.screen._visible = false;
  107.       this.clip.menu.btStart.enabled = true;
  108.       this.clip.menu.btInfo.enabled = true;
  109.       this.clip.menu.btOptions.enabled = true;
  110.       this.clip.menu.btStart.onRollOver = function()
  111.       {
  112.          _root.intro.startH();
  113.       };
  114.       this.clip.menu.btStart.onPress = function()
  115.       {
  116.          _root.intro.startGame();
  117.       };
  118.       this.clip.menu.btInfo.onRollOver = function()
  119.       {
  120.          _root.intro.infoH();
  121.       };
  122.       this.clip.menu.btInfo.onPress = function()
  123.       {
  124.          _root.intro.infoX();
  125.       };
  126.       this.clip.menu.btOptions.onRollOver = function()
  127.       {
  128.          _root.intro.optionsH();
  129.       };
  130.       this.clip.menu.btOptions.onPress = function()
  131.       {
  132.          _root.intro.optionsX();
  133.       };
  134.    }
  135.    function startH()
  136.    {
  137.       this.mainMenu.currentIndex = 0;
  138.       this.clip.menu.start.gotoAndStop("over");
  139.       this.clip.menu.options.gotoAndStop("off");
  140.       this.clip.menu.info.gotoAndStop("off");
  141.    }
  142.    function optionsH()
  143.    {
  144.       this.mainMenu.currentIndex = 2;
  145.       this.clip.menu.start.gotoAndStop("off");
  146.       this.clip.menu.options.gotoAndStop("over");
  147.       this.clip.menu.info.gotoAndStop("off");
  148.    }
  149.    function infoH()
  150.    {
  151.       this.mainMenu.currentIndex = 1;
  152.       this.clip.menu.start.gotoAndStop("off");
  153.       this.clip.menu.options.gotoAndStop("off");
  154.       this.clip.menu.info.gotoAndStop("over");
  155.    }
  156.    function optionsX()
  157.    {
  158.       this.clip.menu.options.gotoAndStop("on");
  159.       this.clip.title.gotoAndStop(2);
  160.       this.clip.screen.gotoAndStop("options");
  161.       this.clip.screen._visible = true;
  162.       this.clip.menu.btStart.enabled = false;
  163.       this.clip.menu.btInfo.enabled = false;
  164.       this.clip.menu.btOptions.enabled = false;
  165.       this.clip.screen.options.btDif.onRollOver = function()
  166.       {
  167.          _root.intro.optionsDifH();
  168.       };
  169.       this.clip.screen.options.btDif.onPress = function()
  170.       {
  171.          _root.intro.optionsDifX();
  172.       };
  173.       this.clip.screen.options.btPass.onRollOver = function()
  174.       {
  175.          _root.intro.optionsPassH();
  176.       };
  177.       this.clip.screen.options.btPass.onPress = function()
  178.       {
  179.          _root.intro.passPress();
  180.       };
  181.       this.clip.screen.options.btExit.onRollOver = function()
  182.       {
  183.          _root.intro.optionsExitH();
  184.       };
  185.       this.clip.screen.options.btExit.onPress = function()
  186.       {
  187.          _root.intro.optionsExitX();
  188.       };
  189.       this.mainMenu.focus = "options";
  190.       this.mainMenu.options.currentIndex = 0;
  191.       this[this.mainMenu.options.array[this.mainMenu.options.currentIndex].highlight]();
  192.    }
  193.    function passPress()
  194.    {
  195.       Selection.setFocus(this.clip.screen.options.pass.passBox);
  196.    }
  197.    function infoX()
  198.    {
  199.       this.clip.menu.btStart.enabled = false;
  200.       this.clip.menu.btInfo.enabled = false;
  201.       this.clip.menu.btOptions.enabled = false;
  202.       this.clip.menu.info.gotoAndStop("on");
  203.       this.clip.title.gotoAndStop(2);
  204.       this.clip.screen.gotoAndStop("info");
  205.       this.clip.screen._visible = true;
  206.       this.mainMenu.focus = "info";
  207.       this.clip.screen.info.gotoAndStop(this.mainMenu.info.currentFrame);
  208.    }
  209.    function optionsDifH()
  210.    {
  211.       this.mainMenu.options.currentIndex = 0;
  212.       this.mainMenu.options.passHi = false;
  213.       this.clip.screen.options.difficulty._alpha = 100;
  214.       this.clip.screen.options.pass._alpha = 15;
  215.       this.clip.screen.options.exit._alpha = 15;
  216.       this.clip.screen.options.difficulty.choices.gotoAndStop(this.mainMenu.options.dif.current);
  217.    }
  218.    function optionsPassH()
  219.    {
  220.       if(!this.mainMenu.options.passHi)
  221.       {
  222.          this.mainMenu.options.currentIndex = 1;
  223.          this.mainMenu.options.passHi = true;
  224.          this.clip.screen.options.difficulty._alpha = 15;
  225.          this.clip.screen.options.pass._alpha = 100;
  226.          this.clip.screen.options.exit._alpha = 15;
  227.          Selection.setFocus(this.clip.screen.options.pass.passBox);
  228.          this.clip.screen.options.pass.passBox.html = false;
  229.       }
  230.    }
  231.    function optionsExitH()
  232.    {
  233.       this.mainMenu.options.currentIndex = 2;
  234.       this.mainMenu.options.passHi = false;
  235.       this.clip.screen.options.difficulty._alpha = 15;
  236.       this.clip.screen.options.pass._alpha = 15;
  237.       this.clip.screen.options.exit._alpha = 100;
  238.    }
  239.    function optionsDifX()
  240.    {
  241.       var _loc3_ = this.clip.screen.options.difficulty.choices;
  242.       if(this.mainMenu.options.dif.current == 1)
  243.       {
  244.          _loc3_.gotoAndStop(2);
  245.          _root.changeDif("med");
  246.          this.mainMenu.options.dif.current = 2;
  247.       }
  248.       else if(this.mainMenu.options.dif.current == 2)
  249.       {
  250.          _loc3_.gotoAndStop(3);
  251.          _root.changeDif("hard");
  252.          this.mainMenu.options.dif.current = 3;
  253.       }
  254.       else if(this.mainMenu.options.dif.current == 3)
  255.       {
  256.          _loc3_.gotoAndStop(1);
  257.          _root.changeDif("easy");
  258.          this.mainMenu.options.dif.current = 1;
  259.       }
  260.    }
  261.    function optionsPassX()
  262.    {
  263.       var _loc3_ = this.clip.screen.options.pass.passBox.text;
  264.       if(_loc3_ == "golvl2")
  265.       {
  266.          _root.level = 2;
  267.          _root.warp = true;
  268.          _root.subLevelNum = 1;
  269.          _root.bgLevel2();
  270.          _root.coins.num = _root.coins.numT = _root.stats.coins = _root.stats.totalCoins = 175;
  271.          _root.gems.num = _root.gems.numT = _root.stats.gems = _root.stats.totalGems = 15;
  272.          _root.bro1Weapon = "tripleLaserA";
  273.          _root.bro2Weapon = "tripleLaserA";
  274.          _root.audio.playLevel5("computer6",_root.randRange(31,37));
  275.          _root.audio.playLevel2("tagTeam1",20);
  276.       }
  277.       else if(_loc3_ == "golvl3")
  278.       {
  279.          _root.level = 3;
  280.          _root.warp = true;
  281.          _root.bgLevel3();
  282.          _root.coins.num = _root.coins.numT = _root.stats.coins = _root.stats.totalCoins = 350;
  283.          _root.gems.num = _root.gems.numT = _root.stats.gems = _root.stats.totalGems = 20;
  284.          _root.subLevelNum = 1;
  285.          _root.bro1Weapon = "tripleTwistLaser";
  286.          _root.bro2Weapon = "tripleTwistLaser";
  287.          _root.audio.playLevel5("computer6",_root.randRange(31,37));
  288.          _root.audio.playLevel2("tagTeam1",20);
  289.       }
  290.    }
  291.    function optionsExitX()
  292.    {
  293.       this.mainMenu.options.passHi = false;
  294.       this.clip.menu.btStart.enabled = true;
  295.       this.clip.menu.btInfo.enabled = true;
  296.       this.clip.menu.btOptions.enabled = true;
  297.       this.mainMenu.focus = "mainM";
  298.       this[this.mainMenu.array[this.mainMenu.currentIndex].highlight]();
  299.       this.clip.title.gotoAndStop(1);
  300.       this.clip.screen._visible = false;
  301.    }
  302.    function infoExitX()
  303.    {
  304.       this.clip.menu.btStart.enabled = true;
  305.       this.clip.menu.btInfo.enabled = true;
  306.       this.clip.menu.btOptions.enabled = true;
  307.       this.mainMenu.focus = "mainM";
  308.       this[this.mainMenu.array[this.mainMenu.currentIndex].highlight]();
  309.       this.clip.title.gotoAndStop(1);
  310.       this.clip.screen._visible = false;
  311.    }
  312.    function shiftMainMenu(num)
  313.    {
  314.       this.mainMenu.currentIndex += num;
  315.       if(this.mainMenu.currentIndex < 0)
  316.       {
  317.          this.mainMenu.currentIndex = this.mainMenu.array.length - 1;
  318.       }
  319.       if(this.mainMenu.currentIndex == this.mainMenu.array.length)
  320.       {
  321.          this.mainMenu.currentIndex = 0;
  322.       }
  323.       this[this.mainMenu.array[this.mainMenu.currentIndex].highlight]();
  324.    }
  325.    function shiftOptions(num)
  326.    {
  327.       this.mainMenu.options.currentIndex += num;
  328.       if(this.mainMenu.options.currentIndex < 0)
  329.       {
  330.          this.mainMenu.options.currentIndex = this.mainMenu.options.array.length - 1;
  331.       }
  332.       if(this.mainMenu.options.currentIndex == this.mainMenu.options.array.length)
  333.       {
  334.          this.mainMenu.options.currentIndex = 0;
  335.       }
  336.       this[this.mainMenu.options.array[this.mainMenu.options.currentIndex].highlight]();
  337.    }
  338.    function mainM(what)
  339.    {
  340.       if(what == "up")
  341.       {
  342.          this.shiftMainMenu(1);
  343.       }
  344.       if(what == "down")
  345.       {
  346.          this.shiftMainMenu(-1);
  347.       }
  348.       if(what == "enter" || what == "right")
  349.       {
  350.          this[this.mainMenu.array[this.mainMenu.currentIndex].exec]();
  351.       }
  352.    }
  353.    function options(what)
  354.    {
  355.       if(what == "up")
  356.       {
  357.          this.shiftOptions(-1);
  358.       }
  359.       if(what == "down")
  360.       {
  361.          this.shiftOptions(1);
  362.       }
  363.       if(what == "enter" || what == "right")
  364.       {
  365.          this[this.mainMenu.options.array[this.mainMenu.options.currentIndex].exec]();
  366.       }
  367.       if(what == "left")
  368.       {
  369.          this.optionsExitX();
  370.       }
  371.    }
  372.    function info(what)
  373.    {
  374.       if(what == "right")
  375.       {
  376.          if(this.mainMenu.info.currentFrame != this.clip.screen.info._totalframes)
  377.          {
  378.             this.mainMenu.info.currentFrame = this.mainMenu.info.currentFrame + 1;
  379.             this.clip.screen.info.gotoAndStop(this.mainMenu.info.currentFrame);
  380.          }
  381.       }
  382.       if(what == "left")
  383.       {
  384.          if(this.mainMenu.info.currentFrame != 1)
  385.          {
  386.             this.mainMenu.info.currentFrame--;
  387.             this.clip.screen.info.gotoAndStop(this.mainMenu.info.currentFrame);
  388.          }
  389.          else
  390.          {
  391.             this.infoExitX();
  392.          }
  393.       }
  394.    }
  395.    function showConfig()
  396.    {
  397.       var _loc5_ = ["moveU","moveD","moveL","moveR","fireU","fireD","fireL","fireR"];
  398.       var _loc4_ = 0;
  399.       while(_loc4_ < 8)
  400.       {
  401.          var _loc3_ = _root[_loc5_[_loc4_]];
  402.          if(_loc3_ == 38 || _loc3_ == 37 || _loc3_ == 39 || _loc3_ == 40)
  403.          {
  404.             this.clip.screen.info["a" + _loc5_[_loc4_]].gotoAndStop("k" + _loc3_);
  405.             this.clip.screen.info[_loc5_[_loc4_]].text = "";
  406.          }
  407.          else
  408.          {
  409.             this.clip.screen.info["a" + _loc5_[_loc4_]].gotoAndStop(1);
  410.             this.clip.screen.info[_loc5_[_loc4_]].text = chr(_loc3_);
  411.          }
  412.          _loc4_ = _loc4_ + 1;
  413.       }
  414.    }
  415.    function recon(what)
  416.    {
  417.       if(!this.reconfig)
  418.       {
  419.          this.clip.screen.info.switchCredits._alpha = 15;
  420.          this.clip.screen.info.b1.enabled = false;
  421.          this.clip.screen.info.b2.enabled = false;
  422.          this.clip.screen.info.b3.enabled = false;
  423.          this.reconKey = what;
  424.          this.reconfig = true;
  425.          this.clip.screen.info["a" + this.reconKey].gotoAndStop(1);
  426.          this.clip.screen.info[this.reconKey].text = "?";
  427.          var _loc3_ = 0;
  428.          var _loc4_ = this.reconArray.length;
  429.          while(_loc3_ < _loc4_)
  430.          {
  431.             if(this.reconArray[_loc3_] == _root[this.reconKey])
  432.             {
  433.                this.reconArray.splice(_loc3_,1);
  434.                this.reconIndex = _loc3_;
  435.                break;
  436.             }
  437.             _loc3_ = _loc3_ + 1;
  438.          }
  439.       }
  440.    }
  441.    function sendReconKey(code, ascii)
  442.    {
  443.       if(code >= 37 && code <= 40 || code >= 48 && code <= 57 || code >= 65 && code <= 90)
  444.       {
  445.          this.reconfig = false;
  446.          var _loc5_ = 0;
  447.          var _loc7_ = this.reconArray.length;
  448.          while(_loc5_ < _loc7_)
  449.          {
  450.             if(this.reconArray[_loc5_] == code)
  451.             {
  452.                var _loc6_ = _loc5_ >= this.reconIndex ? _loc5_ + 1 : _loc5_;
  453.                this.reconfig = true;
  454.                this.reconArray.splice(this.reconIndex,0,code);
  455.                var _loc4_ = ["moveU","moveD","moveL","moveR","fireU","fireD","fireL","fireR"];
  456.                if(code == 38 || code == 37 || code == 39 || code == 40)
  457.                {
  458.                   this.clip.screen.info["a" + _loc4_[this.reconIndex]].gotoAndStop("k" + code);
  459.                   this.clip.screen.info[_loc4_[this.reconIndex]].text = "";
  460.                }
  461.                else
  462.                {
  463.                   this.clip.screen.info["a" + _loc4_[this.reconIndex]].gotoAndStop(1);
  464.                   this.clip.screen.info[_loc4_[this.reconIndex]].text = chr(code);
  465.                }
  466.                _root[this.reconKey] = code;
  467.                this.reconIndex = _loc6_;
  468.                this.reconArray.splice(this.reconIndex,1);
  469.                this.reconKey = _loc4_[this.reconIndex];
  470.                this.clip.screen.info["a" + this.reconKey].gotoAndStop(1);
  471.                this.clip.screen.info[this.reconKey].text = "?";
  472.                break;
  473.             }
  474.             _loc5_ = _loc5_ + 1;
  475.          }
  476.          if(!this.reconfig)
  477.          {
  478.             if(code == 38 || code == 37 || code == 39 || code == 40)
  479.             {
  480.                this.clip.screen.info["a" + this.reconKey].gotoAndStop("k" + code);
  481.                this.clip.screen.info[this.reconKey].text = "";
  482.             }
  483.             else
  484.             {
  485.                this.clip.screen.info["a" + this.reconKey].gotoAndStop(1);
  486.                this.clip.screen.info[this.reconKey].text = chr(code);
  487.             }
  488.             _root[this.reconKey] = code;
  489.             this.reconArray.splice(this.reconIndex,0,code);
  490.             this.clip.screen.info.switchCredits._alpha = 100;
  491.             this.clip.screen.info.b1.enabled = true;
  492.             this.clip.screen.info.b2.enabled = true;
  493.             this.clip.screen.info.b3.enabled = true;
  494.          }
  495.       }
  496.    }
  497.    function switchRecon()
  498.    {
  499.       if(!this.reconfig)
  500.       {
  501.          var _loc3_ = _root.fireU;
  502.          var _loc4_ = _root.fireD;
  503.          var _loc6_ = _root.fireL;
  504.          var _loc5_ = _root.fireR;
  505.          _root.fireU = _root.moveU;
  506.          _root.fireD = _root.moveD;
  507.          _root.fireL = _root.moveL;
  508.          _root.fireR = _root.moveR;
  509.          _root.moveU = _loc3_;
  510.          _root.moveD = _loc4_;
  511.          _root.moveL = _loc6_;
  512.          _root.moveR = _loc5_;
  513.          this.showConfig();
  514.          var _loc7_ = this.reconArray.splice(0,4);
  515.          this.reconArray = this.reconArray.concat(_loc7_);
  516.       }
  517.    }
  518.    function pressRight()
  519.    {
  520.       this[this.mainMenu.focus]("right");
  521.    }
  522.    function pressLeft()
  523.    {
  524.       this[this.mainMenu.focus]("left");
  525.    }
  526.    function pressDown()
  527.    {
  528.       this[this.mainMenu.focus]("down");
  529.    }
  530.    function pressUp()
  531.    {
  532.       this[this.mainMenu.focus]("up");
  533.    }
  534.    function pressEnter()
  535.    {
  536.       this[this.mainMenu.focus]("enter");
  537.    }
  538.    function showHangar()
  539.    {
  540.       _root.aC1.s1.setVolume(75);
  541.       this.clip.removeMovieClip();
  542.       this.clip2.removeMovieClip();
  543.       _root.introBro1.x = 1200;
  544.       _root.introBro2.x = 1050;
  545.       _root.introBroMaskClip.removeMovieClip();
  546.       _root.introBro1.xMov = -5;
  547.       _root.introBro2.xMov = -5;
  548.       _root.introBro1Clip._alpha = 100;
  549.       _root.introBro2Clip._alpha = 100;
  550.       _root.introBro1Clip.setMask(null);
  551.       _root.introBro1.f2 = "";
  552.       _root.introBro2.f2 = "";
  553.       if(this.wheelBot)
  554.       {
  555.          _root.removeChar("wheelBot");
  556.          this.wheelBot = false;
  557.       }
  558.       if(this.flyBot)
  559.       {
  560.          _root.removeChar("flyBot");
  561.          this.flyBot = false;
  562.       }
  563.       _root.introBro1.x = 1250;
  564.       _root.introBro2.x = 1050;
  565.       this.clip = _root.attachMovie("hangar","hangar",90000);
  566.       this.clip.mainClip.bitmap.cacheAsBitmap = true;
  567.       this.mainRoutine = "hangar";
  568.       this.f2 = "waitForShips";
  569.    }
  570.    function startGame()
  571.    {
  572.       _root.initWaveScripts();
  573.       this.clip.menu.btStart.enabled = false;
  574.       this.clip.menu.btInfo.enabled = false;
  575.       this.clip.menu.btOptions.enabled = false;
  576.       this.clip.menu.start.gotoAndStop("on");
  577.       Key.removeListener(this.keyListener);
  578.       this.gameStarted = true;
  579.       _root.introBro1.startGame();
  580.       _root.introBro2.startGame();
  581.       this.f2 = "starting1";
  582.    }
  583.    function startGame2()
  584.    {
  585.       _root.initWaveScripts();
  586.       this.clip.removeMovieClip();
  587.       this.clip2.removeMovieClip();
  588.       _root.removeChar("introBro1");
  589.       _root.removeChar("introBro2");
  590.       _root.introBroMaskClip.removeMovieClip();
  591.       if(this.wheelBot)
  592.       {
  593.          _root.removeChar("wheelBot");
  594.          this.wheelBot = false;
  595.       }
  596.       if(this.flyBot)
  597.       {
  598.          _root.removeChar("flyBot");
  599.          this.flyBot = false;
  600.       }
  601.       if(_root.char == "broShip1")
  602.       {
  603.          _root.broShip1 = new classes.bro.BroShip1(794,196);
  604.          _root.addChar("broShip1");
  605.       }
  606.       else if(_root.char == "broShip2")
  607.       {
  608.          _root.broShip2 = new classes.bro.BroShip2(408,196);
  609.          _root.addChar("broShip2");
  610.       }
  611.       else if(_root.char == "bro1")
  612.       {
  613.          _root.bro1 = new classes.bro.Bro1(408,196);
  614.          _root.addChar("bro1");
  615.       }
  616.       else if(_root.char == "bro2")
  617.       {
  618.          _root.bro2 = new classes.bro.Bro2(408,196);
  619.          _root.addChar("bro2");
  620.       }
  621.       if(_root.char2 == "broShip1")
  622.       {
  623.          _root.broShip1 = new classes.bro.BroShip1(794,196);
  624.          _root.addChar("broShip1");
  625.       }
  626.       else if(_root.char2 == "broShip2")
  627.       {
  628.          _root.broShip2 = new classes.bro.BroShip2(408,196);
  629.          _root.addChar("broShip2");
  630.       }
  631.       else if(_root.char2 == "bro1")
  632.       {
  633.          _root.bro1 = new classes.bro.Bro1(408,196);
  634.          _root.addChar("bro1");
  635.       }
  636.       else if(_root.char2 == "bro2")
  637.       {
  638.          _root.bro2 = new classes.bro.Bro2(408,196);
  639.          _root.addChar("bro2");
  640.       }
  641.       if(_root.char == "broShip1")
  642.       {
  643.          _root.broShip2.action1();
  644.       }
  645.       else
  646.       {
  647.          _root.broShip1.action1();
  648.       }
  649.       _root.game = 1;
  650.       _root.levelInit();
  651.       _root.removeFX("intro");
  652.       _root.starB.stopStars();
  653.       _root.star = new classes.fx.Star();
  654.       _root.addFX("star");
  655.       _root.star.phase2();
  656.    }
  657.    function starting1()
  658.    {
  659.       if(_root.introBro2.x <= 264)
  660.       {
  661.          _root.introBro2.punchOut();
  662.          this.f2 = "starting2";
  663.       }
  664.    }
  665.    function starting2()
  666.    {
  667.       if(_root.introBro1.x <= 310)
  668.       {
  669.          if(!_root.bro1Punch)
  670.          {
  671.             _root.introBro1.wait();
  672.          }
  673.          this.f2 = "starting3";
  674.       }
  675.    }
  676.    function starting3()
  677.    {
  678.       if(_root.introBro1.x <= 264)
  679.       {
  680.          _root.introBro1.punchOut();
  681.          delete _root.bro1Punch;
  682.          this.f2 = "starting4";
  683.       }
  684.    }
  685.    function starting4()
  686.    {
  687.       if(_root.introBro1.x < 50)
  688.       {
  689.          this.showHangar();
  690.       }
  691.    }
  692.    function controlRoom()
  693.    {
  694.       if(random(1000) > 997 && !this.wheelBot && !this.wheelDoorOpen)
  695.       {
  696.          this.wheelBot = true;
  697.          _root.wheelBot = new classes.misc.WheelBot(0,492);
  698.          _root.addChar("wheelBot");
  699.       }
  700.       if(random(1000) > 997 && !this.flyBot)
  701.       {
  702.          this.flyBot = true;
  703.          _root.flyBot = new classes.misc.FlyBot(24,399);
  704.          _root.addChar("flyBot");
  705.       }
  706.       if(Key.isDown(32) && !this.gameStarted)
  707.       {
  708.          this.startGame();
  709.       }
  710.       if(Key.isDown(16) && this.gameStarted)
  711.       {
  712.          this.startGame2();
  713.       }
  714.       this.neonVar += _root.randRange(-35,35);
  715.       if(random(10) > 2)
  716.       {
  717.          this.neonVar = 0;
  718.       }
  719.       this.colorTrans.redOffset = this.neonVar;
  720.       this.colorTrans.greenOffset = this.neonVar;
  721.       this.colorTrans.blueOffset = this.neonVar;
  722.       this.trans.colorTransform = this.colorTrans;
  723.       if(random(100) > 95)
  724.       {
  725.          _root.audio.playLevel5("computerBlip" + (random(16) + 1),_root.randRange(2,8));
  726.       }
  727.       if(random(200) == 199)
  728.       {
  729.          _root.audio.playLevel5("computer" + (random(7) + 2),_root.randRange(2,7));
  730.       }
  731.    }
  732.    function hangar()
  733.    {
  734.    }
  735.    function waitForShips()
  736.    {
  737.       if(_root.introBro1.x <= 612 && !this.bro1EnteringShip)
  738.       {
  739.          this.bro1EnteringShip = true;
  740.          _root.removeChar("introBro1");
  741.          _root.hangar.broShip1.gotoAndPlay("getInShip");
  742.       }
  743.       if(_root.introBro2.x <= 465 && !this.bro2EnteringShip)
  744.       {
  745.          this.bro2EnteringShip = true;
  746.          _root.removeChar("introBro2");
  747.          _root.hangar.broShip2.gotoAndPlay("getInShip");
  748.       }
  749.    }
  750.    function bro1EnteredShip()
  751.    {
  752.       _root.hangar.broShip1.gotoAndStop("main");
  753.       _root.hangar.broShip1.clip.gotoAndStop(2);
  754.       _root.hangar.broShip1B.gotoAndStop("main");
  755.       _root.hangar.broShip1B.clip.gotoAndStop(2);
  756.       this.chooseBro();
  757.    }
  758.    function bro2EnteredShip()
  759.    {
  760.       _root.hangar.broShip2.gotoAndStop("main");
  761.       _root.hangar.broShip2.clip.gotoAndStop(2);
  762.       _root.hangar.broShip2B.gotoAndStop("main");
  763.       _root.hangar.broShip2B.clip.gotoAndStop(2);
  764.    }
  765.    function chooseBro()
  766.    {
  767.       this.f2 = "broChoosing";
  768.       _root.attachMovie("selectArrow","selectArrowClip",90510);
  769.       _root.selectArrowClip._x = 414;
  770.       _root.selectArrowClip._y = 372;
  771.       _root.hangar.broShip2.clip.body.gotoAndStop("faceF");
  772.    }
  773.    function broChoosing()
  774.    {
  775.       if(Key.isDown(37))
  776.       {
  777.          if(this.currentBro == 1)
  778.          {
  779.             _root.selectArrowClip._x = 414;
  780.             this.currentBro = 2;
  781.             _root.audio.playLevel5("buzzSelect",5);
  782.             _root.hangar.broShip2.clip.body.gotoAndStop("faceF");
  783.             _root.hangar.broShip1.clip.body.gotoAndStop("FU");
  784.          }
  785.       }
  786.       if(Key.isDown(39))
  787.       {
  788.          if(this.currentBro == 2)
  789.          {
  790.             _root.selectArrowClip._x = 561;
  791.             this.currentBro = 1;
  792.             _root.audio.playLevel5("zapSelect",5);
  793.             _root.hangar.broShip1.clip.body.gotoAndStop("faceF");
  794.             _root.hangar.broShip2.clip.body.gotoAndStop("FU");
  795.          }
  796.       }
  797.       if(Key.isDown(13))
  798.       {
  799.          _root.selectArrowClip.removeMovieClip();
  800.          _root.char = this.currentBro != 1 ? "broShip2" : "broShip1";
  801.          _root.char2 = this.currentBro != 1 ? "broShip1" : "broShip2";
  802.          _root.hangar.broShip1.clip.body.gotoAndStop("FU");
  803.          _root.hangar.broShip2.clip.body.gotoAndStop("FU");
  804.          this.descend();
  805.       }
  806.    }
  807.    function descend()
  808.    {
  809.       _root.audio.playLevel2("floorDrop",25);
  810.       _root.audio.playLevel1("exitTheme",12,1,0.05);
  811.       _root.hangar.gotoAndPlay("go");
  812.       this.f2 = "descending";
  813.       this.mainRoutine = "";
  814.       _root.star = new classes.fx.Star();
  815.       _root.addFX("star");
  816.    }
  817.    function descending()
  818.    {
  819.       this.c2 = this.c2 + 1;
  820.       if(this.c2 == 60)
  821.       {
  822.          _root.starB.stopStars();
  823.          _root.star.makeStars();
  824.       }
  825.    }
  826.    function controlShip()
  827.    {
  828.       _root.hangar.broShip1._visible = false;
  829.       _root.hangar.broShip2._visible = false;
  830.       _root.broShip1 = new classes.bro.BroShip1(794,202);
  831.       _root.addChar("broShip1");
  832.       _root.broShip2 = new classes.bro.BroShip2(408,202);
  833.       _root.addChar("broShip2");
  834.       if(_root.warp)
  835.       {
  836.          _root[_root.char2].warpLeave();
  837.       }
  838.       else
  839.       {
  840.          _root[_root.char2].action1();
  841.       }
  842.       _root.game = 1;
  843.    }
  844.    function startAction()
  845.    {
  846.       this.clip.removeMovieClip();
  847.       _root.levelInit();
  848.       _root.star.phase2();
  849.       _root.removeFX("intro");
  850.    }
  851.    function main()
  852.    {
  853.       this[this.f2]();
  854.       this[this.mainRoutine]();
  855.    }
  856. }
  857.