home *** CD-ROM | disk | FTP | other *** search
- _root.rover = new Sound(rover);
- _root.rover.attachSound("rover");
- _root.explode = new Sound(explode);
- _root.explode.attachSound("explode");
- _root.loop = new Sound(loop);
- _root.loop.attachSound("loop");
- _root.loopvolume = 100;
- _root.fade = "in";
- _root.gsc = "play";
- _root.display._visible = false;
- _root.score = "None";
- _root.stageheight = 220;
- _root.stagewidth = 400;
- _root.mycolor = "0x993300";
- _root.halfshipwidth = 10;
- _root.maxjaggyness = 30;
- _root.mintunnelwidth = 30;
- _root.minaddy = 20;
- _root.terrainarray = new Array();
- _root.coordinates = new Array();
- _root.loop.onSoundComplete = function()
- {
- _root.loop.start(0,0);
- };
- _root.setup = function()
- {
- _root.loop.stop();
- _root.loop.start(0,0);
- if(_root.gsc == "play")
- {
- _root.loopvolume = 100;
- _root.fade = "in";
- }
- else if(_root.gsc == "stop")
- {
- _root.fade = "out";
- _root.loopvolume = 0;
- }
- _root.loop.setVolume(_root.loopvolume);
- _root.attachMovie("ship","ship",1);
- _root.ship._y = _root.stageheight - 5;
- _root.ship._x = _root.stagewidth / 2;
- _root.attachMovie("terrain","terrain" + _root.depth,_root.depth);
- _root.terrainarray[_root.terrainarray.length] = _root["terrain" + _root.depth];
- if(_root.depth < 1000)
- {
- _root.depth = _root.depth + 1;
- }
- else
- {
- _root.depth = 5;
- }
- _root.addterrain = false;
- _root.diesequence = false;
- _root.display._visible = true;
- _root.gameplay = true;
- _root.score = 0;
- _root.speed = 14;
- _root.tspeed = 15;
- _root.jaggyness = 10;
- _root.tunnelwidth = 125;
- _root.depth = 5;
- _root.nextx = _root.stagewidth / 2 - _root.tunnelwidth / 2;
- _root.addy = 50;
- _root.deadcounter = 0;
- _root.pausedelay = 0;
- };
- _root.clean = function()
- {
- i = _root._root.terrainarray.length - 1;
- while(i >= 0)
- {
- _root.terrainarray[i].removeMovieClip();
- _root.terrainarray.splice(i,1);
- i--;
- }
- i = _root._root.coordinates.length - 1;
- while(i >= 0)
- {
- _root.coordinates[i].removeMovieClip();
- _root.coordinates.splice(i,1);
- i--;
- }
- _root.ship.removeMovieClip();
- _root.explosion.removeMovieClip();
- _root.youaredead = false;
- _root.display._visible = false;
- _root.gameplay = false;
- _root.fade = "end";
- };
-