Frame 1
gameName = "asstroys";
if (introDone) {
gotoAndStop (2);
} else {
introDone = true;
}
Stage.showMenu = false;
version = 20031601 /* 0x131A871 */;
Frame 4
stop();
Frame 5
_global.snd = new com.neodelight.std.XSound();
_global.snd.playLoop("sndMusic", 1, "music");
Frame 6
stop();
clearInterval(beatTimeout);
Key.removeListener(keyListener);
MovieClip.prototype.wrapPos = function () {
if (this._x > (xMax + (this._width * 0.5))) {
if (this._name == "saucer_mc") {
this.hideSaucer();
} else {
this._x = this._x - (xMax + this._width);
}
}
if (this._y > (yMax + (this._height * 0.5))) {
this._y = this._y - (yMax + this._height);
}
if (this._x < ((-this._width) * 0.5)) {
if (this._name == "saucer_mc") {
this.hideSaucer();
} else {
this._x = this._x + (xMax + this._width);
}
}
if (this._y < ((-this._height) * 0.5)) {
this._y = this._y + (yMax + this._height);
}
};
introMover = function () {
this._x = this._x + this.vx;
this._y = this._y + this.vy;
this._rotation = this._rotation + this.vr;
this.wrapPos();
};
introAsteroids = function () {
var _local1 = 10;
while (_local1--) {
var _local3 = Math.random() * (Math.PI*2);
var _local2 = [100, 50, 25][_local1 % 3];
intro_mc.attachMovie("asteroid", _local1, _local1, {vx:Math.sin(_local3) * 1.5, vy:Math.cos(_local3) * 1.5, vr:(Math.random() - 0.5) * 10, _x:Math.random() * xMax, _y:Math.random() * yMax, _xscale:_local2, _yscale:_local2, onEnterFrame:introMover}).gotoAndStop((_local1 % 4) + 1);
}
};
game_so = SharedObject.getLocal("neaveAsteroids");
score = 0;
xMax = 500;
yMax = 375;
introAsteroids();
playGame_btn.onRelease = function () {
play();
};
highScores_btn.onRelease = function () {
getURL ("http://www.neodelight.com/highscores?ref=asteroids&ref_loc=highscores&ref_ver=" + _root.version, "_blank");
};
moreGames_btn.onRelease = function () {
getURL ("http://www.neodelight.com?ref=asteroids&ref_loc=moregames&ref_ver=" + _root.version, "_blank");
};
neave_btn.onRelease = function () {
getURL ("http://www.neave.com/games/", "_blank");
};
Frame 7
stop();
Frame 9
stop();
asteroidCount = 0;
asteroidsVisible = 0;
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 = (saucer_mc._visible = false))))))))));
spaceship_mc.gunLoad = 0;
spaceship_mc.gunLoadMax = 15;
dx = (dy = (explodeNum = (asteroidNum = (scoreMod = (score = 0)))));
level = 1;
lives = 0;
friction = 1;
rads = (Math.PI/180);
leftKey = (rightKey = (upKey = (spaceship_mc.fireKey = (paused = (exploded = (beatToggle = false))))));
asteroids_mc.createEmptyMovieClip("explode_mc", 0);
beat1_sound = new Sound(this);
beat1_sound.attachSound("beat1");
beat2_sound = new Sound(this);
beat2_sound.attachSound("beat2");
thrust_sound = new Sound(spaceship_mc);
thrust_sound.attachSound("thrust");
saucerBig_sound = new Sound(saucer_mc);
saucerBig_sound.attachSound("saucerBig");
saucerSmall_sound = new Sound(saucer_mc);
saucerSmall_sound.attachSound("saucerSmall");
setLives = function () {
lives_mc[lives].removeMovieClip();
var _local1 = 0;
while (_local1 < lives) {
var _local2 = lives_mc.attachMovie("spaceship", _local1, _local1, {_x:_local1 * 15, _xscale:60, _yscale:60});
_local2.gotoAndStop(1);
_local2.hit_mc._visible = false;
_local1++;
}
};
setLives();
keyListener = new Object();
keyListener.onKeyDown = function () {
switch (Key.getCode()) {
case 37 :
leftKey = true;
return;
case 39 :
rightKey = 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;
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);
return;
case 16 :
if (!(spaceship_mc._visible && (!paused))) {
break;
}
spaceship_mc._visible = false;
spaceship_mc.gotoAndStop(1);
leftKey = (rightKey = (upKey = (fireKey = false)));
dx = (dy = 0);
thrust_sound.stop();
hyperTimeout = setInterval(hyperspace, 500);
}
};
keyListener.onKeyUp = function () {
switch (Key.getCode()) {
case 37 :
leftKey = false;
return;
case 39 :
rightKey = false;
return;
case 38 :
upKey = false;
thrust_sound.stop();
spaceship_mc.gotoAndStop(1);
return;
case 32 :
fireKey = false;
}
};
spaceship_mc.onEnterFrame = function () {
if (paused || (!this._visible)) {
return(undefined);
}
if (leftKey) {
this._rotation = this._rotation - 10;
}
if (rightKey) {
this._rotation = this._rotation + 10;
}
var _local8 = Math.sin(this._rotation * rads);
var _local7 = -Math.cos(this._rotation * rads);
if (upKey) {
dx = dx + (_local8 / 4);
dy = dy + (_local7 / 4);
}
dx = dx * friction;
dy = dy * friction;
this._x = this._x + dx;
this._y = this._y + dy;
this.wrapPos();
var _local9 = Key.isDown(32) && (!Key.isDown(16));
if ((this.gunLoad--) > 0) {
_local9 = false;
} else if (_local9) {
_local9 = false;
this.gunLoad = this.gunLoadMax;
var _local4 = 4;
var _local5 = -1;
while (_local4--) {
if (!_root[("missile" + _local4) + "_mc"]._visible) {
_local5 = _local4;
break;
}
}
if (_local5 != -1) {
var _local6 = _root[("missile" + _local5) + "_mc"];
_local6.fuse = 24;
_local6.vx = (_local8 * 10) + dx;
_local6.vy = (_local7 * 10) + dy;
_local6._x = this._x + (_local8 * 10);
_local6._y = this._y + (_local7 * 10);
_local6._visible = true;
_local6.onEnterFrame = missileMover;
_global.snd.playEvent("sndFire", 1, "fx");
}
}
var _local10 = int(score / 10000);
if (scoreMod != _local10) {
scoreMod = _local10;
lives++;
setLives();
_global.snd.playEvent("sndExtra", 1, "fx");
}
if (((missile4_mc.hitTest(this.hit_mc) && (!exploded)) && (this._visible)) && (missile4_mc._visible)) {
missile4_mc._visible = false;
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();
} else if (saucer_mc.small) {
saucerSmall_sound.start(0, 80);
} else {
saucerBig_sound.start(0, 80);
}
}
};
explodeSaucer = function () {
saucer_mc.hideSaucer();
var _local9 = 12;
while (_local9--) {
var _local2 = Math.random() * (Math.PI*2);
var _local4 = Math.sin(_local2) * 2;
var _local3 = Math.cos(_local2) * 2;
asteroids_mc.explode_mc.attachMovie("explosion", explodeNum, explodeNum, {vx:_local4, vy:_local3, fuse:Math.ceil(Math.random() * 40), _x:((_local4 * Math.random()) * 4) + saucer_mc._x, _y:((_local3 * Math.random()) * 4) + saucer_mc._y, onEnterFrame:explodeMover});
explodeNum++;
}
_global.snd.playEvent("sndUfoDie", 1, "fx");
};
explodeSpaceship = function () {
spaceship_mc._visible = false;
explode_mc._x = spaceship_mc._x;
explode_mc._y = spaceship_mc._y;
lives--;
setLives();
var _local8 = 40;
while (_local8--) {
var _local3 = explode_mc.createEmptyMovieClip(_local8, _local8);
_local3.vx = (Math.sin(Math.random() * (Math.PI*2)) * Math.random()) * 5;
_local3.vy = (Math.cos(Math.random() * (Math.PI*2)) * Math.random()) * 5;
_local3.fuse = Math.ceil(Math.random() * 30) + 10;
_local3._x = (Math.random() * 12) - 6;
_local3._y = (Math.random() * 12) - 6;
_local3._rotation = Math.random() * 360;
var _local5 = random(255);
_local5 = (_local5 * 256) + (_local5 * 65536);
_local3.lineStyle(Math.random() * 2, _local5);
var _local6 = Math.random() * 4;
_local3.moveTo(0, _local6 * -1);
_local3.lineTo(0, _local6);
_local3.onEnterFrame = explodeMover;
}
_local8 = 3;
while (_local8--) {
var _local7 = asteroids_mc.getNextHighestDepth();
var _local4 = asteroids_mc.attachMovie("cloud", "mc" + _local7, _local7);
_local4._x = (spaceship_mc._x + (Math.random() * 10)) - 5;
_local4._y = (spaceship_mc._y + (Math.random() * 10)) - 5;
_local4._xscale = (_local4._yscale = 20 + (Math.random() * 30));
_local4.vx = (Math.random() * 2) + (this.dx * 0.3);
_local4.vy = (Math.random() * 2) + (this.dy * 0.3);
_local4._rotation = Math.random() * 360;
_local4.onEnterFrame = function () {
this._x = this._x + this.vx;
this._y = this._y + this.vy;
this.vx = this.vx * 0.98;
this.vy = this.vy * 0.98;
this._alpha--;
if (this._alpha <= 0) {
this.removeMovieClip();
}
};
}
if (lives > 0) {
newShipTimeout = setInterval(newSpaceship, 1500);
} else {
gameOver_mc.gotoAndPlay(2);
gameOver_mc._visible = true;
quitGame_mc._visible = false;
Key.removeListener(keyListener);
clearInterval(hyperTimeout);
clearInterval(newShipTimeout);
clearInterval(newGameTimeout);
thrust_sound.stop();
saucerBig_sound.stop();
saucerSmall_sound.stop();
}
_global.snd.playEvent("sndFartMedium0", 1, "fx");
};
explodeMover = function () {
if (paused) {
return(undefined);
}
this._x = this._x + this.vx;
this._y = this._y + this.vy;
this.fuse--;
if (this.fuse < 0) {
this.removeMovieClip();
}
};
missileMover = function () {
if (paused) {
return(undefined);
}
this._x = this._x + this.vx;
this._y = this._y + this.vy;
this.wrapPos();
this.fuse--;
if (this.fuse == 0) {
this._visible = false;
delete this.onEnterFrame;
}
};
saucerMover = function () {
if (paused) {
return(undefined);
}
this._x = this._x + this.vx;
if (Math.random() < 0.02) {
this.vy = (int(Math.random() * 3) - 1) * 2;
}
if (this.vy != 0) {
this._y = this._y + this.vy;
}
this.wrapPos();
var _local4 = 4;
while (_local4--) {
var _local5 = _root[("missile" + _local4) + "_mc"];
if (_local5._visible) {
if (_local5.hitTest(this)) {
_local5._visible = false;
explodeSaucer();
if (this.small) {
score = score + 1000;
} else {
score = score + 200;
}
}
}
}
var _local5 = missile4_mc;
if ((!_local5._visible) && (Math.random() < 0.1)) {
var _local6 = ((this.small && (spaceship_mc._visible)) ? (Math.atan2(((spaceship_mc._x - this._x) + (Math.random() * 64)) - 32, ((this._y - spaceship_mc._y) + (Math.random() * 64)) - 32)) : (Math.random() * (Math.PI*2)));
_local5.fuse = 24;
_local5.vx = Math.sin(_local6) * 8;
_local5.vy = Math.cos(_local6) * -8;
_local5._x = this._x + _local5.vx;
_local5._y = this._y + (_local5.vy * 2);
_local5._visible = true;
_local5.onEnterFrame = missileMover;
_global.snd.playEvent("sndFire", 1, "fx");
}
if ((spaceship_mc.hit_mc.hitTest(this) && (!exploded)) && (spaceship_mc._visible)) {
exploded = true;
explodeSpaceship();
}
};
asteroidMover = function () {
if (paused) {
return(undefined);
}
this._x = this._x + this.vx;
this._y = this._y + this.vy;
this._rotation = this._rotation + this.vr;
this.wrapPos();
if (_root.asteroidsVisible == 1) {
_root.marker._visible = true;
_root.marker._x = this._x;
_root.marker._y = this._y;
} else {
_root.marker._visible = false;
}
var _local15 = false;
var _local19 = false;
if (saucer_mc._visible && (saucer_mc.hitTest(this))) {
_local15 = true;
explodeSaucer();
}
d = Math.sqrt(Math.pow(_root.spaceship_mc._x - this._x, 2) + Math.pow(_root.spaceship_mc._y - this._y, 2));
if (((d < (this._xscale * 0.65)) && (_root.spaceship_mc._visible)) && (!this.exploded)) {
_local15 = (this.spaceshipShot = true);
this.exploded = _local15;
explodeSpaceship();
}
var _local6 = 5;
while (_local6--) {
var _local5 = _root[("missile" + _local6) + "_mc"];
if (_local5._visible && (_local5.hitTest(this))) {
_local5._visible = false;
_local15 = true;
if (_local6 < 4) {
this.spaceshipShot = true;
}
break;
}
}
if (_local15) {
var _local10 = (this._xscale = (this._yscale = this._yscale / 2));
var _local18 = Math.random() * (Math.PI*2);
this.vx = this.vx + Math.sin(_local18);
this.vy = this.vy + Math.cos(_local18);
var _local16 = Math.random() < 0.1;
_root.asteroidCount--;
var _local17 = int(_local10 / 25) + 4;
while (_local17--) {
_local18 = Math.random() * (Math.PI*2);
var _local9 = Math.sin(_local18) * 2;
var _local8 = Math.cos(_local18) * 2;
asteroids_mc.explode_mc.attachMovie("explosion", explodeNum, asteroids_mc.getNextHighestDepth(), {vx:_local9, vy:_local8, fuse:Math.ceil(Math.random() * _local10), _x:((_local9 * Math.random()) * 4) + this._x, _y:((_local8 * Math.random()) * 4) + this._y, onEnterFrame:explodeMover});
explodeNum++;
}
_local6 = 3;
while (_local6--) {
var _local7 = asteroids_mc.getNextHighestDepth();
var _local4 = asteroids_mc.attachMovie("cloud2", "mc" + _local7, _local7);
_local4._x = (this._x + (Math.random() * 10)) - 5;
_local4._y = (this._y + (Math.random() * 10)) - 5;
if (_local16 && (_local10 < 25)) {
scale = 50 * (0.3 + (Math.random() * 0.3));
} else {
scale = this._xscale * (0.3 + (Math.random() * 0.3));
}
_local4._xscale = (_local4._yscale = scale);
_local4.vx = (Math.random() * 2) + (this.vx * 0.3);
_local4.vy = (Math.random() * 2) + (this.vy * 0.3);
_local4._rotation = Math.random() * 360;
_local4.onEnterFrame = function () {
this._x = this._x + this.vx;
this._y = this._y + this.vy;
this.vx = this.vx * 0.98;
this.vy = this.vy * 0.98;
this._alpha = this._alpha - 3;
if (this._alpha <= 0) {
this.removeMovieClip();
}
};
}
if (_local10 < 25) {
_root.asteroidsVisible--;
if (_local16) {
this._xscale = (this._yscale = this._yscale * 2);
this.vr = 6;
this.onEnterFrame = _root.asteroidMoverDie;
_global.snd.playEvent("sndFartExtra" + Math.floor(Math.random() * 2), 1, "fx");
} else {
this.removeMovieClip();
_global.snd.playEvent("sndFartShort" + Math.floor(Math.random() * 5), 1, "fx");
}
if (this.spaceshipShot) {
score = score + 100;
}
} else {
_root.asteroidsVisible++;
if (_local10 == 50) {
_global.snd.playEvent("sndFartLong" + Math.floor(Math.random() * 5), 1, "fx");
if (this.spaceshipShot) {
score = score + 20;
}
} else {
_global.snd.playEvent("sndFartMedium" + Math.floor(Math.random() * 5), 1, "fx");
if (this.spaceshipShot) {
score = score + 50;
}
}
this.gotoAndStop((_local6 % this._totalframes) + 1);
_local18 = Math.random() * (Math.PI*2);
_root.makeAsteroid(this._x, this._y, this.vx + Math.sin(_local18), this.vy + Math.cos(_local18), _local10, this._currentframe);
}
}
};
asteroidMoverDie = function () {
this.vx = this.vx * 0.95;
this.vy = this.vy * 0.95;
this.vx = this.vx + (Math.sin(this._rotation * _root.rads) * 0.3);
this.vy = this.vy - (Math.cos(this._rotation * _root.rads) * 0.3);
this._x = this._x + this.vx;
this._y = this._y + this.vy;
this.wrapPos();
this._rotation = this._rotation + this.vr;
this.vr = this.vr * 1.05;
this._xscale = (this._yscale = this._xscale * 0.95);
if (this._xscale < 5) {
this.removeMovieClip();
}
};
makeAsteroid = function (x, y, vx, vy, s, skin) {
_root.asteroidNum++;
vx = vx * 0.7;
vy = vy * 0.7;
var _local3 = asteroids_mc.attachMovie("asteroid", _root.asteroidNum, _root.asteroidNum, {vx:vx, vy:vy, vr:(Math.random() * 3) - 1.5, _x:x, _y:y, _xscale:s, _yscale:s, _rotation:Math.random() * 360, onEnterFrame:asteroidMover});
if (!skin) {
skin = (_root.asteroidNum % Math.min(this._totalframes, level + 3)) + 1;
}
_local3.gotoAndStop(skin);
return(_local3);
};
hyperspace = function () {
if (paused) {
return(undefined);
}
with (spaceship_mc) {
_visible = true;
_x = (Math.random() * (xMax - (_width * 2))) + _width;
_y = (Math.random() * (yMax - (_height * 2))) + _height;
}
clearInterval(hyperTimeout);
};
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;
saucerSmall_sound.start(0, 100);
} else {
saucer_mc._xscale = (saucer_mc._yscale = 100);
saucer_mc.small = false;
saucerBig_sound.start(0, 100);
}
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 ((_root.asteroidCount == 0) && (!saucer_mc._visible)) {
clearInterval(beatTimeout);
level++;
newGameTimeout = setInterval(newGame, 1000);
}
};
newSpaceship = function () {
spaceship_mc._x = 250;
spaceship_mc._y = 190;
spaceship_mc._rotation = 0;
var _local1 = false;
for (var _local2 in asteroids_mc) {
if (spaceship_mc.hitTest(asteroids_mc[_local2])) {
_local1 = true;
break;
}
}
if (!_local1) {
spaceship_mc._visible = true;
exploded = false;
dx = (dy = 0);
clearInterval(newShipTimeout);
}
};
newGame = function () {
var _local4 = Math.min(10, level + 1);
_root.asteroidCount = _local4 * 7;
_root.asteroidsVisible = _local4;
while (_local4--) {
var _local3 = Math.random() * (Math.PI*2);
var _local2 = makeAsteroid(Math.random() * xMax, Math.random() * yMax, Math.sin(_local3) * 1.5, Math.cos(_local3) * 1.5, 100);
if (_local2.hitTest(spaceship_mc) || (_local2.hitTest(safeArea_mc))) {
_local4++;
_root.asteroidNum--;
}
}
beatCount = ((level < 7) ? (1100 - (level * 100)) : 400);
beatSound();
Key.addListener(keyListener);
clearInterval(newGameTimeout);
};
newGameTimeout = setInterval(newGame, 1000);
newShipTimeout = setInterval(newSpaceship, 1100);
Symbol 5 MovieClip [explosion] Frame 1
gotoAndStop(Math.floor(Math.random() * 3));
Symbol 10 MovieClip Frame 1
var flashVersion = int(System.capabilities.version.split(" ").pop().split(",").shift());
if (flashVersion < 7) {
this.msg = "Please upgrade to Flash Player 7";
_root.percentageDisplay = "";
_root.onEnterFrame = function () {
this.gotoAndStop(1);
};
} else {
this.msg = "";
stop();
_root.onEnterFrame = function () {
var _local3 = (_root.getBytesLoaded() / _root.getBytesTotal()) * 100;
this.percentageDisplay = ("loading.." + Math.min(100, Math.floor(_local3))) + "%";
_root.bike._x = (_local3 * 5.5) * ((550 - _root.bike._width) / 550);
if (_local3 == 100) {
this.onEnterFrame = undefined;
_root.gotoAndPlay(3);
} else {
_root.gotoAndStop(1);
}
};
}
Symbol 150 MovieClip [__Packages.com.neodelight.std.XSound] Frame 0
class com.neodelight.std.XSound extends Sound
{
var channels, channelsById, groups, master;
function XSound () {
super();
channels = new Array(channelsAmount);
channelsById = new Array();
groups = {fx:1, music:1};
var _local4 = 0;
while (_local4 < channelsAmount) {
channels[_local4] = new com.neodelight.std.XSoundChannel(_local4, _root.createEmptyMovieClip(com.neodelight.std.Unique.getKey(), _root.getNextHighestDepth()), groups);
_local4++;
}
master = new Sound();
master.setVolume(100);
}
function addGroup(id) {
groups[id] = 1;
}
function setVolume(volume) {
master.setVolume(volume * 100);
}
function getVolume() {
return(master.getVolume() * 0.01);
}
function setGroupVolume(volume, id) {
groups[id] = volume;
var _local2 = channels.length;
while (_local2--) {
channels[_local2].setVolume();
}
}
function getGroupVolume(id) {
return(groups[id]);
}
function status() {
var _local3 = "";
var _local2 = 0;
while (_local2 < channelsAmount) {
_local3 = _local3 + (((_local2 + ": ") + channels[_local2]) + newline);
_local2++;
}
return(_local3);
}
function playSequence(sequence, locked, group, channelId) {
var _local2 = getChannel();
delete channelsById[_local2.channelId];
_local2.channelId = channelId;
if (channelId) {
channelsById[channelId] = _local2;
}
_local2.playSequence(sequence, locked, group);
}
function playLoop(libId, volume, group, channelId) {
var _local2 = getChannel();
delete channelsById[_local2.channelId];
_local2.channelId = channelId;
if (channelId) {
channelsById[channelId] = _local2;
}
_local2.attachSound(libId);
_local2.start(0, 99999);
_local2.group = (group ? (group) : "music");
_local2.setVolume(volume);
_local2.libId = libId;
_local2.locked = true;
_local2.playing = true;
return(_local2);
}
function playEvent(libId, volume, group, channelId) {
var _local2 = getChannel();
delete channelsById[_local2.channelId];
_local2.channelId = channelId;
if (channelId) {
channelsById[channelId] = _local2;
}
_local2.attachSound(libId);
_local2.start(0, 0);
_local2.group = (group ? (group) : "fx");
_local2.setVolume(volume);
_local2.libId = libId;
_local2.playing = true;
return(_local2);
}
function getChannel() {
var _local4 = -1;
var _local5 = -1;
var _local3 = 0;
while (_local3 < channels.length) {
var _local2 = channels[_local3];
if (!_local2.locked) {
if (_local2.playing) {
if (_local2.position > _local4) {
_local4 = _local2.position;
_local5 = _local2.id;
}
} else {
return(channels[_local3]);
}
}
_local3++;
}
if (_local5 != -1) {
return(channels[_local5]);
}
}
function fadeChannel(id, fadeTo, frames) {
channelsById[id].fade(fadeTo, frames);
}
function stop(libId) {
var _local2 = 0;
while (_local2 < channels.length) {
if ((channels[_local2].libId == libId) || (!libId)) {
channels[_local2].stop();
}
_local2++;
}
}
var channelsAmount = 8;
}
Symbol 151 MovieClip [__Packages.com.neodelight.std.XSoundChannel] Frame 0
class com.neodelight.std.XSoundChannel extends Sound
{
var id, playing, locked, groups, mc, volume, group, fadeOutFlag, fading, fadeTo, fadeSpeed, sequence, sequencePointer, libId, sequenceStep, attachSound, start, channelId;
function XSoundChannel (id, mc, groups) {
super(mc);
this.id = id;
playing = false;
locked = false;
this.groups = groups;
this.mc = mc;
this.mc.channel = this;
this.mc.onEnterFrame = function () {
if (!this.channel.fading) {
return(undefined);
}
var _local2 = this.channel.getVolume() + this.channel.fadeSpeed;
_local2 = ((this.channel.fadeSpeed > 0) ? (Math.min(this.channel.fadeTo, _local2)) : (Math.max(this.channel.fadeTo, _local2)));
if (_local2 == this.channel.fadeTo) {
this.channel.fading = false;
if (this.channel.fadeOutFlag) {
this.channel.stop();
}
}
this.channel.setVolume(_local2);
};
}
function setVolume(volume) {
if (volume != undefined) {
this.volume = volume;
}
super.setVolume(Math.max(0, Math.min(100, (this.volume * 100) * groups[group])));
}
function getVolume() {
return(volume);
}
function fade(fadeTo, frames) {
if (fadeTo == -1) {
fadeOutFlag = true;
fadeTo = 0;
} else {
fadeOutFlag = false;
}
if (frames <= 0) {
setVolume(fadeTo);
fading = false;
} else {
fading = true;
this.fadeTo = Math.min(1, fadeTo);
fadeSpeed = (fadeTo - getVolume()) / frames;
}
}
function playSequence(sequence, locked, group) {
this.sequence = sequence;
sequencePointer = 0;
this.locked = locked;
fading = false;
this.group = (group ? (group) : "fx");
playing = true;
stepSequence();
onSoundComplete = stepSequence;
libId = "__SEQUENCE__";
}
function stepSequence() {
if (sequenceStep.goto != undefined) {
sequencePointer = sequenceStep.goto;
}
var _local2 = sequence[sequencePointer++];
sequenceStep = _local2;
if (!_local2) {
stop();
}
if (_local2.times == 0) {
_local2.times = 9999;
_local2.goto = sequencePointer - 1;
} else if (_local2.times == undefined) {
_local2.times = 1;
}
attachSound(_local2.id);
setVolume(_local2.vol);
start((_local2.offset ? (_local2.offset) : 0), _local2.times);
if (_local2.fadeFrames) {
fade(_local2.fadeTo, _local2.fadeFrames);
}
}
function stop() {
onSoundComplete = undefined;
sequenceStep = undefined;
locked = false;
playing = false;
fading = false;
if (channelId) {
delete _global.snd.channelsById[channelId];
}
super.stop();
}
function onSoundComplete() {
playing = false;
locked = false;
fading = false;
}
function toString() {
return((((((((("v:" + getVolume()) + " p:") + playing) + " l:") + locked) + " f:") + fading) + " lib:") + libId);
}
}
Symbol 152 MovieClip [__Packages.com.neodelight.std.Unique] Frame 0
class com.neodelight.std.Unique
{
function Unique () {
}
static function getId() {
return(id++);
}
static function getKey() {
return("k" + (key++));
}
static var key = 1;
static var id = 1;
}
Symbol 12 Button
on (release) {
getURL (("http://www.neodelight.com?ref=" + _root.game) + "&ref_loc=intro", "_BLANK");
}
Symbol 23 MovieClip Frame 1
startFrame = _parent._currentframe;
Symbol 23 MovieClip Frame 2
vol = (1 - ((_parent._currentFrame - startFrame) / (_parent._totalFrames - startFrame))) * 100;
if (vol < 0) {
vol = 0;
}
_parent.snd.setVolume(vol);
Symbol 23 MovieClip Frame 3
gotoAndPlay ("loop");
Symbol 24 MovieClip Frame 1
snd = new Sound(this);
snd.setVolume(100);
_parent.stop();
Symbol 24 MovieClip Frame 123
stop();
_parent.play();
Symbol 27 MovieClip Frame 1
_global.api = new Object();
_global.api.debug = new Object();
_global.api.highscore = new Object();
_global.api.debug.describe = function (o) {
var _local2 = ("[DESCRIBE: " + o.toString()) + "]";
_local2 = _local2 + "\n---------------------------DESC-START";
for (var _local3 in o) {
_local2 = _local2 + (((newline + _local3) + ": ") + o[_local3]);
}
_local2 = _local2 + "\n---------------------------DESC-STOP";
return(_local2);
};
_global.api.snd = new Object();
_global.api.snd.lib = new Object();
_global.api.snd.load = function (name, url) {
var _local2 = new Sound();
if (url eq "") {
_local2.attachSound(name);
} else {
_local2.loadSound(url);
}
_global.api.snd.lib[name] = _local2;
};
_global.api.snd.play = function (name) {
_root.snd[name].gotoAndPlay(1);
};
_global.api.highscore.initSession = function () {
this.session = "";
while (this.session.length < 20) {
this.session = this.session + this.charTable.charAt(Math.round(Math.random() * (this.charTable.length - 4)));
}
this.charTableIndex = new Array();
var _local2 = 0;
while (_local2 < this.charTable.length) {
this.charTableIndex[this.charTable.charCodeAt(_local2)] = _local2;
_local2++;
}
};
_global.api.highscore.submit = function (pGame, pDisciple, pScore0, pScore1) {
trace("score: " + pScore0);
var _local2 = ("g=" + pGame) + "&";
_local2 = _local2 + (("d=" + pDisciple) + "&");
_local2 = _local2 + (("s0=" + pScore0) + "&");
_local2 = _local2 + (("s1=" + pScore1) + "&");
_local2 = _local2 + ("se=" + escape(session));
_local2 = _local2 + "&c=42";
var _local3 = (((this.urlSubmit + "?g=") + pGame) + "&s=") + escape(this.encrypt(this.encrypt(_local2, this.keystring), this.keystring2)).split("%").join("_");
trace(_local3);
getURL (_local3, "_top");
};
_global.api.highscore.encrypt = function (text, pKey) {
var _local8 = "";
var _local4 = 0;
var _local5;
var _local3;
var _local2 = 0;
while (_local2 < text.length) {
char = this.charTableIndex[text.charCodeAt(_local2)];
_local5 = this.charTableIndex[pKey.charCodeAt(_local2 % pKey.length)];
_local3 = (char + _local5) + _local4;
_local3 = _local3 % this.charTable.length;
_local8 = _local8 + this.charTable.charAt(_local3);
_local4 = _local4 + _local3;
_local2++;
}
_local4 = _local4 % this.charTable.length;
return((_local8 + "") + this.charTable.charAt(_local4));
};
_global.api.highscore.charTable = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz&=.";
_global.api.highscore.keystring = "1c37cadbd74acf517cee1765207ea0a4";
_global.api.highscore.keystring2 = "a67a17d7df947c3d98967b8569f695c1";
_global.api.highscore.urlSubmit = "http://www.neodelight.com/v4/high_enter.php";
_global.api.highscore.initSession();
_visible = false;
Symbol 77 MovieClip Frame 1
stop();
Symbol 80 Button
on (release) {
_root.play();
}
Symbol 102 Button
on (release) {
getURL ("http://www.neodelight.com/highscores/" + _root.gameName);
}
Symbol 104 Button
on (release) {
getURL ("http://www.neodelight.com/?ref_loc=moregames&ref=" + _root.gameName);
}
Symbol 113 Button
on (release) {
play();
}
Symbol 125 MovieClip Frame 20
this._visible = false;
Symbol 138 MovieClip Frame 1
stop();
Symbol 138 MovieClip Frame 3
stop();
Symbol 138 MovieClip Frame 5
stop();
Symbol 138 MovieClip Frame 7
stop();
Symbol 138 MovieClip Frame 9
stop();
Symbol 138 MovieClip Frame 11
stop();
Symbol 145 Button
on (release, keyPress "y") {
_global.api.highscore.submit(_root.gameName, "", _level0.score, 0);
}
Symbol 147 Button
on (release, keyPress "n") {
_root.gotoAndStop("menu");
}
Symbol 149 MovieClip Frame 1
stop();
Symbol 149 MovieClip Frame 33
Symbol 149 MovieClip Frame 34
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);