home *** CD-ROM | disk | FTP | other *** search
/ 404 Jogos / CLJG.iso / Aventura / Frizzle_fraz.swf / scripts / Code / LOGIC / _cd449.as
Encoding:
Text File  |  2008-09-26  |  28.3 KB  |  929 lines

  1. package Code.LOGIC
  2. {
  3.    import Code.LIB.SOUND._wj196;
  4.    import Code.LIB._bm350;
  5.    import Code.LIB._iv163;
  6.    import Code.LIB._ja537;
  7.    import Code.LIB._lq68;
  8.    import Code.LIB._uu24;
  9.    import Code.LOGIC.OBJECTS.ACTORS.BLOB._be439;
  10.    import Code.LOGIC.OBJECTS.ACTORS.BLOB._hg469;
  11.    import Code.LOGIC.OBJECTS.ACTORS.BLOB._la458;
  12.    import Code.LOGIC.OBJECTS.ACTORS.BLOB._pg56;
  13.    import Code.LOGIC.OBJECTS.ACTORS.INTERFACES._mk516;
  14.    import Code.LOGIC.OBJECTS.ACTORS.INTERFACES._xn130;
  15.    import Code.LOGIC.OBJECTS.ACTORS.RECTS._bk73;
  16.    import Code.LOGIC.OBJECTS.ACTORS.RECTS._dt98;
  17.    import Code.LOGIC.OBJECTS.ACTORS.RECTS._gg531;
  18.    import Code.LOGIC.OBJECTS.ACTORS.RECTS._le239;
  19.    import Code.LOGIC.OBJECTS.ACTORS.RECTS._st436;
  20.    import Code.LOGIC.OBJECTS.ACTORS.RECTS._tr528;
  21.    import Code.LOGIC.OBJECTS.ACTORS._ap353;
  22.    import Code.LOGIC.OBJECTS.ACTORS._kp67;
  23.    import Code.LOGIC.OBJECTS.ACTORS._sg87;
  24.    import Code.LOGIC.OBJECTS.ACTORS._tv77;
  25.    import Code.LOGIC.OBJECTS.ACTORS._uy463;
  26.    import Code.LOGIC.OBJECTS.GRAPHICS._cl163;
  27.    import Code.LOGIC.OBJECTS.GRAPHICS._wv496;
  28.    import Code.LOGIC.OBJECTS.OBJECTS._bd467;
  29.    import Code.LOGIC.OBJECTS.OBJECTS._fj490;
  30.    import Code.LOGIC.OBJECTS.OBJECTS._ix78;
  31.    import Code.LOGIC.OBJECTS.OBJECTS._mt59;
  32.    import Code.LOGIC.OBJECTS.OBJECTS._pc67;
  33.    import Code.OPTIONS._dx111;
  34.    import Code.org.cove.ape._be271;
  35.    import Code.org.cove.ape._gf356;
  36.    import Code.org.cove.ape._hj251;
  37.    import Code.org.cove.ape._hu144;
  38.    import Code.org.cove.ape._rv416;
  39.    import Code.org.cove.ape._yo331;
  40.    import flash.display.Sprite;
  41.    import flash.events.Event;
  42.    import flash.events.KeyboardEvent;
  43.    import flash.filters.BlurFilter;
  44.    import flash.geom.Point;
  45.    import flash.geom.Rectangle;
  46.    
  47.    public class _cd449 extends _ja537
  48.    {
  49.       
  50.       public static const screenWidth:int = 800;
  51.       
  52.       public static const screenHeight:int = 600;
  53.       
  54.       public static const G:Number = 3.5;
  55.       
  56.       public static const SECTOR_SIZE:int = int(600);
  57.       
  58.       public static const stWin:int = 6;
  59.       
  60.       public static var timerWater:int;
  61.       
  62.       public static const stScroll:int = 3;
  63.       
  64.       public static var BLOB:_be439;
  65.       
  66.       public static const stNormal:int = 1;
  67.       
  68.       public static const stDoor:int = 4;
  69.       
  70.       public static const stBlow:int = 2;
  71.       
  72.       public static const stHideField:int = 5;
  73.       
  74.       public static const stLoose:int = 7;
  75.       
  76.       public static const stShow:int = 0;
  77.        
  78.       
  79.       private var checkPoints:Array;
  80.       
  81.       protected var rightWall:_tr528;
  82.       
  83.       private var doorFlag:Boolean = false;
  84.       
  85.       private var engine:_hj251;
  86.       
  87.       protected var leftWall:_tr528;
  88.       
  89.       private var state:int;
  90.       
  91.       protected var container:_pc67;
  92.       
  93.       private var activeGroups:Array;
  94.       
  95.       private var collectedBlobs:Array;
  96.       
  97.       private var defaultGroup:_yo331;
  98.       
  99.       private var saveBlobs:Boolean;
  100.       
  101.       private var blows:Array;
  102.       
  103.       public var paused:Boolean;
  104.       
  105.       private var currCheckPoint:int = 0;
  106.       
  107.       private var sectorsCount:int;
  108.       
  109.       private var timer:int;
  110.       
  111.       private var keyBuff:Object;
  112.       
  113.       private var endGame:Boolean = false;
  114.       
  115.       protected var maxID:int;
  116.       
  117.       private var _startInd:int = -1;
  118.       
  119.       protected var level:Object;
  120.       
  121.       protected var SHOW_CHECKPOINTS:Boolean = false;
  122.       
  123.       private var effect:_fj490;
  124.       
  125.       private var blob:_be439;
  126.       
  127.       private var topPanel:_mt59;
  128.       
  129.       private var explodes:Object;
  130.       
  131.       private var door:_bk73;
  132.       
  133.       private var mapWidth:int;
  134.       
  135.       protected var stopped:Boolean = true;
  136.       
  137.       protected var groups:Array;
  138.       
  139.       private var win:Boolean;
  140.       
  141.       private var textMsgs:Array;
  142.       
  143.       private var pushForce:_be271;
  144.       
  145.       public function _cd449(param1:Object)
  146.       {
  147.          SHOW_CHECKPOINTS = false;
  148.          stopped = true;
  149.          keyBuff = {
  150.             "leftKey":false,
  151.             "rightKey":false,
  152.             "upKey":false,
  153.             "downKey":false
  154.          };
  155.          activeGroups = [0,0,0];
  156.          explodes = {};
  157.          currCheckPoint = 0;
  158.          _startInd = -1;
  159.          doorFlag = false;
  160.          endGame = false;
  161.          super();
  162.          maxID = 0;
  163.          this.level = param1;
  164.          this.mapWidth = this.level.mapWidth;
  165.          this.sectorsCount = this.mapWidth / SECTOR_SIZE + 1;
  166.          this.container = new _pc67(screenWidth,screenHeight,mapWidth);
  167.          this.addChild(_uu24._sa70(new _dx111.GGameBg()));
  168.          this.addChild(container);
  169.          _bm350.prStage.frameRate = 35;
  170.          this.engine = new _hj251();
  171.          _hj251.INST = this.engine;
  172.          this.engine.init(1 / 4);
  173.          this.engine.container = container;
  174.          this.engine._pj361(new _be271(0,G));
  175.          this.blows = new Array();
  176.          this.checkPoints = new Array();
  177.          this.collectedBlobs = new Array();
  178.          _nk262();
  179.          this.scrollRect = new Rectangle(0,0,800 * _bm350._tc204,600 * _bm350._tc204);
  180.          stopped = false;
  181.       }
  182.       
  183.       public function _mc381(param1:int, param2:Point) : void
  184.       {
  185.          var _loc3_:String = null;
  186.          var _loc4_:Object = null;
  187.          var _loc5_:_ix78 = null;
  188.          _loc3_ = String(textMsgs[param1]);
  189.          _loc4_ = {
  190.             "text":_loc3_,
  191.             "width":150,
  192.             "height":120,
  193.             "textSize":18,
  194.             "picture":new _dx111.GCloud() as Sprite
  195.          };
  196.          (_loc5_ = new _ix78(_loc4_))._gm53(param2.x,param2.y - _loc5_.height / _bm350._tc204 - 40);
  197.          this.container.addChild(_loc5_);
  198.       }
  199.       
  200.       private function _ln110(param1:Array, param2:Number, param3:Number) : _cl163
  201.       {
  202.          var _loc4_:_cl163 = null;
  203.          (_loc4_ = new _cl163(param1))._gm53(param2,param3);
  204.          this.blows.push(_loc4_);
  205.          this.container.addChild(_loc4_);
  206.          return _loc4_;
  207.       }
  208.       
  209.       protected function _nk262() : void
  210.       {
  211.          var _loc1_:int = 0;
  212.          var _loc2_:int = 0;
  213.          var _loc3_:Array = null;
  214.          var _loc4_:Object = null;
  215.          var _loc5_:_mk516 = null;
  216.          var _loc6_:String = null;
  217.          saveBlobs = false;
  218.          this.groups = new Array();
  219.          _loc1_ = 0;
  220.          while(_loc1_ < this.sectorsCount)
  221.          {
  222.             this.groups.push(new _yo331(true));
  223.             _loc1_++;
  224.          }
  225.          this.defaultGroup = new _yo331(true);
  226.          this.engine._yd219(defaultGroup);
  227.          _loc1_ = 0;
  228.          while(_loc1_ < this.groups.length - 1)
  229.          {
  230.             _yo331(groups[_loc1_])._fc291(defaultGroup);
  231.             _yo331(groups[_loc1_])._fc291(groups[_loc1_ + 1]);
  232.             _loc1_++;
  233.          }
  234.          _loc2_ = 0;
  235.          _loc3_ = _xy153(this.level.objects);
  236.          _loc1_ = 0;
  237.          for(; _loc1_ < _loc3_.length; _loc1_++)
  238.          {
  239.             if((_loc5_ = _loc3_[_loc1_]) is _sg87 && _sg87(_loc5_).type == _sg87.TYPE_KEY)
  240.             {
  241.                _loc2_++;
  242.             }
  243.             else if(_loc5_ is _bk73)
  244.             {
  245.                door = _bk73(_loc5_);
  246.             }
  247.             else if(_loc5_ is _kp67 && !SHOW_CHECKPOINTS)
  248.             {
  249.                continue;
  250.             }
  251.             addItem(_loc5_);
  252.          }
  253.          if(level.defaultGroup)
  254.          {
  255.             _loc3_ = _xy153(this.level.defaultGroup);
  256.             _loc1_ = 0;
  257.             while(_loc1_ < _loc3_.length)
  258.             {
  259.                _loc5_ = _loc3_[_loc1_];
  260.                defaultGroup._dq187(_hu144(_loc5_));
  261.                _loc1_++;
  262.             }
  263.          }
  264.          _loc4_ = {
  265.             "State":0,
  266.             "x":-50,
  267.             "_ew250":true,
  268.             "y":0,
  269.             "rotation":0,
  270.             "prClass":_tr528,
  271.             "width":50,
  272.             "_tp253":56,
  273.             "action":"",
  274.             "height":600,
  275.             "active":false
  276.          };
  277.          leftWall = new _tr528(_loc4_);
  278.          addItem(leftWall);
  279.          _loc4_ = {
  280.             "State":0,
  281.             "x":level.mapWidth,
  282.             "_ew250":true,
  283.             "y":0,
  284.             "rotation":0,
  285.             "prClass":_tr528,
  286.             "width":50,
  287.             "_tp253":56,
  288.             "action":"",
  289.             "height":600,
  290.             "active":false
  291.          };
  292.          rightWall = new _tr528(_loc4_);
  293.          addItem(rightWall);
  294.          container._qm444 = 0;
  295.          container._wl52 = screenHeight;
  296.          container.scrollY = level.scrollY;
  297.          this.explodes = {
  298.             "playerBlob":_cl163._jl109(new _dx111.GPlayerBlobComplete() as Sprite,15),
  299.             "heart":_cl163._jl109(new _dx111.GHeart() as Sprite,15),
  300.             "key":_cl163._jl109(new _dx111.GKey() as Sprite,15),
  301.             "greenBlob":_uu24._sa70(new _dx111.GBlobGreen() as Sprite,0.3),
  302.             "yellowBlob":_uu24._sa70(new _dx111.GBlobYellow() as Sprite,0.3)
  303.          };
  304.          this.textMsgs = new Array();
  305.          _loc1_ = 0;
  306.          while(_loc1_ < level.txtMsgs.length)
  307.          {
  308.             _loc6_ = String(level.txtMsgs[_loc1_]);
  309.             this.textMsgs.push(_loc6_.slice(0,_loc6_.length - 1));
  310.             _loc1_++;
  311.          }
  312.          this.topPanel = new _mt59(_loc2_);
  313.          this.topPanel._uk503 = _bm350.lives > 0 ? _bm350.lives : 2;
  314.          if(_bm350.lives == 0)
  315.          {
  316.             _bm350.lives = 2;
  317.          }
  318.          addChild(topPanel);
  319.          paused = false;
  320.          _cd449.timerWater = 0;
  321.          this.State = stNormal;
  322.       }
  323.       
  324.       private function _be25() : void
  325.       {
  326.          var _loc1_:Object = null;
  327.          var _loc2_:int = 0;
  328.          var _loc3_:_iv163 = null;
  329.          _loc1_ = {
  330.             "x":checkPoints[currCheckPoint]._ej28,
  331.             "y":checkPoints[currCheckPoint]._th99,
  332.             "radius":22,
  333.             "color":_dx111.cAqua
  334.          };
  335.          this.blob = new _be439(_loc1_);
  336.          this.blob._my161 = this._gt261;
  337.          this.defaultGroup._dq187(blob);
  338.          if(saveBlobs)
  339.          {
  340.             _loc2_ = 0;
  341.             while(_loc2_ < collectedBlobs.length)
  342.             {
  343.                _loc3_ = _hg469(collectedBlobs[_loc2_]).color == _hg469.GREEN ? explodes.greenBlob : explodes.yellowBlob;
  344.                _wv496(blob._ny250)._cj212(_loc3_._dx22());
  345.                _loc2_++;
  346.             }
  347.          }
  348.          _cd449.BLOB = blob;
  349.       }
  350.       
  351.       private function _ee494() : void
  352.       {
  353.          var _loc1_:int = 0;
  354.          var _loc2_:int = 0;
  355.          var _loc3_:Number = NaN;
  356.          var _loc4_:int = 0;
  357.          var _loc5_:int = 0;
  358.          var _loc6_:* = false;
  359.          var _loc7_:Array = null;
  360.          var _loc8_:int = 0;
  361.          var _loc9_:_yo331 = null;
  362.          var _loc10_:_yo331 = null;
  363.          var _loc11_:Array = null;
  364.          var _loc12_:Array = null;
  365.          var _loc13_:_hu144 = null;
  366.          var _loc14_:_la458 = null;
  367.          var _loc15_:int = 0;
  368.          var _loc16_:_yo331 = null;
  369.          var _loc17_:_gf356 = null;
  370.          _loc3_ = this.container._qm444;
  371.          if((_loc5_ = (_loc4_ = _loc3_ / SECTOR_SIZE) - 1) < 0)
  372.          {
  373.             _loc5_ = 0;
  374.          }
  375.          if(_loc5_ + 3 >= groups.length)
  376.          {
  377.             _loc5_ = groups.length - 3;
  378.          }
  379.          if(_loc6_ = _loc5_ != _startInd)
  380.          {
  381.             _startInd = _loc5_;
  382.             _loc7_ = [];
  383.             _loc1_ = 0;
  384.             while(_loc1_ < 3)
  385.             {
  386.                _loc7_.push(groups[_loc1_ + _loc5_]);
  387.                _loc1_++;
  388.             }
  389.             _loc1_ = 0;
  390.             while(_loc1_ < activeGroups.length)
  391.             {
  392.                if(!(activeGroups[_loc1_] is int))
  393.                {
  394.                   if((_loc8_ = _loc7_.indexOf(activeGroups[_loc1_])) < 0)
  395.                   {
  396.                      this.engine._xb207(activeGroups[_loc1_]);
  397.                      activeGroups[_loc1_] = 0;
  398.                   }
  399.                }
  400.                _loc1_++;
  401.             }
  402.             _loc1_ = 0;
  403.             while(_loc1_ < _loc7_.length)
  404.             {
  405.                if((_loc8_ = activeGroups.indexOf(_loc7_[_loc1_])) < 0)
  406.                {
  407.                   _loc9_ = _loc7_[_loc1_];
  408.                   this.engine._yd219(_loc9_);
  409.                   _loc2_ = 0;
  410.                   while(_loc2_ < activeGroups.length)
  411.                   {
  412.                      if(activeGroups[_loc2_] is int)
  413.                      {
  414.                         activeGroups[_loc2_] = _loc9_;
  415.                         break;
  416.                      }
  417.                      _loc2_++;
  418.                   }
  419.                }
  420.                _loc1_++;
  421.             }
  422.          }
  423.          _loc1_ = 0;
  424.          while(_loc1_ < this.activeGroups.length)
  425.          {
  426.             _loc11_ = (_loc10_ = _yo331(this.activeGroups[_loc1_]))._id359;
  427.             _loc2_ = 0;
  428.             while(_loc2_ < _loc11_.length)
  429.             {
  430.                if((_loc13_ = _loc11_[_loc2_]) is _mk516 && _mk516(_loc13_)._do489)
  431.                {
  432.                   removeItem(_mk516(_loc13_));
  433.                   _loc2_--;
  434.                }
  435.                else if(_loc13_ is _la458)
  436.                {
  437.                   _loc14_ = _la458(_loc13_);
  438.                   _loc15_ = _gg527(_loc14_._ej28);
  439.                   _loc16_ = groups[_loc15_];
  440.                   if(_loc14_._th99 + _loc14_.radius > screenHeight)
  441.                   {
  442.                      _loc14_.State = _la458.stInvisible;
  443.                   }
  444.                   if(_loc16_ != _loc14_.group)
  445.                   {
  446.                      _loc14_.group._rw173(_loc14_);
  447.                      _yo331(groups[_loc15_])._dq187(_loc14_);
  448.                      if(_loc15_ == _loc1_)
  449.                      {
  450.                         _loc1_--;
  451.                      }
  452.                      _loc14_.group = _loc16_;
  453.                   }
  454.                }
  455.                _loc2_++;
  456.             }
  457.             _loc12_ = _loc10_._oj169;
  458.             _loc2_ = 0;
  459.             while(_loc2_ < _loc12_.length)
  460.             {
  461.                if((_loc17_ = _loc12_[_loc2_]) is _tv77)
  462.                {
  463.                   _tv77(_loc17_).rotate();
  464.                }
  465.                _loc2_++;
  466.             }
  467.             _loc1_++;
  468.          }
  469.       }
  470.       
  471.       override public function onEnterFrame(param1:Event) : void
  472.       {
  473.          var _loc2_:int = 0;
  474.          var _loc3_:_cl163 = null;
  475.          var _loc4_:Array = null;
  476.          if(stopped && !paused)
  477.          {
  478.             this.engine._wr15();
  479.             return;
  480.          }
  481.          if(state == stNormal && _bm350.prStage.focus != this)
  482.          {
  483.             _bm350.prStage.focus = this;
  484.          }
  485.          if(paused)
  486.          {
  487.             return;
  488.          }
  489.          ++timerWater;
  490.          this._ee494();
  491.          this.engine._dm39();
  492.          this.engine._wr15();
  493.          _loc2_ = 0;
  494.          while(_loc2_ < blows.length)
  495.          {
  496.             _loc3_ = blows[_loc2_];
  497.             _loc3_.onEnterFrame();
  498.             if(_loc3_._gd168)
  499.             {
  500.                blows.splice(_loc2_,1);
  501.                _loc2_--;
  502.             }
  503.             _loc2_++;
  504.          }
  505.          switch(state)
  506.          {
  507.             case stNormal:
  508.                container._qm444 = blob._ej28;
  509.                container._wl52 = blob._th99;
  510.                if(blob._th99 - blob.radius > screenHeight)
  511.                {
  512.                   _ut545(true);
  513.                }
  514.                blob.leftPressed = keyBuff.leftKey == true;
  515.                blob.rightPressed = keyBuff.rightKey == true;
  516.                blob.upPressed = keyBuff.upKey == true;
  517.                blob.downPressed = keyBuff.downKey == true;
  518.                break;
  519.             case stBlow:
  520.                if(timer++ > 80)
  521.                {
  522.                   State = endGame == true ? stHideField : stScroll;
  523.                }
  524.                break;
  525.             case stScroll:
  526.                if(container.State != _pc67.stScrollTo)
  527.                {
  528.                   State = stNormal;
  529.                }
  530.                break;
  531.             case stDoor:
  532.                _loc4_ = [new BlurFilter()];
  533.                blob._ny250.scaleX = blob._ny250.scaleY = blob._ny250.scaleY - 0.1;
  534.                blob._ny250.filters = _loc4_;
  535.                if(blob._ny250.scaleX < 0.1)
  536.                {
  537.                   State = stHideField;
  538.                   blob._ny250.visible = false;
  539.                   blob.fixed = true;
  540.                }
  541.                break;
  542.             case stHideField:
  543.                effect.onEnterFrame();
  544.                if(effect._cx499)
  545.                {
  546.                   State = win == true ? stWin : stLoose;
  547.                }
  548.          }
  549.       }
  550.       
  551.       public function _tb187(param1:int) : _mk516
  552.       {
  553.          var _loc2_:int = 0;
  554.          var _loc3_:_yo331 = null;
  555.          var _loc4_:Array = null;
  556.          var _loc5_:int = 0;
  557.          _loc2_ = 0;
  558.          while(_loc2_ < this.groups.length)
  559.          {
  560.             _loc3_ = groups[_loc2_];
  561.             _loc4_ = _loc3_._id359.concat(_loc3_._oj169);
  562.             _loc5_ = 0;
  563.             while(_loc5_ < _loc4_.length)
  564.             {
  565.                if(_mk516(_loc4_[_loc5_])._tp253 == param1)
  566.                {
  567.                   return _mk516(_loc4_[_loc5_]);
  568.                }
  569.                _loc5_++;
  570.             }
  571.             _loc2_++;
  572.          }
  573.          return null;
  574.       }
  575.       
  576.       private function set State(param1:int) : void
  577.       {
  578.          var _loc2_:Point = null;
  579.          state = param1;
  580.          switch(state)
  581.          {
  582.             case stNormal:
  583.                this._be25();
  584.                break;
  585.             case stBlow:
  586.                timer = 0;
  587.                break;
  588.             case stScroll:
  589.                container._if60(_kp67(checkPoints[currCheckPoint])._ej28,screenHeight);
  590.                break;
  591.             case stDoor:
  592.                _loc2_ = new Point(door._ej28 - blob._ej28,door._th99 - blob._th99);
  593.                _loc2_.normalize(6);
  594.                blob._rx33 = new _be271(_loc2_.x,_loc2_.y);
  595.                blob._ts56 = false;
  596.                break;
  597.             case stHideField:
  598.                parent.addChild(this);
  599.                effect = new _fj490(this,_fj490.BRICKS,new Rectangle(0,0,800 * _bm350._tc204,600 * _bm350._tc204));
  600.                addChild(effect);
  601.                removeChild(container);
  602.          }
  603.       }
  604.       
  605.       private function _xy153(param1:Array) : Array
  606.       {
  607.          var _loc2_:Array = null;
  608.          var _loc3_:int = 0;
  609.          var _loc4_:Object = null;
  610.          var _loc5_:Object = null;
  611.          _loc2_ = new Array();
  612.          _loc3_ = 0;
  613.          while(_loc3_ < param1.length)
  614.          {
  615.             if((_loc4_ = param1[_loc3_]).prClass is Class)
  616.             {
  617.                _loc5_ = new _loc4_.prClass(_loc4_);
  618.                _loc2_.push(_loc5_);
  619.                if(_loc5_ is _kp67)
  620.                {
  621.                   checkPoints.push(_loc5_);
  622.                }
  623.             }
  624.             _loc3_++;
  625.          }
  626.          return _loc2_;
  627.       }
  628.       
  629.       public function get _sn240() : int
  630.       {
  631.          return state;
  632.       }
  633.       
  634.       protected function addItem(param1:_mk516) : void
  635.       {
  636.          var _loc2_:int = 0;
  637.          var _loc3_:int = 0;
  638.          var _loc4_:_yo331 = null;
  639.          _loc2_ = param1._ej28;
  640.          _loc3_ = _gg527(_loc2_);
  641.          _loc4_ = groups[_loc3_];
  642.          param1.group = _loc4_;
  643.          if(param1 is _hu144)
  644.          {
  645.             _loc4_._dq187(_hu144(param1));
  646.          }
  647.          else if(param1 is _gf356)
  648.          {
  649.             _loc4_._qf444(_gf356(param1));
  650.          }
  651.          else if(param1 is _yo331)
  652.          {
  653.             engine._yd219(_yo331(param1));
  654.          }
  655.          if(param1._tp253 > maxID)
  656.          {
  657.             maxID = param1._tp253;
  658.          }
  659.       }
  660.       
  661.       private function _lg561(param1:_hg469) : void
  662.       {
  663.          var _loc2_:_iv163 = null;
  664.          var _loc3_:_iv163 = null;
  665.          _loc2_ = param1.color == _hg469.GREEN ? explodes.greenBlob : explodes.yellowBlob;
  666.          _loc3_ = _loc2_._dx22();
  667.          _wv496(blob._ny250)._cj212(_loc3_);
  668.          this.collectedBlobs.push(param1);
  669.          this.topPanel._nq84 = collectedBlobs.length;
  670.       }
  671.       
  672.       private function _gg527(param1:Number) : int
  673.       {
  674.          return param1 / SECTOR_SIZE;
  675.       }
  676.       
  677.       public function _gt261(param1:_hu144, param2:_hu144) : void
  678.       {
  679.          var _loc3_:_rv416 = null;
  680.          var _loc4_:Number = NaN;
  681.          var _loc5_:Number = NaN;
  682.          var _loc6_:Number = NaN;
  683.          var _loc7_:Number = NaN;
  684.          var _loc8_:Number = NaN;
  685.          var _loc9_:Number = NaN;
  686.          var _loc10_:Number = NaN;
  687.          var _loc11_:Boolean = false;
  688.          var _loc12_:_sg87 = null;
  689.          var _loc13_:Object = null;
  690.          var _loc14_:_ix78 = null;
  691.          if(param2.owner is _xn130 && _xn130(param2.owner).active)
  692.          {
  693.             if(param2.owner is _le239)
  694.             {
  695.                _wj196._va384("active");
  696.             }
  697.             _bd467._sf232(_xn130(param2.owner).action,_mk516(param2.owner),this);
  698.          }
  699.          if(param2.owner is _ap353)
  700.          {
  701.             blob.inWall = true;
  702.          }
  703.          if(param2 is _gg531 && !(param2 is _dt98) && !(param2 is _bk73) && blob.State != _la458.stSwim && !(param2 is _le239))
  704.          {
  705.             _loc3_ = _rv416(param2);
  706.             if(param2 is _tr528 && !_tr528(_loc3_)._ew250)
  707.             {
  708.                blob._rotatable = true;
  709.                blob.inWall = true;
  710.                return;
  711.             }
  712.             _loc4_ = blob._ej28;
  713.             _loc5_ = blob._th99;
  714.             _loc6_ = _loc3_._ej28;
  715.             _loc7_ = _loc3_._th99;
  716.             _loc8_ = _loc3_.width;
  717.             _loc9_ = _loc3_.height;
  718.             _loc10_ = blob.radius;
  719.             _loc11_ = false;
  720.             if(_loc5_ < _loc7_ - _loc9_ / 2 && _loc4_ > _loc6_ - _loc8_ / 2 - _loc10_ * 2 && _loc4_ < _loc6_ + _loc8_ / 2 + _loc10_ * 2)
  721.             {
  722.                if(param2 is _st436)
  723.                {
  724.                   _wj196._va384("jumper");
  725.                }
  726.                else
  727.                {
  728.                   _wj196._va384("blobJump");
  729.                }
  730.                blob._vr432(param2 is _st436);
  731.             }
  732.          }
  733.          else if(param2 is _hg469)
  734.          {
  735.             _la458(param2)._xa427();
  736.             _lg561(_hg469(param2));
  737.             _wj196._va384("collect");
  738.          }
  739.          if(param2 is _sg87)
  740.          {
  741.             _wj196._va384("bonus");
  742.             _loc12_ = _sg87(param2);
  743.             switch(_loc12_.type)
  744.             {
  745.                case _sg87.TYPE_HEART:
  746.                   _ln110(explodes.heart,_loc12_._ej28,_loc12_._th99);
  747.                   ++this.topPanel._uk503;
  748.                   _bm350.lives = this.topPanel._uk503;
  749.                   break;
  750.                case _sg87.TYPE_KEY:
  751.                   _ln110(explodes.key,_loc12_._ej28,_loc12_._th99);
  752.                   ++this.topPanel._up52;
  753.                   if(this.topPanel._up52 == this.topPanel._wy409)
  754.                   {
  755.                      this.door.open();
  756.                   }
  757.             }
  758.             _loc12_._gd168 = true;
  759.          }
  760.          else if(param2 is _dt98 || param2.owner is _pg56 || param2.owner is _uy463)
  761.          {
  762.             _ut545();
  763.          }
  764.          else if(param2.owner && param2.owner is _tv77 && param2 == _tv77(param2.owner)._ft227)
  765.          {
  766.             _ut545();
  767.          }
  768.          if(state == stNormal && param2.owner is _bk73)
  769.          {
  770.             if(topPanel._up52 == topPanel._wy409)
  771.             {
  772.                win = true;
  773.                endGame = true;
  774.                State = stDoor;
  775.             }
  776.             else if(!doorFlag)
  777.             {
  778.                doorFlag = true;
  779.                _loc13_ = {
  780.                   "text":"you missed\n some keys",
  781.                   "width":150,
  782.                   "height":120,
  783.                   "textSize":18,
  784.                   "picture":new _dx111.GCloud() as Sprite
  785.                };
  786.                (_loc14_ = new _ix78(_loc13_))._gm53(blob._ej28 - 70,blob._th99 - _loc14_.height / _bm350._tc204 - 40);
  787.                this.container.addChild(_loc14_);
  788.             }
  789.          }
  790.       }
  791.       
  792.       override public function _vx267(param1:KeyboardEvent) : void
  793.       {
  794.          switch(param1.keyCode)
  795.          {
  796.             case _lq68.KEY_LEFT:
  797.                keyBuff.leftKey = false;
  798.                break;
  799.             case _lq68.KEY_RIGHT:
  800.                keyBuff.rightKey = false;
  801.                break;
  802.             case _lq68.KEY_UP:
  803.                keyBuff.upKey = false;
  804.                break;
  805.             case _lq68.KEY_DOWN:
  806.                keyBuff.downKey = false;
  807.          }
  808.       }
  809.       
  810.       public function _ut545(param1:Boolean = false) : void
  811.       {
  812.          var _loc2_:_hg469 = null;
  813.          saveBlobs = param1;
  814.          _wj196._va384("blobBlow");
  815.          blob.State = _la458.stInvisible;
  816.          this.defaultGroup._rw173(blob);
  817.          _ln110(explodes.playerBlob,blob._ej28,blob._th99);
  818.          this.State = stBlow;
  819.          --this.topPanel._uk503;
  820.          _bm350.lives = this.topPanel._uk503;
  821.          if(this.topPanel._uk503 == 0)
  822.          {
  823.             win = false;
  824.             endGame = true;
  825.             State = stBlow;
  826.             return;
  827.          }
  828.          this.currCheckPoint = _yd54(blob);
  829.          if(param1)
  830.          {
  831.             return;
  832.          }
  833.          while(collectedBlobs.length > 0)
  834.          {
  835.             _loc2_ = collectedBlobs[0];
  836.             collectedBlobs.splice(0,1);
  837.             _loc2_.position = new _be271(blob._ej28,blob._th99);
  838.             _loc2_.State = _la458.stMove;
  839.             _loc2_.fixed = false;
  840.             _loc2_._rx33 = new _be271(Math.random() * 7 - Math.random() * 7,Math.random() * 7 - Math.random() * 7);
  841.             addItem(_loc2_);
  842.          }
  843.          topPanel._nq84 = collectedBlobs.length;
  844.       }
  845.       
  846.       public function get _kw428() : int
  847.       {
  848.          return collectedBlobs.length;
  849.       }
  850.       
  851.       override public function _fx43(param1:KeyboardEvent) : void
  852.       {
  853.          switch(param1.keyCode)
  854.          {
  855.             case _lq68.KEY_LEFT:
  856.                keyBuff.leftKey = true;
  857.                break;
  858.             case _lq68.KEY_RIGHT:
  859.                keyBuff.rightKey = true;
  860.                break;
  861.             case _lq68.KEY_UP:
  862.                keyBuff.upKey = true;
  863.                break;
  864.             case _lq68.KEY_DOWN:
  865.                keyBuff.downKey = true;
  866.          }
  867.       }
  868.       
  869.       protected function removeItem(param1:_mk516) : void
  870.       {
  871.          var _loc2_:_yo331 = null;
  872.          _loc2_ = param1.group;
  873.          param1.group = null;
  874.          if(param1 is _hu144)
  875.          {
  876.             _loc2_._rw173(_hu144(param1));
  877.          }
  878.          else
  879.          {
  880.             _loc2_._uo329(_gf356(param1));
  881.          }
  882.       }
  883.       
  884.       private function _yd54(param1:_be439) : int
  885.       {
  886.          var _loc2_:int = 0;
  887.          var _loc3_:_kp67 = null;
  888.          var _loc4_:int = 0;
  889.          var _loc5_:_kp67 = null;
  890.          _loc2_ = 0;
  891.          _loc3_ = checkPoints[_loc2_];
  892.          _loc4_ = 1;
  893.          while(_loc4_ < checkPoints.length)
  894.          {
  895.             if((_loc5_ = checkPoints[_loc4_])._ej28 > _loc3_._ej28 && param1._ej28 > _loc5_._ej28)
  896.             {
  897.                _loc2_ = _loc4_;
  898.                _loc3_ = _loc5_;
  899.             }
  900.             _loc4_++;
  901.          }
  902.          return _loc2_;
  903.       }
  904.       
  905.       protected function _na430(param1:_mk516) : void
  906.       {
  907.          var _loc2_:int = 0;
  908.          var _loc3_:_yo331 = null;
  909.          _loc2_ = _gg527(param1._ej28);
  910.          _loc3_ = groups[_loc2_];
  911.          if(_loc3_ == param1.group)
  912.          {
  913.             return;
  914.          }
  915.          if(param1 is _hu144)
  916.          {
  917.             param1.group._rw173(_hu144(param1));
  918.             _loc3_._dq187(_hu144(param1));
  919.          }
  920.          else if(param1 is _gf356)
  921.          {
  922.             param1.group._uo329(_gf356(param1));
  923.             _loc3_._qf444(_gf356(param1));
  924.          }
  925.          param1.group = _loc3_;
  926.       }
  927.    }
  928. }
  929.