Advertisement
Jhynjhiruu

Untitled

May 15th, 2020
4,465
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. if(_root.installed != true)
  2. {
  3.    _root.installed = true;
  4.    _root.entryWidth = 8;
  5.    _root.layers = ["BackGFX","FrontGFX","Platforms","BPlatforms","Ice","Lava","CamEdge","Edge","Water"];
  6.    _root.frontOffsList = [16,17,40,41,42,44,45,64,65,68,69,70,71];
  7.    _root.attachGraphics = function()
  8.    {
  9.       _root.BackObjs = [];
  10.       _root.FrontObjs = [];
  11.       _root.frontPos = [];
  12.       _root.frontCounter = 0;
  13.       _root.frontOffs = 0;
  14.       var _loc3_ = 0;
  15.       while(_loc3_ < _root.LevelItems.length)
  16.       {
  17.          _root.frontOffsBack = _root.frontOffs;
  18.          var _loc4_ = 0;
  19.          while(_loc4_ < _root.frontOffsList.length)
  20.          {
  21.             if(_root.frontOffsList[_loc4_] == Number(_root.LevelItems[_loc3_][0]))
  22.             {
  23.                if(_root.LevelItems[_loc3_][0] != "45")
  24.                {
  25.                   _root.frontOffs = _root.frontOffs + 1;
  26.                }
  27.                else if(_root.LevelItems[_loc3_][8])
  28.                {
  29.                   _root.frontOffs = _root.frontOffs + 1;
  30.                }
  31.                break;
  32.             }
  33.             _loc4_ = _loc4_ + 1;
  34.          }
  35.          if(_loc4_ == _root.frontOffsList.length)
  36.          {
  37.             if(_root.ItemFrontGFX(_loc4_) && _root.ItemFrontGFXBack == false)
  38.             {
  39.                _root.frontOffs = _root.frontOffs + 1;
  40.             }
  41.          }
  42.          if(_root.frontOffsBack == _root.frontOffs)
  43.          {
  44.             _root.frontPos.push(null);
  45.          }
  46.          else
  47.          {
  48.             _root.frontPos.push(_root.frontCounter);
  49.             _root.frontCounter = _root.frontCounter + 1;
  50.          }
  51.          _loc3_ = _loc3_ + 1;
  52.       }
  53.       var _loc5_ = 0;
  54.       while(_loc5_ < _root.LevelItems.length)
  55.       {
  56.          var _loc6_ = 0;
  57.          var _loc7_ = true;
  58.          while(_loc6_ < _root.LevelItems[_loc5_].length && _loc7_)
  59.          {
  60.             if(_root.LevelItems[_loc5_][_loc6_] == "attach")
  61.             {
  62.                _loc7_ = false;
  63.             }
  64.             _loc6_ = _loc6_ + 1;
  65.          }
  66.          if(_loc6_ < _root.LevelItems[_loc5_].length && _loc6_ > 2)
  67.          {
  68.             var _loc8_ = "";
  69.             var _loc9_ = "";
  70.             for(var _loc10_ in _root.Course.BackGFX)
  71.             {
  72.                var _loc11_ = 0;
  73.                while(_loc11_ < _loc10_.length)
  74.                {
  75.                   if(isNaN(_loc10_.substr(_loc11_)) == false)
  76.                   {
  77.                      break;
  78.                   }
  79.                   _loc11_ = _loc11_ + 1;
  80.                }
  81.                if(Number(_loc10_.substr(_loc11_)) == _loc5_ && _loc10_.substr(_loc11_ - 1,1) != "_")
  82.                {
  83.                   _loc9_ = _loc10_;
  84.                   _root.BackObjs.push(_loc9_);
  85.                   _loc8_ = "Back";
  86.                }
  87.             }
  88.             for(var _loc10_ in _root.Course.FrontGFX)
  89.             {
  90.                _loc11_ = 0;
  91.                while(_loc11_ < _loc10_.length)
  92.                {
  93.                   if(isNaN(_loc10_.substr(_loc11_)) == false)
  94.                   {
  95.                      break;
  96.                   }
  97.                   _loc11_ = _loc11_ + 1;
  98.                }
  99.                if((Number(_loc10_.substr(_loc11_)) == _loc5_ || Number(_loc10_.substr(_loc11_)) == _root.frontPos[_loc5_] + (_root.Course.FrontGFX.getNextHighestDepth() - _root.frontOffs)) && _loc10_.substr(_loc11_ - 1,1) != "_")
  100.                {
  101.                   _loc9_ = _loc10_;
  102.                   _root.FrontObjs.push(_loc9_);
  103.                   _loc8_ = "Front";
  104.                }
  105.             }
  106.             if(_loc9_ != "")
  107.             {
  108.                tellTarget(_root.Course[_loc8_ + "GFX"][_loc9_])
  109.                {
  110.                   _visible = false;
  111.                   children = [];
  112.                   children.offsets = [];
  113.                   numChildren = 0;
  114.                }
  115.                if(_root.LevelItems[_loc5_].length == _loc6_ + _root.entryWidth)
  116.                {
  117.                   switch(_root.LevelItems[_loc5_][_loc6_])
  118.                   {
  119.                      case "Image":
  120.                         _root.Course[_root.layers[_root.LevelItems[_loc5_][_loc6_ + 6] % _root.layers.length]].createEmptyMovieClip("Moving" + _root.LevelItems[_loc5_][_loc6_] + _loc5_,_root.Course[_root.layers[_root.LevelItems[_loc5_][_loc6_ + 6] % _root.layers.length]].getNextHighestDepth());
  121.                         _root.Course[_root.layers[_root.LevelItems[_loc5_][_loc6_ + 6] % _root.layers.length]]["Moving" + _root.LevelItems[_loc5_][_loc6_] + _loc5_].loadMovie(unescape(_root.LevelItems[_loc5_][_loc6_ + 1]),this,"GET");
  122.                         _root.LevelItems[_loc5_][_loc6_ + 2] = Number(_root.LevelItems[_loc5_][_loc6_ + 2]) - 16;
  123.                         _root.LevelItems[_loc5_][_loc6_ + 3] = Number(_root.LevelItems[_loc5_][_loc6_ + 3]) - 16;
  124.                         break;
  125.                      case "Object":
  126.                         _root.Course[_root.layers[_root.LevelItems[_loc5_][_loc6_ + 6] % _root.layers.length]].attachMovie(_root.LevelItems[_loc5_][_loc6_ + 1],"Moving" + _root.LevelItems[_loc5_][_loc6_] + _loc5_,_root.Course[_root.layers[_root.LevelItems[_loc5_][_loc6_ + 6] % _root.layers.length]].getNextHighestDepth());
  127.                         break;
  128.                      default:
  129.                         _root.Course[_root.layers[_root.LevelItems[_loc5_][_loc6_ + 6] % _root.layers.length]].attachMovie("LD" + _root.LevelItems[_loc5_][_loc6_],"Moving" + _root.LevelItems[_loc5_][_loc6_] + _loc5_,_root.Course[_root.layers[_root.LevelItems[_loc5_][_loc6_ + 6] % _root.layers.length]].getNextHighestDepth());
  130.                         _root.Course[_root.layers[_root.LevelItems[_loc5_][_loc6_ + 6] % _root.layers.length]]["Moving" + _root.LevelItems[_loc5_][_loc6_] + _loc5_].gotoAndStop(_root.LevelItems[_loc5_][_loc6_ + 1]);
  131.                   }
  132.                   tellTarget(_root.Course[_root.layers[_root.LevelItems[_loc5_][_loc6_ + 6] % _root.layers.length]]["Moving" + _root.LevelItems[_loc5_][_loc6_] + _loc5_])
  133.                   {
  134.                      _x = Number(_root.LevelItems[_loc5_][1]);
  135.                      _y = Number(_root.LevelItems[_loc5_][2]);
  136.                      _rotation = Number(_root.LevelItems[_loc5_][_loc6_ + 4]);
  137.                      _xscale = Number(_root.LevelItems[_loc5_][_loc6_ + 5]);
  138.                      _yscale = Number(_root.LevelItems[_loc5_][_loc6_ + 5]);
  139.                   }
  140.                   var _loc12_ = _root.LevelItems[_loc5_][_loc6_ + 8].split(";");
  141.                   for(var _loc13_ in _loc12_)
  142.                   {
  143.                      var _loc14_ = _loc12_[_loc13_].split(":");
  144.                      if(isNaN(_loc14_[1]) == false)
  145.                      {
  146.                         _loc14_[1] = Number(_loc14_[1]);
  147.                      }
  148.                      _root.Course[_root.layers[_root.LevelItems[_loc5_][_loc6_ + 6] % _root.layers.length]]["Moving" + _root.LevelItems[_loc5_][_loc6_] + _loc5_][_loc14_[0]] = _loc14_[1];
  149.                   }
  150.                   tellTarget(_root.Course[_loc8_ + "GFX"][_loc9_])
  151.                   {
  152.                      children.push(_root.Course[_root.layers[_root.LevelItems[_loc5_][_loc6_ + 6] % _root.layers.length]]["Moving" + _root.LevelItems[_loc5_][_loc6_] + _loc5_]);
  153.                      children.offsets.push({x:Number(_root.LevelItems[_loc5_][_loc6_ + 2]),y:Number(_root.LevelItems[_loc5_][_loc6_ + 3])});
  154.                      numChildren = 1;
  155.                   }
  156.                }
  157.                else
  158.                {
  159.                   var _loc15_ = 0;
  160.                   while(_loc15_ < Number(_root.LevelItems[_loc5_][_loc6_]))
  161.                   {
  162.                      switch(_root.LevelItems[_loc5_][_loc6_ + 1 + _root.entryWidth * _loc15_])
  163.                      {
  164.                         case "Image":
  165.                            _root.Course[_root.layers[_root.LevelItems[_loc5_][_loc6_ + 7 + _root.entryWidth * _loc15_] % _root.layers.length]].createEmptyMovieClip("Moving" + _root.LevelItems[_loc5_][_loc6_ + 1 + _root.entryWidth * _loc15_] + _loc5_ + "_" + _loc15_,_root.Course[_root.layers[_root.LevelItems[_loc5_][_loc6_ + 7 + _root.entryWidth * _loc15_] % _root.layers.length]].getNextHighestDepth());
  166.                            _root.Course[_root.layers[_root.LevelItems[_loc5_][_loc6_ + 7 + _root.entryWidth * _loc15_] % _root.layers.length]]["Moving" + _root.LevelItems[_loc5_][_loc6_ + 1 + _root.entryWidth * _loc15_] + _loc5_ + "_" + _loc15_].loadMovie(unescape(_root.LevelItems[_loc5_][_loc6_ + 2 + _root.entryWidth * _loc15_]),this,"GET");
  167.                            _root.LevelItems[_loc5_][_loc6_ + 3 + _root.entryWidth * _loc15_] = Number(_root.LevelItems[_loc5_][_loc6_ + 3 + _root.entryWidth * _loc15_]) - 16;
  168.                            _root.LevelItems[_loc5_][_loc6_ + 4 + _root.entryWidth * _loc15_] = Number(_root.LevelItems[_loc5_][_loc6_ + 4 + _root.entryWidth * _loc15_]) - 16;
  169.                            break;
  170.                         case "Object":
  171.                            _root.Course[_root.layers[_root.LevelItems[_loc5_][_loc6_ + 7 + _root.entryWidth * _loc15_] % _root.layers.length]].attachMovie(_root.LevelItems[_loc5_][_loc6_ + 2 + _root.entryWidth * _loc15_],"Moving" + _root.LevelItems[_loc5_][_loc6_ + 1 + _root.entryWidth * _loc15_] + _loc5_ + "_" + _loc15_,_root.Course[_root.layers[_root.LevelItems[_loc5_][_loc6_ + 7 + _root.entryWidth * _loc15_] % _root.layers.length]].getNextHighestDepth());
  172.                            break;
  173.                         default:
  174.                            _root.Course[_root.layers[_root.LevelItems[_loc5_][_loc6_ + 7 + _root.entryWidth * _loc15_] % _root.layers.length]].attachMovie("LD" + _root.LevelItems[_loc5_][_loc6_ + 1 + _root.entryWidth * _loc15_],"Moving" + _root.LevelItems[_loc5_][_loc6_ + 1 + _root.entryWidth * _loc15_] + _loc5_ + "_" + _loc15_,_root.Course[_root.layers[_root.LevelItems[_loc5_][_loc6_ + 7 + _root.entryWidth * _loc15_] % _root.layers.length]].getNextHighestDepth());
  175.                            _root.Course[_root.layers[_root.LevelItems[_loc5_][_loc6_ + 7 + _root.entryWidth * _loc15_] % _root.layers.length]]["Moving" + _root.LevelItems[_loc5_][_loc6_ + 1 + _root.entryWidth * _loc15_] + _loc5_ + "_" + _loc15_].gotoAndStop(_root.LevelItems[_loc5_][_loc6_ + 2 + _root.entryWidth * _loc15_]);
  176.                      }
  177.                      tellTarget(_root.Course[_root.layers[_root.LevelItems[_loc5_][_loc6_ + 7 + _root.entryWidth * _loc15_] % _root.layers.length]]["Moving" + _root.LevelItems[_loc5_][_loc6_ + 1 + _root.entryWidth * _loc15_] + _loc5_ + "_" + _loc15_])
  178.                      {
  179.                         _x = Number(_root.LevelItems[_loc5_][1]);
  180.                         _y = Number(_root.LevelItems[_loc5_][2]);
  181.                         _rotation = Number(_root.LevelItems[_loc5_][_loc6_ + 5 + _root.entryWidth * _loc15_]);
  182.                         _xscale = Number(_root.LevelItems[_loc5_][_loc6_ + 6 + _root.entryWidth * _loc15_]);
  183.                         _yscale = Number(_root.LevelItems[_loc5_][_loc6_ + 6 + _root.entryWidth * _loc15_]);
  184.                      }
  185.                      _loc12_ = _root.LevelItems[_loc5_][_loc6_ + 8 + _root.entryWidth * _loc15_].split(";");
  186.                      for(var _loc13_ in _loc12_)
  187.                      {
  188.                         _loc14_ = _loc12_[_loc13_].split(":");
  189.                         if(isNaN(_loc14_[1]) == false)
  190.                         {
  191.                            _loc14_[1] = Number(_loc14_[1]);
  192.                         }
  193.                         _root.Course[_root.layers[_root.LevelItems[_loc5_][_loc6_ + 7 + _root.entryWidth * _loc15_] % _root.layers.length]]["Moving" + _root.LevelItems[_loc5_][_loc6_ + 1 + _root.entryWidth * _loc15_] + _loc5_ + "_" + _loc15_][_loc14_[0]] = _loc14_[1];
  194.                      }
  195.                      tellTarget(_root.Course[_loc8_ + "GFX"][_loc9_])
  196.                      {
  197.                         children.push(_root.Course[_root.layers[_root.LevelItems[_loc5_][_loc6_ + 7 + _root.entryWidth * _loc15_] % _root.layers.length]]["Moving" + _root.LevelItems[_loc5_][_loc6_ + 1 + _root.entryWidth * _loc15_] + _loc5_ + "_" + _loc15_]);
  198.                         children.offsets.push({x:Number(_root.LevelItems[_loc5_][_loc6_ + 3 + _root.entryWidth * _loc15_]),y:Number(_root.LevelItems[_loc5_][_loc6_ + 4 + _root.entryWidth * _loc15_])});
  199.                         numChildren = numChildren + 1;
  200.                      }
  201.                      _loc15_ = _loc15_ + 1;
  202.                   }
  203.                }
  204.             }
  205.          }
  206.          _loc5_ = _loc5_ + 1;
  207.       }
  208.    };
  209.    _root.newPLDL = _root.PlayLevelDesignerLevel;
  210.    _root.PlayLevelDesignerLevel = function(MarioX, MarioY, MarioXspeed, MarioYspeed, transition, messageboolean)
  211.    {
  212.       _root.newPLDL(MarioX,MarioY,MarioXspeed,MarioYspeed,transition,messageboolean);
  213.       _root.attachGraphics();
  214.    };
  215.    _root.checkNum = function(len, text, str, num)
  216.    {
  217.       if(str.substr(0,len) == text)
  218.       {
  219.          if(str.indexOf("_") != -1)
  220.          {
  221.             if(Number(str.substr(len,str.indexOf("_") - len)) == num)
  222.             {
  223.                return true;
  224.             }
  225.          }
  226.          else if(Number(str.substr(len)) == num)
  227.          {
  228.             return true;
  229.          }
  230.       }
  231.       return false;
  232.    };
  233.    _root.update = function()
  234.    {
  235.       var _loc2_ = 0;
  236.       while(_loc2_ < _root.BackObjs.length)
  237.       {
  238.          var _loc3_ = 0;
  239.          var _loc4_ = _root.BackObjs[_loc2_].length - 1;
  240.          while(_loc4_ > 0)
  241.          {
  242.             if(isNaN(_root.BackObjs[_loc2_].substr(_loc4_)) == false)
  243.             {
  244.                _loc3_ = Number(_root.BackObjs[_loc2_].substr(_loc4_));
  245.                _loc4_ = _loc4_ - 1;
  246.                continue;
  247.             }
  248.             break;
  249.          }
  250.          if((_root.BackObjs[_loc2_].substr(4,4) == "Coin" || _root.Course.BackGFX[_root.BackObjs[_loc2_]].cointext != undefined) && _root.Course.BackGFX[_root.BackObjs[_loc2_]]._currentframe == _root.Course.BackGFX[_root.BackObjs[_loc2_]]._totalframes)
  251.          {
  252.             for(var _loc5_ in _root.Course.BackGFX)
  253.             {
  254.                if(_root.checkNum(11,"MovingImage",_loc5_,_loc3_) || _root.checkNum(12,"MovingObject",_loc5_,_loc3_) || _root.checkNum(10,"MovingTile",_loc5_,_loc3_) || _root.checkNum(10,"MovingItem",_loc5_,_loc3_))
  255.                {
  256.                   _root.Course.BackGFX[_loc5_].removeMovieClip(_root.Course.BackGFX[_loc5_]);
  257.                }
  258.             }
  259.             _root.BackObjs.splice(_loc2_,1);
  260.          }
  261.          else
  262.          {
  263.             tellTarget(_root.Course.BackGFX[_root.BackObjs[_loc2_]])
  264.             {
  265.                _visible = _root.KeySPACE();
  266.                var _loc6_ = 0;
  267.                while(_loc6_ < numChildren)
  268.                {
  269.                   children[_loc6_]._x = _x + children.offsets[_loc6_].x;
  270.                   children[_loc6_]._y = _y + children.offsets[_loc6_].y;
  271.                   _loc6_ = _loc6_ + 1;
  272.                }
  273.             }
  274.             _loc2_ = _loc2_ + 1;
  275.          }
  276.       }
  277.       _loc2_ = 0;
  278.       while(_loc2_ < _root.FrontObjs.length)
  279.       {
  280.          _loc3_ = 0;
  281.          _loc4_ = _root.FrontObjs[_loc2_].length - 1;
  282.          while(_loc4_ > 0)
  283.          {
  284.             if(isNaN(_root.FrontObjs[_loc2_].substr(_loc4_)) == false)
  285.             {
  286.                _loc3_ = Number(_root.FrontObjs[_loc2_].substr(_loc4_));
  287.                _loc4_ = _loc4_ - 1;
  288.                continue;
  289.             }
  290.             break;
  291.          }
  292.          if((_root.FrontObjs[_loc2_].substr(4,4) == "Coin" || _root.Course.FrontGFX[_root.FrontObjs[_loc2_]].cointext != undefined) && _root.Course.FrontGFX[_root.FrontObjs[_loc2_]]._currentframe == _root.Course.FrontGFX[_root.FrontObjs[_loc2_]]._totalframes)
  293.          {
  294.             for(var _loc5_ in _root.Course.FrontGFX)
  295.             {
  296.                if(_root.checkNum(11,"MovingImage",_loc5_,_loc3_) || _root.checkNum(12,"MovingObject",_loc5_,_loc3_) || _root.checkNum(10,"MovingTile",_loc5_,_loc3_) || _root.checkNum(10,"MovingItem",_loc5_,_loc3_))
  297.                {
  298.                   _root.Course.FrontGFX[_loc5_].removeMovieClip(_root.Course.FrontGFX[_loc5_]);
  299.                }
  300.             }
  301.             _root.FrontObjs.splice(_loc2_,1);
  302.          }
  303.          else
  304.          {
  305.             tellTarget(_root.Course.FrontGFX[_root.FrontObjs[_loc2_]])
  306.             {
  307.                _visible = _root.KeySPACE();
  308.                _loc6_ = 0;
  309.                while(_loc6_ < numChildren)
  310.                {
  311.                   children[_loc6_]._x = _x + children.offsets[_loc6_].x;
  312.                   children[_loc6_]._y = _y + children.offsets[_loc6_].y;
  313.                   _loc6_ = _loc6_ + 1;
  314.                }
  315.             }
  316.             _loc2_ = _loc2_ + 1;
  317.          }
  318.       }
  319.    };
  320.    _root.newKP = _root.KeyPlus;
  321.    _root.KeyPlus = function()
  322.    {
  323.       _root.update();
  324.       return _root.newKP();
  325.    };
  326.    _root.attachGraphics();
  327. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement