Frame 1
MochiAd.showPreGameAd({id:"03d6eeae33ac5a38", res:"640x400"});
mochi.MochiServices.connect("03d6eeae33ac5a38");
var _mochiads_game_id = "03d6eeae33ac5a38";
Frame 2
logoLink.onRelease = function () {
getURL ("http://www.ninjadoodle.com/", "_blank");
};
_global.myRoot = this;
stopAllSounds();
fscommand ("allowscale", "false");
fscommand ("fullscreen", "false");
fscommand ("showmenu", "false");
this._quality = "best";
var core = this;
var make_sound = function (mc_name, depth, volume, name) {
var _local2 = core.createEmptyMovieClip(mc_name, depth);
var _local1 = new Sound(_local2);
_local1.setVolume(volume);
_local1.attachSound(name);
return(_local1);
};
var wind = make_sound("wind", 200, 100, "wind");
var explosion = make_sound("explosion", 201, 100, "explosion");
var counter = make_sound("counter", 202, 100, "counter");
var jackpot = make_sound("jackpot", 203, 30, "jackpot");
var deflect = make_sound("deflect", 204, 100, "deflect");
var pickup = make_sound("pickup", 205, 100, "pickup");
var buzzer = make_sound("buzzer", 206, 100, "buzzer");
var bounce = make_sound("bounce", 207, 100, "bounce");
var shatter = make_sound("shatter", 208, 100, "shatter");
var golf = make_sound("golf", 209, 100, "golf");
var squish = make_sound("squish", 210, 100, "squish");
var fail = make_sound("fail", 211, 100, "fail");
var success = make_sound("success", 212, 100, "success");
var doom = make_sound("doom", 213, 100, "doom");
var happy = make_sound("happy", 214, 100, "happy");
var menuOver = make_sound("menuOver", 215, 100, "menuOver");
var menuDown = make_sound("menuDown", 216, 100, "menuDown");
var theme = make_sound("theme", 217, 100, "theme");
globalSound = new Sound();
sound = true;
Frame 82
function __com_mochibot__(swfid, mc, lv, trk) {
var x;
var g;
var s;
var fv;
var sb;
var u;
var res;
var mb;
var mbc;
var pv;
mb = "__mochibot__";
mbc = "mochibot.com";
g = (_global ? (_global) : (_level0._root));
if (g[mb + swfid]) {
return(g[mb + swfid]);
}
s = System.security;
x = mc._root.getSWFVersion;
fv = (x ? (mc.getSWFVersion()) : ((_global ? 6 : 5)));
if (!s) {
s = {};
}
sb = s.sandboxType;
if (sb == "localWithFile") {
return(null);
}
x = s.allowDomain;
if (x) {
s.allowDomain(mbc);
}
x = s.allowInsecureDomain;
if (x) {
s.allowInsecureDomain(mbc);
}
pv = ((fv == 5) ? (getVersion()) : (System.capabilities.version));
u = (((((((((((("http://" + mbc) + "/my/core.swf?mv=8&fv=") + fv) + "&v=") + escape(pv)) + "&swfid=") + escape(swfid)) + "&l=") + lv) + "&f=") + mc) + (sb ? ("&sb=" + sb) : "")) + (trk ? "&t=1" : "");
lv = ((fv > 6) ? (mc.getNextHighestDepth()) : ((g[mb + "level"] ? (g[mb + "level"] + 1) : (lv))));
g[mb + "level"] = lv;
if (fv == 5) {
res = "_level" + lv;
if (!eval (res)) {
loadMovieNum (u, lv);
}
} else {
res = mc.createEmptyMovieClip(mb + swfid, lv);
res.loadMovie(u);
}
return(res);
}
__com_mochibot__("b16f1996", this, 10301, true);
stop();
stopAllSounds();
core.wind.start(0, 10000);
quit = true;
faded = false;
scores = false;
playOn = false;
lives = 3;
score = 0;
miniGamesCompleted = 0;
miniGames = new Array();
i = 0;
while (i < 21) {
miniGames[i] = "miniGame" + (i + 1);
i++;
}
i = Math.floor(Math.random() * miniGames.length);
nextMiniGame = miniGames[i];
miniGames.splice(i, 1);
playButton.onRollOver = function () {
core.menuOver.start(0, 1);
};
playButton.onPress = function () {
core.menuDown.start(0, 1);
playOn = true;
fades.play();
};
scoresButton.onRollOver = function () {
core.menuOver.start(0, 1);
};
scoresButton.onPress = function () {
core.menuDown.start(0, 1);
scores = true;
fades.play();
};
textLink.onPress = function () {
getURL ("http://www.ninjadoodle.com/", "_blank");
};
onEnterFrame = function () {
if (sound) {
soundSwitch.gotoAndStop("on");
} else {
soundSwitch.gotoAndStop("off");
}
if (fades._currentframe == fades._totalframes) {
faded = true;
}
if (faded) {
faded = false;
if (scores) {
scores = false;
gotoAndStop ("scores");
}
if (playOn) {
playOn = false;
play();
}
}
};
thisTime = 0;
lastTime = 0;
framesCounted = 0;
intervalTotal = 0;
fpsCounter = function () {
framesCounted++;
thisTime = getTimer();
interval = thisTime - lastTime;
intervalTotal = intervalTotal + interval;
if (intervalTotal >= 1000) {
intervalTotal = 0;
framerate = framesCounted + " FPS";
framesCounted = 0;
}
lastTime = thisTime;
};
Instance of Symbol 81 MovieClip in Frame 82
on (keyPress "s") {
if (_global.myRoot.sound) {
_global.myRoot.sound = false;
_global.myRoot.globalSound.setVolume(0);
} else {
_global.myRoot.sound = true;
_global.myRoot.globalSound.setVolume(100);
}
}
on (keyPress "q") {
if (!_global.myRoot.quit) {
_global.myRoot.quit = true;
_global.myRoot.fades.play();
}
}
on (keyPress "<Space>") {
if ((((_global.myRoot.gameReady and (!_global.myRoot.quit)) and (!_global.myRoot.miniGameWon)) and (!_global.myRoot.miniGameOver)) and (!_global.myRoot.gameOver)) {
if (!_global.myRoot.gamePaused) {
_global.myRoot.gamePaused = true;
_global.myRoot.foreground.gotoAndStop("gamePaused");
} else {
_global.myRoot.gamePaused = false;
_global.myRoot.foreground.gotoAndStop("gameReady");
}
}
}
Frame 83
stop();
quit = false;
faded = false;
playOn = false;
playButton.onRollOver = function () {
core.menuOver.start(0, 1);
};
playButton.onPress = function () {
core.menuDown.start(0, 1);
playOn = true;
fades.play();
};
textLink.onPress = function () {
getURL ("http://www.ninjadoodle.com/", "_blank");
};
onEnterFrame = function () {
if (sound) {
soundSwitch.gotoAndStop("on");
} else {
soundSwitch.gotoAndStop("off");
}
if (fades._currentframe == fades._totalframes) {
faded = true;
}
if (quit) {
fades.play();
if (faded) {
faded = false;
gotoAndStop ("menu");
}
}
if (playOn) {
fades.play();
if (faded) {
stopAllSounds();
core.theme.start(0, 1000);
_global.myRoot.gotoAndStop(nextMiniGame);
}
}
};
Instance of Symbol 81 MovieClip in Frame 83
on (keyPress "s") {
if (_global.myRoot.sound) {
_global.myRoot.sound = false;
_global.myRoot.globalSound.setVolume(0);
} else {
_global.myRoot.sound = true;
_global.myRoot.globalSound.setVolume(100);
}
}
on (keyPress "q") {
if (!_global.myRoot.quit) {
_global.myRoot.quit = true;
_global.myRoot.fades.play();
}
}
on (keyPress "<Space>") {
if ((((_global.myRoot.gameReady and (!_global.myRoot.quit)) and (!_global.myRoot.miniGameWon)) and (!_global.myRoot.miniGameOver)) and (!_global.myRoot.gameOver)) {
if (!_global.myRoot.gamePaused) {
_global.myRoot.gamePaused = true;
_global.myRoot.foreground.gotoAndStop("gamePaused");
} else {
_global.myRoot.gamePaused = false;
_global.myRoot.foreground.gotoAndStop("gameReady");
}
}
}
Frame 84
stop();
quit = false;
faded = false;
gameReady = false;
gameDone = false;
gamePaused = false;
miniGameWon = false;
miniGameOver = false;
gameOver = false;
timerRunning = false;
timeBonusAdded = false;
scoreAdded = false;
miniGamesCompleted = miniGamesCompleted + 1;
miniGameCounter = miniGamesCompleted;
trace(miniGamesCompleted);
i = Math.floor(Math.random() * miniGames.length);
nextMiniGame = miniGames[i];
miniGames.splice(i, 1);
mousePressed = false;
onMouseUp = function () {
mousePressed = false;
};
onMouseDown = function () {
mousePressed = true;
};
onMouseMove = function () {
};
startAnim.infoBox.infoText = "CLICK 25 TIMES!";
survivalMode = false;
miniGameScore = 10;
clicks = 0;
playCounter = false;
onEnterFrame = function () {
fpsCounter();
gamePausedText._visible = false;
if (sound) {
soundSwitch.gotoAndStop("on");
} else {
soundSwitch.gotoAndStop("off");
}
if (startAnim._currentframe == startAnim._totalframes) {
gameReady = true;
}
if (endAnim._currentframe == endAnim._totalframes) {
gameDone = true;
}
if (fades._currentframe == fades._totalframes) {
faded = true;
}
if (((((gameReady and (!quit)) and (!gamePaused)) and (!miniGameWon)) and (!miniGameOver)) and (!gameOver)) {
gamePausedText._visible = true;
timer._width = timer._width - 4;
if (timer._width <= 0) {
if (!survivalMode) {
core.fail.start(0, 1);
lives = lives - 1;
timer._width = 0;
if (lives > 0) {
miniGameOver = true;
} else {
gameOver = true;
}
} else {
core.success.start(0, 1);
miniGameWon = true;
}
} else {
if (mousePressed) {
clicks++;
playCounter = true;
mousePressed = false;
}
if (playCounter) {
playCounter = false;
core.counter.start(0, 1);
}
if (clicks == 25) {
core.success.start(0, 1);
miniGameWon = true;
}
}
} else {
if (quit) {
fades.play();
if (faded) {
faded = false;
gotoAndStop ("menu");
}
}
if (miniGameWon) {
if (!survivalMode) {
if (!timeBonusAdded) {
timeBonusAdded = true;
miniGameScore = miniGameScore + Math.round(timer._width / 10);
}
}
if (!scoreAdded) {
if (miniGameScore > 0) {
miniGameScore = miniGameScore - 1;
score = score + 1;
core.jackpot.start(0, 1);
} else {
scoreAdded = true;
miniGameScore = 0;
}
}
if ((!gameDone) and scoreAdded) {
endAnim.infoBox.infoText = "WELL DONE!";
endAnim.play();
}
if (gameDone) {
fades.play();
}
if (faded) {
faded = false;
if (miniGamesCompleted < 21) {
_global.myRoot.gotoAndStop(nextMiniGame);
} else {
_global.myRoot.gotoAndStop("gameWon");
}
}
}
if (miniGameOver) {
if (!gameDone) {
endAnim.infoBox.infoText = "WHOOPS!";
endAnim.play();
}
if (gameDone) {
fades.play();
}
if (faded) {
faded = false;
if (miniGamesCompleted < 21) {
_global.myRoot.gotoAndStop(nextMiniGame);
} else {
_global.myRoot.gotoAndStop("gameWon");
}
}
}
if (gameOver) {
if (!gameDone) {
endAnim.infoBox.infoText = "GAME OVER!";
endAnim.play();
}
if (gameDone) {
fades.play();
}
if (faded) {
faded = false;
gotoAndStop ("gameOver");
}
}
}
};
Instance of Symbol 81 MovieClip in Frame 84
on (keyPress "s") {
if (_global.myRoot.sound) {
_global.myRoot.sound = false;
_global.myRoot.globalSound.setVolume(0);
} else {
_global.myRoot.sound = true;
_global.myRoot.globalSound.setVolume(100);
}
}
on (keyPress "q") {
if (!_global.myRoot.quit) {
_global.myRoot.quit = true;
_global.myRoot.fades.play();
}
}
on (keyPress "<Space>") {
if ((((_global.myRoot.gameReady and (!_global.myRoot.quit)) and (!_global.myRoot.miniGameWon)) and (!_global.myRoot.miniGameOver)) and (!_global.myRoot.gameOver)) {
if (!_global.myRoot.gamePaused) {
_global.myRoot.gamePaused = true;
_global.myRoot.foreground.gotoAndStop("gamePaused");
} else {
_global.myRoot.gamePaused = false;
_global.myRoot.foreground.gotoAndStop("gameReady");
}
}
}
Frame 85
stop();
quit = false;
faded = false;
gameReady = false;
gameDone = false;
gamePaused = false;
miniGameWon = false;
miniGameOver = false;
gameOver = false;
timerRunning = false;
timeBonusAdded = false;
scoreAdded = false;
miniGamesCompleted = miniGamesCompleted + 1;
trace(miniGamesCompleted);
miniGameCounter = miniGamesCompleted;
i = Math.floor(Math.random() * miniGames.length);
nextMiniGame = miniGames[i];
miniGames.splice(i, 1);
mousePressed = false;
onMouseUp = function () {
mousePressed = false;
};
onMouseDown = function () {
mousePressed = true;
};
onMouseMove = function () {
};
startAnim.infoBox.infoText = "EXPLODE IN ORDER!";
survivalMode = false;
miniGameScore = 10;
blown = new Array();
i = 0;
while (i < 7) {
blown[i] = false;
i++;
}
blown[0] = true;
shaking = false;
bombPositions = new Array();
bombPositions[0] = 170;
bombPositions[1] = 220;
bombPositions[2] = 270;
bombPositions[3] = 320;
bombPositions[4] = 370;
bombPositions[5] = 420;
bombPositions[6] = 470;
i = 0;
while (i < 7) {
j = i + 1;
k = Math.floor(Math.random() * bombPositions.length);
_global.myRoot["bomb" + j]._x = bombPositions[k];
_global.myRoot[("bomb" + j) + "reflection"]._x = bombPositions[k];
bombPositions.splice(k, 1);
i++;
}
onEnterFrame = function () {
fpsCounter();
gamePausedText._visible = false;
if (sound) {
soundSwitch.gotoAndStop("on");
} else {
soundSwitch.gotoAndStop("off");
}
if (startAnim._currentframe == startAnim._totalframes) {
gameReady = true;
}
if (endAnim._currentframe == endAnim._totalframes) {
gameDone = true;
}
if (fades._currentframe == fades._totalframes) {
faded = true;
}
if (shaking) {
_global.myRoot._x = random(5) - 2;
_global.myRoot._y = random(5) - 2;
shakeCount--;
if (shakeCount == 0) {
shaking = false;
_global.myRoot._x = 0;
_global.myRoot._y = 0;
}
}
if (((((gameReady and (!quit)) and (!gamePaused)) and (!miniGameWon)) and (!miniGameOver)) and (!gameOver)) {
gamePausedText._visible = true;
timer._width = timer._width - 5;
if (timer._width <= 0) {
if (!survivalMode) {
core.fail.start(0, 1);
lives = lives - 1;
timer._width = 0;
if (lives > 0) {
miniGameOver = true;
} else {
gameOver = true;
}
} else {
core.success.start(0, 1);
miniGameWon = true;
}
} else {
i = 0;
while (i < 7) {
j = i + 1;
if (mousePressed) {
if (_global.myRoot["bomb" + j].hitTest(_xmouse, _ymouse, true)) {
if (!blown[j]) {
if (blown[i]) {
blown[j] = true;
playExplosion = true;
mousePressed = false;
d = 0;
while (d < 20) {
p1 = attachMovie("particle", "particle" + (i++), _global.myRoot.getNextHighestDepth());
p1._x = _xmouse;
p1._y = _ymouse;
p1._xscale = (p1._yscale = (Math.random() * 100) + 50);
p1._rotation = random(360);
d++;
}
_global.myRoot["bomb" + j].play();
_global.myRoot[("bomb" + j) + "reflection"].play();
core.explosion.start(0, 1);
shaking = true;
shakeCount = 10;
} else {
core.buzzer.start(0, 1);
mousePressed = false;
}
}
}
}
i++;
}
if (blown[7]) {
core.success.start(0, 1);
miniGameWon = true;
}
}
} else {
if (quit) {
fades.play();
if (faded) {
faded = false;
gotoAndStop ("menu");
}
}
if (miniGameWon) {
if (!survivalMode) {
if (!timeBonusAdded) {
timeBonusAdded = true;
miniGameScore = miniGameScore + Math.round(timer._width / 10);
}
}
if (!scoreAdded) {
if (miniGameScore > 0) {
miniGameScore = miniGameScore - 1;
score = score + 1;
core.jackpot.start(0, 1);
} else {
scoreAdded = true;
miniGameScore = 0;
}
}
if ((!gameDone) and scoreAdded) {
endAnim.infoBox.infoText = "WELL DONE!";
endAnim.play();
}
if (gameDone) {
fades.play();
}
if (faded) {
faded = false;
if (miniGamesCompleted < 21) {
_global.myRoot.gotoAndStop(nextMiniGame);
} else {
_global.myRoot.gotoAndStop("gameWon");
}
}
}
if (miniGameOver) {
if (!gameDone) {
endAnim.infoBox.infoText = "WHOOPS!";
endAnim.play();
}
if (gameDone) {
fades.play();
}
if (faded) {
faded = false;
if (miniGamesCompleted < 21) {
_global.myRoot.gotoAndStop(nextMiniGame);
} else {
_global.myRoot.gotoAndStop("gameWon");
}
}
}
if (gameOver) {
if (!gameDone) {
endAnim.infoBox.infoText = "GAME OVER!";
endAnim.play();
}
if (gameDone) {
fades.play();
}
if (faded) {
faded = false;
gotoAndStop ("gameOver");
}
}
}
};
Instance of Symbol 81 MovieClip in Frame 85
on (keyPress "s") {
if (_global.myRoot.sound) {
_global.myRoot.sound = false;
_global.myRoot.globalSound.setVolume(0);
} else {
_global.myRoot.sound = true;
_global.myRoot.globalSound.setVolume(100);
}
}
on (keyPress "q") {
if (!_global.myRoot.quit) {
_global.myRoot.quit = true;
_global.myRoot.fades.play();
}
}
on (keyPress "<Space>") {
if ((((_global.myRoot.gameReady and (!_global.myRoot.quit)) and (!_global.myRoot.miniGameWon)) and (!_global.myRoot.miniGameOver)) and (!_global.myRoot.gameOver)) {
if (!_global.myRoot.gamePaused) {
_global.myRoot.gamePaused = true;
_global.myRoot.foreground.gotoAndStop("gamePaused");
} else {
_global.myRoot.gamePaused = false;
_global.myRoot.foreground.gotoAndStop("gameReady");
}
}
}
Frame 86
stop();
quit = false;
faded = false;
gameReady = false;
gameDone = false;
gamePaused = false;
miniGameWon = false;
miniGameOver = false;
gameOver = false;
timerRunning = false;
timeBonusAdded = false;
scoreAdded = false;
miniGamesCompleted = miniGamesCompleted + 1;
trace(miniGamesCompleted);
miniGameCounter = miniGamesCompleted;
i = Math.floor(Math.random() * miniGames.length);
nextMiniGame = miniGames[i];
miniGames.splice(i, 1);
mousePressed = false;
onMouseUp = function () {
mousePressed = false;
};
onMouseDown = function () {
mousePressed = true;
};
onMouseMove = function () {
};
startAnim.infoBox.infoText = "TURN CLOCKWISE!";
survivalMode = false;
miniGameScore = 10;
rounds = 10;
quadrant = 3;
centreMC._visible = false;
onEnterFrame = function () {
fpsCounter();
gamePausedText._visible = false;
if (sound) {
soundSwitch.gotoAndStop("on");
} else {
soundSwitch.gotoAndStop("off");
}
if (startAnim._currentframe == startAnim._totalframes) {
gameReady = true;
}
if (endAnim._currentframe == endAnim._totalframes) {
gameDone = true;
}
if (fades._currentframe == fades._totalframes) {
faded = true;
}
x = centreMC._xmouse;
y = centreMC._ymouse * -1;
angle = Math.atan(y / x) / (Math.PI/180);
if (x < 0) {
angle = angle + 180;
}
if ((x >= 0) && (y < 0)) {
angle = angle + 360;
}
lever._rotation = angle * -1;
leverReflection._rotation = angle;
if (((((gameReady and (!quit)) and (!gamePaused)) and (!miniGameWon)) and (!miniGameOver)) and (!gameOver)) {
gamePausedText._visible = true;
timer._width = timer._width - 4;
if (timer._width <= 0) {
if (!survivalMode) {
core.fail.start(0, 1);
lives = lives - 1;
timer._width = 0;
if (lives > 0) {
miniGameOver = true;
} else {
gameOver = true;
}
} else {
core.success.start(0, 1);
miniGameWon = true;
}
} else if (quadrant == int(angle / 90)) {
quadrant--;
if (quadrant == -1) {
core.counter.start(0, 1);
quadrant = 3;
rounds--;
if (rounds == 0) {
core.success.start(0, 1);
miniGameWon = true;
}
}
}
} else {
if (quit) {
fades.play();
if (faded) {
faded = false;
gotoAndStop ("menu");
}
}
if (miniGameWon) {
if (!survivalMode) {
if (!timeBonusAdded) {
timeBonusAdded = true;
miniGameScore = miniGameScore + Math.round(timer._width / 10);
}
}
if (!scoreAdded) {
if (miniGameScore > 0) {
miniGameScore = miniGameScore - 1;
score = score + 1;
core.jackpot.start(0, 1);
} else {
scoreAdded = true;
miniGameScore = 0;
}
}
if ((!gameDone) and scoreAdded) {
endAnim.infoBox.infoText = "WELL DONE!";
endAnim.play();
}
if (gameDone) {
fades.play();
}
if (faded) {
faded = false;
if (miniGamesCompleted < 21) {
_global.myRoot.gotoAndStop(nextMiniGame);
} else {
_global.myRoot.gotoAndStop("gameWon");
}
}
}
if (miniGameOver) {
if (!gameDone) {
endAnim.infoBox.infoText = "WHOOPS!";
endAnim.play();
}
if (gameDone) {
fades.play();
}
if (faded) {
faded = false;
if (miniGamesCompleted < 21) {
_global.myRoot.gotoAndStop(nextMiniGame);
} else {
_global.myRoot.gotoAndStop("gameWon");
}
}
}
if (gameOver) {
if (!gameDone) {
endAnim.infoBox.infoText = "GAME OVER!";
endAnim.play();
}
if (gameDone) {
fades.play();
}
if (faded) {
faded = false;
gotoAndStop ("gameOver");
}
}
}
};
Instance of Symbol 81 MovieClip in Frame 86
on (keyPress "s") {
if (_global.myRoot.sound) {
_global.myRoot.sound = false;
_global.myRoot.globalSound.setVolume(0);
} else {
_global.myRoot.sound = true;
_global.myRoot.globalSound.setVolume(100);
}
}
on (keyPress "q") {
if (!_global.myRoot.quit) {
_global.myRoot.quit = true;
_global.myRoot.fades.play();
}
}
on (keyPress "<Space>") {
if ((((_global.myRoot.gameReady and (!_global.myRoot.quit)) and (!_global.myRoot.miniGameWon)) and (!_global.myRoot.miniGameOver)) and (!_global.myRoot.gameOver)) {
if (!_global.myRoot.gamePaused) {
_global.myRoot.gamePaused = true;
_global.myRoot.foreground.gotoAndStop("gamePaused");
} else {
_global.myRoot.gamePaused = false;
_global.myRoot.foreground.gotoAndStop("gameReady");
}
}
}
Frame 87
stop();
quit = false;
faded = false;
gameReady = false;
gameDone = false;
gamePaused = false;
miniGameWon = false;
miniGameOver = false;
gameOver = false;
timerRunning = false;
timeBonusAdded = false;
scoreAdded = false;
miniGamesCompleted = miniGamesCompleted + 1;
trace(miniGamesCompleted);
miniGameCounter = miniGamesCompleted;
i = Math.floor(Math.random() * miniGames.length);
nextMiniGame = miniGames[i];
miniGames.splice(i, 1);
mousePressed = false;
onMouseUp = function () {
mousePressed = false;
};
onMouseDown = function () {
mousePressed = true;
};
onMouseMove = function () {
};
startAnim.infoBox.infoText = "DEFLECT!";
survivalMode = true;
miniGameScore = 20;
delay = 10;
bombSpeed = 0;
bombSpeedLimit = 12;
shaking = false;
lifeTaken = false;
i = 0;
while (i < 4) {
j = i + 1;
_global.myRoot["bomb" + j]._x = random(540) + 50;
i++;
}
i = 1;
onEnterFrame = function () {
fpsCounter();
gamePausedText._visible = false;
if (sound) {
soundSwitch.gotoAndStop("on");
} else {
soundSwitch.gotoAndStop("off");
}
if (startAnim._currentframe == startAnim._totalframes) {
gameReady = true;
}
if (endAnim._currentframe == endAnim._totalframes) {
gameDone = true;
}
if (fades._currentframe == fades._totalframes) {
faded = true;
}
distX = _xmouse - player._x;
distY = _ymouse - player._y;
distance = Math.sqrt((distX * distX) + (distY * distY));
angle = Math.atan2(distY, distX);
speed = distance / delay;
xSpeed = speed * Math.cos(angle);
ySpeed = speed * Math.sin(angle);
player._x = player._x + xSpeed;
playerReflection._x = player._x;
if (player._x < 50) {
player._x = 50;
}
if (player._x > 590) {
player._x = 590;
}
if (shaking) {
_global.myRoot._x = random(5) - 2;
_global.myRoot._y = random(5) - 2;
shakeCount--;
if (shakeCount == 0) {
shaking = false;
_global.myRoot._x = 0;
_global.myRoot._y = 0;
}
}
if (((((gameReady and (!quit)) and (!gamePaused)) and (!miniGameWon)) and (!miniGameOver)) and (!gameOver)) {
gamePausedText._visible = true;
timer._width = timer._width - 4;
if (timer._width <= 0) {
if (!survivalMode) {
core.fail.start(0, 1);
lives = lives - 1;
timer._width = 0;
if (lives > 0) {
miniGameOver = true;
} else {
gameOver = true;
}
} else {
core.success.start(0, 1);
miniGameWon = true;
}
} else {
if (bombSpeed < bombSpeedLimit) {
bombSpeed = bombSpeed + 0.4;
}
_global.myRoot["bomb" + i]._y = _global.myRoot["bomb" + i]._y + bombSpeed;
if (((_global.myRoot["bomb" + i]._y > 280) and (_global.myRoot["bomb" + i]._x < (player._x + 30))) and (_global.myRoot["bomb" + i]._x > (player._x - 30))) {
shaking = true;
shakeCount = 10;
core.explosion.start(0, 1);
_global.myRoot["bomb" + i].play();
_global.myRoot["bomb" + i]._y = 279;
j = 0;
while (j < 20) {
p = attachMovie("particle", "particle" + (j++), _global.myRoot.getNextHighestDepth());
p._x = player._x;
p._y = 280;
p._xscale = (p._yscale = (Math.random() * 100) + 50);
p._rotation = random(360);
j++;
}
bombSpeed = 0;
i++;
}
if ((_global.myRoot["bomb" + i]._y > 290) and ((_global.myRoot["bomb" + i]._x > (player._x + 30)) or (_global.myRoot["bomb" + i]._x < (player._x - 30)))) {
if (!lifeTaken) {
lifeTaken = true;
bombSpeed = 0;
shaking = true;
shakeCount = 10;
core.explosion.start(0, 1);
core.fail.start(0, 1);
lives = lives - 1;
lastX = _global.myRoot["bomb" + i]._x;
_global.myRoot["bomb" + i].play();
j = 0;
while (j < 20) {
p = attachMovie("particle", "particle" + (j++), _global.myRoot.getNextHighestDepth());
p._x = lastX;
p._y = 310;
p._xscale = (p._yscale = (Math.random() * 100) + 50);
p._rotation = random(360);
j++;
}
}
if (lives > 0) {
miniGameOver = true;
} else {
gameOver = true;
}
}
}
} else {
if (quit) {
fades.play();
if (faded) {
faded = false;
gotoAndStop ("menu");
}
}
if (miniGameWon) {
if (ballFalling) {
_global.myRoot["ball" + i].play();
}
if (!survivalMode) {
if (!timeBonusAdded) {
timeBonusAdded = true;
miniGameScore = miniGameScore + Math.round(timer._width / 10);
}
}
if (!scoreAdded) {
if (miniGameScore > 0) {
miniGameScore = miniGameScore - 1;
score = score + 1;
core.jackpot.start(0, 1);
} else {
scoreAdded = true;
miniGameScore = 0;
}
}
if ((!gameDone) and scoreAdded) {
endAnim.infoBox.infoText = "WELL DONE!";
endAnim.play();
}
if (gameDone) {
fades.play();
}
if (faded) {
faded = false;
if (miniGamesCompleted < 21) {
_global.myRoot.gotoAndStop(nextMiniGame);
} else {
_global.myRoot.gotoAndStop("gameWon");
}
}
}
if (miniGameOver) {
if (!gameDone) {
endAnim.infoBox.infoText = "WHOOPS!";
endAnim.play();
}
if (gameDone) {
fades.play();
}
if (faded) {
faded = false;
if (miniGamesCompleted < 21) {
_global.myRoot.gotoAndStop(nextMiniGame);
} else {
_global.myRoot.gotoAndStop("gameWon");
}
}
}
if (gameOver) {
if (!gameDone) {
endAnim.infoBox.infoText = "GAME OVER!";
endAnim.play();
}
if (gameDone) {
fades.play();
}
if (faded) {
faded = false;
gotoAndStop ("gameOver");
}
}
}
};
Instance of Symbol 81 MovieClip in Frame 87
on (keyPress "s") {
if (_global.myRoot.sound) {
_global.myRoot.sound = false;
_global.myRoot.globalSound.setVolume(0);
} else {
_global.myRoot.sound = true;
_global.myRoot.globalSound.setVolume(100);
}
}
on (keyPress "q") {
if (!_global.myRoot.quit) {
_global.myRoot.quit = true;
_global.myRoot.fades.play();
}
}
on (keyPress "<Space>") {
if ((((_global.myRoot.gameReady and (!_global.myRoot.quit)) and (!_global.myRoot.miniGameWon)) and (!_global.myRoot.miniGameOver)) and (!_global.myRoot.gameOver)) {
if (!_global.myRoot.gamePaused) {
_global.myRoot.gamePaused = true;
_global.myRoot.foreground.gotoAndStop("gamePaused");
} else {
_global.myRoot.gamePaused = false;
_global.myRoot.foreground.gotoAndStop("gameReady");
}
}
}
Frame 88
stop();
quit = false;
faded = false;
gameReady = false;
gameDone = false;
gamePaused = false;
miniGameWon = false;
miniGameOver = false;
gameOver = false;
timerRunning = false;
timeBonusAdded = false;
scoreAdded = false;
miniGamesCompleted = miniGamesCompleted + 1;
trace(miniGamesCompleted);
miniGameCounter = miniGamesCompleted;
i = Math.floor(Math.random() * miniGames.length);
nextMiniGame = miniGames[i];
miniGames.splice(i, 1);
mousePressed = false;
onMouseUp = function () {
mousePressed = false;
};
onMouseDown = function () {
mousePressed = true;
};
onMouseMove = function () {
};
startAnim.infoBox.infoText = "DRESS THE NINJA!";
survivalMode = false;
miniGameScore = 10;
dressUpNinja.dressUpNinjaSword._visible = false;
dressUpNinja.dressUpNinjaStar._visible = false;
draggingNinjaMask = false;
ninjaMaskOn = false;
draggingNinjaSword = false;
ninjaSwordOn = false;
draggingNinjaStar = false;
ninjaStarOn = false;
draggingNinjaPants = false;
ninjaPantsOn = false;
draggingNinjaTop = false;
ninjaTopOn = false;
onEnterFrame = function () {
fpsCounter();
gamePausedText._visible = false;
if (sound) {
soundSwitch.gotoAndStop("on");
} else {
soundSwitch.gotoAndStop("off");
}
if (startAnim._currentframe == startAnim._totalframes) {
gameReady = true;
}
if (endAnim._currentframe == endAnim._totalframes) {
gameDone = true;
}
if (fades._currentframe == fades._totalframes) {
faded = true;
}
if (((((gameReady and (!quit)) and (!gamePaused)) and (!miniGameWon)) and (!miniGameOver)) and (!gameOver)) {
gamePausedText._visible = true;
timer._width = timer._width - 4;
if (timer._width <= 0) {
if (!survivalMode) {
core.fail.start(0, 1);
ninjaMask._x = 80;
ninjaMask._y = 110;
ninjaSword._x = 260;
ninjaSword._y = 80;
ninjaStar._x = 430;
ninjaStar._y = 80;
ninjaPants._x = 550;
ninjaPants._y = 150;
ninjaTop._x = 550;
ninjaTop._y = 80;
lives = lives - 1;
timer._width = 0;
if (lives > 0) {
miniGameOver = true;
} else {
gameOver = true;
}
} else {
core.success.start(0, 1);
miniGameWon = true;
}
} else {
if (mousePressed) {
if (ninjaMask.hitTest(_xmouse, _ymouse, true)) {
if ((((!draggingNinjaSword) and (!draggingNinjaStar)) and (!draggingNinjaPants)) and (!draggingNinjaTop)) {
draggingNinjaMask = true;
}
}
if (ninjaSword.hitTest(_xmouse, _ymouse, true)) {
if ((((!draggingNinjaMask) and (!draggingNinjaStar)) and (!draggingNinjaPants)) and (!draggingNinjaTop)) {
draggingNinjaSword = true;
}
}
if (ninjaStar.hitTest(_xmouse, _ymouse, true)) {
if ((((!draggingNinjaMask) and (!draggingNinjaSword)) and (!draggingNinjaPants)) and (!draggingNinjaTop)) {
draggingNinjaStar = true;
}
}
if (ninjaPants.hitTest(_xmouse, _ymouse, true)) {
if ((((!draggingNinjaMask) and (!draggingNinjaSword)) and (!draggingNinjaStar)) and (!draggingNinjaTop)) {
draggingNinjaPants = true;
}
}
if (ninjaTop.hitTest(_xmouse, _ymouse, true)) {
if ((((!draggingNinjaMask) and (!draggingNinjaSword)) and (!draggingNinjaStar)) and (!draggingNinjaPants)) {
draggingNinjaTop = true;
}
}
} else {
draggingNinjaMask = false;
draggingNinjaSword = false;
draggingNinjaStar = false;
draggingNinjaPants = false;
draggingNinjaTop = false;
}
if (draggingNinjaMask) {
ninjaMask._x = _xmouse;
ninjaMask._y = _ymouse;
if (ninjaMask._x < 10) {
ninjaMask._x = 10;
}
if (ninjaMask._x > 630) {
ninjaMask._x = 630;
}
if (ninjaMask._y < 40) {
ninjaMask._y = 40;
}
if (ninjaMask._y > 330) {
ninjaMask._y = 330;
}
}
if (!draggingNinjaMask) {
if (dressUpNinja.hitTest(ninjaMask._x, ninjaMask._y, true)) {
if (!ninjaMaskOn) {
ninjaMaskOn = true;
ninjaMask.play();
core.pickup.start(0, 1);
dressUpNinja.dressUpNinjaHead.play();
dressUpNinjaReflection.dressUpNinjaHead.play();
}
} else {
ninjaMask._x = 80;
ninjaMask._y = 110;
}
}
if (draggingNinjaSword) {
ninjaSword._x = _xmouse;
ninjaSword._y = _ymouse;
if (ninjaSword._x < 10) {
ninjaSword._x = 10;
}
if (ninjaSword._x > 630) {
ninjaSword._x = 630;
}
if (ninjaSword._y < 40) {
ninjaSword._y = 40;
}
if (ninjaSword._y > 330) {
ninjaSword._y = 330;
}
}
if (!draggingNinjaSword) {
if (dressUpNinja.hitTest(ninjaSword._x, ninjaSword._y, true)) {
if (!ninjaSwordOn) {
ninjaSwordOn = true;
ninjaSword.play();
core.pickup.start(0, 1);
dressUpNinja.dressUpNinjaSword._visible = true;
dressUpNinjaReflection.dressUpNinjaSword._visible = true;
}
} else {
ninjaSword._x = 260;
ninjaSword._y = 80;
}
}
if (draggingNinjaStar) {
ninjaStar._x = _xmouse;
ninjaStar._y = _ymouse;
if (ninjaStar._x < 10) {
ninjaStar._x = 10;
}
if (ninjaStar._x > 630) {
ninjaStar._x = 630;
}
if (ninjaStar._y < 40) {
ninjaStar._y = 40;
}
if (ninjaStar._y > 330) {
ninjaStar._y = 330;
}
}
if (!draggingNinjaStar) {
if (dressUpNinja.hitTest(ninjaStar._x, ninjaStar._y, true)) {
if (!ninjaStarOn) {
ninjaStarOn = true;
ninjaStar.play();
core.pickup.start(0, 1);
dressUpNinja.dressUpNinjaStar._visible = true;
dressUpNinjaReflection.dressUpNinjaStar._visible = true;
}
} else {
ninjaStar._x = 430;
ninjaStar._y = 80;
}
}
if (draggingNinjaPants) {
ninjaPants._x = _xmouse;
ninjaPants._y = _ymouse;
if (ninjaPants._x < 10) {
ninjaPants._x = 10;
}
if (ninjaPants._x > 630) {
ninjaPants._x = 630;
}
if (ninjaPants._y < 40) {
ninjaPants._y = 40;
}
if (ninjaPants._y > 330) {
ninjaPants._y = 330;
}
}
if (!draggingNinjaPants) {
if (dressUpNinja.hitTest(ninjaPants._x, ninjaPants._y, true)) {
if (!ninjaPantsOn) {
ninjaPantsOn = true;
ninjaPants.play();
core.pickup.start(0, 1);
dressUpNinja.dressUpNinjaLegLeft.play();
dressUpNinjaReflection.dressUpNinjaLegLeft.play();
dressUpNinja.dressUpNinjaLegRight.play();
dressUpNinjaReflection.dressUpNinjaLegRight.play();
}
} else {
ninjaPants._x = 550;
ninjaPants._y = 150;
}
}
if (draggingNinjaTop) {
ninjaTop._x = _xmouse;
ninjaTop._y = _ymouse;
if (ninjaTop._x < 10) {
ninjaTop._x = 10;
}
if (ninjaTop._x > 630) {
ninjaTop._x = 630;
}
if (ninjaTop._y < 40) {
ninjaTop._y = 40;
}
if (ninjaTop._y > 330) {
ninjaTop._y = 330;
}
}
if (!draggingNinjaTop) {
if (dressUpNinja.hitTest(ninjaTop._x, ninjaTop._y, true)) {
if (!ninjaTopOn) {
ninjaTopOn = true;
ninjaTop.play();
core.pickup.start(0, 1);
dressUpNinja.dressUpNinjaBody.play();
dressUpNinjaReflection.dressUpNinjaBody.play();
dressUpNinja.dressUpNinjaArmLeft.play();
dressUpNinjaReflection.dressUpNinjaArmLeft.play();
dressUpNinja.dressUpNinjaArmRight.play();
dressUpNinjaReflection.dressUpNinjaArmRight.play();
}
} else {
ninjaTop._x = 550;
ninjaTop._y = 80;
}
}
if ((((ninjaMaskOn and ninjaSwordOn) and ninjaStarOn) and ninjaPantsOn) and ninjaTopOn) {
dressUpNinja.play();
dressUpNinjaReflection.play();
core.success.start(0, 1);
miniGameWon = true;
}
}
} else {
if (quit) {
fades.play();
if (faded) {
faded = false;
gotoAndStop ("menu");
}
}
if (miniGameWon) {
if (!survivalMode) {
if (!timeBonusAdded) {
timeBonusAdded = true;
miniGameScore = miniGameScore + Math.round(timer._width / 10);
}
}
if (!scoreAdded) {
if (miniGameScore > 0) {
miniGameScore = miniGameScore - 1;
score = score + 1;
core.jackpot.start(0, 1);
} else {
scoreAdded = true;
miniGameScore = 0;
}
}
if ((!gameDone) and scoreAdded) {
endAnim.infoBox.infoText = "WELL DONE!";
endAnim.play();
}
if (gameDone) {
fades.play();
}
if (faded) {
faded = false;
if (miniGamesCompleted < 21) {
_global.myRoot.gotoAndStop(nextMiniGame);
} else {
_global.myRoot.gotoAndStop("gameWon");
}
}
}
if (miniGameOver) {
if (!gameDone) {
endAnim.infoBox.infoText = "WHOOPS!";
endAnim.play();
}
if (gameDone) {
fades.play();
}
if (faded) {
faded = false;
if (miniGamesCompleted < 21) {
_global.myRoot.gotoAndStop(nextMiniGame);
} else {
_global.myRoot.gotoAndStop("gameWon");
}
}
}
if (gameOver) {
if (!gameDone) {
endAnim.infoBox.infoText = "GAME OVER!";
endAnim.play();
}
if (gameDone) {
fades.play();
}
if (faded) {
faded = false;
gotoAndStop ("gameOver");
}
}
}
};
Instance of Symbol 81 MovieClip in Frame 88
on (keyPress "s") {
if (_global.myRoot.sound) {
_global.myRoot.sound = false;
_global.myRoot.globalSound.setVolume(0);
} else {
_global.myRoot.sound = true;
_global.myRoot.globalSound.setVolume(100);
}
}
on (keyPress "q") {
if (!_global.myRoot.quit) {
_global.myRoot.quit = true;
_global.myRoot.fades.play();
}
}
on (keyPress "<Space>") {
if ((((_global.myRoot.gameReady and (!_global.myRoot.quit)) and (!_global.myRoot.miniGameWon)) and (!_global.myRoot.miniGameOver)) and (!_global.myRoot.gameOver)) {
if (!_global.myRoot.gamePaused) {
_global.myRoot.gamePaused = true;
_global.myRoot.foreground.gotoAndStop("gamePaused");
} else {
_global.myRoot.gamePaused = false;
_global.myRoot.foreground.gotoAndStop("gameReady");
}
}
}
Frame 89
stop();
quit = false;
faded = false;
gameReady = false;
gameDone = false;
gamePaused = false;
miniGameWon = false;
miniGameOver = false;
gameOver = false;
timerRunning = false;
timeBonusAdded = false;
scoreAdded = false;
miniGamesCompleted = miniGamesCompleted + 1;
trace(miniGamesCompleted);
miniGameCounter = miniGamesCompleted;
i = Math.floor(Math.random() * miniGames.length);
nextMiniGame = miniGames[i];
miniGames.splice(i, 1);
mousePressed = false;
onMouseUp = function () {
mousePressed = false;
};
onMouseDown = function () {
mousePressed = true;
};
onMouseMove = function () {
};
colors = new Array();
colors[0] = "BLUE";
colors[1] = "RED";
color = colors[Math.floor(Math.random() * colors.length)];
startAnim.infoBox.infoText = ("SHOOT " + color) + "!";
survivalMode = false;
miniGameScore = 10;
bottleCount = 0;
shaking = false;
bottlePositions = new Array();
bottlePositions[0] = 95;
bottlePositions[1] = 125;
bottlePositions[2] = 155;
bottlePositions[3] = 185;
bottlePositions[4] = 215;
bottlePositions[5] = 245;
bottlePositions[6] = 275;
bottlePositions[7] = 305;
bottlePositions[8] = 335;
bottlePositions[9] = 365;
bottlePositions[10] = 395;
bottlePositions[11] = 425;
bottlePositions[12] = 455;
bottlePositions[13] = 485;
bottlePositions[14] = 515;
bottlePositions[15] = 545;
a = 0;
while (a < 16) {
b = a + 1;
c = Math.floor(Math.random() * bottlePositions.length);
_global.myRoot["bottle" + b]._x = bottlePositions[c];
_global.myRoot[("bottle" + b) + "reflection"]._x = bottlePositions[c];
bottlePositions.splice(c, 1);
a++;
}
onEnterFrame = function () {
fpsCounter();
gamePausedText._visible = false;
if (sound) {
soundSwitch.gotoAndStop("on");
} else {
soundSwitch.gotoAndStop("off");
}
if (startAnim._currentframe == startAnim._totalframes) {
gameReady = true;
}
if (endAnim._currentframe == endAnim._totalframes) {
gameDone = true;
}
if (fades._currentframe == fades._totalframes) {
faded = true;
}
if (shaking) {
_global.myRoot._x = random(5) - 2;
_global.myRoot._y = random(5) - 2;
shakeCount--;
if (shakeCount == 0) {
shaking = false;
_global.myRoot._x = 0;
_global.myRoot._y = 0;
}
}
if (((((gameReady and (!quit)) and (!gamePaused)) and (!miniGameWon)) and (!miniGameOver)) and (!gameOver)) {
gamePausedText._visible = true;
timer._width = timer._width - 4;
if (timer._width <= 0) {
if (!survivalMode) {
core.fail.start(0, 1);
lives = lives - 1;
timer._width = 0;
if (lives > 0) {
miniGameOver = true;
} else {
gameOver = true;
}
} else {
core.success.start(0, 1);
miniGameWon = true;
}
} else {
i = 0;
while (i < 16) {
j = i + 1;
if (_global.myRoot["bottle" + j].hitTest(_xmouse, _ymouse, true)) {
if (mousePressed) {
mousePressed = false;
core.shatter.start(0, 1);
_global.myRoot["bottle" + j].play();
_global.myRoot[("bottle" + j) + "reflection"].play();
d = 0;
while (d < 20) {
p1 = attachMovie("particle", "particle" + (d++), _global.myRoot.getNextHighestDepth());
p1._x = _xmouse;
p1._y = _ymouse;
p1._xscale = (p1._yscale = (Math.random() * 100) + 50);
p1._rotation = random(360);
d++;
}
if (color == "BLUE") {
if ((j % 2) != 0) {
bottleCount = bottleCount + 1;
core.explosion.start(0, 1);
shaking = true;
shakeCount = 10;
} else {
core.fail.start(0, 1);
core.explosion.start(0, 1);
shaking = true;
shakeCount = 10;
lives = lives - 1;
if (lives > 0) {
miniGameOver = true;
} else {
gameOver = true;
}
}
} else if ((j % 2) == 0) {
bottleCount = bottleCount + 1;
core.explosion.start(0, 1);
shaking = true;
shakeCount = 10;
} else {
core.fail.start(0, 1);
core.explosion.start(0, 1);
shaking = true;
shakeCount = 10;
lives = lives - 1;
if (lives > 0) {
miniGameOver = true;
} else {
gameOver = true;
}
}
}
}
i++;
}
if (bottleCount == 8) {
core.success.start(0, 1);
miniGameWon = true;
}
}
} else {
if (quit) {
fades.play();
if (faded) {
faded = false;
gotoAndStop ("menu");
}
}
if (miniGameWon) {
if (!survivalMode) {
if (!timeBonusAdded) {
timeBonusAdded = true;
miniGameScore = miniGameScore + Math.round(timer._width / 10);
}
}
if (!scoreAdded) {
if (miniGameScore > 0) {
miniGameScore = miniGameScore - 1;
score = score + 1;
core.jackpot.start(0, 1);
} else {
scoreAdded = true;
miniGameScore = 0;
}
}
if ((!gameDone) and scoreAdded) {
endAnim.infoBox.infoText = "WELL DONE!";
endAnim.play();
}
if (gameDone) {
fades.play();
}
if (faded) {
faded = false;
if (miniGamesCompleted < 21) {
_global.myRoot.gotoAndStop(nextMiniGame);
} else {
_global.myRoot.gotoAndStop("gameWon");
}
}
}
if (miniGameOver) {
if (!gameDone) {
endAnim.infoBox.infoText = "WHOOPS!";
endAnim.play();
}
if (gameDone) {
fades.play();
}
if (faded) {
faded = false;
if (miniGamesCompleted < 21) {
_global.myRoot.gotoAndStop(nextMiniGame);
} else {
_global.myRoot.gotoAndStop("gameWon");
}
}
}
if (gameOver) {
if (!gameDone) {
endAnim.infoBox.infoText = "GAME OVER!";
endAnim.play();
}
if (gameDone) {
fades.play();
}
if (faded) {
faded = false;
gotoAndStop ("gameOver");
}
}
}
};
Instance of Symbol 81 MovieClip in Frame 89
on (keyPress "s") {
if (_global.myRoot.sound) {
_global.myRoot.sound = false;
_global.myRoot.globalSound.setVolume(0);
} else {
_global.myRoot.sound = true;
_global.myRoot.globalSound.setVolume(100);
}
}
on (keyPress "q") {
if (!_global.myRoot.quit) {
_global.myRoot.quit = true;
_global.myRoot.fades.play();
}
}
on (keyPress "<Space>") {
if ((((_global.myRoot.gameReady and (!_global.myRoot.quit)) and (!_global.myRoot.miniGameWon)) and (!_global.myRoot.miniGameOver)) and (!_global.myRoot.gameOver)) {
if (!_global.myRoot.gamePaused) {
_global.myRoot.gamePaused = true;
_global.myRoot.foreground.gotoAndStop("gamePaused");
} else {
_global.myRoot.gamePaused = false;
_global.myRoot.foreground.gotoAndStop("gameReady");
}
}
}
Frame 90
stop();
quit = false;
faded = false;
gameReady = false;
gameDone = false;
gamePaused = false;
miniGameWon = false;
miniGameOver = false;
gameOver = false;
timerRunning = false;
timeBonusAdded = false;
scoreAdded = false;
miniGamesCompleted = miniGamesCompleted + 1;
trace(miniGamesCompleted);
miniGameCounter = miniGamesCompleted;
i = Math.floor(Math.random() * miniGames.length);
nextMiniGame = miniGames[i];
miniGames.splice(i, 1);
mousePressed = false;
onMouseUp = function () {
mousePressed = false;
};
onMouseDown = function () {
mousePressed = true;
};
onMouseMove = function () {
};
startAnim.infoBox.infoText = "AVOID THE ASTEROIDS";
survivalMode = true;
miniGameScore = 20;
delay = 10;
yPosition = -50;
shakeCount = 10;
shaking = false;
lifeTaken = false;
hitPoints = new Array();
hitPoints.push({x:0, y:-10});
hitPoints.push({x:-15, y:12});
hitPoints.push({x:15, y:12});
i = 0;
while (i < 13) {
j = i + 1;
_global.myRoot["asteroid" + j]._x = random(540) + 50;
_global.myRoot["asteroid" + j]._y = yPosition;
_global.myRoot["asteroid" + j].gotoAndStop(random(5));
yPosition = yPosition - 85;
i++;
}
onEnterFrame = function () {
fpsCounter();
gamePausedText._visible = false;
if (sound) {
soundSwitch.gotoAndStop("on");
} else {
soundSwitch.gotoAndStop("off");
}
if (startAnim._currentframe == startAnim._totalframes) {
gameReady = true;
}
if (endAnim._currentframe == endAnim._totalframes) {
gameDone = true;
}
if (fades._currentframe == fades._totalframes) {
faded = true;
}
distX = _xmouse - player._x;
distY = _ymouse - player._y;
distance = Math.sqrt((distX * distX) + (distY * distY));
angle = Math.atan2(distY, distX);
speed = distance / delay;
xSpeed = speed * Math.cos(angle);
ySpeed = speed * Math.sin(angle);
if (xSpeed > 20) {
xSpeed = 20;
}
if (xSpeed < -20) {
xSpeed = -20;
}
player._x = player._x + xSpeed;
if (player._x < 50) {
player._x = 50;
}
if (player._x > 590) {
player._x = 590;
}
if (shaking) {
_global.myRoot._x = random(5) - 2;
_global.myRoot._y = random(5) - 2;
shakeCount--;
if (shakeCount == 0) {
shaking = false;
_global.myRoot._x = 0;
_global.myRoot._y = 0;
}
}
if (((((gameReady and (!quit)) and (!gamePaused)) and (!miniGameWon)) and (!miniGameOver)) and (!gameOver)) {
gamePausedText._visible = true;
timer._width = timer._width - 4;
if (timer._width <= 0) {
if (!survivalMode) {
core.fail.start(0, 1);
lives = lives - 1;
timer._width = 0;
if (lives > 0) {
miniGameOver = true;
} else {
gameOver = true;
}
} else {
core.success.start(0, 1);
miniGameWon = true;
}
} else {
p = attachMovie("particle", "particle" + (i++), _global.myRoot.getNextHighestDepth());
p._x = player._x;
p._y = player._y + 10;
p._xscale = (p._yscale = (Math.random() * 50) + 20);
p._rotation = 180;
i = 0;
while (i < 13) {
j = i + 1;
_global.myRoot["asteroid" + j]._rotation = _global.myRoot["asteroid" + j]._rotation + (random(10) + 5);
_global.myRoot["asteroid" + j]._y = _global.myRoot["asteroid" + j]._y + 10;
a = 0;
while (a < hitPoints.length) {
if (_global.myRoot["asteroid" + j].hitTest(player._x + hitPoints[a].x, player._y + hitPoints[a].y, true)) {
k = 0;
while (k < 20) {
p = attachMovie("particle", "particle" + (k++), _global.myRoot.getNextHighestDepth());
p._x = player._x;
p._y = player._y;
p._xscale = (p._yscale = (Math.random() * 100) + 50);
p._rotation = random(360);
k++;
}
if (!lifeTaken) {
lifeTaken = true;
core.fail.start(0, 1);
core.explosion.start(0, 1);
shaking = true;
player.play();
lives = lives - 1;
if (lives > 0) {
miniGameOver = true;
} else {
gameOver = true;
}
}
}
a++;
}
i++;
}
}
} else {
if (quit) {
fades.play();
if (faded) {
faded = false;
gotoAndStop ("menu");
}
}
if (miniGameWon) {
if (!survivalMode) {
if (!timeBonusAdded) {
timeBonusAdded = true;
miniGameScore = miniGameScore + Math.round(timer._width / 10);
}
}
if (!scoreAdded) {
if (miniGameScore > 0) {
miniGameScore = miniGameScore - 1;
score = score + 1;
core.jackpot.start(0, 1);
} else {
scoreAdded = true;
miniGameScore = 0;
}
}
if ((!gameDone) and scoreAdded) {
endAnim.infoBox.infoText = "WELL DONE!";
endAnim.play();
}
if (gameDone) {
fades.play();
}
if (faded) {
faded = false;
if (miniGamesCompleted < 21) {
_global.myRoot.gotoAndStop(nextMiniGame);
} else {
_global.myRoot.gotoAndStop("gameWon");
}
}
}
if (miniGameOver) {
if (!gameDone) {
endAnim.infoBox.infoText = "WHOOPS!";
endAnim.play();
}
if (gameDone) {
fades.play();
}
if (faded) {
faded = false;
if (miniGamesCompleted < 21) {
_global.myRoot.gotoAndStop(nextMiniGame);
} else {
_global.myRoot.gotoAndStop("gameWon");
}
}
}
if (gameOver) {
if (!gameDone) {
endAnim.infoBox.infoText = "GAME OVER!";
endAnim.play();
}
if (gameDone) {
fades.play();
}
if (faded) {
faded = false;
gotoAndStop ("gameOver");
}
}
}
};
Instance of Symbol 81 MovieClip in Frame 90
on (keyPress "s") {
if (_global.myRoot.sound) {
_global.myRoot.sound = false;
_global.myRoot.globalSound.setVolume(0);
} else {
_global.myRoot.sound = true;
_global.myRoot.globalSound.setVolume(100);
}
}
on (keyPress "q") {
if (!_global.myRoot.quit) {
_global.myRoot.quit = true;
_global.myRoot.fades.play();
}
}
on (keyPress "<Space>") {
if ((((_global.myRoot.gameReady and (!_global.myRoot.quit)) and (!_global.myRoot.miniGameWon)) and (!_global.myRoot.miniGameOver)) and (!_global.myRoot.gameOver)) {
if (!_global.myRoot.gamePaused) {
_global.myRoot.gamePaused = true;
_global.myRoot.foreground.gotoAndStop("gamePaused");
} else {
_global.myRoot.gamePaused = false;
_global.myRoot.foreground.gotoAndStop("gameReady");
}
}
}
Frame 91
stop();
quit = false;
faded = false;
gameReady = false;
gameDone = false;
gamePaused = false;
miniGameWon = false;
miniGameOver = false;
gameOver = false;
timerRunning = false;
timeBonusAdded = false;
scoreAdded = false;
miniGamesCompleted = miniGamesCompleted + 1;
trace(miniGamesCompleted);
miniGameCounter = miniGamesCompleted;
i = Math.floor(Math.random() * miniGames.length);
nextMiniGame = miniGames[i];
miniGames.splice(i, 1);
startAnim.infoBox.infoText = "CLICK'n'DRAG 2 CONNECT!";
survivalMode = false;
miniGameScore = 10;
connected = new Array();
i = 0;
while (i < 9) {
connected[i] = false;
i++;
}
connected[0] = true;
drawing = false;
mousePressed = false;
onMouseDown = function () {
mousePressed = true;
if (((((gameReady and (!quit)) and (!gamePaused)) and (!miniGameWon)) and (!miniGameOver)) and (!gameOver)) {
createEmptyMovieClip("line", 1);
line.moveTo(_xmouse, _ymouse);
line.lineStyle(5, 16777215, 100);
drawing = true;
onMouseMove = function () {
if ((((_xmouse > 10) and (_xmouse < 630)) and (_ymouse > 40)) and (_ymouse < 330)) {
line.lineTo(_xmouse, _ymouse);
updateAfterEvent();
}
};
}
};
onMouseUp = function () {
mousePressed = false;
onMouseMove = null;
drawing = false;
a = 0;
while (a < 9) {
b = a + 1;
if (!miniGameWon) {
_global.myRoot["dot" + b].gotoAndStop(1);
connected[a] = false;
}
a++;
}
connected[0] = true;
line.removeMovieClip();
};
onMouseMove = function () {
};
onEnterFrame = function () {
fpsCounter();
gamePausedText._visible = false;
if (sound) {
soundSwitch.gotoAndStop("on");
} else {
soundSwitch.gotoAndStop("off");
}
if (startAnim._currentframe == startAnim._totalframes) {
gameReady = true;
}
if (endAnim._currentframe == endAnim._totalframes) {
gameDone = true;
}
if (fades._currentframe == fades._totalframes) {
faded = true;
}
if (((((gameReady and (!quit)) and (!gamePaused)) and (!miniGameWon)) and (!miniGameOver)) and (!gameOver)) {
gamePausedText._visible = true;
timer._width = timer._width - 4;
if (timer._width <= 0) {
if (!survivalMode) {
core.fail.start(0, 1);
lives = lives - 1;
timer._width = 0;
line.removeMovieClip();
a = 0;
while (a < 9) {
b = a + 1;
_global.myRoot["dot" + b].gotoAndStop(1);
connected[a] = false;
a++;
}
if (lives > 0) {
miniGameOver = true;
} else {
gameOver = true;
}
} else {
core.success.start(0, 1);
miniGameWon = true;
}
} else {
i = 0;
while (i < 9) {
j = i + 1;
if (drawing and _global.myRoot["dot" + j].hitTest(_xmouse, _ymouse, true)) {
if (connected[i]) {
if (!connected[j]) {
d = 0;
while (d < 20) {
p = attachMovie("particle", "particle" + (i++), _global.myRoot.getNextHighestDepth());
p._x = _xmouse;
p._y = _ymouse;
p._xscale = (p._yscale = (Math.random() * 100) + 10);
p._rotation = random(360);
d++;
}
_global.myRoot["dot" + j].play();
core.pickup.start(0, 1);
}
connected[j] = true;
trace(connected[j]);
} else {
line.removeMovieClip();
a = 0;
while (a < 9) {
b = a + 1;
_global.myRoot["dot" + b].gotoAndStop(1);
connected[a] = false;
a++;
}
connected[0] = true;
core.buzzer.start(0, 1);
drawing = false;
}
}
i++;
}
if (connected[8]) {
i = 0;
while (i < 9) {
j = i + 1;
root["dot" + j].play();
i++;
}
ninjaStar.play();
line.removeMovieClip();
core.success.start(0, 1);
miniGameWon = true;
}
}
} else {
if (quit) {
fades.play();
if (faded) {
faded = false;
gotoAndStop ("menu");
}
}
if (miniGameWon) {
if (!survivalMode) {
if (!timeBonusAdded) {
timeBonusAdded = true;
miniGameScore = miniGameScore + Math.round(timer._width / 10);
}
}
if (!scoreAdded) {
if (miniGameScore > 0) {
miniGameScore = miniGameScore - 1;
score = score + 1;
core.jackpot.start(0, 1);
} else {
scoreAdded = true;
miniGameScore = 0;
}
}
if ((!gameDone) and scoreAdded) {
endAnim.infoBox.infoText = "WELL DONE!";
endAnim.play();
}
if (gameDone) {
fades.play();
}
if (faded) {
faded = false;
if (miniGamesCompleted < 21) {
_global.myRoot.gotoAndStop(nextMiniGame);
} else {
_global.myRoot.gotoAndStop("gameWon");
}
}
}
if (miniGameOver) {
if (!gameDone) {
endAnim.infoBox.infoText = "WHOOPS!";
endAnim.play();
}
if (gameDone) {
fades.play();
}
if (faded) {
faded = false;
if (miniGamesCompleted < 21) {
_global.myRoot.gotoAndStop(nextMiniGame);
} else {
_global.myRoot.gotoAndStop("gameWon");
}
}
}
if (gameOver) {
if (!gameDone) {
endAnim.infoBox.infoText = "GAME OVER!";
endAnim.play();
}
if (gameDone) {
fades.play();
}
if (faded) {
faded = false;
gotoAndStop ("gameOver");
}
}
}
};
Instance of Symbol 81 MovieClip in Frame 91
on (keyPress "s") {
if (_global.myRoot.sound) {
_global.myRoot.sound = false;
_global.myRoot.globalSound.setVolume(0);
} else {
_global.myRoot.sound = true;
_global.myRoot.globalSound.setVolume(100);
}
}
on (keyPress "q") {
if (!_global.myRoot.quit) {
_global.myRoot.quit = true;
_global.myRoot.fades.play();
}
}
on (keyPress "<Space>") {
if ((((_global.myRoot.gameReady and (!_global.myRoot.quit)) and (!_global.myRoot.miniGameWon)) and (!_global.myRoot.miniGameOver)) and (!_global.myRoot.gameOver)) {
if (!_global.myRoot.gamePaused) {
_global.myRoot.gamePaused = true;
_global.myRoot.foreground.gotoAndStop("gamePaused");
} else {
_global.myRoot.gamePaused = false;
_global.myRoot.foreground.gotoAndStop("gameReady");
}
}
}
Frame 92
stop();
quit = false;
faded = false;
gameReady = false;
gameDone = false;
gamePaused = false;
miniGameWon = false;
miniGameOver = false;
gameOver = false;
timerRunning = false;
timeBonusAdded = false;
scoreAdded = false;
miniGamesCompleted = miniGamesCompleted + 1;
trace(miniGamesCompleted);
miniGameCounter = miniGamesCompleted;
i = Math.floor(Math.random() * miniGames.length);
nextMiniGame = miniGames[i];
miniGames.splice(i, 1);
mousePressed = false;
onMouseDown = function () {
mousePressed = true;
};
onMouseMove = function () {
};
startAnim.infoBox.infoText = "CLICK TOWARDS EXIT!";
survivalMode = false;
miniGameScore = 10;
lastX = player._x;
lastY = player._y;
cross._visible = false;
delay = 10;
ballSpeed = 0;
ballSpeedLimit = 10;
lifeTaken = false;
onMouseUp = function () {
mousePressed = false;
if (((((gameReady and (!quit)) and (!gamePaused)) and (!miniGameWon)) and (!miniGameOver)) and (!gameOver)) {
lastX = _xmouse;
lastY = _ymouse;
cross._visible = true;
cross._x = lastX;
cross._y = lastY;
}
};
onEnterFrame = function () {
gamePausedText._visible = false;
if (sound) {
soundSwitch.gotoAndStop("on");
} else {
soundSwitch.gotoAndStop("off");
}
if (startAnim._currentframe == startAnim._totalframes) {
gameReady = true;
}
if (endAnim._currentframe == endAnim._totalframes) {
gameDone = true;
}
if (fades._currentframe == fades._totalframes) {
faded = true;
}
if (((((gameReady and (!quit)) and (!gamePaused)) and (!miniGameWon)) and (!miniGameOver)) and (!gameOver)) {
gamePausedText._visible = true;
timer._width = timer._width - 4;
if (timer._width <= 0) {
if (!survivalMode) {
core.fail.start(0, 1);
lives = lives - 1;
timer._width = 0;
if (lives > 0) {
miniGameOver = true;
} else {
gameOver = true;
}
} else {
core.success.start(0, 1);
miniGameWon = true;
}
}
distX = lastX - player._x;
distY = lastY - player._y;
distance = Math.sqrt((distX * distX) + (distY * distY));
angle = Math.atan2(distY, distX);
speed = distance / delay;
xSpeed = speed * Math.cos(angle);
ySpeed = speed * Math.sin(angle);
player._x = player._x + xSpeed;
player._y = player._y + ySpeed;
playerReflection._x = player._x;
playerReflection._y = player._y + 10;
if (hitMap.hitTest(player._x, player._y, true)) {
if (!lifeTaken) {
lifeTaken = true;
core.fail.start(0, 1);
lives = lives - 1;
if (lives > 0) {
miniGameOver = true;
} else {
gameOver = true;
}
}
}
if (hole.hitTest(player._x, player._y, true)) {
player._x = 580;
player._y = 275;
player.play();
core.golf.start(0, 1);
core.success.start(0, 1);
miniGameWon = true;
}
} else {
if (quit) {
fades.play();
if (faded) {
faded = false;
gotoAndStop ("menu");
}
}
if (miniGameWon) {
if (!survivalMode) {
if (!timeBonusAdded) {
timeBonusAdded = true;
miniGameScore = miniGameScore + Math.round(timer._width / 10);
}
}
if (!scoreAdded) {
if (miniGameScore > 0) {
miniGameScore = miniGameScore - 1;
score = score + 1;
core.jackpot.start(0, 1);
} else {
scoreAdded = true;
miniGameScore = 0;
}
}
if ((!gameDone) and scoreAdded) {
endAnim.infoBox.infoText = "WELL DONE!";
endAnim.play();
}
if (gameDone) {
fades.play();
}
if (faded) {
faded = false;
if (miniGamesCompleted < 21) {
_global.myRoot.gotoAndStop(nextMiniGame);
} else {
_global.myRoot.gotoAndStop("gameWon");
}
}
}
if (miniGameOver) {
if (!gameDone) {
endAnim.infoBox.infoText = "WHOOPS!";
endAnim.play();
}
if (gameDone) {
fades.play();
}
if (faded) {
faded = false;
if (miniGamesCompleted < 21) {
_global.myRoot.gotoAndStop(nextMiniGame);
} else {
_global.myRoot.gotoAndStop("gameWon");
}
}
}
if (gameOver) {
if (!gameDone) {
endAnim.infoBox.infoText = "GAME OVER!";
endAnim.play();
}
if (gameDone) {
fades.play();
}
if (faded) {
faded = false;
gotoAndStop ("gameOver");
}
}
}
};
Instance of Symbol 81 MovieClip in Frame 92
on (keyPress "s") {
if (_global.myRoot.sound) {
_global.myRoot.sound = false;
_global.myRoot.globalSound.setVolume(0);
} else {
_global.myRoot.sound = true;
_global.myRoot.globalSound.setVolume(100);
}
}
on (keyPress "q") {
if (!_global.myRoot.quit) {
_global.myRoot.quit = true;
_global.myRoot.fades.play();
}
}
on (keyPress "<Space>") {
if ((((_global.myRoot.gameReady and (!_global.myRoot.quit)) and (!_global.myRoot.miniGameWon)) and (!_global.myRoot.miniGameOver)) and (!_global.myRoot.gameOver)) {
if (!_global.myRoot.gamePaused) {
_global.myRoot.gamePaused = true;
_global.myRoot.foreground.gotoAndStop("gamePaused");
} else {
_global.myRoot.gamePaused = false;
_global.myRoot.foreground.gotoAndStop("gameReady");
}
}
}
Frame 93
stop();
quit = false;
faded = false;
gameReady = false;
gameDone = false;
gamePaused = false;
miniGameWon = false;
miniGameOver = false;
gameOver = false;
timerRunning = false;
timeBonusAdded = false;
scoreAdded = false;
miniGamesCompleted = miniGamesCompleted + 1;
trace(miniGamesCompleted);
miniGameCounter = miniGamesCompleted;
i = Math.floor(Math.random() * miniGames.length);
nextMiniGame = miniGames[i];
miniGames.splice(i, 1);
mousePressed = false;
onMouseUp = function () {
mousePressed = false;
};
onMouseDown = function () {
mousePressed = true;
};
onMouseMove = function () {
};
startAnim.infoBox.infoText = "DRAG SQUARE TO EXIT!";
survivalMode = false;
miniGameScore = 10;
dragging = false;
shaking = false;
lifeTaken = false;
onEnterFrame = function () {
gamePausedText._visible = false;
if (sound) {
soundSwitch.gotoAndStop("on");
} else {
soundSwitch.gotoAndStop("off");
}
if (startAnim._currentframe == startAnim._totalframes) {
gameReady = true;
}
if (endAnim._currentframe == endAnim._totalframes) {
gameDone = true;
}
if (fades._currentframe == fades._totalframes) {
faded = true;
}
if (shaking) {
_global.myRoot._x = random(5) - 2;
_global.myRoot._y = random(5) - 2;
shakeCount--;
if (shakeCount == 0) {
shaking = false;
_global.myRoot._x = 0;
_global.myRoot._y = 0;
}
}
if (((((gameReady and (!quit)) and (!gamePaused)) and (!miniGameWon)) and (!miniGameOver)) and (!gameOver)) {
gamePausedText._visible = true;
timer._width = timer._width - 4;
if (timer._width <= 0) {
if (!survivalMode) {
core.fail.start(0, 1);
lives = lives - 1;
timer._width = 0;
if (lives > 0) {
miniGameOver = true;
} else {
gameOver = true;
}
} else {
core.success.start(0, 1);
miniGameWon = true;
}
} else {
if (mousePressed) {
if (player.hitTest(_xmouse, _ymouse, true)) {
dragging = true;
}
} else {
dragging = false;
}
if (dragging) {
player._x = _xmouse;
player._y = _ymouse;
}
if (hitmap.hitTest(player._x, player._y, true)) {
player.play();
d = 0;
while (d < 20) {
p = attachMovie("particle", "particle" + (i++), _global.myRoot.getNextHighestDepth());
p._x = _xmouse;
p._y = _ymouse;
p._xscale = (p._yscale = (Math.random() * 100) + 50);
p._rotation = random(360);
d++;
}
if (!lifeTaken) {
lifeTaken = true;
core.fail.start(0, 1);
core.explosion.start(0, 1);
shaking = true;
shakeCount = 10;
lives = lives - 1;
if (lives > 0) {
miniGameOver = true;
} else {
gameOver = true;
}
}
}
if (exit.hitTest(player)) {
mousePressed = false;
player._x = 580;
player._y = 185;
core.success.start(0, 1);
miniGameWon = true;
}
}
} else {
if (quit) {
fades.play();
if (faded) {
faded = false;
gotoAndStop ("menu");
}
}
if (miniGameWon) {
if (!survivalMode) {
if (!timeBonusAdded) {
timeBonusAdded = true;
miniGameScore = miniGameScore + Math.round(timer._width / 10);
}
}
if (!scoreAdded) {
if (miniGameScore > 0) {
miniGameScore = miniGameScore - 1;
score = score + 1;
core.jackpot.start(0, 1);
} else {
scoreAdded = true;
miniGameScore = 0;
}
}
if ((!gameDone) and scoreAdded) {
endAnim.infoBox.infoText = "WELL DONE!";
endAnim.play();
}
if (gameDone) {
fades.play();
}
if (faded) {
faded = false;
if (miniGamesCompleted < 21) {
_global.myRoot.gotoAndStop(nextMiniGame);
} else {
_global.myRoot.gotoAndStop("gameWon");
}
}
}
if (miniGameOver) {
if (!gameDone) {
endAnim.infoBox.infoText = "WHOOPS!";
endAnim.play();
}
if (gameDone) {
fades.play();
}
if (faded) {
faded = false;
if (miniGamesCompleted < 21) {
_global.myRoot.gotoAndStop(nextMiniGame);
} else {
_global.myRoot.gotoAndStop("gameWon");
}
}
}
if (gameOver) {
if (!gameDone) {
endAnim.infoBox.infoText = "GAME OVER!";
endAnim.play();
}
if (gameDone) {
fades.play();
}
if (faded) {
faded = false;
gotoAndStop ("gameOver");
}
}
}
};
Instance of Symbol 81 MovieClip in Frame 93
on (keyPress "s") {
if (_global.myRoot.sound) {
_global.myRoot.sound = false;
_global.myRoot.globalSound.setVolume(0);
} else {
_global.myRoot.sound = true;
_global.myRoot.globalSound.setVolume(100);
}
}
on (keyPress "q") {
if (!_global.myRoot.quit) {
_global.myRoot.quit = true;
_global.myRoot.fades.play();
}
}
on (keyPress "<Space>") {
if ((((_global.myRoot.gameReady and (!_global.myRoot.quit)) and (!_global.myRoot.miniGameWon)) and (!_global.myRoot.miniGameOver)) and (!_global.myRoot.gameOver)) {
if (!_global.myRoot.gamePaused) {
_global.myRoot.gamePaused = true;
_global.myRoot.foreground.gotoAndStop("gamePaused");
} else {
_global.myRoot.gamePaused = false;
_global.myRoot.foreground.gotoAndStop("gameReady");
}
}
}
Frame 94
stop();
quit = false;
faded = false;
gameReady = false;
gameDone = false;
gamePaused = false;
miniGameWon = false;
miniGameOver = false;
gameOver = false;
timerRunning = false;
timeBonusAdded = false;
scoreAdded = false;
miniGamesCompleted = miniGamesCompleted + 1;
trace(miniGamesCompleted);
miniGameCounter = miniGamesCompleted;
i = Math.floor(Math.random() * miniGames.length);
nextMiniGame = miniGames[i];
miniGames.splice(i, 1);
mousePressed = false;
onMouseUp = function () {
mousePressed = false;
};
onMouseDown = function () {
mousePressed = true;
};
onMouseMove = function () {
};
startAnim.infoBox.infoText = "CLICK TO JUMP!";
survivalMode = true;
miniGameScore = 20;
delay = 20;
lifeTaken = false;
alive = true;
shaking = false;
shakeCount = 10;
player._visible = true;
onEnterFrame = function () {
gamePausedText._visible = false;
if (sound) {
soundSwitch.gotoAndStop("on");
} else {
soundSwitch.gotoAndStop("off");
}
if (startAnim._currentframe == startAnim._totalframes) {
gameReady = true;
}
if (endAnim._currentframe == endAnim._totalframes) {
gameDone = true;
}
if (fades._currentframe == fades._totalframes) {
faded = true;
}
if (alive) {
distX = _xmouse - player._x;
distY = _ymouse - player._y;
distance = Math.sqrt((distX * distX) + (distY * distY));
angle = Math.atan2(distY, distX);
speed = distance / delay;
xSpeed = speed * Math.cos(angle);
ySpeed = speed * Math.sin(angle);
player._x = player._x + xSpeed;
mountains._x = mountains._x - 1;
if (mousePressed) {
player.play();
if (player._currentframe == 1) {
core.bounce.start(0, 1);
}
mousePressed = false;
}
}
if (shaking) {
_global.myRoot._x = random(5) - 2;
_global.myRoot._y = random(5) - 2;
shakeCount--;
if (shakeCount == 0) {
shaking = false;
_global.myRoot._x = 0;
_global.myRoot._y = 0;
}
}
if (((((gameReady and (!quit)) and (!gamePaused)) and (!miniGameWon)) and (!miniGameOver)) and (!gameOver)) {
gamePausedText._visible = true;
timer._width = timer._width - 4;
if (timer._width <= 0) {
if (!survivalMode) {
core.fail.start(0, 1);
lives = lives - 1;
timer._width = 0;
if (lives > 0) {
miniGameOver = true;
} else {
gameOver = true;
}
} else {
core.success.start(0, 1);
miniGameWon = true;
}
} else {
hole._x = hole._x - 10;
if (hole.hitTest(player._x + 30, player._y, true) or hole.hitTest(player._x - 30, player._y, true)) {
if ((player._currentframe < 5) or (player._currentframe > 26)) {
i = 0;
while (i < 40) {
p1 = attachMovie("particle", "particle" + (i++), _global.myRoot.getNextHighestDepth());
p1._x = player._x;
p1._y = player._y;
p1._xscale = (p1._yscale = (Math.random() * 100) + 100);
p1._rotation = random(360);
i++;
}
if (!lifeTaken) {
alive = false;
lifeTaken = true;
player._visible = false;
core.fail.start(0, 1);
core.explosion.start(0, 1);
shaking = true;
lives = lives - 1;
if (lives > 0) {
miniGameOver = true;
} else {
gameOver = true;
}
}
}
}
}
} else {
if (quit) {
fades.play();
if (faded) {
faded = false;
gotoAndStop ("menu");
}
}
if (miniGameWon) {
if (!survivalMode) {
if (!timeBonusAdded) {
timeBonusAdded = true;
miniGameScore = miniGameScore + Math.round(timer._width / 10);
}
}
if (!scoreAdded) {
if (miniGameScore > 0) {
miniGameScore = miniGameScore - 1;
score = score + 1;
core.jackpot.start(0, 1);
} else {
scoreAdded = true;
miniGameScore = 0;
}
}
if ((!gameDone) and scoreAdded) {
endAnim.infoBox.infoText = "WELL DONE!";
endAnim.play();
}
if (gameDone) {
fades.play();
}
if (faded) {
faded = false;
if (miniGamesCompleted < 21) {
_global.myRoot.gotoAndStop(nextMiniGame);
} else {
_global.myRoot.gotoAndStop("gameWon");
}
}
}
if (miniGameOver) {
if (!gameDone) {
endAnim.infoBox.infoText = "WHOOPS!";
endAnim.play();
}
if (gameDone) {
fades.play();
}
if (faded) {
faded = false;
if (miniGamesCompleted < 21) {
_global.myRoot.gotoAndStop(nextMiniGame);
} else {
_global.myRoot.gotoAndStop("gameWon");
}
}
}
if (gameOver) {
if (!gameDone) {
endAnim.infoBox.infoText = "GAME OVER!";
endAnim.play();
}
if (gameDone) {
fades.play();
}
if (faded) {
faded = false;
gotoAndStop ("gameOver");
}
}
}
};
Instance of Symbol 81 MovieClip in Frame 94
on (keyPress "s") {
if (_global.myRoot.sound) {
_global.myRoot.sound = false;
_global.myRoot.globalSound.setVolume(0);
} else {
_global.myRoot.sound = true;
_global.myRoot.globalSound.setVolume(100);
}
}
on (keyPress "q") {
if (!_global.myRoot.quit) {
_global.myRoot.quit = true;
_global.myRoot.fades.play();
}
}
on (keyPress "<Space>") {
if ((((_global.myRoot.gameReady and (!_global.myRoot.quit)) and (!_global.myRoot.miniGameWon)) and (!_global.myRoot.miniGameOver)) and (!_global.myRoot.gameOver)) {
if (!_global.myRoot.gamePaused) {
_global.myRoot.gamePaused = true;
_global.myRoot.foreground.gotoAndStop("gamePaused");
} else {
_global.myRoot.gamePaused = false;
_global.myRoot.foreground.gotoAndStop("gameReady");
}
}
}
Frame 95
stop();
quit = false;
faded = false;
gameReady = false;
gameDone = false;
gamePaused = false;
miniGameWon = false;
miniGameOver = false;
gameOver = false;
timerRunning = false;
timeBonusAdded = false;
scoreAdded = false;
miniGamesCompleted = miniGamesCompleted + 1;
trace(miniGamesCompleted);
miniGameCounter = miniGamesCompleted;
i = Math.floor(Math.random() * miniGames.length);
nextMiniGame = miniGames[i];
miniGames.splice(i, 1);
mousePressed = false;
onMouseUp = function () {
mousePressed = false;
};
onMouseDown = function () {
mousePressed = true;
};
onMouseMove = function () {
};
startAnim.infoBox.infoText = "FLY & COLLECT!";
survivalMode = false;
miniGameScore = 10;
delay = 7;
starsCollected = new Array();
i = 0;
while (i < 18) {
starsCollected[i] = false;
i++;
}
starCount = 0;
hitPoints = new Array();
hitPoints.push({x:0, y:-10});
hitPoints.push({x:-15, y:12});
hitPoints.push({x:15, y:12});
onEnterFrame = function () {
gamePausedText._visible = false;
if (sound) {
soundSwitch.gotoAndStop("on");
} else {
soundSwitch.gotoAndStop("off");
}
if (startAnim._currentframe == startAnim._totalframes) {
gameReady = true;
}
if (endAnim._currentframe == endAnim._totalframes) {
gameDone = true;
}
if (fades._currentframe == fades._totalframes) {
faded = true;
}
distX = _xmouse - player._x;
distY = _ymouse - player._y;
distance = Math.sqrt((distX * distX) + (distY * distY));
angle = Math.atan2(distY, distX);
speed = distance / delay;
xSpeed = speed * Math.cos(angle);
ySpeed = speed * Math.sin(angle);
player._x = player._x + xSpeed;
player._y = player._y + ySpeed;
player._rotation = ((angle * 180) / Math.PI) + 90;
if (player._x < 20) {
player._x = 20;
}
if (player._x > 620) {
player._x = 620;
}
if (player._y < 50) {
player._y = 50;
}
if (player._y > 320) {
player._y = 320;
}
p = attachMovie("particleShip", "particleShip" + (i++), _global.myRoot.getNextHighestDepth());
p._x = player._x;
p._y = player._y;
p._xscale = (p._yscale = (Math.random() * 50) + 20);
p._rotation = (angle * 180) / Math.PI;
if (((((gameReady and (!quit)) and (!gamePaused)) and (!miniGameWon)) and (!miniGameOver)) and (!gameOver)) {
gamePausedText._visible = true;
timer._width = timer._width - 4;
if (timer._width <= 0) {
if (!survivalMode) {
core.fail.start(0, 1);
lives = lives - 1;
timer._width = 0;
if (lives > 0) {
miniGameOver = true;
} else {
gameOver = true;
}
} else {
core.success.start(0, 1);
miniGameWon = true;
}
} else {
i = 0;
while (i < 16) {
j = i + 1;
if (_global.myRoot["star" + j].hitTest(player)) {
if (!starsCollected[i]) {
_global.myRoot["star" + j].play();
starsCollected[i] = true;
starCount = starCount + 1;
core.pickup.start(0, 1);
}
}
i++;
}
if (starCount == 16) {
core.success.start(0, 1);
miniGameWon = true;
}
}
} else {
if (quit) {
fades.play();
if (faded) {
faded = false;
gotoAndStop ("menu");
}
}
if (miniGameWon) {
if (!survivalMode) {
if (!timeBonusAdded) {
timeBonusAdded = true;
miniGameScore = miniGameScore + Math.round(timer._width / 10);
}
}
if (!scoreAdded) {
if (miniGameScore > 0) {
miniGameScore = miniGameScore - 1;
score = score + 1;
core.jackpot.start(0, 1);
} else {
scoreAdded = true;
miniGameScore = 0;
}
}
if ((!gameDone) and scoreAdded) {
endAnim.infoBox.infoText = "WELL DONE!";
endAnim.play();
}
if (gameDone) {
fades.play();
}
if (faded) {
faded = false;
if (miniGamesCompleted < 21) {
_global.myRoot.gotoAndStop(nextMiniGame);
} else {
_global.myRoot.gotoAndStop("gameWon");
}
}
}
if (miniGameOver) {
if (!gameDone) {
endAnim.infoBox.infoText = "WHOOPS!";
endAnim.play();
}
if (gameDone) {
fades.play();
}
if (faded) {
faded = false;
if (miniGamesCompleted < 21) {
_global.myRoot.gotoAndStop(nextMiniGame);
} else {
_global.myRoot.gotoAndStop("gameWon");
}
}
}
if (gameOver) {
if (!gameDone) {
endAnim.infoBox.infoText = "GAME OVER!";
endAnim.play();
}
if (gameDone) {
fades.play();
}
if (faded) {
faded = false;
gotoAndStop ("gameOver");
}
}
}
};
Instance of Symbol 81 MovieClip in Frame 95
on (keyPress "s") {
if (_global.myRoot.sound) {
_global.myRoot.sound = false;
_global.myRoot.globalSound.setVolume(0);
} else {
_global.myRoot.sound = true;
_global.myRoot.globalSound.setVolume(100);
}
}
on (keyPress "q") {
if (!_global.myRoot.quit) {
_global.myRoot.quit = true;
_global.myRoot.fades.play();
}
}
on (keyPress "<Space>") {
if ((((_global.myRoot.gameReady and (!_global.myRoot.quit)) and (!_global.myRoot.miniGameWon)) and (!_global.myRoot.miniGameOver)) and (!_global.myRoot.gameOver)) {
if (!_global.myRoot.gamePaused) {
_global.myRoot.gamePaused = true;
_global.myRoot.foreground.gotoAndStop("gamePaused");
} else {
_global.myRoot.gamePaused = false;
_global.myRoot.foreground.gotoAndStop("gameReady");
}
}
}
Frame 96
stop();
quit = false;
faded = false;
gameReady = false;
gameDone = false;
gamePaused = false;
miniGameWon = false;
miniGameOver = false;
gameOver = false;
timerRunning = false;
timeBonusAdded = false;
scoreAdded = false;
miniGamesCompleted = miniGamesCompleted + 1;
trace(miniGamesCompleted);
miniGameCounter = miniGamesCompleted;
xSpot._visible = true;
i = Math.floor(Math.random() * miniGames.length);
nextMiniGame = miniGames[i];
miniGames.splice(i, 1);
mousePressed = false;
onMouseDown = function () {
mousePressed = true;
};
onMouseMove = function () {
};
startAnim.infoBox.infoText = "GET KNIGHT TO X!";
survivalMode = false;
miniGameScore = 10;
knight._y = 110;
i = 0;
while (i < 9) {
j = i + 1;
_global.myRoot["check" + j].checkOutline._visible = false;
i++;
}
knightPosition = new Array();
knightPosition[0] = 240;
knightPosition[1] = 400;
i = 0;
while (i < 2) {
j = i + 1;
k = Math.floor(Math.random() * knightPosition.length);
knight._x = knightPosition[k];
if (knight._x == 240) {
xSpot._x = 400;
} else {
xSpot._x = 240;
}
i++;
}
onMouseUp = function () {
mousePressed = false;
if (((((gameReady and (!quit)) and (!gamePaused)) and (!miniGameWon)) and (!miniGameOver)) and (!gameOver)) {
if (check1.hitTest(knight)) {
if (check6.hitTest(_xmouse, _ymouse, true)) {
knight._x = 400;
knight._y = 190;
core.counter.start(0, 1);
} else if (check8.hitTest(_xmouse, _ymouse, true)) {
knight._x = 320;
knight._y = 270;
core.counter.start(0, 1);
} else {
core.buzzer.start(0, 1);
mousePressed = false;
}
} else if (check2.hitTest(knight)) {
if (check7.hitTest(_xmouse, _ymouse, true)) {
knight._x = 250;
knight._y = 270;
core.counter.start(0, 1);
} else if (check9.hitTest(_xmouse, _ymouse, true)) {
knight._x = 400;
knight._y = 270;
core.counter.start(0, 1);
} else {
core.buzzer.start(0, 1);
mousePressed = false;
}
} else if (check3.hitTest(knight)) {
if (check4.hitTest(_xmouse, _ymouse, true)) {
knight._x = 240;
knight._y = 190;
core.counter.start(0, 1);
} else if (check8.hitTest(_xmouse, _ymouse, true)) {
knight._x = 320;
knight._y = 270;
core.counter.start(0, 1);
} else {
core.buzzer.start(0, 1);
mousePressed = false;
}
} else if (check4.hitTest(knight)) {
if (check3.hitTest(_xmouse, _ymouse, true)) {
knight._x = 400;
knight._y = 110;
core.counter.start(0, 1);
} else if (check9.hitTest(_xmouse, _ymouse, true)) {
knight._x = 400;
knight._y = 270;
core.counter.start(0, 1);
} else {
core.buzzer.start(0, 1);
mousePressed = false;
}
} else if (check6.hitTest(knight)) {
if (check1.hitTest(_xmouse, _ymouse, true)) {
knight._x = 240;
knight._y = 110;
core.counter.start(0, 1);
} else if (check7.hitTest(_xmouse, _ymouse, true)) {
knight._x = 240;
knight._y = 270;
core.counter.start(0, 1);
} else {
core.buzzer.start(0, 1);
mousePressed = false;
}
} else if (check7.hitTest(knight)) {
if (check2.hitTest(_xmouse, _ymouse, true)) {
knight._x = 320;
knight._y = 110;
core.counter.start(0, 1);
} else if (check6.hitTest(_xmouse, _ymouse, true)) {
knight._x = 400;
knight._y = 190;
core.counter.start(0, 1);
} else {
core.buzzer.start(0, 1);
mousePressed = false;
}
} else if (check8.hitTest(knight)) {
if (check1.hitTest(_xmouse, _ymouse, true)) {
knight._x = 240;
knight._y = 110;
core.counter.start(0, 1);
} else if (check3.hitTest(_xmouse, _ymouse, true)) {
knight._x = 400;
knight._y = 110;
core.counter.start(0, 1);
} else {
core.buzzer.start(0, 1);
mousePressed = false;
}
} else if (check9.hitTest(knight)) {
if (check2.hitTest(_xmouse, _ymouse, true)) {
knight._x = 320;
knight._y = 110;
core.counter.start(0, 1);
} else if (check4.hitTest(_xmouse, _ymouse, true)) {
knight._x = 240;
knight._y = 190;
core.counter.start(0, 1);
} else {
core.buzzer.start(0, 1);
mousePressed = false;
}
}
if (xSpot.hitTest(knight)) {
core.success.start(0, 1);
miniGameWon = true;
xSpot._visible = false;
}
}
};
onEnterFrame = function () {
gamePausedText._visible = false;
if (sound) {
soundSwitch.gotoAndStop("on");
} else {
soundSwitch.gotoAndStop("off");
}
if (startAnim._currentframe == startAnim._totalframes) {
gameReady = true;
}
if (endAnim._currentframe == endAnim._totalframes) {
gameDone = true;
}
if (fades._currentframe == fades._totalframes) {
faded = true;
}
if (((((gameReady and (!quit)) and (!gamePaused)) and (!miniGameWon)) and (!miniGameOver)) and (!gameOver)) {
gamePausedText._visible = true;
timer._width = timer._width - 4;
if (timer._width <= 0) {
if (!survivalMode) {
core.fail.start(0, 1);
lives = lives - 1;
timer._width = 0;
if (lives > 0) {
miniGameOver = true;
} else {
gameOver = true;
}
} else {
core.success.start(0, 1);
miniGameWon = true;
}
}
i = 0;
while (i < 9) {
j = i + 1;
if (_global.myRoot["check" + j].hitTest(_xmouse, _ymouse, true)) {
_global.myRoot["check" + j].checkOutline._visible = true;
} else {
_global.myRoot["check" + j].checkOutline._visible = false;
}
i++;
}
} else {
if (quit) {
fades.play();
if (faded) {
faded = false;
gotoAndStop ("menu");
}
}
if (miniGameWon) {
if (!survivalMode) {
if (!timeBonusAdded) {
timeBonusAdded = true;
miniGameScore = miniGameScore + Math.round(timer._width / 10);
}
}
if (!scoreAdded) {
if (miniGameScore > 0) {
miniGameScore = miniGameScore - 1;
score = score + 1;
core.jackpot.start(0, 1);
} else {
scoreAdded = true;
miniGameScore = 0;
}
}
if ((!gameDone) and scoreAdded) {
endAnim.infoBox.infoText = "WELL DONE!";
endAnim.play();
}
if (gameDone) {
fades.play();
}
if (faded) {
faded = false;
if (miniGamesCompleted < 21) {
_global.myRoot.gotoAndStop(nextMiniGame);
} else {
_global.myRoot.gotoAndStop("gameWon");
}
}
}
if (miniGameOver) {
if (!gameDone) {
endAnim.infoBox.infoText = "WHOOPS!";
endAnim.play();
}
if (gameDone) {
fades.play();
}
if (faded) {
faded = false;
if (miniGamesCompleted < 21) {
_global.myRoot.gotoAndStop(nextMiniGame);
} else {
_global.myRoot.gotoAndStop("gameWon");
}
}
}
if (gameOver) {
if (!gameDone) {
endAnim.infoBox.infoText = "GAME OVER!";
endAnim.play();
}
if (gameDone) {
fades.play();
}
if (faded) {
faded = false;
gotoAndStop ("gameOver");
}
}
}
};
Instance of Symbol 81 MovieClip in Frame 96
on (keyPress "s") {
if (_global.myRoot.sound) {
_global.myRoot.sound = false;
_global.myRoot.globalSound.setVolume(0);
} else {
_global.myRoot.sound = true;
_global.myRoot.globalSound.setVolume(100);
}
}
on (keyPress "q") {
if (!_global.myRoot.quit) {
_global.myRoot.quit = true;
_global.myRoot.fades.play();
}
}
on (keyPress "<Space>") {
if ((((_global.myRoot.gameReady and (!_global.myRoot.quit)) and (!_global.myRoot.miniGameWon)) and (!_global.myRoot.miniGameOver)) and (!_global.myRoot.gameOver)) {
if (!_global.myRoot.gamePaused) {
_global.myRoot.gamePaused = true;
_global.myRoot.foreground.gotoAndStop("gamePaused");
} else {
_global.myRoot.gamePaused = false;
_global.myRoot.foreground.gotoAndStop("gameReady");
}
}
}
Frame 97
stop();
quit = false;
faded = false;
gameReady = false;
gameDone = false;
gamePaused = false;
miniGameWon = false;
miniGameOver = false;
gameOver = false;
timerRunning = false;
timeBonusAdded = false;
scoreAdded = false;
miniGamesCompleted = miniGamesCompleted + 1;
trace(miniGamesCompleted);
miniGameCounter = miniGamesCompleted;
i = Math.floor(Math.random() * miniGames.length);
nextMiniGame = miniGames[i];
miniGames.splice(i, 1);
mousePressed = false;
onMouseUp = function () {
mousePressed = false;
};
onMouseDown = function () {
mousePressed = true;
};
onMouseMove = function () {
};
startAnim.infoBox.infoText = "MINIGAME 21!";
survivalMode = false;
miniGameScore = 10;
cardsTurned = 0;
pairsFound = 0;
cardPositions = new Array();
cardPositions[0] = 170;
cardPositions[1] = 230;
cardPositions[2] = 290;
cardPositions[3] = 350;
cardPositions[4] = 410;
cardPositions[5] = 470;
i = 0;
while (i < 6) {
j = i + 1;
k = Math.floor(Math.random() * cardPositions.length);
_global.myRoot["card" + j]._x = cardPositions[k];
_global.myRoot[("card" + j) + "reflection"]._x = cardPositions[k];
_global.myRoot["card" + j].gotoAndStop(2);
_global.myRoot[("card" + j) + "reflection"].gotoAndStop(2);
cardPositions.splice(k, 1);
i++;
}
turned = new Array();
i = 0;
while (i < 6) {
turned[i] = false;
i++;
}
onEnterFrame = function () {
gamePausedText._visible = false;
if (sound) {
soundSwitch.gotoAndStop("on");
} else {
soundSwitch.gotoAndStop("off");
}
if (startAnim._currentframe == startAnim._totalframes) {
gameReady = true;
}
if (endAnim._currentframe == endAnim._totalframes) {
gameDone = true;
}
if (fades._currentframe == fades._totalframes) {
faded = true;
}
if (((((gameReady and (!quit)) and (!gamePaused)) and (!miniGameWon)) and (!miniGameOver)) and (!gameOver)) {
gamePausedText._visible = true;
timer._width = timer._width - 4;
if (timer._width <= 0) {
if (!survivalMode) {
core.fail.start(0, 1);
lives = lives - 1;
timer._width = 0;
if (lives > 0) {
miniGameOver = true;
} else {
gameOver = true;
}
} else {
core.success.start(0, 1);
miniGameWon = true;
}
} else {
i = 0;
while (i < 6) {
j = i + 1;
if (turned[i] == false) {
_global.myRoot["card" + j].gotoAndStop(1);
_global.myRoot[("card" + j) + "reflection"].gotoAndStop(1);
turned[i] = true;
}
i++;
}
if (mousePressed) {
i = 0;
while (i < 6) {
j = i + 1;
if (_global.myRoot["card" + j].hitTest(_xmouse, _ymouse, true)) {
if (_global.myRoot["card" + j]._currentframe == 1) {
_global.myRoot["card" + j].gotoAndStop(2);
_global.myRoot[("card" + j) + "reflection"].gotoAndStop(2);
mousePressed = false;
cardsTurned = cardsTurned + 1;
trace(cardsTurned);
cardClicked = j;
}
}
i++;
}
}
if (cardsTurned == 2) {
i = 0;
while (i < 6) {
j = i + 1;
k = j + 3;
if ((_global.myRoot["card" + j]._currentframe == 2) and (_global.myRoot["card" + k]._currentframe == 2)) {
_global.myRoot["card" + j].gotoAndPlay(3);
_global.myRoot[("card" + j) + "reflection"].gotoAndPlay(3);
_global.myRoot["card" + k].gotoAndPlay(3);
_global.myRoot[("card" + k) + "reflection"].gotoAndPlay(3);
cardsTurned = cardsTurned - 2;
trace(cardsTurned);
pairsFound = pairsFound + 1;
}
i++;
}
}
if (cardsTurned == 3) {
i = 0;
while (i < 6) {
j = i + 1;
if ((j != cardClicked) and (_global.myRoot["card" + j]._currentframe == 2)) {
_global.myRoot["card" + j].gotoAndStop(1);
_global.myRoot[("card" + j) + "reflection"].gotoAndStop(1);
}
i++;
}
cardsTurned = 1;
}
if (pairsFound == 3) {
core.success.start(0, 1);
miniGameWon = true;
}
}
} else {
if (quit) {
fades.play();
if (faded) {
faded = false;
gotoAndStop ("menu");
}
}
if (miniGameWon) {
if (!survivalMode) {
if (!timeBonusAdded) {
timeBonusAdded = true;
miniGameScore = miniGameScore + Math.round(timer._width / 10);
}
}
if (!scoreAdded) {
if (miniGameScore > 0) {
miniGameScore = miniGameScore - 1;
score = score + 1;
core.jackpot.start(0, 1);
} else {
scoreAdded = true;
miniGameScore = 0;
}
}
if ((!gameDone) and scoreAdded) {
endAnim.infoBox.infoText = "WELL DONE!";
endAnim.play();
}
if (gameDone) {
fades.play();
}
if (faded) {
faded = false;
if (miniGamesCompleted < 21) {
_global.myRoot.gotoAndStop(nextMiniGame);
} else {
_global.myRoot.gotoAndStop("gameWon");
}
}
}
if (miniGameOver) {
if (!gameDone) {
endAnim.infoBox.infoText = "WHOOPS!";
endAnim.play();
}
if (gameDone) {
fades.play();
}
if (faded) {
faded = false;
if (miniGamesCompleted < 21) {
_global.myRoot.gotoAndStop(nextMiniGame);
} else {
_global.myRoot.gotoAndStop("gameWon");
}
}
}
if (gameOver) {
if (!gameDone) {
endAnim.infoBox.infoText = "GAME OVER!";
endAnim.play();
}
if (gameDone) {
fades.play();
}
if (faded) {
faded = false;
gotoAndStop ("gameOver");
}
}
}
};
Instance of Symbol 81 MovieClip in Frame 97
on (keyPress "s") {
if (_global.myRoot.sound) {
_global.myRoot.sound = false;
_global.myRoot.globalSound.setVolume(0);
} else {
_global.myRoot.sound = true;
_global.myRoot.globalSound.setVolume(100);
}
}
on (keyPress "q") {
if (!_global.myRoot.quit) {
_global.myRoot.quit = true;
_global.myRoot.fades.play();
}
}
on (keyPress "<Space>") {
if ((((_global.myRoot.gameReady and (!_global.myRoot.quit)) and (!_global.myRoot.miniGameWon)) and (!_global.myRoot.miniGameOver)) and (!_global.myRoot.gameOver)) {
if (!_global.myRoot.gamePaused) {
_global.myRoot.gamePaused = true;
_global.myRoot.foreground.gotoAndStop("gamePaused");
} else {
_global.myRoot.gamePaused = false;
_global.myRoot.foreground.gotoAndStop("gameReady");
}
}
}
Frame 98
stop();
quit = false;
faded = false;
gameReady = false;
gameDone = false;
gamePaused = false;
miniGameWon = false;
miniGameOver = false;
gameOver = false;
timerRunning = false;
timeBonusAdded = false;
scoreAdded = false;
miniGamesCompleted = miniGamesCompleted + 1;
trace(miniGamesCompleted);
miniGameCounter = miniGamesCompleted;
i = Math.floor(Math.random() * miniGames.length);
nextMiniGame = miniGames[i];
miniGames.splice(i, 1);
mousePressed = false;
onMouseUp = function () {
mousePressed = false;
};
onMouseDown = function () {
mousePressed = true;
};
onMouseMove = function () {
};
startAnim.infoBox.infoText = "PICK THE MUSHROOMS!";
survivalMode = false;
miniGameScore = 10;
picked = new Array();
i = 0;
while (i < 6) {
picked[i] = false;
i++;
}
mushroomCount = 0;
onEnterFrame = function () {
gamePausedText._visible = false;
if (sound) {
soundSwitch.gotoAndStop("on");
} else {
soundSwitch.gotoAndStop("off");
}
if (startAnim._currentframe == startAnim._totalframes) {
gameReady = true;
}
if (endAnim._currentframe == endAnim._totalframes) {
gameDone = true;
}
if (fades._currentframe == fades._totalframes) {
faded = true;
}
if (((((gameReady and (!quit)) and (!gamePaused)) and (!miniGameWon)) and (!miniGameOver)) and (!gameOver)) {
gamePausedText._visible = true;
timer._width = timer._width - 4;
if (timer._width <= 0) {
if (!survivalMode) {
core.fail.start(0, 1);
lives = lives - 1;
timer._width = 0;
if (lives > 0) {
miniGameOver = true;
} else {
gameOver = true;
}
} else {
core.success.start(0, 1);
miniGameWon = true;
}
} else {
if (mousePressed) {
i = 0;
while (i < 6) {
j = i + 1;
if (!dragging) {
if (_global.myRoot["mushroom" + j].hitTest(_xmouse, _ymouse, true)) {
dragging = true;
k = j;
}
}
i++;
}
} else {
dragging = false;
}
if (dragging) {
if (_ymouse > 234) {
_global.myRoot["mushroom" + k]._y = 234;
} else if ((_ymouse < 234) and (_ymouse > 60)) {
_global.myRoot["mushroom" + k]._y = _ymouse;
_global.myRoot[("mushroom" + k) + "reflection"]._y = ((234 - _global.myRoot["mushroom" + k]._y) / 2) + 260;
}
if (_ymouse < 60) {
_global.myRoot["mushroom" + k]._y = 60;
} else if ((_ymouse < 234) and (_ymouse > 60)) {
_global.myRoot["mushroom" + k]._y = _ymouse;
_global.myRoot[("mushroom" + k) + "reflection"]._y = ((234 - _global.myRoot["mushroom" + k]._y) / 2) + 260;
}
if (_xmouse < 30) {
_global.myRoot["mushroom" + k]._x = 30;
_global.myRoot[("mushroom" + k) + "reflection"]._x = 30;
} else if ((_xmouse > 30) and (_xmouse < 610)) {
_global.myRoot["mushroom" + k]._x = _xmouse;
_global.myRoot[("mushroom" + k) + "reflection"]._x = _xmouse;
}
if (_xmouse > 610) {
_global.myRoot["mushroom" + k]._x = 610;
_global.myRoot[("mushroom" + k) + "reflection"]._x = 610;
} else if ((_xmouse < 610) and (_xmouse > 30)) {
_global.myRoot["mushroom" + k]._x = _xmouse;
_global.myRoot[("mushroom" + k) + "reflection"]._x = _xmouse;
}
} else if (basket.hitTest(_global.myRoot["mushroom" + k]._x, _global.myRoot["mushroom" + k]._y, true)) {
if (!picked[k - 1]) {
_global.myRoot["mushroom" + k].play();
_global.myRoot[("mushroom" + k) + "reflection"].play();
picked[k - 1] = true;
mushroomCount = mushroomCount + 1;
core.pickup.start(0, 1);
}
} else {
_global.myRoot["mushroom" + k]._y = 234;
_global.myRoot[("mushroom" + k) + "reflection"]._y = 260;
}
if (mushroomCount == 6) {
core.success.start(0, 1);
miniGameWon = true;
}
}
} else {
if (quit) {
fades.play();
if (faded) {
faded = false;
gotoAndStop ("menu");
}
}
if (miniGameWon) {
if (!survivalMode) {
if (!timeBonusAdded) {
timeBonusAdded = true;
miniGameScore = miniGameScore + Math.round(timer._width / 10);
}
}
if (!scoreAdded) {
if (miniGameScore > 0) {
miniGameScore = miniGameScore - 1;
score = score + 1;
core.jackpot.start(0, 1);
} else {
scoreAdded = true;
miniGameScore = 0;
}
}
if ((!gameDone) and scoreAdded) {
endAnim.infoBox.infoText = "WELL DONE!";
endAnim.play();
}
if (gameDone) {
fades.play();
}
if (faded) {
faded = false;
if (miniGamesCompleted < 21) {
_global.myRoot.gotoAndStop(nextMiniGame);
} else {
_global.myRoot.gotoAndStop("gameWon");
}
}
}
if (miniGameOver) {
if (!gameDone) {
endAnim.infoBox.infoText = "WHOOPS!";
endAnim.play();
}
if (gameDone) {
fades.play();
}
if (faded) {
faded = false;
if (miniGamesCompleted < 21) {
_global.myRoot.gotoAndStop(nextMiniGame);
} else {
_global.myRoot.gotoAndStop("gameWon");
}
}
}
if (gameOver) {
if (!gameDone) {
endAnim.infoBox.infoText = "GAME OVER!";
endAnim.play();
}
if (gameDone) {
fades.play();
}
if (faded) {
faded = false;
gotoAndStop ("gameOver");
}
}
}
};
Instance of Symbol 81 MovieClip in Frame 98
on (keyPress "s") {
if (_global.myRoot.sound) {
_global.myRoot.sound = false;
_global.myRoot.globalSound.setVolume(0);
} else {
_global.myRoot.sound = true;
_global.myRoot.globalSound.setVolume(100);
}
}
on (keyPress "q") {
if (!_global.myRoot.quit) {
_global.myRoot.quit = true;
_global.myRoot.fades.play();
}
}
on (keyPress "<Space>") {
if ((((_global.myRoot.gameReady and (!_global.myRoot.quit)) and (!_global.myRoot.miniGameWon)) and (!_global.myRoot.miniGameOver)) and (!_global.myRoot.gameOver)) {
if (!_global.myRoot.gamePaused) {
_global.myRoot.gamePaused = true;
_global.myRoot.foreground.gotoAndStop("gamePaused");
} else {
_global.myRoot.gamePaused = false;
_global.myRoot.foreground.gotoAndStop("gameReady");
}
}
}
Frame 99
stop();
quit = false;
faded = false;
gameReady = false;
gameDone = false;
gamePaused = false;
miniGameWon = false;
miniGameOver = false;
gameOver = false;
timerRunning = false;
timeBonusAdded = false;
scoreAdded = false;
miniGamesCompleted = miniGamesCompleted + 1;
trace(miniGamesCompleted);
miniGameCounter = miniGamesCompleted;
i = Math.floor(Math.random() * miniGames.length);
nextMiniGame = miniGames[i];
miniGames.splice(i, 1);
mousePressed = false;
onMouseDown = function () {
mousePressed = true;
};
onMouseMove = function () {
};
startAnim.infoBox.infoText = "MAKE A SMILEY!";
survivalMode = false;
miniGameScore = 10;
smileyRotation = new Array();
smileyRotation[0] = 90;
smileyRotation[1] = 180;
smileyRotation[2] = 270;
i = 0;
while (i < 4) {
j = i + 1;
k = Math.floor(Math.random() * smileyRotation.length);
_global.myRoot["smiley" + j]._rotation = smileyRotation[k];
i++;
}
onMouseUp = function () {
mousePressed = false;
if (((((gameReady and (!quit)) and (!gamePaused)) and (!miniGameWon)) and (!miniGameOver)) and (!gameOver)) {
i = 0;
while (i < 4) {
j = i + 1;
if (_global.myRoot["smiley" + j].hitTest(_xmouse, _ymouse, true)) {
_global.myRoot["smiley" + j]._rotation = _global.myRoot["smiley" + j]._rotation + 90;
core.counter.start(0, 1);
}
i++;
}
}
};
onEnterFrame = function () {
gamePausedText._visible = false;
if (sound) {
soundSwitch.gotoAndStop("on");
} else {
soundSwitch.gotoAndStop("off");
}
if (startAnim._currentframe == startAnim._totalframes) {
gameReady = true;
}
if (endAnim._currentframe == endAnim._totalframes) {
gameDone = true;
}
if (fades._currentframe == fades._totalframes) {
faded = true;
}
if (((((gameReady and (!quit)) and (!gamePaused)) and (!miniGameWon)) and (!miniGameOver)) and (!gameOver)) {
gamePausedText._visible = true;
timer._width = timer._width - 4;
if (timer._width <= 0) {
if (!survivalMode) {
core.fail.start(0, 1);
lives = lives - 1;
timer._width = 0;
if (lives > 0) {
miniGameOver = true;
} else {
gameOver = true;
}
} else {
core.success.start(0, 1);
miniGameWon = true;
}
} else if ((((smiley1._rotation == 0) and (smiley2._rotation == 0)) and (smiley3._rotation == 0)) and (smiley4._rotation == 0)) {
smiley.play();
core.success.start(0, 1);
miniGameWon = true;
}
} else {
if (quit) {
fades.play();
if (faded) {
faded = false;
gotoAndStop ("menu");
}
}
if (miniGameWon) {
if (!survivalMode) {
if (!timeBonusAdded) {
timeBonusAdded = true;
miniGameScore = miniGameScore + Math.round(timer._width / 10);
}
}
if (!scoreAdded) {
if (miniGameScore > 0) {
miniGameScore = miniGameScore - 1;
score = score + 1;
core.jackpot.start(0, 1);
} else {
scoreAdded = true;
miniGameScore = 0;
}
}
if ((!gameDone) and scoreAdded) {
endAnim.infoBox.infoText = "WELL DONE!";
endAnim.play();
}
if (gameDone) {
fades.play();
}
if (faded) {
faded = false;
if (miniGamesCompleted < 21) {
_global.myRoot.gotoAndStop(nextMiniGame);
} else {
_global.myRoot.gotoAndStop("gameWon");
}
}
}
if (miniGameOver) {
if (!gameDone) {
endAnim.infoBox.infoText = "WHOOPS!";
endAnim.play();
}
if (gameDone) {
fades.play();
}
if (faded) {
faded = false;
if (miniGamesCompleted < 21) {
_global.myRoot.gotoAndStop(nextMiniGame);
} else {
_global.myRoot.gotoAndStop("gameWon");
}
}
}
if (gameOver) {
if (!gameDone) {
endAnim.infoBox.infoText = "GAME OVER!";
endAnim.play();
}
if (gameDone) {
fades.play();
}
if (faded) {
faded = false;
gotoAndStop ("gameOver");
}
}
}
};
Instance of Symbol 81 MovieClip in Frame 99
on (keyPress "s") {
if (_global.myRoot.sound) {
_global.myRoot.sound = false;
_global.myRoot.globalSound.setVolume(0);
} else {
_global.myRoot.sound = true;
_global.myRoot.globalSound.setVolume(100);
}
}
on (keyPress "q") {
if (!_global.myRoot.quit) {
_global.myRoot.quit = true;
_global.myRoot.fades.play();
}
}
on (keyPress "<Space>") {
if ((((_global.myRoot.gameReady and (!_global.myRoot.quit)) and (!_global.myRoot.miniGameWon)) and (!_global.myRoot.miniGameOver)) and (!_global.myRoot.gameOver)) {
if (!_global.myRoot.gamePaused) {
_global.myRoot.gamePaused = true;
_global.myRoot.foreground.gotoAndStop("gamePaused");
} else {
_global.myRoot.gamePaused = false;
_global.myRoot.foreground.gotoAndStop("gameReady");
}
}
}
Frame 100
stop();
quit = false;
faded = false;
gameReady = false;
gameDone = false;
gamePaused = false;
miniGameWon = false;
miniGameOver = false;
gameOver = false;
timerRunning = false;
timeBonusAdded = false;
scoreAdded = false;
miniGamesCompleted = miniGamesCompleted + 1;
trace(miniGamesCompleted);
miniGameCounter = miniGamesCompleted;
i = Math.floor(Math.random() * miniGames.length);
nextMiniGame = miniGames[i];
miniGames.splice(i, 1);
mousePressed = false;
onMouseUp = function () {
mousePressed = false;
};
onMouseDown = function () {
mousePressed = true;
};
onMouseMove = function () {
};
startAnim.infoBox.infoText = "DEFLECT!";
survivalMode = true;
miniGameScore = 20;
delay = 10;
speed = 4;
angle = random(360);
vx = Math.cos((angle * Math.PI) / 180) * speed;
vy = Math.sin((angle * Math.PI) / 180) * speed;
crossed = false;
shaking = false;
shakeCount = 10;
lifeTaken = false;
onEnterFrame = function () {
gamePausedText._visible = false;
if (sound) {
soundSwitch.gotoAndStop("on");
} else {
soundSwitch.gotoAndStop("off");
}
if (startAnim._currentframe == startAnim._totalframes) {
gameReady = true;
}
if (endAnim._currentframe == endAnim._totalframes) {
gameDone = true;
}
if (fades._currentframe == fades._totalframes) {
faded = true;
}
if (!gamePaused) {
paddleTop._x = _xmouse;
paddleRight._y = _ymouse;
paddleBottom._x = _xmouse;
paddleLeft._y = _ymouse;
if (paddleTop._x < 220) {
paddleTop._x = 220;
paddleBottom._x = 220;
}
if (paddleTop._x > 420) {
paddleTop._x = 420;
paddleBottom._x = 420;
}
if (paddleRight._y < 90) {
paddleRight._y = 90;
paddleLeft._y = 90;
}
if (paddleRight._y > 280) {
paddleRight._y = 280;
paddleLeft._y = 280;
}
}
if (shaking) {
_global.myRoot._x = random(5) - 2;
_global.myRoot._y = random(5) - 2;
shakeCount--;
if (shakeCount == 0) {
shaking = false;
_global.myRoot._x = 0;
_global.myRoot._y = 0;
}
}
if (((((gameReady and (!quit)) and (!gamePaused)) and (!miniGameWon)) and (!miniGameOver)) and (!gameOver)) {
gamePausedText._visible = true;
timer._width = timer._width - 4;
if (timer._width <= 0) {
if (!survivalMode) {
core.fail.start(0, 1);
lives = lives - 1;
timer._width = 0;
if (lives > 0) {
miniGameOver = true;
} else {
gameOver = true;
}
} else {
core.success.start(0, 1);
miniGameWon = true;
}
} else {
_global.myRoot.puck._x = _global.myRoot.puck._x + vx;
_global.myRoot.puck._y = _global.myRoot.puck._y + vy;
p = attachMovie("particleFade", "particle" + (i++), _global.myRoot.getNextHighestDepth());
p._x = puck._x;
p._y = puck._y;
p._xscale = (p._yscale = (Math.random() * 10) + 40);
if (!crossed) {
if (((puck._y < 75) and (puck._x > (paddleTop._x - 20))) and ((puck._y < 75) and (puck._x < (paddleTop._x + 20)))) {
puck._y = 75;
vy = vy * -1;
vx = vx * 1;
core.deflect.start(0, 1);
} else if (((puck._y < 75) and (puck._x < (paddleTop._x - 20))) or ((puck._y < 75) and (puck._x > (paddleTop._x + 20)))) {
crossed = true;
}
if (((puck._x > 435) and (puck._y > (paddleRight._y - 20))) and ((puck._x > 435) and (puck._y < (paddleRight._y + 20)))) {
puck._x = 435;
vy = vy * 1;
vx = vx * -1;
core.deflect.start(0, 1);
} else if (((puck._x > 435) and (puck._y < (paddleRight._y - 20))) or ((puck._x > 435) and (puck._y > (paddleRight._y + 20)))) {
crossed = true;
}
if (((puck._y > 295) and (puck._x > (paddleBottom._x - 20))) and ((puck._y > 295) and (puck._x < (paddleBottom._x + 20)))) {
puck._y = 295;
vy = vy * -1;
vx = vx * 1;
core.deflect.start(0, 1);
} else if (((puck._y > 295) and (puck._x < (paddleBottom._x - 20))) or ((puck._y > 295) and (puck._x > (paddleBottom._x + 20)))) {
crossed = true;
}
if (((puck._x < 205) and (puck._y > (paddleLeft._y - 20))) and ((puck._x < 205) and (puck._y < (paddleLeft._y + 20)))) {
puck._x = 205;
vy = vy * 1;
vx = vx * -1;
core.deflect.start(0, 1);
} else if (((puck._x < 205) and (puck._y < (paddleLeft._y - 20))) or ((puck._x < 205) and (puck._y > (paddleLeft._y + 20)))) {
crossed = true;
}
}
if (hitMap.hitTest(puck._x, puck._y, true)) {
if (!lifeTaken) {
lifeTaken = true;
puck.play();
shaking = true;
core.fail.start(0, 1);
core.explosion.start(0, 1);
lives = lives - 1;
if (lives > 0) {
miniGameOver = true;
} else {
gameOver = true;
}
}
}
}
} else {
if (quit) {
fades.play();
if (faded) {
faded = false;
gotoAndStop ("menu");
}
}
if (miniGameWon) {
if (!survivalMode) {
if (!timeBonusAdded) {
timeBonusAdded = true;
miniGameScore = miniGameScore + Math.round(timer._width / 10);
}
}
if (!scoreAdded) {
if (miniGameScore > 0) {
miniGameScore = miniGameScore - 1;
score = score + 1;
core.jackpot.start(0, 1);
} else {
scoreAdded = true;
miniGameScore = 0;
}
}
if ((!gameDone) and scoreAdded) {
endAnim.infoBox.infoText = "WELL DONE!";
endAnim.play();
}
if (gameDone) {
fades.play();
}
if (faded) {
faded = false;
if (miniGamesCompleted < 21) {
_global.myRoot.gotoAndStop(nextMiniGame);
} else {
_global.myRoot.gotoAndStop("gameWon");
}
}
}
if (miniGameOver) {
if (!gameDone) {
endAnim.infoBox.infoText = "WHOOPS!";
endAnim.play();
}
if (gameDone) {
fades.play();
}
if (faded) {
faded = false;
if (miniGamesCompleted < 21) {
_global.myRoot.gotoAndStop(nextMiniGame);
} else {
_global.myRoot.gotoAndStop("gameWon");
}
}
}
if (gameOver) {
if (!gameDone) {
endAnim.infoBox.infoText = "GAME OVER!";
endAnim.play();
}
if (gameDone) {
fades.play();
}
if (faded) {
faded = false;
gotoAndStop ("gameOver");
}
}
}
};
Instance of Symbol 81 MovieClip in Frame 100
on (keyPress "s") {
if (_global.myRoot.sound) {
_global.myRoot.sound = false;
_global.myRoot.globalSound.setVolume(0);
} else {
_global.myRoot.sound = true;
_global.myRoot.globalSound.setVolume(100);
}
}
on (keyPress "q") {
if (!_global.myRoot.quit) {
_global.myRoot.quit = true;
_global.myRoot.fades.play();
}
}
on (keyPress "<Space>") {
if ((((_global.myRoot.gameReady and (!_global.myRoot.quit)) and (!_global.myRoot.miniGameWon)) and (!_global.myRoot.miniGameOver)) and (!_global.myRoot.gameOver)) {
if (!_global.myRoot.gamePaused) {
_global.myRoot.gamePaused = true;
_global.myRoot.foreground.gotoAndStop("gamePaused");
} else {
_global.myRoot.gamePaused = false;
_global.myRoot.foreground.gotoAndStop("gameReady");
}
}
}
Frame 101
stop();
quit = false;
faded = false;
gameReady = false;
gameDone = false;
gamePaused = false;
miniGameWon = false;
miniGameOver = false;
gameOver = false;
timerRunning = false;
timeBonusAdded = false;
scoreAdded = false;
miniGamesCompleted = miniGamesCompleted + 1;
trace(miniGamesCompleted);
miniGameCounter = miniGamesCompleted;
i = Math.floor(Math.random() * miniGames.length);
nextMiniGame = miniGames[i];
miniGames.splice(i, 1);
mousePressed = false;
onMouseUp = function () {
mousePressed = false;
};
onMouseDown = function () {
mousePressed = true;
};
onMouseMove = function () {
};
startAnim.infoBox.infoText = "SPELL DOODLE!";
survivalMode = false;
miniGameScore = 10;
shaking = false;
playExplosion = false;
letterPositions = new Array();
letterPositions[0] = 120;
letterPositions[1] = 200;
letterPositions[2] = 280;
letterPositions[3] = 360;
letterPositions[4] = 440;
letterPositions[5] = 520;
i = 0;
while (i < 6) {
j = i + 1;
k = Math.floor(Math.random() * letterPositions.length);
_global.myRoot["square" + j]._x = letterPositions[k];
_global.myRoot[("square" + j) + "reflection"]._x = letterPositions[k];
letterPositions.splice(k, 1);
i++;
}
blown = new Array();
i = 0;
while (i < 6) {
blown[i] = false;
i++;
}
particleExplosion = function () {
shaking = true;
playExplosion = true;
shakeCount = 10;
d = 0;
while (d < 20) {
p1 = attachMovie("particle", "particle" + (i++), _global.myRoot.getNextHighestDepth());
p1._x = _xmouse;
p1._y = _ymouse;
p1._xscale = (p1._yscale = (Math.random() * 100) + 50);
p1._rotation = random(360);
d++;
}
};
onEnterFrame = function () {
gamePausedText._visible = false;
if (sound) {
soundSwitch.gotoAndStop("on");
} else {
soundSwitch.gotoAndStop("off");
}
if (startAnim._currentframe == startAnim._totalframes) {
gameReady = true;
}
if (endAnim._currentframe == endAnim._totalframes) {
gameDone = true;
}
if (fades._currentframe == fades._totalframes) {
faded = true;
}
if (shaking) {
_global.myRoot._x = random(5) - 2;
_global.myRoot._y = random(5) - 2;
shakeCount--;
if (shakeCount == 0) {
shaking = false;
_global.myRoot._x = 0;
_global.myRoot._y = 0;
}
}
if (((((gameReady and (!quit)) and (!gamePaused)) and (!miniGameWon)) and (!miniGameOver)) and (!gameOver)) {
gamePausedText._visible = true;
timer._width = timer._width - 4;
if (timer._width <= 0) {
if (!survivalMode) {
core.fail.start(0, 1);
lives = lives - 1;
timer._width = 1;
if (lives > 0) {
miniGameOver = true;
} else {
gameOver = true;
}
} else {
core.success.start(0, 1);
miniGameWon = true;
}
} else {
if (mousePressed) {
if (square1.hitTest(_xmouse, _ymouse, true)) {
if (!blown[1]) {
square1.play();
square1reflection.play();
particleExplosion();
blown[1] = true;
mousePressed = false;
} else if (blown[3]) {
square1.play();
square1reflection.play();
particleExplosion();
blown[4] = true;
mousePressed = false;
} else {
core.buzzer.start(0, 1);
mousePressed = false;
}
}
if (square4.hitTest(_xmouse, _ymouse, true)) {
if (!blown[1]) {
square4.play();
square4reflection.play();
particleExplosion();
blown[1] = true;
mousePressed = false;
} else if (blown[3]) {
square4.play();
square4reflection.play();
particleExplosion();
blown[4] = true;
mousePressed = false;
} else {
core.buzzer.start(0, 1);
mousePressed = false;
}
}
if (square2.hitTest(_xmouse, _ymouse, true)) {
if (blown[1] and (!blown[2])) {
square2.play();
square2reflection.play();
particleExplosion();
blown[2] = true;
mousePressed = false;
} else if (blown[2]) {
square2.play();
square2reflection.play();
particleExplosion();
blown[3] = true;
mousePressed = false;
} else {
core.buzzer.start(0, 1);
mousePressed = false;
}
}
if (square3.hitTest(_xmouse, _ymouse, true)) {
if (blown[1] and (!blown[2])) {
square3.play();
square3reflection.play();
particleExplosion();
blown[2] = true;
mousePressed = false;
} else if (blown[2]) {
square3.play();
square3reflection.play();
particleExplosion();
blown[3] = true;
mousePressed = false;
} else {
core.buzzer.start(0, 1);
mousePressed = false;
}
}
if (square5.hitTest(_xmouse, _ymouse, true)) {
if (blown[4]) {
square5.play();
square5reflection.play();
particleExplosion();
blown[5] = true;
mousePressed = false;
} else {
core.buzzer.start(0, 1);
mousePressed = false;
}
}
if (square6.hitTest(_xmouse, _ymouse, true)) {
if (blown[5]) {
square6.play();
square6reflection.play();
particleExplosion();
blown[6] = true;
mousePressed = false;
} else {
core.buzzer.start(0, 1);
mousePressed = false;
}
}
}
i = 0;
while (i < 6) {
j = i + 1;
if (_global.myRoot["square" + j].hitTest(_xmouse, _ymouse, true)) {
_global.myRoot["square" + j]._alpha = 50;
} else {
_global.myRoot["square" + j]._alpha = 100;
}
i++;
}
if (playExplosion) {
playExplosion = false;
core.explosion.start(0, 1);
}
if (blown[6]) {
core.success.start(0, 1);
miniGameWon = true;
}
}
} else {
if (quit) {
fades.play();
if (faded) {
faded = false;
gotoAndStop ("menu");
}
}
if (miniGameWon) {
if (!survivalMode) {
if (!timeBonusAdded) {
timeBonusAdded = true;
miniGameScore = miniGameScore + Math.round(timer._width / 10);
}
}
if (!scoreAdded) {
if (miniGameScore > 0) {
miniGameScore = miniGameScore - 1;
score = score + 1;
core.jackpot.start(0, 1);
} else {
scoreAdded = true;
miniGameScore = 0;
}
}
if ((!gameDone) and scoreAdded) {
endAnim.infoBox.infoText = "WELL DONE!";
endAnim.play();
}
if (gameDone) {
fades.play();
}
if (faded) {
faded = false;
if (miniGamesCompleted < 21) {
_global.myRoot.gotoAndStop(nextMiniGame);
} else {
_global.myRoot.gotoAndStop("gameWon");
}
}
}
if (miniGameOver) {
if (!gameDone) {
endAnim.infoBox.infoText = "WHOOPS!";
endAnim.play();
}
if (gameDone) {
fades.play();
}
if (faded) {
faded = false;
if (miniGamesCompleted < 21) {
_global.myRoot.gotoAndStop(nextMiniGame);
} else {
_global.myRoot.gotoAndStop("gameWon");
}
}
}
if (gameOver) {
if (!gameDone) {
endAnim.infoBox.infoText = "GAME OVER!";
endAnim.play();
}
if (gameDone) {
fades.play();
}
if (faded) {
faded = false;
gotoAndStop ("gameOver");
}
}
}
};
Instance of Symbol 81 MovieClip in Frame 101
on (keyPress "s") {
if (_global.myRoot.sound) {
_global.myRoot.sound = false;
_global.myRoot.globalSound.setVolume(0);
} else {
_global.myRoot.sound = true;
_global.myRoot.globalSound.setVolume(100);
}
}
on (keyPress "q") {
if (!_global.myRoot.quit) {
_global.myRoot.quit = true;
_global.myRoot.fades.play();
}
}
on (keyPress "<Space>") {
if ((((_global.myRoot.gameReady and (!_global.myRoot.quit)) and (!_global.myRoot.miniGameWon)) and (!_global.myRoot.miniGameOver)) and (!_global.myRoot.gameOver)) {
if (!_global.myRoot.gamePaused) {
_global.myRoot.gamePaused = true;
_global.myRoot.foreground.gotoAndStop("gamePaused");
} else {
_global.myRoot.gamePaused = false;
_global.myRoot.foreground.gotoAndStop("gameReady");
}
}
}
Frame 102
stop();
quit = false;
faded = false;
gameReady = false;
gameDone = false;
gamePaused = false;
miniGameWon = false;
miniGameOver = false;
gameOver = false;
timerRunning = false;
timeBonusAdded = false;
scoreAdded = false;
miniGamesCompleted = miniGamesCompleted + 1;
trace(miniGamesCompleted);
miniGameCounter = miniGamesCompleted;
i = Math.floor(Math.random() * miniGames.length);
nextMiniGame = miniGames[i];
miniGames.splice(i, 1);
mousePressed = false;
onMouseUp = function () {
mousePressed = false;
};
onMouseDown = function () {
mousePressed = true;
};
onMouseMove = function () {
};
startAnim.infoBox.infoText = "TURN ON!";
survivalMode = false;
miniGameScore = 10;
lightbulbPositions = new Array();
lightbulbPositions[0] = 220;
lightbulbPositions[1] = 320;
lightbulbPositions[2] = 420;
i = 0;
while (i < 3) {
j = i + 1;
k = Math.floor(Math.random() * lightbulbPositions.length);
_global.myRoot["lightbulb" + j]._x = lightbulbPositions[k];
_global.myRoot[("lightbulb" + j) + "reflection"]._x = lightbulbPositions[k];
lightbulbPositions.splice(k, 1);
i++;
}
onEnterFrame = function () {
gamePausedText._visible = false;
if (sound) {
soundSwitch.gotoAndStop("on");
} else {
soundSwitch.gotoAndStop("off");
}
if (startAnim._currentframe == startAnim._totalframes) {
gameReady = true;
}
if (endAnim._currentframe == endAnim._totalframes) {
gameDone = true;
}
if (fades._currentframe == fades._totalframes) {
faded = true;
}
if (((((gameReady and (!quit)) and (!gamePaused)) and (!miniGameWon)) and (!miniGameOver)) and (!gameOver)) {
gamePausedText._visible = true;
timer._width = timer._width - 4;
if (timer._width <= 0) {
if (!survivalMode) {
core.fail.start(0, 1);
lives = lives - 1;
timer._width = 0;
if (lives > 0) {
miniGameOver = true;
} else {
gameOver = true;
}
} else {
core.success.start(0, 1);
miniGameWon = true;
}
} else {
if (mousePressed) {
if (lightbulb1.hitTest(_xmouse, _ymouse, true)) {
lightbulb2.play();
lightbulb2reflection.play();
core.pickup.start(0, 1);
}
if (lightbulb2.hitTest(_xmouse, _ymouse, true)) {
lightbulb3.play();
lightbulb3reflection.play();
core.pickup.start(0, 1);
}
if (lightbulb3.hitTest(_xmouse, _ymouse, true)) {
lightbulb1.play();
lightbulb1reflection.play();
lightbulb2.play();
lightbulb2reflection.play();
core.pickup.start(0, 1);
}
mousePressed = false;
}
if (((lightbulb1._currentframe == 2) and (lightbulb2._currentframe == 2)) and (lightbulb3._currentframe == 2)) {
core.success.start(0, 1);
miniGameWon = true;
}
}
} else {
if (quit) {
fades.play();
if (faded) {
faded = false;
gotoAndStop ("menu");
}
}
if (miniGameWon) {
if (!survivalMode) {
if (!timeBonusAdded) {
timeBonusAdded = true;
miniGameScore = miniGameScore + Math.round(timer._width / 10);
}
}
if (!scoreAdded) {
if (miniGameScore > 0) {
miniGameScore = miniGameScore - 1;
score = score + 1;
core.jackpot.start(0, 1);
} else {
scoreAdded = true;
miniGameScore = 0;
}
}
if ((!gameDone) and scoreAdded) {
endAnim.infoBox.infoText = "WELL DONE!";
endAnim.play();
}
if (gameDone) {
fades.play();
}
if (faded) {
faded = false;
if (miniGamesCompleted < 21) {
_global.myRoot.gotoAndStop(nextMiniGame);
} else {
_global.myRoot.gotoAndStop("gameWon");
}
}
}
if (miniGameOver) {
if (!gameDone) {
endAnim.infoBox.infoText = "WHOOPS!";
endAnim.play();
}
if (gameDone) {
fades.play();
}
if (faded) {
faded = false;
if (miniGamesCompleted < 21) {
_global.myRoot.gotoAndStop(nextMiniGame);
} else {
_global.myRoot.gotoAndStop("gameWon");
}
}
}
if (gameOver) {
if (!gameDone) {
endAnim.infoBox.infoText = "GAME OVER!";
endAnim.play();
}
if (gameDone) {
fades.play();
}
if (faded) {
faded = false;
gotoAndStop ("gameOver");
}
}
}
};
Instance of Symbol 81 MovieClip in Frame 102
on (keyPress "s") {
if (_global.myRoot.sound) {
_global.myRoot.sound = false;
_global.myRoot.globalSound.setVolume(0);
} else {
_global.myRoot.sound = true;
_global.myRoot.globalSound.setVolume(100);
}
}
on (keyPress "q") {
if (!_global.myRoot.quit) {
_global.myRoot.quit = true;
_global.myRoot.fades.play();
}
}
on (keyPress "<Space>") {
if ((((_global.myRoot.gameReady and (!_global.myRoot.quit)) and (!_global.myRoot.miniGameWon)) and (!_global.myRoot.miniGameOver)) and (!_global.myRoot.gameOver)) {
if (!_global.myRoot.gamePaused) {
_global.myRoot.gamePaused = true;
_global.myRoot.foreground.gotoAndStop("gamePaused");
} else {
_global.myRoot.gamePaused = false;
_global.myRoot.foreground.gotoAndStop("gameReady");
}
}
}
Frame 103
stop();
quit = false;
faded = false;
gameReady = false;
gameDone = false;
gamePaused = false;
miniGameWon = false;
miniGameOver = false;
gameOver = false;
timerRunning = false;
timeBonusAdded = false;
scoreAdded = false;
miniGamesCompleted = miniGamesCompleted + 1;
trace(miniGamesCompleted);
miniGameCounter = miniGamesCompleted;
i = Math.floor(Math.random() * miniGames.length);
nextMiniGame = miniGames[i];
miniGames.splice(i, 1);
mousePressed = false;
onMouseUp = function () {
mousePressed = false;
};
onMouseDown = function () {
mousePressed = true;
};
onMouseMove = function () {
};
startAnim.infoBox.infoText = "CATCH THE FLY!";
survivalMode = false;
miniGameScore = 10;
alive = true;
onEnterFrame = function () {
gamePausedText._visible = false;
if (sound) {
soundSwitch.gotoAndStop("on");
} else {
soundSwitch.gotoAndStop("off");
}
if (startAnim._currentframe == startAnim._totalframes) {
gameReady = true;
}
if (endAnim._currentframe == endAnim._totalframes) {
gameDone = true;
}
if (fades._currentframe == fades._totalframes) {
faded = true;
}
if (alive) {
fly._x = fly._x + (random(20) - 9.5);
fly._y = fly._y + (random(20) - 9.5);
if (fly._x < 10) {
fly._x = 10;
}
if (fly._x > 630) {
fly._x = 630;
}
if (fly._y < 50) {
fly._y = 50;
}
if (fly._y > 310) {
fly._y = 310;
}
}
if (((((gameReady and (!quit)) and (!gamePaused)) and (!miniGameWon)) and (!miniGameOver)) and (!gameOver)) {
gamePausedText._visible = true;
timer._width = timer._width - 4;
if (timer._width <= 0) {
if (!survivalMode) {
core.fail.start(0, 1);
lives = lives - 1;
timer._width = 0;
if (lives > 0) {
miniGameOver = true;
} else {
gameOver = true;
}
} else {
core.success.start(0, 1);
miniGameWon = true;
}
} else if (mousePressed) {
if (fly.hitTest(_xmouse, _ymouse, true)) {
alive = false;
mousePressed = false;
fly.gotoAndStop(2);
core.squish.start(0, 1);
core.success.start(0, 1);
miniGameWon = true;
}
}
} else {
if (quit) {
fades.play();
if (faded) {
faded = false;
gotoAndStop ("menu");
}
}
if (miniGameWon) {
if (!survivalMode) {
if (!timeBonusAdded) {
timeBonusAdded = true;
miniGameScore = miniGameScore + Math.round(timer._width / 10);
}
}
if (!scoreAdded) {
if (miniGameScore > 0) {
miniGameScore = miniGameScore - 1;
score = score + 1;
core.jackpot.start(0, 1);
} else {
scoreAdded = true;
miniGameScore = 0;
}
}
if ((!gameDone) and scoreAdded) {
endAnim.infoBox.infoText = "WELL DONE!";
endAnim.play();
}
if (gameDone) {
fades.play();
}
if (faded) {
faded = false;
if (miniGamesCompleted < 21) {
_global.myRoot.gotoAndStop(nextMiniGame);
} else {
_global.myRoot.gotoAndStop("gameWon");
}
}
}
if (miniGameOver) {
if (!gameDone) {
endAnim.infoBox.infoText = "WHOOPS!";
endAnim.play();
}
if (gameDone) {
fades.play();
}
if (faded) {
faded = false;
if (miniGamesCompleted < 21) {
_global.myRoot.gotoAndStop(nextMiniGame);
} else {
_global.myRoot.gotoAndStop("gameWon");
}
}
}
if (gameOver) {
if (!gameDone) {
endAnim.infoBox.infoText = "GAME OVER!";
endAnim.play();
}
if (gameDone) {
fades.play();
}
if (faded) {
faded = false;
gotoAndStop ("gameOver");
}
}
}
};
Instance of Symbol 81 MovieClip in Frame 103
on (keyPress "s") {
if (_global.myRoot.sound) {
_global.myRoot.sound = false;
_global.myRoot.globalSound.setVolume(0);
} else {
_global.myRoot.sound = true;
_global.myRoot.globalSound.setVolume(100);
}
}
on (keyPress "q") {
if (!_global.myRoot.quit) {
_global.myRoot.quit = true;
_global.myRoot.fades.play();
}
}
on (keyPress "<Space>") {
if ((((_global.myRoot.gameReady and (!_global.myRoot.quit)) and (!_global.myRoot.miniGameWon)) and (!_global.myRoot.miniGameOver)) and (!_global.myRoot.gameOver)) {
if (!_global.myRoot.gamePaused) {
_global.myRoot.gamePaused = true;
_global.myRoot.foreground.gotoAndStop("gamePaused");
} else {
_global.myRoot.gamePaused = false;
_global.myRoot.foreground.gotoAndStop("gameReady");
}
}
}
Frame 104
stop();
quit = false;
faded = false;
gameReady = false;
gameDone = false;
gamePaused = false;
miniGameWon = false;
miniGameOver = false;
gameOver = false;
timerRunning = false;
timeBonusAdded = false;
scoreAdded = false;
miniGamesCompleted = miniGamesCompleted + 1;
trace(miniGamesCompleted);
miniGameCounter = miniGamesCompleted;
i = Math.floor(Math.random() * miniGames.length);
nextMiniGame = miniGames[i];
miniGames.splice(i, 1);
mousePressed = false;
onMouseUp = function () {
mousePressed = false;
};
onMouseDown = function () {
mousePressed = true;
};
onMouseMove = function () {
};
startAnim.infoBox.infoText = "CLICK 5!";
survivalMode = false;
miniGameScore = 10;
delay = 7;
star._x = 320;
starCount = 0;
starReady = true;
onEnterFrame = function () {
gamePausedText._visible = false;
if (sound) {
soundSwitch.gotoAndStop("on");
} else {
soundSwitch.gotoAndStop("off");
}
if (startAnim._currentframe == startAnim._totalframes) {
gameReady = true;
}
if (endAnim._currentframe == endAnim._totalframes) {
gameDone = true;
}
if (fades._currentframe == fades._totalframes) {
faded = true;
}
if (((((gameReady and (!quit)) and (!gamePaused)) and (!miniGameWon)) and (!miniGameOver)) and (!gameOver)) {
gamePausedText._visible = true;
timer._width = timer._width - 4;
if (timer._width <= 0) {
if (!survivalMode) {
core.fail.start(0, 1);
lives = lives - 1;
timer._width = 0;
if (lives > 0) {
miniGameOver = true;
} else {
gameOver = true;
}
} else {
core.success.start(0, 1);
miniGameWon = true;
}
} else {
if (starReady) {
if (mousePressed) {
if (star.hitTest(_xmouse, _ymouse, true)) {
star.play();
core.pickup.start(0, 1);
starReflection.play();
starCount++;
starReady = false;
mousePressed = false;
}
}
} else if (star._currentframe == star._totalframes) {
star._x = random(500) + 70;
starReflection._x = star._x;
star.play();
starReflection.play();
starReady = true;
}
if (starCount == 5) {
core.success.start(0, 1);
miniGameWon = true;
}
}
} else {
if (quit) {
fades.play();
if (faded) {
faded = false;
gotoAndStop ("menu");
}
}
if (miniGameWon) {
if (!survivalMode) {
if (!timeBonusAdded) {
timeBonusAdded = true;
miniGameScore = miniGameScore + Math.round(timer._width / 10);
}
}
if (!scoreAdded) {
if (miniGameScore > 0) {
miniGameScore = miniGameScore - 1;
score = score + 1;
core.jackpot.start(0, 1);
} else {
scoreAdded = true;
miniGameScore = 0;
}
}
if ((!gameDone) and scoreAdded) {
endAnim.infoBox.infoText = "WELL DONE!";
endAnim.play();
}
if (gameDone) {
fades.play();
}
if (faded) {
faded = false;
if (miniGamesCompleted < 21) {
_global.myRoot.gotoAndStop(nextMiniGame);
} else {
_global.myRoot.gotoAndStop("gameWon");
}
}
}
if (miniGameOver) {
if (!gameDone) {
endAnim.infoBox.infoText = "WHOOPS!";
endAnim.play();
}
if (gameDone) {
fades.play();
}
if (faded) {
faded = false;
if (miniGamesCompleted < 21) {
_global.myRoot.gotoAndStop(nextMiniGame);
} else {
_global.myRoot.gotoAndStop("gameWon");
}
}
}
if (gameOver) {
if (!gameDone) {
endAnim.infoBox.infoText = "GAME OVER!";
endAnim.play();
}
if (gameDone) {
fades.play();
}
if (faded) {
faded = false;
gotoAndStop ("gameOver");
}
}
}
};
Instance of Symbol 81 MovieClip in Frame 104
on (keyPress "s") {
if (_global.myRoot.sound) {
_global.myRoot.sound = false;
_global.myRoot.globalSound.setVolume(0);
} else {
_global.myRoot.sound = true;
_global.myRoot.globalSound.setVolume(100);
}
}
on (keyPress "q") {
if (!_global.myRoot.quit) {
_global.myRoot.quit = true;
_global.myRoot.fades.play();
}
}
on (keyPress "<Space>") {
if ((((_global.myRoot.gameReady and (!_global.myRoot.quit)) and (!_global.myRoot.miniGameWon)) and (!_global.myRoot.miniGameOver)) and (!_global.myRoot.gameOver)) {
if (!_global.myRoot.gamePaused) {
_global.myRoot.gamePaused = true;
_global.myRoot.foreground.gotoAndStop("gamePaused");
} else {
_global.myRoot.gamePaused = false;
_global.myRoot.foreground.gotoAndStop("gameReady");
}
}
}
Frame 105
stop();
stopAllSounds();
quit = false;
faded = false;
submit = false;
replay = false;
core.happy.start(0, 1);
core.wind.start(0, 10000);
bonus = lives * 10;
score = score + bonus;
if (score <= 200) {
ninjaFingers.gotoAndStop(1);
}
if ((score > 200) and (score <= 300)) {
ninjaFingers.gotoAndStop(2);
}
if ((score > 300) and (score <= 400)) {
ninjaFingers.gotoAndStop(3);
}
if ((score > 400) and (score <= 500)) {
ninjaFingers.gotoAndStop(4);
}
if ((score > 500) and (score <= 600)) {
ninjaFingers.gotoAndStop(5);
}
if (score > 600) {
ninjaFingers.gotoAndStop(6);
}
replayButton.onRollOver = function () {
core.menuOver.start(0, 1);
};
replayButton.onRelease = function () {
fades.play();
menuDown.start();
replay = true;
};
submitButton.onRollOver = function () {
core.menuOver.start(0, 1);
};
submitButton.onPress = function () {
fades.play();
core.menuDown.start(0, 1);
submit = true;
};
ninjaFingers.rewardButton.onRelease = function () {
getURL ("http://www.ninjadoodle.com/", "_blank");
};
onEnterFrame = function () {
if (sound) {
soundSwitch.gotoAndStop("on");
} else {
soundSwitch.gotoAndStop("off");
}
if (score > 0) {
submitButton._visible = true;
} else {
submitButton._visible = false;
}
if (fades._currentframe == fades._totalframes) {
faded = true;
}
if (faded) {
faded = false;
if (quit) {
gotoAndStop ("menu");
}
if (submit) {
submit = false;
gotoAndStop ("submit");
}
if (replay) {
replay = false;
gotoAndStop ("advert");
}
}
};
Instance of Symbol 81 MovieClip in Frame 105
on (keyPress "s") {
if (_global.myRoot.sound) {
_global.myRoot.sound = false;
_global.myRoot.globalSound.setVolume(0);
} else {
_global.myRoot.sound = true;
_global.myRoot.globalSound.setVolume(100);
}
}
on (keyPress "q") {
if (!_global.myRoot.quit) {
_global.myRoot.quit = true;
_global.myRoot.fades.play();
}
}
on (keyPress "<Space>") {
if ((((_global.myRoot.gameReady and (!_global.myRoot.quit)) and (!_global.myRoot.miniGameWon)) and (!_global.myRoot.miniGameOver)) and (!_global.myRoot.gameOver)) {
if (!_global.myRoot.gamePaused) {
_global.myRoot.gamePaused = true;
_global.myRoot.foreground.gotoAndStop("gamePaused");
} else {
_global.myRoot.gamePaused = false;
_global.myRoot.foreground.gotoAndStop("gameReady");
}
}
}
Frame 106
stop();
stopAllSounds();
quit = false;
faded = false;
submit = false;
replay = false;
core.doom.start(0, 1);
core.wind.start(0, 10000);
if (score <= 200) {
ninjaFingers.gotoAndStop(1);
}
if ((score > 200) and (score <= 300)) {
ninjaFingers.gotoAndStop(2);
}
if ((score > 300) and (score <= 400)) {
ninjaFingers.gotoAndStop(3);
}
if ((score > 400) and (score <= 500)) {
ninjaFingers.gotoAndStop(4);
}
if ((score > 500) and (score <= 600)) {
ninjaFingers.gotoAndStop(5);
}
if (score > 600) {
ninjaFingers.gotoAndStop(6);
}
replayButton.onRollOver = function () {
core.menuOver.start(0, 1);
};
replayButton.onRelease = function () {
fades.play();
menuDown.start();
replay = true;
};
submitButton.onRollOver = function () {
core.menuOver.start(0, 1);
};
submitButton.onPress = function () {
fades.play();
core.menuDown.start(0, 1);
submit = true;
};
ninjaFingers.rewardButton.onRelease = function () {
getURL ("http://www.ninjadoodle.com/", "_blank");
};
onEnterFrame = function () {
if (sound) {
soundSwitch.gotoAndStop("on");
} else {
soundSwitch.gotoAndStop("off");
}
if (score > 0) {
submitButton._visible = true;
} else {
submitButton._visible = false;
}
if (fades._currentframe == fades._totalframes) {
faded = true;
}
if (faded) {
faded = false;
if (quit) {
gotoAndStop ("menu");
}
if (submit) {
submit = false;
gotoAndStop ("submit");
}
if (replay) {
replay = false;
if (score > 100) {
gotoAndStop ("advert");
} else {
gotoAndStop ("menu");
}
}
}
};
Instance of Symbol 81 MovieClip in Frame 106
on (keyPress "s") {
if (_global.myRoot.sound) {
_global.myRoot.sound = false;
_global.myRoot.globalSound.setVolume(0);
} else {
_global.myRoot.sound = true;
_global.myRoot.globalSound.setVolume(100);
}
}
on (keyPress "q") {
if (!_global.myRoot.quit) {
_global.myRoot.quit = true;
_global.myRoot.fades.play();
}
}
on (keyPress "<Space>") {
if ((((_global.myRoot.gameReady and (!_global.myRoot.quit)) and (!_global.myRoot.miniGameWon)) and (!_global.myRoot.miniGameOver)) and (!_global.myRoot.gameOver)) {
if (!_global.myRoot.gamePaused) {
_global.myRoot.gamePaused = true;
_global.myRoot.foreground.gotoAndStop("gamePaused");
} else {
_global.myRoot.gamePaused = false;
_global.myRoot.foreground.gotoAndStop("gameReady");
}
}
}
Frame 107
MochiAd.showInterLevelAd({id:"03d6eeae33ac5a38", res:"640x400"});
Frame 108
gotoAndStop ("menu");
Frame 109
stop();
mochi.MochiScores.showLeaderboard({boardID:"ed304ed2587bc9ba"});
Frame 110
_global.myRoot.gotoAndStop("menu");
Frame 111
stop();
mochi.MochiScores.showLeaderboard({boardID:"ed304ed2587bc9ba", score:score});
Frame 112
if (score > 100) {
gotoAndStop ("advert");
} else {
gotoAndStop ("menu");
}
Symbol 3 MovieClip [particle] Frame 10
stop();
this.removeMovieClip();
Symbol 6 MovieClip [particleShip] Frame 10
stop();
this.removeMovieClip();
Symbol 7 MovieClip [particleFade] Frame 10
stop();
this.removeMovieClip();
Symbol 9 MovieClip [player] Frame 1
stop();
Symbol 9 MovieClip [player] Frame 2
stop();
Symbol 444 MovieClip [__Packages.mochi.MochiServices] Frame 0
class mochi.MochiServices
{
static var _id, _container, _clip, _sendChannelName, _rcvChannelName, __get__comChannelName, onError, _listenChannel, _rcvChannel, _loader, _loaderListener, _sendChannel;
function MochiServices () {
}
static function get id() {
return(_id);
}
static function get clip() {
return(_container);
}
static function get childClip() {
return(_clip);
}
static function getVersion() {
return("1.32");
}
static function allowDomains(server) {
var _local1 = server.split("/")[2].split(":")[0];
if (System.security) {
if (System.security.allowDomain) {
System.security.allowDomain("*");
System.security.allowDomain(_local1);
}
if (System.security.allowInsecureDomain) {
System.security.allowInsecureDomain("*");
System.security.allowInsecureDomain(_local1);
}
}
return(_local1);
}
static function get isNetworkAvailable() {
if (System.security) {
var _local1 = System.security;
if (_local1.sandboxType == "localWithFile") {
return(false);
}
}
return(true);
}
static function set comChannelName(val) {
if (val != undefined) {
if (val.length > 3) {
_sendChannelName = val + "_fromgame";
_rcvChannelName = val;
initComChannels();
}
}
//return(__get__comChannelName());
}
static function get connected() {
return(_connected);
}
static function connect(id, clip, onError) {
if ((!_connected) && (_clip == undefined)) {
trace("MochiServices Connecting...");
_connecting = true;
init(id, clip);
}
if (onError != undefined) {
mochi.MochiServices.onError = onError;
} else if (mochi.MochiServices.onError == undefined) {
mochi.MochiServices.onError = function (errorCode) {
trace(errorCode);
};
}
}
static function disconnect() {
if (_connected || (_connecting)) {
_connecting = (_connected = false);
flush(true);
if (_clip != undefined) {
_clip.removeMovieClip();
delete _clip;
}
_listenChannel.close();
_rcvChannel.close();
}
}
static function init(id, clip) {
_id = id;
if (clip != undefined) {
_container = clip;
} else {
_container = _root;
}
loadCommunicator(id, _container);
}
static function loadCommunicator(id, clip) {
var _local2 = "_mochiservices_com_" + id;
if (_clip != null) {
return(_clip);
}
if (!isNetworkAvailable) {
return(null);
}
allowDomains(_gatewayURL);
_clip = clip.createEmptyMovieClip(_local2, 10336, false);
_loader = new MovieClipLoader();
if (_loaderListener.waitInterval != null) {
clearInterval(_loaderListener.waitInterval);
}
_loaderListener = {};
_loaderListener.onLoadError = function (target_mc, errorCode, httpStatus) {
trace("MochiServices could not load.");
mochi.MochiServices.disconnect();
mochi.MochiServices.onError.apply(null, [errorCode]);
};
_loaderListener.onLoadStart = function (target_mc) {
this.isLoading = true;
};
_loaderListener.startTime = getTimer();
_loaderListener.wait = function () {
if ((getTimer() - this.startTime) > 10000) {
if (!this.isLoading) {
mochi.MochiServices.disconnect();
mochi.MochiServices.onError.apply(null, ["IOError"]);
}
clearInterval(this.waitInterval);
}
};
_loaderListener.waitInterval = setInterval(_loaderListener, "wait", 1000);
_loader.addListener(_loaderListener);
_loader.loadClip(_gatewayURL, _clip);
_sendChannel = new LocalConnection();
_sendChannel._queue = [];
_rcvChannel = new LocalConnection();
_rcvChannel.allowDomain = function (d) {
return(true);
};
_rcvChannel.allowInsecureDomain = _rcvChannel.allowDomain;
_rcvChannel._nextcallbackID = 0;
_rcvChannel._callbacks = {};
listen();
return(_clip);
}
static function onStatus(infoObject) {
if (!(infoObject.level === "error")) {
} else {
_connected = false;
_listenChannel.connect(_listenChannelName);
}
}
static function listen() {
_listenChannel = new LocalConnection();
_listenChannel.handshake = function (args) {
mochi.MochiServices.__set__comChannelName(args.newChannel);
};
_listenChannel.allowDomain = function (d) {
return(true);
};
_listenChannel.allowInsecureDomain = _listenChannel.allowDomain;
_listenChannel.connect(_listenChannelName);
trace("Waiting for MochiAds services to connect...");
}
static function initComChannels() {
if (!_connected) {
_sendChannel.onStatus = function (infoObject) {
mochi.MochiServices.onStatus(infoObject);
};
_sendChannel.send(_sendChannelName, "onReceive", {methodName:"handshakeDone"});
_sendChannel.send(_sendChannelName, "onReceive", {methodName:"registerGame", id:_id, clip:_clip, version:getVersion()});
_rcvChannel.onStatus = function (infoObject) {
mochi.MochiServices.onStatus(infoObject);
};
_rcvChannel.onReceive = function (pkg) {
var _local5 = pkg.callbackID;
var _local4 = this._callbacks[_local5];
if (!_local4) {
return(undefined);
}
var _local2 = _local4.callbackMethod;
var _local3 = _local4.callbackObject;
if (_local3 && (typeof(_local2) == "string")) {
_local2 = _local3[_local2];
}
if (_local2 != undefined) {
_local2.apply(_local3, pkg.args);
}
delete this._callbacks[_local5];
};
_rcvChannel.onError = function () {
mochi.MochiServices.onError.apply(null, ["IOError"]);
};
_rcvChannel.connect(_rcvChannelName);
trace("connected!");
_connecting = false;
_connected = true;
_listenChannel.close();
while (_sendChannel._queue.length > 0) {
_sendChannel.send(_sendChannelName, "onReceive", _sendChannel._queue.shift());
}
}
}
static function flush(error) {
var _local1;
var _local2;
while (_sendChannel._queue.length > 0) {
_local1 = _sendChannel._queue.shift();
if (_local1.callbackID != null) {
_local2 = _rcvChannel._callbacks[_local1.callbackID];
}
delete _rcvChannel._callbacks[_local1.callbackID];
if (error) {
handleError(_local1.args, _local2.callbackObject, _local2.callbackMethod);
}
}
}
static function handleError(args, callbackObject, callbackMethod) {
if (args != null) {
if (args.onError != null) {
args.onError.apply(null, ["NotConnected"]);
}
if ((args.options != null) && (args.options.onError != null)) {
args.options.onError.apply(null, ["NotConnected"]);
}
}
if (callbackMethod != null) {
args = {};
args.error = true;
args.errorCode = "NotConnected";
if ((callbackObject != null) && (typeof(callbackMethod) == "string")) {
callbackObject[callbackMethod](args);
} else if (callbackMethod != null) {
callbackMethod.apply(args);
}
}
}
static function send(methodName, args, callbackObject, callbackMethod) {
if (_connected) {
_sendChannel.send(_sendChannelName, "onReceive", {methodName:methodName, args:args, callbackID:_rcvChannel._nextcallbackID});
} else {
if ((_clip == undefined) || (!_connecting)) {
onError.apply(null, ["NotConnected"]);
handleError(args, callbackObject, callbackMethod);
flush(true);
return(undefined);
}
_sendChannel._queue.push({methodName:methodName, args:args, callbackID:_rcvChannel._nextcallbackID});
}
_rcvChannel._callbacks[_rcvChannel._nextcallbackID] = {callbackObject:callbackObject, callbackMethod:callbackMethod};
_rcvChannel._nextcallbackID++;
}
static var _gatewayURL = "http://www.mochiads.com/static/lib/services/services.swf";
static var _listenChannelName = "__mochiservices";
static var _connecting = false;
static var _connected = false;
}
Symbol 445 MovieClip [__Packages.MochiAd] Frame 0
class MochiAd
{
function MochiAd () {
}
static function getVersion() {
return("2.5");
}
static function showPreGameAd(options) {
var _local26 = {clip:_root, ad_timeout:3000, fadeout_time:250, regpt:"o", method:"showPreloaderAd", color:16747008, background:16777161, outline:13994812, no_progress_bar:false, ad_started:function () {
this.clip.stop();
}, ad_finished:function () {
this.clip.play();
}, ad_failed:function () {
trace("[MochiAd] Couldn't load an ad, make sure that your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, ad_loaded:function (width, height) {
}, ad_skipped:function () {
}, ad_progress:function (percent) {
}};
options = _parseOptions(options, _local26);
if ("c862232051e0a94e1c3609b3916ddb17".substr(0) == "dfeada81ac97cde83665f81c12da7def") {
options.ad_started();
options.ad_finished();
return(undefined);
}
var clip = options.clip;
var _local22 = 11000;
var _local25 = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!load(options)) {
options.ad_failed();
options.ad_finished();
return(undefined);
}
options.ad_started();
var mc = clip._mochiad;
mc.onUnload = function () {
options.ad_finished();
};
var _local14 = _getRes(options);
var _local4 = _local14[0];
var _local13 = _local14[1];
mc._x = _local4 * 0.5;
mc._y = _local13 * 0.5;
var chk = mc.createEmptyMovieClip("_mochiad_wait", 3);
chk._x = _local4 * -0.5;
chk._y = _local13 * -0.5;
var _local6 = chk.createEmptyMovieClip("_mochiad_bar", 4);
if (options.no_progress_bar) {
_local6._visible = false;
delete options.no_progress_bar;
} else {
_local6._x = 10;
_local6._y = _local13 - 20;
}
var _local21 = options.color;
delete options.color;
var _local19 = options.background;
delete options.background;
var _local23 = options.outline;
delete options.outline;
var _local5 = _local6.createEmptyMovieClip("_outline", 1);
_local5.beginFill(_local19);
_local5.moveTo(0, 0);
_local5.lineTo(_local4 - 20, 0);
_local5.lineTo(_local4 - 20, 10);
_local5.lineTo(0, 10);
_local5.lineTo(0, 0);
_local5.endFill();
var _local3 = _local6.createEmptyMovieClip("_inside", 2);
_local3.beginFill(_local21);
_local3.moveTo(0, 0);
_local3.lineTo(_local4 - 20, 0);
_local3.lineTo(_local4 - 20, 10);
_local3.lineTo(0, 10);
_local3.lineTo(0, 0);
_local3.endFill();
_local3._xscale = 0;
var _local7 = _local6.createEmptyMovieClip("_outline", 3);
_local7.lineStyle(0, _local23, 100);
_local7.moveTo(0, 0);
_local7.lineTo(_local4 - 20, 0);
_local7.lineTo(_local4 - 20, 10);
_local7.lineTo(0, 10);
_local7.lineTo(0, 0);
chk.ad_msec = _local22;
chk.ad_timeout = _local25;
chk.started = getTimer();
chk.showing = false;
chk.last_pcnt = 0;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function () {
var _local2 = 100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time));
if (_local2 > 0) {
this._parent._alpha = _local2;
} else {
var _local3 = this._parent._parent;
MochiAd.unload(_local3);
delete this.onEnterFrame;
}
};
mc.lc.regContLC = function (lc_name) {
mc._containerLCName = lc_name;
};
var sendHostProgress = false;
mc.lc.sendHostLoadProgress = function (lc_name) {
sendHostProgress = true;
};
mc.lc.adLoaded = options.ad_loaded;
mc.lc.adSkipped = options.ad_skipped;
mc.lc.adjustProgress = function (msec) {
var _local2 = this.mc._mochiad_wait;
_local2.server_control = true;
_local2.started = getTimer();
_local2.ad_msec = msec;
};
mc.lc.rpc = function (callbackID, arg) {
MochiAd.rpc(clip, callbackID, arg);
};
mc.rpcTestFn = function (s) {
trace("[MOCHIAD rpcTestFn] " + s);
return(s);
};
chk.onEnterFrame = function () {
var _local6 = this._parent._parent;
var _local11 = this._parent._mochiad_ctr;
var _local5 = getTimer() - this.started;
var _local3 = false;
var _local4 = _local6.getBytesTotal();
var _local8 = _local6.getBytesLoaded();
var _local2 = (100 * _local8) / _local4;
var _local10 = (100 * _local5) / chk.ad_msec;
var _local9 = this._mochiad_bar._inside;
var _local13 = Math.min(100, Math.min(_local2 || 0, _local10));
_local13 = Math.max(this.last_pcnt, _local13);
this.last_pcnt = _local13;
_local9._xscale = _local13;
options.ad_progress(_local13);
if (sendHostProgress) {
clip._mochiad.lc.send(clip._mochiad._containerLCName, "notify", {id:"hostLoadPcnt", pcnt:_local2});
if (_local2 == 100) {
sendHostProgress = false;
}
}
if (!chk.showing) {
var _local7 = _local11.getBytesTotal();
if ((_local7 > 0) || (typeof(_local7) == "undefined")) {
chk.showing = true;
chk.started = getTimer();
} else if ((_local5 > chk.ad_timeout) && (_local2 == 100)) {
options.ad_failed();
_local3 = true;
}
}
if (_local5 > chk.ad_msec) {
_local3 = true;
}
if (((_local4 > 0) && (_local8 >= _local4)) && (_local3)) {
if (this.server_control) {
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = chk.fadeFunction;
}
}
};
}
static function showClickAwayAd(options) {
var _local9 = {clip:_root, ad_timeout:2000, fadeout_time:250, regpt:"o", method:"showClickAwayAd", res:"300x250", no_bg:true, ad_started:function () {
}, ad_finished:function () {
}, ad_loaded:function (width, height) {
}, ad_failed:function () {
trace("[MochiAd] Couldn't load an ad, make sure that your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, ad_skipped:function () {
}};
options = _parseOptions(options, _local9);
var clip = options.clip;
var _local8 = options.ad_timeout;
delete options.ad_timeout;
if (!load(options)) {
options.ad_failed();
options.ad_finished();
return(undefined);
}
options.ad_started();
var mc = clip._mochiad;
mc.onUnload = function () {
options.ad_finished();
};
var _local4 = _getRes(options);
var _local10 = _local4[0];
var _local7 = _local4[1];
mc._x = _local10 * 0.5;
mc._y = _local7 * 0.5;
var chk = mc.createEmptyMovieClip("_mochiad_wait", 3);
chk.ad_timeout = _local8;
chk.started = getTimer();
chk.showing = false;
mc.lc.adLoaded = options.ad_loaded;
mc.lc.adSkipped = options.ad_skipped;
mc.lc.rpc = function (callbackID, arg) {
MochiAd.rpc(clip, callbackID, arg);
};
mc.rpcTestFn = function (s) {
trace("[MOCHIAD rpcTestFn] " + s);
return(s);
};
var _local20 = false;
mc.lc.regContLC = function (lc_name) {
mc._containerLCName = lc_name;
};
chk.onEnterFrame = function () {
var _local5 = this._parent._mochiad_ctr;
var _local4 = getTimer() - this.started;
var _local2 = false;
if (!chk.showing) {
var _local3 = _local5.getBytesTotal();
if ((_local3 > 0) || (typeof(_local3) == "undefined")) {
_local2 = true;
chk.showing = true;
chk.started = getTimer();
} else if (_local4 > chk.ad_timeout) {
options.ad_failed();
_local2 = true;
}
}
if (_local2) {
delete this.onEnterFrame;
}
};
}
static function showInterLevelAd(options) {
var _local13 = {clip:_root, ad_timeout:2000, fadeout_time:250, regpt:"o", method:"showTimedAd", ad_started:function () {
this.clip.stop();
}, ad_finished:function () {
this.clip.play();
}, ad_failed:function () {
trace("[MochiAd] Couldn't load an ad, make sure that your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, ad_loaded:function (width, height) {
}, ad_skipped:function () {
}};
options = _parseOptions(options, _local13);
var clip = options.clip;
var _local10 = 11000;
var _local12 = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!load(options)) {
options.ad_failed();
options.ad_finished();
return(undefined);
}
options.ad_started();
var mc = clip._mochiad;
mc.onUnload = function () {
options.ad_finished();
};
var _local5 = _getRes(options);
var _local14 = _local5[0];
var _local11 = _local5[1];
mc._x = _local14 * 0.5;
mc._y = _local11 * 0.5;
var chk = mc.createEmptyMovieClip("_mochiad_wait", 3);
chk.ad_msec = _local10;
chk.ad_timeout = _local12;
chk.started = getTimer();
chk.showing = false;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function () {
var _local2 = 100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time));
if (_local2 > 0) {
this._parent._alpha = _local2;
} else {
var _local3 = this._parent._parent;
MochiAd.unload(_local3);
delete this.onEnterFrame;
}
};
mc.lc.adLoaded = options.ad_loaded;
mc.lc.adSkipped = options.ad_skipped;
mc.lc.adjustProgress = function (msec) {
var _local2 = this.mc._mochiad_wait;
_local2.server_control = true;
_local2.started = getTimer();
_local2.ad_msec = msec - 250;
};
mc.lc.rpc = function (callbackID, arg) {
MochiAd.rpc(clip, callbackID, arg);
};
mc.rpcTestFn = function (s) {
trace("[MOCHIAD rpcTestFn] " + s);
return(s);
};
chk.onEnterFrame = function () {
var _local5 = this._parent._mochiad_ctr;
var _local4 = getTimer() - this.started;
var _local2 = false;
if (!chk.showing) {
var _local3 = _local5.getBytesTotal();
if ((_local3 > 0) || (typeof(_local3) == "undefined")) {
chk.showing = true;
chk.started = getTimer();
} else if (_local4 > chk.ad_timeout) {
options.ad_failed();
_local2 = true;
}
}
if (_local4 > chk.ad_msec) {
_local2 = true;
}
if (_local2) {
if (this.server_control) {
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = this.fadeFunction;
}
}
};
}
static function showPreloaderAd(options) {
trace("[MochiAd] DEPRECATED: showPreloaderAd was renamed to showPreGameAd in 2.0");
showPreGameAd(options);
}
static function showTimedAd(options) {
trace("[MochiAd] DEPRECATED: showTimedAd was renamed to showInterLevelAd in 2.0");
showInterLevelAd(options);
}
static function _allowDomains(server) {
var _local1 = server.split("/")[2].split(":")[0];
if (System.security) {
if (System.security.allowDomain) {
System.security.allowDomain("*");
System.security.allowDomain(_local1);
}
if (System.security.allowInsecureDomain) {
System.security.allowInsecureDomain("*");
System.security.allowInsecureDomain(_local1);
}
}
return(_local1);
}
static function load(options) {
var _local13 = {clip:_root, server:"http://x.mochiads.com/srv/1/", method:"load", depth:10333, id:"_UNKNOWN_"};
options = _parseOptions(options, _local13);
options.swfv = options.clip.getSWFVersion() || 6;
options.mav = getVersion();
var _local9 = options.clip;
if (!_isNetworkAvailable()) {
return(null);
}
if (_local9._mochiad_loaded) {
return(null);
}
var _local12 = options.depth;
delete options.depth;
var _local6 = _local9.createEmptyMovieClip("_mochiad", _local12);
var _local11 = _getRes(options);
options.res = (_local11[0] + "x") + _local11[1];
options.server = options.server + options.id;
delete options.id;
_local9._mochiad_loaded = true;
var _local4 = _local6.createEmptyMovieClip("_mochiad_ctr", 1);
for (var _local7 in options) {
_local4[_local7] = options[_local7];
}
var _local10 = _local4.server;
delete _local4.server;
var _local14 = _allowDomains(_local10);
_local6.onEnterFrame = function () {
if (this._mochiad_ctr._url != this._url) {
this.onEnterFrame = function () {
if (!this._mochiad_ctr) {
delete this.onEnterFrame;
MochiAd.unload(this._parent);
}
};
}
};
var _local5 = new LocalConnection();
var _local8 = ["", Math.floor(new Date().getTime()), random(999999)].join("_");
_local5.mc = _local6;
_local5.name = _local8;
_local5.hostname = _local14;
_local5.allowDomain = function (d) {
return(true);
};
_local5.allowInsecureDomain = _local5.allowDomain;
_local5.connect(_local8);
_local6.lc = _local5;
_local4.lc = _local8;
_local4.st = getTimer();
_local4.loadMovie(_local10 + ".swf", "POST");
return(_local6);
}
static function unload(clip) {
if (typeof(clip) == "undefined") {
clip = _root;
}
if (clip.clip && (clip.clip._mochiad)) {
clip = clip.clip;
}
if (!clip._mochiad) {
return(false);
}
if (clip._mochiad._containerLCName != undefined) {
clip._mochiad.lc.send(clip._mochiad._containerLCName, "notify", {id:"unload"});
}
clip._mochiad.removeMovieClip();
delete clip._mochiad_loaded;
delete clip._mochiad;
return(true);
}
static function _isNetworkAvailable() {
if (System.security) {
var _local1 = System.security;
if (_local1.sandboxType == "localWithFile") {
return(false);
}
}
return(true);
}
static function _getRes(options) {
var _local3 = options.clip.getBounds();
var _local2 = 0;
var _local1 = 0;
if (typeof(options.res) != "undefined") {
var _local4 = options.res.split("x");
_local2 = parseFloat(_local4[0]);
_local1 = parseFloat(_local4[1]);
} else {
_local2 = _local3.xMax - _local3.xMin;
_local1 = _local3.yMax - _local3.yMin;
}
if ((_local2 == 0) || (_local1 == 0)) {
_local2 = Stage.width;
_local1 = Stage.height;
}
return([_local2, _local1]);
}
static function _parseOptions(options, defaults) {
var _local4 = {};
for (var _local8 in defaults) {
_local4[_local8] = defaults[_local8];
}
if (options) {
for (var _local8 in options) {
_local4[_local8] = options[_local8];
}
}
if (_root.mochiad_options) {
var _local5 = _root.mochiad_options.split("&");
var _local2 = 0;
while (_local2 < _local5.length) {
var _local3 = _local5[_local2].split("=");
_local4[unescape(_local3[0])] = unescape(_local3[1]);
_local2++;
}
}
if (_local4.id == "test") {
trace("[MochiAd] WARNING: Using the MochiAds test identifier, make sure to use the code from your dashboard, not this example!");
}
return(_local4);
}
static function rpc(clip, callbackID, arg) {
switch (arg.id) {
case "setValue" :
setValue(clip, arg.objectName, arg.value);
break;
case "getValue" :
var _local4 = getValue(clip, arg.objectName);
clip._mochiad.lc.send(clip._mochiad._containerLCName, "rpcResult", callbackID, _local4);
break;
case "runMethod" :
var _local3 = runMethod(clip, arg.method, arg.args);
clip._mochiad.lc.send(clip._mochiad._containerLCName, "rpcResult", callbackID, _local3);
break;
default :
trace("[mochiads rpc] unknown rpc id: " + arg.id);
}
}
static function setValue(base, objectName, value) {
var _local2 = objectName.split(".");
var _local1;
_local1 = 0;
while (_local1 < (_local2.length - 1)) {
if ((base[_local2[_local1]] == undefined) || (base[_local2[_local1]] == null)) {
return(undefined);
}
base = base[_local2[_local1]];
_local1++;
}
base[_local2[_local1]] = value;
}
static function getValue(base, objectName) {
var _local2 = objectName.split(".");
var _local1;
_local1 = 0;
while (_local1 < (_local2.length - 1)) {
if ((base[_local2[_local1]] == undefined) || (base[_local2[_local1]] == null)) {
return(undefined);
}
base = base[_local2[_local1]];
_local1++;
}
return(base[_local2[_local1]]);
}
static function runMethod(base, methodName, argsArray) {
var _local2 = methodName.split(".");
var _local1;
_local1 = 0;
while (_local1 < (_local2.length - 1)) {
if ((base[_local2[_local1]] == undefined) || (base[_local2[_local1]] == null)) {
return(undefined);
}
base = base[_local2[_local1]];
_local1++;
}
if (typeof(base[_local2[_local1]]) == "function") {
return(base[_local2[_local1]].apply(base, argsArray));
}
return(undefined);
}
}
Symbol 446 MovieClip [__Packages.mochi.MochiScores] Frame 0
class mochi.MochiScores
{
static var boardID, onClose, onError;
function MochiScores () {
}
static function setBoardID(boardID) {
mochi.MochiScores.boardID = boardID;
mochi.MochiServices.send("scores_setBoardID", {boardID:boardID});
}
static function showLeaderboard(options) {
if (options.clip != null) {
if ((options.clip != mochi.MochiServices.__get__clip()) || (mochi.MochiServices.__get__childClip()._target == undefined)) {
mochi.MochiServices.disconnect();
mochi.MochiServices.connect(mochi.MochiServices.__get__id(), options.clip);
}
delete options.clip;
}
if (options.name != null) {
if (typeof(options.name) == "object") {
if (options.name.text != undefined) {
options.name = options.name.text;
}
}
}
if (options.score != null) {
if (typeof(options.score) == "object") {
if (options.score.text != undefined) {
options.score = options.score.text;
}
}
}
if (options.onDisplay != null) {
options.onDisplay();
} else {
mochi.MochiServices.__get__clip().stop();
}
if (options.onClose != null) {
onClose = options.onClose;
} else {
onClose = function () {
mochi.MochiServices.__get__clip().play();
};
}
if (options.onError != null) {
onError = options.onError;
} else {
onError = onClose;
}
if (options.boardID == null) {
if (boardID != null) {
options.boardID = boardID;
}
}
mochi.MochiServices.send("scores_showLeaderboard", {options:options}, null, doClose);
}
static function closeLeaderboard() {
mochi.MochiServices.send("scores_closeLeaderboard");
}
static function getPlayerInfo(callbackObj, callbackMethod) {
mochi.MochiServices.send("scores_getPlayerInfo", null, callbackObj, callbackMethod);
}
static function submit(score, name, callbackObj, callbackMethod) {
mochi.MochiServices.send("scores_submit", {score:score, name:name}, callbackObj, callbackMethod);
}
static function requestList(callbackObj, callbackMethod) {
mochi.MochiServices.send("scores_requestList", null, callbackObj, callbackMethod);
}
static function scoresArrayToObjects(scores) {
var _local5 = {};
var _local1;
var _local4;
var _local2;
var _local6;
for (var _local8 in scores) {
if (typeof(scores[_local8]) == "object") {
if ((scores[_local8].cols != null) && (scores[_local8].rows != null)) {
_local5[_local8] = [];
_local2 = scores[_local8];
_local4 = 0;
while (_local4 < _local2.rows.length) {
_local6 = {};
_local1 = 0;
while (_local1 < _local2.cols.length) {
_local6[_local2.cols[_local1]] = _local2.rows[_local4][_local1];
_local1++;
}
_local5[_local8].push(_local6);
_local4++;
}
} else {
_local5[_local8] = {};
for (var _local7 in scores[_local8]) {
_local5[_local8][_local7] = scores[_local8][_local7];
}
}
} else {
_local5[_local8] = scores[_local8];
}
}
return(_local5);
}
static function doClose(args) {
if (args.error == true) {
if (args.errorCode == undefined) {
args.errorCode = "IOError";
}
onError.apply(null, [args.errorCode]);
} else {
onClose.apply();
}
}
}
Symbol 39 MovieClip Frame 1
stop();
Symbol 63 MovieClip Frame 1
stop();
Symbol 63 MovieClip Frame 2
stop();
Symbol 67 MovieClip Frame 1
stop();
Symbol 67 MovieClip Frame 2
stop();
Symbol 89 MovieClip Frame 11
stop();
Symbol 89 MovieClip Frame 12
play();
Symbol 89 MovieClip Frame 21
stop();
Symbol 111 MovieClip Frame 50
stop();
Symbol 112 MovieClip Frame 1
stop();
Symbol 112 MovieClip Frame 2
play();
Symbol 112 MovieClip Frame 75
stop();
Symbol 125 MovieClip Frame 1
stop();
Symbol 125 MovieClip Frame 2
play();
Symbol 125 MovieClip Frame 9
stop();
Symbol 127 MovieClip Frame 1
stop();
Symbol 127 MovieClip Frame 2
play();
Symbol 127 MovieClip Frame 9
stop();
Symbol 129 MovieClip Frame 1
stop();
Symbol 129 MovieClip Frame 2
play();
Symbol 129 MovieClip Frame 9
stop();
Symbol 131 MovieClip Frame 1
stop();
Symbol 131 MovieClip Frame 2
play();
Symbol 131 MovieClip Frame 9
stop();
Symbol 133 MovieClip Frame 1
stop();
Symbol 133 MovieClip Frame 2
play();
Symbol 133 MovieClip Frame 9
stop();
Symbol 135 MovieClip Frame 1
stop();
Symbol 135 MovieClip Frame 2
play();
Symbol 135 MovieClip Frame 9
stop();
Symbol 137 MovieClip Frame 1
stop();
Symbol 137 MovieClip Frame 2
play();
Symbol 137 MovieClip Frame 9
stop();
Symbol 158 MovieClip Frame 1
stop();
Symbol 158 MovieClip Frame 2
play();
Symbol 158 MovieClip Frame 9
stop();
Symbol 165 MovieClip Frame 1
stop();
Symbol 165 MovieClip Frame 2
stop();
Symbol 168 MovieClip Frame 1
stop();
Symbol 168 MovieClip Frame 2
stop();
Symbol 171 MovieClip Frame 1
stop();
Symbol 171 MovieClip Frame 2
stop();
Symbol 174 MovieClip Frame 1
stop();
Symbol 174 MovieClip Frame 2
stop();
Symbol 177 MovieClip Frame 1
stop();
Symbol 177 MovieClip Frame 2
stop();
Symbol 178 MovieClip Frame 1
stop();
Symbol 178 MovieClip Frame 2
play();
Symbol 178 MovieClip Frame 22
stop();
Symbol 180 MovieClip Frame 1
stop();
Symbol 180 MovieClip Frame 2
stop();
Symbol 182 MovieClip Frame 1
stop();
Symbol 182 MovieClip Frame 2
stop();
Symbol 184 MovieClip Frame 1
stop();
Symbol 184 MovieClip Frame 2
stop();
Symbol 190 MovieClip Frame 1
stop();
Symbol 190 MovieClip Frame 2
stop();
Symbol 192 MovieClip Frame 1
stop();
Symbol 192 MovieClip Frame 2
stop();
Symbol 202 MovieClip Frame 1
stop();
Symbol 202 MovieClip Frame 2
stop();
Symbol 202 MovieClip Frame 3
stop();
Symbol 202 MovieClip Frame 4
stop();
Symbol 202 MovieClip Frame 5
stop();
Symbol 210 MovieClip Frame 1
stop();
Symbol 210 MovieClip Frame 2
play();
Symbol 210 MovieClip Frame 10
stop();
Symbol 213 MovieClip Frame 1
stop();
Symbol 213 MovieClip Frame 2
play();
Symbol 213 MovieClip Frame 10
stop();
Symbol 216 MovieClip Frame 1
stop();
Symbol 216 MovieClip Frame 2
play();
Symbol 216 MovieClip Frame 10
stop();
Symbol 219 MovieClip Frame 1
stop();
Symbol 219 MovieClip Frame 2
play();
Symbol 219 MovieClip Frame 10
stop();
Symbol 222 MovieClip Frame 1
stop();
Symbol 222 MovieClip Frame 2
play();
Symbol 222 MovieClip Frame 10
stop();
Symbol 225 MovieClip Frame 1
stop();
Symbol 225 MovieClip Frame 2
play();
Symbol 225 MovieClip Frame 10
stop();
Symbol 228 MovieClip Frame 1
stop();
Symbol 228 MovieClip Frame 2
play();
Symbol 228 MovieClip Frame 10
stop();
Symbol 231 MovieClip Frame 1
stop();
Symbol 231 MovieClip Frame 2
play();
Symbol 231 MovieClip Frame 10
stop();
Symbol 234 MovieClip Frame 1
stop();
Symbol 234 MovieClip Frame 2
play();
Symbol 234 MovieClip Frame 15
stop();
Symbol 259 MovieClip Frame 1
stop();
Symbol 259 MovieClip Frame 2
stop();
Symbol 271 MovieClip Frame 1
stop();
Symbol 271 MovieClip Frame 2
play();
Symbol 278 MovieClip Frame 1
stop();
Symbol 278 MovieClip Frame 2
play();
Symbol 278 MovieClip Frame 8
stop();
Symbol 304 MovieClip Frame 1
stop();
Symbol 304 MovieClip Frame 2
stop();
Symbol 304 MovieClip Frame 3
play();
Symbol 304 MovieClip Frame 15
stop();
Symbol 308 MovieClip Frame 1
stop();
Symbol 308 MovieClip Frame 2
stop();
Symbol 308 MovieClip Frame 3
play();
Symbol 308 MovieClip Frame 15
stop();
Symbol 312 MovieClip Frame 1
stop();
Symbol 312 MovieClip Frame 2
stop();
Symbol 312 MovieClip Frame 3
play();
Symbol 312 MovieClip Frame 15
stop();
Symbol 323 MovieClip Frame 1
stop();
Symbol 323 MovieClip Frame 2
stop();
Symbol 329 MovieClip Frame 1
stop();
Symbol 329 MovieClip Frame 2
stop();
Symbol 331 MovieClip Frame 1
stop();
Symbol 331 MovieClip Frame 2
stop();
Symbol 333 MovieClip Frame 1
stop();
Symbol 333 MovieClip Frame 2
stop();
Symbol 335 MovieClip Frame 1
stop();
Symbol 335 MovieClip Frame 2
stop();
Symbol 337 MovieClip Frame 1
stop();
Symbol 337 MovieClip Frame 2
stop();
Symbol 346 MovieClip Frame 1
stop();
Symbol 346 MovieClip Frame 2
play();
Symbol 346 MovieClip Frame 11
stop();
Symbol 355 MovieClip Frame 1
stop();
Symbol 355 MovieClip Frame 2
stop();
Symbol 358 MovieClip Frame 1
stop();
Symbol 358 MovieClip Frame 2
stop();
Symbol 361 MovieClip Frame 1
stop();
Symbol 361 MovieClip Frame 2
stop();
Symbol 364 MovieClip Frame 1
stop();
Symbol 364 MovieClip Frame 2
stop();
Symbol 375 MovieClip Frame 1
stop();
Symbol 375 MovieClip Frame 2
stop();
Symbol 385 MovieClip Frame 1
stop();
Symbol 385 MovieClip Frame 2
stop();
Symbol 420 MovieClip Frame 1
stop();
Symbol 420 MovieClip Frame 2
stop();
Symbol 420 MovieClip Frame 3
stop();
Symbol 420 MovieClip Frame 4
stop();
Symbol 420 MovieClip Frame 5
stop();
Symbol 420 MovieClip Frame 6
stop();