Frame 1
Stage.showMenu = false;
Mouse.show();
stop();
Frame 2
Frame 3
stop();
_quality = "HIGH";
Mouse.show();
stopAllSounds();
buttonPlay.onPress = function () {
stopAllSounds();
frame_ = "game";
_root.attachMovie("transition", "transition", 999994);
};
buttonHowtoplay.onPress = function () {
frame_ = "Howtoplay";
_root.attachMovie("transition", "transition", 0);
};
buttonCredits.onPress = function () {
frame_ = "credits";
_root.attachMovie("transition", "transition", 0);
};
buttonMoregames.onRelease = function () {
getURL ("http://www.mofunzone.com/", "_blank");
};
mofunzonelink.onRelease = function () {
getURL ("http://www.mofunzone.com/", "_blank");
};
lasersound = new Sound();
loop2 = new Sound();
notification2 = new Sound();
explosionsound = new Sound();
loopsound = new Sound();
explosion2 = new Sound();
lasersound.attachSound("laserk");
explosionsound.attachSound("explosion");
loopsound.attachSound("loop");
loop2.attachSound("loop2");
notification2.attachSound("notification2");
explosion2.attachSound("explosion2");
loop2.start(0, 999);
Frame 4
buttonBack.onPress = function () {
frame_ = "menu";
_root.attachMovie("transition", "transition", 0);
};
Mouse.show();
Frame 5
buttonBack.onPress = function () {
frame_ = "menu";
_root.attachMovie("transition", "transition", 0);
};
Mouse.show();
Frame 6
function fpsF() {
cont.net_graph.fpsDisplay.text = fps + " fps";
fps = 0;
}
function shoot() {
if (nbLaser > 0) {
nbLaser--;
cont.scoreDisplay.laserTxtbox.text = nbLaser;
fuel--;
lasersound.start(0, 0);
_root.cont.attachMovie("laser", "laser" + d, d, {_x:cont.rocket._x, _y:cont.rocket._y, _rotation:cont.rocket._rotation});
i = 0;
while (i < 3) {
j = 0;
while (j < 3) {
if (cArray[i][j] == 0) {
cArray[i][j] = cont["laser" + d]._name;
i = 3;
j = 3;
}
j++;
}
i++;
}
if (cont["laser" + d]._rotation > 180) {
cont["laser" + d].xSpd = 20 * Math.cos((pi / 180) * cont.rocket._rotation);
cont["laser" + d].ySpd = 20 * Math.sin((pi / 180) * cont.rocket._rotation);
} else {
cont["laser" + d].xSpd = 20 * Math.sin((pi / 180) * cont.rocket._rotation);
cont["laser" + d].ySpd = 20 * Math.cos((pi / 180) * cont.rocket._rotation);
}
cont["laser" + d].onEnterFrame = function () {
this._x = this._x + this.xSpd;
this._y = this._y - this.ySpd;
if ((((this._x > 590) || (this._x < -30)) || (this._y < -30)) || (this._y > 380)) {
i = 0;
while (i < 3) {
j = 0;
while (j < 3) {
if (cArray[i][j] == this._name) {
cArray[i][j] = 0;
i = 3;
j = 3;
}
j++;
}
i++;
}
delete this.onEnterFrame;
this.removeMovieClip();
}
updateAfterEvent();
};
}
if (d >= 999980) {
d = 0;
} else {
d++;
}
}
function generate() {
d++;
cont.attachMovie("gas", "gas" + d, d, {_x:(Math.random() * 560) + 660, _y:Math.random() * 350, xSpd:(Math.random() * 5) + level});
cont["gas" + d].onEnterFrame = function () {
this._x = this._x - this.xSpd;
if (this.hitTest(cont.rocket.hitbox)) {
notification2.start(0, 0);
cont.scoreDisplay.scoreTxtbox.text = score;
delete this.onEnterFrame;
this.removeMovieClip();
nbLaser++;
cont.scoreDisplay.laserTxtbox.text = nbLaser;
if (fuel < 90) {
fuel = fuel + 10;
} else {
fuel = 100;
}
} else if (this._x < -15) {
delete this.onEnterFrame;
this.removeMovieClip();
}
};
h = 0;
while (h < (level + 3)) {
d++;
cont.attachMovie("asteroid1", "asteroid1" + d, d, {_x:(Math.random() * 560) + 660, _y:Math.random() * 350, _rotation:Math.random() * 180, xSpd:(Math.random() * 10) + level, ySpd:(Math.random() * 3) - 1.5});
cont["asteroid1" + d].onEnterFrame = function () {
this._x = this._x - this.xSpd;
this._y = this._y - this.ySpd;
this._rotation = this._rotation + 0.5;
if (this.hitTest(cont.rocket._x, cont.rocket._y, true)) {
losing();
} else if (((this._x < -150) || (this._y < -150)) || (this._y > 500)) {
delete this.onEnterFrame;
this.removeMovieClip();
} else {
m = 0;
while (m < 3) {
n = 0;
while (n < 3) {
if (this.hitTest(cont[cArray[m][n]]._x, cont[cArray[m][n]]._y, true) && (cont[cArray[m][n]] != undefined)) {
cont[cArray[m][n]].removeMovieClip();
cArray[m][n] = 0;
m = 3;
n = 3;
explosionsound.start(0, 0);
cont.scoreDisplay.scoreTxtbox.text = score;
buf = this._x;
buf2 = this._y;
delete this.onEnterFrame;
this.removeMovieClip();
setAsteroid2();
}
n++;
}
m++;
}
}
};
h++;
}
d++;
}
function setAsteroid2() {
q = 0;
while (q < 2) {
d++;
cont.attachMovie("asteroid2", "asteroid2" + d, d, {_x:buf + ((Math.random() * 30) - 15), _y:buf2 + ((Math.random() * 30) - 15), xSpd:(Math.random() * 5) + level, ySpd:(Math.random() * 4) - 2, _rotation:Math.random() * 360});
cont["asteroid2" + d].onEnterFrame = function () {
if (((this._x < -75) || (this._y < -75)) || (this._y > 425)) {
delete this.onEnterFrame;
this.removeMovieClip();
} else if (this.hitTest(cont.rocket._x, cont.rocket._y, true)) {
losing();
} else {
m = 0;
while (m < 3) {
n = 0;
while (n < 3) {
if (this.hitTest(cont[cArray[m][n]]._x, cont[cArray[m][n]]._y, true) && (cont[cArray[m][n]] != undefined)) {
cont[cArray[m][n]].removeMovieClip();
cArray[m][n] = 0;
m = 3;
n = 3;
explosionsound.start(0, 0);
cont.scoreDisplay.scoreTxtbox.text = score;
buf = this._x;
buf2 = this._y;
delete this.onEnterFrame;
this.removeMovieClip();
setAsteroid3();
}
n++;
}
m++;
}
this._x = this._x - this.xSpd;
this._y = this._y - this.ySpd;
this._rotation = this._rotation + 0.5;
}
};
d++;
q++;
}
}
function setAsteroid3() {
q = 0;
while (q < 2) {
d++;
cont.attachMovie("asteroid3", "asteroid3" + d, d, {_x:buf + ((Math.random() * 30) - 15), _y:buf2 + ((Math.random() * 30) - 15), xSpd:(Math.random() * 5) + level, ySpd:(Math.random() * 4) - 2, _rotation:Math.random() * 360});
cont["asteroid3" + d].onEnterFrame = function () {
if (((this._x < -75) || (this._y < -75)) || (this._y > 425)) {
delete this.onEnterFrame;
this.removeMovieClip();
} else if (this.hitTest(cont.rocket._x, cont.rocket._y, true)) {
losing();
} else {
m = 0;
while (m < 3) {
n = 0;
while (n < 3) {
if (this.hitTest(cont[cArray[m][n]]._x, cont[cArray[m][n]]._y, true) && (cont[cArray[m][n]] != undefined)) {
cont[cArray[m][n]].removeMovieClip();
cArray[m][n] = 0;
m = 3;
n = 3;
explosionsound.start(0, 0);
cont.scoreDisplay.scoreTxtbox.text = score;
buf = this._x;
buf2 = this._y;
delete this.onEnterFrame;
this.removeMovieClip();
}
n++;
}
m++;
}
this._x = this._x - this.xSpd;
this._y = this._y - this.ySpd;
this._rotation = this._rotation + 0.5;
}
};
d++;
q++;
}
}
function scoring() {
score = score + (1 + level);
cont.scoreDisplay.scoreTxtbox.text = score;
}
function losing() {
if (losable) {
losable = false;
clearInterval(lInterval);
clearInterval(fInterval);
clearInterval(generateInterval);
clearInterval(sInterval);
Mouse.removeListener(mListener);
nbLaser = 0;
_root.cont.removeMovieClip();
explosion2.start(0, 0);
frame_ = "gameover";
_root.attachMovie("transition", "transition", 0);
}
}
function levelUp() {
if (level < 9) {
d++;
cont.attachMovie("powerUp1", "powerUp1" + d, d, {_x:(Math.random() * 560) + 560, _y:(Math.random() * 300) + 25, xSpd:Math.random() * 10});
cont["powerUp1" + d].onEnterFrame = function () {
this._x = this._x - this.xSpd;
if (this.hitTest(cont.rocket.hitbox)) {
notification2.start(0, 0);
cont.scoreDisplay.scoreTxtbox.text = score;
delete this.onEnterFrame;
this.removeMovieClip();
nbLaser = nbLaser + 20;
cont.scoreDisplay.laserTxtbox.text = nbLaser;
fuel = 100;
}
};
level++;
d++;
}
}
stop();
_quality = "LOW";
Mouse.hide();
loopsound.start(0, 999);
cArray = [[0, 0, 0], [0, 0, 0], [0, 0, 0]];
var fuel = 100;
var level = 0;
var nbLaser = 0;
var losable = true;
var fps = 0;
var d = 0;
var score = 0;
var pi = 3.141593;
var buf = 0;
var buf2 = 0;
_root.createEmptyMovieClip("cont", 0, {_x:0, _y:0, _width:560, _height:350});
_root.cont.attachMovie("rocket", "rocket", 999995, {_x:110, _y:110});
_root.cont.attachMovie("fuelDisplay", "fuelDisplay", 999996, {_x:15, _y:15});
_root.cont.attachMovie("scoreDisplay", "scoreDisplay", 999997, {_x:555, _y:15});
_root.cont.attachMovie("net_graph", "net_graph", 999998, {_x:0, _y:330});
_root.cont.attachMovie("mobutton", "mobutton", 999999);
_root.cont.mobutton._x = 350;
_root.cont.mobutton._y = 295;
_root.cont.mobutton.onRelease = function () {
getURL ("http://www.mofunzone.com/", "_blank");
};
cont.scoreDisplay.scoreTxtbox.text = score;
cont.scoreDisplay.laserTxtbox.text = nbLaser;
lInterval = setInterval(levelUp, 36000);
sInterval = setInterval(scoring, 1000);
_root.onEnterFrame = function () {
fps++;
};
fInterval = setInterval(fpsF, 1000);
mListener = new Object();
mListener.onMouseDown = function () {
shoot();
};
Mouse.addListener(mListener);
generate();
generateInterval = setInterval(generate, 5000);
cont.rocket.onEnterFrame = function () {
cont.attachMovie("smoke", ["smoke" + d], d, {_x:cont.rocket._x, _y:cont.rocket._y});
cont["smoke" + d].onEnterFrame = function () {
this._alpha = this._alpha - 5;
this._xscale--;
this._yscale--;
this._x = this._x - 2.5;
if (this._alpha <= 0) {
delete this.onEnterFrame;
this.removeMovieClip();
}
};
d++;
if (fuel > 0) {
fuel = fuel - 0.07;
} else {
losing();
}
cont.fuelDisplay.fuelbar._xscale = fuel;
rad = Math.atan2(_ymouse - cont.rocket._y, _xmouse - cont.rocket._x);
cont.rocket._rotation = Math.round(((rad * 360) / (2 * pi)) + 90);
cont.rocket._x = cont.rocket._x - 10;
cont.rocket._x = cont.rocket._x + ((_xmouse - cont.rocket._x) / 3);
cont.rocket._y = cont.rocket._y + ((_ymouse - cont.rocket._y) / 3);
updateAfterEvent();
};
levelUp();
Frame 7
_quality = "HIGH";
Mouse.show();
stopAllSounds();
scoreDisplayer.text = score;
buttonReplay.onPress = function () {
frame_ = "game";
_root.attachMovie("transition", "transition", 0);
};
buttonMoregames.onRelease = function () {
getURL ("http://www.mofunzone.com/", "_blank");
};
buttonBack.onPress = function () {
frame_ = "menu";
_root.attachMovie("transition", "transition", 0);
};
mofunzonelink.onRelease = function () {
getURL ("http://www.mofunzone.com/", "_blank");
};
Frame 8
stop();
Symbol 7 MovieClip [rocket] Frame 1
stop();
Symbol 30 MovieClip [transition] Frame 24
_root.gotoAndStop(_root.frame_);
Symbol 30 MovieClip [transition] Frame 45
this.removeMovieClip();
Symbol 69 MovieClip Frame 11
_parent.gotoAndStop(2);
Symbol 79 MovieClip Frame 1
this.onEnterFrame = function () {
bytesloaded = Math.round(_root.getBytesLoaded());
bytestotal = Math.round(_root.getBytesTotal());
percent = bytesloaded / bytestotal;
barmask._xscale = percent * 100;
};
Symbol 111 MovieClip Frame 1
if (Math.random() > 0.5) {
_xscale = (-_xscale);
_x = (_x - _parent.shiftamt);
}
Symbol 111 MovieClip Frame 90
if (_parent.isloaded) {
_parent.gotoAndStop(10);
} else {
thenextframe = Math.ceil(Math.random() * 8) + 1;
if (thenextframe == _parent._currentframe) {
_parent.nextFrame();
} else {
_parent.gotoAndStop(thenextframe);
}
}
Symbol 122 MovieClip Frame 1
if (Math.random() > 0.5) {
_xscale = (-_xscale);
_x = (_x - _parent.shiftamt);
}
Symbol 122 MovieClip Frame 90
if (_parent.isloaded) {
_parent.gotoAndStop(10);
} else {
thenextframe = Math.ceil(Math.random() * 8) + 1;
if (thenextframe == _parent._currentframe) {
_parent.nextFrame();
} else {
_parent.gotoAndStop(thenextframe);
}
}
Symbol 130 MovieClip Frame 1
if (Math.random() > 0.5) {
_xscale = (-_xscale);
_x = (_x - _parent.shiftamt);
}
Symbol 130 MovieClip Frame 90
if (_parent.isloaded) {
_parent.gotoAndStop(10);
} else {
thenextframe = Math.ceil(Math.random() * 8) + 1;
if (thenextframe == _parent._currentframe) {
_parent.nextFrame();
} else {
_parent.gotoAndStop(thenextframe);
}
}
Symbol 138 MovieClip Frame 1
if (Math.random() > 0.5) {
_xscale = (-_xscale);
_x = (_x - _parent.shiftamt);
}
Symbol 138 MovieClip Frame 90
if (_parent.isloaded) {
_parent.gotoAndStop(10);
} else {
thenextframe = Math.ceil(Math.random() * 8) + 1;
if (thenextframe == _parent._currentframe) {
_parent.nextFrame();
} else {
_parent.gotoAndStop(thenextframe);
}
}
Symbol 146 MovieClip Frame 1
if (Math.random() > 0.5) {
_xscale = (-_xscale);
_x = (_x - _parent.shiftamt);
}
Symbol 146 MovieClip Frame 90
if (_parent.isloaded) {
_parent.gotoAndStop(10);
} else {
thenextframe = Math.ceil(Math.random() * 8) + 1;
if (thenextframe == _parent._currentframe) {
_parent.nextFrame();
} else {
_parent.gotoAndStop(thenextframe);
}
}
Symbol 154 MovieClip Frame 1
if (Math.random() > 0.5) {
_xscale = (-_xscale);
_x = (_x - _parent.shiftamt);
}
Symbol 154 MovieClip Frame 90
if (_parent.isloaded) {
_parent.gotoAndStop(10);
} else {
thenextframe = Math.ceil(Math.random() * 8) + 1;
if (thenextframe == _parent._currentframe) {
_parent.nextFrame();
} else {
_parent.gotoAndStop(thenextframe);
}
}
Symbol 162 MovieClip Frame 1
if (Math.random() > 0.5) {
_xscale = (-_xscale);
_x = (_x - _parent.shiftamt);
}
Symbol 162 MovieClip Frame 90
if (_parent.isloaded) {
_parent.gotoAndStop(10);
} else {
thenextframe = Math.ceil(Math.random() * 8) + 1;
if (thenextframe == _parent._currentframe) {
_parent.nextFrame();
} else {
_parent.gotoAndStop(thenextframe);
}
}
Symbol 170 MovieClip Frame 1
if (Math.random() > 0.5) {
_xscale = (-_xscale);
_x = (_x - _parent.shiftamt);
}
Symbol 170 MovieClip Frame 90
if (_parent.isloaded) {
_parent.gotoAndStop(10);
} else {
thenextframe = Math.ceil(Math.random() * 8) + 1;
if (thenextframe == _parent._currentframe) {
_parent.gotoAndStop(2);
} else {
_parent.gotoAndStop(thenextframe);
}
}
Symbol 177 MovieClip Frame 133
_root.play();
Symbol 178 MovieClip Frame 1
stop();
_root.stop();
shiftamt = 17;
isloaded = false;
this.onEnterFrame = function () {
bytesloaded = Math.round(_root.getBytesLoaded());
bytestotal = Math.round(_root.getBytesTotal());
percent = bytesloaded / bytestotal;
if (bytesloaded == bytestotal) {
isloaded = true;
}
};
this.onRelease = function () {
getURL ("http://www.mofunzone.com/", "_blank");
};