Frame 1
stop();
Stage.showMenu = false;
this.onEnterFrame = function () {
var _local1 = Math.ceil((_root.getBytesLoaded() / _root.getBytesTotal()) * 100);
preloader_mc.mark = _local1;
preloader_mc.percent_loaded_txt.text = _local1;
if (_local1 == 100) {
delete this.onEnterFrame;
play();
}
};
Frame 2
stop();
clearInterval(beatTimeout);
Key.removeListener(keyListener);
Mouse.removeListener(mouseListener);
Mouse.show();
MovieClip.prototype.wrapPos = function () {
var _local1 = this;
if (_local1._x > (xMax + (_local1._width / 2))) {
if (_local1._name == "saucer_mc") {
_local1.hideSaucer();
} else {
_local1._x = _local1._x - (xMax + _local1._width);
}
}
if (_local1._y > (yMax + (_local1._height / 2))) {
_local1._y = _local1._y - (yMax + _local1._height);
}
if (_local1._x < ((-_local1._width) / 2)) {
if (_local1._name == "saucer_mc") {
_local1.hideSaucer();
} else {
_local1._x = _local1._x + (xMax + _local1._width);
}
}
if (_local1._y < ((-_local1._height) / 2)) {
_local1._y = _local1._y + (yMax + _local1._height);
}
};
introMover = function () {
var _local1 = this;
_local1._x = _local1._x + _local1.vx;
_local1._y = _local1._y + _local1.vy;
_local1.wrapPos();
};
score = 0;
level = 1;
xMax = 630;
yMax = 450;
playGame_btn.onRelease = function () {
gotoAndPlay (3);
};
help_btn.onRelease = function () {
gotoAndStop (5);
trace("Help");
};
Frame 3
stop();
spaceship_mc.gotoAndStop(1);
spaceship_mc._visible = (spaceship_mc.hit_mc._visible = (safeArea_mc._visible = (gameOver_mc._visible = (quitGame_mc._visible = (missile0_mc._visible = (missile1_mc._visible = (missile2_mc._visible = (missile3_mc._visible = (missile4_mc._visible = (crosshair_mc._visible = (level_mc._visible = (saucer_mc._visible = false))))))))))));
cloudsmc.attachMovie("cloudy", i, i);
dx = (dy = (explodeNum = (asteroidNum = (scoreMod = (score = 0)))));
var level = 1;
var lives = 3;
var health = 100;
var Asteriodhealth = 100;
var damage = 10;
var UFOdamage = 25;
var cupidDamage = 50;
var speed = 1;
var Asteroidspeed = 0.5;
friction = 0.75;
rads = (Math.PI/180);
leftKey = (rightKey = (upKey = (downKey = (fireKey = (paused = (exploded = (beatToggle = false)))))));
asteroids_mc.createEmptyMovieClip("explode_mc", 0);
beat1_sound = new Sound(beat1_mc);
beat1_sound.attachSound("beat1");
beat1_sound.setVolume(10);
beat2_sound = new Sound(beat2_mc);
beat2_sound.attachSound("beat2");
beat2_sound.setVolume(10);
thrust_sound = new Sound(spaceship_mc);
thrust_sound.attachSound("thrust");
backgroundSound = new Sound(backgroundSound_mc);
backgroundSound.setVolume(50);
backgroundSound.attachSound("Happy");
backgroundSound.start(0, 100);
setLives = function () {
lives_mc[lives].removeMovieClip();
var _local1 = 0;
while (_local1 < lives) {
var _local2 = lives_mc.attachMovie("Spaceshipsmall", _local1, _local1, {_x:_local1 * 20, _xscale:20, _yscale:20, _rotation:50});
_local2.gotoAndStop(1);
_local2.hit_mc._visible = false;
health = 100;
_local1++;
}
};
setLives();
displayHealth = function () {
health_mc.gotoAndPlay(2);
health_mc.health_bar._xscale = health;
};
displayLevel = function () {
if (!level_mc._visible) {
level_mc._visible = true;
}
};
keyListener = new Object();
keyListener.onKeyDown = function () {
switch (Key.getCode()) {
case 37 :
leftKey = true;
return;
case 39 :
rightKey = true;
return;
case 40 :
downKey = true;
return;
case 38 :
if (paused) {
return(undefined);
}
if (!upKey) {
thrust_sound.start(0, 1000);
}
upKey = true;
spaceship_mc.play();
return;
case 80 :
if (!quitGame_mc._visible) {
paused = !paused;
pause_mc._visible = true;
pauseSaucer();
}
return;
case 81 :
paused = (quitGame_mc._visible = true);
return;
case 78 :
if (quitGame_mc._visible) {
paused = (quitGame_mc._visible = false);
pauseSaucer();
}
return;
case 89 :
clearInterval(hyperTimeout);
clearInterval(newShipTimeout);
clearInterval(newGameTimeout);
gotoAndStop (2);
Mouse.removeListener(mouseListener);
}
};
keyListener.onKeyUp = function () {
switch (Key.getCode()) {
case 37 :
leftKey = false;
return;
case 39 :
rightKey = false;
return;
case 40 :
downKey = false;
return;
case 38 :
upKey = false;
thrust_sound.stop();
spaceship_mc.gotoAndStop(1);
}
};
Mouse.hide();
var mouseListener:Object = new Object();
onMouseMove = function () {
spaceship_mc._rotation = ((180 * Math.atan2(_root._ymouse - spaceship_mc._y, _root._xmouse - spaceship_mc._x)) / Math.PI) + 90;
missleAngle = spaceship_mc._rotation;
crosshair_mc._x = _xmouse;
crosshair_mc._y = _ymouse;
updateAfterEvent();
};
Mouse.addListener(mouseListener);
spaceship_mc.onEnterFrame = function () {
var _local2 = this;
if (paused || (!_local2._visible)) {
} else {
displayHealth();
crosshair_mc._visible = true;
var vx = Math.sin(_local2._rotation * rads);
var vy = (-Math.cos(_local2._rotation * rads));
if (upKey) {
_local2._y = _local2._y - 5;
}
if (downKey) {
_local2._y = _local2._y + 5;
}
if (rightKey) {
_local2._x = _local2._x + 5;
}
if (leftKey) {
_local2._x = _local2._x - 5;
}
_local2.wrapPos();
onMouseDown = function () {
fireKey = true;
level_mc._visible = false;
};
if (fireKey) {
fireKey = false;
var _local1 = 4;
var _local3 = -1;
while (_local1--) {
if (!_root[("missile" + _local1) + "_mc"]._visible) {
_local3 = _local1;
break;
}
}
angle = missleAngle;
_mc._rotation = angle;
if (_local3 != -1) {
var _mc = _root[("missile" + _local3) + "_mc"];
_mc.fuse = 25;
_mc.vx = Math.sin(angle * (Math.PI/180)) * 10;
_mc.vy = (-Math.cos(angle * (Math.PI/180))) * 10;
_mc._x = _local2._x;
_mc._y = _local2._y;
_mc._rotation = angle;
_mc._visible = true;
_mc.onEnterFrame = missileMover;
sound_mc.gotoAndPlay("fire");
}
}
var s = int(score / 10000);
if (scoreMod != s) {
scoreMod = s;
saucerBig_sound.stop();
saucerSmall_sound.stop();
backgroundSound.stop();
gotoAndPlay (7);
}
if (((missile4_mc.hitTest(_local2.hit_mc) && (!exploded)) && (_local2._visible)) && (missile4_mc._visible)) {
missile4_mc._visible = false;
health = health - UFOdamage;
displayHealth();
if (health <= 0) {
health = 0;
exploded = true;
explodeSpaceship();
}
}
}
};
saucer_mc.hideSaucer = function () {
saucerBig_sound.stop();
saucerSmall_sound.stop();
this._visible = false;
delete this.onEnterFrame;
};
pauseSaucer = function () {
if (saucer_mc._visible) {
if (paused) {
saucerBig_sound.stop();
saucerSmall_sound.stop();
}
}
};
explodeSaucer = function () {
saucer_mc.hideSaucer();
var i = 6;
while (i--) {
var _local1 = Math.random() * (Math.PI*2);
var _local3 = Math.sin(_local1) * 2;
var _local2 = Math.cos(_local1) * 2;
asteroids_mc.explode_mc.attachMovie("explosion", explodeNum, explodeNum, {vx:_local3, vy:_local2, fuse:Math.ceil(Math.random() * 40), _x:((_local3 * Math.random()) * 4) + saucer_mc._x, _y:((_local2 * Math.random()) * 4) + saucer_mc._y, onEnterFrame:explodeMover});
explodeNum++;
}
sound_mc.gotoAndPlay("bangMedium");
};
explodeSpaceship = function () {
spaceship_mc._visible = false;
explode_mc._x = spaceship_mc._x;
explode_mc._y = spaceship_mc._y;
lives--;
setLives();
asteroidHit = true;
var i = 4;
while (i--) {
vx = Math.sin(Math.random() * (Math.PI*2));
vy = Math.cos(Math.random() * (Math.PI*2));
explode_mc.attachMovie("explosionShip", explodeNum, explodeNum, {vx:vx, vy:vy, fuse:Math.ceil((Math.random() * 40) + 10), _x:((vx * Math.random()) * 4) + explodeShip_mc._x, _y:((vy * Math.random()) * 4) + explodeShip_mc._y, onEnterFrame:explodeMover});
explodeNum++;
}
if (lives > 0) {
newShipTimeout = setInterval(newSpaceship, 1000);
} else {
removeListener(mouseListener);
clearInterval(hyperTimeout);
clearInterval(newShipTimeout);
clearInterval(newGameTimeout);
backgroundSound.stop();
thrust_sound.stop();
saucerBig_sound.stop();
saucerSmall_sound.stop();
gotoAndPlay (82);
quitGame_mc._visible = false;
}
sound_mc.gotoAndPlay("bangMedium");
};
explodeMover = function () {
var _local1 = this;
if (paused) {
} else {
_local1._x = _local1._x + _local1.vx;
_local1._y = _local1._y + _local1.vy;
_local1.fuse--;
if (_local1.fuse < 0) {
_local1.removeMovieClip();
}
}
};
missileMover = function () {
var _local1 = this;
if (paused) {
} else {
_local1._x = _local1._x + _local1.vx;
_local1._y = _local1._y + _local1.vy;
_local1.wrapPos();
_local1.fuse--;
if (_local1.fuse == 0) {
_local1._visible = false;
delete _local1.onEnterFrame;
}
}
};
saucerMover = function () {
var _local1 = this;
if (paused) {
} else {
_local1._x = _local1._x + _local1.vx;
if (Math.random() < 0.02) {
_local1.vy = (int(Math.random() * 3) - 1) * 2;
}
if (_local1.vy != 0) {
_local1._y = _local1._y + _local1.vy;
}
_local1.wrapPos();
var _local3 = 4;
while (_local3--) {
var _local2 = _root[("missile" + _local3) + "_mc"];
if (_local2._visible) {
if (_local2.hitTest(_local1)) {
_local2._visible = false;
explodeSaucer();
if (_local1.small) {
score = score + 1000;
} else {
score = score + 300;
}
}
}
}
var _local2 = missile4_mc;
if ((!_local2._visible) && (Math.random() < 0.1)) {
var angle = ((_local1.small && (spaceship_mc._visible)) ? (Math.atan2(spaceship_mc._x - _local1._x, _local1._y - spaceship_mc._y)) : (Math.atan2(spaceship_mc._x - _local1._x, _local1._y - spaceship_mc._y)));
var angDiff = (angle - (_local2._rotation / 57.2957795130823));
_local2._rotation = _local2._rotation + (angDiff * 57.2957795130823);
var rads = (_local2._rotation / 57.2957795130823);
_local2.fuse = 24;
_local2.vx = Math.sin(rads) * 8;
_local2.vy = Math.cos(rads) * -8;
_local2._x = _local1._x + _local2.vx;
_local2._y = _local1._y + (_local2.vy * 2);
_local2._visible = true;
_local2.onEnterFrame = missileMover;
sound_mc.gotoAndPlay("lazer");
}
if ((spaceship_mc.hit_mc.hitTest(_local1) && (!exploded)) && (spaceship_mc._visible)) {
exploded = true;
explodeSpaceship();
}
}
};
var counter = 0;
asteroidMover = function () {
var _local2 = this;
if (paused) {
} else {
_local2.counter = 0;
var speed = Math.sqrt((_local2.vx * _local2.vx) + (_local2.vy * _local2.vy));
var dx = (spaceship_mc._x - _local2._x);
var dy = (spaceship_mc._y - _local2._y);
var _local3 = Math.atan2(dy, dx);
var ranVx = ((Math.cos(_local3) * speed) + Math.random());
var ranVy = ((Math.sin(_local3) * speed) + Math.random());
_local2._x = _local2._x + ranVx;
_local2._y = _local2._y + ranVy;
var asteroidHit = false;
var spaceshipShot = false;
if (saucer_mc._visible && (saucer_mc.hitTest(_local2))) {
asteroidHit = true;
explodeSaucer();
}
if (spaceship_mc.hit_mc.hitTest(_local2) && (spaceship_mc._visible)) {
asteroidHit = true;
health = health - damage;
displayHealth();
if (health <= 0) {
health = 0;
exploded = true;
explodeSpaceship();
}
}
var i = 5;
while (i--) {
var _local1 = _root[("missile" + i) + "_mc"];
if (_local1._visible && (_local1.hitTest(_local2))) {
_local1._visible = false;
asteroidHit = true;
if (i < 4) {
spaceshipShot = true;
}
break;
}
}
if (asteroidHit) {
asteroidCount--;
var j = 4;
while (j--) {
_local3 = Math.random() * (Math.PI*2);
var vx = (Math.sin(_local3) * 2);
var vy = (Math.cos(_local3) * 2);
asteroids_mc.explode_mc.attachMovie("explosion", explodeNum, explodeNum, {vx:vx, vy:vy, fuse:Math.ceil(Math.random() * 40), _x:((vx * Math.random()) * 4) + _local2._x, _y:((vy * Math.random()) * 4) + _local2._y, onEnterFrame:explodeMover});
explodeNum++;
}
if (spaceshipShot) {
score = score + 100;
}
sound_mc.gotoAndPlay("bangSmall");
_local2.removeMovieClip();
}
}
};
makeAsteroid = function (x, y, vx, vy, s) {
asteroidNum++;
var _local1 = asteroids_mc.attachMovie("asteroid", asteroidNum, asteroidNum, {vx:vx, vy:vy, _x:x, _y:y, _xscale:100, _yscale:100, onEnterFrame:asteroidMover});
return(_local1);
};
beatSound = function () {
if (paused) {
return(undefined);
}
beatToggle = !beatToggle;
if (beatToggle) {
beat1_sound.start();
} else {
beat2_sound.start();
}
if (gameOver_mc._visible) {
return(undefined);
}
if (beatCount > 300) {
beatCount = beatCount - 10;
clearInterval(beatTimeout);
beatTimeout = setInterval(beatSound, beatCount);
}
if (((beatCount < 700) && (!saucer_mc._visible)) && (Math.random() < 0.05)) {
if ((beatCount < 400) && (Math.random() < 0.4)) {
saucer_mc._xscale = (saucer_mc._yscale = 50);
saucer_mc.small = true;
} else {
saucer_mc._xscale = (saucer_mc._yscale = 100);
saucer_mc.small = false;
}
if (Math.random() < 0.5) {
saucer_mc.vx = -2;
saucer_mc._x = (saucer_mc._width / 2) + xMax;
} else {
saucer_mc.vx = 2;
saucer_mc._x = saucer_mc._width / -2;
}
saucer_mc.vy = 0;
saucer_mc._y = Math.random() * yMax;
saucer_mc._visible = true;
saucer_mc.onEnterFrame = saucerMover;
}
if ((asteroidCount == 0) && (!saucer_mc._visible)) {
clearInterval(beatTimeout);
level++;
newGameTimeout = setInterval(newGame, 1000);
}
};
newSpaceship = function () {
var _local2 = this;
spaceship_mc._x = 350;
spaceship_mc._y = 250;
spaceship_mc._rotation = 0;
var _local1 = false;
for (var _local3 in asteroids_mc) {
if (spaceship_mc.hitTest(asteroids_mc[_local3]) && (_local2.hitTest(asteroids_mc[_local3]))) {
_local1 = true;
break;
}
}
if (!_local1) {
spaceship_mc._visible = true;
exploded = false;
dx = (dy = 0);
clearInterval(newShipTimeout);
}
};
newGame = function () {
if (paused) {
} else {
displayLevel();
backgroundSoundPlay();
levels_txt.text = level;
var levelUp = ("Level " + level);
level_mc.Level_txt.text = levelUp;
var _local3 = ((level < 7) ? (level + 3) : 10);
asteroidCount = _local3;
while (_local3--) {
var _local2 = Math.random() * (Math.PI*2);
var _local1 = makeAsteroid(Math.random() * xMax, Math.random() * yMax, Math.sin(_local2) * 1.5, Math.cos(_local2) * 1.5, 0);
if (_local1.hitTest(spaceship_mc) || (_local1.hitTest(safeArea_mc))) {
_local3++;
asteroidNum--;
}
}
beatCount = ((level < 7) ? (1100 - (level * 100)) : 400);
beatSound();
Key.addListener(keyListener);
addListener(mouseListener);
clearInterval(newGameTimeout);
}
};
newGameTimeout = setInterval(newGame, 1000);
newShipTimeout = setInterval(newSpaceship, 1100);
Frame 4
stop();
clearInterval(beatTimeout);
Mouse.removeListener(mouseListener);
Mouse.show();
showScores = function () {
var _local1 = 10;
while (_local1 > 0) {
var n = scoreboard_lv["name" + (page + _local1)];
var _local3 = scoreboard_lv["score" + (page + _local1)];
var _local2 = this[("line" + _local1) + "_mc"];
_local2.rank_txt.text = (page + _local1) + ".";
_local2.name_txt.text = (n.length ? (n.toUpperCase()) : "-");
_local2.score_txt.text = (_local3.length ? (_local3) : "-");
_local2._visible = true;
loading_mc._visible = false;
_local1--;
}
};
page = 0;
maxScore = 100;
scoreboard_lv = new LoadVars();
if ((score > 0) && (game_so.data.playerName.length > 0)) {
scoreboard_lv.score = score;
scoreboard_lv.name = game_so.data.playerName.toLowerCase();
}
scoreboard_lv.game = "asteroids";
scoreboard_lv.sendAndLoad("http://www.neave.com/games/games_score_text.php", scoreboard_lv, "POST");
scoreboard_lv.onLoad = function (success) {
if (success) {
if (Boolean(scoreboard_lv.success)) {
next_btn._visible = true;
if (scoreboard_lv.maxScore.length > 0) {
maxScore = Number(scoreboard_lv.maxScore);
}
showScores();
} else {
loading_mc.errorMsg = scoreboard_lv.errorMsg.toUpperCase();
loading_mc.gotoAndStop(2);
}
} else {
loading_mc.errorMsg = "COULD NOT ACCESS SCORES.";
loading_mc.gotoAndStop(2);
}
};
score = 0;
next_btn._visible = (last_btn._visible = false);
last_btn.onPress = function () {
page = page - 10;
if (page < 0) {
page = 0;
}
if (page < 10) {
last_btn._visible = false;
}
next_btn._visible = true;
showScores();
};
next_btn.onPress = function () {
page = page + 10;
if (page > maxScore) {
page = maxScore;
}
if (page > (maxScore - 20)) {
next_btn._visible = false;
}
last_btn._visible = true;
showScores();
};
newGame_btn.onRelease = function () {
gotoAndStop (2);
};
Frame 5
stop();
trace("Help true");
clearInterval(beatTimeout);
Mouse.removeListener(mouseListener);
Mouse.show();
playGame_btn.onRelease = function () {
gotoAndPlay (3);
};
highScores_btn.onRelease = function () {
gotoAndStop (4);
};
help_btn.onRelease = function () {
gotoAndStop (5);
};
story_btn.onRelease = function () {
gotoAndStop (6);
};
intro_btn.onRelease = function () {
gotoAndStop (2);
};
Frame 7
clearInterval(beatTimeout);
Key.removeListener(keyListener);
Mouse.removeListener(mouseListener);
Mouse.show();
clearInterval(hyperTimeout);
clearInterval(newShipTimeout);
clearInterval(newGameTimeout);
thrust_sound.stop();
saucerBig_sound.stop();
saucerSmall_sound.stop();
saucerSmall_sound.stop();
beat1_sound.stop();
beat2_sound.stop();
backgroundSound.stop();
Frame 58
stop();
Frame 59
cupid - old.gotoAndPlay("morf");
Frame 81
stop();
playGame_btn.onRelease = function () {
gotoAndPlay (3);
};
forward_btn.onPress = function () {
getURL ("http://www.ofmwheels.co.za/cupids-quest/forward.php", "_blank");
};
Frame 82
Mouse.removeListener(mouseListener);
Mouse.show();
clearInterval(beatTimeout);
Key.removeListener(keyListener);
clearInterval(hyperTimeout);
clearInterval(newShipTimeout);
clearInterval(newGameTimeout);
thrust_sound.stop();
saucerBig_sound.stop();
saucerSmall_sound.stop();
saucerSmall_sound.stop();
beat1_sound.stop();
beat2_sound.stop();
backgroundSound.stop();
Frame 133
stop();
playGame_btn.onRelease = function () {
gotoAndPlay (3);
};
forward_btn.onPress = function () {
getURL ("http://www.ofmwheels.co.za/cupids-quest/forward.php", "_blank");
};
help_btn.onRelease = function () {
gotoAndStop (5);
};
Frame 156
stop();
Symbol 39 MovieClip Frame 1
var mark = 0;
onEnterFrame = function () {
gotoAndPlay(mark);
};
onEnterFrame();
Symbol 79 MovieClip Frame 1
stop();
Symbol 79 MovieClip Frame 30
this.gotoAndPlay(1);
Symbol 119 MovieClip Frame 1
stop();
Symbol 119 MovieClip Frame 3
stop();
Symbol 119 MovieClip Frame 5
stop();
Symbol 119 MovieClip Frame 7
stop();
Symbol 119 MovieClip Frame 9
stop();
Symbol 119 MovieClip Frame 11
stop();
Symbol 119 MovieClip Frame 13
stop();
Symbol 128 MovieClip Frame 1
stop();
Symbol 128 MovieClip Frame 61
stop();
name_txt.restrict = "A-Z 0-9.\\-";
if (_root.game_so.data.playerName.length > 0) {
name_txt.text = _root.game_so.data.playerName;
}
Selection.setFocus(name_txt);
Selection.setSelection(name_txt.length, name_txt.length);
ok_btn.onRelease = function () {
if (name_txt.length > 0) {
_root.game_so.data.playerName = name_txt.text;
}
_root.nextFrame();
};
ok_btn.onKeyDown = function () {
if (Key.getCode() == 13) {
Key.removeListener(ok_btn);
this.onRelease();
}
};
Key.addListener(ok_btn);
Symbol 140 MovieClip Frame 1
stop();
Symbol 143 MovieClip Frame 26
stop();
Symbol 158 MovieClip Frame 1
stop();
errorMsg = "";
Symbol 180 MovieClip Frame 119
_parent.play();
Symbol 180 MovieClip Frame 140
stop();
Symbol 191 MovieClip Frame 10
stop();
Symbol 192 MovieClip Frame 36
gotoAndPlay ("loop");