home *** CD-ROM | disk | FTP | other *** search
- function init()
- {
- regClear();
- setLevel(_global.opt.startLevel);
- ready = true;
- }
- function regClear()
- {
- regObjects = new Array();
- regCount = 0;
- }
- function register(pObject)
- {
- pObject.reset();
- regObjects[regCount++] = pObject;
- }
- function resetLevel()
- {
- i = 0;
- while(i < regCount)
- {
- regObjects[i].reset();
- i++;
- }
- }
- function nextLevel()
- {
- setLevel(_global.stat.actLevel + 1);
- }
- function setLevel(pLevel)
- {
- if(_global.stat.actLevel == pLevel)
- {
- resetLevel();
- }
- else
- {
- _global.stat.actLevel = pLevel;
- regClear();
- matter.solid.gotoAndStop(_global.stat.actLevel);
- matter.deadly.gotoAndStop(_global.stat.actLevel);
- matter.ghost.gotoAndStop(_global.stat.actLevel);
- fg.gotoAndStop(_global.stat.actLevel);
- bg.gotoAndStop(_global.stat.actLevel);
- markers.gotoAndStop(_global.stat.actLevel);
- }
- }
- stop();
- init();
-