home *** CD-ROM | disk | FTP | other *** search
- tellTarget("Spaceship")
- {
- if(_visible)
- {
- if(_root.SsSound._currentframe == 1 && _currentframe == 1)
- {
- _root.SsSound.play();
- }
- if(_root.shipScore == 0 || _X < 0)
- {
- _root.shipScore = 50;
- _visible = false;
- _X = 540;
- gotoAndStop(1);
- }
- if(_root.shipScore >= 50)
- {
- _X = _X - 4;
- }
- }
- }
- if(800 - 3 * alienHeight - 5 * aliensDead < getTimer() - time)
- {
- if(newLife == 1)
- {
- tellTarget("LaserBase")
- {
- gotoAndStop(1);
- _X = 95;
- }
- newLife = 0;
- tonePos = 1;
- }
- else if(newLife)
- {
- newLife--;
- }
- else
- {
- Sound.gotoAndPlay("Tone" + tonePos);
- tonePos++;
- if(tonePos == 5)
- {
- tonePos = 1;
- }
- tellTarget("Spaceship")
- {
- if(!_visible && random(40) < 1)
- {
- _visible = true;
- }
- }
- if(0 < shipScore && shipScore < 50)
- {
- shipScore -= 10;
- }
- allGone = true;
- if(shifts == 1 && (497 < xMax || xMin < 23))
- {
- shifts = 0;
- dir *= -1;
- alienHeight += 14;
- }
- xMin = 400;
- xMax = 0;
- var i = 0;
- while(i < 11)
- {
- var j = 1;
- while(j < 6)
- {
- thisAlien = eval("Row" + j + i);
- if(thisAlien._visible)
- {
- allGone = false;
- tellTarget(thisAlien)
- {
- if(_root.shifts == 0)
- {
- _Y = _root.alienHeight + 30 * this.j;
- }
- else
- {
- _X = _X + _root.dir;
- if(_currentframe == 1)
- {
- gotoAndStop(2);
- }
- else
- {
- gotoAndStop(1);
- }
- }
- if(320 < _Y)
- {
- _root.lives = 0;
- }
- if(_X < _root.xMin)
- {
- _root.xMin = _X;
- }
- if(_root.xMax < _X)
- {
- _root.xMax = _X;
- }
- }
- }
- j++;
- }
- i++;
- }
- if(shifts == 0)
- {
- xMin = 400;
- xMax = 0;
- shifts = 1;
- }
- if(allGone)
- {
- score += 1000;
- if(lives < 9)
- {
- lives++;
- }
- gotoAndPlay(6);
- }
- }
- time = getTimer();
- }
- var i = 0;
- while(i < 11)
- {
- var j = 1;
- while(j < 6)
- {
- thisAlien = eval("Row" + j + i);
- if(LaserFire.hitTest(thisAlien))
- {
- Sound.gotoAndPlay("Kill");
- aliensDead++;
- LaserFire._y = -20;
- Explode._x = thisAlien._X;
- Explode._y = thisAlien._y;
- Explode.gotoAndPlay(2);
- removeMovieClip(thisAlien);
- if(j == 5 || j == 4)
- {
- score += 10;
- }
- else if(j == 3 || j == 2)
- {
- score += 20;
- }
- else
- {
- score += 40;
- }
- }
- j++;
- }
- i++;
- }
- tellTarget("LaserFire")
- {
- if(_visible)
- {
- _Y = _Y - 12;
- if(280 < _Y)
- {
- var b = 10;
- while(b < 50)
- {
- block = eval("_root.Block" + b);
- if(block._visible && hitTest(block))
- {
- _Y = 0;
- if(block._currentframe == 4)
- {
- block._visible = false;
- }
- else
- {
- block.nextFrame();
- }
- }
- b++;
- }
- }
- if(_Y < 40)
- {
- _visible = false;
- _Y = 392;
- }
- }
- }
- if(LaserFire.hitTest(Spaceship) && Spaceship._currentframe == 1)
- {
- stopAllSounds();
- Sound.gotoAndPlay("KillSS");
- setProperty("LaserFire", _Y, -20);
- shipScore = random(6) + 1;
- score += 50 * shipScore;
- Spaceship.gotoAndStop(shipScore + 1);
- SsSound.gotoAndStop(1);
- shipScore = 40;
- }
- var fire = 4;
- while(0 < fire)
- {
- if(!AlienFire4._visible && 1 < random(20) && fire == 4)
- {
- fire = 3;
- }
- alienFire = eval("AlienFire" + fire);
- tellTarget(alienFire)
- {
- if(_visible)
- {
- if(this.fire == 4)
- {
- _Y = _Y + 12;
- }
- else
- {
- _Y = _Y + 8;
- }
- if(412 < _Y)
- {
- _visible = false;
- }
- }
- else if(!_root.newLife && random(170 - _root.alienHeight) < 1)
- {
- var i = random(11);
- var j = 5;
- while(0 < j)
- {
- firePos = eval("_root.Row" + j + i);
- if(firePos._visible)
- {
- _X = firePos._x;
- _Y = firePos._y + 16;
- _visible = true;
- j = 0;
- }
- j--;
- }
- }
- if(290 < _Y && _visible)
- {
- var b = 10;
- while(b < 50)
- {
- block = eval("_root.Block" + b);
- if(block._visible && hitTest(block))
- {
- _visible = false;
- if(block._currentframe == 4)
- {
- block._visible = false;
- }
- else
- {
- block.nextFrame();
- }
- }
- b++;
- }
- }
- }
- if(!newLife && alienFire._visible && alienFire.hitTest(LaserBase))
- {
- Sound.gotoAndPlay("Boom");
- alienFire._visible = false;
- setProperty("Life" + lives, _visible, false);
- LaserBase.gotoAndStop(2);
- newLife = 3;
- lives--;
- }
- fire--;
- }
- if(lives == 0)
- {
- LaserBase.gotoAndStop(2);
- gotoAndPlay(16);
- }
-