home *** CD-ROM | disk | FTP | other *** search
- function setuplevel()
- {
- _root.state = "paused";
- _root.levelann = "Cave " + level;
- trace("LEVEL START" + level);
- attachMovie("level_announce","tellPlayer",9);
- tellPlayer._x = 320;
- tellPlayer._y = 100;
- background.gotoAndStop(level);
- i = 0;
- while(i < 100)
- {
- removeMovieClip(eval("landScape.mine" + i));
- removeMovieClip(eval("landScape.fuelPad" + i));
- removeMovieClip(eval("landScape.volcano" + i));
- removeMovieClip(eval("landScape.escapePod" + i));
- i++;
- }
- landScape.attachMovie("thrustClip","thrustClip",100);
- landScape.thrustClip.thrustRightClip._visible = false;
- landScape.thrustClip.thrustLeftClip._visible = false;
- landScape.thrustClip.thrustUpClip._visible = false;
- landScape.thrustClip.thrustDownClip._visible = false;
- playerState = "normal";
- currentLevelquota = 0;
- currentLevelCollect = 0;
- gameArray = eval("level" + level + "data");
- enemyLevel = _root.enemyLevelStart;
- trace(enemyLevel);
- i = 0;
- while(i < gameArray.length)
- {
- ran = gameArray[i];
- if(ran == "player")
- {
- trace(ran);
- px = gameArray[i + 1];
- py = gameArray[i + 2];
- playerXspeed = 0;
- playerYspeed = 0.1;
- attachMovie("player","player",7);
- player._x = 320;
- player._y = 240;
- }
- if(ran == "exit")
- {
- landScape.attachMovie("exitPad","exit" + enemyLevel,enemyLevel);
- with(eval("landScape.exit" + enemyLevel))
- {
- _x = gameArray[i + 1];
- _y = gameArray[i + 2];
- }
- }
- if(ran == "miniCollect")
- {
- landScape.attachMovie("miniCollect","miniCollect" + enemyLevel,enemyLevel);
- tempType = gameArray[i + 3];
- if(tempType == 0)
- {
- tempType = random(3) + 1;
- }
- with(eval("landScape.miniCollect" + enemyLevel))
- {
- _x = gameArray[i + 1];
- _y = gameArray[i + 2];
- gotoAndStop(tempType);
- clip.typeOf = tempType;
- }
- }
- if(ran == "mine")
- {
- landScape.attachMovie("mine_Clip","mine" + enemyLevel,enemyLevel);
- with(eval("landScape.mine" + enemyLevel))
- {
- _x = gameArray[i + 1];
- _y = gameArray[i + 2];
- clip.moveType = gameArray[i + 3];
- }
- }
- if(ran == "volcano")
- {
- landScape.attachMovie("volcano","volcano" + enemyLevel,enemyLevel);
- with(eval("landScape.volcano" + enemyLevel))
- {
- _x = gameArray[i + 1];
- _y = gameArray[i + 2];
- clip.moveType = gameArray[i + 3];
- }
- }
- if(ran == "escapePod")
- {
- landScape.attachMovie("escapePod","escapePod" + enemyLevel,enemyLevel);
- with(eval("landScape.escapePod" + enemyLevel))
- {
- _x = gameArray[i + 1];
- _y = gameArray[i + 2];
- currentLevelquota++;
- }
- }
- if(ran == "fuelPad")
- {
- landScape.attachMovie("fuelPad","fuelPad" + enemyLevel,enemyLevel);
- with(eval("landScape.fuelPad" + enemyLevel))
- {
- _x = gameArray[i + 1];
- _y = gameArray[i + 2];
- }
- }
- if(ran == "shieldCharge")
- {
- landScape.attachMovie("shieldCharge","shieldCharge" + enemyLevel,enemyLevel);
- with(eval("landScape.shieldCharge" + enemyLevel))
- {
- _x = gameArray[i + 1];
- _y = gameArray[i + 2];
- }
- }
- enemyLevel++;
- i += 4;
- }
- currentLevelCollect = 0;
- remainObjects = currentLevelquota - currentLevelCollect;
- trace("remainObjects = " + remainObjects);
- landScape.gotoAndStop(level + 1);
- landScape._x = - (px - 320);
- landScape._y = - (py - 240);
- landScape._xscale = 100;
- landScape._yscale = 100;
- playmusic();
- thrusting = 0;
- leftThrust = 0;
- rightThrust = 0;
- addThrust = 5;
- playerFuel = 100;
- playerHealth = 100;
- this.lifeMeter_clip.life_bar_clip._xscale = playerHealth;
- this.fuelMeter_clip.fuel_bar_clip._xscale = playerFuel;
- lowFuelSnd_played = 0;
- }
-