Frame 51
numEnemy = 8;
i = 2;
while (i <= numEnemy) {
enemy.duplicateMovieClip("enemy" + i, i + 100);
i++;
}
score = 0;
Instance of Symbol 20 MovieClip "mainground" in Frame 51
onClipEvent (load) {
ground.duplicateMovieClip("ground2", 100);
ground2._x = ground._x + ground._width;
groundStartx = this._x;
groundSpeed = 10;
}
onClipEvent (enterFrame) {
this._x = this._x - 10;
if (this._x <= (groundStartx - 551.35)) {
this._x = groundStartx - groundSpeed;
}
}
Instance of Symbol 23 MovieClip "spaceship" in Frame 51
onClipEvent (load) {
moveSpeed = 10;
_root.laser._visible = false;
laserCounter = 1;
maxLasers = 4;
depthCounter = 1;
}
onClipEvent (enterFrame) {
if (Key.isDown(32) and (laserCounter <= maxLasers)) {
laserCounter++;
_root.laser.duplicateMovieClip("laser" + depthCounter, depthCounter);
_root["laser" + depthCounter]._visible = true;
depthCounter++;
if (depthCounter > maxLasers) {
depthCounter = 1;
}
}
if (Key.isDown(39)) {
this._x = this._x + moveSpeed;
} else if (Key.isDown(37) and (this._x > 0)) {
this._x = this._x - moveSpeed;
}
if (Key.isDown(40)) {
this._y = this._y + moveSpeed;
} else if (Key.isDown(38)) {
this._y = this._y - moveSpeed;
}
}
Instance of Symbol 25 MovieClip "laser" in Frame 51
onClipEvent (load) {
laserMoveSpeed = 20;
this._y = _root.spaceship._y - 4;
this._x = _root.spaceship._x + 8;
}
onClipEvent (enterFrame) {
if (this._name != "laser") {
this._x = this._x + laserMoveSpeed;
if (this._x > 600) {
_root.spaceship.laserCounter--;
_root.spaceship.laserCounter--;
this.removeMovieClip();
}
}
i = 1;
while (i <= _root.numEnemy) {
if (this.hitTest(_root["enemy" + i])) {
_root.score = _root.score + 10;
_root["enemy" + i].gotoAndPlay(2);
}
i++;
}
}
Instance of Symbol 30 MovieClip "enemy" in Frame 51
onClipEvent (load) {
function reset() {
this._x = 600;
this._y = random(200) + 100;
enemySpeed = random(15) + 1;
this.gotoAndStop(1);
}
reset();
}
onClipEvent (enterFrame) {
if (this.hitTest(_root.spaceship)) {
_root.gotoAndStop("gameOver");
}
if (_root.spaceship.scrollStart) {
this._x = this._x - (enemySpeed + _root.mainGround.groundSpeed);
} else {
this._x = this._x - enemySpeed;
}
if (this._x < -10) {
reset();
}
}
Instance of Symbol 32 MovieClip in Frame 51
onClipEvent (enterFrame) {
if (this.hitTest(_root.spaceship)) {
tellTarget (_root.spaceship) {
_x = (_x + 20);
};
}
}
Instance of Symbol 34 MovieClip in Frame 51
onClipEvent (enterFrame) {
if (this.hitTest(_root.spaceship)) {
tellTarget (_root.spaceship) {
_y = (_y + 20);
};
}
}
Instance of Symbol 36 MovieClip in Frame 51
onClipEvent (enterFrame) {
if (this.hitTest(_root.spaceship)) {
tellTarget (_root.spaceship) {
_x = (_x - 20);
};
}
}
Instance of Symbol 38 MovieClip in Frame 51
onClipEvent (enterFrame) {
if (this.hitTest(_root.spaceship)) {
tellTarget (_root.spaceship) {
_y = (_y - 20);
};
}
}
Frame 52
stop();
Instance of Symbol 23 MovieClip "spaceship" in Frame 52
onClipEvent (load) {
moveSpeed = 10;
_root.laser._visible = false;
laserCounter = 1;
}
onClipEvent (enterFrame) {
if (Key.isDown(32)) {
laserCounter++;
_root.laser.duplicateMovieClip("laser" + laserCounter, laserCounter);
_root["laser" + laserCounter]._visible = true;
}
if (Key.isDown(39)) {
this._x = this._x + moveSpeed;
} else if (Key.isDown(37)) {
this._x = this._x - moveSpeed;
}
if (Key.isDown(40)) {
this._y = this._y + moveSpeed;
} else if (Key.isDown(38)) {
this._y = this._y - moveSpeed;
}
}
Instance of Symbol 25 MovieClip "laser" in Frame 52
onClipEvent (load) {
laserMoveSpeed = 20;
this._y = _root.spaceship._y - 4;
this._x = _root.spaceship._x + 8;
}
onClipEvent (enterFrame) {
if (this._name != "laser") {
this._x = this._x + laserMoveSpeed;
if (this._x > 600) {
_root.spaceship.laserCounter--;
this.removeMovieClip();
}
}
i = 1;
while (i <= _root.numEnemy) {
if (this.hitTest(_root["enemy" + i])) {
_root.score = _root.score + 10;
_root["enemy" + i].gotoAndPlay(2);
}
i++;
}
}
Instance of Symbol 30 MovieClip "enemy" in Frame 52
onClipEvent (load) {
function reset() {
this._x = 600;
this._y = random(200) + 100;
enemySpeed = random(15) + 1;
}
reset();
}
onClipEvent (enterFrame) {
if (_root.spaceship.scrollStart) {
this._x = this._x - (enemySpeed + _root.mainGround.groundSpeed);
} else {
this._x = this._x - enemySpeed;
}
if (this._x < -10) {
reset();
}
}
Frame 53
stopAllSounds();
Symbol 11 Button
on (release) {
_root.play();
}
Symbol 12 MovieClip Frame 1
_root.stop();
PercentLoaded = (_root.getBytesLoaded() / _root.getBytesTotal()) * 100;
if (PercentLoaded != 100) {
setProperty(bar, _xscale , PercentLoaded);
} else {
gotoAndStop ("loaded");
}
Symbol 12 MovieClip Frame 2
gotoAndPlay (1);
Symbol 30 MovieClip Frame 1
score = 0;
Symbol 30 MovieClip Frame 6
score = 0;
stop();
Symbol 48 Button
on (release) {
gotoAndPlay (51);
}