Frame 1
stop();
Frame 2
speed = 0;
rotate = 0;
deltax = 0;
deltay = 0;
maxbullet = 1;
lastshoot = 0;
level = 1;
lives = 3;
score = 0;
bonuslife = 1000;
exhaust = 200;
missiletimer = 0;
pause = false;
Frame 3
asteroids = level * 5;
astmax = 5;
astonscreen = astmax;
kills = 0;
missilefly = 0;
ufomove = 0;
powerup = 0;
powerupbar._visible = false;
_root.lifecounter.gotoAndStop(_root.lives + 1);
t = 1;
while (astmax >= t) {
duplicateMovieClip (asteroid, "asteroid" + t, t + 100);
position = int(4 * Math.random());
coordinate = int(240 * Math.random());
if (position == 1) {
setProperty("asteroid" + t, _x , -30);
setProperty("asteroid" + t, _y , coordinate);
}
if (position == 2) {
setProperty("asteroid" + t, _x , 350);
setProperty("asteroid" + t, _y , coordinate);
}
if (position == 3) {
setProperty("asteroid" + t, _y , -30);
setProperty("asteroid" + t, _x , coordinate);
}
if (position == 4) {
setProperty("asteroid" + t, _y , -270);
setProperty("asteroid" + t, _x , coordinate);
}
lastdepth = t + 100;
t = t + 1;
}
spaceship.gotoAndPlay(106);
stop();
Instance of Symbol 31 MovieClip "spaceship" in Frame 3
onClipEvent (enterFrame) {
_root.lifecounter.gotoAndStop(_root.lives + 1);
rotate = this._rotation;
if (rotate < 0) {
rotate = 180 + (180 - Math.abs(rotate));
}
rotate = (rotate / 360) * (Math.PI*2);
dx = Math.sin(rotate);
dy = -Math.cos(rotate);
if ((Key.isDown(Key.UP) && (this._currentFrame == 1)) && (_root.pause == false)) {
_root.deltax = _root.deltax + (dx / 8);
_root.deltay = _root.deltay + (dy / 8);
_root.exhausttrail.duplicateMovieClip("exhaust" + _root.exhaust, _root.exhaust);
setProperty("_root.exhaust" + _root.exhaust, _x , this._x - (2 * dx));
setProperty("_root.exhaust" + _root.exhaust, _y , this._y - (2 * dy));
_root.exhaust = _root.exhaust + 1;
}
if ((Key.isDown(Key.DOWN) && (this._currentFrame == 1)) && (_root.pause == false)) {
_root.deltax = _root.deltax - (dx / 8);
_root.deltay = _root.deltay - (dy / 8);
_root.exhausttrail.duplicateMovieClip("exhaust" + _root.exhaust, _root.exhaust);
setProperty("_root.exhaust" + _root.exhaust, _x , this._x);
setProperty("_root.exhaust" + _root.exhaust, _y , this._y);
_root.exhaust = _root.exhaust + 1;
}
if (230 < _root.exhaust) {
_root.exhaust = 200;
}
if (4 < _root.deltax) {
_root.deltax = 4;
}
if (_root.deltax < -4) {
_root.deltax = -4;
}
if (4 < _root.deltay) {
_root.deltay = 4;
}
if (_root.deltay < -4) {
_root.deltay = -4;
}
if (_root.pause == false) {
this._x = this._x + _root.deltax;
this._y = this._y + _root.deltay;
}
if (Key.isDown(Key.RIGHT) && (_root.pause == false)) {
this._rotation = this._rotation + 9;
}
if (Key.isDown(Key.LEFT) && (_root.pause == false)) {
this._rotation = this._rotation - 9;
}
if (320 < this._x) {
this._x = 0;
}
if (240 < this._y) {
this._y = 0;
}
if (this._x < 0) {
this._x = 320;
}
if (this._y < 0) {
this._y = 240;
}
if ((this._currentFrame == 1) && (_root.pause == false)) {
_root.lastshoot = _root.lastshoot - 1;
if (_root.lastshoot < 0) {
_root.lastshoot = 0;
}
if (((Key.isDown(Key.CONTROL) || (Key.isDown(Key.SPACE))) && (_root.lastshoot == 0)) && (this._currentFrame == 1)) {
newname = "bullet" + Number(_root.maxbullet);
duplicateMovieClip (_root.bullet, newname, _root.maxbullet);
setProperty("_root.bullet" + _root.maxbullet, _x , this._x + (10 * dx));
setProperty("_root.bullet" + _root.maxbullet, _y , this._y + (10 * dy));
setProperty("_root.bullet" + _root.maxbullet, _rotation , this._rotation);
Set(("_root.bullet" + _root.maxbullet) + ".type", 1);
Set(("_root.bullet" + _root.maxbullet) + ".speed", 5);
_root.maxbullet = _root.maxbullet + 1;
_root.lastshoot = 15;
if (10 < _root.maxbullet) {
_root.maxbullet = 1;
}
shoot = new Sound();
shoot.attachSound("shoot");
shoot.start();
}
if (_root.kills >= _root.asteroids) {
this.gotoAndPlay(126);
}
}
if (Key.isDown(Key.SPACE) && (_root.pause == true)) {
_root.pause = false;
_root.scoredisplay = _root.score;
}
if (Key.isDown(80) && (_root.pause == false)) {
_root.pause = true;
_root.scoredisplay = "SPACE";
}
}
Instance of Symbol 43 MovieClip "asteroid" in Frame 3
onClipEvent (load) {
state = "defaultValue";
}
onClipEvent (enterFrame) {
if (this._name != "asteroid") {
if (this._x < -20) {
this._x = 320;
rotate = int(120 * Math.random());
rotate = rotate + 210;
rotspeed = int(6 * Math.random());
speed = 2 * Math.random();
}
if (340 < this._x) {
this._x = 0;
rotate = int(120 * Math.random());
rotate = rotate + 30;
rotspeed = int(6 * Math.random());
speed = 2 * Math.random();
}
if (this._y < -20) {
this._y = 240;
rotate = int(120 * Math.random());
rotate = rotate + 300;
rotspeed = int(6 * Math.random());
speed = 2 * Math.random();
}
if (260 < this._y) {
this._y = 0;
rotate = int(120 * Math.random());
rotate = rotate + 60;
rotspeed = int(6 * Math.random());
speed = 2 * Math.random();
}
if (rotspeed == 0) {
rotspeed = 1;
}
if (3 < rotspeed) {
rotspeed = 3 - rotspeed;
}
if (speed < 0.5) {
speed = 0.5;
}
if (360 < rotate) {
rotate = rotate - 360;
}
if (_root.pause == false) {
angle = (rotate / 360) * (Math.PI*2);
dx = Math.sin(angle);
dy = -Math.cos(angle);
if ((this._currentFrame == 1) || (this.currentFrame == 11)) {
this._rotation = this._rotation + rotspeed;
}
this._x = this._x + (dx * speed);
this._y = this._y + (dy * speed);
}
if ((((this.astcoll1.hitTest(_root.spaceship) || (this.astcoll2.hitTest(_root.spaceship))) && (_root.spaceship._currentFrame == 1)) && (0 >= _root.powerup)) && ((this._currentFrame == 1) || (this._currentFrame == 11))) {
_root.spaceship.gotoAndPlay("death");
}
bullethit = false;
t = 0;
while (30 >= t) {
if (this.hitTest("_root.bullet" + t) && ((this._currentFrame == 1) || (this._currentFrame == 11))) {
bullethit = true;
removeMovieClip("_root.bullet" + t);
}
t = t + 1;
}
if (this.hitTest(_root.missile) && (_root.missile._currentFrame == 1)) {
bullethit = true;
_root.missile.gotoAndPlay("death");
score = score + 10;
}
if (bullethit == true) {
what = int(2 * Math.random());
if (what == 0) {
split = new Sound();
split.attachSound("split");
split.start();
if (this._currentFrame == 11) {
this.gotoAndPlay("destroy");
_root.score = _root.score + 20;
_root.bonuslife = _root.bonuslife - 20;
_root.astonscreen = _root.astonscreen - 1;
}
if (this._currentFrame == 1) {
s = "asteroid" + Number(_root.asteroids + 1);
_root.lastdepth = _root.lastdepth + 1;
_root.asteroids = _root.asteroids + 1;
_root.astonscreen = _root.astonscreen + 1;
duplicateMovieClip (_root.asteroid, s, _root.lastdepth);
setProperty("_root." + s, _x , this._x);
setProperty("_root." + s, _y , this._y);
rotate = rotate - 30;
tellTarget ("_root." + s) {
gotoAndStop (11);
};
this.gotoAndPlay("getsmaller");
_root.score = _root.score + 10;
_root.bonuslife = _root.bonuslife - 10;
}
}
if (what == 1) {
if (this._currentFrame == 11) {
this.gotoAndPlay("destroy");
_root.score = _root.score + 20;
_root.bonuslife = _root.bonuslife - 20;
_root.astonscreen = _root.astonscreen - 1;
}
if (this._currentFrame == 1) {
this.gotoAndPlay("getsmaller");
_root.score = _root.score + 10;
_root.bonuslife = _root.bonuslife - 10;
}
}
}
if (_root.pause == false) {
_root.scoredisplay = _root.score;
}
if (0 >= _root.bonuslife) {
_root.lives = _root.lives + 1;
_root.bonuslife = Math.abs(_root.bonuslife) + 1000;
}
if (_root._currentFrame == 100) {
this.removeMovieClip();
}
}
}
Instance of Symbol 45 MovieClip "bullet" in Frame 3
onClipEvent (load) {
fuse = 5;
}
onClipEvent (enterFrame) {
if ((this._name != "bullet") && (_root.pause == false)) {
rotate = this._rotation;
if (rotate < 0) {
rotate = 180 + (180 - Math.abs(rotate));
}
rotate = (rotate / 360) * (Math.PI*2);
dx = Math.sin(rotate);
dy = -Math.cos(rotate);
this._x = this._x + (dx * this.speed);
this._y = this._y + (dy * this.speed);
if ((((320 < this._x) || (240 < this._y)) || (this._x < 0)) || (this._y < 0)) {
this.removeMovieClip();
}
}
if ((this.hitTest(_root.spaceship) && (_root.spaceship._currentFrame == 1)) && (this.type == 2)) {
_root.spaceship.gotoAndPlay("death");
this.removeMovieClip();
}
}
Instance of Symbol 50 MovieClip "ufo" in Frame 3
onClipEvent (enterFrame) {
if (((1 < _root.level) && (_root.ufomove != 1)) && (_root.pause == false)) {
_root.ufomove = int(250 * Math.random());
this.gotoAndPlay(1);
if (_root.ufomove == 1) {
position = int(4 * Math.random());
if (position == 1) {
this._x = -15;
this._y = int(200 * Math.random()) + 20;
rotate = 90;
}
if (position == 2) {
this._x = 335;
this._y = int(200 * Math.random()) + 20;
rotate = 270;
}
if (position == 3) {
this._x = int(280 * Math.random()) + 20;
this._y = -15;
rotate = 180;
}
if (position == 4) {
this._x = int(280 * Math.random()) + 20;
this._y = 255;
rotate = 0;
}
angle = int(60 * Math.random());
a = int(2 * Math.random());
if (a == 1) {
rotate = rotate + angle;
}
if (a != 1) {
rotate = rotate - angle;
}
ufosound = 0;
}
}
if ((_root.ufomove == 1) && (_root.pause == false)) {
angle = (rotate / 360) * (Math.PI*2);
dx = Math.sin(angle);
dy = -Math.cos(angle);
this._x = this._x + (dx * 2);
this._y = this._y + (dy * 2);
if ((((this._x < -15) || (335 < this._x)) || (this._y < -15)) || (255 < this._y)) {
_root.ufomove = 0;
}
ufosound = ufosound + 1;
if (this._currentFrame < 8) {
if (ufosound == 2) {
ufoengine = new Sound();
ufoengine.attachSound("ufo");
ufoengine.start();
ufosound = 0;
}
}
if (_root.level == 3) {
firechance = 170;
}
if (_root.level == 4) {
firechance = 150;
}
if (_root.level == 5) {
firechance = 130;
}
if (_root.level == 6) {
firechance = 110;
}
if (_root.level == 7) {
firechance = 90;
}
if (_root.level == 8) {
firechance = 70;
}
if (_root.level == 9) {
firechance = 50;
}
if (9 < _root.level) {
firechance = 30;
}
fire = int(firechance * Math.random());
if ((((fire == 1) && (this._currentFrame < 8)) && (2 < _root.level)) && (_root.pause == false)) {
newname = "bullet" + Number(_root.maxbullet);
angle = Math.atan2(_root.spaceship._x - this._x, this._y - _root.spaceship._y);
angle = (angle * 360) / (Math.PI*2);
if (180 < angle) {
angle = (angle - 180) - 180;
}
duplicateMovieClip (_root.bullet, newname, _root.maxbullet);
setProperty("_root.bullet" + _root.maxbullet, _x , this._x);
setProperty("_root.bullet" + _root.maxbullet, _y , this._y);
setProperty("_root.bullet" + _root.maxbullet, _rotation , angle);
Set(("_root.bullet" + _root.maxbullet) + ".type", 2);
Set(("_root.bullet" + _root.maxbullet) + ".speed", 3);
_root.maxbullet = _root.maxbullet + 1;
if (10 < _root.maxbullet) {
_root.maxbullet = 1;
}
}
if ((this.hitTest(_root.spaceship) && (_root.spaceship._currentFrame == 1)) && (7 >= this._currentFrame)) {
this.gotoAndPlay("death");
_root.spaceship.gotoAndPlay("death");
}
if (this.hitTest(_root.spaceship) && (this._currentFrame == 23)) {
this._x = -15;
this._y = 120;
_root.ufomove = 0;
_root.powerup = 100;
}
bullethit = false;
t = 1;
while (30 >= t) {
if (this.hitTest("_root.bullet" + t) && (eval (("_root.bullet" + t) + ".type") == 1)) {
bullethit = true;
_root.removeMovieClip("_root.bullet" + t);
}
t = t + 1;
}
if ((bullethit == true) && (this._currentFrame < 8)) {
this.gotoAndPlay("death");
}
}
if ((0 < _root.powerup) && (_root.pause == false)) {
_root.powerupbar._visible = true;
_root.powerupbar.bar._width = _root.powerup;
_root.powerup = _root.powerup - 0.2;
powercolor = new Color(_root.powerupbar.bar);
if (30 < _root.powerup) {
powercolor.setRGB(6723840);
}
if (30 >= _root.powerup) {
powercolor.setRGB(16777113);
}
if (15 >= _root.powerup) {
powercolor.setRGB(10040064);
}
if (0 >= _root.powerup) {
_root.powerup = 0;
_root.powerupbar._visible = false;
}
}
}
Instance of Symbol 52 MovieClip "missile" in Frame 3
onClipEvent (enterFrame) {
if (((((3 < _root.level) && (_root.missilefly != 1)) && (_root.ufomove == 1)) && (_root.ufo._currentFrame < 8)) && (_root.pause == false)) {
_root.missilefly = int(200 * Math.random());
if (_root.missilefly == 1) {
this._x = _root.ufo._x;
this._y = _root.ufo._y;
_root.missiletimer = 200;
ufoshot = new Sound();
ufoshot.attachSound("ufoshot");
ufoshot.start();
}
}
if (((_root.missilefly == 1) && (this._currentFrame == 1)) && (_root.pause == false)) {
angle = Math.atan2(_root.spaceship._x - this._x, this._y - _root.spaceship._y);
angle = (angle * 360) / (Math.PI*2);
if (180 < angle) {
angle = (angle - 180) - 180;
}
this._rotation = angle;
rotate = this._rotation;
if (rotate < 0) {
rotate = 180 + (180 - Math.abs(rotate));
}
rotate = (rotate / 360) * (Math.PI*2);
dx = Math.sin(rotate);
dy = -Math.cos(rotate);
speed = _root.level / 2;
if (2.5 < speed) {
speed = 2.5;
}
this._x = this._x + (dx * speed);
this._y = this._y + (dy * speed);
_root.exhausttrail.duplicateMovieClip("exhaust" + _root.exhaust, _root.exhaust);
setProperty("_root.exhaust" + _root.exhaust, _x , this._x - (2 * dx));
setProperty("_root.exhaust" + _root.exhaust, _y , this._y - (2 * dy));
_root.exhaust = _root.exhaust + 1;
_root.missiletimer = _root.missiletimer - 1;
if ((0 >= _root.missiletimer) && (this._currentFrame == 1)) {
this.gotoAndPlay("death");
}
if ((this.hitTest(_root.spaceship) && (_root.spaceship._currentFrame == 1)) && (this._currentFrame == 1)) {
_root.spaceship.gotoAndPlay("death");
this.gotoAndPlay("death");
}
bullethit = false;
t = 0;
while (t < 30) {
if (this.hitTest("_root.bullet" + t) && ((this._currentFrame == 1) || (this._currentFrame == 11))) {
bullethit = true;
removeMovieClip("_root.bullet" + t);
}
t = t + 1;
}
}
}
Frame 5
t = -1;
while (asteroids >= t) {
removeMovieClip("asteroid" + t);
t = t + 1;
}
deltax = 0;
deltay = 0;
speed = 0;
Frame 11
if (lives < 0) {
gotoAndPlay (82);
}
Frame 13
level = level + 1;
scoreboard.levelno = "LEVEL " + level;
scoreboard.score = "SCORE : " + score;
Frame 17
scoreboard.levelno = "LEVEL " + level;
scoreboard.score = "SCORE : " + score;
Frame 67
scoreboard.levelno = "LEVEL " + level;
scoreboard.score = "SCORE : " + score;
Frame 72
scoreboard.levelno = "LEVEL " + level;
scoreboard.score = "SCORE : " + score;
Frame 81
gotoAndStop (3);
Frame 101
scoredisplay = "SCORE: " + score;
stop();
Symbol 7 Button
on (release) {
play();
}
Symbol 23 MovieClip Frame 1
stop();
Symbol 26 MovieClip Frame 12
if (this._name != "exhausttrail") {
this.removeMovieClip();
}
Symbol 31 MovieClip Frame 1
_root.lives.gotoAndStop(_root.lives + 1);
stop();
Symbol 31 MovieClip Frame 2
_root.lives = _root.lives - 1;
Symbol 31 MovieClip Frame 15
Symbol 31 MovieClip Frame 105
this._x = 160;
this._y = 120;
this._rotation = 0;
_root.deltax = 0;
_root.deltay = 0;
t = 0;
while (_root.asteroids >= t) {
a = int(4 * Math.random());
if (a == 0) {
setProperty("_root.asteroid" + t, _x , -30);
}
if (a == 1) {
setProperty("_root.asteroid" + t, _y , -30);
}
if (a == 2) {
setProperty("_root.asteroid" + t, _x , 350);
}
if (a >= 3) {
setProperty("_root.asteroid" + t, _y , 270);
}
t = t + 1;
}
if (_root.lives < 0) {
_root.gotoAndPlay("nextlevel");
}
Symbol 31 MovieClip Frame 106
play();
if (_root.missilefly == 1) {
_root.missile.gotoAndPlay("death");
}
if (_root.ufomove == 1) {
_root.ufomove = 0;
_root.ufo._x = -30;
}
Symbol 31 MovieClip Frame 125
gotoAndStop (1);
Symbol 31 MovieClip Frame 141
_root.gotoAndPlay("nextlevel");
gotoAndStop (1);
Symbol 43 MovieClip Frame 1
stop();
Symbol 43 MovieClip Frame 2
play();
Symbol 43 MovieClip Frame 11
stop();
Symbol 43 MovieClip Frame 12
play();
Symbol 43 MovieClip Frame 21
_root.kills = _root.kills + 1;
if ((((_root.kills + _root.astonscreen) < _root.asteroids) && (_root.astonscreen < 8)) && (10 >= _root._currentFrame())) {
_root.asteroid.duplicateMovieClip("asteroid" + Number(_root.kills + _root.astonscreen), _root.lastdepth + 1);
_root.lastdepth = _root.lastdepth + 1;
_root.astonscreen = _root.astonscreen + 1;
}
this.removeMovieClip();
Symbol 50 MovieClip Frame 7
gotoAndPlay (1);
Symbol 50 MovieClip Frame 8
play();
Symbol 50 MovieClip Frame 22
_root.score = _root.score + 50;
getpowerup = int(5 * Math.random());
if (getpowerup != 1) {
this._x = -15;
this._y = 120;
_root.ufomove = 0;
stop();
}
Symbol 50 MovieClip Frame 23
stop();
Symbol 52 MovieClip Frame 1
stop();
Symbol 52 MovieClip Frame 2
play();
Symbol 52 MovieClip Frame 15
_root.missilefly = 0;
this._x = -30;