home *** CD-ROM | disk | FTP | other *** search
/ Champak 48 / cdrom_image.iso / Games / aengiequest.swf / scripts / __Packages / Game.as < prev    next >
Encoding:
Text File  |  2007-10-01  |  36.5 KB  |  944 lines

  1. function ┬º\x01\x02┬º()
  2. {
  3.    return 62;
  4. }
  5. var ┬º\x01┬º = 669 + "\x01\x02"();
  6. while(true)
  7. {
  8.    if(eval("\x01") == 731)
  9.    {
  10.       set("\x01",eval("\x01") + 222);
  11.       ┬º┬ºpush(true);
  12.    }
  13.    else
  14.    {
  15.       if(eval("\x01") == 795)
  16.       {
  17.          set("\x01",eval("\x01") - 557);
  18.          ┬º┬ºpop() extends ┬º┬ºpop() >> function ┬º\x01\x02┬º()
  19.          {
  20.             return 62;
  21.          };
  22.          ┬º┬ºpop() extends ┬º┬ºpop() << (┬º┬ºpop() >>> ┬º┬ºpop());
  23.          break;
  24.       }
  25.       if(eval("\x01") == 979)
  26.       {
  27.          set("\x01",eval("\x01") - 442);
  28.          ┬º┬ºpush("\x0f");
  29.          ┬º┬ºpush(1);
  30.       }
  31.       else if(eval("\x01") == 953)
  32.       {
  33.          set("\x01",eval("\x01") - 158);
  34.          if(function ┬º\x01\x02┬º()
  35.          {
  36.             return 62;
  37.          })
  38.          {
  39.             set("\x01",eval("\x01") - 557);
  40.          }
  41.       }
  42.       else if(eval("\x01") == 861)
  43.       {
  44.          set("\x01",eval("\x01") - 334);
  45.          ┬º┬ºpush(!function ┬º\x01\x02┬º()
  46.          {
  47.             return 62;
  48.          });
  49.       }
  50.       else if(eval("\x01") == 238)
  51.       {
  52.          set("\x01",eval("\x01") + 334);
  53.       }
  54.       else if(eval("\x01") == 793)
  55.       {
  56.          set("\x01",eval("\x01") - 467);
  57.          if(function ┬º\x01\x02┬º()
  58.          {
  59.             return 62;
  60.          })
  61.          {
  62.             set("\x01",eval("\x01") + 262);
  63.          }
  64.       }
  65.       else
  66.       {
  67.          if(eval("\x01") == 315)
  68.          {
  69.             set("\x01",eval("\x01") + 359);
  70.             if(!_global.Game)
  71.             {
  72.                _global.Game extends MovieClip;
  73.                var _loc2_ = _global.Game = function()
  74.                {
  75.                   super();
  76.                   this.score = 0;
  77.                   this.loadLevels();
  78.                   this.soundFade = 800;
  79.                }.prototype;
  80.                _loc2_.startNextLevel = function()
  81.                {
  82.                   this.message.hide();
  83.                   this.startLevel(this.levelIndex + 1);
  84.                };
  85.                _loc2_.loadLevels = function()
  86.                {
  87.                   var game;
  88.                   var _loc5_ = undefined;
  89.                   var _loc4_ = undefined;
  90.                   var _loc3_ = undefined;
  91.                   if(Config.LEVELS_LOADFROMURL)
  92.                   {
  93.                      game = this;
  94.                      _loc5_ = new XML();
  95.                      _loc5_.ignoreWhite = true;
  96.                      _loc5_.onLoad = function(success)
  97.                      {
  98.                         game.finishedLoadingLevels(this.firstChild,success);
  99.                      };
  100.                      _loc5_.load(Config.LEVELS_URL);
  101.                   }
  102.                   else
  103.                   {
  104.                      this.levelInfos = new Array();
  105.                      _loc3_ = 0;
  106.                      while(_loc3_ < Config.LEVELS_INFOS.length)
  107.                      {
  108.                         _loc4_ = new LevelInfo();
  109.                         _loc4_.fillFromArray(Config.LEVELS_INFOS[_loc3_]);
  110.                         this.levelInfos.push(_loc4_);
  111.                         _loc3_ = _loc3_ + 1;
  112.                      }
  113.                      this.startLevel(_root.forcelevel);
  114.                   }
  115.                };
  116.                _loc2_.finishedLoadingLevels = function(rootNode, success)
  117.                {
  118.                   var _loc2_ = undefined;
  119.                   var _loc3_ = undefined;
  120.                   if(!success)
  121.                   {
  122.                      this.gotoAndStop("loadFailed");
  123.                      return undefined;
  124.                   }
  125.                   this.levelInfos = new Array();
  126.                   _loc2_ = rootNode.firstChild;
  127.                   while(_loc2_)
  128.                   {
  129.                      if(_loc2_.nodeName == "LEVEL")
  130.                      {
  131.                         _loc3_ = new LevelInfo();
  132.                         _loc3_.fillFromNode(_loc2_);
  133.                         this.levelInfos.push(_loc3_);
  134.                      }
  135.                      _loc2_ = _loc2_.nextSibling;
  136.                   }
  137.                   this.startLevel(0);
  138.                };
  139.                _loc2_.startLevel = function(levelIndex)
  140.                {
  141.                   this.levelIndex = levelIndex;
  142.                   this.levelName = this.levelInfos[levelIndex].name;
  143.                   this.createThings(this.levelInfos[levelIndex]);
  144.                   this.moveStepX = 0;
  145.                   this.moveStepY = 0;
  146.                   this.restartButton.onRelease = function()
  147.                   {
  148.                      _root.clickSound.start();
  149.                      this._parent.restartLevel();
  150.                   };
  151.                   this.backmenuButton.onRelease = function()
  152.                   {
  153.                      _root.bgmusic.setVolume(100);
  154.                      _root.bgmusic.stop();
  155.                      _root.clickSound.start();
  156.                      _root.gotoAndStop("title");
  157.                   };
  158.                   clearInterval(this.intervalID);
  159.                   this.intervalID = setInterval(this,"onPlayTime",1);
  160.                   this.gotoAndStop("play");
  161.                };
  162.                _loc2_.restartLevel = function()
  163.                {
  164.                   this.startLevel(this.levelIndex);
  165.                };
  166.                _loc2_.createThings = function(levelInfo)
  167.                {
  168.                   var _loc4_ = undefined;
  169.                   var _loc5_ = undefined;
  170.                   var _loc6_ = undefined;
  171.                   var _loc2_ = undefined;
  172.                   var _loc3_ = undefined;
  173.                   _loc2_ = 0;
  174.                   while(_loc2_ < this.things.length)
  175.                   {
  176.                      this.things[_loc2_].removeMovieClip();
  177.                      _loc2_ = _loc2_ + 1;
  178.                   }
  179.                   this.things = new Array();
  180.                   _loc2_ = 0;
  181.                   while(_loc2_ < this.inventoryKeys.length)
  182.                   {
  183.                      this.inventoryKeys[_loc2_].removeMovieClip();
  184.                      _loc2_ = _loc2_ + 1;
  185.                   }
  186.                   this.inventoryKeys = new Array();
  187.                   this.inventoryKeyIndexes = new Array();
  188.                   _loc2_ = 0;
  189.                   while(_loc2_ < levelInfo.typeInfos.length)
  190.                   {
  191.                      _loc3_ = 0;
  192.                      while(_loc3_ < levelInfo.typeInfos[_loc2_].length)
  193.                      {
  194.                         _loc4_ = levelInfo.typeInfos[_loc2_][_loc3_];
  195.                         if(_loc4_.type != TypeInfo.TYPE_OPEN)
  196.                         {
  197.                            switch(_loc4_.type)
  198.                            {
  199.                               case TypeInfo.TYPE_BLOCK:
  200.                                  _loc5_ = this.createBlock(_loc2_,_loc3_,_loc4_.blockType);
  201.                                  break;
  202.                               case TypeInfo.TYPE_PUSHBLOCK:
  203.                                  _loc5_ = this.createPushBlock(_loc2_,_loc3_);
  204.                                  break;
  205.                               case TypeInfo.TYPE_KEY:
  206.                                  _loc5_ = this.createKey(_loc2_,_loc3_,_loc4_.keyButtonIndex);
  207.                                  break;
  208.                               case TypeInfo.TYPE_BUTTON:
  209.                                  _loc5_ = this.createButton(_loc2_,_loc3_,_loc4_.keyButtonIndex);
  210.                                  break;
  211.                               case TypeInfo.TYPE_DOOR:
  212.                                  _loc5_ = this.createDoor(_loc2_,_loc3_,_loc4_.doorType,_loc4_.doorDirection,_loc4_.keyButtonIndex);
  213.                                  break;
  214.                               case TypeInfo.TYPE_MAN:
  215.                                  _loc6_ = this.createMan(_loc2_,_loc3_);
  216.                                  this.man = _loc6_;
  217.                                  _loc5_ = _loc6_;
  218.                                  break;
  219.                               case TypeInfo.TYPE_FLAG:
  220.                                  _loc5_ = this.createFlag(_loc2_,_loc3_);
  221.                            }
  222.                            this.things.push(_loc5_);
  223.                         }
  224.                         _loc3_ = _loc3_ + 1;
  225.                      }
  226.                      _loc2_ = _loc2_ + 1;
  227.                   }
  228.                   this.updateDepths();
  229.                };
  230.                _loc2_.createBlock = function(x, y, type)
  231.                {
  232.                   var _loc2_ = this.thingsHolder.getNextHighestDepth();
  233.                   var _loc4_ = this.thingsHolder.attachMovie("block","thing" + _loc2_,_loc2_);
  234.                   var _loc3_ = _loc4_;
  235.                   _loc3_.initialize(x,y,type);
  236.                   return _loc3_;
  237.                };
  238.                _loc2_.createPushBlock = function(x, y)
  239.                {
  240.                   var _loc2_ = this.thingsHolder.getNextHighestDepth();
  241.                   var _loc4_ = this.thingsHolder.attachMovie("pushBlock","thing" + _loc2_,_loc2_);
  242.                   var _loc3_ = _loc4_;
  243.                   _loc3_.initialize(x,y);
  244.                   return _loc3_;
  245.                };
  246.                _loc2_.createKey = function(x, y, keyIndex)
  247.                {
  248.                   var _loc3_ = this.thingsHolder.getNextHighestDepth();
  249.                   var _loc4_ = this.thingsHolder.attachMovie("doorKey","thing" + _loc3_,_loc3_);
  250.                   var _loc2_ = _loc4_;
  251.                   _loc2_.initialize(x,y,keyIndex);
  252.                   return _loc2_;
  253.                };
  254.                _loc2_.createButton = function(x, y, buttonIndex)
  255.                {
  256.                   var _loc2_ = this.thingsHolder.getNextHighestDepth();
  257.                   var _loc4_ = this.thingsHolder.attachMovie("doorButton","thing" + _loc2_,_loc2_);
  258.                   var _loc3_ = _loc4_;
  259.                   _loc3_.initialize(x,y,buttonIndex);
  260.                   return _loc3_;
  261.                };
  262.                _loc2_.createDoor = function(x, y, type, direction, keyButtonIndex)
  263.                {
  264.                   var _loc2_ = this.thingsHolder.getNextHighestDepth();
  265.                   var _loc4_ = this.thingsHolder.attachMovie("door","thing" + _loc2_,_loc2_);
  266.                   var _loc3_ = _loc4_;
  267.                   _loc3_.initialize(x,y,type,direction,keyButtonIndex);
  268.                   return _loc3_;
  269.                };
  270.                _loc2_.createMan = function(x, y)
  271.                {
  272.                   var _loc3_ = this.thingsHolder.getNextHighestDepth();
  273.                   var _loc4_ = this.thingsHolder.attachMovie("man","thing" + _loc3_,_loc3_);
  274.                   var _loc2_ = _loc4_;
  275.                   _loc2_.initialize(x,y);
  276.                   return _loc2_;
  277.                };
  278.                _loc2_.createFlag = function(x, y)
  279.                {
  280.                   var _loc3_ = this.thingsHolder.getNextHighestDepth();
  281.                   var _loc4_ = this.thingsHolder.attachMovie("flag","thing" + _loc3_,_loc3_);
  282.                   var _loc2_ = _loc4_;
  283.                   _loc2_.initialize(x,y);
  284.                   return _loc2_;
  285.                };
  286.                _loc2_.onPlayTime = function()
  287.                {
  288.                   var _loc7_ = getTimer();
  289.                   var _loc4_ = undefined;
  290.                   var _loc6_ = undefined;
  291.                   var _loc5_ = undefined;
  292.                   var _loc3_ = undefined;
  293.                   if(this.soundFade > 0)
  294.                   {
  295.                      this.soundFade = this.soundFade - 1;
  296.                      if(this.soundFade <= 50)
  297.                      {
  298.                         if(this.soundFade == 50)
  299.                         {
  300.                            _root.bgmusic.setVolume(100);
  301.                         }
  302.                         if(this.soundFade == 49)
  303.                         {
  304.                            _root.bgmusic.stop();
  305.                         }
  306.                      }
  307.                      else
  308.                      {
  309.                         _root.bgmusic.setVolume(Math.round(this.soundFade / 8));
  310.                      }
  311.                   }
  312.                   if(this.updateMoveDirections(_loc7_))
  313.                   {
  314.                      return undefined;
  315.                   }
  316.                   if(this.moveStepX == 0 && this.moveStepY == 0)
  317.                   {
  318.                      return undefined;
  319.                   }
  320.                   _loc4_ = (_loc7_ - this.startMoveTime) / Config.MAN_MOVETIME;
  321.                   if(_loc4_ <= 0)
  322.                   {
  323.                      return undefined;
  324.                   }
  325.                   if(_loc4_ > 1)
  326.                   {
  327.                      _loc4_ = 1;
  328.                   }
  329.                   _loc6_ = this.man.x + _loc4_ * this.moveStepX;
  330.                   _loc5_ = this.man.y + _loc4_ * this.moveStepY;
  331.                   this.man._x = _loc6_ * Config.DIRECTION_X[0] / Config.DIMENSION_X + _loc5_ * Config.DIRECTION_Y[0] / Config.DIMENSION_Y;
  332.                   this.man._y = _loc6_ * Config.DIRECTION_X[1] / Config.DIMENSION_X + _loc5_ * Config.DIRECTION_Y[1] / Config.DIMENSION_Y;
  333.                   _loc3_ = this.getPushingBlock(this.moveStepX,this.moveStepY);
  334.                   if(_loc3_ != null)
  335.                   {
  336.                      this.man.setPushing(true);
  337.                      _loc6_ = _loc3_.x + _loc4_ * this.moveStepX;
  338.                      _loc5_ = _loc3_.y + _loc4_ * this.moveStepY;
  339.                      _loc3_._x = _loc6_ * Config.DIRECTION_X[0] / Config.DIMENSION_X + _loc5_ * Config.DIRECTION_Y[0] / Config.DIMENSION_Y;
  340.                      _loc3_._y = _loc6_ * Config.DIRECTION_X[1] / Config.DIMENSION_X + _loc5_ * Config.DIRECTION_Y[1] / Config.DIMENSION_Y;
  341.                   }
  342.                   this.updateDepth(this.man);
  343.                   if(_loc3_)
  344.                   {
  345.                      this.updateDepth(_loc3_);
  346.                   }
  347.                   if(_loc4_ == 1)
  348.                   {
  349.                      this.man.x += this.moveStepX;
  350.                      this.man.y += this.moveStepY;
  351.                      if(_loc3_)
  352.                      {
  353.                         _loc3_.x += this.moveStepX;
  354.                         _loc3_.y += this.moveStepY;
  355.                         _root.boxSound.start();
  356.                      }
  357.                      this.man.setPushing(false);
  358.                      this.moveStepX = 0;
  359.                      this.moveStepY = 0;
  360.                      this.pickKey();
  361.                      if(this.updateDoors())
  362.                      {
  363.                         return undefined;
  364.                      }
  365.                      if(this.checkWin())
  366.                      {
  367.                         return undefined;
  368.                      }
  369.                      this.updateMoveDirections(_loc7_);
  370.                      this.onPlayTime();
  371.                   }
  372.                   updateAfterEvent();
  373.                };
  374.                _loc2_.updateMoveDirections = function(time)
  375.                {
  376.                   if(this.moveStepX != 0 || this.moveStepY != 0)
  377.                   {
  378.                      return undefined;
  379.                   }
  380.                   if(Key.isDown(37))
  381.                   {
  382.                      if(this.setFaceDirection(-1,0))
  383.                      {
  384.                         return true;
  385.                      }
  386.                      if(!this.getCanMove(-1,0))
  387.                      {
  388.                         return false;
  389.                      }
  390.                      this.moveStepX = -1;
  391.                      this.moveStepY = 0;
  392.                      this.startMoveTime = time;
  393.                   }
  394.                   else if(Key.isDown(39))
  395.                   {
  396.                      if(this.setFaceDirection(1,0))
  397.                      {
  398.                         return true;
  399.                      }
  400.                      if(!this.getCanMove(1,0))
  401.                      {
  402.                         return false;
  403.                      }
  404.                      this.moveStepX = 1;
  405.                      this.moveStepY = 0;
  406.                      this.startMoveTime = time;
  407.                   }
  408.                   else if(Key.isDown(38))
  409.                   {
  410.                      if(this.setFaceDirection(0,-1))
  411.                      {
  412.                         return true;
  413.                      }
  414.                      if(!this.getCanMove(0,-1))
  415.                      {
  416.                         return false;
  417.                      }
  418.                      this.moveStepX = 0;
  419.                      this.moveStepY = -1;
  420.                      this.startMoveTime = time;
  421.                   }
  422.                   else if(Key.isDown(40))
  423.                   {
  424.                      if(this.setFaceDirection(0,1))
  425.                      {
  426.                         return true;
  427.                      }
  428.                      if(!this.getCanMove(0,1))
  429.                      {
  430.                         return false;
  431.                      }
  432.                      this.moveStepX = 0;
  433.                      this.moveStepY = 1;
  434.                      this.startMoveTime = time;
  435.                   }
  436.                   return false;
  437.                };
  438.                _loc2_.setFaceDirection = function(directionX, directionY)
  439.                {
  440.                   var _loc4_ = this.getTileThings(this.man.x + directionX,this.man.y + directionY);
  441.                   var _loc5_ = undefined;
  442.                   var _loc3_ = undefined;
  443.                   this.man.setDirection(directionX,directionY);
  444.                   _loc3_ = 0;
  445.                   while(_loc3_ < _loc4_.length)
  446.                   {
  447.                      if(_loc4_[_loc3_].type == TypeInfo.TYPE_DOOR)
  448.                      {
  449.                         if(_loc4_[_loc3_].doorType == TypeInfo.DOORTYPE_KEY)
  450.                         {
  451.                            _loc5_ = this.getInventoryIndex(_loc4_[_loc3_].keyButtonIndex);
  452.                            if(_loc5_ != -1)
  453.                            {
  454.                               if(!_loc4_[_loc3_].opened)
  455.                               {
  456.                                  this.removeKeyFromInventory(_loc5_);
  457.                                  _loc4_[_loc3_].opened = true;
  458.                                  _root.doorSound.start();
  459.                                  this.openingDoors = new Array();
  460.                                  this.closingDoors = new Array();
  461.                                  this.openingDoors.push(_loc4_[_loc3_]);
  462.                                  clearInterval(this.intervalID);
  463.                                  this.startDoorTime = getTimer();
  464.                                  this.intervalID = setInterval(this,"onDoorTime",1);
  465.                                  return true;
  466.                               }
  467.                            }
  468.                         }
  469.                      }
  470.                      _loc3_ = _loc3_ + 1;
  471.                   }
  472.                   return false;
  473.                };
  474.                _loc2_.getInventoryIndex = function(keyIndex)
  475.                {
  476.                   var _loc2_ = undefined;
  477.                   _loc2_ = 0;
  478.                   while(_loc2_ < this.inventoryKeyIndexes.length)
  479.                   {
  480.                      if(this.inventoryKeyIndexes[_loc2_] == keyIndex)
  481.                      {
  482.                         return _loc2_;
  483.                      }
  484.                      _loc2_ = _loc2_ + 1;
  485.                   }
  486.                   return -1;
  487.                };
  488.                _loc2_.getCanMove = function(directionX, directionY)
  489.                {
  490.                   var _loc2_ = undefined;
  491.                   var _loc6_ = this.man.x + directionX;
  492.                   var _loc5_ = this.man.y + directionY;
  493.                   var _loc4_ = false;
  494.                   var _loc3_ = undefined;
  495.                   while(true)
  496.                   {
  497.                      if(_loc6_ < 0 || _loc6_ >= Config.DIMENSION_X || _loc5_ < 0 || _loc5_ >= Config.DIMENSION_Y)
  498.                      {
  499.                         return false;
  500.                      }
  501.                      _loc2_ = this.getTileThings(_loc6_,_loc5_);
  502.                      if(_loc2_.length == 0)
  503.                      {
  504.                         return true;
  505.                      }
  506.                      _loc3_ = 0;
  507.                      while(_loc3_ < _loc2_.length)
  508.                      {
  509.                         switch(_loc2_[_loc3_].type)
  510.                         {
  511.                            case TypeInfo.TYPE_KEY:
  512.                            case TypeInfo.TYPE_BUTTON:
  513.                            case TypeInfo.TYPE_FLAG:
  514.                               if(_loc2_.length == 1)
  515.                               {
  516.                                  return true;
  517.                               }
  518.                               break;
  519.                            case TypeInfo.TYPE_BLOCK:
  520.                               return false;
  521.                            default:
  522.                               if(_loc0_ !== TypeInfo.TYPE_PUSHBLOCK)
  523.                               {
  524.                                  if(_loc0_ === TypeInfo.TYPE_DOOR)
  525.                                  {
  526.                                     if(!_loc2_[_loc3_].opened)
  527.                                     {
  528.                                        return false;
  529.                                     }
  530.                                     if(_loc2_.length == 1)
  531.                                     {
  532.                                        return true;
  533.                                     }
  534.                                  }
  535.                               }
  536.                               else
  537.                               {
  538.                                  if(_loc4_)
  539.                                  {
  540.                                     return false;
  541.                                  }
  542.                                  _loc4_ = true;
  543.                               }
  544.                               break;
  545.                         }
  546.                         _loc3_ = _loc3_ + 1;
  547.                      }
  548.                      _loc6_ += directionX;
  549.                      _loc5_ += directionY;
  550.                   }
  551.                };
  552.                _loc2_.getTileThings = function(x, y)
  553.                {
  554.                   var _loc3_ = new Array();
  555.                   var _loc2_ = undefined;
  556.                   _loc2_ = 0;
  557.                   while(_loc2_ < this.things.length)
  558.                   {
  559.                      if(this.things[_loc2_].x == x && this.things[_loc2_].y == y)
  560.                      {
  561.                         _loc3_.push(this.things[_loc2_]);
  562.                      }
  563.                      _loc2_ = _loc2_ + 1;
  564.                   }
  565.                   return _loc3_;
  566.                };
  567.                _loc2_.getPushingBlock = function(directionX, directionY)
  568.                {
  569.                   var _loc3_ = this.getTileThings(this.man.x + directionX,this.man.y + directionY);
  570.                   var _loc2_ = undefined;
  571.                   _loc2_ = 0;
  572.                   while(_loc2_ < _loc3_.length)
  573.                   {
  574.                      if(_loc3_[_loc2_].type == TypeInfo.TYPE_PUSHBLOCK)
  575.                      {
  576.                         return _loc3_[_loc2_];
  577.                      }
  578.                      _loc2_ = _loc2_ + 1;
  579.                   }
  580.                   return null;
  581.                };
  582.                _loc2_.updateDepth = function(thing)
  583.                {
  584.                   var _loc4_ = undefined;
  585.                   var _loc2_ = undefined;
  586.                   if(thing.index > 0 && Thing.compareDepths(thing,this.things[thing.index - 1]) == -1)
  587.                   {
  588.                      _loc4_ = this.findDepthIndex(thing,0,thing.index);
  589.                      this.things.splice(thing.index,1);
  590.                      this.things.splice(_loc4_,0,thing);
  591.                   }
  592.                   else
  593.                   {
  594.                      if(!(thing.index < this.things.length - 1 && Thing.compareDepths(thing,this.things[thing.index + 1]) == 1))
  595.                      {
  596.                         return undefined;
  597.                      }
  598.                      _loc4_ = this.findDepthIndex(thing,thing.index + 1,this.things.length);
  599.                      this.things.splice(_loc4_,0,thing);
  600.                      this.things.splice(thing.index,1);
  601.                   }
  602.                   _loc2_ = 0;
  603.                   while(_loc2_ < this.things.length)
  604.                   {
  605.                      this.things[_loc2_].index = _loc2_;
  606.                      this.things[_loc2_].swapDepths(_loc2_);
  607.                      _loc2_ = _loc2_ + 1;
  608.                   }
  609.                };
  610.                _loc2_.updateDepths = function()
  611.                {
  612.                   var _loc2_ = undefined;
  613.                   this.things.sort(Thing.compareDepths);
  614.                   _loc2_ = 0;
  615.                   while(_loc2_ < this.things.length)
  616.                   {
  617.                      this.things[_loc2_].index = _loc2_;
  618.                      this.things[_loc2_].swapDepths(_loc2_);
  619.                      _loc2_ = _loc2_ + 1;
  620.                   }
  621.                };
  622.                _loc2_.findDepthIndex = function(thing, begin, end)
  623.                {
  624.                   var _loc2_ = undefined;
  625.                   var _loc5_ = undefined;
  626.                   while(begin < end)
  627.                   {
  628.                      _loc2_ = Math.floor((begin + end) / 2);
  629.                      _loc5_ = Thing.compareDepths(thing,this.things[_loc2_]);
  630.                      if(_loc5_ == -1)
  631.                      {
  632.                         end = _loc2_;
  633.                      }
  634.                      else
  635.                      {
  636.                         begin = _loc2_ + 1;
  637.                      }
  638.                   }
  639.                   return end;
  640.                };
  641.                _loc2_.pickKey = function()
  642.                {
  643.                   var _loc2_ = undefined;
  644.                   var _loc3_ = undefined;
  645.                   _loc2_ = 0;
  646.                   while(_loc2_ < this.things.length)
  647.                   {
  648.                      if(!(this.things[_loc2_].x != this.man.x || this.things[_loc2_].y != this.man.y))
  649.                      {
  650.                         if(this.things[_loc2_].type == TypeInfo.TYPE_KEY)
  651.                         {
  652.                            this.addKeyToInventory(this.things[_loc2_].keyIndex);
  653.                            this.things[_loc2_].removeMovieClip();
  654.                            this.things.splice(_loc2_,1);
  655.                            _loc3_ = _loc2_;
  656.                            while(_loc3_ < this.things.length)
  657.                            {
  658.                               this.things[_loc3_].index = _loc3_;
  659.                               _loc3_ = _loc3_ + 1;
  660.                            }
  661.                            _loc2_ = _loc2_ - 1;
  662.                         }
  663.                      }
  664.                      _loc2_ = _loc2_ + 1;
  665.                   }
  666.                };
  667.                _loc2_.addKeyToInventory = function(keyIndex)
  668.                {
  669.                   var _loc4_ = this.inventoryHolder.getNextHighestDepth();
  670.                   var _loc3_ = this.inventoryHolder.attachMovie("inventoryKey","key" + _loc4_,_loc4_);
  671.                   new Color(_loc3_).setRGB(Config.KEY_COLOURS[keyIndex]);
  672.                   _loc3_._x = this.inventoryKeys.length * Config.INVENTORY_KEYSPACING;
  673.                   this.inventoryKeys.push(_loc3_);
  674.                   this.inventoryKeyIndexes.push(keyIndex);
  675.                   _root.pickupSound.start();
  676.                };
  677.                _loc2_.removeKeyFromInventory = function(index)
  678.                {
  679.                   var _loc2_ = undefined;
  680.                   this.inventoryKeys[index].removeMovieClip();
  681.                   this.inventoryKeys.splice(index,1);
  682.                   this.inventoryKeyIndexes.splice(index,1);
  683.                   _loc2_ = index;
  684.                   while(_loc2_ < this.inventoryKeys.length)
  685.                   {
  686.                      this.inventoryKeys[_loc2_]._x = _loc2_ * Config.INVENTORY_KEYSPACING;
  687.                      _loc2_ = _loc2_ + 1;
  688.                   }
  689.                };
  690.                _loc2_.updateDoors = function()
  691.                {
  692.                   var _loc3_ = undefined;
  693.                   this.openingDoors = new Array();
  694.                   this.closingDoors = new Array();
  695.                   _loc3_ = 0;
  696.                   while(_loc3_ < this.things.length)
  697.                   {
  698.                      if(this.things[_loc3_].type == TypeInfo.TYPE_DOOR)
  699.                      {
  700.                         if(this.things[_loc3_].doorType == TypeInfo.DOORTYPE_BUTTON)
  701.                         {
  702.                            if(this.things[_loc3_].opened)
  703.                            {
  704.                               if(!this.getDoorShouldBeOpen(this.things[_loc3_]))
  705.                               {
  706.                                  this.closingDoors.push(this.things[_loc3_]);
  707.                                  _root.doorSound.start();
  708.                               }
  709.                            }
  710.                            else if(this.getDoorShouldBeOpen(this.things[_loc3_]))
  711.                            {
  712.                               this.openingDoors.push(this.things[_loc3_]);
  713.                               _root.doorSound.start();
  714.                            }
  715.                         }
  716.                      }
  717.                      _loc3_ = _loc3_ + 1;
  718.                   }
  719.                   if(this.openingDoors.length > 0 || this.closingDoors.length > 0)
  720.                   {
  721.                      clearInterval(this.intervalID);
  722.                      this.startDoorTime = getTimer();
  723.                      this.intervalID = setInterval(this,"onDoorTime",1);
  724.                      return true;
  725.                   }
  726.                   return false;
  727.                };
  728.                _loc2_.getDoorShouldBeOpen = function(door)
  729.                {
  730.                   var _loc3_ = undefined;
  731.                   var _loc2_ = undefined;
  732.                   if(door.opened)
  733.                   {
  734.                      _loc2_ = 0;
  735.                      while(_loc2_ < this.things.length)
  736.                      {
  737.                         if(this.things[_loc2_] != door)
  738.                         {
  739.                            if(this.things[_loc2_].x == door.x && this.things[_loc2_].y == door.y)
  740.                            {
  741.                               return true;
  742.                            }
  743.                         }
  744.                         _loc2_ = _loc2_ + 1;
  745.                      }
  746.                   }
  747.                   _loc2_ = 0;
  748.                   while(true)
  749.                   {
  750.                      if(_loc2_ < this.things.length)
  751.                      {
  752.                         if(this.things[_loc2_].type == TypeInfo.TYPE_BUTTON)
  753.                         {
  754.                            if(this.things[_loc2_].buttonIndex == door.keyButtonIndex)
  755.                            {
  756.                               _loc3_ = 0;
  757.                               while(_loc3_ < this.things.length)
  758.                               {
  759.                                  if(_loc3_ != _loc2_)
  760.                                  {
  761.                                     if(this.things[_loc3_].x == this.things[_loc2_].x && this.things[_loc3_].y == this.things[_loc2_].y)
  762.                                     {
  763.                                        break;
  764.                                     }
  765.                                  }
  766.                                  _loc3_ = _loc3_ + 1;
  767.                               }
  768.                               if(_loc3_ >= this.things.length)
  769.                               {
  770.                                  break;
  771.                               }
  772.                            }
  773.                         }
  774.                      }
  775.                      else
  776.                      {
  777.                         return true;
  778.                      }
  779.                      _loc2_ = _loc2_ + 1;
  780.                   }
  781.                   return false;
  782.                };
  783.                _loc2_.onDoorTime = function()
  784.                {
  785.                   var _loc4_ = getTimer();
  786.                   var _loc3_ = (_loc4_ - this.startDoorTime) / Config.DOOR_MOVETIME;
  787.                   var _loc2_ = undefined;
  788.                   if(_loc3_ > 1)
  789.                   {
  790.                      _loc3_ = 1;
  791.                   }
  792.                   _loc2_ = 0;
  793.                   while(_loc2_ < this.openingDoors.length)
  794.                   {
  795.                      this.openingDoors[_loc2_].setCloseRatio(1 - _loc3_);
  796.                      this.updateDepth(this.openingDoors[_loc2_]);
  797.                      _loc2_ = _loc2_ + 1;
  798.                   }
  799.                   _loc2_ = 0;
  800.                   while(_loc2_ < this.closingDoors.length)
  801.                   {
  802.                      this.closingDoors[_loc2_].setCloseRatio(_loc3_);
  803.                      this.updateDepth(this.closingDoors[_loc2_]);
  804.                      _loc2_ = _loc2_ + 1;
  805.                   }
  806.                   if(_loc3_ == 1)
  807.                   {
  808.                      clearInterval(this.intervalID);
  809.                      this.intervalID = setInterval(this,"onPlayTime",1);
  810.                   }
  811.                   updateAfterEvent();
  812.                };
  813.                _loc2_.checkWin = function()
  814.                {
  815.                   var _loc4_ = this.getTileThings(this.man.x,this.man.y);
  816.                   var _loc3_ = undefined;
  817.                   _loc3_ = 0;
  818.                   while(_loc3_ < _loc4_.length)
  819.                   {
  820.                      if(_loc4_[_loc3_].type == TypeInfo.TYPE_FLAG)
  821.                      {
  822.                         this.score += this.levelInfos[this.levelIndex].score;
  823.                         clearInterval(this.intervalID);
  824.                         if(this.levelIndex < this.levelInfos.length - 1)
  825.                         {
  826.                            this.message.showClear(this.levelIndex);
  827.                            _root.clearSound.start();
  828.                         }
  829.                         else
  830.                         {
  831.                            this.message.showWin();
  832.                            _root.bgmusic.start();
  833.                         }
  834.                      }
  835.                      _loc3_ = _loc3_ + 1;
  836.                   }
  837.                   return false;
  838.                };
  839.                ┬º┬ºpush(ASSetPropFlags(_global.Game.prototype,null,1));
  840.             }
  841.             ┬º┬ºpop();
  842.             break;
  843.          }
  844.          if(eval("\x01") == 572)
  845.          {
  846.             set("\x01",eval("\x01") + 221);
  847.             ┬º┬ºpush(true);
  848.          }
  849.          else if(eval("\x01") == 671)
  850.          {
  851.             set("\x01",eval("\x01") - 356);
  852.          }
  853.          else if(eval("\x01") == 825)
  854.          {
  855.             set("\x01",eval("\x01") + 154);
  856.          }
  857.          else if(eval("\x01") == 743)
  858.          {
  859.             set("\x01",eval("\x01") - 171);
  860.          }
  861.          else if(eval("\x01") == 71)
  862.          {
  863.             set("\x01",eval("\x01") + 805);
  864.             ┬º┬ºpush(true);
  865.          }
  866.          else if(eval("\x01") == 347)
  867.          {
  868.             set("\x01",eval("\x01") - 276);
  869.          }
  870.          else if(eval("\x01") == 876)
  871.          {
  872.             set("\x01",eval("\x01") + 52);
  873.             if(function ┬º\x01\x02┬º()
  874.             {
  875.                return 62;
  876.             })
  877.             {
  878.                set("\x01",eval("\x01") + 56);
  879.             }
  880.          }
  881.          else if(eval("\x01") == 527)
  882.          {
  883.             set("\x01",eval("\x01") + 144);
  884.             if(function ┬º\x01\x02┬º()
  885.             {
  886.                return 62;
  887.             })
  888.             {
  889.                set("\x01",eval("\x01") - 356);
  890.             }
  891.          }
  892.          else if(eval("\x01") == 984)
  893.          {
  894.             set("\x01",eval("\x01") - 5);
  895.          }
  896.          else if(eval("\x01") == 670)
  897.          {
  898.             set("\x01",eval("\x01") - 299);
  899.             ┬º┬ºpush("\x0f");
  900.          }
  901.          else if(eval("\x01") == 537)
  902.          {
  903.             set("\x01",eval("\x01") + 133);
  904.             var ┬º┬ºpop() = function ┬º\x01\x02┬º()
  905.             {
  906.                return 62;
  907.             };
  908.          }
  909.          else if(eval("\x01") == 588)
  910.          {
  911.             set("\x01",eval("\x01") - 517);
  912.          }
  913.          else
  914.          {
  915.             if(eval("\x01") == 674)
  916.             {
  917.                set("\x01",eval("\x01") - 674);
  918.                break;
  919.             }
  920.             if(eval("\x01") == 326)
  921.             {
  922.                set("\x01",eval("\x01") + 262);
  923.                stop();
  924.                break;
  925.             }
  926.             if(eval("\x01") == 928)
  927.             {
  928.                set("\x01",eval("\x01") + 56);
  929.                break;
  930.             }
  931.             if(eval("\x01") != 371)
  932.             {
  933.                break;
  934.             }
  935.             set("\x01",eval("\x01") + 490);
  936.             ┬º┬ºpush(eval(function ┬º\x01\x02┬º()
  937.             {
  938.                return 62;
  939.             }));
  940.          }
  941.       }
  942.    }
  943. }
  944.