home *** CD-ROM | disk | FTP | other *** search
- function createStarField()
- {
- var depthOffset = 15;
- var i = depthOffset;
- var gutter = 0;
- var layer1PlayHead = 1;
- var layer2PlayHead = 9;
- var layer3PlayHead = 17;
- while(--i)
- {
- playField.attachMovie("stars","starsLayer3" + i,_root.depth);
- _root.depth = _root.depth + 1;
- tellTarget(playField["starsLayer3" + i])
- {
- _X = Math.floor(Math.random() * 700);
- _Y = gutter;
- gotoAndPlay(layer3PlayHead);
- }
- if(++layer3PlayHead == 23)
- {
- layer3PlayHead = 17;
- }
- gutter += 11;
- playField.attachMovie("stars","starsLayer2" + i,_root.depth);
- _root.depth = _root.depth + 1;
- tellTarget(playField["starsLayer2" + i])
- {
- _X = Math.floor(Math.random() * 700);
- _Y = gutter;
- gotoAndPlay(layer2PlayHead);
- }
- if(++layer2PlayHead == 16)
- {
- layer2PlayHead = 9;
- }
- gutter += 11;
- playField.attachMovie("stars","starsLayer1" + i,_root.depth);
- _root.depth = _root.depth + 1;
- tellTarget(playField["starsLayer1" + i])
- {
- _X = Math.floor(Math.random() * 700);
- _Y = gutter;
- gotoAndPlay(layer1PlayHead);
- }
- if(++layer1PlayHead == 8)
- {
- layer1PlayHead = 0;
- }
- gutter += 11;
- }
- _root.ship.swapDepths(31);
- }
- function init()
- {
- var t = this.createEmptyMovieClip("playField",_root.depth);
- _root.depth = _root.depth + 1;
- t._x = 0;
- t._y = 16;
- createStarField();
- }
- _root.depth = 2;
-