Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if(_root.installed != true)
- {
- _root.installed = true;
- _root.entryWidth = 8;
- _root.layers = ["BackGFX","FrontGFX","Platforms","BPlatforms","Ice","Lava","CamEdge","Edge","Water"];
- _root.frontOffsList = [16,17,40,41,42,44,45,64,65,68,69,70,71];
- _root.attachGraphics = function()
- {
- _root.BackObjs = [];
- _root.FrontObjs = [];
- _root.frontPos = [];
- _root.frontCounter = 0;
- _root.frontOffs = 0;
- var _loc3_ = 0;
- while(_loc3_ < _root.LevelItems.length)
- {
- _root.frontOffsBack = _root.frontOffs;
- var _loc4_ = 0;
- while(_loc4_ < _root.frontOffsList.length)
- {
- if(_root.frontOffsList[_loc4_] == Number(_root.LevelItems[_loc3_][0]))
- {
- if(_root.LevelItems[_loc3_][0] != "45")
- {
- _root.frontOffs = _root.frontOffs + 1;
- }
- else if(_root.LevelItems[_loc3_][8])
- {
- _root.frontOffs = _root.frontOffs + 1;
- }
- break;
- }
- _loc4_ = _loc4_ + 1;
- }
- if(_loc4_ == _root.frontOffsList.length)
- {
- if(_root.ItemFrontGFX(_loc4_) && _root.ItemFrontGFXBack == false)
- {
- _root.frontOffs = _root.frontOffs + 1;
- }
- }
- if(_root.frontOffsBack == _root.frontOffs)
- {
- _root.frontPos.push(null);
- }
- else
- {
- _root.frontPos.push(_root.frontCounter);
- _root.frontCounter = _root.frontCounter + 1;
- }
- _loc3_ = _loc3_ + 1;
- }
- var _loc5_ = 0;
- while(_loc5_ < _root.LevelItems.length)
- {
- var _loc6_ = 0;
- var _loc7_ = true;
- while(_loc6_ < _root.LevelItems[_loc5_].length && _loc7_)
- {
- if(_root.LevelItems[_loc5_][_loc6_] == "attach")
- {
- _loc7_ = false;
- }
- _loc6_ = _loc6_ + 1;
- }
- if(_loc6_ < _root.LevelItems[_loc5_].length && _loc6_ > 2)
- {
- var _loc8_ = "";
- var _loc9_ = "";
- for(var _loc10_ in _root.Course.BackGFX)
- {
- var _loc11_ = 0;
- while(_loc11_ < _loc10_.length)
- {
- if(isNaN(_loc10_.substr(_loc11_)) == false)
- {
- break;
- }
- _loc11_ = _loc11_ + 1;
- }
- if(Number(_loc10_.substr(_loc11_)) == _loc5_ && _loc10_.substr(_loc11_ - 1,1) != "_")
- {
- _loc9_ = _loc10_;
- _root.BackObjs.push(_loc9_);
- _loc8_ = "Back";
- }
- }
- for(var _loc10_ in _root.Course.FrontGFX)
- {
- _loc11_ = 0;
- while(_loc11_ < _loc10_.length)
- {
- if(isNaN(_loc10_.substr(_loc11_)) == false)
- {
- break;
- }
- _loc11_ = _loc11_ + 1;
- }
- if((Number(_loc10_.substr(_loc11_)) == _loc5_ || Number(_loc10_.substr(_loc11_)) == _root.frontPos[_loc5_] + (_root.Course.FrontGFX.getNextHighestDepth() - _root.frontOffs)) && _loc10_.substr(_loc11_ - 1,1) != "_")
- {
- _loc9_ = _loc10_;
- _root.FrontObjs.push(_loc9_);
- _loc8_ = "Front";
- }
- }
- if(_loc9_ != "")
- {
- tellTarget(_root.Course[_loc8_ + "GFX"][_loc9_])
- {
- _visible = false;
- children = [];
- children.offsets = [];
- numChildren = 0;
- }
- if(_root.LevelItems[_loc5_].length == _loc6_ + _root.entryWidth)
- {
- switch(_root.LevelItems[_loc5_][_loc6_])
- {
- case "Image":
- _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());
- _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");
- _root.LevelItems[_loc5_][_loc6_ + 2] = Number(_root.LevelItems[_loc5_][_loc6_ + 2]) - 16;
- _root.LevelItems[_loc5_][_loc6_ + 3] = Number(_root.LevelItems[_loc5_][_loc6_ + 3]) - 16;
- break;
- case "Object":
- _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());
- break;
- default:
- _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());
- _root.Course[_root.layers[_root.LevelItems[_loc5_][_loc6_ + 6] % _root.layers.length]]["Moving" + _root.LevelItems[_loc5_][_loc6_] + _loc5_].gotoAndStop(_root.LevelItems[_loc5_][_loc6_ + 1]);
- }
- tellTarget(_root.Course[_root.layers[_root.LevelItems[_loc5_][_loc6_ + 6] % _root.layers.length]]["Moving" + _root.LevelItems[_loc5_][_loc6_] + _loc5_])
- {
- _x = Number(_root.LevelItems[_loc5_][1]);
- _y = Number(_root.LevelItems[_loc5_][2]);
- _rotation = Number(_root.LevelItems[_loc5_][_loc6_ + 4]);
- _xscale = Number(_root.LevelItems[_loc5_][_loc6_ + 5]);
- _yscale = Number(_root.LevelItems[_loc5_][_loc6_ + 5]);
- }
- var _loc12_ = _root.LevelItems[_loc5_][_loc6_ + 8].split(";");
- for(var _loc13_ in _loc12_)
- {
- var _loc14_ = _loc12_[_loc13_].split(":");
- if(isNaN(_loc14_[1]) == false)
- {
- _loc14_[1] = Number(_loc14_[1]);
- }
- _root.Course[_root.layers[_root.LevelItems[_loc5_][_loc6_ + 6] % _root.layers.length]]["Moving" + _root.LevelItems[_loc5_][_loc6_] + _loc5_][_loc14_[0]] = _loc14_[1];
- }
- tellTarget(_root.Course[_loc8_ + "GFX"][_loc9_])
- {
- children.push(_root.Course[_root.layers[_root.LevelItems[_loc5_][_loc6_ + 6] % _root.layers.length]]["Moving" + _root.LevelItems[_loc5_][_loc6_] + _loc5_]);
- children.offsets.push({x:Number(_root.LevelItems[_loc5_][_loc6_ + 2]),y:Number(_root.LevelItems[_loc5_][_loc6_ + 3])});
- numChildren = 1;
- }
- }
- else
- {
- var _loc15_ = 0;
- while(_loc15_ < Number(_root.LevelItems[_loc5_][_loc6_]))
- {
- switch(_root.LevelItems[_loc5_][_loc6_ + 1 + _root.entryWidth * _loc15_])
- {
- case "Image":
- _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());
- _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");
- _root.LevelItems[_loc5_][_loc6_ + 3 + _root.entryWidth * _loc15_] = Number(_root.LevelItems[_loc5_][_loc6_ + 3 + _root.entryWidth * _loc15_]) - 16;
- _root.LevelItems[_loc5_][_loc6_ + 4 + _root.entryWidth * _loc15_] = Number(_root.LevelItems[_loc5_][_loc6_ + 4 + _root.entryWidth * _loc15_]) - 16;
- break;
- case "Object":
- _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());
- break;
- default:
- _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());
- _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_]);
- }
- 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_])
- {
- _x = Number(_root.LevelItems[_loc5_][1]);
- _y = Number(_root.LevelItems[_loc5_][2]);
- _rotation = Number(_root.LevelItems[_loc5_][_loc6_ + 5 + _root.entryWidth * _loc15_]);
- _xscale = Number(_root.LevelItems[_loc5_][_loc6_ + 6 + _root.entryWidth * _loc15_]);
- _yscale = Number(_root.LevelItems[_loc5_][_loc6_ + 6 + _root.entryWidth * _loc15_]);
- }
- _loc12_ = _root.LevelItems[_loc5_][_loc6_ + 8 + _root.entryWidth * _loc15_].split(";");
- for(var _loc13_ in _loc12_)
- {
- _loc14_ = _loc12_[_loc13_].split(":");
- if(isNaN(_loc14_[1]) == false)
- {
- _loc14_[1] = Number(_loc14_[1]);
- }
- _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];
- }
- tellTarget(_root.Course[_loc8_ + "GFX"][_loc9_])
- {
- 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_]);
- children.offsets.push({x:Number(_root.LevelItems[_loc5_][_loc6_ + 3 + _root.entryWidth * _loc15_]),y:Number(_root.LevelItems[_loc5_][_loc6_ + 4 + _root.entryWidth * _loc15_])});
- numChildren = numChildren + 1;
- }
- _loc15_ = _loc15_ + 1;
- }
- }
- }
- }
- _loc5_ = _loc5_ + 1;
- }
- };
- _root.newPLDL = _root.PlayLevelDesignerLevel;
- _root.PlayLevelDesignerLevel = function(MarioX, MarioY, MarioXspeed, MarioYspeed, transition, messageboolean)
- {
- _root.newPLDL(MarioX,MarioY,MarioXspeed,MarioYspeed,transition,messageboolean);
- _root.attachGraphics();
- };
- _root.checkNum = function(len, text, str, num)
- {
- if(str.substr(0,len) == text)
- {
- if(str.indexOf("_") != -1)
- {
- if(Number(str.substr(len,str.indexOf("_") - len)) == num)
- {
- return true;
- }
- }
- else if(Number(str.substr(len)) == num)
- {
- return true;
- }
- }
- return false;
- };
- _root.update = function()
- {
- var _loc2_ = 0;
- while(_loc2_ < _root.BackObjs.length)
- {
- var _loc3_ = 0;
- var _loc4_ = _root.BackObjs[_loc2_].length - 1;
- while(_loc4_ > 0)
- {
- if(isNaN(_root.BackObjs[_loc2_].substr(_loc4_)) == false)
- {
- _loc3_ = Number(_root.BackObjs[_loc2_].substr(_loc4_));
- _loc4_ = _loc4_ - 1;
- continue;
- }
- break;
- }
- 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)
- {
- for(var _loc5_ in _root.Course.BackGFX)
- {
- 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_))
- {
- _root.Course.BackGFX[_loc5_].removeMovieClip(_root.Course.BackGFX[_loc5_]);
- }
- }
- _root.BackObjs.splice(_loc2_,1);
- }
- else
- {
- tellTarget(_root.Course.BackGFX[_root.BackObjs[_loc2_]])
- {
- _visible = _root.KeySPACE();
- var _loc6_ = 0;
- while(_loc6_ < numChildren)
- {
- children[_loc6_]._x = _x + children.offsets[_loc6_].x;
- children[_loc6_]._y = _y + children.offsets[_loc6_].y;
- _loc6_ = _loc6_ + 1;
- }
- }
- _loc2_ = _loc2_ + 1;
- }
- }
- _loc2_ = 0;
- while(_loc2_ < _root.FrontObjs.length)
- {
- _loc3_ = 0;
- _loc4_ = _root.FrontObjs[_loc2_].length - 1;
- while(_loc4_ > 0)
- {
- if(isNaN(_root.FrontObjs[_loc2_].substr(_loc4_)) == false)
- {
- _loc3_ = Number(_root.FrontObjs[_loc2_].substr(_loc4_));
- _loc4_ = _loc4_ - 1;
- continue;
- }
- break;
- }
- 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)
- {
- for(var _loc5_ in _root.Course.FrontGFX)
- {
- 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_))
- {
- _root.Course.FrontGFX[_loc5_].removeMovieClip(_root.Course.FrontGFX[_loc5_]);
- }
- }
- _root.FrontObjs.splice(_loc2_,1);
- }
- else
- {
- tellTarget(_root.Course.FrontGFX[_root.FrontObjs[_loc2_]])
- {
- _visible = _root.KeySPACE();
- _loc6_ = 0;
- while(_loc6_ < numChildren)
- {
- children[_loc6_]._x = _x + children.offsets[_loc6_].x;
- children[_loc6_]._y = _y + children.offsets[_loc6_].y;
- _loc6_ = _loc6_ + 1;
- }
- }
- _loc2_ = _loc2_ + 1;
- }
- }
- };
- _root.newKP = _root.KeyPlus;
- _root.KeyPlus = function()
- {
- _root.update();
- return _root.newKP();
- };
- _root.attachGraphics();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement