Frame 2
numEnemy = 4;
i = 2;
while (numEnemy >= i) {
enemy1.duplicateMovieClip("enemy" + i, i + 100);
i++;
}
score = 0;
stop();
Instance of Symbol 32 MovieClip "spaceship" in Frame 2
onClipEvent (load) {
moveSpeed = 5;
}
onClipEvent (enterFrame) {
if (Key.isDown(Key.RIGHT)) {
if (_root.Walls.hitTest(getBounds(_root).xMax, _y, true)) {
} else {
this._x = this._x + moveSpeed;
}
} else if (Key.isDown(Key.UP)) {
if (_root.Walls.hitTest(_x, getBounds(_root).yMin, true)) {
} else {
this._y = this._y - moveSpeed;
}
} else if (Key.isDown(Key.DOWN)) {
if (_root.Walls.hitTest(_x, getBounds(_root).yMax, true)) {
} else {
this._y = this._y + moveSpeed;
}
} else if (Key.isDown(Key.LEFT)) {
if (_root.Walls.hitTest(getBounds(_root).xMin, _y, true)) {
} else {
this._x = this._x - moveSpeed;
}
}
}
onClipEvent (load) {
_root.laser._visible = false;
laserCounter = 1;
maxLasers = 1;
depthCounter = 1;
}
onClipEvent (enterFrame) {
if (Key.isDown(Key.CONTROL) and (maxLasers >= laserCounter)) {
laserCounter++;
_root.laser.duplicateMovieClip("laser" + depthCounter, depthCounter);
_root["laser" + depthCounter]._visible = true;
depthCounter++;
if (maxLasers < depthCounter) {
depthCounter = 1;
}
}
}
Instance of Symbol 35 MovieClip "laser" in Frame 2
onClipEvent (load) {
laserMoveSpeed = 20;
this._x = _root.spaceship._x;
this._y = _root.spaceship._y - 20;
}
onClipEvent (enterFrame) {
if (this._name != "laser") {
this._y = this._y - laserMoveSpeed;
if (this._y < -10) {
_root.spaceship.laserCounter--;
this.removeMovieClip();
}
i = 1;
while (_root.numEnemy >= i) {
if (this.hitTest(_root["enemy" + i])) {
_root.score = _root.score + 100;
_root["enemy" + i].gotoAndPlay(2);
}
i++;
}
}
}
Instance of Symbol 41 MovieClip "enemy1" in Frame 2
onClipEvent (load) {
function reset() {
this._x = random(120) + 260;
this._y = -10;
enemySpeed = random(5) + 5;
this.gotoAndStop(1);
}
reset();
}
onClipEvent (enterFrame) {
if (this._y < 500) {
this._y = this._y + enemySpeed;
}
if (360 < this._y) {
reset();
}
if (this.hitTest(_root.spaceship)) {
_root.gotoAndStop(4);
}
}
Frame 3
gotoAndStop (2);
Frame 4
stop();
Instance of Symbol 44 MovieClip "enemy1" in Frame 4
onClipEvent (load) {
function reset() {
this._x = random(120) + 260;
this._y = -10;
enemySpeed = random(5) + 5;
this.gotoAndStop(1);
}
reset();
}
onClipEvent (enterFrame) {
if (this._y < 500) {
this._y = this._y + enemySpeed;
}
if (360 < this._y) {
reset();
}
if (this.hitTest(_root.spaceship)) {
_root.gotoAndStop(3);
}
}
Symbol 17 Button
on (release) {
_root.play();
}
Symbol 18 MovieClip Frame 1
_root.stop();
PercentLoaded = (_root.getBytesLoaded() / _root.getBytesTotal()) * 100;
if (PercentLoaded != 100) {
setProperty(bar, _xscale , PercentLoaded);
} else {
gotoAndStop (3);
}
Symbol 18 MovieClip Frame 2
gotoAndPlay (1);
Symbol 18 MovieClip Frame 3
stop();
Symbol 32 MovieClip Frame 1
stop();
Symbol 34 MovieClip Frame 1
stop();
Symbol 34 MovieClip Frame 2
stop();
Symbol 35 MovieClip Frame 1
stop();
Instance of Symbol 34 MovieClip "shoot" in Symbol 35 MovieClip Frame 1
onClipEvent (enterFrame) {
if (this.hitTest(_root["enemy" + i])) {
_root.shoot.gotoAndStop(2);
}
}
Symbol 41 MovieClip Frame 1
stop();
Symbol 41 MovieClip Frame 5
stop();
Symbol 44 MovieClip Frame 1
stop();
Symbol 44 MovieClip Frame 5
stop();
Symbol 51 Button
on (release) {
gotoAndPlay (2);
}