Frame 1
function initGameVars() {
levelOrbs = new Array(55);
levelTimes = new Array(55);
levelScores = new Array(55);
levelMedals = new Array(55);
i = 0;
while (i < 55) {
levelOrbs[i] = 0;
levelTimes[i] = 0;
levelScores[i] = 0;
levelMedals[i] = 4;
i++;
}
worldSelect = 0;
worldLevelSelect = 0;
levelSelect = 0;
completeLevels = 0;
limitLevel = 1;
limitWorld = 1;
pointerFrame = 1;
bgFrame = 1;
bgFixed = false;
spinDir = 1;
gameQual = 1;
musicOn = 1;
menuType = 1;
levelNames = new Array("Tutorial", "Grey=Good, Green=Bad", "Cloudy With A Chance Of Meteors", "Chain Reaction", "Cursor Enlargement", "Out Of Control", "Rolling Stones", "This Was A Triumph", "That's Just Swell", "Switches: Friend Or Foe", "That's No Moon", "Divide And Conquer", "Supersize Me", "There's Always One", "Shooting Squad", "That Sinking Feeling", "Unstoppable Force Invisible Cursor", "Timing Is Everything", "This Just Keeps Getting Better", "As If It Wasn't Hard Enough Already", "Why Are There So Many Tangerines?", "Go Go Gadget Boss", "Prioritize", "Shooting Range", "Jigsaw Killer", "Rows vs Columns", "Fix Your Own Plumbing", "No Access", "15", "If You Can't Beat Them...", "Send In The Robot", "Survival Of The Fittest", "Simon Says", "Rocket Science", "Clockwork Cursor", "Timed Levels Are Still Fun Right?", "Blockage In The Maze", "Don't Get Stuck!", "Movin' On Up", "Steady Hand", "No Escape", "Impossible Level #1", "Window Of Oportunity", "Old School", "Ghostly Presence", "Rapid Fire", "Gift And A Curse", "Now You See Them", "Avoiding The Problem", "Balloons: Nature's Killers", "May Contain Sharp Objects", "Cursoroids?", "Point The Way", "Centre Of The Universe", "Revenge");
adjustedLevels = new Array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 39, 47, 35, 30, 26, 27, 52, 48, 43, 51, 33, 25, 19, 14, 12, 16, 17, 23, 21, 29, 15, 22, 13, 18, 28, 42, 24, 34, 46, 50, 20, 54, 44, 31, 38, 40, 41, 32, 36, 37, 35, 39, 53, 55);
medalNames = new Array("Gold", "Silver", "Bronze", "No Medal");
cursorNames = new Array("Default", "Aero", "Hand", "Mac", "Pointer");
qualityNames = new Array("High", "Medium", "Low");
worldNames = new Array("Tutorial", "Skill", "Puzzle", "Maze", "Last Frontier");
menuNames = new Array("New", "Original");
UIFrozen = false;
shouldRaise = true;
totalScore = 0;
lastRail = 0;
lastWorldRail = 0;
worldOverviewY = -10;
startLevelFrame = 30;
bgNum = 6;
subRaise = false;
tempLevelCode = "";
tempLevelPosition = 0;
regen = false;
customBackFrame = 15;
fromCust = false;
cursorHeightArray = new Array(0, 12, 10, 13, 11, 20);
cursorWidthArray = new Array(0, 6.2, 7.3, 10, 6.5, 4);
mKeyDown = false;
qKeyDown = false;
shownMedalsText = false;
shownScrollFast = false;
autoTips = true;
}
function initAverages() {
averageOrbs = new Array(0, 0, 0, 0, 0);
averageTimes = new Array(0, 0, 0, 0, 0);
averageMedals = new Array(0, 0, 0, 0, 0);
averageScores = new Array(0, 0, 0, 0, 0);
percentCompletes = new Array(0, 0, 0, 0, 0);
}
function getSaveGame() {
saveData = SharedObject.getLocal("CA4_SaveGame");
customLevels = SharedObject.getLocal("CA4_CustomLevels");
}
function createSaveData() {
if ((saveData.data.madeData == undefined) || (saveData.data.madeData == false)) {
saveGame();
saveData.data.madeData = true;
}
if (!customLevels.data.madeData) {
customLevels.data.levels = new Array(10);
i = 0;
while (i < 10) {
customLevels.data.levels[i] = "empty";
i++;
}
customLevels.data.madeData = true;
}
}
function saveGame() {
saveData.data.levelOrbs = levelOrbs;
saveData.data.levelTimes = levelTimes;
saveData.data.levelScores = levelScores;
saveData.data.levelMedals = levelMedals;
saveData.data.worldSelect = worldSelect;
saveData.data.worldLevelSelect = worldLevelSelect;
saveData.data.levelSelect = levelSelect;
saveData.data.completeLevels = completeLevels;
saveData.data.limitLevel = limitLevel;
saveData.data.limitWorld = limitWorld;
saveData.data.pointerFrame = pointerFrame;
saveData.data.bgFrame = bgFrame;
saveData.data.bgFixed = bgFixed;
saveData.data.spinDir = spinDir;
saveData.data.gameQual = gameQual;
saveData.data.musicOn = musicOn;
saveData.data.menuType = menuType;
}
function loadGame() {
levelOrbs = saveData.data.levelOrbs;
levelTimes = saveData.data.levelTimes;
levelScores = saveData.data.levelScores;
levelMedals = saveData.data.levelMedals;
worldSelect = saveData.data.worldSelect;
worldLevelSelect = saveData.data.worldLevelSelect;
levelSelect = saveData.data.levelSelect;
completeLevels = saveData.data.completeLevels;
limitLevel = saveData.data.limitLevel;
limitWorld = saveData.data.limitWorld;
pointerFrame = saveData.data.pointerFrame;
bgFrame = saveData.data.bgFrame;
bgFixed = saveData.data.bgFixed;
spinDir = saveData.data.spinDir;
gameQual = saveData.data.gameQual;
musicOn = saveData.data.musicOn;
menuType = saveData.data.menuType;
}
function newGame() {
saveData.data.madeData = false;
initGameVars();
createSaveData();
saveGame();
}
function checkPress() {
onMouseDown = function () {
if ((((_root._currentframe != 1) && (_root._currentframe != 17)) && (_root._currentframe != 22)) && (_root._currentframe != 24)) {
Mouse.hide();
}
cursor.pressed = true;
oX = cursor._x;
oY = cursor._y;
};
onMouseUp = function () {
cursor.pressed = false;
};
}
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);
}
function doSomething() {
}
urlStart = _url.indexOf("://") + 3;
urlEnd = _url.indexOf("/", urlStart);
domain = _url.substring(urlStart, urlEnd);
LastDot = domain.lastIndexOf(".") - 1;
domEnd = domain.lastIndexOf(".", LastDot) + 1;
domain = domain.substring(domEnd, domain.length);
siteLocking = false;
if (siteLocking) {
if (domain != "flashgamelicense.com") {
_x = 10000;
attachMovie("siteLocked", "siteLocked", _root.getNextHighestDepth());
siteLocked._x = -10000;
}
}
initGameVars();
getSaveGame();
if (saveData.data.madeData) {
loadGame();
} else {
createSaveData();
}
checkPress();
rightClickMenu = new ContextMenu();
rightClickMenu.hideBuiltInItems();
Functioned = new ContextMenuItem("Created by Paul Hogg 2010", doSomething);
rightClickMenu.customItems.push(Functioned);
_root.menu = rightClickMenu;
stop();
mochi.as2.MochiServices.connect("05b50a1e3ed346a0");
__com_mochibot__("21c7a5de", this, 10301, true);
__com_mochibot__("8425661f", this, 10301, true);
i = 1;
while (i <= 13) {
fO = _root["fo" + i];
tDegree = (i - 1) * 27.6923076923077;
fO.range = 180;
fO._x = 300 + (Math.sin((Math.PI/180) * tDegree) * fO.range);
fO._y = 225 - (Math.cos((Math.PI/180) * tDegree) * fO.range);
fO.sS = 0;
fO.sSS = 0;
i++;
}
spinSpeed = 0;
extraRot = 0;
totalBytes = _root.getBytesTotal();
beginButton.onRelease = function () {
if (loadedBytes == totalBytes) {
gotoAndStop (2);
}
};
loadingCircle.bGamesLogo.onRelease = function () {
getURL ("http://www.bgames.com/?utm_source=sponsor_game&utm_medium=loading&utm_campaign=Cursor-Attack-4", "_new");
};
beginButton._visible = false;
sizeChanger = 0;
rangeChanger = 0;
onEnterFrame = function () {
loadedBytes = _root.getBytesLoaded();
fraction = loadedBytes / totalBytes;
loadingCircle.loader.gotoAndStop(Math.floor(13 * fraction));
if (beginButton.sScale == undefined) {
beginButton.sScale = beginButton._xscale;
}
if (beginButton.hitTest(_xmouse, _ymouse, true)) {
beginButton._xscale = beginButton._xscale + (((beginButton.sScale + 20) - beginButton._xscale) / 3);
beginButton._yscale = beginButton._yscale + (((beginButton.sScale + 20) - beginButton._yscale) / 3);
} else {
beginButton._xscale = beginButton._xscale + ((beginButton.sScale - beginButton._xscale) / 3);
beginButton._yscale = beginButton._yscale + ((beginButton.sScale - beginButton._yscale) / 3);
}
if (spinSpeed < 0.65) {
spinSpeed = spinSpeed + 0.05;
}
if (loadedBytes == totalBytes) {
if (!beginButton._visible) {
beginButton._visible = true;
}
}
sizeChanger = sizeChanger + 2.5;
rangeChanger = rangeChanger + 0.5;
extraRot = extraRot + spinSpeed;
i = 1;
while (i <= 13) {
fO = _root["fo" + i];
tDegree = ((i - 1) * 27.6923076923077) + extraRot;
fO._x = 300 + (Math.sin((Math.PI/180) * tDegree) * fO.range);
fO._y = 225 - (Math.cos((Math.PI/180) * tDegree) * fO.range);
fO._rotation = fO._rotation + fO.sS;
fO.dis = Math.sqrt(Math.pow(_xmouse - fO._x, 2) + Math.pow(_ymouse - fO._y, 2));
fO.sS = fO.sS + fO.sSS;
fO._xscale = (fO._yscale = 100 + (40 * Math.sin((Math.PI/180) * (sizeChanger + tDegree))));
if (fO.dis < 150) {
fO.sSS = (150 - fO.dis) / 300;
} else {
fO.sSS = 0;
fO.sS = fO.sS * 0.92;
}
i++;
}
};
Frame 2
function initArrays() {
bullets = new Array();
greys = new Array();
shooters = new Array();
orbs = new Array();
meteors = new Array();
greens = new Array();
ghosts = new Array();
crystals = new Array();
spinners = new Array();
clouds = new Array();
bombs = new Array();
blades = new Array();
bits = new Array();
shields = new Array();
portals = new Array();
switches = new Array();
stones = new Array();
swells = new Array();
rockets = new Array();
blockers = new Array();
pauses = new Array();
}
function initCursor() {
cursor.xSpeed = 0;
cursor.ySpeed = 0;
cursor.dir = 1;
cursor.spinning = false;
cursor.spinSpeed = 0;
cursor.eScale = 100;
cursor.eAlpha = 100;
cursor.rotSpeed = 0;
cursor.ease = 2;
cursor.propEase = 4;
cursor.reload = 0;
cursor.canShoot = true;
cursor.firstShot = false;
cursor.pressed = false;
cursor.dead = false;
cursor.gotoAndStop(pointerFrame);
Mouse.hide();
if (bgFixed) {
bg.reel._y = (bgFrame - 1) * -450;
} else {
bg.reel._y = (Math.ceil(levelSelect / 9.16666666666667) - 1) * -450;
}
_root._quality = qualityNames[gameQual - 1];
}
function initGame() {
game = [];
game.totOrbs = 0;
game.colOrbs = 0;
game.disOrbs = 0;
game.deathTimer = 0;
game.endTimer = 0;
game.shoveOrbs = true;
cursor.canShoot = true;
cursor.reloadSpeed = 3;
game.paused = false;
game.removalArray = new Array();
cursor.cursorHeight = cursorHeightArray[pointerFrame];
cursor.cursorWidth = cursorWidthArray[pointerFrame];
game.downSize = 10;
game.menuScreen = 89 + worldSelect;
game.waitTime = 30;
game.timer = 0;
game.canThink = true;
game.thoughtText = "I'm just a cursor, what do I know?";
game.thoughtTimer = 0;
i = 1;
while (i <= 3) {
t = attachMovie("thought" + i, "thought" + i, _root.getNextHighestDepth());
if (i == 1) {
t._x = cursor._x + 12;
t._y = cursor._y - 10;
}
if (i == 2) {
t._x = cursor._x + 28;
t._y = cursor._y - 28;
}
if (i == 3) {
t._x = cursor._x + 130;
t._y = cursor._y - 60;
}
t.ease = i * 3;
t._visible = false;
t.thoughtText = game.thoughtText;
t.eX = t._x;
t.eY = t._y;
t.eA = 0;
t._alpha = 0;
i++;
}
_root.attachMovie("orbBar", "bar", _root.getNextHighestDepth());
game.barWidth = bar._width;
game.barScale = 0;
bar._xscale = 0;
bar._x = 10;
bar._y = 15;
_root.attachMovie("levnum", "levnum", _root.getNextHighestDepth());
levnum._x = 65;
levnum._y = 420;
levnum.levelnumber = "Level " + levelSelect;
}
function moveCursor() {
cursor.xSpeed = (_xmouse - cursor._x) / cursor.ease;
cursor.ySpeed = (_ymouse - cursor._y) / cursor.ease;
cursor._x = cursor._x + cursor.xSpeed;
cursor._y = cursor._y + cursor.ySpeed;
}
function hideCursor() {
if ((((_xmouse < 600) && (_xmouse > 0)) && (_ymouse < 450)) && (_ymouse > 0)) {
}
}
function rotateCursor(dir) {
if (!cursor.spinning) {
if (spinDir == 1) {
if (Key.isDown(37) || (Key.isDown(65))) {
if (cursor.rotSpeed > -15) {
cursor.rotSpeed = cursor.rotSpeed - 3;
}
} else if (Key.isDown(39) || (Key.isDown(68))) {
if (cursor.rotSpeed < 15) {
cursor.rotSpeed = cursor.rotSpeed + 3;
}
} else {
cursor.rotSpeed = cursor.rotSpeed * 0.5;
}
} else if (Key.isDown(39) || (Key.isDown(68))) {
if (cursor.rotSpeed > -15) {
cursor.rotSpeed = cursor.rotSpeed - 3;
}
} else if (Key.isDown(37) || (Key.isDown(65))) {
if (cursor.rotSpeed < 15) {
cursor.rotSpeed = cursor.rotSpeed + 3;
}
} else {
cursor.rotSpeed = cursor.rotSpeed * 0.5;
}
}
cursor._rotation = cursor._rotation + cursor.rotSpeed;
}
function scaleCursor() {
cursor._xscale = cursor._xscale + ((cursor.eScale - cursor._xscale) / cursor.propEase);
cursor._yscale = cursor._yscale + ((cursor.eScale - cursor._yscale) / cursor.propEase);
}
function alphaCursor() {
cursor._alpha = cursor._alpha + ((cursor.eAlpha - cursor._alpha) / cursor.propEase);
}
function shootCursor() {
if (!game.paused) {
cursor.reload++;
if (game.deathTimer == 0) {
if (cursor.pressed) {
if (cursor.canShoot) {
if (cursor.reload >= cursor.reloadSpeed) {
shoot(cursor._x, cursor._y, cursor._rotation, 1);
cursor.reload = 0;
if (musicOn) {
cursorShoot.start();
}
}
}
}
}
}
}
function shoot(x, y, rot, who) {
d = _root.getNextHighestDepth();
b = attachMovie("bullet", "bullet" + d, d);
b._x = x;
b._y = y;
b._rotation = rot;
b.who = who;
b.gotoAndStop(who);
b.xSpeed = Math.sin((Math.PI/180) * rot) * 10;
b.ySpeed = Math.cos((Math.PI/180) * rot) * 10;
b.pHit = false;
bullets.push(b);
}
function bulletProof(ob, type) {
for (i in bullets) {
b = bullets[i];
if (type == 1) {
if (b._currentframe == 1) {
if (ob.hitTest(b._x, b._y, true)) {
removeMovieClip(b);
bullets.splice(i, 1);
}
}
} else if (ob.hitTest(b._x, b._y, true)) {
removeMovieClip(b);
bullets.splice(i, 1);
}
}
}
function moveBullets() {
if (!game.paused) {
for (i in bullets) {
b = bullets[i];
b._x = b._x + b.xSpeed;
b._y = b._y - b.ySpeed;
if (game.deathTimer == 0) {
if ((b._currentframe == 2) || (b._currentframe == 3)) {
if (cursor.hitTest(b._x, b._y, false)) {
removeMovieClip(b);
bullets.splice(i, 1);
if (game.endTimer == 0) {
if (game.disOrbs > 0) {
loseOrb();
} else {
smashCursor();
}
}
}
}
}
if ((((b._x > 620) || (b._x < -20)) || (b._y > 470)) || (b._y < -20)) {
removeMovieClip(b);
bullets.splice(i, 1);
}
}
bulletProof(walls, 1);
}
}
function manageGame() {
if (!game.paused) {
smashCursorOn(walls);
shoveOrbs(walls);
bar._xscale = bar._xscale + ((game.barScale - bar._xscale) / 3);
game.barScale = (game.disOrbs / game.totOrbs) * 100;
if (game.colOrbs == game.totOrbs) {
if (game.deathTimer == 0) {
if ((game.endTimer++) > game.waitTime) {
if (levelOrbs[levelSelect - 1] == 0) {
completeLevels++;
updateLimitLevel();
tempLevelSelect = _root["levelSelectedWorld" + worldSelect];
if (tempLevelSelect != 11) {
if (levelSelect < limitLevel) {
_root["levelSelectedWorld" + worldSelect]++;
}
} else if (worldSelect != 5) {
game.menuScreen = 86;
}
}
game.tempScore = Math.round((game.barScale / (game.timer / 60)) * levelSelect);
if (game.tempScore > levelScores[levelSelect - 1]) {
levelOrbs[levelSelect - 1] = Math.round(game.barScale);
levelTimes[levelSelect - 1] = game.timer;
levelScores[levelSelect - 1] = game.tempScore;
if (game.barScale > 95) {
game.tempMedal = 1;
} else if (game.barScale > 85) {
game.tempMedal = 2;
} else if (game.barScale > 60) {
game.tempMedal = 3;
} else {
game.tempMedal = 4;
}
levelMedals[levelSelect - 1] = game.tempMedal;
}
removeEverything();
gotoAndStop(game.menuScreen);
}
}
}
if ((!cursor.dead) && (game.endTimer == 0)) {
game.timer++;
}
if (Key.isDown(2) || (Key.isDown(32))) {
if (_currentframe != 30) {
smashCursor();
}
}
if (cursor.dead) {
if ((game.deathTimer++) > game.waitTime) {
removeEverything();
gotoAndStop(game.menuScreen);
cursor.dead = false;
}
}
if (autoTips) {
if (game.thoughtTimer < 90) {
game.thoughtTimer++;
thought1.eA = 250;
thought2.eA = 250;
thought3.eA = 250;
}
}
i = 1;
while (i <= 3) {
t = _root["thought" + i];
t.thoughtText = game.thoughtText;
if (i == 1) {
t.eX = cursor._x + 12;
t.eY = cursor._y - 10;
}
if (i == 2) {
t.eX = cursor._x + 28;
t.eY = cursor._y - 28;
}
if (i == 3) {
t.eX = cursor._x + 130;
t.eY = cursor._y - 60;
}
if (!cursor.dead) {
if (t._alpha > 0) {
t._visible = true;
t.swapDepths(_root.getNextHighestDepth());
} else {
t._visible = false;
}
} else {
t.eA = 0;
}
t._alpha = t._alpha + (((t.eA - (i * 30)) - t._alpha) / 10);
t._x = t._x + ((t.eX - t._x) / t.ease);
t._y = t._y + ((t.eY - t._y) / t.ease);
if ((Key.isDown(72) || (Key.isDown(87))) || (Key.isDown(38))) {
t.eA = 250;
} else {
t.eA = 0;
}
i++;
}
}
}
function manageCustomGame() {
if (!game.paused) {
bar._xscale = bar._xscale + ((game.barScale - bar._xscale) / 3);
game.barScale = (game.disOrbs / game.totOrbs) * 100;
if (game.colOrbs == game.totOrbs) {
if (game.deathTimer == 0) {
if ((game.endTimer++) > game.waitTime) {
removeEverything();
gotoAndStop(customBackFrame);
}
}
}
if ((!cursor.dead) && (game.endTimer == 0)) {
game.timer++;
}
if (Key.isDown(2) || (Key.isDown(32))) {
smashCursor();
}
if (cursor.dead) {
if ((game.deathTimer++) > game.waitTime) {
removeEverything();
gotoAndStop(customBackFrame);
cursor.dead = false;
}
}
}
}
function updateLimitLevel() {
if ((completeLevels == 1) && (limitLevel == 1)) {
limitLevel = 10;
}
if ((completeLevels >= 10) && (limitLevel == 10)) {
limitLevel = 44;
}
if ((completeLevels >= 44) && (limitLevel == 44)) {
limitLevel = 54;
}
if ((completeLevels >= 54) && (limitLevel == 54)) {
limitLevel = 55;
}
}
function removeEverything() {
removeArray(bullets);
removeArray(greys);
removeArray(shooters);
removeArray(orbs);
removeArray(meteors);
removeArray(greens);
removeArray(ghosts);
removeArray(crystals);
removeArray(spinners);
removeArray(clouds);
removeArray(bombs);
removeArray(blades);
removeArray(bits);
removeArray(shields);
removeArray(rockets);
removeArray(stones);
removeArray(swells);
removeArray(portals);
removeArray(switches);
removeArray(blockers);
removeArray(pauses);
cursor.eAlpha = 100;
cursor.eScale = 100;
cursor.spinSpeed = 0;
cursor._visible = true;
cursor.reload = 0;
if (game.removalArray.length != 0) {
i = 0;
while (i < game.removalArray.length) {
removeArray(game.removalArray[i]);
i++;
}
}
removeMovieClip(bar);
removeMovieClip(levnum);
i = 1;
while (i <= 3) {
removeMovieClip(_root["thought" + i]);
i++;
}
}
function removeArray(a) {
for (i in a) {
o = a[i];
removeMovieClip(o);
a.splice(i, 1);
}
}
function makeGrey(x, y, scale, orbs, speed, dir) {
game.totOrbs = game.totOrbs + orbs;
d = _root.getNextHighestDepth();
g = attachMovie("grey", "grey" + d, d);
g._x = x;
g._y = y;
g._xscale = (g._yscale = scale);
g.xSpeed = Math.sin((Math.PI/180) * dir) * speed;
g.ySpeed = Math.cos((Math.PI/180) * dir) * speed;
g.orbs = orbs;
greys.push(g);
}
function moveGreys() {
for (i in greys) {
g = greys[i];
moveSphere(g);
shootSphere(g, true);
if (g._currentframe == 1) {
if (g._xscale <= 55) {
g.gotoAndPlay(2);
g.xSpeed = g.xSpeed * 0.5;
g.ySpeed = g.ySpeed * 0.5;
}
} else if (g._currentframe >= 20) {
releaseOrbs(g, g.orbs);
removeMovieClip(g);
greys.splice(i, 1);
}
}
}
function makeGreen(x, y, scale, speed, dir) {
d = _root.getNextHighestDepth();
g = attachMovie("green", "green" + d, d);
g._x = x;
g._y = y;
g._xscale = (g._yscale = scale);
g.xSpeed = Math.sin((Math.PI/180) * dir) * speed;
g.ySpeed = Math.cos((Math.PI/180) * dir) * speed;
greens.push(g);
}
function moveGreens() {
for (i in greens) {
g = greens[i];
moveSphere(g);
for (j in bullets) {
b = bullets[j];
if ((b._currentframe == 1) || (b._currentframe == 3)) {
if (g.hitTest(b._x, b._y, true)) {
g.xSpeed = g.xSpeed + (b.xSpeed / 10);
g.ySpeed = g.ySpeed + (b.ySpeed / 10);
removeMovieClip(b);
bullets.splice(j, 1);
g._xscale = g._xscale - game.downSize;
g._yscale = g._yscale - game.downSize;
if (game.disOrbs > 0) {
loseOrb();
} else {
smashCursor();
}
}
}
}
if (g._xscale <= 55) {
if (g._currentframe == 1) {
g.gotoAndPlay(2);
}
}
}
}
function makeCloud(x, y, speed, dir) {
d = _root.getNextHighestDepth();
c = attachMovie("cloud", "cloud" + d, d);
c._x = x;
c._y = y;
c.rotSpeed = (Math.random() * 4) - 2;
c.xSpeed = Math.sin((Math.PI/180) * dir) * speed;
c.ySpeed = Math.cos((Math.PI/180) * dir) * speed;
clouds.push(c);
}
function moveClouds() {
i = 0;
while (i < clouds.length) {
c = clouds[i];
j = 0;
while (j < bullets.length) {
b = bullets[j];
if (c._currentframe == 1) {
if ((b._currentframe == 1) || (b._currentframe == 3)) {
if (c.hitTest(b._x, b._y, true)) {
c.gotoAndPlay(2);
if (musicOn) {
windGust.start();
}
removeMovieClip(b);
bullets.splice(j, 1);
}
}
}
j++;
}
if (c._currentframe == 196) {
if (musicOn) {
windGustReverse.start();
}
}
if (c._currentframe >= 295) {
c.gotoAndStop(1);
}
if (c._currentframe == 1) {
moveSphere(c);
c._rotation = c._rotation + c.rotSpeed;
} else {
c.swapDepths(_root.getNextHighestDepth());
}
i++;
}
}
function makeBomb(x, y, orbs, speed, dir) {
game.totOrbs = game.totOrbs + orbs;
d = _root.getNextHighestDepth();
b = attachMovie("bomb", "bomb" + d, d);
b._x = x;
b._y = y;
if (b.hitTest(cursor)) {
b._x = random(600);
b._y = random(400);
}
if (b.hitTest(cursor)) {
b._x = random(600);
b._y = random(400);
}
if (b.hitTest(cursor)) {
b._x = random(600);
b._y = random(400);
}
if (b.hitTest(cursor)) {
b._x = random(600);
b._y = random(400);
}
b.orbs = orbs;
b.rotSpeed = (Math.random() * 4) - 2;
b.xSpeed = Math.sin((Math.PI/180) * dir) * speed;
b.ySpeed = Math.cos((Math.PI/180) * dir) * speed;
b._rotation = random(360);
bombs.push(b);
}
function moveBombs() {
for (i in bombs) {
b = bombs[i];
moveSphere(b);
b._rotation = b._rotation + b.rotSpeed;
if (b._currentframe == 13) {
if (b.orbs > 0) {
releaseOrbs(b, b.orbs);
}
removeMovieClip(b);
bombs.splice(i, 1);
}
if (b.hitTest(cursor._x, cursor._y, true)) {
if (b._currentframe == 1) {
smashCursor();
}
}
for (j in bullets) {
bu = bullets[j];
if (b._currentframe == 1) {
if (bulletHitTest(b, true, 3)) {
if (musicOn) {
bombExplode.start();
}
b.gotoAndPlay(2);
s = 0;
while (s < 360) {
shoot(b._x, b._y, s, 3);
s = s + 20;
}
}
}
}
}
}
function makeCrystal(x, y, size, orbs, speed, dir) {
game.totOrbs = game.totOrbs + orbs;
d = _root.getNextHighestDepth();
c = attachMovie("crystal", "crystal" + d, d);
c._x = x;
c._y = y;
c.orbs = orbs;
c.xSpeed = Math.sin((Math.PI/180) * dir) * speed;
c.ySpeed = Math.cos((Math.PI/180) * dir) * speed;
c.rotSpeed = (Math.random() * 6) - 3;
c.growSize = size;
crystals.push(c);
}
function moveCrystals() {
for (i in crystals) {
c = crystals[i];
moveSphere(c);
c._rotation = c._rotation + c.rotSpeed;
if (c._currentframe == 21) {
if (c.orbs > 0) {
releaseOrbs(c, c.orbs);
}
removeMovieClip(c);
crystals.splice(i, 1);
}
if (c._currentframe == 1) {
if (bulletHitTest(c, false, 3)) {
c.gotoAndPlay(2);
cursor.eScale = c.growSize;
}
}
}
}
function makeSpinner(x, y, spinspeed, orbs, speed, dir) {
game.totOrbs = game.totOrbs + orbs;
d = _root.getNextHighestDepth();
c = attachMovie("spinner", "spinner" + d, d);
c._x = x;
c._y = y;
c.orbs = orbs;
c.xSpeed = Math.sin((Math.PI/180) * dir) * speed;
c.ySpeed = Math.cos((Math.PI/180) * dir) * speed;
c.rotSpeed = (Math.random() * 8) - 4;
c.spinSpeed = spinspeed;
c._rotation = random(360);
spinners.push(c);
}
function moveSpinners() {
for (i in spinners) {
c = spinners[i];
moveSphere(c);
c._rotation = c._rotation + c.rotSpeed;
if (c._currentframe == 30) {
releaseOrbs(c, c.orbs);
removeMovieClip(c);
spinners.splice(i, 1);
}
if (c._currentframe == 1) {
if (bulletHitTest(c, false, 3)) {
cursor.spinSpeed = c.spinSpeed;
c.gotoAndPlay(2);
}
} else {
c.xSpeed = c.xSpeed * 0.93;
c.ySpeed = c.ySpeed * 0.93;
}
}
}
function makeGhost(x, y, alpha, orbs, speed, dir) {
game.totOrbs = game.totOrbs + orbs;
d = _root.getNextHighestDepth();
g = attachMovie("ghost", "ghost" + d, d);
g._x = x;
g._y = y;
g.alpha = alpha;
g.orbs = orbs;
g.xSpeed = Math.sin((Math.PI/180) * dir) * speed;
g.ySpeed = Math.cos((Math.PI/180) * dir) * speed;
g.rotSpeed = (Math.random() * 6) - 3;
ghosts.push(g);
}
function moveGhosts() {
for (i in ghosts) {
g = ghosts[i];
moveSphere(g);
g._rotation = g._rotation + g.rotSpeed;
if (g._currentframe == 21) {
releaseOrbs(g, g.orbs);
removeMovieClip(g);
ghosts.splice(i, 1);
}
if (bulletHitTest(g, false, 3)) {
if (g._currentframe == 1) {
cursor.eAlpha = g.alpha;
g.gotoAndPlay(2);
}
}
}
}
function makeShooter(x, y, type, count) {
d = _root.getNextHighestDepth();
s = attachMovie("shooter", "shooter" + d, d);
s._x = x;
s._y = y;
s.randChance = count;
s.rot = 0;
s.xDif = cursor._x - s._x;
s.yDif = cursor._y - s._y;
s.rot = Math.atan2(s.yDif, s.xDif) + (Math.PI/2);
s.bType = type;
s._rotation = 57.2957795130823 * s.rot;
shooters.push(s);
}
function moveShooters() {
for (i in shooters) {
s = shooters[i];
s.xDif = cursor._x - s._x;
s.yDif = cursor._y - s._y;
s.rot = Math.atan2(s.yDif, s.xDif) + (Math.PI/2);
s._rotation = 57.2957795130823 * s.rot;
if (random(s.randChance) == 0) {
shoot(s._x + (Math.sin(s.rot) * 20), s._y - (Math.cos(s.rot) * 20), s._rotation, s.bType);
}
}
}
function makeMeteor(scale, speed, dir) {
d = _root.getNextHighestDepth();
m = attachMovie("meteor", "meteor" + d, d);
m.speed = speed;
m._xscale = (m._yscale = scale);
if (dir == "random") {
r = random(4);
if (r == 0) {
dir = "up";
}
if (r == 1) {
dir = "down";
}
if (r == 2) {
dir = "left";
}
if (r == 3) {
dir = "right";
}
}
if (dir == "up") {
m._x = random(600);
m._y = (-m._width) / 2;
}
if (dir == "right") {
m._y = random(400);
m._x = 600 + (m._width / 2);
}
if (dir == "down") {
m._x = random(600);
m._y = 450 + (m._width / 2);
}
if (dir == "left") {
m._y = random(400);
m._x = (-m._width) / 2;
}
m.xDif = cursor.mX - m._x;
m.yDif = cursor.mY - m._y;
m.rot = Math.atan2(m.yDif, m.xDif) + (Math.PI/2);
m._rotation = random(360);
m.dis = 100;
m.xSpeed = Math.sin(m.rot) * speed;
m.ySpeed = Math.cos(m.rot) * speed;
meteors.push(m);
}
function moveMeteors() {
for (i in meteors) {
m = meteors[i];
m._x = m._x + m.xSpeed;
m._y = m._y - m.ySpeed;
if ((((m._x > (600 + m._width)) || (m._x < (-m._width))) || (m._y > (450 + m._height))) || (m._y < (-m._height))) {
removeMovieClip(m);
meteors.splice(i, 1);
}
m.xDif = m._x - cursor.mX;
m.yDif = m._y - cursor.mY;
m.dis = Math.sqrt((m.xDif * m.xDif) + (m.yDif * m.yDif));
m.angle = (Math.atan2(m.yDif, m.xDif) - (Math.PI/2)) + ((Math.PI/180) * cursor._rotation);
m.cursorR = Math.sqrt(Math.pow((cursor.cursorWidth * (cursor._xscale / 100)) * Math.sin(m.angle), 2) + Math.pow((cursor.cursorHeight * (cursor._xscale / 100)) * Math.cos(m.angle), 2));
m.limitR = (20 * (m._xscale / 100)) + m.cursorR;
if (m.dis < m.limitR) {
smashCursor();
}
}
}
function makeBlade(x, y, scale, orbs, speed) {
game.totOrbs = game.totOrbs + orbs;
d = _root.getNextHighestDepth();
b = attachMovie("blade", "blade" + d, d);
b._x = x;
b._y = y;
b._xscale = (b._yscale = scale);
b.xDif = 0;
b.yDif = 0;
b.xDif2 = 0;
b.yDif2 = 0;
b.speed = speed;
b.orbs = orbs;
blades.push(b);
}
function moveBlades() {
for (i in blades) {
b = blades[i];
if (b._currentframe == 1) {
b.xDif = cursor._x - b._x;
b.yDif = cursor._y - b._y;
b.xDif2 = b.xDif2 + (b.xDif / b.speed);
b.yDif2 = b.yDif2 + (b.yDif / b.speed);
b.xDif2 = b.xDif2 * 0.95;
b.yDif2 = b.yDif2 * 0.95;
} else {
b.xDif2 = b.xDif2 * 0.93;
b.yDif2 = b.yDif2 * 0.93;
if ((b._x > 600) || (b._x < 0)) {
b.xDif2 = b.xDif2 * -0.9;
}
if ((b._y > 450) || (b._y < 0)) {
b.yDif2 = b.yDif2 * -0.9;
}
}
b._rotation = b._rotation - b.xDif2;
b._x = b._x + b.xDif2;
b._y = b._y + b.yDif2;
if (b.hitTest(cursor._x, cursor._y, false)) {
smashCursor();
}
if (b.orbs > 0) {
if (b._currentframe == 1) {
if (bulletHitTest(b, false, 3)) {
b._xscale = b._xscale - game.downSize;
b._yscale = b._yscale - game.downSize;
}
}
if (b._currentframe == 1) {
if (b._xscale <= 50) {
b.gotoAndPlay(2);
}
}
if (b._currentframe == 21) {
releaseOrbs(b, b.orbs);
removeMovieClip(b);
blades.splice(i, 1);
}
}
}
}
function makeShield(x, y, scale, speed, dir) {
d = _root.getNextHighestDepth();
s = attachMovie("shield", "shield" + d, d);
s._x = x;
s._y = y;
s._xscale = (s._yscale = scale);
s.xSpeed = Math.sin((Math.PI/180) * dir) * speed;
s.ySpeed = Math.cos((Math.PI/180) * dir) * speed;
shields.push(s);
}
function moveShields() {
for (i in shields) {
s = shields[i];
moveSphere(s);
bulletProof(s, 2);
s.swapDepths(_root.getNextHighestDepth());
}
}
function makeStone(x, y, scale, orbs, speed, dir) {
game.totOrbs = game.totOrbs + orbs;
d = _root.getNextHighestDepth();
s = attachMovie("stone", "stone" + d, d);
s._x = x;
s._y = y;
s._xscale = (s._yscale = scale);
s.xSpeed = Math.sin((Math.PI/180) * dir) * speed;
s.ySpeed = Math.cos((Math.PI/180) * dir) * speed;
s.orbs = orbs;
s.bounds = s.getBounds(_root);
stones.push(s);
}
function moveStones() {
for (i in stones) {
s = stones[i];
s._x = s._x + s.xSpeed;
s._y = s._y - s.ySpeed;
s._rotation = s._rotation + ((s.xSpeed + s.ySpeed) / 3);
s.bounds = s.getBounds(_root);
if (s.bounds.xMax < 0) {
s._x = 600 + (s._width / 2);
}
if (s.bounds.xMin > 600) {
s._x = (-s._width) / 2;
}
if (s.bounds.yMax < 0) {
s._y = 450 + (s._height / 2);
}
if (s.bounds.yMin > 450) {
s._y = (-s._height) / 2;
}
if (s._currentframe == 30) {
releaseOrbs(s, s.orbs);
removeMovieClip(s);
stones.splice(i, 1);
}
if (s._currentframe != 1) {
s.xSpeed = s.xSpeed * 0.9;
s.ySpeed = s.ySpeed * 0.9;
} else {
smashCursorOn(s);
}
for (j in bullets) {
b = bullets[j];
if (s.hitTest(b._x, b._y, true)) {
s.xSpeed = s.xSpeed + (b.xSpeed / (b._xscale / 4));
s.ySpeed = s.ySpeed + (b.ySpeed / (b._xscale / 4));
removeMovieClip(b);
bullets.splice(j, 1);
}
}
if (s._currentframe == 1) {
for (j in rockets) {
r = rockets[j];
if (r.active) {
if (s.hitTest(r._x, r._y, true)) {
removeMovieClip(r);
rockets.splice(j, 1);
s.gotoAndPlay(2);
}
}
}
} else {
s.xSpeed = s.xSpeed * 0.9;
s.ySpeed = s.ySpeed * 0.9;
}
}
}
function makeSwitch(x, y, tag) {
d = _root.getNextHighestDepth();
s = attachMovie("switch", "switch" + d, d);
s._x = x;
s._y = y;
s._name = tag;
s.val = false;
s.timer = 30;
s.frame.gotoAndStop(2);
if (s.val) {
s.lightX = -16.5;
} else {
s.lightX = 16.5;
}
switches.push(s);
}
function moveSwitches() {
for (i in switches) {
s = switches[i];
if (s.val) {
s.lightX = -16.5;
} else {
s.lightX = 16.5;
}
s.lights._x = s.lights._x + ((s.lightX - s.lights._x) / 4);
if (s.timer > 30) {
s.frame.gotoAndStop(2);
if (bulletHitTest(s, true, 1)) {
s.timer = 0;
if (s.val) {
s.val = false;
if (musicOn) {
switchOff.start();
}
} else {
s.val = true;
if (musicOn) {
switchOn.start();
}
}
}
} else {
s.timer++;
s.frame.gotoAndStop(1);
}
}
}
function makePortal(x, y, input, output, lockF, lockR) {
d = _root.getNextHighestDepth();
p = attachMovie("portal", "portal" + d, d);
p._x = x;
p._y = y;
p.inputN = input;
p.outputN = output;
p.swirlSpeed = 0;
p.linked = false;
if ((lockF != undefined) && (lockF != 0)) {
p.lockF = lockF;
}
if (lockR != undefined) {
p.lockR = lockR;
}
p.outputArray = new Array();
portals.push(p);
}
function movePortals() {
for (i in portals) {
p = portals[i];
if (!p.linked) {
for (g in portals) {
g = portals[g];
if (g.inputN == p.outputN) {
p.outputArray.push(g);
}
}
p.linked = true;
}
p.swirl._rotation = p.swirl._rotation + p.swirlSpeed;
p.swirlSpeed = p.swirlSpeed * 0.92;
for (j in bullets) {
b = bullets[j];
if (p.hitTest(b._x, b._y, true)) {
p.swirlSpeed = p.swirlSpeed - 10;
if (p.lockF == undefined) {
p.lockF = b._currentframe;
}
if (p.lockR == undefined) {
tempR = b._rotation;
}
removeMovieClip(b);
bullets.splice(j, 1);
for (a in p.outputArray) {
pa = p.outputArray[a];
pa.swirlSpeed = pa.swirlSpeed + 10;
if (p.lockR == undefined) {
shoot(pa._x + (Math.sin(0.0174 * tempR) * 25), pa._y - (Math.cos(0.0174 * tempR) * 25), tempR, p.lockF);
} else {
shoot(pa._x + (Math.sin(0.0174 * p.lockR) * 25), pa._y - (Math.cos(0.0174 * p.lockR) * 25), p.lockR, p.lockF);
}
}
}
}
}
}
function makeSwell(x, y, growSpeed, reduceSpeed) {
d = _root.getNextHighestDepth();
s = attachMovie("swell", "swell" + d, d);
s._x = x;
s._y = y;
s.eSize = 100;
s.timer = 11;
s.gSpeed = growSpeed;
s.rSpeed = reduceSpeed;
swells.push(s);
}
function moveSwells() {
for (i in swells) {
s = swells[i];
if (s.timer > 10) {
s.eSize = s.eSize + s.gSpeed;
} else {
s.timer++;
}
s._xscale = s._xscale + ((s.eSize - s._xscale) / 3);
s._yscale = s._yscale + ((s.eSize - s._yscale) / 3);
smashCursorOn(s);
if (s._xscale > 100) {
if (bulletHitTest(s, true, 3)) {
s.eSize = s.eSize - s.rSpeed;
s.timer = 0;
}
}
}
}
function makeRocket(x, y, dir) {
d = _root.getNextHighestDepth();
r = attachMovie("rocket", "rocket" + d, d);
r._x = x;
r._y = y;
r._rotation = dir;
r.xSpeed = Math.sin((Math.PI/180) * dir) * 0;
r.ySpeed = Math.cos((Math.PI/180) * dir) * 0;
r.speed = 2;
r.active = false;
rockets.push(r);
}
function moveRockets() {
for (i in rockets) {
r = rockets[i];
for (j in rockets) {
r2 = rockets[j];
if (r.active) {
if (!r2.active) {
if (r.hitTest(r2)) {
r2.active = true;
if (musicOn) {
rocketFire.start();
}
}
}
}
}
if (!r.active) {
if (bulletHitTest(r, false, 3)) {
r.active = true;
if (musicOn) {
rocketFire.start();
}
}
}
if ((((r._x > 650) || (r._x < -50)) || (r._y > 500)) || (r._y < -50)) {
removeMovieClip(r);
rockets.splice(i, 1);
}
if (r.active) {
r.gotoAndStop(2);
r.xSpeed = Math.sin((Math.PI/180) * r._rotation) * r.speed;
r.ySpeed = Math.cos((Math.PI/180) * r._rotation) * r.speed;
if (r.speed < 30) {
r.speed = r.speed + 1.1;
}
r._x = r._x + r.xSpeed;
r._y = r._y - r.ySpeed;
if (r.hitTest(cursor)) {
smashCursor();
}
}
}
}
function blockerWall(x1, y1, x2, y2) {
xPos = x1;
while (xPos < x2) {
yPos = y1;
while (yPos < y2) {
makeBlocker(xPos, yPos);
yPos = yPos + 25;
}
xPos = xPos + 25;
}
}
function makeBlocker(x, y) {
d = _root.getNextHighestDepth();
b = attachMovie("blocker", "blocker" + d, d);
b._x = x;
b._y = y;
b.falling = false;
b.xSpeed = 0;
b.ySpeed = 0;
blockers.push(b);
}
function moveBlockers() {
for (i in blockers) {
b = blockers[i];
smashCursorOn(b);
if (b.falling) {
b.ySpeed++;
b._y = b._y + b.ySpeed;
b._x = b._x + b.xSpeed;
b.xSpeed = b.xSpeed * 0.95;
if ((((b._x > 620) || (b._x < -20)) || (b._y > 470)) || (b._y < -20)) {
removeMovieClip(b);
blockers.splice(i, 1);
}
} else {
for (j in bullets) {
bu = bullets[j];
if (b.hitTest(bu)) {
b.falling = true;
b.xSpeed = bu.xSpeed / 2;
b.ySpeed = (-bu.ySpeed) / 2;
b.swapDepths(_root.getNextHighestDepth());
removeMovieClip(bu);
bullets.splice(j, 1);
}
}
}
}
}
function bulletHitTest(ob, bound, type) {
var _local5 = false;
for (m in bullets) {
var _local1 = bullets[m];
if (type == 1) {
if (_local1._currentframe == 1) {
if (ob.hitTest(_local1._x, _local1._y, bound)) {
removeMovieClip(_local1);
bullets.splice(m, 1);
_local5 = true;
}
}
} else if (type == 2) {
if (ob.hitTest(_local1._x, _local1._y, bound)) {
removeMovieClip(_local1);
bullets.splice(m, 1);
_local5 = true;
}
} else if (type == 3) {
if ((_local1._currentframe == 1) || (_local1._currentframe == 3)) {
if (ob.hitTest(_local1._x, _local1._y, bound)) {
removeMovieClip(_local1);
bullets.splice(m, 1);
_local5 = true;
}
}
}
}
return(_local5);
}
function moveSphere(ob) {
ob._x = ob._x + ob.xSpeed;
ob._y = ob._y - ob.ySpeed;
ob.left = ob._x;
ob.right = ob._x;
ob.top = ob._y;
ob.bottom = ob._y;
if (ob.right > 600) {
ob._x = 600;
ob.xSpeed = ob.xSpeed * -1;
}
if (ob.left < 0) {
ob._x = 0;
ob.xSpeed = ob.xSpeed * -1;
}
if (ob.top < 0) {
ob._y = 0;
ob.ySpeed = ob.ySpeed * -1;
}
if (ob.bottom > 450) {
ob._y = 450;
ob.ySpeed = ob.ySpeed * -1;
}
}
function shootSphere(ob, moves) {
for (b in bullets) {
bullet = bullets[b];
if (ob.hitTest(bullet._x, bullet._y, true)) {
if ((bullet._currentframe == 1) || (bullet._currentframe == 3)) {
ob._xscale = ob._xscale - game.downSize;
ob._yscale = ob._yscale - game.downSize;
if (moves) {
ob.xSpeed = ob.xSpeed + (bullet.xSpeed / 10);
ob.ySpeed = ob.ySpeed + (bullet.ySpeed / 10);
}
removeMovieClip(bullet);
bullets.splice(b, 1);
}
}
}
}
function makeOrb(x, y, ex, ey, single) {
if (single) {
game.totOrbs++;
}
d = _root.getNextHighestDepth();
o = attachMovie("orb", "orb" + d, d);
o._x = x;
o._y = y;
o._rotation = random(360);
o.endX = ex;
o.endY = ey;
o.active = true;
orbs.push(o);
}
function moveOrbs() {
for (i in orbs) {
o = orbs[i];
o._x = o._x + ((o.endX - o._x) / 4);
o._y = o._y + ((o.endY - o._y) / 4);
if (o.endX > 600) {
o.endX = 590;
}
if (o.endX < 0) {
o.endX = 10;
}
if (o.endY > 450) {
o.endY = 440;
}
if (o.endY < 0) {
o.endY = 10;
}
if (!o.active) {
if ((Math.abs(o._x - o.endX) < 3) && (Math.abs(o._y - o.endY) < 3)) {
removeMovieClip(o);
orbs.splice(i, 1);
}
} else {
o.xDif = o._x - cursor.mX;
o.yDif = o._y - cursor.mY;
o.dis = Math.sqrt((o.xDif * o.xDif) + (o.yDif * o.yDif));
o.angle = (Math.atan2(o.yDif, o.xDif) - (Math.PI/2)) + ((Math.PI/180) * cursor._rotation);
o.cursorR = Math.sqrt(Math.pow((cursor.cursorWidth * (cursor._xscale / 100)) * Math.sin(o.angle), 2) + Math.pow((cursor.cursorHeight * (cursor._xscale / 100)) * Math.cos(o.angle), 2));
o.limitR = (20 * (o._xscale / 100)) + o.cursorR;
if (o.dis < o.limitR) {
if (game.deathTimer == 0) {
if (o.active) {
game.colOrbs++;
game.disOrbs++;
o.endX = bar._x + ((game.disOrbs / game.totOrbs) * game.barWidth);
o.endY = bar._y;
if (musicOn) {
getOrb.start();
}
o.active = false;
}
}
}
}
}
}
function shoveOrbs(ob) {
if (game.shoveOrbs) {
for (i in orbs) {
o = orbs[i];
if (o.active) {
a = 0;
while (a < 360) {
tempX = o._x + (Math.sin(0.0174 * a) * 5.5);
tempY = o._y - (Math.cos(0.0174 * a) * 5.5);
if (ob.hitTest(tempX, tempY, true)) {
o.endX = o.endX + ((o._x - tempX) / 3);
o.endY = o.endY + ((o._y - tempY) / 3);
}
a = a + 45;
}
}
}
}
}
function loseOrb() {
if (game.endTimer == 0) {
makeBit(bar._x + ((game.disOrbs / game.totOrbs) * game.barWidth), 14, 2);
game.disOrbs--;
if (musicOn) {
fallOrb.start();
}
}
}
function releaseOrbs(ob, count) {
c = 0;
while (c < count) {
makeOrb(ob._x, ob._y, ob._x + ((Math.random() * 60) - 30), ob._y + ((Math.random() * 60) - 30), false);
c++;
}
}
function manageCursor() {
moveCursor();
hideCursor();
scaleCursor();
alphaCursor();
manageBackground();
cursor.mX = cursor._x - (Math.sin((Math.PI/180) * cursor._rotation) * ((cursor.cursorHeight * cursor._xscale) / 100));
cursor.mY = cursor._y + (Math.cos((Math.PI/180) * cursor._rotation) * ((cursor.cursorHeight * cursor._xscale) / 100));
if (Key.isDown(77)) {
if (_currentframe != 30) {
if (!mKeyDown) {
if (musicOn) {
optionChange.start();
}
mKeyDown = true;
if (musicOn) {
aquaticVoyage.stop();
musicOn = false;
saveData.data.musicOn = musicOn;
} else {
aquaticVoyage.start(0, 999);
musicOn = true;
saveData.data.musicOn = musicOn;
}
}
}
} else {
mKeyDown = false;
}
if (Key.isDown(81)) {
if (!qKeyDown) {
qKeyDown = true;
if (musicOn) {
optionChange.start();
}
gameQual--;
if (gameQual == 0) {
gameQual = 3;
}
qualityButton.preview.gotoAndStop(4 - gameQual);
_root._quality = qualityNames[gameQual - 1];
}
} else {
qKeyDown = false;
}
if (cursor.spinSpeed == 0) {
rotateCursor(cursor.dir);
} else if (!game.paused) {
cursor._rotation = cursor._rotation + cursor.spinSpeed;
}
if (cursor._x > 600) {
cursor._x = 600;
}
if (cursor._x < 0) {
cursor._x = 0;
}
if (cursor._y > 450) {
cursor._y = 450;
}
if (cursor._y < 0) {
cursor._y = 0;
}
}
function manageBackground() {
if (bgFixed) {
bgY = (bgFrame - 1) * -450;
} else {
bgY = (Math.ceil(levelSelect / 9.16666666666667) - 1) * -450;
}
bg.reel._y = bg.reel._y + ((bgY - bg.reel._y) / 3);
}
function changeBackground() {
}
function smashCursor() {
if (game.endTimer == 0) {
if (!cursor.dead) {
cursor.dead = true;
cursor._visible = false;
smashDecider = random(5) + 1;
if (musicOn) {
if (smashDecider == 1) {
cursorSmash1.start();
} else if (smashDecider == 2) {
cursorSmash2.start();
} else if (smashDecider == 3) {
cursorSmash3.start();
} else if (smashDecider == 4) {
cursorSmash4.start();
} else if (smashDecider == 5) {
cursorSmash5.start();
}
}
p = 0;
while (p < 10) {
makeBit(cursor._x + ((Math.random() * 8) - 4), cursor._y + ((Math.random() * 8) - 4), 1);
p++;
}
}
}
}
function smashCursorOn(ob) {
if (!game.paused) {
if (ob.hitTest(cursor._x, cursor._y, true)) {
smashCursor();
}
}
}
function makeBit(x, y, type) {
d = _root.getNextHighestDepth();
tempB = attachMovie("bit", "bit" + d, d);
tempB.gotoAndStop(type);
tempB._x = x;
tempB._y = y;
tempB.xSpeed = (Math.random() * 10) - 5;
tempB.ySpeed = (-Math.random()) * 5;
if (type == 1) {
tempB.xSpeed = ((Math.random() * 10) - 5) + (cursor.xSpeed / 10);
tempB.ySpeed = ((-Math.random()) * 5) + (cursor.ySpeed / 10);
tempB.b2.gotoAndStop(pointerFrame);
tempB._xscale = (tempB._yscale = cursor._xscale);
tempB._rotation = random(360);
} else if (type == 3) {
tempB._rotation = random(360);
} else if (type == 4) {
tempB._rotation = random(360);
tempB.targetPiece.gotoAndStop(random(3) + 1);
}
bits.push(tempB);
}
function moveBits() {
for (i in bits) {
b = bits[i];
b._x = b._x + b.xSpeed;
b.xSpeed = b.xSpeed * 0.98;
b._y = b._y + b.ySpeed;
b.ySpeed++;
if ((((b._x > 650) || (b._x < -50)) || (b._y > 450)) || (b._y < -50)) {
removeMovieClip(b);
bits.splice(i, 1);
}
}
}
function moveItems() {
if (!game.paused) {
moveOrbs();
moveGreys();
moveGreens();
moveShields();
moveBombs();
moveShooters();
moveSpinners();
moveGhosts();
moveCrystals();
moveMeteors();
movePortals();
moveSwells();
moveStones();
moveSwitches();
moveRockets();
moveBlades();
moveClouds();
moveBlockers();
moveBits();
}
movePauses();
}
function getCircleHeight(xPos) {
tempY = ((0.00022222 * Math.pow(xPos, 2)) - (0.1333 * xPos)) + 350;
return(tempY);
}
function getMouseDistance(ob) {
return(Math.sqrt(Math.pow(cursor._x - ob._x, 2) + Math.pow(cursor._y - ob._y, 2)));
}
function initMenuUI() {
fCircle = circles[0];
fCircle.prox = fCircle._width * 0.8;
lCircle = circles[circles.length - 1];
lCircle.prox = lCircle._width * 0.8;
xDif = 300 - cursor._x;
rail = 300;
damper = 0.07;
damperE = 0.06;
iter = 0;
looper = 0;
raiseLevel = 0;
leftCount = 0;
raising = false;
detTime = 0;
goToFrame = 0;
if ((_root._currentframe >= 5) && (_root._currentframe <= 9)) {
worldOverview._y = worldOverviewY;
i = 1;
while (i < 12) {
lB = _root.worldOverview["levelBox" + i].boxColour;
j = (i - 1) + ((worldSelect - 1) * 11);
if (j >= limitLevel) {
tF = 1;
} else if (levelOrbs[j] == 0) {
tF = 2;
} else if (levelMedals[j] == 1) {
tF = 3;
} else if (levelMedals[j] == 2) {
tF = 4;
} else if (levelMedals[j] == 3) {
tF = 5;
} else if (levelMedals[j] == 4) {
tF = 2;
}
lB.gotoAndStop(tF);
i++;
}
if (!shouldRaise) {
levelBase._visible = true;
levelBase._y = 390;
levelBaseY = 390;
levelBase.bigText = "";
levelBase.levelDescription = (("Level " + levelSelect) + ": ") + levelNames[levelSelect - 1];
levelBase.bestTime = "Best Time - " + framesToTime(levelTimes[levelSelect - 1]);
levelBase.bestScore = "Score - " + levelScores[levelSelect - 1];
levelBase.medal.gotoAndStop(levelMedals[levelSelect - 1]);
levelBase.bestOrbs = ("Orbs - " + levelOrbs[levelSelect - 1]) + "%";
levelBase.medal.gotoAndStop(levelMedals[levelSelect - 1]);
UIFrozen = true;
damper = 0;
} else {
levelBase._y = 520;
levelBaseY = 520;
levelBase._visible = false;
}
}
}
function initCircles() {
i = 0;
while (i < circles.length) {
c = circles[i];
circles[i]._x = 70 + (i * 155);
c._y = 450;
c.oY = c._y;
c.eY = 250;
c.varY = 250;
c.level = getCircleHeight(c._x) - 140;
c.oX = c._x - 300;
c.eX = 0;
c.varX = 0;
c.eS = 100;
c.onTop = false;
c.xDif = 0;
i++;
}
}
function raiseCircles(dir) {
iter = 0;
looper = 0;
raising = true;
if (dir == "up") {
raiseLevel = 0;
}
if (dir == "down") {
raiseLevel = 250;
}
}
function goTo(frame) {
goToFrame = frame;
}
function moveMenuUI(many) {
if (raising) {
if (iter < circles.length) {
if ((looper++) > 0) {
circles[iter].eY = raiseLevel;
looper = 0;
iter++;
}
} else {
raising = false;
}
}
xDif = 300 - cursor._x;
if (cursor._x < 300) {
if ((fCircle._x - fCircle.prox) < 0) {
rail = rail + (xDif * damper);
}
} else if ((lCircle._x + lCircle.prox) > 600) {
rail = rail + (xDif * damper);
}
leftCount = 0;
if (many == undefined) {
if (goToFrame != 0) {
if (lCircle._y > 420) {
gotoAndStop(goToFrame);
}
}
} else if (goToFrame != 0) {
if (getLatestCircle()._y > 420) {
gotoAndStop(goToFrame);
}
}
}
function moveCircles(awayMessage) {
i = 0;
while (i < circles.length) {
c = circles[i];
c._x = (rail + c.oX) + c.varX;
c.varX = c.varX + ((c.eX - c.varX) / 3);
c._y = c.level + c.varY;
c.level = getCircleHeight(c._x) - 140;
c.varY = c.varY + ((c.eY - c.varY) / 3);
c._xscale = c._xscale + ((c.eS - c._xscale) / 3);
c._yscale = c._yscale + ((c.eS - c._yscale) / 3);
c.xDif = Math.abs(c._x - cursor._x);
if ((c._x > 670) || (c._x < -70)) {
c._visible = false;
} else {
c._visible = true;
c._rotation = (c._x - 300) / 50;
}
if (!c.onTop) {
if (Math.abs(c._y - (getCircleHeight(c._x) - 140)) < 2) {
c.onTop = true;
}
}
if (c.eY < 200) {
if (c.onTop) {
if ((c.xDif < 50) && (cursor._y > c.getBounds(_root).yMin)) {
c.gotoAndStop(2);
c.eY = -10;
c.eS = 110;
base.description = circleTags[i];
leftCount++;
j = 0;
while (j < circles.length) {
c2 = circles[j];
if (c != c2) {
if (c._x > c2._x) {
c2.eX = -10;
}
if (c._x < c2._x) {
c2.eX = 10;
}
}
j++;
}
} else {
c.eS = 100;
c.eY = 0;
c.eX = 0;
c.gotoAndStop(1);
}
}
}
if (leftCount == 0) {
base.description = awayMessage;
}
i++;
}
}
function moveWorldCircles() {
i = 0;
while (i < circles.length) {
c = circles[i];
c._x = (rail + c.oX) + c.varX;
c.varX = c.varX + ((c.eX - c.varX) / 3);
c._y = c.level + c.varY;
c.level = getCircleHeight(c._x) - 140;
c.varY = c.varY + ((c.eY - c.varY) / 3);
c._xscale = c._xscale + ((c.eS - c._xscale) / 3);
c._yscale = c._yscale + ((c.eS - c._yscale) / 3);
c.xDif = Math.abs(c._x - cursor._x);
if ((c._x > 670) || (c._x < -70)) {
c._visible = false;
} else {
c._visible = true;
c._rotation = (c._x - 300) / 50;
}
if (!c.onTop) {
if (Math.abs(c._y - (getCircleHeight(c._x) - 140)) < 2) {
c.onTop = true;
}
}
if (c.eY < 200) {
if (c.onTop) {
if ((c.xDif < 50) && (cursor._y > c.getBounds(_root).yMin)) {
c.eY = -10;
c.eS = 110;
c.gotoAndStop(2);
if ((i > 0) && (i <= limitWorld)) {
base.averageOrbs = ("Average Orbs - " + averageOrbs[i - 1]) + "%";
base.averageTime = "Average Time - " + framesToTime(averageTimes[i - 1]);
base.averageScore = "Average Score - " + averageScores[i - 1];
base.overallMedal = "Overall Medal -\r" + medalNames[averageMedals[i - 1] - 1];
base.worldStatus = ((("World " + i) + newline) + percentCompletes[i - 1]) + "% Complete";
base.medal.gotoAndStop(averageMedals[i - 1]);
base.bigText = "";
} else if (i == 0) {
base.averageOrbs = "";
base.averageTime = "";
base.worldStatus = "";
base.overallMedal = "";
base.averageScore = "";
base.medal.gotoAndStop(4);
base.bigText = "Back to the main menu";
} else if (i == (limitWorld + 1)) {
base.averageOrbs = "";
base.averageTime = "";
base.worldStatus = "";
base.overallMedal = "";
base.averageScore = "";
base.medal.gotoAndStop(4);
base.bigText = "Submit your total score from all 5 worlds, which is " + totalScore;
}
leftCount++;
j = 0;
while (j < circles.length) {
c2 = circles[j];
if (c != c2) {
if (c._x > c2._x) {
c2.eX = -10;
}
if (c._x < c2._x) {
c2.eX = 10;
}
}
j++;
}
} else {
c.eS = 100;
c.eY = 0;
c.eX = 0;
c.gotoAndStop(1);
}
}
}
if (leftCount == 0) {
base.bigText = "Hover over a world to see more info about it";
base.averageOrbs = "";
base.averageTime = "";
base.overallMedal = "";
base.averageScore = "";
base.medal.gotoAndStop(4);
base.worldStatus = "";
}
i++;
}
}
function getLatestCircle() {
p = 0;
while (p < circles.length) {
c = circles[p];
if (c._x > 600) {
return(c);
}
if ((p + 1) == circles.length) {
return(c);
}
p++;
}
}
function moveLevelCircles() {
i = 0;
while (i < circles.length) {
c = circles[i];
c.varX = c.varX + ((c.eX - c.varX) / 3);
c._x = (rail + c.oX) + c.varX;
c.varY = c.varY + ((c.eY - c.varY) / 3);
c._xscale = c._xscale + ((c.eS - c._xscale) / 3);
c._yscale = c._yscale + ((c.eS - c._yscale) / 3);
c._y = c.level + c.varY;
c.xDif = Math.abs(c._x - cursor._x);
c.level = getCircleHeight(c._x) - 140;
if ((c._x > 670) || (c._x < -70)) {
c._visible = false;
} else {
c._visible = true;
c._rotation = (c._x - 300) / 50;
}
if (!c.onTop) {
if (Math.abs(c._y - (getCircleHeight(c._x) - 140)) < 2) {
c.onTop = true;
}
}
if (c.eY < 200) {
if (c.onTop) {
if ((c.xDif < 50) && (cursor._y > c.getBounds(_root).yMin)) {
c.eY = -10;
c.eS = 110;
c.gotoAndStop(2);
leftCount++;
if ((levelSelect != undefined) && (levelSelect != i)) {
}
if (i > 0) {
base.bigText = "";
base.levelDescription = (("Level " + (i + ((worldSelect - 1) * 11))) + ": ") + levelNames[(i + ((worldSelect - 1) * 11)) - 1];
base.bestTime = "Best Time - " + framesToTime(levelTimes[(i + ((worldSelect - 1) * 11)) - 1]);
base.bestScore = "Score - " + levelScores[(i + ((worldSelect - 1) * 11)) - 1];
base.bestOrbs = ("Orbs - " + levelOrbs[(i + ((worldSelect - 1) * 11)) - 1]) + "%";
base.medal.gotoAndStop(levelMedals[(i + ((worldSelect - 1) * 11)) - 1]);
} else {
base.bigText = "Back to the world select menu";
base.levelDescription = "";
base.bestTime = "";
base.bestScore = "";
base.bestOrbs = "";
base.medal.gotoAndStop(4);
}
j = 0;
while (j < circles.length) {
c2 = circles[j];
if (c != c2) {
if (c._x > c2._x) {
c2.eX = -10;
}
if (c._x < c2._x) {
c2.eX = 10;
}
}
j++;
}
if (levelScores[c.levelNumber - 1] > 0) {
c.erase._visible = true;
}
} else {
c.eS = 100;
c.eY = 0;
c.eX = 0;
c.gotoAndStop(1);
c.erase._visible = false;
}
}
}
i++;
}
if (cursor.pressed) {
UIFrozen = false;
if (damperE < 0.075) {
damperE = damperE + 0.002;
}
} else if (damperE > 0.04) {
damperE = damperE - 0.002;
}
damper = damper + ((damperE - damper) / 5);
levelBase._y = levelBase._y + ((levelBaseY - levelBase._y) / 4);
if (shouldRaise) {
if (leftCount == 0) {
base.bigText = "Hover over a level to see more info";
base.levelDescription = "";
base.bestOrbs = "";
base.bestTime = "";
base.bestScore = "";
base.medal.gotoAndStop(4);
}
} else {
if (levelBase._y >= 515) {
levelBase._visible = false;
} else {
levelBase._visible = true;
}
detTime++;
levelBase.bigText = "";
levelBase.levelDescription = (("Level " + levelSelect) + ": ") + levelNames[levelSelect - 1];
levelBase.bestTime = "Best Time - " + framesToTime(levelTimes[levelSelect - 1]);
levelBase.bestScore = "Score - " + levelScores[levelSelect - 1];
levelBase.bestOrbs = ("Orbs - " + levelOrbs[levelSelect - 1]) + "%";
levelBase.medal.gotoAndStop(levelMedals[levelSelect - 1]);
if (detTime > 60) {
UIFrozen = false;
}
if (UIFrozen) {
damper = 0;
} else {
levelBaseY = 520;
}
if (leftCount == 0) {
base.bigText = "Hover over a level to see more info";
base.levelDescription = "";
base.bestOrbs = "";
base.bestTime = "";
base.bestScore = "";
base.medal.gotoAndStop(4);
}
}
worldOverview._y = worldOverview._y + ((worldOverviewY - worldOverview._y) / 3);
if (worldOverview._y <= -9) {
worldOverview._visible = false;
} else {
worldOverview._visible = true;
}
}
function makeButton(ob) {
if (ob.scale == undefined) {
ob.scale = 100;
}
ob._xscale = ob._xscale + ((ob.scale - ob._xscale) / 3);
ob._yscale = ob._yscale + ((ob.scale - ob._yscale) / 3);
if (ob.hitTest(cursor._x, cursor._y, false)) {
ob.scale = 120;
} else {
ob.scale = 100;
}
}
function squareButton(ob, mouse) {
if (ob.sScale == undefined) {
ob.sScale = ob._xscale;
}
if (mouse) {
if (ob.hitTest(_xmouse, _ymouse, true)) {
ob._xscale = ob._xscale + (((ob.sScale + 20) - ob._xscale) / 3);
ob._yscale = ob._yscale + (((ob.sScale + 20) - ob._yscale) / 3);
} else {
ob._xscale = ob._xscale + ((ob.sScale - ob._xscale) / 3);
ob._yscale = ob._yscale + ((ob.sScale - ob._yscale) / 3);
}
} else if (ob.hitTest(cursor._x, cursor._y, true)) {
ob._xscale = ob._xscale + (((ob.sScale + 20) - ob._xscale) / 3);
ob._yscale = ob._yscale + (((ob.sScale + 20) - ob._yscale) / 3);
} else {
ob._xscale = ob._xscale + ((ob.sScale - ob._xscale) / 3);
ob._yscale = ob._yscale + ((ob.sScale - ob._yscale) / 3);
}
}
function makePause(x, y) {
d = _root.getNextHighestDepth();
p = attachMovie("pauseOrb", "pauseOrb" + d, d);
p._x = x;
p._y = y;
game.paused = true;
p.p = true;
pauses.push(p);
}
function movePauses() {
for (i in pauses) {
p = pauses[i];
if (p.p) {
if (p.hitTest(cursor._x, cursor._y, true)) {
p.p = false;
p.gotoAndPlay(2);
if (musicOn) {
unPause.start();
}
}
}
game.paused = false;
if (p.p) {
game.paused = true;
}
}
}
function getFreeSpace() {
firstFree = 0;
i = 0;
while (i < 10) {
if (customLevels.data.levels[i] == "empty") {
firstFree = i;
break;
}
i++;
}
return(firstFree);
}
function countDown(val) {
tSeconds = Math.floor(val / 30);
tMFrames = val - (30 * tSeconds);
tMSeconds = Math.round(tMFrames * 3.33333333333333);
if (tMSeconds < 10) {
tMSeconds = "0" + tMSeconds;
}
if (tSeconds < 10) {
tSeconds = "0" + tSeconds;
}
return((tSeconds + ":") + tMSeconds);
}
function roughlyEqual(val1, val2, error) {
var _local1 = false;
if (Math.abs(val1 - val2) < error) {
_local1 = true;
}
return(_local1);
}
function sliderDrag(ob) {
ob.onPress = function () {
startDrag (ob, true, 0, ob._y, 75, ob._y);
};
ob.onRelease = function () {
stopDrag();
};
ob.onReleaseOutside = function () {
stopDrag();
};
}
function moveSpherox() {
spherox._x = spherox._x + spherox.xSpeed;
spherox._y = spherox._y + spherox.ySpeed;
if (spherox._x > 570) {
spherox.xSpeed = spherox.xSpeed * -1;
spherox._x = 570;
}
if (spherox._x < 30) {
spherox.xSpeed = spherox.xSpeed * -1;
spherox._x = 30;
}
if (spherox._y > 420) {
spherox.ySpeed = spherox.ySpeed * -1;
spherox._y = 420;
}
if (spherox._y < 30) {
spherox.ySpeed = spherox.ySpeed * -1;
spherox._y = 30;
}
for (b in bullets) {
tB = bullets[b];
if (spherox.hitTest(tB._x, tB._y, true)) {
spherox.xSpeed = spherox.xSpeed + (tB.xSpeed / 20);
spherox.ySpeed = spherox.ySpeed - (tB.ySpeed / 20);
removeMovieClip(tB);
bullets.splice(b, 1);
}
}
}
function moveLevelsLeft() {
if (musicOn) {
switchOn.start();
}
levelSelectedWorld1--;
if (levelSelectedWorld1 < 1) {
levelSelectedWorld1 = tempLimitLevel;
i = 1;
while (i <= tempLimitLevel) {
tC = _root["level" + i];
if (i == levelSelectedWorld1) {
tC.eS = 110;
tC.endExtraY = -20;
} else {
tC.eS = 100;
tC.endExtraY = 0;
}
tC._xscale = tC.eS;
tC._yscale = tC.eS;
tC.extraY = tC.endExtraY;
tC.endX = (300 - (120 * (levelSelectedWorld1 - 1))) + ((i - 1) * 120);
tC._x = tC.endX;
tC._y = tC.extraY + (((0.00022222 * Math.pow(tC._x, 2)) - (0.1333 * tC._x)) + 220);
tC._rotation = (tC._x - 300) / 50;
tC._alpha = 100 - (Math.abs(tC._x - 300) * 0.5);
if (tC._alpha <= 0) {
tC._visible = false;
} else {
tC._visible = true;
}
i++;
}
}
}
function moveLevelsRight() {
if (musicOn) {
switchOn.start();
}
levelSelectedWorld1++;
if (levelSelectedWorld1 > tempLimitLevel) {
levelSelectedWorld1 = 1;
i = 1;
while (i <= tempLimitLevel) {
tC = _root["level" + i];
if (i == levelSelectedWorld1) {
tC.eS = 110;
tC.endExtraY = -20;
} else {
tC.eS = 100;
tC.endExtraY = 0;
}
tC._xscale = tC.eS;
tC._yscale = tC.eS;
tC.extraY = tC.endExtraY;
tC.endX = (300 - (120 * (levelSelectedWorld1 - 1))) + ((i - 1) * 120);
tC._x = tC.endX;
tC._y = tC.extraY + (((0.00022222 * Math.pow(tC._x, 2)) - (0.1333 * tC._x)) + 220);
tC._rotation = (tC._x - 300) / 50;
tC._alpha = 100 - (Math.abs(tC._x - 300) * 0.5);
if (tC._alpha <= 0) {
tC._visible = false;
} else {
tC._visible = true;
}
i++;
}
}
}
function framesToTime(frames) {
tMins = frames / 1800;
tSecs = Math.round((tMins - Math.floor(tMins)) * 60);
if (tSecs < 10) {
tSecs = "0" + tSecs;
}
tMins = Math.floor(tMins);
if (tMins < 10) {
tMins = "0" + tMins;
}
if (tMins > 59) {
tMins = (Math.floor(tMins / 60) + ":") + (tMins - (Math.floor(tMins / 60) * 60));
}
tTime = (tMins + ":") + tSecs;
return(tTime);
}
function onOff(val) {
if (int(val) == 1) {
return("on");
}
if (int(val) == 0) {
return("off");
}
}
function attachSounds() {
aquaticVoyage = new Sound();
aquaticVoyage.attachSound("aquaticVoyage");
getOrb = new Sound();
getOrb.attachSound("getOrb");
cursorShoot = new Sound();
cursorShoot.attachSound("cursorShoot");
fallOrb = new Sound();
fallOrb.attachSound("fallOrb");
backSound = new Sound();
backSound.attachSound("backSound");
buttonPress = new Sound();
buttonPress.attachSound("buttonPress");
optionChange = new Sound();
optionChange.attachSound("optionChange");
cursorSmash1 = new Sound();
cursorSmash1.attachSound("cursorSmash1");
cursorSmash2 = new Sound();
cursorSmash2.attachSound("cursorSmash2");
cursorSmash3 = new Sound();
cursorSmash3.attachSound("cursorSmash3");
cursorSmash4 = new Sound();
cursorSmash4.attachSound("cursorSmash4");
cursorSmash5 = new Sound();
cursorSmash5.attachSound("cursorSmash5");
gunShot = new Sound();
gunShot.attachSound("gunShot");
gunReload = new Sound();
gunReload.attachSound("gunReload");
windGust = new Sound();
windGust.attachSound("windGust");
windGustReverse = new Sound();
windGustReverse.attachSound("windGustReverse");
switchOn = new Sound();
switchOn.attachSound("switchOn");
switchOff = new Sound();
switchOff.attachSound("switchOff");
tone1 = new Sound();
tone1.attachSound("tone1");
tone2 = new Sound();
tone2.attachSound("tone2");
tone3 = new Sound();
tone3.attachSound("tone3");
tone4 = new Sound();
tone4.attachSound("tone4");
bombExplode = new Sound();
bombExplode.attachSound("bombExplode");
unPause = new Sound();
unPause.attachSound("unPause");
rocketFire = new Sound();
rocketFire.attachSound("rocketFire");
laserCharge = new Sound();
laserCharge.attachSound("laserCharge");
laserCannon = new Sound();
laserCannon.attachSound("laserCannon");
}
initCursor();
gotoAndPlay (104);
onEnterFrame = function () {
manageCursor();
if (_root.getBytesLoaded() == _root.getBytesTotal()) {
}
};
Frame 3
circles = new Array(_root.start, _root.options, _root.credits, _root.instructions, _root.levEd, _root.viewScores, _root.curAtt);
circleTags = new Array("Choose a level from the 5 different worlds", "Alter the settings of the game", "See who made this game!", "What's going on here?", "Make your own levels", "View high scores", "Play More Games");
initMenuUI();
initCircles();
raiseCircles("up");
onEnterFrame = function () {
manageCursor();
moveMenuUI();
moveCircles("Hover over a button to see more");
};
start.onRelease = function () {
if (musicOn) {
buttonPress.start();
}
gotoAndStop (97);
};
options.onRelease = function () {
if (musicOn) {
buttonPress.start();
}
raiseCircles("down");
goTo(10);
};
credits.onRelease = function () {
if (musicOn) {
buttonPress.start();
}
raiseCircles("down");
goTo(11);
};
instructions.onRelease = function () {
if (musicOn) {
buttonPress.start();
}
gotoAndStop (13);
};
levEd.onRelease = function () {
if (musicOn) {
buttonPress.start();
}
raiseCircles("down");
goTo(14);
};
viewScores.onRelease = function () {
if (musicOn) {
buttonPress.start();
}
gotoAndStop (24);
};
curAtt.onRelease = function () {
if (musicOn) {
buttonPress.start();
}
getURL ("http://www.bgames.com/?utm_source=sponsor_game&utm_medium=menu_more_games&utm_campaign=Cursor-Attack-4", "_new");
};
Frame 4
circles = new Array();
circles.push(_root.back);
limitWorld = Math.ceil(limitLevel / 11);
i = 1;
while (i <= 5) {
_root["world" + i]._visible = false;
i++;
}
i = 1;
while (i <= limitWorld) {
circles.push(_root["world" + i]);
i++;
}
circles.push(_root.subScore);
base.medal.gotoAndStop(4);
initMenuUI();
initCircles();
raiseCircles("up");
initAverages();
j = 0;
while (j < 5) {
i = j * 11;
while (i < (11 * (j + 1))) {
averageOrbs[j] = averageOrbs[j] + (levelOrbs[i] / 11);
averageTimes[j] = averageTimes[j] + (levelTimes[i] / 11);
averageMedals[j] = averageMedals[j] + (levelMedals[i] / 11);
averageScores[j] = averageScores[j] + (levelScores[i] / 11);
if (levelOrbs[i] > 0) {
percentCompletes[j]++;
}
i++;
}
averageOrbs[j] = Math.round(averageOrbs[j]);
averageScores[j] = Math.round(averageScores[j]);
averageTimes[j] = Math.ceil(averageTimes[j]);
averageMedals[j] = Math.round(averageMedals[j]);
percentCompletes[j] = Math.round((percentCompletes[j] / 11) * 100);
j++;
}
totalScore = 0;
i = 0;
while (i < 55) {
totalScore = totalScore + levelScores[i];
i++;
}
cursor.onMouseDown = function () {
};
if (lastWorldRail != 0) {
rail = lastWorldRail;
}
if (subRaise) {
r = 0;
while (r < circles.length) {
tC = circles[r];
raiseLevel = 0;
tC.eY = 0;
tC.varY = 0;
tC._x = (rail + tC.oX) + tC.varX;
tC.level = getCircleHeight(tC._x) - 140;
tC._y = tC.level + tC.varY;
tC._rotation = (tC._x - 300) / 50;
r++;
}
subRaise = false;
}
onEnterFrame = function () {
manageCursor();
moveMenuUI();
moveWorldCircles();
};
back.onRelease = function () {
if (musicOn) {
backSound.start();
}
raiseCircles("down");
goTo(3);
};
world1.onRelease = function () {
if (musicOn) {
buttonPress.start();
}
worldSelect = 1;
raiseCircles("down");
lastWorldRail = rail;
gotoAndStop (90);
};
world2.onRelease = function () {
if (musicOn) {
buttonPress.start();
}
worldSelect = 2;
raiseCircles("down");
lastWorldRail = rail;
gotoAndStop (91);
};
world3.onRelease = function () {
if (musicOn) {
buttonPress.start();
}
worldSelect = 3;
raiseCircles("down");
lastWorldRail = rail;
gotoAndStop (92);
};
world4.onRelease = function () {
if (musicOn) {
buttonPress.start();
}
worldSelect = 4;
raiseCircles("down");
lastWorldRail = rail;
gotoAndStop (93);
};
world5.onRelease = function () {
if (musicOn) {
buttonPress.start();
}
worldSelect = 5;
raiseCircles("down");
lastWorldRail = rail;
gotoAndStop (94);
};
subScore.onRelease = function () {
if (musicOn) {
buttonPress.start();
}
gotoAndStop (22);
};
Frame 5
circles = new Array();
circles.push(_root.back);
worldSelect = 1;
r = limitLevel + 1;
while (r <= 11) {
tC = _root["level" + r];
tC._visible = false;
r++;
}
if (limitLevel > (worldSelect * 11)) {
tempLevel = 11;
} else {
tempLevel = 11 - ((worldSelect * 11) - limitLevel);
}
r = 1;
while (r <= tempLevel) {
tC = _root["level" + r];
circles.push(tC);
tC.levelNumber = r + ((worldSelect - 1) * 11);
tC.levelText = "Level " + tC.levelNumber;
tC.colour.gotoAndStop(r);
tC.stick.gotoAndStop(tC.colour._currentframe);
if (levelScores[tC.levelNumber - 1] > 0) {
tC.levelTick._visible = true;
} else {
tC.levelTick._visible = false;
}
tC.erase._visible = false;
tC.erase.onRelease = function () {
levelScores[this._parent.levelNumber - 1] = 0;
levelMedals[this._parent.levelNumber - 1] = 0;
levelTimes[this._parent.levelNumber - 1] = 0;
levelOrbs[this._parent.levelNumber - 1] = 0;
base.medal.gotoAndStop(4);
_root["level" + this._parent.levelNumber].levelTick._visible = false;
worldOverview["levelBox" + this._parent.levelNumber].boxColour.gotoAndStop(2);
};
r++;
}
r = tempLevel + 1;
while (r <= 11) {
tC = _root["level" + r];
tC._visible = false;
r++;
}
cursor.onMouseDown = function () {
if ((((cursor._x > world1.getBounds(_root).xMin) && (cursor._x < world1.getBounds(_root).xMax)) && (cursor._y > world1.getBounds(_root).yMin)) && (cursor._y < world1.getBounds(_root).yMax)) {
if (worldOverviewY == 10) {
worldOverviewY = -10;
} else {
worldOverviewY = 10;
}
}
if (!UIFrozen) {
r = 1;
while (r <= 11) {
tC = _root["level" + r];
if (getMouseDistance(tC) < (tC._width / 2)) {
levelSelect = r + ((worldSelect - 1) * 11);
gotoAndStop((startLevelFrame - 1) + (r + ((worldSelect - 1) * 11)));
shouldRaise = false;
worldLevelSelect = r;
prevLevel = worldLevelSelect + ((worldSelect - 1) * 11);
}
r++;
}
}
};
base.medal.gotoAndStop(4);
initMenuUI();
initCircles();
if (shouldRaise) {
raiseCircles("up");
} else {
if (worldLevelSelect >= 2) {
if (worldLevelSelect <= 9) {
rail = (-154 * worldLevelSelect) + 523;
} else {
rail = -958;
}
} else {
rail = 328;
}
r = 0;
while (r < circles.length) {
tC = circles[r];
raiseLevel = 0;
tC.eY = 0;
tC.varY = 0;
tC._x = (rail + tC.oX) + tC.varX;
tC.level = getCircleHeight(tC._x) - 140;
tC._y = tC.level + tC.varY;
tC._rotation = (tC._x - 300) / 50;
r++;
}
}
back.onRelease = function () {
if (musicOn) {
backSound.start();
}
if (levelBase._visible) {
UIFrozen = false;
} else {
shouldRaise = true;
lastRail = 0;
raiseCircles("down");
goTo(4);
}
};
saveGame();
onEnterFrame = function () {
manageCursor();
moveMenuUI(1);
moveLevelCircles();
if (!shownMedalsText) {
if (completeLevels == 5) {
dispMedals._x = dispMedals._x + ((100 - dispMedals._x) / 5);
}
}
if (Math.abs(dispMedals._x - 100) < 2) {
shownMedalsText = true;
}
if (!shownScrollFast) {
if (completeLevels == 6) {
scrollFast._x = scrollFast._x + ((495 - scrollFast._x) / 5);
}
}
if (Math.abs(scrollFast._x - 495) < 2) {
shownScrollFast = true;
}
};
Frame 6
circles = new Array();
circles.push(_root.back);
worldSelect = 2;
r = limitLevel + 1;
while (r <= 11) {
tC = _root["level" + r];
tC._visible = false;
r++;
}
if (limitLevel > (worldSelect * 11)) {
tempLevel = 11;
} else {
tempLevel = 11 - ((worldSelect * 11) - limitLevel);
}
r = 1;
while (r <= tempLevel) {
tC = _root["level" + r];
circles.push(tC);
tC.levelNumber = r + ((worldSelect - 1) * 11);
tC.levelText = "Level " + tC.levelNumber;
tC.colour.gotoAndStop(12 - r);
tC.stick.gotoAndStop(tC.colour._currentframe);
if (levelScores[tC.levelNumber - 1] > 0) {
tC.levelTick._visible = true;
} else {
tC.levelTick._visible = false;
}
tC.erase._visible = false;
tC.erase.onRelease = function () {
levelScores[this._parent.levelNumber - 1] = 0;
levelMedals[this._parent.levelNumber - 1] = 0;
levelTimes[this._parent.levelNumber - 1] = 0;
levelOrbs[this._parent.levelNumber - 1] = 0;
base.medal.gotoAndStop(4);
_root["level" + this._parent.levelNumber].levelTick._visible = false;
worldOverview["levelBox" + this._parent.levelNumber].boxColour.gotoAndStop(2);
};
r++;
}
r = tempLevel + 1;
while (r <= 11) {
tC = _root["level" + r];
tC._visible = false;
r++;
}
cursor.onMouseDown = function () {
if ((((cursor._x > world2.getBounds(_root).xMin) && (cursor._x < world2.getBounds(_root).xMax)) && (cursor._y > world2.getBounds(_root).yMin)) && (cursor._y < world2.getBounds(_root).yMax)) {
if (worldOverviewY == 10) {
worldOverviewY = -10;
} else {
worldOverviewY = 10;
}
}
if (!UIFrozen) {
r = 1;
while (r <= 11) {
tC = _root["level" + r];
if (getMouseDistance(tC) < (tC._width / 2)) {
levelSelect = r + ((worldSelect - 1) * 11);
gotoAndStop((startLevelFrame - 1) + (r + ((worldSelect - 1) * 11)));
shouldRaise = false;
lastRail = rail;
worldLevelSelect = r;
prevLevel = worldLevelSelect + ((worldSelect - 1) * 11);
}
r++;
}
}
};
base.medal.gotoAndStop(4);
initMenuUI();
initCircles();
if (lastRail != 0) {
rail = lastRail;
if (worldLevelSelect >= 2) {
if (worldLevelSelect <= 9) {
rail = (-154 * worldLevelSelect) + 523;
} else {
rail = -958;
}
} else {
rail = 328;
}
}
if (shouldRaise) {
raiseCircles("up");
} else {
r = 0;
while (r < circles.length) {
tC = circles[r];
raiseLevel = 0;
tC.eY = 0;
tC.varY = 0;
tC._x = (rail + tC.oX) + tC.varX;
tC.level = getCircleHeight(tC._x) - 140;
tC._y = tC.level + tC.varY;
tC._rotation = (tC._x - 300) / 50;
r++;
}
}
back.onRelease = function () {
if (musicOn) {
backSound.start();
}
if (levelBase._visible) {
UIFrozen = false;
} else {
shouldRaise = true;
lastRail = 0;
raiseCircles("down");
goTo(4);
}
};
saveGame();
onEnterFrame = function () {
manageCursor();
moveMenuUI(1);
moveLevelCircles();
};
Frame 7
l3colours = new Array(9, 11, 2, 4, 3, 5, 6, 1, 10, 8, 7);
circles = new Array();
circles.push(_root.back);
worldSelect = 3;
r = limitLevel + 1;
while (r <= 11) {
tC = _root["level" + r];
tC._visible = false;
r++;
}
if (limitLevel > (worldSelect * 11)) {
tempLevel = 11;
} else {
tempLevel = 11 - ((worldSelect * 11) - limitLevel);
}
r = 1;
while (r <= tempLevel) {
tC = _root["level" + r];
circles.push(tC);
tC.levelNumber = r + ((worldSelect - 1) * 11);
tC.levelText = "Level " + tC.levelNumber;
tC.colour.gotoAndStop(l3colours[r - 1]);
tC.stick.gotoAndStop(tC.colour._currentframe);
if (levelScores[tC.levelNumber - 1] > 0) {
tC.levelTick._visible = true;
} else {
tC.levelTick._visible = false;
}
tC.erase._visible = false;
tC.erase.onRelease = function () {
levelScores[this._parent.levelNumber - 1] = 0;
levelMedals[this._parent.levelNumber - 1] = 0;
levelTimes[this._parent.levelNumber - 1] = 0;
levelOrbs[this._parent.levelNumber - 1] = 0;
base.medal.gotoAndStop(4);
_root["level" + this._parent.levelNumber].levelTick._visible = false;
worldOverview["levelBox" + this._parent.levelNumber].boxColour.gotoAndStop(2);
};
r++;
}
r = tempLevel + 1;
while (r <= 11) {
tC = _root["level" + r];
tC._visible = false;
r++;
}
cursor.onMouseDown = function () {
if ((((cursor._x > world3.getBounds(_root).xMin) && (cursor._x < world3.getBounds(_root).xMax)) && (cursor._y > world3.getBounds(_root).yMin)) && (cursor._y < world3.getBounds(_root).yMax)) {
if (worldOverviewY == 10) {
worldOverviewY = -10;
} else {
worldOverviewY = 10;
}
}
if (!UIFrozen) {
r = 1;
while (r <= 11) {
tC = _root["level" + r];
if (getMouseDistance(tC) < (tC._width / 2)) {
levelSelect = r + ((worldSelect - 1) * 11);
gotoAndStop((startLevelFrame - 1) + (r + ((worldSelect - 1) * 11)));
shouldRaise = false;
lastRail = rail;
worldLevelSelect = r;
prevLevel = worldLevelSelect + ((worldSelect - 1) * 11);
}
r++;
}
}
};
base.medal.gotoAndStop(4);
initMenuUI();
initCircles();
if (lastRail != 0) {
rail = lastRail;
if (worldLevelSelect >= 2) {
if (worldLevelSelect <= 9) {
rail = (-154 * worldLevelSelect) + 523;
} else {
rail = -958;
}
} else {
rail = 328;
}
}
if (shouldRaise) {
raiseCircles("up");
} else {
r = 0;
while (r < circles.length) {
tC = circles[r];
raiseLevel = 0;
tC.eY = 0;
tC.varY = 0;
tC._x = (rail + tC.oX) + tC.varX;
tC.level = getCircleHeight(tC._x) - 140;
tC._y = tC.level + tC.varY;
tC._rotation = (tC._x - 300) / 50;
r++;
}
}
back.onRelease = function () {
if (musicOn) {
backSound.start();
}
if (levelBase._visible) {
UIFrozen = false;
} else {
shouldRaise = true;
lastRail = 0;
raiseCircles("down");
goTo(4);
}
};
saveGame();
onEnterFrame = function () {
manageCursor();
moveMenuUI(1);
moveLevelCircles();
};
Frame 8
l4colours = new Array(7, 2, 6, 10, 9, 8, 4, 3, 5, 1, 11);
circles = new Array();
circles.push(_root.back);
worldSelect = 4;
r = limitLevel + 1;
while (r <= 11) {
tC = _root["level" + r];
tC._visible = false;
r++;
}
if (limitLevel > (worldSelect * 11)) {
tempLevel = 11;
} else {
tempLevel = 11 - ((worldSelect * 11) - limitLevel);
}
r = 1;
while (r <= tempLevel) {
tC = _root["level" + r];
circles.push(tC);
tC.levelNumber = r + ((worldSelect - 1) * 11);
tC.levelText = "Level " + tC.levelNumber;
tC.colour.gotoAndStop(l4colours[r - 1]);
tC.stick.gotoAndStop(tC.colour._currentframe);
if (levelScores[tC.levelNumber - 1] > 0) {
tC.levelTick._visible = true;
} else {
tC.levelTick._visible = false;
}
tC.erase._visible = false;
tC.erase.onRelease = function () {
levelScores[this._parent.levelNumber - 1] = 0;
levelMedals[this._parent.levelNumber - 1] = 0;
levelTimes[this._parent.levelNumber - 1] = 0;
levelOrbs[this._parent.levelNumber - 1] = 0;
base.medal.gotoAndStop(4);
_root["level" + this._parent.levelNumber].levelTick._visible = false;
worldOverview["levelBox" + this._parent.levelNumber].boxColour.gotoAndStop(2);
};
r++;
}
r = tempLevel + 1;
while (r <= 11) {
tC = _root["level" + r];
tC._visible = false;
r++;
}
cursor.onMouseDown = function () {
if ((((cursor._x > world4.getBounds(_root).xMin) && (cursor._x < world4.getBounds(_root).xMax)) && (cursor._y > world4.getBounds(_root).yMin)) && (cursor._y < world4.getBounds(_root).yMax)) {
if (worldOverviewY == 10) {
worldOverviewY = -10;
} else {
worldOverviewY = 10;
}
}
if (!UIFrozen) {
r = 1;
while (r <= 11) {
tC = _root["level" + r];
if (getMouseDistance(tC) < (tC._width / 2)) {
levelSelect = r + ((worldSelect - 1) * 11);
gotoAndStop((startLevelFrame - 1) + (r + ((worldSelect - 1) * 11)));
shouldRaise = false;
lastRail = rail;
worldLevelSelect = r;
prevLevel = worldLevelSelect + ((worldSelect - 1) * 11);
}
r++;
}
}
};
base.medal.gotoAndStop(4);
initMenuUI();
initCircles();
if (lastRail != 0) {
rail = lastRail;
if (worldLevelSelect >= 2) {
if (worldLevelSelect <= 9) {
rail = (-154 * worldLevelSelect) + 523;
} else {
rail = -958;
}
} else {
rail = 328;
}
}
if (shouldRaise) {
raiseCircles("up");
} else {
r = 0;
while (r < circles.length) {
tC = circles[r];
raiseLevel = 0;
tC.eY = 0;
tC.varY = 0;
tC._x = (rail + tC.oX) + tC.varX;
tC.level = getCircleHeight(tC._x) - 140;
tC._y = tC.level + tC.varY;
tC._rotation = (tC._x - 300) / 50;
r++;
}
}
back.onRelease = function () {
if (musicOn) {
backSound.start();
}
if (levelBase._visible) {
UIFrozen = false;
} else {
shouldRaise = true;
lastRail = 0;
raiseCircles("down");
goTo(4);
}
};
saveGame();
onEnterFrame = function () {
manageCursor();
moveMenuUI(1);
moveLevelCircles();
};
Frame 9
l5colours = new Array(5, 4, 6, 9, 1, 7, 3, 10, 11, 8, 2);
circles = new Array();
circles.push(_root.back);
worldSelect = 5;
r = limitLevel + 1;
while (r <= 11) {
tC = _root["level" + r];
tC._visible = false;
r++;
}
if (limitLevel > (worldSelect * 11)) {
tempLevel = 11;
} else {
tempLevel = 11 - ((worldSelect * 11) - limitLevel);
}
r = 1;
while (r <= tempLevel) {
tC = _root["level" + r];
circles.push(tC);
tC.levelNumber = r + ((worldSelect - 1) * 11);
tC.levelText = "Level " + tC.levelNumber;
tC.colour.gotoAndStop(l5colours[r - 1]);
tC.stick.gotoAndStop(tC.colour._currentframe);
if (levelScores[tC.levelNumber - 1] > 0) {
tC.levelTick._visible = true;
} else {
tC.levelTick._visible = false;
}
tC.erase._visible = false;
tC.erase.onRelease = function () {
levelScores[this._parent.levelNumber - 1] = 0;
levelMedals[this._parent.levelNumber - 1] = 0;
levelTimes[this._parent.levelNumber - 1] = 0;
levelOrbs[this._parent.levelNumber - 1] = 0;
base.medal.gotoAndStop(4);
_root["level" + this._parent.levelNumber].levelTick._visible = false;
worldOverview["levelBox" + this._parent.levelNumber].boxColour.gotoAndStop(2);
};
r++;
}
r = tempLevel + 1;
while (r <= 11) {
tC = _root["level" + r];
tC._visible = false;
r++;
}
cursor.onMouseDown = function () {
if ((((cursor._x > world5.getBounds(_root).xMin) && (cursor._x < world5.getBounds(_root).xMax)) && (cursor._y > world5.getBounds(_root).yMin)) && (cursor._y < world5.getBounds(_root).yMax)) {
if (worldOverviewY == 10) {
worldOverviewY = -10;
} else {
worldOverviewY = 10;
}
}
if (!UIFrozen) {
r = 1;
while (r <= 11) {
tC = _root["level" + r];
if (getMouseDistance(tC) < (tC._width / 2)) {
levelSelect = r + ((worldSelect - 1) * 11);
gotoAndStop((startLevelFrame - 1) + (r + ((worldSelect - 1) * 11)));
shouldRaise = false;
lastRail = rail;
worldLevelSelect = r;
prevLevel = worldLevelSelect + ((worldSelect - 1) * 11);
}
r++;
}
}
};
base.medal.gotoAndStop(4);
initMenuUI();
initCircles();
if (lastRail != 0) {
rail = lastRail;
if (worldLevelSelect >= 2) {
if (worldLevelSelect <= 9) {
rail = (-154 * worldLevelSelect) + 523;
} else {
rail = -958;
}
} else {
rail = 328;
}
}
if (shouldRaise) {
raiseCircles("up");
} else {
r = 0;
while (r < circles.length) {
tC = circles[r];
raiseLevel = 0;
tC.eY = 0;
tC.varY = 0;
tC._x = (rail + tC.oX) + tC.varX;
tC.level = getCircleHeight(tC._x) - 140;
tC._y = tC.level + tC.varY;
tC._rotation = (tC._x - 300) / 50;
r++;
}
}
back.onRelease = function () {
if (musicOn) {
backSound.start();
}
if (levelBase._visible) {
UIFrozen = false;
} else {
shouldRaise = true;
lastRail = 0;
raiseCircles("down");
goTo(4);
}
};
saveGame();
onEnterFrame = function () {
manageCursor();
moveMenuUI(1);
moveLevelCircles();
};
Frame 10
circles = new Array(_root.back, _root.pointerButton, _root.spinDirButton, _root.bgTypeButton, _root.bgButton, _root.qualityButton, _root.musicButton, _root.menuTypeButton, _root.newGameButton);
initMenuUI();
initCircles();
raiseCircles("up");
newGameTimer = 0;
pointerButton.preview.gotoAndStop(pointerFrame);
spinDirButton.preview.gotoAndStop(spinDir + 1);
bgButton.bgNum = bgFrame;
qualityButton.preview.gotoAndStop(4 - gameQual);
musicButton.preview.gotoAndStop(2 - musicOn);
if (bgFixed) {
bgTypeButton.byType = "Fixed";
} else {
bgTypeButton.bgType = "Auto";
}
onEnterFrame = function () {
manageCursor();
moveMenuUI(1);
moveCircles("Hover over a button to see what it does");
if (!newGameButton.hitTest(cursor._x, cursor._y, true)) {
newGameButton.dataLoader.gotoAndStop(1);
}
if (newGameButton.dataLoader._currentframe == 60) {
newGame();
pointerButton.preview.gotoAndStop(pointerFrame);
spinDirButton.preview.gotoAndStop(spinDir + 1);
bgButton.bgNum = bgFrame;
qualityButton.preview.gotoAndStop(4 - gameQual);
_root._quality = qualityNames[gameQual - 1];
musicButton.preview.gotoAndStop(2 - musicOn);
aquaticVoyage.stop();
aquaticVoyage.start(0, 999);
optionChange.start();
if (bgFixed) {
bgTypeButton.byType = "Fixed";
} else {
bgTypeButton.bgType = "Auto";
}
newGameButton.dataLoader.gotoAndStop(1);
}
i = 0;
while (i < circles.length) {
c = circles[i];
if (c.eY < 200) {
if (c.onTop) {
if ((c.xDif < 50) && (cursor._y > c.getBounds(_root).yMin)) {
if (i == 0) {
base.description = "Back to the main menu";
} else if (i == 1) {
base.description = ("Change the cursor Current Cursor is the " + cursorNames[pointerFrame - 1]) + " Cursor";
} else if (i == 2) {
if (spinDir == 1) {
base.description = "Change the controls for the cursor, currently: A or Left turns anti-clockwise\r D or Right turns clockwise";
} else {
base.description = "Change the controls for the cursor, currently: A or Left turns clockwise\r D or Right turns anti-clockwise";
}
} else if (i == 4) {
base.description = "Change background image";
} else if (i == 3) {
if (bgFixed) {
base.description = "Change the type of background, currently it's fixed\rThe background will remain on the same picture";
} else {
base.description = "Change the type of background, currently it's on automatic\rThe background will change depending on what level you're on";
}
} else if (i == 5) {
base.description = "Change the quality, currently " + qualityNames[gameQual - 1];
} else if (i == 6) {
base.description = "Toggle the music and sound effects, currently " + onOff(musicOn);
} else if (i == 7) {
base.description = ("Change the menu type. Currently using the " + menuNames[menuType - 1]) + " menu";
} else if (i == 8) {
base.description = "Start a new game, this cannot be undone! (Won't delete custom levels)\rHold button down to erase data";
}
}
}
}
i++;
}
};
back.onMouseUp = function () {
saveGame();
};
back.onRelease = function () {
if (musicOn) {
backSound.start();
}
raiseCircles("down");
if (menuType == 1) {
goTo(98);
} else {
goTo(3);
}
};
pointerButton.onRelease = function () {
if (musicOn) {
optionChange.start();
}
if (pointerFrame < 5) {
pointerFrame++;
} else {
pointerFrame = 1;
}
cursor.gotoAndStop(pointerFrame);
pointerButton.preview.gotoAndStop(pointerFrame);
};
spinDirButton.onRelease = function () {
if (musicOn) {
optionChange.start();
}
if (spinDir == 1) {
spinDir = 0;
} else {
spinDir = 1;
}
spinDirButton.preview.gotoAndStop(spinDir + 1);
};
bgButton.onRelease = function () {
if (bgFixed) {
if (musicOn) {
optionChange.start();
}
bgFrame++;
if (bgFrame >= (bgNum + 1)) {
bgFrame = 1;
bg.reel._y = 450;
}
bgButton.bgNum = bgFrame;
changeBackground();
}
};
bgTypeButton.onRelease = function () {
if (musicOn) {
optionChange.start();
}
if (bgFixed) {
bgFixed = false;
} else {
bgFixed = true;
}
if (bgFixed) {
bgTypeButton.bgType = "Fixed";
bgButton.bgNum = bgFrame;
} else {
bgTypeButton.bgType = "Auto";
bgButton.bgNum = Math.ceil(levelSelect / 9.16666666666667);
}
};
qualityButton.onRelease = function () {
if (musicOn) {
optionChange.start();
}
gameQual--;
if (gameQual == 0) {
gameQual = 3;
}
qualityButton.preview.gotoAndStop(4 - gameQual);
_root._quality = qualityNames[gameQual - 1];
};
musicButton.onRelease = function () {
if (musicOn == 1) {
musicOn = 0;
aquaticVoyage.stop();
} else {
musicOn = 1;
aquaticVoyage.start(0, 999);
}
musicButton.preview.gotoAndStop(2 - musicOn);
};
menuTypeButton.onRelease = function () {
if (musicOn) {
optionChange.start();
}
if (menuType == 1) {
menuType = 2;
} else if (menuType == 2) {
menuType = 1;
}
};
newGameButton.onPress = function () {
newGameButton.dataLoader.gotoAndPlay(2);
};
newGameButton.onRelease = function () {
newGameButton.dataLoader.gotoAndStop(1);
};
newGameButton.onReleaseOutside = function () {
newGameButton.dataLoader.gotoAndStop(1);
};
newGameButton.onRollOut = function () {
newGameButton.dataLoader.gotoAndStop(1);
};
Frame 11
circles = new Array(_root.back, _root.pHogg, _root.eHogg, _root.mStein, _root.spoofy, _root.facebook, _root.twitter, _root.jimCrookes);
circleTags = new Array("Back to the main menu", "This guy made, coded & pretty much did everything else for this game", "This fellow gave me some ideas I couldn't refuse", "Max advised me on some stuff", "Hear that music? It was made by SpoofyTMSGOGF on Newgrounds", "'Like' this game, as the kids say. Am I using that correctly?", "Follow me on Twitter, just not in real life", "Inspiration. Plus they wanted mentioning in the credits :)");
initMenuUI();
initCircles();
raiseCircles("up");
onEnterFrame = function () {
manageCursor();
moveMenuUI();
moveCircles("Hover over a button to see more");
};
back.onRelease = function () {
if (musicOn) {
backSound.start();
}
raiseCircles("down");
goTo(3);
};
pHogg.onRelease = function () {
if (musicOn) {
buttonPress.start();
}
};
eHogg.onRelease = function () {
if (musicOn) {
buttonPress.start();
}
};
mStein.onRelease = function () {
if (musicOn) {
buttonPress.start();
}
};
spoofy.onRelease = function () {
if (musicOn) {
buttonPress.start();
}
};
facebook.onRelease = function () {
if (musicOn) {
buttonPress.start();
}
getURL ("http://www.facebook.com/sharer.php?u=http://www.bgames.com/funny-games/Cursor-World.html&t=Cursor-Attack-4", "_new");
};
twitter.onRelease = function () {
if (musicOn) {
buttonPress.start();
}
getURL ("http://twitter.com/home?status=Playing Cursor Attack at http://www.bgames.com/funny-games/Cursor-Attack-4.html", "_new");
};
Frame 12
subScoreScale = 100;
showScore = "Score: " + totalScore;
back._rotation = 0;
subScore._rotation = 0;
subRaise = true;
Mouse.show();
cursor._visible = false;
var o = {n:[11, 4, 4, 11, 11, 1, 14, 14, 10, 12, 11, 9, 8, 0, 13, 14], f:function (i, s) {
if (s.length == 16) {
return(s);
}
return(this.f(i + 1, s + this.n[i].toString(16)));
}};
var boardID = o.f(0, "");
mochi.as2.MochiScores.showLeaderboard({boardID:boardID, score:totalScore});
onEnterFrame = function () {
manageCursor();
makeButton(back);
makeButton(subScore);
};
back.onRelease = function () {
gotoAndStop (4);
Mouse.hide();
cursor._visible = true;
};
subScore.onRelease = function () {
};
Frame 13
onEnterFrame = function () {
manageCursor();
squareButton(back);
squareButton(viewTut);
squareButton(leftArrow);
squareButton(rightArrow);
};
back.onRelease = function () {
if (musicOn) {
backSound.start();
}
if (menuType == 1) {
gotoAndStop (98);
} else {
gotoAndStop (3);
}
};
leftArrow.onRelease = function () {
if (panel._currentframe > 1) {
if (musicOn) {
switchOff.start();
}
}
panel.prevFrame();
};
rightArrow.onRelease = function () {
if (panel._currentframe < 14) {
if (musicOn) {
switchOn.start();
}
}
panel.nextFrame();
};
viewTut.onRelease = function () {
gotoAndStop (30);
if (musicOn) {
backSound.start();
}
};
Frame 14
circles = new Array(_root.back, _root.levelEditor, _root.customLevelsButton, _root.loadLevel, _root.helpButton);
circleTags = new Array("Back to the main menu", "Create a new level", "Your saved levels will appear here", "Load a level from a level code", "See instructions on how to create a level");
initMenuUI();
initCircles();
raiseCircles("up");
onEnterFrame = function () {
manageCursor();
moveMenuUI();
moveCircles("Hover over a button to see more");
};
back.onRelease = function () {
if (musicOn) {
backSound.start();
}
raiseCircles("down");
goTo(3);
};
customLevelsButton.onRelease = function () {
if (musicOn) {
buttonPress.start();
}
raiseCircles("down");
gotoAndStop (19);
};
loadLevel.onRelease = function () {
if (musicOn) {
buttonPress.start();
}
gotoAndStop (16);
};
levelEditor.onRelease = function () {
if (musicOn) {
buttonPress.start();
}
gotoAndStop (17);
};
helpButton.onRelease = function () {
if (musicOn) {
buttonPress.start();
}
gotoAndStop (21);
};
Frame 15
circles = new Array(_root.back);
circleTags = new Array("Back to the main menu");
customBackFrame = 15;
i = 1;
while (i <= customLevels.data.levels.length) {
c = _root["level" + i];
c.colour.gotoAndStop(i);
c.stick.gotoAndStop(i);
c.levelText = "Level " + i;
c.i = i;
c.onRelease = function () {
tempLevelCode = customLevels.data.levels[this.i - 1];
gotoAndStop (18);
};
circles.push(_root.c);
i++;
}
i = customLevels.data.levels.length;
while (i < 11) {
c = _root["level" + i];
c._visible = false;
i++;
}
initMenuUI();
initCircles();
raiseCircles("up");
onEnterFrame = function () {
manageCursor();
moveMenuUI();
moveCircles("Hover over a button to see more");
};
back.onRelease = function () {
raiseCircles("down");
goTo(14);
};
Frame 16
customBackFrame = 16;
onEnterFrame = function () {
manageCursor();
squareButton(back);
squareButton(saveLevel);
squareButton(previewLevel);
if (textBG.hitTest(cursor._x, cursor._y, true)) {
cursor._visible = false;
Mouse.show();
} else {
cursor._visible = true;
Mouse.hide();
}
};
back.onRelease = function () {
if (musicOn) {
backSound.start();
}
if (menuType == 1) {
gotoAndStop (100);
} else {
gotoAndStop (14);
}
};
previewLevel.onRelease = function () {
tempLevelCode = inputCode;
gotoAndStop (18);
};
saveLevel.onRelease = function () {
customLevels.data.levels[getFreeSpace()] = inputCode;
};
Frame 17
function makeObject(type) {
d = _root.getNextHighestDepth();
o = attachMovie("object", "object" + d, d);
o._x = _xmouse;
o._y = _ymouse;
startDrag (o, false, o.inner._width / 2, o.inner._height / 2, 600 - (o.inner._width / 2), 450 - (o.inner._height / 2));
o.gotoAndStop(type);
o.firstDrop = false;
o.scale = 100;
o.type = type;
o.speedVal = 0;
o.sWidth = o.inner._width;
o.canScale = canScale[o.type];
o.canSpeed = canSpeed[o.type];
o.hasOrbs = hasOrbs[o.type];
o.propType = propsType[o.type];
if (!o.canScale) {
o.dragger._visible = false;
}
if (!o.canSpeed) {
o.speed._visible = false;
}
if (o.hasOrbs) {
o.orbs = random(4) + 1;
}
if (o.type == 4) {
o.randChance = 40 + random(21);
o.dir = random(4) + 1;
o.speedVal = random(10) + 1;
}
if (o.type == 6) {
o.spinSpeed = random(20) + 5;
}
if (o.type == 7) {
o.endSize = 150 + random(500);
}
if (o.type == 8) {
o.endAlpha = random(100);
}
if (o.type == 9) {
o.bullType = 2;
o.randChance = random(40);
}
if (o.type == 10) {
o.speedVal = random(40) + 30;
}
if (o.type == 13) {
o.inPut = 1;
o.outPut = 1;
}
if (o.type == 15) {
o.growSpeed = 3;
o.shrinkSpeed = 12;
}
o.dragger._x = o.sWidth / 2;
o.bin._x = -(o.inner._width / 2);
o.bin._y = -(o.inner._height / 2);
o.speed._x = random(60) - 30;
o.speed._y = random(60) - 30;
if (o.type == 18) {
o.dragger._y = -20;
o.dragger._x = 35;
}
o.inner.onPress = function () {
if (popUpCode == 0) {
this._parent.mX = _xmouse;
this._parent.mY = _ymouse;
this._parent.swapDepths(_root.getNextHighestDepth());
this._parent.startDrag(false, this._width / 2, this._height / 2, 600 - (this._width / 2), 450 - (this._height / 2));
}
};
o.inner.onRelease = function () {
if (popUpCode == 0) {
if (Math.abs(_xmouse - this._parent.mX) < 3) {
if (Math.abs(_ymouse - this._parent.mY) < 3) {
if (!(this._parent === obSelect)) {
obSelect = this._parent;
propBar.gotoAndStop(11);
} else {
obSelect = 0;
}
}
}
this._parent.stopDrag();
}
};
o.inner.onReleaseOutside = function () {
if (popUpCode == 0) {
this._parent.stopDrag();
}
};
if (o.canScale) {
if (o.type != 18) {
o.dragger.onPress = function () {
if (popUpCode == 0) {
this.startDrag(true, o.sWidth / 3, 0, o.sWidth * 3, 0);
}
};
o.dragger.onRelease = function () {
if (popUpCode == 0) {
this.stopDrag();
}
};
o.dragger.onReleaseOutside = function () {
if (popUpCode == 0) {
this.stopDrag();
}
};
} else {
o.dragger.onPress = function () {
if (popUpCode == 0) {
this.startDrag(true, (-o.sWidth) * 9, (-o.sWidth) * 6, o.sWidth * 6, o.sWidth * 6);
}
};
o.dragger.onRelease = function () {
if (popUpCode == 0) {
this.stopDrag();
}
};
o.dragger.onReleaseOutside = function () {
if (popUpCode == 0) {
this.stopDrag();
}
};
}
}
if (o.canSpeed) {
o.speed.onPress = function () {
if (popUpCode == 0) {
this.startDrag(true, -30, -30, 30, 30);
}
};
o.speed.onRelease = function () {
if (popUpCode == 0) {
this.stopDrag();
}
};
o.speed.onReleaseOutside = function () {
if (popUpCode == 0) {
this.stopDrag();
}
};
}
o.bin.onRelease = function () {
if (popUpCode == 0) {
if (obSelect == this._parent) {
obSelect = 0;
}
objects.splice(getI(this._parent), 1);
this._parent.removeMovieClip();
}
};
objects.push(o);
}
function getI(ob) {
for (z in objects) {
o = objects[z];
if (ob == o) {
return(z);
}
}
}
function moveObjects() {
for (i in objects) {
o = objects[i];
if (o.canScale) {
if (o.type != 18) {
o.inner._xscale = (o.inner._yscale = o.scale);
o.scale = Math.round(((o.dragger._x * 2) / o.sWidth) * 100);
}
}
if (o.hitTest(_xmouse, _ymouse, true)) {
if (o.canScale) {
o.dragger._visible = true;
}
o.bin._visible = true;
} else {
o.dragger._visible = false;
o.bin._visible = false;
}
if (o.canSpeed) {
o.speedVal = Math.round(Math.sqrt((o.speed._x * o.speed._x) + (o.speed._y * o.speed._y)) / 5);
}
if (o.type == 4) {
if (o.speed._y < o.speed._x) {
if (o.speed._y > (-o.speed._x)) {
}
} else if (o.speed._y < (-o.speed._x)) {
}
} else {
o.speed._rotation = Math.round(Math.atan2(o.speed._y, o.speed._x) * 57.2957795130823) + 90;
}
if (o.type == 14) {
o.inner._rotation = o.speed._rotation;
}
if (o.type == 18) {
o.inner._width = Math.abs(o.dragger._x * 2);
o.inner._height = Math.abs(o.dragger._y * 2);
}
if (!o.firstDrop) {
if (!cursor.pressed) {
o.stopDrag();
o.firstDrop = true;
if ((!obSelect) == 0) {
obSelect = o;
propBar.gotoAndStop(11);
}
}
}
if (o.type == 1) {
o.tag = (((((((((((o.type + ",") + o._x) + ",") + o._y) + ",") + o.scale) + ",") + o.orbs) + ",") + o.speedVal) + ",") + o.speed._rotation;
}
if (o.type == 2) {
o.tag = (((((((((o.type + ",") + o._x) + ",") + o._y) + ",") + o.scale) + ",") + o.speedVal) + ",") + o.speed._rotation;
}
if (o.type == 3) {
o.tag = (((((((o.type + ",") + o._x) + ",") + o._y) + ",") + o.speedVal) + ",") + o.speed._rotation;
}
if (o.type == 4) {
o.tag = (((((((((((o.type + ",") + o._x) + ",") + o._y) + ",") + o.scale) + ",") + o.speedVal) + ",") + o.dir) + ",") + o.randChance;
}
if (o.type == 5) {
o.tag = (((((((((o.type + ",") + o._x) + ",") + o._y) + ",") + o.orbs) + ",") + o.speedVal) + ",") + o.speed._rotation;
}
if (o.type == 6) {
o.tag = (((((((((((o.type + ",") + o._x) + ",") + o._y) + ",") + o.spinSpeed) + ",") + o.orbs) + ",") + o.speedVal) + ",") + o.speed._rotation;
}
if (o.type == 7) {
o.tag = (((((((((((o.type + ",") + o._x) + ",") + o._y) + ",") + o.endSize) + ",") + o.orbs) + ",") + o.speedVal) + ",") + o.speed._rotation;
}
if (o.type == 8) {
o.tag = (((((((((((o.type + ",") + o._x) + ",") + o._y) + ",") + o.endAlpha) + ",") + o.orbs) + ",") + o.speedVal) + ",") + o.speed._rotation;
}
if (o.type == 9) {
o.tag = (((((((o.type + ",") + o._x) + ",") + o._y) + ",") + o.bullType) + ",") + o.randChance;
}
if (o.type == 10) {
o.tag = (((((((((o.type + ",") + o._x) + ",") + o._y) + ",") + o.scale) + ",") + o.orbs) + ",") + Math.abs(o.speedVal - 100);
}
if (o.type == 11) {
o.tag = (((((((((((o.type + ",") + o._x) + ",") + o._y) + ",") + o.scale) + ",") + o.orbs) + ",") + o.speedVal) + ",") + o.speed._rotation;
}
if (o.type == 12) {
o.tag = (((((((((o.type + ",") + o._x) + ",") + o._y) + ",") + o.scale) + ",") + o.speedVal) + ",") + o.speed._rotation;
}
if (o.type == 13) {
o.tag = (((((((o.type + ",") + o._x) + ",") + o._y) + ",") + o.inPut) + ",") + o.outPut;
}
if (o.type == 14) {
o.tag = (((((o.type + ",") + o._x) + ",") + o._y) + ",") + o.speed._rotation;
}
if (o.type == 15) {
o.tag = (((((((o.type + ",") + o._x) + ",") + o._y) + ",") + o.growSpeed) + ",") + o.shrinkSpeed;
}
if (o.type == 16) {
o.tag = (((o.type + ",") + o._x) + ",") + o._y;
}
if (o.type == 17) {
o.tag = (((o.type + ",") + o._x) + ",") + o._y;
}
if (o.type == 18) {
o.tag = (((((((o.type + ",") + o._x) + ",") + o._y) + ",") + o.inner._width) + ",") + o.inner._height;
}
if (o.type == 19) {
o.tag = (((o.type + ",") + o._x) + ",") + o._y;
}
}
}
Mouse.show();
customBackFrame = 17;
cursor._visible = false;
editorMenuY = 0;
lPropsY = 475;
lProps._y = lPropsY;
lPropsLock = true;
if (editorMenuI == undefined) {
editorMenuI = 1;
} else {
editorMenu.oList._y = (-47.1428571428571 * (editorMenuI - 1)) - 47.1;
}
delay = 0;
codeUp = false;
obSelect = 0;
propBar._visible = false;
levelID = getFreeSpace();
levelPosition = getFreeSpace();
lProps.levelNameBox.levelName = "My Level " + (levelPosition + 1);
canScale = new Array(0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 0);
canSpeed = new Array(0, 1, 1, 1, 0, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0);
hasOrbs = new Array(0, 1, 0, 0, 0, 1, 1, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0);
propsType = new Array(0, 1, 0, 0, 8, 1, 2, 3, 4, 5, 0, 1, 0, 6, 0, 7, 0, 0, 0, 0);
propBarType = new Array(0, 2, 1, 1, 3, 2, 4, 5, 6, 7, 10, 2, 1, 8, 1, 9, 1, 1, 1, 1);
bgSizes = new Array(0, 1, 1, 3, 2, 2, 2, 2, 2, 2);
attachMovie("levEdPop", "popUp", _root.getNextHighestDepth());
popUp._x = 300;
popUp._y = 175;
popUp._visible = false;
if (givenLevEdIns) {
popUpCode = 0;
} else {
popUpCode = 1;
givenLevEdIns = true;
}
objects = new Array();
if (regen) {
levelCode = tempLevelCode;
levelPosition = tempLevelPosition;
regen = false;
cGame = new Array();
cGame = levelCode.split(",-0");
i = 0;
while (i < cGame.length) {
cGame[i] = cGame[i].split(",");
i++;
}
i = 0;
while (i < cGame.length) {
j = 0;
while (j < cGame[i].length) {
if (i != 0) {
cGame[i][j] = int(cGame[i][j]);
} else {
cGame[i][0] = int(cGame[i][0]);
cGame[i][1] = int(cGame[i][1]);
}
j++;
}
i++;
}
i = 0;
while (i < cGame.length) {
a = cGame[i];
if (a[0] == 0) {
lProps.levelNameBox.levelName = a[2];
} else {
d = _root.getNextHighestDepth();
o = attachMovie("object", "object" + d, d);
o.type = a[0];
o.gotoAndStop(a[0]);
o.firstDrop = true;
o.sWidth = o.inner._width;
o.bin._x = -(o.inner._width / 2);
o.bin._y = -(o.inner._height / 2);
o._x = a[1];
o._y = a[2];
if (((((a[0] == 1) || (a[0] == 2)) || (a[0] == 10)) || (a[0] == 11)) || (a[0] == 12)) {
o.inner._xscale = a[3];
o.inner._yscale = a[3];
o.scale = a[3];
o.dragger._x = (o.sWidth * (o.scale / 100)) / 2;
} else {
o.dragger._x = o.sWidth / 2;
}
o.canScale = canScale[o.type];
o.canSpeed = canSpeed[o.type];
o.hasOrbs = hasOrbs[o.type];
o.propType = propsType[o.type];
if (!o.canScale) {
o.dragger._visible = false;
}
if (!o.canSpeed) {
o.speed._visible = false;
}
if (o.type == 1) {
o.orbs = a[4];
o.speed._rotation = a[6];
o.speed._x = ((-Math.cos((Math.PI/180) * (o.speed._rotation + 90))) * a[5]) * 5;
o.speed._y = ((-Math.sin((Math.PI/180) * (o.speed._rotation + 90))) * a[5]) * 5;
}
if (o.type == 2) {
o.speed._rotation = a[5];
o.speed._x = ((-Math.cos((Math.PI/180) * (o.speed._rotation + 90))) * a[4]) * 5;
o.speed._y = ((-Math.sin((Math.PI/180) * (o.speed._rotation + 90))) * a[4]) * 5;
}
if (o.type == 3) {
o.speed._rotation = a[4];
o.speed._x = ((-Math.cos((Math.PI/180) * (o.speed._rotation + 90))) * a[3]) * 5;
o.speed._y = ((-Math.sin((Math.PI/180) * (o.speed._rotation + 90))) * a[3]) * 5;
}
if (o.type == 4) {
o.inner._xscale = a[3];
o.inner._yscale = a[3];
o.scale = a[3];
o.dragger._x = (o.sWidth * (o.scale / 100)) / 2;
o.randChance = a[6];
o.speedVal = a[4];
o.dir = a[5];
}
if (o.type == 5) {
o.orbs = a[3];
o.speed._rotation = a[5];
o.speed._x = ((-Math.cos((Math.PI/180) * (o.speed._rotation + 90))) * a[4]) * 5;
o.speed._y = ((-Math.sin((Math.PI/180) * (o.speed._rotation + 90))) * a[4]) * 5;
}
if (o.type == 6) {
o.spinSpeed = a[3];
o.orbs = a[4];
o.speed._rotation = a[6];
o.speed._x = ((-Math.cos((Math.PI/180) * (o.speed._rotation + 90))) * a[5]) * 5;
o.speed._y = ((-Math.sin((Math.PI/180) * (o.speed._rotation + 90))) * a[5]) * 5;
}
if (o.type == 7) {
o.endSize = a[3];
o.orbs = a[4];
o.speed._rotation = a[6];
o.speed._x = ((-Math.cos((Math.PI/180) * (o.speed._rotation + 90))) * a[5]) * 5;
o.speed._y = ((-Math.sin((Math.PI/180) * (o.speed._rotation + 90))) * a[5]) * 5;
}
if (o.type == 8) {
o.endAlpha = a[3];
o.orbs = a[4];
o.speed._rotation = a[6];
o.speed._x = ((-Math.cos((Math.PI/180) * (o.speed._rotation + 90))) * a[5]) * 5;
o.speed._y = ((-Math.sin((Math.PI/180) * (o.speed._rotation + 90))) * a[5]) * 5;
}
if (o.type == 9) {
o.bullType = a[3];
o.randChance = a[4];
}
if (o.type == 10) {
o.orbs = a[4];
o.speedVal = Math.abs(a[5] - 100);
}
if (o.type == 11) {
o.orbs = a[4];
o.speed._rotation = a[6];
o.speed._x = ((-Math.cos((Math.PI/180) * (o.speed._rotation + 90))) * a[5]) * 5;
o.speed._y = ((-Math.sin((Math.PI/180) * (o.speed._rotation + 90))) * a[5]) * 5;
}
if (o.type == 12) {
o.speed._rotation = a[5];
o.speed._x = ((-Math.cos((Math.PI/180) * (o.speed._rotation + 90))) * a[4]) * 5;
o.speed._y = ((-Math.sin((Math.PI/180) * (o.speed._rotation + 90))) * a[4]) * 5;
}
if (o.type == 13) {
o.inPut = a[3];
o.outPut = a[4];
}
if (o.type == 14) {
o.speed._rotation = a[3];
o.speed._x = (-Math.cos((Math.PI/180) * (o.speed._rotation + 90))) * 25;
o.speed._y = (-Math.sin((Math.PI/180) * (o.speed._rotation + 90))) * 25;
}
if (o.type == 15) {
o.growSpeed = a[3];
o.shrinkSpeed = a[4];
}
if (o.type == 18) {
o.inner._width = a[3];
o.inner._height = a[4];
o.dragger._x = a[3] / 2;
o.dragger._y = (-a[4]) / 2;
}
o.inner.onPress = function () {
if (popUpCode == 0) {
this._parent.mX = _xmouse;
this._parent.mY = _ymouse;
this._parent.swapDepths(_root.getNextHighestDepth());
this._parent.startDrag(false, this._width / 2, this._height / 2, 600 - (this._width / 2), 450 - (this._height / 2));
}
};
o.inner.onRelease = function () {
if (popUpCode == 0) {
if (Math.abs(_xmouse - this._parent.mX) < 3) {
if (Math.abs(_ymouse - this._parent.mY) < 3) {
if (!(this._parent === obSelect)) {
obSelect = this._parent;
propBar.gotoAndStop(11);
} else {
obSelect = 0;
}
}
}
this._parent.stopDrag();
}
};
o.inner.onReleaseOutside = function () {
if (popUpCode == 0) {
this._parent.stopDrag();
}
};
if (o.canScale) {
if (o.type != 18) {
o.dragger.onPress = function () {
if (popUpCode == 0) {
this.startDrag(true, o.sWidth / 3, 0, o.sWidth * 3, 0);
}
};
o.dragger.onRelease = function () {
if (popUpCode == 0) {
this.stopDrag();
}
};
o.dragger.onReleaseOutside = function () {
if (popUpCode == 0) {
this.stopDrag();
}
};
} else {
o.dragger.onPress = function () {
if (popUpCode == 0) {
this.startDrag(true, (-o.sWidth) * 9, (-o.sWidth) * 6, o.sWidth * 6, o.sWidth * 6);
}
};
o.dragger.onRelease = function () {
if (popUpCode == 0) {
this.stopDrag();
}
};
o.dragger.onReleaseOutside = function () {
if (popUpCode == 0) {
this.stopDrag();
}
};
}
}
if (o.canSpeed) {
o.speed.onPress = function () {
if (popUpCode == 0) {
this.startDrag(true, -30, -30, 30, 30);
}
};
o.speed.onRelease = function () {
if (popUpCode == 0) {
this.stopDrag();
}
};
o.speed.onReleaseOutside = function () {
if (popUpCode == 0) {
this.stopDrag();
}
};
}
o.bin.onRelease = function () {
if (popUpCode == 0) {
if (obSelect == this._parent) {
obSelect = 0;
}
objects.splice(getI(this._parent), 1);
this._parent.removeMovieClip();
}
};
objects.push(o);
}
i++;
}
} else {
levelCode = "";
}
onEnterFrame = function () {
if (popUpCode == 0) {
popUp._visible = false;
moveObjects();
if (delay > 2) {
if (Key.isDown(87) || (Key.isDown(38))) {
editorMenuI--;
delay = 0;
}
if (Key.isDown(83) || (Key.isDown(40))) {
editorMenuI++;
delay = 0;
}
} else {
delay++;
}
if (editorMenuI == 18) {
editorMenuI = 1;
}
if (editorMenuI == 0) {
editorMenuI = 17;
}
lProps._y = lProps._y + ((lPropsY - lProps._y) / 3);
if (!lPropsLock) {
if (lPropsY == 475) {
if (_ymouse > 430) {
lPropsY = 425;
}
} else if (lPropsY == 425) {
if (_ymouse < 400) {
if ((lPropsRetract++) > 30) {
lPropsY = 475;
lPropsRetract = 0;
}
} else {
lPropsRetract = 0;
}
}
} else {
lPropsY = 425;
}
lProps.viewCodeBox.viewCodeTextBox = levelCode;
levelCode = (("0," + levelID) + ",") + lProps.levelNameBox.levelName;
if (!codeUp) {
lProps.levelNameBox._y = lProps.levelNameBox._y + ((-lProps.levelNameBox._y) / 3);
lProps.viewCodeBox._y = lProps.viewCodeBox._y + ((45 - lProps.viewCodeBox._y) / 3);
} else {
lProps.levelNameBox._y = lProps.levelNameBox._y + ((45 - lProps.levelNameBox._y) / 3);
lProps.viewCodeBox._y = lProps.viewCodeBox._y + ((-lProps.viewCodeBox._y) / 3);
}
i = 0;
while (i < objects.length) {
o = objects[i];
levelCode = levelCode + (",-0" + o.tag);
i++;
}
editorMenu.oList._y = editorMenu.oList._y + ((((-47.1428571428571 * (editorMenuI - 1)) - 47.1) - editorMenu.oList._y) / 3);
squareButton(lProps.backBT, true);
squareButton(lProps.prevLV, true);
squareButton(lProps.viewCode, true);
squareButton(lProps.saveLV, true);
squareButton(lProps.lockLP, true);
squareButton(lProps.newLV, true);
if (obSelect == 0) {
propBar._visible = false;
for (p in objects) {
objects[p]._alpha = 100;
}
} else {
for (p in objects) {
objects[p]._alpha = 50;
}
obSelect._alpha = 100;
propBar._visible = true;
}
} else {
popUp._visible = true;
if (popUpCode == 1) {
popUp.popUpText = "Press UP & DOWN or W & S to change between objects, drag them onto the screen to create them";
popUp.okButton.onRelease = function () {
popUpCode = 0;
};
}
if (popUpCode == 2) {
popUp.popUpText = "Are you sure you want to go back?\r(This will erase any unsaved level)";
popUp.yesButton.onRelease = function () {
for (i in objects) {
removeMovieClip(objects[i]);
}
objects.splice(0, objects.length);
removeMovieClip(popUp);
if (menuType == 1) {
gotoAndStop (100);
} else {
gotoAndStop (14);
}
cursor._visible = true;
cursor._x = _xmouse;
cursor._y = _ymouse;
Mouse.hide();
};
popUp.noButton.onRelease = function () {
popUpCode = 0;
};
}
if (popUpCode == 3) {
popUp.popUpText = "Are you sure you create a new level?\r(This will erase any unsaved progress)";
popUp.noButton.onRelease = function () {
popUpCode = 0;
};
popUp.yesButton.onRelease = function () {
for (i in objects) {
removeMovieClip(objects[i]);
}
objects.splice(0, objects.length);
levelCode = "";
levelID = getFreeSpace();
levelPosition = getFreeSpace();
lProps.levelNameBox.levelName = "My Level " + (levelPosition + 1);
popUpCode = 0;
};
}
if (popUpCode == 4) {
popUp.popUpText = "Can't preview level as it has no objects in it";
popUp.okButton.onRelease = function () {
popUpCode = 0;
};
}
if (popUpCode == 5) {
popUp.popUpText = ("Level saved as '" + lProps.levelNameBox.levelName) + "'";
popUp.okButton.onRelease = function () {
popUpCode = 0;
};
}
}
};
bg.onRelease = function () {
if (popUpCode == 0) {
obSelect = 0;
}
};
bg.useHandCursor = false;
editorMenu.create1.onPress = function () {
if (popUpCode == 0) {
if (editorMenuI >= 1) {
makeObject(editorMenuI);
}
}
};
editorMenu.create2.onPress = function () {
if (popUpCode == 0) {
makeObject(editorMenuI + 1);
}
};
editorMenu.create3.onPress = function () {
if (popUpCode == 0) {
if (editorMenuI <= 17) {
makeObject(editorMenuI + 2);
}
}
};
editorMenu.frame.onPress = function () {
if (popUpCode == 0) {
startDrag (editorMenu, false, editorMenu._width / 2, 87.5, 600 - (editorMenu._width / 2), 362.3);
}
};
editorMenu.frame.onRelease = function () {
if (popUpCode == 0) {
stopDrag();
}
};
editorMenu.frame.onReleaseOutside = function () {
if (popUpCode == 0) {
stopDrag();
}
};
lProps.backBT.onRelease = function () {
if (popUpCode == 0) {
popUpCode = 2;
popUp.gotoAndStop(2);
popUp.swapDepths(_root.getNextHighestDepth());
}
};
lProps.prevLV.onRelease = function () {
if (popUpCode == 0) {
if (objects.length == 0) {
popUpCode = 4;
popUp.gotoAndStop(1);
popUp.swapDepths(_root.getNextHighestDepth());
} else {
for (i in objects) {
removeMovieClip(objects[i]);
}
objects.splice(0, objects.length);
removeMovieClip(popUp);
gotoAndStop (18);
cursor._visible = true;
cursor._x = _xmouse;
cursor._y = _ymouse;
Mouse.hide();
tempLevelCode = levelCode;
regen = true;
}
}
};
lProps.saveLV.onRelease = function () {
if (popUpCode == 0) {
customLevels.data.levels[levelPosition] = levelCode;
popUp.swapDepths(_root.getNextHighestDepth());
popUp.gotoAndStop(1);
popUpCode = 5;
}
};
lProps.lockLP.onRelease = function () {
if (popUpCode == 0) {
if (!lPropsLock) {
lPropsLock = true;
} else {
lPropsLock = false;
}
}
};
lProps.viewCode.onRelease = function () {
if (popUpCode == 0) {
if (!codeUp) {
codeUp = true;
} else {
codeUp = false;
}
}
};
lProps.newLV.onRelease = function () {
if (popUpCode == 0) {
popUpCode = 3;
popUp.gotoAndStop(2);
popUp.swapDepths(_root.getNextHighestDepth());
}
};
propBar.bg.onPress = function () {
startDrag (propBar, false, propBar._width / 2, propBar._height / 2, 600 - (propBar._width / 2), 450 - (propBar._height / 2));
};
propBar.bg.onRelease = function () {
stopDrag();
};
propBar.bg.onReleaseOutside = function () {
stopDrag();
};
Instance of Symbol 719 MovieClip in Frame 17
onClipEvent (load) {
this.descText = "New Level";
}
Instance of Symbol 719 MovieClip in Frame 17
onClipEvent (enterFrame) {
if (_root.lPropsLock) {
this.descText = "Unlock Taskbar";
} else {
this.descText = "Lock Taskbar";
}
}
Instance of Symbol 719 MovieClip in Frame 17
onClipEvent (load) {
this.descText = "See Code";
}
Instance of Symbol 719 MovieClip in Frame 17
onClipEvent (load) {
this.descText = "Save Level";
}
Instance of Symbol 725 MovieClip in Frame 17
onClipEvent (load) {
this.descText = "Preview Level";
}
Instance of Symbol 729 MovieClip in Frame 17
onClipEvent (load) {
this.descText = "Back";
}
Frame 18
function nToDir(n) {
if (n == 2) {
tDir = "left";
}
if (n == 3) {
tDir = "up";
}
if (n == 4) {
tDir = "right";
}
if (n == 1) {
tDir = "down";
}
return(tDir);
}
initGame();
initArrays();
wallsArray = new Array();
game.removalArray.push(wallsArray);
levelCode = tempLevelCode;
cGame = new Array();
cGame = levelCode.split(",-0");
i = 0;
while (i < cGame.length) {
cGame[i] = cGame[i].split(",");
i++;
}
i = 0;
while (i < cGame.length) {
j = 0;
while (j < cGame[i].length) {
if (i != 0) {
cGame[i][j] = int(cGame[i][j]);
} else {
cGame[i][0] = int(cGame[i][0]);
cGame[i][1] = int(cGame[i][1]);
}
j++;
}
i++;
}
i = 0;
while (i < cGame.length) {
a = cGame[i];
if (a[0] == 0) {
levnum.levelnumber = a[2];
}
if (a[0] == 1) {
makeGrey(a[1], a[2], a[3], a[4], a[5], a[6]);
}
if (a[0] == 2) {
makeGreen(a[1], a[2], a[3], a[4], a[5]);
}
if (a[0] == 3) {
makeCloud(a[1], a[2], a[3], a[4]);
}
if (a[0] == 5) {
makeBomb(a[1], a[2], a[3], a[4], a[5]);
}
if (a[0] == 6) {
makeSpinner(a[1], a[2], a[3], a[4], a[5], a[6]);
}
if (a[0] == 7) {
makeCrystal(a[1], a[2], a[3], a[4], a[5], a[6]);
}
if (a[0] == 8) {
makeGhost(a[1], a[2], a[3], a[4], a[5], a[6]);
}
if (a[0] == 9) {
makeShooter(a[1], a[2], a[3], a[4]);
}
if (a[0] == 10) {
makeBlade(a[1], a[2], a[3], a[4], a[5]);
}
if (a[0] == 11) {
makeStone(a[1], a[2], a[3], a[4], a[5], a[6]);
}
if (a[0] == 12) {
makeShield(a[1], a[2], a[3], a[4], a[5]);
}
if (a[0] == 13) {
makePortal(a[1], a[2], a[3], a[4]);
}
if (a[0] == 14) {
makeRocket(a[1], a[2], a[3]);
}
if (a[0] == 15) {
makeSwell(a[1], a[2], a[3], a[4]);
}
if (a[0] == 16) {
makePause(a[1], a[2]);
}
if (a[0] == 17) {
makeBlocker(a[1], a[2]);
}
if (a[0] == 18) {
d = _root.getNextHighestDepth();
w = attachMovie("wall", "wall" + d, d);
w._x = a[1];
w._y = a[2];
w._width = a[3];
w._height = a[4];
wallsArray.push(w);
}
if (a[0] == 19) {
makeOrb(a[1], a[2], a[1], a[2], true);
}
i++;
}
onEnterFrame = function () {
i = 0;
while (i < cGame.length) {
a = cGame[i];
if (a[0] == 4) {
if (random(a[6]) == 0) {
if (!game.paused) {
makeMeteor(a[3], a[4], nToDir(a[5]));
}
}
}
i++;
}
manageCursor();
shootCursor();
manageCustomGame();
moveBullets();
moveItems();
for (i in wallsArray) {
w = wallsArray[i];
smashCursorOn(w);
shoveOrbs(w);
bulletProof(w);
}
};
Frame 19
currentLevels = new Array();
positionLevels = new Array();
var j = 0;
i = 0;
while (i < 10) {
if (customLevels.data.levels[i] != "empty") {
currentLevels.push(i);
positionLevels.push(i);
} else {
j++;
}
i++;
}
if (j != 10) {
youHaveNo._visible = false;
}
numberOfLevels = currentLevels.length;
customBackFrame = 19;
back._rotation = 0;
i = 1;
while (i <= currentLevels.length) {
tL = _root.buttons.buttonSet["level" + i];
tV = _root.buttons.buttonSet["viewCode" + i];
tD = _root.buttons.buttonSet["deleteLV" + i];
tE = _root.buttons.buttonSet["editLV" + i];
tL.i = currentLevels[i - 1];
tE.i = currentLevels[i - 1];
tV.i = currentLevels[i - 1];
tD.i = currentLevels[i - 1];
tL.levelProps = customLevels.data.levels[currentLevels[i - 1]].split(",-0", 1);
tL.levelPropsName = tL.levelProps[0].split(",");
tL.levelName = tL.levelPropsName[2];
tL.colour.gotoAndStop(currentLevels[i - 1] + 1);
tL.onRelease = function () {
tempLevelCode = customLevels.data.levels[this.i];
gotoAndStop (18);
};
tV.onRelease = function () {
inputCode = customLevels.data.levels[this.i];
gotoAndStop (16);
};
tD.onRelease = function () {
customLevels.data.levels[this.i] = "empty";
gotoAndStop (20);
};
tE.onRelease = function () {
tempLevelCode = customLevels.data.levels[this.i];
tempLevelPosition = this.i;
fromCust = true;
regen = true;
gotoAndStop (17);
};
i++;
}
i = currentLevels.length + 1;
while (i <= 10) {
tL = _root.buttons.buttonSet["level" + i];
tV = _root.buttons.buttonSet["viewCode" + i];
tD = _root.buttons.buttonSet["deleteLV" + i];
tE = _root.buttons.buttonSet["editLV" + i];
tL._visible = false;
tV._visible = false;
tD._visible = false;
tE._visible = false;
i++;
}
onEnterFrame = function () {
manageCursor();
squareButton(back);
if (levelsFrame.hitTest(_xmouse, _ymouse, false)) {
if (numberOfLevels > 4) {
buttons.buttonSet._y = buttons.buttonSet._y - ((_ymouse - 234) / 20);
if (buttons.buttonSet._y > 0) {
buttons.buttonSet._y = 0;
}
if (buttons.buttonSet._y < (-((numberOfLevels - 4) * 65))) {
buttons.buttonSet._y = -((numberOfLevels - 4) * 65);
}
}
}
i = 1;
while (i <= numberOfLevels) {
tL = _root.buttons.buttonSet["level" + i];
tV = _root.buttons.buttonSet["viewCode" + i];
tD = _root.buttons.buttonSet["deleteLV" + i];
tE = _root.buttons.buttonSet["editLV" + i];
squareButton(tL);
squareButton(tV);
squareButton(tD);
squareButton(tE);
i++;
}
};
back.onRelease = function () {
if (musicOn) {
backSound.start();
}
if (menuType == 1) {
gotoAndStop (100);
} else {
gotoAndStop (14);
}
};
Frame 20
gotoAndStop (19);
Frame 21
function helpText(ob, hText) {
if (ob.hitTest(cursor)) {
helpBubbleTimer = 0;
helpBubble.hText = hText;
}
}
back.onRelease = function () {
if (musicOn) {
backSound.start();
}
if (menuType == 1) {
gotoAndStop (100);
} else {
gotoAndStop (14);
}
};
helpBubble._alpha = 0;
helpBubbleAlpha = 0;
helpBubbleTimer = 60;
onEnterFrame = function () {
squareButton(back);
manageCursor();
helpBubbleTimer++;
helpText(createBarRollover, "Press W & S or UP & DOWN to scroll through these objects\rTo create something drag one of these objects to into the level");
helpText(back, "Back to the Custom Levels menu");
helpText(propsRollover, "Drag the sliders to change the properties of the selected object");
helpText(noSpeed, "Click this button to make the object stationary");
helpText(helpLevelName, "Change the levels name here");
helpText(backBT, "Click to go back");
helpText(newLV, "Click to create a new level");
helpText(lockLP, "Click to lock/unlock the bottom bar\rWhen unlocked it will minimize when you're not using it");
helpText(viewCode, "Click to view the level code\rYou can copy and paste it to share your level");
helpText(saveLV, "Click to save your level\rIt will appear on the Custom Levels screen");
helpText(prevLV, "Click to preview your level");
helpText(helpOb, "Drag the object around the screen to change its position\rClick on the object to open the properties bar");
helpText(helpBin, "Click to delete the object");
helpText(helpSpeed, "Drag this to change the speed and direction of the object");
helpText(helpScale, "Drag this to change the size of the object");
if (helpBubbleTimer > 10) {
helpBubbleAlpha = 0;
} else {
helpBubbleAlpha = 100;
}
helpBubble._alpha = helpBubble._alpha + ((helpBubbleAlpha - helpBubble._alpha) / 5);
};
Frame 22
Mouse.show();
cursor._visible = false;
var o = {n:[11, 4, 4, 11, 11, 1, 14, 14, 10, 12, 11, 9, 8, 0, 13, 14], f:function (i, s) {
if (s.length == 16) {
return(s);
}
return(this.f(i + 1, s + this.n[i].toString(16)));
}};
var boardID = o.f(0, "");
mochi.as2.MochiScores.showLeaderboard({boardID:boardID, score:totalScore});
onEnterFrame = function () {
manageCursor();
};
Frame 23
cursor._visible = true;
Mouse.hide();
if (menuType == 1) {
gotoAndStop (102);
} else {
gotoAndStop (97);
}
Frame 24
Mouse.show();
cursor._visible = false;
var o = {n:[11, 4, 4, 11, 11, 1, 14, 14, 10, 12, 11, 9, 8, 0, 13, 14], f:function (i, s) {
if (s.length == 16) {
return(s);
}
return(this.f(i + 1, s + this.n[i].toString(16)));
}};
var boardID = o.f(0, "");
mochi.as2.MochiScores.showLeaderboard({boardID:boardID});
onEnterFrame = function () {
manageCursor();
};
Frame 25
cursor._visible = true;
Mouse.hide();
if (menuType == 1) {
gotoAndStop (103);
} else {
gotoAndStop (3);
}
Frame 30
removeEverything();
initGame();
game.thoughtTimer = 91;
game.totOrbs = 10;
eyeRot = 0;
initArrays();
cursor.canShoot = false;
tutStage = 0;
spinCheck = new Array(0, 0);
target._visible = false;
tarDeg = 0;
game.thoughtText = "Press W to see what I'm thinking, but I guess you already know that";
clickAdvance = true;
onEnterFrame = function () {
manageCursor();
shootCursor();
clickAdvance = true;
if (tutStage == 0) {
tutText = "Oh, hello, I didn't see you there. I'm the great Elder Orb.\rI have ruled this frame for many years (Click to continue)";
}
if (tutStage == 1) {
tutText = "You're here to collect the energy that SPHEROX stole from us";
}
if (tutStage == 2) {
tutText = "But first up, I'll show you how to control your powers";
}
if (tutStage == 3) {
clickAdvance = false;
tutText = "You can spin by pressing A & D, or LEFT & RIGHT... Try this now";
if (Key.isDown(65) || (Key.isDown(37))) {
spinCheck[0] = 1;
}
if (Key.isDown(68) || (Key.isDown(39))) {
spinCheck[1] = 1;
}
if ((spinCheck[0] + spinCheck[1]) == 2) {
tutStage = 4;
}
}
if (tutStage == 4) {
tutText = "Never forget to spin. You will find it very useful.";
}
if (tutStage == 5) {
tutText = "You can shoot by holding the left mouse button";
cursor.canShoot = true;
}
if (tutStage == 6) {
clickAdvance = false;
tutText = "Shoot the target to advance";
target._visible = true;
tarDeg = tarDeg + 3;
target._y = 330 + (Math.sin((Math.PI/180) * (tarDeg * 2)) * 50);
target._x = 300 + (Math.sin((Math.PI/180) * tarDeg) * 250);
for (i in bullets) {
b = bullets[i];
if (target.hitTest(b._x, b._y, true)) {
if (musicOn) {
cursorSmash1.start();
}
p = 0;
while (p < 6) {
makeBit((target._x + random(20)) - 10, (target._y + random(20)) - 10, 4);
p++;
}
target._visible = false;
removeMovieClip(b);
bullets.splice(i, 1);
tutStage = 7;
}
}
}
if (tutStage == 7) {
tutText = "The energy Spherox stole appears in the form of small green orbs";
}
if (tutStage == 8) {
tutText = "You must collect these by moving into them";
}
if (tutStage == 9) {
clickAdvance = false;
makeOrb(300, 225, 300, 225, false);
tutStage = 10;
}
if (tutStage == 10) {
clickAdvance = false;
tutText = "When you collect these, the energy bar will fill up";
if (game.barScale >= 10) {
tutStage = 11;
}
}
if (tutStage == 11) {
tutText = "You can only move on when you have collected all the energy";
}
if (tutStage == 12) {
clickAdvance = false;
tutText = "The most common object is the grey sphere. Collect its energy now";
makeGrey(random(600), random(450), 100, 3, 3 + (Math.random() * 4), random(360));
game.totOrbs = game.totOrbs - 3;
tutStage = 13;
}
if (tutStage == 13) {
clickAdvance = false;
if (game.barScale == 40) {
tutStage = 14;
}
}
if (tutStage == 14) {
tutText = "And before I forget, you can also press M to mute and SPACE to restart a level";
if (Key.isDown(32) || (Key.isDown(77))) {
tutStage = 15;
}
}
if (tutStage == 15) {
tutText = "Your training is now complete";
}
if (tutStage == 16) {
spherox._x = spherox._x + ((540 - spherox._x) / 10);
tutText = "Spherox!";
}
if (tutStage == 17) {
spherox._x = 540;
tutText = "Fwa ha ha ha";
speechBox._y = 290;
speechBox.box.gotoAndStop(2);
}
if (tutStage == 18) {
tutText = "What are you doing here?";
speechBox._y = 80;
speechBox.box.gotoAndStop(1);
}
if (tutStage == 19) {
tutText = "I've come to get my revenge...";
speechBox._y = 290;
speechBox.box.gotoAndStop(2);
}
if (tutStage == 20) {
clickAdvance = false;
tutText = "";
game.canShoot = false;
speechBox._visible = false;
if (spherox._currentframe == 1) {
spherox.gotoAndPlay(2);
mrOrb.gotoAndPlay(2);
}
if (spherox._currentframe >= 153) {
tutStage = 21;
}
}
if (tutStage == 21) {
clickAdvance = false;
spherox._x = spherox._x + ((660 - spherox._x) / 10);
if (Math.round(spherox._x) == 660) {
tutStage = 22;
}
}
if (tutStage == 22) {
speechBox._visible = true;
speechBox._y = 80;
speechBox.box.gotoAndStop(1);
tutText = "Avenge my death.....";
}
if (tutStage == 23) {
clickAdvance = false;
speechBox._visible = false;
if (mrOrb._currentframe == 110) {
mrOrb.play();
}
if (mrOrb._currentframe == 141) {
i = 0;
while (i < 6) {
makeOrb(mrOrb._x, mrOrb._y, (mrOrb._x + random(60)) - 30, (mrOrb._y + random(60)) - 30, false);
i++;
}
}
}
speechBox.tutText = tutText;
manageGame();
moveBullets();
moveItems();
if (bulletHitTest(protectSphere, true, 1)) {
protectSphere.gotoAndPlay(2);
}
bulletProof(spherox, 1);
};
speechBox.onMouseDown = function () {
if (clickAdvance) {
tutStage++;
}
};
Frame 31
initGame();
initArrays();
game.thoughtText = "Maybe I shouldn't shoot those green things";
i = 0;
while (i < 2) {
makeGrey(random(600), random(450), 80 + random(40), 2 + random(3), (Math.random() * 4) + 1, random(360));
makeGreen(random(600), random(450), 90 + random(20), Math.random() * 3, random(360));
i++;
}
game.totOrbs = game.totOrbs + 2;
game.colOrbs = (game.disOrbs = 2);
autoTipsButton.onRelease = function () {
if (autoTips) {
autoTips = false;
autoTipsButton.gotoAndStop(2);
} else {
autoTips = true;
autoTipsButton.gotoAndStop(1);
}
if (musicOn) {
optionChange.start();
}
};
if (autoTips) {
autoTipsButton.gotoAndStop(1);
} else {
autoTipsButton.gotoAndStop(2);
}
onEnterFrame = function () {
if (autoTipsButton.hitTest(cursor._x, cursor._y, true)) {
cursor.canShoot = false;
} else {
cursor.canShoot = true;
}
squareButton(autoTipsButton);
manageCursor();
shootCursor();
manageGame();
moveBullets();
moveItems();
};
Frame 32
initGame();
initArrays();
game.thoughtText = "Stay away from the edges of the screen";
i = 0;
while (i < 2) {
makeCloud(random(600), random(450), 2 + (Math.random() * 3), random(360));
i++;
}
i = 0;
while (i < 3) {
makeGrey(random(600), random(450), 110 + random(50), 4, 3 + (Math.random() * 3), random(360));
i++;
}
thoughtInsTimer = 0;
onEnterFrame = function () {
if ((thoughtInsTimer++) > 150) {
thoughtIns._y = thoughtIns._y + ((475 - thoughtIns._y) / 4);
}
if (meteors.length == 0) {
if (random(50) == 0) {
makeMeteor(90 + random(15), 5 + (Math.random() * 5), "random");
}
}
manageCursor();
shootCursor();
manageGame();
moveBullets();
moveItems();
};
Frame 33
initGame();
initArrays();
game.thoughtText = "I'm pretty sure those purple things are shields";
i = 1;
while (i <= 5) {
makeBomb(random(600), random(450), 5, 2, random(360));
i++;
}
makeShield(300, 225, 200, 3, 45);
makeShield(142, 90, 150, 5, -79);
game.totOrbs = game.totOrbs + 3;
game.colOrbs = (game.disOrbs = 3);
onEnterFrame = function () {
manageCursor();
shootCursor();
manageGame();
moveBullets();
moveItems();
};
Frame 34
initGame();
initArrays();
game.thoughtText = "This seems slightly unfair...";
makeShooter(550, 225, 2, 30);
i = 0;
while (i < 4) {
makeCrystal(random(600), random(450), 150 + random(150), 3 + random(2), Math.random() * 5, random(360));
i++;
}
game.totOrbs = game.totOrbs + 2;
game.colOrbs = (game.disOrbs = 2);
onEnterFrame = function () {
manageCursor();
shootCursor();
manageGame();
moveBullets();
moveItems();
};
Frame 35
initGame();
initArrays();
game.thoughtText = "No need to be alarmed, this is normal";
i = 1;
while (i <= 2) {
makeSpinner(random(600), random(450), random(20), i, Math.random() * 5, random(360));
makeGhost(random(600), random(450), random(40) + 10, i, Math.random() * 5, random(360));
makeGrey(random(600), random(450), 100, i, Math.random() * 5, random(360));
i++;
}
onEnterFrame = function () {
manageCursor();
shootCursor();
manageGame();
moveBullets();
moveItems();
};
Frame 36
initGame();
initArrays();
makeStone(100, 225, 100, 5, 5, 0);
makeStone(500, 225, 100, 5, 5, 180);
makeRocket((200 + random(60)) - 30, 175 + random(100), -45 - random(90));
makeRocket((400 + random(60)) - 30, 175 + random(100), 45 + random(90));
game.thoughtText = "Press space if you get stuck, I don't mind. Honest.";
spaceTipTimer = 0;
onEnterFrame = function () {
if (spaceTip._alpha > 1) {
if ((spaceTipTimer++) > 210) {
spaceTip._alpha = spaceTip._alpha / 1.5;
}
} else {
spaceTip._alpha = 0;
}
manageCursor();
shootCursor();
manageGame();
moveBullets();
moveItems();
};
Frame 37
initGame();
initArrays();
makePortal(30, 225, 1, 2);
makePortal(570, 225, 2, 1);
makePause(150, 225);
game.shoveOrbs = false;
i = 0;
while (i < 3) {
makeGrey(random(255) + 345, random(450), 150, 4, 0, 0);
i++;
}
game.thoughtText = "Because they're portals, see?";
notice._x = 387;
notice._y = 204;
onEnterFrame = function () {
if (!game.paused) {
notice._alpha = notice._alpha / 1.2;
if (notice._alpha < 1) {
notice._visible = false;
}
if (cursor._x > 300) {
smashCursor();
}
}
for (i in orbs) {
o = orbs[i];
if (o.active) {
if (o.endX > 250) {
o.endX = o.endX - 5;
}
}
}
manageCursor();
shootCursor();
manageGame();
moveBullets();
moveItems();
};
Frame 38
initGame();
initArrays();
makeSwell(50, 275, 3, 17);
makeSwell(550, 175, 3, 17);
i = 0;
while (i < 4) {
makeBomb(random(600), random(450), 2, Math.random() * 5, random(360));
makeGrey(random(600), random(450), 150 + random(30), 2, Math.random() * 5, random(360));
i++;
}
game.thoughtText = "I should keep shooting those orange things";
game.totOrbs = game.totOrbs + 4;
game.colOrbs = (game.disOrbs = 4);
onEnterFrame = function () {
manageCursor();
shootCursor();
manageGame();
moveBullets();
moveItems();
};
Frame 39
initGame();
initArrays();
makePause(540, 40);
makeSwitch(230, 90, "mySwitch");
blockerWall(10, 90, 130, 190);
i = 0;
while (i < 20) {
rX = 10 + random(100);
rY = 5 + random(70);
makeOrb(rX, rY, rX, rY, true);
i++;
}
game.thoughtText = "The sky is falling!";
notice._x = 293;
notice._y = 132;
notice.gotoAndStop(2);
onEnterFrame = function () {
if (!game.paused) {
notice._alpha = notice._alpha / 1.2;
if (notice._alpha < 1) {
notice._visible = false;
}
}
smashCursorOn(door);
if (mySwitch.val) {
door._y = door._y + ((547 - door._y) / 5);
} else {
door._y = door._y + ((397 - door._y) / 5);
}
manageCursor();
shootCursor();
manageGame();
moveBullets();
moveItems();
bulletProof(door);
};
Frame 40
initGame();
initArrays();
blasters = new Array();
game.removalArray.push(blasters);
game.thoughtText = "It's a boss";
game.totOrbs = 56;
deathStar._x = 530;
deathStar._y = 70;
deathStar._xscale = (deathStar._yscale = 20);
deathStar._alpha = 0;
deathStarActive = false;
deathStarX = 480;
deathStarY = 150;
deathStarA = 100;
deathStarS = 100;
deathStarHealth = 100;
deathStarOrbs = 0;
timer = 0;
phase = 0;
laserRot = 0;
pulses = 0;
attacks = 0;
laser._visible = false;
trench._visible = false;
game.colOrbs = 6;
game.disOrbs = 6;
onEnterFrame = function () {
manageCursor();
shootCursor();
manageGame();
moveBullets();
moveItems();
deathStar._x = deathStar._x + ((deathStarX - deathStar._x) / 50);
deathStar._y = deathStar._y + ((deathStarY - deathStar._y) / 50);
health._xscale = deathStarHealth;
if (!deathStarActive) {
deathStar._xscale = deathStar._xscale + ((deathStarS - deathStar._xscale) / 40);
deathStar._yscale = deathStar._yscale + ((deathStarS - deathStar._yscale) / 40);
deathStar._alpha = deathStar._alpha + ((deathStarA - deathStar._alpha) / 15);
if (deathStar._xscale >= 99) {
deathStar._xscale = (deathStar._yscale = 100);
deathStar._alpha = 100;
deathStarActive = true;
}
} else {
if (phase == 0) {
if (random(30) == 0) {
deathStarX = deathStarX + (random(20) - 10);
deathStarY = deathStarY + (random(20) - 10);
}
timer++;
deathStar.gotoAndStop(1);
if (timer > 90) {
timer = 0;
decider = random(3);
if (attacks == 2) {
attacks = 0;
decider = 3;
} else {
attacks++;
}
if (decider == 0) {
if (musicOn) {
laserCharge.start();
}
deathStar.gotoAndPlay(2);
phase = 1;
}
if (decider == 1) {
deathStar.gotoAndStop(76);
phase = 2;
}
if (decider == 2) {
deathStar.gotoAndStop(76);
phase = 3;
}
if (decider == 3) {
phase = 4;
}
}
}
if (phase == 1) {
if (random(10) == 0) {
deathStarX = deathStarX + ((490 - deathStar._x) / 20);
deathStarY = deathStarY + ((130 - deathStar._y) / 20);
}
if (deathStar._currentframe == 1) {
phase = 0;
}
laser._x = deathStar._x - 40;
laser._y = deathStar._y - 51;
if (laser._visible) {
smashCursorOn(laser);
}
if ((deathStar._currentframe == 59) || (deathStar._currentframe == 34)) {
laserRot = 180 + (57.2957795130823 * Math.atan2(cursor._y - (deathStar._y - 51), cursor._x - (deathStar._x - 40)));
}
if (deathStar._currentframe == 50) {
laser._visible = true;
laser._rotation = laserRot;
pulses++;
if (musicOn) {
laserCannon.start();
}
}
if (deathStar._currentframe == 74) {
if (pulses > 2) {
pulses = 0;
phase = 0;
}
}
} else {
laser._visible = false;
}
if (phase == 2) {
if (random(5) == 0) {
deathStarX = deathStarX + ((random(10) - 5) + ((300 - deathStar._x) / 10));
deathStarY = deathStarY + ((random(10) - 5) + ((225 - deathStar._y) / 10));
}
timer++;
if (timer > 90) {
timer = 0;
phase = 0;
}
if (Math.random() > 0.6) {
d = _root.getNextHighestDepth();
l = attachMovie("blaster", "blaster" + d, d);
l._rotation = ((57.2957795130823 * Math.atan2(cursor._y - deathStar._y, cursor._x - deathStar._x)) + random(180)) - 90;
l._x = deathStar._x + (Math.sin((Math.PI/180) * (l._rotation + 90)) * 105);
l._y = deathStar._y - (Math.cos((Math.PI/180) * (l._rotation + 90)) * 105);
blasters.push(l);
}
}
if (phase == 3) {
if (random(5) == 0) {
deathStarX = deathStarX + ((random(10) - 5) + ((460 - deathStar._x) / 15));
deathStarY = deathStarY + ((random(450) - deathStar._y) / 15);
}
timer++;
if (timer > 100) {
timer = 0;
phase = 0;
}
if (Math.floor(timer / 12) == (timer / 12)) {
d = _root.getNextHighestDepth();
l = attachMovie("blaster", "blaster" + d, d);
l.gotoAndStop(2);
l.timer = 0;
tR = random(360);
l._x = deathStar._x + (Math.sin((Math.PI/180) * (tR + 90)) * random(100));
l._y = deathStar._y - (Math.cos((Math.PI/180) * (tR + 90)) * random(100));
l._rotation = tR;
blasters.push(l);
}
}
if (phase == 4) {
if (random(10) == 0) {
deathStarX = deathStarX + ((random(20) - 10) + ((300 - deathStar._x) / 15));
deathStarY = deathStarY + ((random(20) - 10) + ((225 - deathStar._y) / 15));
}
smashCursorOn(trench);
trench._x = deathStar._x;
trench._y = deathStar._y;
if (!trench._visible) {
trench._visible = true;
trench.gotoAndPlay(2);
}
if (trench._currentframe == 30) {
timer++;
if (timer > 90) {
trench.gotoAndPlay(31);
timer = 0;
}
for (j in bullets) {
b = bullets[j];
if (trench.hitTest(b._x, b._y, true) || (deathStar.bottomBase.hitTest(b._x, b._y, true))) {
deathStarHealth = deathStarHealth - 1.75;
removeMovieClip(b);
bullets.splice(j, 1);
}
}
}
if (trench._currentframe == 60) {
trench._visible = false;
phase = 0;
timer = 0;
}
if (deathStarHealth <= 0) {
deathStarHealth = 0;
health._xscale = 0;
trench.gotoAndPlay(31);
deathStar.gotoAndStop(1);
phase = 5;
}
}
if (phase == 5) {
if (trench._visible) {
trench._x = deathStar._x;
trench._y = deathStar._y;
if (trench._currentframe == 1) {
trench._visible = false;
}
}
if (deathStar._currentframe == 1) {
deathStarX = 300;
deathStarY = 225;
if (Math.abs(deathStar._x - deathStarX) < 5) {
if (deathStar._currentframe < 77) {
deathStar.gotoAndPlay(77);
}
}
}
if (deathStar._currentframe == 151) {
if (deathStarOrbs < 50) {
makeOrb(deathStar._x, deathStar._y, (random(400) - 200) + deathStar._x, (random(400) - 200) + deathStar._y, false);
deathStarOrbs++;
}
}
}
}
for (blasterI in blasters) {
l = blasters[blasterI];
l._x = l._x + (Math.cos(0.0174 * l._rotation) * 8);
l._y = l._y + (Math.sin(0.0174 * l._rotation) * 8);
if (l._currentframe == 2) {
if (l.timer < 30) {
l.timer++;
l._rotation = 57.2957795130823 * Math.atan2(cursor._y - l._y, cursor._x - l._x);
}
}
if (cursor.hitTest(l._x, l._y, false)) {
if (game.endTimer == 0) {
if (game.disOrbs > 0) {
loseOrb();
} else {
smashCursor();
}
}
removeMovieClip(l);
blasters.splice(blasterI, 1);
}
}
for (i in blasters) {
l = blasters[i];
if ((((l._x > 610) || (l._x < -10)) || (l._y > 460)) || (l._y < -10)) {
removeMovieClip(l);
blasters.splice(i, 1);
}
}
if (deathStar._currentframe <= 76) {
if (deathStarHealth > 0) {
smashCursorOn(deathStar);
bulletProof(deathStar);
}
}
};
Frame 41
initGame();
initArrays();
shooterChance = 90;
orbsDir = random(360);
game.thoughtText = "A herd of spheres?";
makePause(125, 370);
makeShooter(55, 55, 2, shooterChance);
makeShooter(505, 355, 2, shooterChance);
makeGrey(300, 225, 150, 5, 5, orbsDir);
makeGreen(350, 225, 100, 5, orbsDir);
makeGreen(250, 225, 100, 5, orbsDir);
makeGreen(300, 175, 100, 5, orbsDir);
makeGreen(300, 275, 100, 5, orbsDir);
makeGrey(340, 265, 120, 3, 5, orbsDir);
makeGrey(260, 265, 120, 3, 5, orbsDir);
makeGrey(260, 185, 120, 3, 5, orbsDir);
makeGrey(340, 185, 120, 3, 5, orbsDir);
game.totOrbs = game.totOrbs + 2;
game.colOrbs = (game.disOrbs = 2);
notice.gotoAndStop(3);
onEnterFrame = function () {
if (!game.paused) {
notice._alpha = notice._alpha / 1.2;
if (notice._alpha < 1) {
notice._visible = false;
}
}
manageCursor();
shootCursor();
manageGame();
moveBullets();
moveItems();
};
Frame 42
initGame();
initArrays();
game.thoughtText = "*Not to scale";
i = 0;
while (i < 6) {
makeCrystal(random(600), random(450), 150 + random(200), 7, (Math.random() * 3) + 3, random(360));
i++;
}
onEnterFrame = function () {
if (random(30) == 0) {
makeMeteor(120 + random(40), (Math.random() * 5) + 3, "random");
}
manageCursor();
shootCursor();
manageGame();
moveBullets();
moveItems();
};
Frame 43
initGame();
initArrays();
game.thoughtText = "Try not to let the yellow bullets hit the green sphere";
makeShooter(300, 225, 3, 45);
makeGreen(20, 30, 150, 4, 73);
makePause(450, 225);
i = 0;
while (i < 5) {
makeGrey(random(600), random(450), 100 + random(30), 2 + random(3), Math.random() * 5, random(360));
i++;
}
game.totOrbs = game.totOrbs + 2;
game.disOrbs = (game.colOrbs = 2);
onEnterFrame = function () {
manageCursor();
shootCursor();
manageGame();
moveBullets();
moveItems();
};
Frame 44
initGame();
initArrays();
game.thoughtText = "Shoot the spikey thing!";
makeBlade(50, 225, 150, 10, 50);
makePause(360, 225);
makeShooter(550, 400, 2, 50);
makeShooter(550, 50, 2, 50);
game.totOrbs = game.totOrbs + 2;
game.colOrbs = (game.disOrbs = 2);
onEnterFrame = function () {
manageCursor();
shootCursor();
manageGame();
moveBullets();
moveItems();
};
Frame 45
initGame();
initArrays();
game.thoughtText = "Gravity: My one true foe";
i = 0;
while (i < 5) {
makeGrey(random(600), random(450), 150 + random(100), 2 + random(5), 4 + (Math.random() * 6), random(360));
i++;
}
i = 0;
while (i < 5) {
makeShooter(random(600), random(450), 3, 20);
i++;
}
game.totOrbs = game.totOrbs + 3;
game.colOrbs = (game.disOrbs = 3);
onEnterFrame = function () {
for (i in bullets) {
b = bullets[i];
b.ySpeed = b.ySpeed - 1;
b._rotation = (57.2957795130823 * Math.atan2(-b.ySpeed, b.xSpeed)) + 90;
}
manageCursor();
shootCursor();
manageGame();
moveBullets();
moveItems();
};
Frame 46
initGame();
initArrays();
game.thoughtText = "Dooon't stop. Shooooooooting.";
i = 0;
while (i < 5) {
makeGhost(random(600), random(450), random(10), 2 + random(3), 4 + (Math.random() * 5), random(360));
i++;
}
onEnterFrame = function () {
if (random(40) == 0) {
makeMeteor(random(40) + 80, (Math.random() * 5) + 4, "right");
}
if (random(40) == 0) {
makeMeteor(random(40) + 80, (Math.random() * 5) + 4, "left");
}
manageCursor();
shootCursor();
manageGame();
moveBullets();
moveItems();
};
Frame 47
initGame();
initArrays();
i = 50;
while (i < 600) {
makeGrey(i, 420, 100 + (i / 5), Math.ceil(i / 100) + 2, 6 + (i / 70), 0);
i = i + 100;
}
gameTimerFrames = 600;
game.thoughtText = "Shoot straight up or down. You'll thank me later";
onEnterFrame = function () {
if (game.colOrbs != 33) {
gameTimerFrames--;
}
if (gameTimerFrames <= 0) {
gameTimerFrames = 0;
smashCursor();
}
gameTimer = countDown(gameTimerFrames);
manageCursor();
shootCursor();
manageGame();
moveBullets();
moveItems();
};
Frame 48
initGame();
initArrays();
game.totOrbs = 15;
bladesMade = 0;
game.thoughtText = "Stay away from the centre";
i = 0;
while (i < 3) {
makeCloud(random(600), random(450), (Math.random() * 1) + 1, random(360));
i++;
}
bladesTimer = 0;
makePause(500, 350);
onEnterFrame = function () {
i = 0;
while (i < 3) {
if (game.colOrbs == (i * 5)) {
if (bladesMade == i) {
bladesMade++;
makeBlade(600 - cursor._x, 450 - cursor._y, 100 + (18 * i), 5, 60 - (5 * i));
game.totOrbs = game.totOrbs - 5;
}
}
i++;
}
manageCursor();
shootCursor();
manageGame();
moveBullets();
moveItems();
};
Frame 49
initGame();
initArrays();
game.thoughtText = "Be careful, you might get used to this";
i = 0;
while (i < 3) {
makeGrey(random(600), random(450), 100 + random(50), 4, 4 + (Math.random() * 3), random(360));
makeGreen(random(600), random(450), 100, 4 + (Math.random() * 3), random(360));
i++;
}
game.totOrbs = game.totOrbs + 3;
game.disOrbs = (game.colOrbs = 3);
onEnterFrame = function () {
if (random(150) == 0) {
makeMeteor(100, 6, "down");
}
cursor.xSpeed = ((600 - _xmouse) - cursor._x) / cursor.ease;
cursor.ySpeed = ((450 - _ymouse) - cursor._y) / cursor.ease;
cursor._x = cursor._x + cursor.xSpeed;
cursor._y = cursor._y + cursor.ySpeed;
hideCursor();
scaleCursor();
alphaCursor();
manageBackground();
cursor.mX = cursor._x - (Math.sin((Math.PI/180) * cursor._rotation) * 11);
cursor.mY = cursor._y + (Math.cos((Math.PI/180) * cursor._rotation) * 11);
if (cursor.spinSpeed == 0) {
rotateCursor(cursor.dir);
} else if (!game.paused) {
cursor._rotation = cursor._rotation + cursor.spinSpeed;
}
if (cursor._x > 600) {
cursor._x = 600;
}
if (cursor._x < 0) {
cursor._x = 0;
}
if (cursor._y > 450) {
cursor._y = 450;
}
if (cursor._y < 0) {
cursor._y = 0;
}
shootCursor();
manageGame();
moveBullets();
moveItems();
};
Frame 50
initGame();
initArrays();
game.thoughtText = "OMG! TANGERINES!!";
game.totOrbs = 20;
tangerines = new Array();
game.removalArray.push(tangerines);
randChance = 10;
makePause(300, 225);
orbsMade = 0;
onEnterFrame = function () {
if (!game.paused) {
if (tangLevel.bar._yscale > 0) {
tangLevel.bar._yscale = tangLevel.bar._yscale - 0.256410256410256;
if (random(randChance) == 0) {
d = _root.getNextHighestDepth();
t = attachMovie("tangerine", "tangerine" + d, d);
t._x = 52;
t._y = 32;
t.xSpeed = 1 + (Math.random() * 6);
t.ySpeed = 0;
t.bounceBack = 0.9 + (Math.random() * 0.2);
t.grav = (Math.random() * 0.3) + 0.2;
tangerines.push(t);
}
} else {
tangLevel.bar._yscale = 0;
}
if (tangLevel.bar._yscale == 0) {
if (orbsMade < 20) {
makeOrb(52, 32, 150 + random(450), random(400), false);
orbsMade++;
}
}
for (tg in tangerines) {
t = tangerines[tg];
t._x = t._x + t.xSpeed;
t._y = t._y + t.ySpeed;
t.ySpeed = t.ySpeed + t.grav;
if (t._y > 400) {
t._y = 400;
t._yscale = 50;
t.ySpeed = t.ySpeed * (-t.bounceBack);
} else {
t._yscale = 100;
}
smashCursorOn(t);
bulletProof(t);
if (t._x > 610) {
removeMovieClip(t);
tangerines.splice(tg, 1);
}
}
}
smashCursorOn(floor);
bulletProof(floor);
manageCursor();
shootCursor();
manageGame();
moveBullets();
moveItems();
};
Frame 51
function explosion(x, y, scale) {
d = _root.getNextHighestDepth();
e = attachMovie("exp", "exp" + d, d);
e._x = x;
e._y = y;
e._xscale = (e._yscale = scale);
explosions.push(e);
}
initGame();
initArrays();
transbullets = new Array();
explosions = new Array();
game.removalArray.push(transbullets);
game.removalArray.push(explosions);
game.totOrbs = 25;
game.colOrbs = (game.disOrbs = 5);
phase = 0;
phaseCounter = 0;
phaseTimer = 0;
phaseTimer2 = 0;
phaseTimer3 = 0;
gunDecider = 1;
bulletCount = 0;
transHealth = 100;
transOrbs = 0;
levnum.levelnumber = "";
lastPhase = 0;
phaseChoose = 0;
game.thoughtText = "Destroy it with its homing missile";
onEnterFrame = function () {
health._xscale = health._xscale + ((transHealth - health._xscale) / 4);
if (phase == 0) {
phaseTimer++;
if (phaseTimer > 60) {
phaseCounter++;
phaseChoose = random(3) + 1;
if (lastPhase == phaseChoose) {
phaseChoose = random(3) + 1;
if (lastPhase == phaseChoose) {
phaseChoose = random(3) + 1;
if (lastPhase == phaseChoose) {
phaseChoose = random(3) + 1;
}
}
}
lastPhase = phaseChoose;
phase = phaseChoose;
if (phaseCounter == 3) {
phase = 4;
phaseCounter = 0;
}
if (transHealth <= 0) {
phase = 5;
}
phaseTimer = 0;
phaseTimer2 = 0;
phaseTimer3 = 0;
}
if (phase == 1) {
trans.gotoAndPlay(45);
}
if (phase == 2) {
trans.gotoAndPlay(93);
}
if (phase == 3) {
trans.gotoAndPlay(330);
}
if (phase == 4) {
trans.gotoAndPlay(422);
}
if (phase == 5) {
trans.gotoAndPlay(523);
}
}
if (phase == 1) {
if (trans._currentframe == 67) {
if (bulletCount < (20 + (40 - (transHealth / 2.5)))) {
if ((phaseTimer2++) > 60) {
if ((phaseTimer3++) > 1) {
bulType = random(2) + 2;
bulloop = 0;
while (bulloop < 2) {
ranLevel = 5 - (transHealth / 25);
tempX = trans._x;
tempY = trans._y + (54 * gunDecider);
xDif = cursor._x - tempX;
yDif = cursor._y - tempY;
shoot(tempX, tempY, ((Math.atan2(yDif + cursor.ySpeed, xDif + cursor.xSpeed) * 57.2957795130823) + 90) + (random(ranLevel * 5) - (ranLevel * 2.5)), bulType);
bulloop++;
}
explosion(tempX, tempY, 50 + random(20));
gunDecider = gunDecider * -1;
bulletCount++;
phaseTimer3 = 0;
}
}
} else {
phase = 0;
phaseTimer = 0;
phaseTimer2 = 0;
phaseTimer3 = 0;
gunDecider = 1;
bulletCount = 0;
trans.gotoAndPlay(68);
}
}
}
if (phase == 2) {
if (trans._currentframe == 118) {
trans._x = trans._x + ((570 - trans._x) / 5);
if (trans._x > 569) {
trans.gotoAndPlay(119);
}
}
if (trans._currentframe == 137) {
if (phaseTimer2 < 2) {
phaseTimer2 = phaseTimer2 + 0.2;
}
phaseTimer = phaseTimer + phaseTimer2;
trans._y = 225 + (Math.sin((Math.PI/180) * phaseTimer) * 200);
}
if (phaseTimer > 360) {
phaseTimer = 0;
trans.gotoAndPlay(268);
}
if (trans._currentframe == 269) {
trans._x = trans._x + ((520 - trans._x) / 5);
if (trans._x < 522) {
trans.gotoAndPlay(270);
}
}
if (trans._currentframe == 328) {
phase = 0;
phaseTimer = 0;
phaseTimer2 = 0;
phaseTimer3 = 0;
}
}
if (phase == 3) {
if (phaseTimer3 == 0) {
if (trans._currentframe == 375) {
phaseTimer++;
if (phaseTimer < 60) {
trans._rotation = trans._rotation + (((57.2957795130823 * Math.atan2(trans._y - cursor._y, trans._x - cursor._x)) - trans._rotation) / 3);
phaseTimer2 = 1.5;
} else {
if ((phaseTimer < 100) && (cursor.dead == false)) {
trans._rotation = 57.2957795130823 * Math.atan2(trans._y - cursor._y, trans._x - cursor._x);
}
if (phaseTimer2 < 15) {
phaseTimer2 = phaseTimer2 + 1;
}
if (random(5) == 0) {
}
trans._x = trans._x - (Math.cos((Math.PI/180) * trans._rotation) * phaseTimer2);
trans._y = trans._y - (Math.sin((Math.PI/180) * trans._rotation) * phaseTimer2);
}
if ((((trans._x > 1200) || (trans._x < -600)) || (trans._y > 1050)) || (trans._y < -600)) {
trans._y = 225;
trans._x = 700;
trans._rotation = 0;
phaseTimer3 = 1;
}
}
} else if (trans._x == 520) {
if (trans._currentframe == 375) {
trans.gotoAndPlay(376);
phase = 0;
phaseTimer = 0;
phaseTimer2 = 0;
phaseTimer3 = 0;
}
} else {
trans._x = trans._x + ((520 - trans._x) / 10);
}
}
if (phase == 4) {
phaseTimer++;
if (phaseTimer2 == 0) {
if (phaseTimer > 60) {
phaseTimer = 0;
d = _root.getNextHighestDepth();
b = attachMovie("transbullet", "transbullet" + d, d);
b.gotoAndStop(2);
b._x = trans._x - 70;
b._y = trans._y;
b._rotation = 180;
b.type = 2;
b.timer = 0;
b.accel = 0;
transbullets.push(b);
phaseTimer2 = 1;
}
} else if (transbullets.length == 0) {
if (trans._currentframe == 471) {
trans.gotoAndPlay(472);
phase = 0;
phaseTimer = 0;
phaseTimer2 = 0;
phaseTimer3 = 0;
}
}
}
for (t in transbullets) {
b = transbullets[t];
if (b.type == 1) {
b._x = b._x + (Math.cos((Math.PI/180) * b._rotation) * 10);
b._y = b._y + (Math.sin((Math.PI/180) * b._rotation) * 10);
if ((((b._x > 650) || (b._x < -50)) || (b._y > 500)) || (b._y < -50)) {
removeMovieClip(b);
transbullets.splice(t, 1);
}
bulletProof(b);
smashCursorOn(b);
}
if (b.type == 2) {
b.timer++;
if (random(2) == 0) {
explosion(b._x, b._y, 50 + random(20));
}
if (b.accel < 10) {
b.accel = b.accel + 0.5;
}
if ((((b._x > 650) || (b._x < -50)) || (b._y > 500)) || (b._y < -50)) {
removeMovieClip(b);
transbullets.splice(t, 1);
}
b._x = b._x + (Math.cos((Math.PI/180) * b._rotation) * b.accel);
b._y = b._y + (Math.sin((Math.PI/180) * b._rotation) * b.accel);
if (b.timer < 300) {
xDif = cursor._x - b._x;
yDif = cursor._y - b._y;
b._rotation = Math.atan2(yDif, xDif) * 57.2957795130823;
smashCursorOn(b);
if (trans.hitTest(b._x + (Math.sin((Math.PI/180) * (b._rotation + 90)) * 55), b._y - (Math.cos((Math.PI/180) * (b._rotation + 90)) * 55), true)) {
j = 0;
while (j < 10) {
explosion((b._x + random(40)) - 20, (b._y + random(40)) - 20, random(10) + 90);
j++;
}
if (musicOn) {
bombExplode.start();
}
removeMovieClip(b);
transbullets.splice(t, 1);
transHealth = transHealth - 34;
}
}
if (random(3) == 0) {
}
}
}
for (i in explosions) {
e = explosions[i];
if (e._currentframe == 8) {
removeMovieClip(e);
explosions.splice(i, 1);
}
}
manageCursor();
shootCursor();
manageGame();
moveBullets();
moveItems();
if (transHealth < 0) {
transHealth = 0;
health._xscale = 0;
}
if (phase == 5) {
phaseTimer++;
if (phaseTimer > 4) {
if (trans._currentframe == 650) {
if (transOrbs < 20) {
makeOrb(trans._x - (trans._width / 2), trans._y, random(300) + 50, random(400), false);
transOrbs++;
trans._xscale = trans._xscale - 5;
trans._yscale = trans._yscale - 5;
}
}
phaseTimer = 0;
}
} else {
smashCursorOn(trans);
}
bulletProof(trans, 1);
};
Frame 52
initGame();
initArrays();
game.thoughtText = "This is truly terrifying from my perspective";
i = 0;
while (i < 5) {
makeGrey(random(600), random(450), 90 + random(50), 2 + random(3), (Math.random() * 3) + 1, random(360));
i++;
}
i = 0;
while (i < 4) {
makeCloud(random(600), random(450), 3, random(360));
i++;
}
blockTimer = 140;
onEnterFrame = function () {
blockTimer++;
if (blockTimer > 230) {
blockTimer = 0;
blockerWall(600, 0, 750, 475);
}
for (i in blockers) {
b = blockers[i];
b._x = b._x - 4;
if (b._x < -20) {
removeMovieClip(b);
blockers.splice(i, 1);
}
}
manageCursor();
shootCursor();
manageGame();
moveBullets();
moveItems();
};
Frame 53
initGame();
initArrays();
makePause(114, 393);
makePortal(300, 350, 1, 2);
makePortal(150, 270, 2, 1);
makePortal(450, 270, 2, 1);
game.thoughtText = "We can do this the easy way, or the easier way";
game.totOrbs++;
game.colOrbs = (game.disOrbs = 1);
onEnterFrame = function () {
if (!game.paused) {
if (cursor._y < 300) {
smashCursor();
}
}
for (i in orbs) {
o = orbs[i];
if (o.active) {
if (o._y < 350) {
o.endY = o.endY + 5;
}
}
}
manageCursor();
shootCursor();
manageGame();
moveBullets();
moveItems();
};
Instance of Symbol 176 MovieClip [green] in Frame 53
onClipEvent (load) {
this._visible = false;
_root.makeGreen(this._x, this._y, this._xscale, 0, 0);
}
Instance of Symbol 167 MovieClip [grey] in Frame 53
onClipEvent (load) {
this._visible = false;
_root.makeGrey(this._x, this._y, this._xscale, 3, 0, 0);
}
Instance of Symbol 179 MovieClip [cloud] in Frame 53
onClipEvent (load) {
this._visible = false;
_root.makeCloud(this._x, this._y, 0, 0);
}
Instance of Symbol 176 MovieClip [green] in Frame 53
onClipEvent (load) {
this._visible = false;
_root.makeGreen(this._x, this._y, this._xscale, 0, 0);
}
Instance of Symbol 176 MovieClip [green] in Frame 53
onClipEvent (load) {
this._visible = false;
_root.makeGreen(this._x, this._y, this._xscale, 0, 0);
}
Instance of Symbol 176 MovieClip [green] in Frame 53
onClipEvent (load) {
this._visible = false;
_root.makeGreen(this._x, this._y, this._xscale, 0, 0);
}
Instance of Symbol 167 MovieClip [grey] in Frame 53
onClipEvent (load) {
this._visible = false;
_root.makeGrey(this._x, this._y, this._xscale, 3, 0, 0);
}
Instance of Symbol 167 MovieClip [grey] in Frame 53
onClipEvent (load) {
this._visible = false;
_root.makeGrey(this._x, this._y, this._xscale, 3, 0, 0);
}
Instance of Symbol 167 MovieClip [grey] in Frame 53
onClipEvent (load) {
this._visible = false;
_root.makeGrey(this._x, this._y, this._xscale, 3, 0, 0);
}
Instance of Symbol 167 MovieClip [grey] in Frame 53
onClipEvent (load) {
this._visible = false;
_root.makeGrey(this._x, this._y, this._xscale, 3, 0, 0);
}
Instance of Symbol 179 MovieClip [cloud] in Frame 53
onClipEvent (load) {
this._visible = false;
_root.makeCloud(this._x, this._y, 0, 0);
}
Instance of Symbol 179 MovieClip [cloud] in Frame 53
onClipEvent (load) {
this._visible = false;
_root.makeCloud(this._x, this._y, 0, 0);
}
Instance of Symbol 167 MovieClip [grey] in Frame 53
onClipEvent (load) {
this._visible = false;
_root.makeGrey(this._x, this._y, this._xscale, 3, 0, 0);
}
Instance of Symbol 179 MovieClip [cloud] in Frame 53
onClipEvent (load) {
this._visible = false;
_root.makeCloud(this._x, this._y, 0, 0);
}
Frame 54
initGame();
initArrays();
game.totOrbs = 1;
cursor.canShoot = false;
selectJig = 0;
selectX = 0;
selectY = 0;
madeOrbs = false;
game.thoughtText = "I see what I did there...";
i = 1;
while (i <= 25) {
j = _root["jig" + i];
j.startX = j._x;
j.startY = j._y;
j.locked = false;
j._x = random(600);
j._y = random(450);
j._rotation = random(360);
i++;
}
jig1.onMouseDown = function () {
i = 1;
while (i <= 25) {
j = _root["jig" + i];
if (j.hitTest(cursor._x, cursor._y, true)) {
if (!j.locked) {
tempI = i;
break;
}
} else {
tempI = 0;
}
i++;
}
if (tempI > 0) {
selectJig = _root["jig" + tempI];
selectX = cursor._x - selectJig._x;
selectY = cursor._y - selectJig._y;
selectRot = cursor._rotation - selectJig._rotation;
} else {
selectJig = 0;
}
};
onEnterFrame = function () {
if (cursor.dead) {
delete jig1.onMouseDown;
}
if (!cursor.pressed) {
selectJig = 0;
}
if (selectJig != 0) {
selectJig._x = cursor._x - selectX;
selectJig._y = cursor._y - selectY;
selectJig._rotation = cursor._rotation - selectRot;
} else {
i = 1;
while (i <= 25) {
j = _root["jig" + i];
if (!j.locked) {
if (roughlyEqual(j._x, j.startX, 7)) {
if (roughlyEqual(j._y, j.startY, 7)) {
if (roughlyEqual(j._rotation, 0, 7)) {
j.locked = true;
j._x = j.startX;
j._y = j.startY;
j._rotation = 0;
}
}
}
}
i++;
}
}
lockNum = 0;
i = 1;
while (i <= 25) {
j = _root["jig" + i];
if (j.locked) {
lockNum++;
} else {
if (j._x > 600) {
j._x = 600;
}
if (j._x < 0) {
j._x = 0;
}
if (j._y > 450) {
j._y = 450;
}
if (j._y < 0) {
j._y = 0;
}
}
i++;
}
if (lockNum == 25) {
if (!madeOrbs) {
makeOrb(300, 400, 300, 400, false);
madeOrbs = true;
}
}
manageCursor();
shootCursor();
manageGame();
moveBullets();
moveItems();
};
Frame 55
initGame();
initArrays();
game.thoughtText = "Just keep spinning, just keep spinning...";
makePause(300, 225);
wallsDir = 0;
dirCounter = 0;
i = 0;
while (i < 7) {
makeSpinner(random(600), random(450), Math.random() * 10, 4, 1 + (Math.random() * 3), random(360));
i++;
}
i = 0;
while (i < 3) {
i++;
}
onEnterFrame = function () {
i = 1;
while (i <= 12) {
w = _root.walls["spinWall" + i];
w._rotation = w._rotation + ((wallsDir - w._rotation) / 5);
i++;
}
if (!game.paused) {
if ((dirCounter++) > 90) {
dirCounter = 0;
if (wallsDir == 0) {
wallsDir = 90;
} else {
wallsDir = 0;
}
}
}
manageCursor();
shootCursor();
manageGame();
moveBullets();
moveItems();
};
Frame 56
initGame();
initArrays();
game.totOrbs = 10;
pipesClosed = 0;
pipeOrbs = 0;
gameWon = false;
game.thoughtText = "Align the pipes! Just like in Mario did";
game.totOrbs = game.totOrbs + 2;
game.colOrbs = (game.disOrbs = 2);
makeShooter(300, 225, 2, 80);
makePause(433, 155);
i = 1;
while (i <= 5) {
p = _root["pipe" + i];
p._rotation = (72 + random(50)) * i;
p.rotSpeed = 0;
p.maxRotSpeed = 10;
p.timer = 4;
p.closed = false;
i++;
}
onEnterFrame = function () {
manageCursor();
shootCursor();
manageGame();
moveBullets();
moveItems();
bulletProof(pipes);
smashCursorOn(pipes);
pipesClosed = 0;
if (!game.paused) {
i = 1;
while (i <= 5) {
p = _root["pipe" + i];
if (bulletHitTest(p, true, 1)) {
p.timer = 0;
if (p.rotSpeed < p.maxRotSpeed) {
p.rotSpeed++;
}
}
p.timer++;
if (!gameWon) {
p._rotation = p._rotation + p.rotSpeed;
}
smashCursorOn(p);
if (p.timer > 6) {
p.rotSpeed = p.rotSpeed * 0.9;
}
if ((roughlyEqual(p._rotation, 0, 10) || (roughlyEqual(p._rotation, 180, 10))) || (roughlyEqual(p._rotation, -180, 10))) {
p.closed = true;
} else {
p.closed = false;
}
if (p.closed) {
pipesClosed++;
p._alpha = 100;
}
i++;
}
if (pipesClosed == 5) {
gameWon = true;
}
if (gameWon) {
for (s in shooters) {
sh = shooters[s];
sh._alpha = sh._alpha / 1.5;
if (sh._alpha < 2) {
removeMovieClip(sh);
shooters.splice(s, 1);
}
}
if (pipeOrbs < 10) {
if (random(3) == 0) {
makeOrb(random(40) + 260, 150, random(160) + 200, random(150) + 160, false);
pipeOrbs++;
}
}
}
}
};
Frame 57
initGame();
initArrays();
game.thoughtText = "You must choose... Wisely";
i = 0;
while (i < 3) {
i++;
}
rotation = 0;
makePortal(300, 100, 1, 2, false, 180);
portals[0]._name = "topPortal";
makePortal(300, 350, 3, 4, false, 0);
portals[1]._name = "bottomPortal";
makePortal(50, 25, 2, 1);
makePortal(550, 400, 4, 3);
makeGrey(50, 200, 160, 5, 5, 180);
makeGreen(50, 250, 100, 4, 180);
makeGrey(550, 250, 160, 5, 5, 0);
makeGreen(550, 200, 100, 4, 0);
game.totOrbs = game.totOrbs + 3;
game.disOrbs = (game.colOrbs = 3);
makePause(300, 225);
onEnterFrame = function () {
if (!game.paused) {
rotation = rotation + 2;
}
topPortal._x = 300 + (Math.sin((Math.PI/180) * rotation) * 125);
topPortal._y = 225 - (Math.cos((Math.PI/180) * rotation) * 125);
bottomPortal._x = 300 + (Math.sin((Math.PI/180) * (rotation + 180)) * 125);
bottomPortal._y = 225 - (Math.cos((Math.PI/180) * (rotation + 180)) * 125);
if ((cursor._x > 500) || (cursor._x < 100)) {
smashCursor();
}
for (i in orbs) {
o = orbs[i];
if (o.active) {
if (o._x < 150) {
o.endX = o.endX + 7;
}
if (o._x > 450) {
o.endX = o.endX - 7;
}
}
}
manageCursor();
shootCursor();
manageGame();
moveBullets();
moveItems();
};
Frame 58
initGame();
initArrays();
game.totOrbs = 10;
cursor.canShoot = false;
randChance = random(5);
if (randChance == 0) {
pieceArray = new Array(4, 15, 12, 7, 6, 3, 5, 8, 10, 9, 2, 13, 14, 11, 1, 0);
} else if (randChance == 1) {
pieceArray = new Array(6, 14, 4, 15, 10, 9, 2, 8, 3, 11, 12, 13, 1, 7, 5, 0);
} else if (randChance == 2) {
pieceArray = new Array(12, 13, 10, 2, 9, 1, 7, 14, 3, 6, 5, 4, 15, 8, 11, 0);
} else if (randChance == 3) {
pieceArray = new Array(1, 12, 15, 14, 11, 8, 5, 2, 7, 10, 6, 13, 4, 3, 9, 0);
} else if (randChance == 4) {
pieceArray = new Array(6, 9, 3, 2, 7, 15, 5, 4, 12, 10, 11, 8, 1, 14, 13, 0);
}
tempI = 0;
tempD = piece2._x - piece1._x;
gameFinished = false;
game.thoughtText = "Imitation is the sincerest form of flattery \u00A9";
i = 1;
while (i < 16) {
p = _root["piece" + i];
p.pieceNumber = pieceArray[i - 1];
if (Math.floor(p.pieceNumber / 2) == (p.pieceNumber / 2)) {
p.gotoAndStop(1);
} else {
p.gotoAndStop(3);
}
p.piecePosition = i;
p.onRelease = function () {
if (!gameFinished) {
this.moved = false;
if (!this.moved) {
if (_root.pieceArray[this.piecePosition - 5] == 0) {
this.endY = this.endY - tempD;
_root.pieceArray[this.piecePosition - 1] = 0;
_root.pieceArray[this.piecePosition - 5] = this.pieceNumber;
this.piecePosition = this.piecePosition - 4;
this.moved = true;
}
}
if (!this.moved) {
if (((this.piecePosition != 5) && (this.piecePosition != 9)) && (this.piecePosition != 13)) {
if (_root.pieceArray[this.piecePosition - 2] == 0) {
this.endX = this.endX - tempD;
_root.pieceArray[this.piecePosition - 1] = 0;
_root.pieceArray[this.piecePosition - 2] = this.pieceNumber;
this.piecePosition = this.piecePosition - 1;
this.moved = true;
}
}
}
if (!this.moved) {
if (((this.piecePosition != 4) && (this.piecePosition != 8)) && (this.piecePosition != 12)) {
if (_root.pieceArray[this.piecePosition] == 0) {
this.endX = this.endX + tempD;
_root.pieceArray[this.piecePosition - 1] = 0;
_root.pieceArray[this.piecePosition] = this.pieceNumber;
this.piecePosition = this.piecePosition + 1;
this.moved = true;
}
}
}
if (!this.moved) {
if (_root.pieceArray[this.piecePosition + 3] == 0) {
this.endY = this.endY + tempD;
_root.pieceArray[this.piecePosition - 1] = 0;
_root.pieceArray[this.piecePosition + 3] = this.pieceNumber;
this.piecePosition = this.piecePosition + 4;
this.moved = true;
}
}
}
};
p.endX = p._x;
p.endY = p._y;
i++;
}
onEnterFrame = function () {
correctCount = 0;
i = 1;
while (i < 16) {
p = _root["piece" + i];
if (p.hitTest(cursor._x, cursor._y, true)) {
if (!gameFinished) {
if (p._currentframe == 1) {
p.gotoAndStop(2);
} else if (p._currentframe == 3) {
p.gotoAndStop(4);
}
}
} else if (p._currentframe == 2) {
p.gotoAndStop(1);
} else if (p._currentframe == 4) {
p.gotoAndStop(3);
}
p._x = p._x + ((p.endX - p._x) / 3);
p._y = p._y + ((p.endY - p._y) / 3);
if (p.pieceNumber == p.piecePosition) {
correctCount++;
}
i++;
}
if (correctCount == 15) {
gameFinished = true;
if (tempI < 10) {
if (Math.floor(tempI) == tempI) {
if (tempI < 5) {
makeOrb(90, 45 + (90 * tempI), 45, 45 + (90 * tempI), false);
} else {
makeOrb(510, 45 + (90 * (tempI - 5)), 560, 45 + (90 * (tempI - 5)), false);
}
}
tempI = tempI + 0.5;
}
}
manageCursor();
shootCursor();
manageGame();
moveBullets();
moveItems();
};
Frame 59
initGame();
initArrays();
cursor._y = 225;
cursor._x = 160;
upSpeed = 0;
game.totOrbs = 10;
madeOrbs = false;
cursor.canShoot = false;
cursor.endS = 200;
gameStarted = false;
startTimer = 0;
wallSpeed = 0;
cursor._rotation = 90;
clickToStart = "CLICK TO START";
fadedCursor.gotoAndStop(pointerFrame);
game.thoughtText = "Yo dawg I heard you like flash games";
gameFinished = false;
onEnterFrame = function () {
if (!gameFinished) {
fadedCursor._x = fadedCursor._x + ((_xmouse - fadedCursor._x) / cursor.ease);
fadedCursor._y = fadedCursor._y + ((_ymouse - fadedCursor._y) / cursor.ease);
cursor._x = 160;
if (!cursor.spinning) {
if (spinDir == 1) {
if (Key.isDown(37) || (Key.isDown(65))) {
if (cursor.rotSpeed > -15) {
cursor.rotSpeed = cursor.rotSpeed - 3;
}
} else if (Key.isDown(39) || (Key.isDown(68))) {
if (cursor.rotSpeed < 15) {
cursor.rotSpeed = cursor.rotSpeed + 3;
}
} else {
cursor.rotSpeed = cursor.rotSpeed * 0.5;
}
} else if (Key.isDown(39) || (Key.isDown(68))) {
if (cursor.rotSpeed > -15) {
cursor.rotSpeed = cursor.rotSpeed - 3;
}
} else if (Key.isDown(37) || (Key.isDown(65))) {
if (cursor.rotSpeed < 15) {
cursor.rotSpeed = cursor.rotSpeed + 3;
}
} else {
cursor.rotSpeed = cursor.rotSpeed * 0.5;
}
}
fadedCursor._rotation = fadedCursor._rotation + cursor.rotSpeed;
if ((startTimer++) > 5) {
if (gameStarted) {
if (wallSpeed < 6.5) {
wallSpeed = wallSpeed + 0.5;
}
walls._x = walls._x - wallSpeed;
if (walls._x < -6477) {
gameFinished = true;
}
cursor._y = cursor._y + upSpeed;
if (cursor.pressed) {
cursor._rotation = cursor._rotation + ((80 - cursor._rotation) / 3);
if (upSpeed > -6) {
upSpeed = upSpeed - 1;
}
} else {
if (upSpeed < 7) {
upSpeed = upSpeed + 1;
}
cursor._rotation = cursor._rotation + ((100 - cursor._rotation) / 3);
}
} else if (cursor.pressed) {
gameStarted = true;
clickToStart = "";
}
}
} else {
if (!madeOrbs) {
i = 0;
while (i < 10) {
tY = 40.9090909090909 + ((450 * i) / 11);
makeOrb(610, tY, 570, tY, false);
i++;
}
madeOrbs = true;
}
fadedCursor._visible = false;
moveCursor();
if (cursor.spinSpeed == 0) {
rotateCursor(cursor.dir);
} else if (!game.paused) {
cursor._rotation = cursor._rotation + cursor.spinSpeed;
}
}
hideCursor();
scaleCursor();
alphaCursor();
manageBackground();
cursor.mX = cursor._x - (Math.sin((Math.PI/180) * cursor._rotation) * 11);
cursor.mY = cursor._y + (Math.cos((Math.PI/180) * cursor._rotation) * 11);
if (cursor._x > 600) {
cursor._x = 600;
}
if (cursor._x < 0) {
cursor._x = 0;
}
if (!gameFinished) {
if ((cursor._y > 450) || (cursor._y < 0)) {
smashCursor();
}
}
shootCursor();
manageGame();
moveBullets();
moveItems();
};
Frame 60
initGame();
initArrays();
i = 0;
while (i < 4) {
makeGrey(random(380) + 220, random(450), 150, 5, 0, 0);
i++;
}
i = 0;
while (i < 3) {
makeGreen(random(380) + 220, random(450), 100, 0, 0);
i++;
}
robotReload = 0;
moveOn = false;
turnOn = false;
shootOn = false;
cursor.reloadSpeed = 5;
game.thoughtText = "Would you like some syrup with that?";
game.totOrbs = game.totOrbs + 2;
game.colOrbs = (game.disOrbs = 2);
onEnterFrame = function () {
if (robot._x > 620) {
robot._x = 220;
}
if (robot._x < 220) {
robot._x = 620;
}
if (robot._y > 470) {
robot._y = -20;
}
if (robot._y < -20) {
robot._y = 470;
}
manageCursor();
shootCursor();
manageGame();
moveBullets();
moveItems();
if (cursor._x > 200) {
cursor.canShoot = false;
cursor._x = 200;
} else {
cursor.canShoot = true;
}
if (moveOn) {
robot._x = robot._x + (Math.sin((Math.PI/180) * robot._rotation) * 5);
robot._y = robot._y - (Math.cos((Math.PI/180) * robot._rotation) * 5);
}
moveButton.gotoAndStop(int(moveOn) + 1);
if (turnOn) {
robot._rotation = robot._rotation + 5;
}
turnButton.gotoAndStop(int(turnOn) + 1);
if (shootOn) {
if ((robotReload++) > 4) {
robotReload = 0;
shoot(robot._x + (Math.sin((Math.PI/180) * robot._rotation) * 25), robot._y - (Math.cos((Math.PI/180) * robot._rotation) * 25), robot._rotation, 3);
}
}
shootButton.gotoAndStop(int(shootOn) + 1);
if (bulletHitTest(moveButton, false, 1)) {
if (moveOn) {
moveOn = false;
} else {
moveOn = true;
}
}
if (bulletHitTest(turnButton, false, 1)) {
if (turnOn) {
turnOn = false;
} else {
turnOn = true;
}
}
if (bulletHitTest(shootButton, false, 1)) {
if (shootOn) {
shootOn = false;
} else {
shootOn = true;
}
}
for (i in bullets) {
b = bullets[i];
if (b.who == 1) {
if (b._x > 200) {
removeMovieClip(b);
bullets.splice(i, 1);
}
} else if (b.who == 3) {
if (b._x < 200) {
removeMovieClip(b);
bullets.splice(i, 1);
}
}
}
for (i in greys) {
g = greys[i];
if (g._x < (200 + (g._width / 2))) {
g._x = 200 + (g._width / 2);
g.xSpeed = g.xSpeed * -1;
}
}
for (i in orbs) {
o = orbs[i];
if (o.active) {
if (robot.hitTest(o)) {
if (game.deathTimer == 0) {
if (o.active) {
game.colOrbs++;
game.disOrbs++;
o.endX = bar._x + ((game.disOrbs / game.totOrbs) * game.barWidth);
o.endY = bar._y;
if (musicOn) {
getOrb.start();
}
o.active = false;
}
}
}
}
}
};
Frame 61
initGame();
initArrays();
game.totOrbs = 20;
madeOrbs = 0;
makeShooter(300, 225, 2, 20);
timerText = 450;
makeSwell(0, 225, 3, 7);
makeSwell(600, 225, 3, 7);
game.thoughtText = "15 seconds never seemed so long";
game.totOrbs = game.totOrbs + 2;
game.colOrbs = (game.disOrbs = 2);
onEnterFrame = function () {
if (timerText > 0) {
if (random(15) == 0) {
makeMeteor(150, 6, "random");
}
if ((!cursor.dead) && (game.endTimer == 0)) {
timerText--;
}
} else if (madeOrbs < 20) {
tX = random(600);
tY = random(450);
makeOrb(tX, tY, tX, tY, false);
madeOrbs++;
}
timerDisplay = countDown(timerText);
for (i in shooters) {
s = shooters[i];
if (timerText <= 0) {
s._alpha = s._alpha - 10;
}
if (s._alpha <= 0) {
removeMovieClip(s);
shooters.splice(i, 1);
}
}
for (i in swells) {
s = swells[i];
if (timerText <= 0) {
s.gSpeed = -6;
}
if (s._xscale <= 0) {
removeMovieClip(s);
swells.splice(i, 1);
}
}
manageCursor();
shootCursor();
manageGame();
moveBullets();
moveItems();
};
Frame 62
initGame();
initArrays();
simonLength = 7;
game.thoughtText = "I like tea and cakes for tea and cake time";
simonColours = new Array(simonLength);
simonInput = new Array(simonLength);
simonTelling = true;
simonLevel = 1;
simonLooper = 0;
simonWrongInput = false;
simonDelay = 0;
i = 0;
while (i < simonLength) {
simonColours[i] = random(4) + 1;
i++;
}
game.totOrbs = 22;
game.disOrbs = (game.colOrbs = 2);
simonOrbs = 0;
cursor.reloadSpeed = 7;
simonAdvance = false;
simon.centre.gotoAndStop(30);
simonActive = 1;
simonRot = 0;
simon._alpha = 0;
onEnterFrame = function () {
manageCursor();
shootCursor();
manageGame();
moveBullets();
moveItems();
if (simonActive == 1) {
simon._alpha = simon._alpha + 1.5;
if (simon._alpha >= 100) {
simonActive = 2;
}
} else if (simonActive == 2) {
smashCursorOn(simon);
if (simonTelling) {
if (simonLooper < simonLevel) {
if (_root.simon["quad" + simonColours[simonLooper]]._currentframe == 1) {
_root.simon["quad" + simonColours[simonLooper]].gotoAndPlay(2);
if (musicOn) {
if (simonColours[simonLooper] == 1) {
tone1.start();
} else if (simonColours[simonLooper] == 2) {
tone2.start();
} else if (simonColours[simonLooper] == 3) {
tone3.start();
} else if (simonColours[simonLooper] == 4) {
tone4.start();
}
}
}
if (_root.simon["quad" + simonColours[simonLooper]]._currentframe == 14) {
simonLooper++;
}
} else if (simonLooper == simonLevel) {
simonTelling = false;
simon.centre.gotoAndPlay(30);
simonLooper = 0;
}
}
if (!simonTelling) {
if (!simonAdvance) {
for (i in bullets) {
b = bullets[i];
if (b._currentframe == 1) {
j = 1;
while (j <= 4) {
q = _root.simon["quad" + j];
if (q.hitTest(b._x, b._y, true)) {
if (q._currentframe == 1) {
removeMovieClip(b);
bullets.splice(i, 1);
if (simonColours[simonLooper] == j) {
simonLooper++;
if (simonLooper == simonLevel) {
simonAdvance = true;
simon.centre.gotoAndPlay(2);
}
if (q._currentframe == 1) {
q.gotoAndPlay(2);
}
if (musicOn) {
if (j == 1) {
tone1.start();
} else if (j == 2) {
tone2.start();
} else if (j == 3) {
tone3.start();
} else if (j == 4) {
tone4.start();
}
}
} else {
smashCursor();
}
}
}
j++;
}
}
}
}
if (simonAdvance) {
if ((simonDelay++) > 30) {
simonAdvance = false;
simonLooper = 0;
simonTelling = true;
simonLevel++;
simonDelay = 0;
if (simonLevel > simonLength) {
simonActive = 3;
simon.gotoAndPlay(2);
}
}
}
}
} else if (simonActive == 3) {
if (simon._currentframe >= 80) {
if (simonOrbs < 20) {
simonOrbs++;
ranDir = (Math.random() * Math.PI) * 2;
simonWidth = simon._width / 2;
ranWidth = 60 + (Math.random() * 100);
makeOrb(simon._x + (Math.sin(ranDir) * simonWidth), simon._y - (Math.cos(ranDir) * simonWidth), simon._x + (Math.sin(ranDir) * ranWidth), simon._y - (Math.cos(ranDir) * ranWidth), false);
}
}
}
if (simonLevel > 6) {
if (!simonTelling) {
if (random(30) == 0) {
randDir = random(360);
shoot(simon._x + (173 * Math.sin((Math.PI/180) * randDir)), simon._y - (173 * Math.cos((Math.PI/180) * randDir)), randDir, 2);
}
}
}
if (simonLevel >= 5) {
if (simonTelling && (!cursor.dead)) {
if (simonRot > 0) {
simonRot = simonRot - 0.1;
} else {
simonRot = 0;
}
} else if (simonRot < 0.8) {
simonRot = simonRot + 0.05;
} else {
simonRot = 0.8;
}
}
simon._rotation = simon._rotation + simonRot;
};
Frame 63
initGame();
initArrays();
makePause(89, 86);
game.thoughtText = "Shoot the stone downwards";
makeStone(95, 246, 150, 5, 0, 0);
makeRocket(540, 391, 270);
i = 1;
while (i <= 9) {
tpOrb = _root["tempOrb" + i];
makeOrb(tpOrb._x, tpOrb._y, tpOrb._x, tpOrb._y, true);
tpOrb._visible = false;
i++;
}
onEnterFrame = function () {
for (i in orbs) {
o = orbs[i];
if (o.active) {
if (o._y > 260) {
if (o._y < 365) {
o.endY = o.endY + 5;
}
if (o._y > 395) {
o.endY = o.endY - 5;
}
}
}
}
manageCursor();
shootCursor();
manageGame();
moveBullets();
moveItems();
};
Frame 64
initGame();
initArrays();
makePause(302, 361);
makeSwitch(47, 217, "mySwitch");
game.thoughtText = "You spin me right round, arrow keys, right round";
cursor.spinSpeed = 3;
onEnterFrame = function () {
bulletProof(door);
if (mySwitch.val) {
door._rotation = door._rotation + 6;
}
manageCursor();
shootCursor();
manageGame();
moveBullets();
moveItems();
};
Frame 65
initGame();
initArrays();
makePause(84, 138);
gameTimerFrames = 300;
game.thoughtText = "I can't see a thing with this here!";
i = 1;
while (i <= 9) {
tpOrb = _root["tempOrb" + i];
makeOrb(tpOrb._x, tpOrb._y, tpOrb._x, tpOrb._y, true);
tpOrb._visible = false;
i++;
}
onEnterFrame = function () {
if (!cursor.dead) {
if (!game.paused) {
if (game.colOrbs != 9) {
gameTimerFrames--;
}
}
}
if (gameTimerFrames < 0) {
gameTimerFrames = 0;
smashCursor();
}
gameTimer = countDown(gameTimerFrames);
manageCursor();
shootCursor();
manageGame();
moveBullets();
moveItems();
};
Frame 66
initGame();
initArrays();
makePause(535, 390);
i = 1;
while (i <= 9) {
tpOrb = _root["tempOrb" + i];
makeOrb(tpOrb._x, tpOrb._y, tpOrb._x, tpOrb._y, true);
tpOrb._visible = false;
i++;
}
blockerWall(100, 375, 460, 405);
blockerWall(37, 102, 67, 334);
blockerWall(167, 104, 197, 240);
blockerWall(328, 104, 360, 240);
blockerWall(440, 95, 541, 250);
gameTimer = 960;
game.thoughtText = "Hidden in plain sight. Behind blue blocks.";
onEnterFrame = function () {
if (!game.paused) {
if (!cursor.dead) {
if (gameTimer > 0) {
if (game.colOrbs != game.totOrbs) {
gameTimer--;
}
} else {
gameTimer = 0;
smashCursor();
}
}
}
gameTime = countDown(gameTimer);
manageCursor();
shootCursor();
manageGame();
moveBullets();
moveItems();
};
Frame 67
initGame();
initArrays();
makePause(300, 205);
game.thoughtText = "Change directions!";
makeSwitch(300, 255, "mySwitch");
i = 0;
while (i < 360) {
makeSpinner(300 + (Math.sin((Math.PI/180) * i) * 175), 225 - (Math.cos((Math.PI/180) * i) * 175), Math.random() * 6, 2 + random(3), 5, i);
i = i + 60;
}
makeGrey(550, 225, 100, 4, 0, 0);
makeGrey(50, 225, 100, 4, 0, 0);
makeSpinner(50, 150, Math.random() * 6, 1 + random(3), 0, 0);
makeSpinner(50, 300, Math.random() * 6, 1 + random(3), 0, 0);
makeSpinner(550, 150, Math.random() * 6, 1 + random(3), 0, 0);
makeSpinner(550, 300, Math.random() * 6, 1 + random(3), 0, 0);
onEnterFrame = function () {
if (!game.paused) {
if (mySwitch.val) {
leftWall._rotation = leftWall._rotation + 2;
} else {
rightWall._rotation = rightWall._rotation - 2;
}
}
manageCursor();
shootCursor();
manageGame();
moveBullets();
moveItems();
smashCursorOn(leftWall);
smashCursorOn(rightWall);
bulletProof(leftWall);
bulletProof(rightWall);
};
Frame 68
initGame();
initArrays();
makePause(300, 400);
wallSpeed = 0;
game.totOrbs = 50;
orbsMade = 0;
wallsFinished = false;
walls._xscale = ((random(2) * 2) - 1) * 100;
game.thoughtText = "I wonder if there's a light at the end";
onEnterFrame = function () {
walls._y = walls._y + wallSpeed;
if (!game.paused) {
if (walls._y < 7300) {
if (wallSpeed < 3.3) {
wallSpeed = wallSpeed + 0.1;
}
} else {
wallsFinished = true;
if (wallSpeed > 0) {
wallSpeed = wallSpeed - 0.1;
} else {
wallSpeed = 0;
}
}
}
if (wallsFinished) {
if (orbsMade < 50) {
orbsMade++;
makeOrb(300, 225, 300 + (Math.sin((Math.PI/180) * (orbsMade * 20)) * (orbsMade * 4)), 225 - (Math.cos((Math.PI/180) * (orbsMade * 20)) * (orbsMade * 4)), false);
}
}
manageCursor();
shootCursor();
manageGame();
moveBullets();
moveItems();
};
Frame 69
initGame();
initArrays();
game.shoveOrbs = false;
makePause(20, 20);
game.thoughtText = "ECHO, Echo, echo...";
onEnterFrame = function () {
if (!game.paused) {
walls._x = 600 - cursor._x;
walls._y = 450 - cursor._y;
}
for (i in orbs) {
o = orbs[i];
if (o.collected == undefined) {
o.collected = false;
o.difX = o._x - walls._x;
o.difY = o._y - walls._y;
}
}
manageCursor();
shootCursor();
manageGame();
moveBullets();
if (!game.paused) {
for (i in orbs) {
o = orbs[i];
if (o.collected) {
o._x = o._x + ((o.endX - o._x) / 4);
o._y = o._y + ((o.endY - o._y) / 4);
} else {
o._x = walls._x + o.difX;
o._y = walls._y + o.difY;
}
if (!o.active) {
if ((Math.abs(o._x - o.endX) < 3) && (Math.abs(o._y - o.endY) < 3)) {
removeMovieClip(o);
orbs.splice(i, 1);
}
} else if (cursor.hitTest(o)) {
if (game.deathTimer == 0) {
if (o.active) {
o.collected = true;
game.colOrbs++;
game.disOrbs++;
o.endX = bar._x + ((game.disOrbs / game.totOrbs) * game.barWidth);
o.endY = bar._y;
if (musicOn) {
getOrb.start();
}
o.active = false;
}
}
}
}
moveGreys();
moveGreens();
moveShields();
moveBombs();
moveShooters();
moveSpinners();
moveGhosts();
moveCrystals();
moveMeteors();
movePortals();
moveSwells();
moveStones();
moveSwitches();
moveRockets();
moveBlades();
moveClouds();
moveBlockers();
moveBits();
}
movePauses();
};
Frame 70
initGame();
initArrays();
makePause(46, 395);
game.totOrbs = 10;
makeOrb(500, 420, 500, 420, true);
makeShooter(540, 420, 2, 27);
madeOrbs = false;
makeOrbs = false;
tempI = 0;
game.thoughtText = "It's a trap!";
game.totOrbs = game.totOrbs + 2;
game.colOrbs = (game.disOrbs = 2);
onEnterFrame = function () {
if (!game.paused) {
if (random(17) == 0) {
makeMeteor(130 + random(60), (Math.random() * 6) + 4, "up");
}
}
if (game.colOrbs > 2) {
if (cursor._y > 150) {
makeOrbs = true;
}
walls.part._x = walls.part._x + ((120 - walls.part._x) / 10);
}
if (makeOrbs) {
if (!madeOrbs) {
if (tempI < 10) {
if (Math.floor(tempI) == tempI) {
makeOrb(30 + (tempI * 60), -10, 30 + (tempI * 60), 65, false);
}
tempI = tempI + 0.5;
} else {
madeOrbs = true;
}
}
}
manageCursor();
shootCursor();
manageGame();
moveBullets();
moveItems();
};
Frame 71
initGame();
initArrays();
game.shoveOrbs = false;
makePause(402, 265);
game.thoughtText = "DON'T PANIC";
onEnterFrame = function () {
manageCursor();
shootCursor();
manageGame();
moveBullets();
moveItems();
};
Frame 72
initGame();
initArrays();
makePause(300, 225);
game.totOrbs = 20;
tempI = 0;
game.thoughtText = "Stress in a box\u2122";
onEnterFrame = function () {
if (walls._currentframe == 1) {
if (!game.paused) {
walls.gotoAndPlay(2);
}
}
if (walls._currentframe == 1088) {
if (tempI < 20) {
ranX = random(560) + 20;
ranY = random(410) + 20;
makeOrb(ranX, ranY, ranX, ranY, false);
tempI++;
}
}
manageCursor();
shootCursor();
manageGame();
moveBullets();
moveItems();
};
Frame 73
initGame();
initArrays();
game.thoughtText = "So many copyright breaches...";
game.totOrbs = 45;
game.disOrbs = (game.colOrbs = 5);
stage = 0;
stageTimer = 0;
subStage = 0;
pacSpeed = 8;
spareParts = new Array();
game.removalArray.push(spareParts);
pongBalls = -1;
paddleLeft.endY = 225;
paddleRight.endY = 225;
missileS = 1;
missileSwitch = 0;
missileDelay = 0;
pacShot = false;
gameOn = true;
ghostsLeft = 4;
stageCount = 2;
stageCounter = 0;
i = 1;
while (i <= 4) {
g = _root["pacGhost" + i];
g.active = true;
g.xSpeed = 0;
g.ySpeed = 0;
g.damage = 0;
g.timer = 0;
g.cover._visible = false;
i++;
}
pacMan.xSpeed = 0;
pacMan.ySpeed = 0;
pacMan.timer = 0;
pacHit = 0;
onEnterFrame = function () {
moveBullets();
if (stage == 0) {
bulletProof(pacMan, 2);
pacMan._x = pacMan._x + pacSpeed;
gI = 1;
while (gI <= 4) {
g = _root["pacGhost" + gI];
bulletProof(g, 2);
g._x = g._x + pacSpeed;
gI++;
}
if (pacGhost4._x > 620) {
stage = random(4) + 2;
pacMan._y = 225;
pacMan._x = -40;
i = 1;
while (i <= 4) {
g = _root["pacGhost" + i];
g._y = 225;
g._x = (60 * i) - 420;
i = i + 1;
}
}
}
if (stage == 1) {
i = 1;
while (i <= 4) {
g = _root["pacGhost" + i];
if (g.active) {
smashCursorOn(g);
}
i++;
}
if (subStage == 0) {
if (!pacShot) {
pacMan._x = pacMan._x + pacMan.xSpeed;
pacMan._y = pacMan._y + pacMan.ySpeed;
if (gameOn) {
pacMan.timer++;
if (pacMan.timer > 30) {
pacMan.timer = 0;
c = random(4) * 90;
pacMan.xSpeed = Math.cos((Math.PI/180) * c) * 5;
pacMan.ySpeed = (-Math.sin((Math.PI/180) * c)) * 5;
}
if (pacMan._x > 575) {
pacMan.xSpeed = -5;
pacMan.ySpeed = 0;
pacMan.timer = 0;
}
if (pacMan._x < 25) {
pacMan.xSpeed = 5;
pacMan.ySpeed = 0;
pacMan.timer = 0;
}
if (pacMan._y > 425) {
pacMan.xSpeed = 0;
pacMan.ySpeed = -5;
pacMan.timer = 0;
}
if (pacMan._y < 25) {
pacMan.xSpeed = 0;
pacMan.ySpeed = 5;
pacMan.timer = 0;
}
} else {
tC = 0;
i = 1;
while (i <= 4) {
g = _root["pacGhost" + i];
if (g.active) {
if ((((g._x > 650) || (g._x < -50)) || (g._y > 500)) || (g._y < -50)) {
tC++;
}
}
i++;
}
if ((((pacMan._x > 650) || (pacMan._x < -50)) || (pacMan._y > 500)) || (pacMan._y < -50)) {
if (tC == ghostsLeft) {
stage = random(4) + 2;
pacMan._y = 225;
pacMan._x = -40;
pacShot = false;
gameOn = true;
pacMan.xSpeed = 0;
pacMan.ySpeed = 0;
pacMan.timer = 0;
pacMan._rotation = 0;
pacHit = 0;
i = 1;
while (i <= 4) {
g = _root["pacGhost" + i];
g.xSpeed = 0;
g.ySpeed = 0;
g.damage = 0;
g.timer = 0;
g.cover._visible = false;
g._y = 225;
g._x = (60 * i) - 420;
i++;
}
}
}
}
pacMan._rotation = 57.2957795130823 * Math.atan2(pacMan.ySpeed, pacMan.xSpeed);
if (bulletHitTest(pacMan, true, 1)) {
if (game.disOrbs > 0) {
loseOrb();
}
}
i = 1;
while (i <= 4) {
g = _root["pacGhost" + i];
if (g.active) {
if (random(5) == 0) {
g.cover._visible = false;
}
if (gameOn) {
if (g.hitTest(pacMan)) {
if (g != pacHit) {
pacHit = g;
if (pacMan.xSpeed > 0) {
if (g.xSpeed < 0) {
g.xSpeed = g.xSpeed * -1;
pacMan.xSpeed = pacMan.xSpeed * -1;
} else if (g.xSpeed > 0) {
pacMan.xSpeed = pacMan.xSpeed * -1;
}
} else if (pacMan.xSpeed < 0) {
if (g.xSpeed > 0) {
g.xSpeed = g.xSpeed * -1;
pacMan.xSpeed = pacMan.xSpeed * -1;
} else if (g.xSpeed < 0) {
pacMan.xSpeed = pacMan.xSpeed * -1;
}
} else if (pacMan.ySpeed > 0) {
if (g.ySpeed < 0) {
g.ySpeed = g.ySpeed * -1;
pacMan.ySpeed = pacMan.ySpeed * -1;
} else if (g.ySpeed < 0) {
pacMan.ySpeed = pacMan.ySpeed * -1;
}
} else if (pacMan.ySpeed < 0) {
if (g.ySpeed > 0) {
g.ySpeed = g.ySpeed * -1;
pacMan.ySpeed = pacMan.ySpeed * -1;
} else if (g.ySpeed < 0) {
pacMan.ySpeed = pacMan.ySpeed * -1;
}
}
}
}
}
g._x = g._x + g.xSpeed;
g._y = g._y + g.ySpeed;
if (gameOn) {
g.timer++;
if (g.timer > 20) {
if (random(35) == 0) {
g.timer = 0;
c = random(4) * 90;
g.xSpeed = Math.cos((Math.PI/180) * c) * 5;
g.ySpeed = (-Math.sin((Math.PI/180) * c)) * 5;
}
}
if (g._x > 580) {
g.xSpeed = -5;
g.ySpeed = 0;
g.timer = 0;
}
if (g._x < 20) {
g.xSpeed = 5;
g.ySpeed = 0;
g.timer = 0;
}
if (g._y > 420) {
g.xSpeed = 0;
g.ySpeed = -5;
g.timer = 0;
}
if (g._y < 30) {
g.xSpeed = 0;
g.ySpeed = 5;
g.timer = 0;
}
}
if (g.xSpeed > 0) {
c = 1;
} else if (g.xSpeed < 0) {
c = 3;
} else if (g.ySpeed > 0) {
c = 2;
} else if (g.ySpeed < 0) {
c = 4;
}
g.ghostEye1.gotoAndStop(c);
g.ghostEye2.gotoAndStop(c);
if (gameOn) {
if (bulletHitTest(g, true, 1)) {
g.cover._visible = true;
g.damage++;
}
if (g.damage > 30) {
g.active = false;
g.gotoAndPlay(7);
gameOn = false;
ghostsLeft--;
if (ghostsLeft == 0) {
subStage = 1;
}
z = 0;
while (z < 10) {
makeOrb(g._x, g._y, (g._x + random(100)) - 50, (g._y + random(100)) - 50, false);
z++;
}
}
}
} else if (g._currentframe == 20) {
g._x = 0;
g._y = 0;
}
i++;
}
} else {
if (pacMan._currentframe == 40) {
smashCursor();
}
bulletProof(pacMan);
}
} else {
pacMan._x = pacMan._x + pacMan.xSpeed;
pacMan._y = pacMan._y + pacMan.ySpeed;
}
}
if (stage == 2) {
for (pp in spareParts) {
t = spareParts[pp];
t._y = t._y + t.ySpeed;
smashCursorOn(t);
bulletProof(t, 1);
if (t._y > 500) {
removeMovieClip(t);
spareParts.splice(pp, 1);
}
}
if (stageTimer < 210) {
stageTimer++;
if (Math.random() > 0.4) {
ranI = random(7) + 1;
tempT = attachMovie("tetris" + ranI, "tetrisPiece" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
tempT._x = 20 * random(30);
tempT._y = -40;
tempT._rotation = 90 * random(3);
tempVal = true;
for (z in spareParts) {
if (tempT.hitTest(spareParts[z])) {
removeMovieClip(tempT);
tempVal = false;
}
}
if (tempVal) {
tempT.ySpeed = (Math.random() * 3) + 2;
spareParts.push(tempT);
}
}
}
if (spareParts.length == 0) {
stageCounter++;
subStage = 0;
stageTimer = 0;
if (stageCounter == stageCount) {
stage = 1;
stageCounter = 0;
} else {
c = random(4) + 2;
if (c == 2) {
c = random(4) + 2;
if (c == 2) {
c = random(4) + 2;
}
}
stage = random(4) + 2;
}
}
}
if (stage == 3) {
if (subStage == 0) {
stageTimer++;
paddleLeft._x++;
paddleRight._x--;
paddleLeft._y = (paddleRight._y = 225);
if (stageTimer > 40) {
stageTimer = 0;
subStage = 1;
}
} else if (subStage == 1) {
stageTimer++;
if (pongBalls == -1) {
r = Math.pow(-1, random(10));
b = attachMovie("pongBall", "pongBall" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
b._x = 300 + (r * 240);
b._y = 225;
b.xSpeed = (-6 * r) + ((Math.random() * 5) * (-r));
b.ySpeed = -6 + (Math.random() * 12);
spareParts.push(b);
pongBalls = 0;
}
if (stageTimer < 300) {
if (pongBalls < 7) {
if (random(50) == 0) {
r = Math.pow(-1, random(10));
b = attachMovie("pongBall", "pongBall" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
b._x = 300 + (r * 240);
b._y = 225;
b.xSpeed = (-6 * r) + ((Math.random() * 5) * (-r));
b.ySpeed = -6 + (Math.random() * 12);
spareParts.push(b);
pongBalls = pongBalls + 1;
}
}
}
t1 = 1000;
t2 = 1000;
for (s in spareParts) {
b = spareParts[s];
b._x = b._x + b.xSpeed;
b._y = b._y + b.ySpeed;
if (b.getBounds(_root).yMin < 0) {
b.ySpeed = b.ySpeed * -1;
}
if (b.getBounds(_root).yMax > 450) {
b.ySpeed = b.ySpeed * -1;
}
if (stageTimer < 450) {
if (paddleLeft.hitTest(b)) {
if (b.xSpeed < 0) {
if (b.getBounds(_root).xMin > paddleLeft._x) {
b.xSpeed = b.xSpeed * -1;
b.ySpeed = ((cursor._y - b._y) * b.xSpeed) / (cursor._x - b._x);
}
}
}
if (paddleRight.hitTest(b)) {
if (b.xSpeed > 0) {
if (b.getBounds(_root).xMax < paddleRight._x) {
b.xSpeed = b.xSpeed * -1;
b.ySpeed = ((cursor._y - b._y) * b.xSpeed) / (cursor._x - b._x);
}
}
}
}
tt1 = Math.sqrt(Math.pow(b._x - paddleLeft._x, 2) + Math.pow(b._y - paddleLeft._y, 2));
if (tt1 < t1) {
if ((b.xSpeed < 0) && (b.getBounds(_root).xMin > paddleLeft._x)) {
t1 = tt1;
paddleLeft.endY = b._y;
}
}
tt2 = Math.sqrt(Math.pow(b._x - paddleRight._x, 2) + Math.pow(b._y - paddleRight._y, 2));
if (tt2 < t2) {
if ((b.xSpeed > 0) && (b.getBounds(_root).xMax < paddleRight._x)) {
t2 = tt2;
paddleRight.endY = b._y;
}
}
if ((b._x > 630) || (b._x < -30)) {
removeMovieClip(b);
spareParts.splice(s, 1);
pongBalls--;
}
smashCursorOn(b);
bulletProof(b, 1);
}
if (Math.abs(paddleLeft._y - paddleLeft.endY) > 10) {
if (paddleLeft.endY > paddleLeft._y) {
paddleLeft._y = paddleLeft._y + 8;
} else {
paddleLeft._y = paddleLeft._y - 8;
}
}
if (Math.abs(paddleRight._y - paddleRight.endY) > 10) {
if (paddleRight.endY > paddleRight._y) {
paddleRight._y = paddleRight._y + 8;
} else {
paddleRight._y = paddleRight._y - 8;
}
}
if (stageTimer > 450) {
if (spareParts.length == 0) {
stageTimer = 0;
subStage = 2;
}
}
} else if (subStage == 2) {
stageTimer++;
paddleLeft._x--;
paddleRight._x++;
if (stageTimer > 40) {
stageTimer = 0;
subStage = 0;
stageCounter++;
if (stageCounter == stageCount) {
stage = 1;
stageCounter = 0;
} else {
c = random(4) + 2;
if (c == 3) {
c = random(4) + 2;
if (c == 3) {
c = random(4) + 2;
}
}
stage = random(4) + 2;
}
}
}
smashCursorOn(paddleLeft);
smashCursorOn(paddleRight);
}
if (stage == 4) {
if (subStage == 0) {
missileBase._y--;
levnum._x = levnum._x - 3;
missileBase.bar1.iBar._yscale = (missileBase.bar2.iBar._yscale = (missileBase.bar3.iBar._yscale = 100));
if (missileBase._y < 430) {
subStage = 2;
}
} else if (subStage == 1) {
missileBase._y++;
levnum._x = levnum._x + 3;
if (missileBase._y > 505) {
stageTimer = 0;
subStage = 0;
stageCounter++;
if (stageCounter == stageCount) {
stage = 1;
subStage = 0;
stageTimer = 0;
stageCounter = 0;
} else {
c = random(4) + 2;
if (c == 4) {
c = random(4) + 2;
if (c == 4) {
c = random(4) + 2;
}
}
stage = random(4) + 2;
}
}
} else if (subStage == 2) {
missileDelay++;
if (missileDelay > 2) {
missileDelay = 0;
missileSwitch++;
if (missileSwitch > 10) {
missileSwitch = 0;
if (random(8) == 0) {
missileS = 4;
} else {
missileS = random(3) + 1;
}
}
if (missileS == 1) {
if (missileBase.bar1.iBar._yscale > 0) {
shoot(missileBase._x - 250, missileBase._y - 50, (57.2957795130823 * Math.atan2((cursor._y - missileBase._y) + 50, (cursor._x - missileBase._x) + 250)) + 90, 3);
missileBase.bar1.iBar._yscale = missileBase.bar1.iBar._yscale - 5;
} else {
missileS = 2;
}
}
if (missileS == 2) {
if (missileBase.bar2.iBar._yscale > 0) {
shoot(missileBase._x, missileBase._y - 40, (57.2957795130823 * Math.atan2((cursor._y - missileBase._y) + 40, cursor._x - missileBase._x)) + 90, 3);
missileBase.bar2.iBar._yscale = missileBase.bar2.iBar._yscale - 5;
} else {
missileS = 3;
}
}
if (missileS == 3) {
if (missileBase.bar3.iBar._yscale > 0) {
shoot(missileBase._x + 250, missileBase._y - 50, (57.2957795130823 * Math.atan2((cursor._y - missileBase._y) + 50, (cursor._x - missileBase._x) - 250)) + 90, 3);
missileBase.bar3.iBar._yscale = missileBase.bar3.iBar._yscale - 5;
} else {
missileS = 1;
}
}
}
if (((missileBase.bar1.iBar._yscale <= 0) && (missileBase.bar2.iBar._yscale <= 0)) && (missileBase.bar3.iBar._yscale <= 0)) {
subStage = 1;
}
}
}
if (stage == 5) {
stageTimer++;
for (sI in spareParts) {
s = spareParts[sI];
s._x = s._x + s.xSpeed;
smashCursorOn(s);
bulletProof(s, 1);
if (Math.abs(s._x - cursor._x) < 15) {
if (random(5) == 0) {
shoot(s._x, s._y + 15, 180, 2);
}
} else if (random(70) == 0) {
shoot(s._x, s._y + 15, 180, 2);
}
if ((s._x > 650) || (s._x < -50)) {
removeMovieClip(s);
spareParts.splice(sI, 1);
}
}
if (stageTimer < 300) {
if (random(25) == 0) {
d = _root.getNextHighestDepth();
c = random(3) + 1;
cc = Math.pow(-1, random(9));
s = attachMovie("sIn" + c, ("sIn" + c) + d, d);
s._y = Math.random() * (cursor._y + ((450 - cursor._y) * 0.2));
s._x = 300 + (340 * cc);
s.xSpeed = (-2 * cc) + ((Math.random() * -4) * cc);
spareParts.push(s);
}
} else if (spareParts.length == 0) {
stageTimer = 0;
subStage = 0;
stageCounter++;
if (stageCounter == stageCount) {
stageCounter = 0;
stage = 1;
} else {
c = random(4) + 2;
if (c == 5) {
c = random(4) + 2;
if (c == 5) {
c = random(4) + 2;
}
}
stage = random(4) + 2;
}
}
}
manageCursor();
shootCursor();
manageGame();
moveItems();
};
Frame 74
initGame();
initArrays();
game.thoughtText = "Don't even think of using this to see where you are";
makeSwell(50, 225, 3, 16);
makeSwell(550, 225, 3, 16);
i = 0;
while (i < 7) {
makeGreen(random(600), random(450), 120, 3, random(360));
makeGhost(random(600), random(450), random(10), 3, 5, random(360));
i++;
}
game.totOrbs = game.totOrbs + 5;
game.colOrbs = (game.disOrbs = 5);
onEnterFrame = function () {
manageCursor();
shootCursor();
manageGame();
moveBullets();
moveItems();
};
Frame 75
initGame();
initArrays();
game.thoughtText = "PEW PEW PEW";
i = 0;
while (i < 20) {
makeGrey(300, 225, 120, 2, 0, 0);
i++;
}
i = 0;
while (i < 2) {
makeShooter(25 + random(550), 100, 2, 60);
makeShooter(25 + random(550), 350, 2, 60);
i++;
}
cursor.reloadSpeed = 0;
game.totOrbs = game.totOrbs + 4;
game.colOrbs = (game.disOrbs = 4);
onEnterFrame = function () {
for (i in shooters) {
s = shooters[i];
s._x = s._x + 5;
if (s._x > 630) {
s._x = -50;
if (s._y < 225) {
s._y = 350;
} else {
s._y = 100;
}
}
}
manageCursor();
shootCursor();
manageGame();
moveBullets();
moveItems();
};
Frame 76
initGame();
initArrays();
game.thoughtText = "There must be a faulty wire somewhere";
makeGrey(300, 225, 500, 10, 0, 0);
i = 0;
while (i < 5) {
makeBomb(random(600), random(450), 3, 2 + (Math.random() * 3), random(360));
i++;
}
meteorsReload = 0;
game.totOrbs = game.totOrbs + 1;
game.colOrbs = (game.disOrbs = 1);
onEnterFrame = function () {
if (cursor.pressed) {
if (meteorsReload > 1) {
meteorsReload = 0;
makeMeteor(100 + random(50), (Math.random() * 4) + 3, "random");
}
}
meteorsReload++;
manageCursor();
shootCursor();
manageGame();
moveBullets();
moveItems();
};
Frame 77
initGame();
initArrays();
game.thoughtText = "";
i = 0;
while (i < 8) {
makeGrey(random(600), random(450), 100 + random(50), 4, 2 + (Math.random() * 2), random(360));
makeGreen(random(600), random(450), 100 + random(5), 3, random(360));
i++;
}
game.totOrbs = game.totOrbs + 5;
game.colOrbs = (game.disOrbs = 5);
for (i in greys) {
g = greys[i];
g._alpha = 0;
}
for (i in greens) {
g = greens[i];
g._alpha = 0;
}
mainAlpha = 0;
alphaTimer = 99;
onEnterFrame = function () {
alphaTimer++;
if (mainAlpha == 0) {
if (alphaTimer > 100) {
alphaTimer = 0;
mainAlpha = 100;
}
} else if (alphaTimer > 30) {
alphaTimer = 0;
mainAlpha = 0;
}
for (i in greys) {
g = greys[i];
g._alpha = g._alpha + ((mainAlpha - g._alpha) / 10);
}
for (i in greens) {
g = greens[i];
g._alpha = g._alpha + ((mainAlpha - g._alpha) / 10);
}
manageCursor();
shootCursor();
manageGame();
moveBullets();
moveItems();
};
Frame 78
initGame();
initArrays();
game.thoughtText = "Don't forget you can slow them down";
i = 0;
while (i < 6) {
makeStone(random(600), random(450), 80 + random(40), 5, 6, random(350));
i++;
}
i = 0;
while (i < 7) {
makeRocket(42.8571428571429 + ((600 * i) / 7), 225, 0);
i++;
}
onEnterFrame = function () {
for (i in rockets) {
r = rockets[i];
if (!r.active) {
r._rotation = (57.2957795130823 * Math.atan2(cursor._y - r._y, cursor._x - r._x)) - 90;
}
}
manageCursor();
shootCursor();
manageGame();
moveBullets();
moveItems();
};
Frame 79
initGame();
initArrays();
balloons = new Array();
game.removalArray.push(balloons);
i = 0;
while (i < 5) {
makeGhost(random(600), random(450), random(10), 4, 4, random(360));
makeSpinner(random(600), random(450), random(30) - 15, 4, 4, random(360));
i++;
}
ballNumber = 0;
game.totOrbs = game.totOrbs + 4;
game.colOrbs = (game.disOrbs = 4);
onEnterFrame = function () {
if (ballNumber == 99) {
game.thoughtText = ((ballNumber + " red balloons") + newline) + "YOU WIN";
} else {
game.thoughtText = ballNumber + " red balloons";
}
manageCursor();
shootCursor();
manageGame();
moveBullets();
moveItems();
if (random(7) == 0) {
d = _root.getNextHighestDepth();
b = attachMovie("wallBalloon", "wallBalloon" + d, d);
b._x = random(600);
b._y = 500;
b.ySpeed = 3 + (Math.random() * 5);
c = random(5) + 1;
b.gotoAndStop(c);
if (c == 1) {
ballNumber++;
}
b.spinTimer = 0;
b.spinMax = (40 * Math.random()) - 20;
balloons.push(b);
}
for (i in balloons) {
b = balloons[i];
b._y = b._y - b.ySpeed;
b.ySpeed = b.ySpeed + 0.1;
b.spinTimer = b.spinTimer + 3;
b._rotation = Math.sin((Math.PI/180) * b.spinTimer) * b.spinMax;
if (b._y < -100) {
removeMovieClip(b);
ballons.splice(i, 1);
}
}
for (bi in balloons) {
b = balloons[bi];
smashCursorOn(b);
bulletProof(b);
}
};
Frame 80
initGame();
initArrays();
cursor.canShoot = false;
game.thoughtText = "You can only shoot in the white circles because I say so";
makeBlade(100, 50, 170, 4, 60);
makeBlade(500, 50, 170, 4, 50);
makeBlade(100, 400, 170, 4, 55);
makeBlade(500, 400, 170, 4, 65);
makePause(300, 225);
onEnterFrame = function () {
if (shootCircles.hitTest(cursor._x, cursor._y, true)) {
cursor.canShoot = true;
} else {
cursor.canShoot = false;
}
manageCursor();
shootCursor();
manageGame();
moveBullets();
moveItems();
};
Frame 81
function makeAsteroid(x, y, size) {
d = _root.getNextHighestDepth();
a = attachMovie("asteroid", "asteroid" + d, d);
a._x = x;
a._y = y;
a._xscale = (a._yscale = size);
a.xSpeed = (Math.random() * (size / 25)) - (size / 50);
a.ySpeed = (Math.random() * (size / 25)) - (size / 50);
a.gotoAndStop(random(4) + 1);
asteroids.push(a);
}
initGame();
initArrays();
asteroids = new Array();
game.removalArray.push(asteroids);
game.totOrbs = 20;
cursor.reloadTime = 0;
shipShoot = true;
makeAsteroid(random(600), random(450), 400);
makeAsteroid(random(600), random(450), 400);
makeAsteroid(random(600), random(450), 300);
game.thoughtText = "Enough with the retro levels!";
game.totOrbs = game.totOrbs + 4;
game.colOrbs = (game.disOrbs = 4);
onEnterFrame = function () {
for (i in asteroids) {
a = asteroids[i];
a._x = a._x + a.xSpeed;
a._y = a._y + a.ySpeed;
smashCursorOn(a);
if (a._x > (600 + (a._width / 2))) {
a._x = -(a._width / 2);
}
if (a._x < (-(a._width / 2))) {
a._x = 600 + (a._width / 2);
}
if (a._y > (450 + (a._height / 2))) {
a._y = -(a._height / 2);
}
if (a._y < (-(a._height / 2))) {
a._y = 450 + (a._height / 2);
}
for (j in bullets) {
b = bullets[j];
if (b.who == 1) {
if ((Math.pow(a._x - b._x, 2) + Math.pow(a._y - b._y, 2)) < Math.pow(a._width / 2, 2)) {
tempX = b._x;
tempY = b._y;
removeMovieClip(b);
bullets.splice(j, 1);
if (a._xscale == 100) {
makeOrb(tempX, tempY, tempX, tempY, false);
}
c = 0;
while (c < (5 + random(5))) {
shoot(tempX, tempY, random(360), 2);
c++;
}
tempX = a._x;
tempY = a._y;
tempS = a._xscale;
removeMovieClip(a);
asteroids.splice(i, 1);
if (tempS > 100) {
makeAsteroid(tempX, tempY, tempS - 100);
makeAsteroid(tempX, tempY, tempS - 100);
}
}
}
}
}
manageCursor();
shootCursor();
manageGame();
moveBullets();
moveItems();
if (cursor.pressed) {
cursor.canShoot = false;
} else {
cursor.canShoot = true;
}
};
Frame 82
initGame();
initArrays();
makeStone(random(600), random(450), 130, 5, 1.5 + (Math.random() * 2.5), random(360));
makeStone(random(600), random(450), 130, 5, 1.5 + (Math.random() * 2.5), random(360));
makeStone(random(600), random(450), 130, 5, 1.5 + (Math.random() * 2.5), random(360));
makeStone(random(600), random(450), 130, 5, 1.5 + (Math.random() * 2.5), random(360));
makeRocket(360, 225, 90);
makeRocket(240, 225, 270);
makeRocket(300, 165, 0);
makeRocket(300, 285, 180);
game.thoughtText = "POINT!";
cursorSlow._x = cursor._x;
cursorSlow._y = cursor._y;
cursorSlow._visible = false;
onEnterFrame = function () {
cursor.rotSpeed = 0;
cursorSlow._x = cursorSlow._x + ((cursor._x - cursorSlow._x) / 2);
cursorSlow._y = cursorSlow._y + ((cursor._y - cursorSlow._y) / 2);
manageCursor();
cursor._rotation = cursor._rotation - cursor.rotSpeed;
shootCursor();
manageGame();
moveBullets();
moveItems();
dY = cursor._y - cursorSlow._y;
dX = cursor._x - cursorSlow._x;
if (Math.sqrt((dY * dY) + (dX * dX)) > 1) {
cursor._rotation = (57.2957795130823 * Math.atan2(dY, dX)) + 90;
}
};
Frame 83
initGame();
initArrays();
game.thoughtText = "a=v\u00B2/r";
makeShield(random(600), random(450), 250, 6, random(360));
makeShooter(50, 50, 2, 70);
makeShooter(550, 50, 2, 70);
makeShooter(550, 400, 2, 70);
makeShooter(50, 400, 2, 70);
i = 0;
while (i < 7) {
makeGrey(random(600), random(450), 200 + random(100), 2, (Math.random() * 6) + 2, random(460));
i++;
}
i = 0;
while (i < 4) {
makeGreen(random(600), random(450), 100, random(6) + 3, random(360));
i++;
}
game.totOrbs = game.totOrbs + 3;
game.colOrbs = (game.disOrbs = 3);
onEnterFrame = function () {
moveCursor();
hideCursor();
scaleCursor();
alphaCursor();
manageBackground();
cursor.mX = cursor._x - (Math.sin((Math.PI/180) * cursor._rotation) * 11);
cursor.mY = cursor._y + (Math.cos((Math.PI/180) * cursor._rotation) * 11);
cursor._rotation = (57.2957795130823 * Math.atan2(centrePoint._y - cursor._y, centrePoint._x - cursor._x)) + 90;
if (cursor._x > 600) {
cursor._x = 600;
}
if (cursor._x < 0) {
cursor._x = 0;
}
if (cursor._y > 450) {
cursor._y = 450;
}
if (cursor._y < 0) {
cursor._y = 0;
}
shootCursor();
manageGame();
moveBullets();
moveItems();
};
Frame 84
initGame();
game.menuScreen = 85;
initArrays();
game.totOrbs = 35;
game.disOrbs = (game.colOrbs = 5);
levnum._visible = false;
game.thoughtText = "Disable him before he fires the rocket...";
phase = 0;
subPhase = 0;
subStages = 0;
cannon._x = 100;
cannon._y = 490;
timer = 0;
spheroxOrbs = 0;
cannonSwing = 0;
spheroxArmor = 100;
spheroxHealth = 3;
spherox._x = 647;
spherox._y = 60;
spherox.xSpeed = 0;
spherox.ySpeed = 0;
onEnterFrame = function () {
if (cursor.dead) {
game.menuScreen = 94;
}
if (((phase == -1) || ((phase == 5) && (subPhase == 6))) || ((phase == 5) && (subPhase == 7))) {
spherox.gotoAndStop(2);
} else {
spherox.gotoAndStop(1);
spherox.eyes._x = (4 * (cursor._x - spherox._x)) / 600;
spherox.nose._x = spherox.eyes._x / 1.5;
spherox.eyes._rotation = (5 * (cursor._x - spherox._x)) / 600;
spherox.eyes._y = -17 + ((6 * (cursor._y - spherox._y)) / 450);
spherox.eyes.eye1.pupil._x = (8 * (cursor._x - spherox._x)) / 600;
spherox.eyes.eye2.pupil._x = (8 * (cursor._x - spherox._x)) / 600;
spherox.eyes.eye1.pupil._y = (3 * (cursor._y - spherox._y)) / 600;
spherox.eyes.eye2.pupil._y = (3 * (cursor._y - spherox._y)) / 600;
spherox.nose._xscale = (cursor._x - spherox._x) / -2.5;
spherox.mouth._x = spherox.eyes._x * 1.5;
spherox.mouth._rotation = (cursor._x - spherox._x) / 60;
spherox.mouth._y = 15 + ((3 * (cursor._y - spherox._y)) / 450);
}
if (phase == -1) {
smashCursorOn(spherox);
spheroxArmor = spheroxArmor + 0.3;
if (spheroxArmor >= 100) {
spheroxArmor = 100;
phase = 1;
}
if (spheroxArmor > 90) {
spherox.xSpeed = spherox.xSpeed * 0.92;
spherox.ySpeed = spherox.ySpeed * 0.92;
}
if (spherox._xscale > 100) {
spherox._xscale--;
spherox._yscale--;
}
moveSpherox();
}
if (phase == 0) {
if ((Math.abs(spherox._x - 515) < 3) && (Math.abs(spherox._y - 141) < 3)) {
timer = 0;
phase = 6;
} else {
spherox._x = spherox._x + ((515 - spherox._x) / 10);
spherox._y = spherox._y + ((141 - spherox._y) / 10);
}
}
if (phase == 1) {
timer++;
alphaLevel = 100 * Math.abs(Math.cos((Math.PI/180) * (timer * 2)));
spherox._alpha = alphaLevel;
if (alphaLevel < 5) {
spherox._x = (cursor._x + random(20)) - 10;
spherox._y = (cursor._y + random(20)) - 10;
}
if (alphaLevel > 60) {
if (spherox.hitTest(cursor._x, cursor._y, true)) {
smashCursor();
}
}
if (timer > 210) {
if (alphaLevel > 95) {
phase = 6;
subStages++;
timer = 0;
spherox._alpha = 100;
}
}
if (bulletHitTest(spherox, true, 1)) {
spheroxArmor = spheroxArmor - 0.7;
}
if (spheroxArmor <= 0) {
timer = 0;
phase = -1;
spherox.xSpeed = (Math.random() * 10) - 5;
spherox.ySpeed = (Math.random() * 10) - 5;
spherox._alpha = 100;
spheroxArmor = 0;
}
}
if (phase == 2) {
smashCursorOn(spherox);
if ((Math.abs(spherox._x - 300) < 3) && (Math.abs(spherox._y - 225) < 3)) {
timer++;
if (timer < 90) {
if (random(2) == 0) {
r = random(360);
shoot(300 + (31 * Math.sin((Math.PI/180) * r)), 225 - (31 * Math.cos((Math.PI/180) * r)), r, random(2) + 2);
}
}
if (((timer == 120) || (timer == 135)) || (timer == 150)) {
z = 0;
while (z < 360) {
shoot(300 + (31 * Math.sin((Math.PI/180) * z)), 225 - (31 * Math.cos((Math.PI/180) * z)), z, random(2) + 2);
z = z + (random(25) + 8);
}
}
if (timer > 240) {
timer = 0;
phase = 6;
subStages++;
}
} else {
spherox._x = spherox._x + ((300 - spherox._x) / 20);
spherox._y = spherox._y + ((225 - spherox._y) / 20);
}
if (bulletHitTest(spherox, true, 1)) {
spheroxArmor = spheroxArmor - 0.7;
}
if (spheroxArmor <= 0) {
timer = 0;
phase = -1;
spherox.xSpeed = (Math.random() * 10) - 5;
spherox.ySpeed = (Math.random() * 10) - 5;
spherox._alpha = 100;
}
}
if (phase == 3) {
smashCursorOn(spherox);
if (bulletHitTest(spherox, true, 1)) {
spheroxArmor = spheroxArmor - 0.7;
}
if (spheroxArmor <= 0) {
timer = 0;
phase = -1;
spherox.xSpeed = (Math.random() * 10) - 5;
spherox.ySpeed = (Math.random() * 10) - 5;
spherox._alpha = 100;
}
if (subPhase == 0) {
if ((fallX == undefined) || (fallX < 0)) {
fallX = (Math.random() * 500) + 50;
fallSpeed = 0;
}
if ((Math.abs(spherox._x - fallX) < 6) && (Math.abs(spherox._y - 115) < 6)) {
if (Math.abs(spherox._xscale - 300) < 5) {
subPhase = 1;
} else {
spherox._xscale = spherox._xscale + ((300 - spherox._xscale) / 15);
spherox._yscale = spherox._yscale + ((300 - spherox._yscale) / 15);
}
} else {
spherox._x = spherox._x + ((fallX - spherox._x) / 35);
spherox._y = spherox._y + ((115 - spherox._y) / 35);
}
}
if (subPhase == 1) {
spherox._y = spherox._y + fallSpeed;
if (fallSpeed < 32) {
fallSpeed = fallSpeed + 0.5;
}
if (spherox._y > 540) {
spherox._y = -93;
spherox._x = (Math.random() * 500) + 50;
timer++;
if (timer > 7) {
subPhase = 2;
fallSpeed = 0;
}
}
}
if (subPhase == 2) {
if (Math.abs(spherox._y - 225) < 4) {
subPhase = 3;
} else {
spherox._y = spherox._y + ((225 - spherox._y) / 9.81);
}
}
if (subPhase == 3) {
if (Math.abs(spherox._xscale - 100) < 5) {
subPhase = 0;
phase = 6;
subStages++;
timer = 0;
fallX = -1;
} else {
spherox._xscale = spherox._xscale + ((100 - spherox._xscale) / 20);
spherox._yscale = spherox._yscale + ((100 - spherox._yscale) / 20);
}
}
}
if (phase == 4) {
smashCursorOn(spherox);
timer++;
aDif = Math.atan2(cursor._y - spherox._y, cursor._x - spherox._x) + (Math.PI/2);
spherox._x = spherox._x + (Math.sin(aDif) * 5);
spherox._y = spherox._y - (Math.cos(aDif) * 5);
if (Math.ceil(timer / 24) == (timer / 24)) {
s = -80;
while (s <= 80) {
shoot(spherox._x + (31 * Math.sin(aDif + ((s * Math.PI) / 180))), spherox._y - (31 * Math.cos(aDif + ((s * Math.PI) / 180))), (s / 3) + (57.2957795130823 * aDif), random(2) + 2);
s = s + 10;
}
}
if (timer > 192) {
phase = 6;
subStages++;
timer = 0;
subPhase = 0;
}
if (bulletHitTest(spherox, true, 1)) {
spheroxArmor = spheroxArmor - 0.7;
}
if (spheroxArmor <= 0) {
timer = 0;
phase = -1;
spherox.xSpeed = (Math.random() * 10) - 5;
spherox.ySpeed = (Math.random() * 10) - 5;
spherox._alpha = 100;
}
}
if (phase == 5) {
smashCursorOn(spherox);
if (subPhase == 0) {
cannon.barrel._rotation = 57.2957795130823 * Math.atan2(cursor._y - cannon._y, cursor._x - cannon._x);
if (cannon._y > 170) {
cannon._y = cannon._y - 3;
} else {
subPhase = 1;
}
if (bulletHitTest(spherox, true, 1)) {
spheroxArmor = spheroxArmor - 0.8;
}
if (spheroxArmor <= 0) {
spheroxArmor = 0;
subPhase = 6;
spherox.xSpeed = (Math.random() * 10) - 5;
spherox.ySpeed = (Math.random() * 10) - 5;
}
}
if (subPhase == 1) {
cannon.barrel._rotation = 57.2957795130823 * Math.atan2(cursor._y - cannon._y, cursor._x - cannon._x);
if ((Math.abs((cannon._x - 30) - spherox._x) < 7) && (Math.abs((cannon._y - 30) - spherox._y) < 7)) {
subPhase = 2;
} else {
spherox._x = spherox._x + (((cannon._x - 30) - spherox._x) / 50);
spherox._y = spherox._y + (((cannon._y - 30) - spherox._y) / 50);
}
if (bulletHitTest(spherox, true, 1)) {
spheroxArmor = spheroxArmor - 0.7;
}
if (spheroxArmor <= 0) {
spheroxArmor = 0;
subPhase = 6;
spherox.xSpeed = (Math.random() * 10) - 5;
spherox.ySpeed = (Math.random() * 10) - 5;
}
}
if (subPhase == 2) {
cannon.barrel._rotation = 57.2957795130823 * Math.atan2(cursor._y - cannon._y, cursor._x - cannon._x);
cannon.barrel.gotoAndPlay(2);
subPhase = 3;
}
if (subPhase == 3) {
cannon.barrel._rotation = 57.2957795130823 * Math.atan2(cursor._y - cannon._y, cursor._x - cannon._x);
if (cannon.barrel._currentframe == 57) {
ball._x = cannon._x + (60 * Math.sin((Math.PI/180) * (cannon.barrel._rotation + 90)));
ball._y = cannon._y - (60 * Math.cos((Math.PI/180) * (cannon.barrel._rotation + 90)));
subPhase = 4;
ball._rotation = cannon.barrel._rotation;
}
}
if (subPhase == 4) {
ball._x = ball._x + (35 * Math.sin((Math.PI/180) * (ball._rotation + 90)));
ball._y = ball._y - (35 * Math.cos((Math.PI/180) * (ball._rotation + 90)));
smashCursorOn(ball);
if ((((ball._x > 620) || (ball._x < -20)) || (ball._y > 470)) || (ball._y < -20)) {
subPhase = 5;
}
}
if (subPhase == 5) {
bulletProof(spherox);
if (cannon._y < 510) {
cannon._y = cannon._y + 3;
} else {
timer = 0;
phase = 6;
subStages = 0;
subPhase = 0;
}
if (beenHit) {
if (spheroxArmor < 100) {
spheroxArmor++;
} else {
spheroxArmor = 100;
}
}
}
if (subPhase == 6) {
if (spheroxHealth == 1) {
cannonSwing = cannonSwing + 5;
cannon.barrel._rotation = 30 * Math.sin((Math.PI/180) * cannonSwing);
}
if (spheroxHealth == 2) {
cannon.barrel._rotation = cannon.barrel._rotation + 3;
}
spheroxArmor = spheroxArmor + 0.2;
if (spheroxArmor >= 100) {
spheroxArmor = 100;
subPhase = 5;
}
if (spheroxArmor > 90) {
spherox.xSpeed = spherox.xSpeed * 0.92;
spherox.ySpeed = spherox.ySpeed * 0.92;
}
if (cannon._y > 170) {
cannon._y = cannon._y - 3;
}
moveSpherox();
if (bulletHitTest(cannon.barrel, true, 1)) {
if (cannon.barrel._currentframe == 1) {
cannon.barrel.gotoAndPlay(2);
}
}
if (cannon.barrel._currentframe == 57) {
ball._x = cannon._x + (60 * Math.sin((Math.PI/180) * (cannon.barrel._rotation + 90)));
ball._y = cannon._y - (60 * Math.cos((Math.PI/180) * (cannon.barrel._rotation + 90)));
subPhase = 7;
ball._rotation = cannon.barrel._rotation;
}
}
if (subPhase == 7) {
if (spheroxHealth == 1) {
cannonSwing = cannonSwing + 5;
cannon.barrel._rotation = 30 * Math.sin((Math.PI/180) * cannonSwing);
}
if (spheroxHealth == 2) {
cannon.barrel._rotation = cannon.barrel._rotation + 3;
}
if (cannon._y > 170) {
cannon._y = cannon._y - 3;
}
smashCursorOn(ball);
ball._x = ball._x + (35 * Math.sin((Math.PI/180) * (ball._rotation + 90)));
ball._y = ball._y - (35 * Math.cos((Math.PI/180) * (ball._rotation + 90)));
if (Math.sqrt(Math.pow(spherox._x - ball._x, 2) + Math.pow(spherox._y - ball._y, 2)) < 45) {
spheroxHealth--;
beenHit = true;
subPhase = 5;
p = 0;
while (p < 4) {
makeOrb(ball._x, ball._y, (ball._x + random(60)) - 30, (ball._y + random(60)) - 30, false);
p++;
}
p = 0;
while (p < 6) {
makeBit((ball._x + random(20)) - 10, (ball._y + random(20)) - 10, 3);
p++;
}
ball._x = -20;
ball._y = -20;
if (spheroxHealth == 0) {
phase = 7;
}
}
moveSpherox();
spheroxArmor = spheroxArmor + 0.2;
if (spheroxArmor >= 100) {
spheroxArmor = 100;
subPhase = 5;
cannon.barrel.gotoAndStop(57);
}
if (spheroxArmor > 90) {
spherox.xSpeed = spherox.xSpeed * 0.92;
spherox.ySpeed = spherox.ySpeed * 0.92;
}
}
}
if (phase == 6) {
if (subStages == 0) {
attack1 = random(4) + 1;
attack2 = random(4) + 1;
if (attack2 == attack1) {
attack2++;
if (attack2 == 5) {
attack2 = 1;
}
}
phase = attack1;
timer = 0;
subPhase = 0;
cannon.barrel.gotoAndStop(1);
cannonSwing = 0;
beenHit = false;
}
if (subStages == 1) {
phase = attack2;
timer = 0;
subPhase = 0;
}
if (subStages == 2) {
phase = 5;
timer = 0;
subPhase = 0;
}
}
if (phase == 7) {
if (cannon._y < 550) {
cannon._y = cannon._y + 6;
}
if (spheroxArmor > 0) {
spheroxArmor = spheroxArmor - 3;
} else {
spheroxArmor = 0;
}
if (spherox._xscale <= 40) {
if (spherox._xscale > 0) {
spherox._xscale = spherox._xscale - 2;
spherox._yscale = spherox._yscale - 2;
spherox._rotation = spherox._rotation + 20;
} else {
spherox._xscale = 0;
spherox._yscale = 0;
}
}
if (bulletHitTest(spherox, true, 1)) {
if (spherox._xscale > 40) {
spherox._xscale = spherox._xscale - 3;
spherox._yscale = spherox._yscale - 3;
makeBit((spherox._x + (Math.random() * 40)) - 20, (spherox._y + (Math.random() * 40)) - 20, 3);
}
if (spheroxOrbs < 18) {
makeOrb(spherox._x, spherox._y, spherox._x + (random(300) - 150), spherox._y + (random(300) - 150), false);
spheroxOrbs++;
}
}
spheroxXDif = (300 - spherox._x) / 60;
spheroxYDif = (225 - spherox._y) / 60;
spherox._x = spherox._x + spheroxXDif;
spherox._y = spherox._y + spheroxYDif;
spherox._x = spherox._x + ((Math.random() * 6) - 3);
spherox._y = spherox._y + ((Math.random() * 6) - 3);
} else {
smashCursorOn(cannon);
}
spheroxHealthBar._xscale = spheroxHealthBar._xscale + (((33.3333333333333 * spheroxHealth) - spheroxHealthBar._xscale) / 5);
armor._xscale = armor._xscale + ((spheroxArmor - armor._xscale) / 5);
manageCursor();
shootCursor();
manageGame();
moveBullets();
moveItems();
};
Frame 85
onEnterFrame = function () {
manageCursor();
squareButton(backBlue);
squareButton(moreSkill);
};
backBlue.onRelease = function () {
if (musicOn) {
buttonPress.start();
}
gotoAndStop (98);
};
moreSkill.onRelease = function () {
if (musicOn) {
buttonPress.start();
}
getURL ("http://www.bgames.com/?utm_source=sponsor_game&utm_medium=end&utm_campaign=Cursor-Attack-4", "_new");
};
Frame 86
congratsText = ("You completed the " + worldNames[worldSelect - 1]) + " World";
advanceButton.onRelease = function () {
gotoAndStop (102);
if (musicOn) {
buttonPress.start();
}
};
moreGames.onRelease = function () {
if (musicOn) {
buttonPress.start();
}
getURL ("http://www.bgames.com/?utm_source=sponsor_game&utm_medium=world&utm_campaign=Cursor-Attack-4", "_new");
};
onEnterFrame = function () {
manageCursor();
squareButton(advanceButton);
squareButton(moreGames);
};
Frame 90
if (levelSelectedWorld1 == undefined) {
levelSelectedWorld1 = 1;
}
worldSelect = 1;
if (limitLevel >= (worldSelect * 11)) {
tempLimitLevel = worldSelect * 11;
} else {
tempLimitLevel = limitLevel - ((worldSelect - 1) * 11);
}
if (levelSelectedWorld1 > tempLimitLevel) {
levelSelectedWorld1 = tempLimitLevel;
}
i = 1;
while (i <= 11) {
_root.worldOverview["levelBox" + i].boxColour.gotoAndStop(levelMedals[(i + ((worldSelect - 1) * 11)) - 1]);
tC = _root["level" + i];
if (i > tempLimitLevel) {
tC._visible = false;
}
i++;
}
i = 1;
while (i <= tempLimitLevel) {
tC = _root["level" + i];
if (i == levelSelectedWorld1) {
tC.eS = 110;
tC.endExtraY = -20;
} else {
tC.eS = 100;
tC.endExtraY = 0;
}
tC._xscale = tC.eS;
tC._yscale = tC.eS;
tC.extraY = tC.endExtraY;
tC._x = (300 - (120 * (levelSelectedWorld1 - 1))) + ((i - 1) * 120);
tC.endX = tC._x;
tC._y = tC.extraY + (((0.00022222 * Math.pow(tC._x, 2)) - (0.1333 * tC._x)) + 220);
tC._rotation = (tC._x - 300) / 50;
tC._alpha = 100 - (Math.abs(tC._x - 300) * 0.5);
tC.levelText = "Level " + i;
tC.colour.gotoAndStop(i);
tC.stick.gotoAndStop(i);
tC.levelNumber = i + ((worldSelect - 1) * 11);
tC.i = i;
if (levelScores[tC.levelNumber - 1] == 0) {
tC.levelTick._visible = false;
tC.erase._visible = false;
}
tC.erase.onRelease = function () {
if (levelSelectedWorld1 == this._parent.i) {
levelScores[this._parent.levelNumber - 1] = 0;
this._parent.levelTick._visible = false;
this._parent.erase._visible = false;
}
};
tC.colour.onRelease = function () {
if (levelSelectedWorld1 == this._parent.i) {
levelSelect = this._parent.levelNumber;
gotoAndStop(this._parent.levelNumber + 29);
}
};
i++;
}
rightArrow.onRelease = function () {
moveLevelsRight();
};
leftArrow.onRelease = function () {
moveLevelsLeft();
};
worldOverview._y = worldOverviewY;
world1Title.onRelease = function () {
if (worldOverviewY == -10) {
worldOverviewY = 10;
} else {
worldOverviewY = -10;
}
};
back.onRelease = function () {
if (musicOn) {
backSound.start();
}
if (menuType == 1) {
gotoAndStop (102);
} else {
gotoAndStop (97);
}
};
changeCursor.onRelease = function () {
if (musicOn) {
optionChange.start();
}
if (pointerFrame < 5) {
pointerFrame++;
} else {
pointerFrame = 1;
}
cursor.gotoAndStop(pointerFrame);
saveGame();
};
muteButtonCircle.onRelease = function () {
if (musicOn == 1) {
musicOn = 0;
aquaticVoyage.stop();
muteButtonCircle.gotoAndStop(2);
} else {
musicOn = 1;
aquaticVoyage.start(0, 999);
muteButtonCircle.gotoAndStop(1);
}
saveGame();
};
if (musicOn) {
muteButtonCircle.gotoAndStop(1);
} else {
muteButtonCircle.gotoAndStop(2);
}
autoTipsButton.onRelease = function () {
if (autoTips) {
autoTips = false;
autoTipsButton.gotoAndStop(2);
} else {
autoTips = true;
autoTipsButton.gotoAndStop(1);
}
if (musicOn) {
optionChange.start();
}
};
if (autoTips) {
autoTipsButton.gotoAndStop(1);
} else {
autoTipsButton.gotoAndStop(2);
}
saveGame();
onEnterFrame = function () {
i = 1;
while (i <= tempLimitLevel) {
tC = _root["level" + i];
tC.endX = (300 - (120 * (levelSelectedWorld1 - 1))) + ((i - 1) * 120);
tC._x = tC._x + ((tC.endX - tC._x) / 4);
tC._y = tC.extraY + (((0.00022222 * Math.pow(tC._x, 2)) - (0.1333 * tC._x)) + 220);
tC._rotation = (tC._x - 300) / 50;
tC._xscale = tC._xscale + ((tC.eS - tC._xscale) / 4);
tC._yscale = tC._yscale + ((tC.eS - tC._yscale) / 4);
tC.extraY = tC.extraY + ((tC.endExtraY - tC.extraY) / 4);
if (i == levelSelectedWorld1) {
tC.eS = 110;
tC.endExtraY = -20;
if (tC.colour.hitTest(cursor._x, cursor._y, true)) {
tC.gotoAndStop(2);
} else {
tC.gotoAndStop(1);
}
} else {
tC.eS = 100;
tC.endExtraY = 0;
tC.gotoAndStop(1);
}
tC._alpha = 100 - (Math.abs(tC._x - 300) * 0.5);
tC.erase._alpha = 100 - (Math.abs(tC._x - 300) * 0.8);
if (tC._alpha <= 0) {
tC._visible = false;
} else {
tC._visible = true;
}
i++;
}
base.levelDescription = (("Level " + (levelSelectedWorld1 + ((worldSelect - 1) * 11))) + ": ") + levelNames[(levelSelectedWorld1 + ((worldSelect - 1) * 11)) - 1];
base.bestTime = "Best Time - " + framesToTime(levelTimes[(levelSelectedWorld1 + ((worldSelect - 1) * 11)) - 1]);
base.bestScore = "Score - " + levelScores[(levelSelectedWorld1 + ((worldSelect - 1) * 11)) - 1];
base.bestOrbs = ("Orbs - " + levelOrbs[(levelSelectedWorld1 + ((worldSelect - 1) * 11)) - 1]) + "%";
base.medal.gotoAndStop(levelMedals[(levelSelectedWorld1 + ((worldSelect - 1) * 11)) - 1]);
squareButton(rightArrow);
squareButton(leftArrow);
squareButton(back);
squareButton(muteButtonCircle);
squareButton(changeCursor);
squareButton(autoTipsButton);
manageCursor();
worldOverview._y = worldOverview._y + ((worldOverviewY - worldOverview._y) / 3);
if (aKeyDown == undefined) {
aKeyDown = false;
dKeyDown = false;
lKeyDown = false;
rKeyDown = false;
}
if (Key.isDown(65)) {
if (!aKeyDown) {
aKeyDown = true;
moveLevelsLeft();
}
} else {
aKeyDown = false;
}
if (Key.isDown(37)) {
if (!lKeyDown) {
lKeyDown = true;
moveLevelsLeft();
}
} else {
lKeyDown = false;
}
if (Key.isDown(68)) {
if (!dKeyDown) {
dKeyDown = true;
moveLevelsRight();
}
} else {
dKeyDown = false;
}
if (Key.isDown(39)) {
if (!rKeyDown) {
rKeyDown = true;
moveLevelsRight();
}
} else {
rKeyDown = false;
}
};
Frame 91
saveGame();
changeCursor.onRelease = function () {
if (musicOn) {
optionChange.start();
}
if (pointerFrame < 5) {
pointerFrame++;
} else {
pointerFrame = 1;
}
cursor.gotoAndStop(pointerFrame);
saveGame();
};
muteButtonCircle.onRelease = function () {
if (musicOn == 1) {
musicOn = 0;
aquaticVoyage.stop();
muteButtonCircle.gotoAndStop(2);
} else {
musicOn = 1;
aquaticVoyage.start(0, 999);
muteButtonCircle.gotoAndStop(1);
}
saveGame();
};
if (musicOn) {
muteButtonCircle.gotoAndStop(1);
} else {
muteButtonCircle.gotoAndStop(2);
}
if (levelSelectedWorld2 == undefined) {
levelSelectedWorld2 = 1;
}
autoTipsButton.onRelease = function () {
if (autoTips) {
autoTips = false;
autoTipsButton.gotoAndStop(2);
} else {
autoTips = true;
autoTipsButton.gotoAndStop(1);
}
if (musicOn) {
optionChange.start();
}
};
if (autoTips) {
autoTipsButton.gotoAndStop(1);
} else {
autoTipsButton.gotoAndStop(2);
}
worldSelect = 2;
if (limitLevel >= (worldSelect * 11)) {
tempLimitLevel = 11;
} else {
tempLimitLevel = limitLevel - ((worldSelect - 1) * 11);
}
if (levelSelectedWorld2 > tempLimitLevel) {
levelSelectedWorld2 = tempLimitLevel;
}
if (tempLimitLevel == 11) {
levelCompleteCheck = 0;
i = (worldSelect - 1) * 11;
while (i < ((worldSelect * 11) - 1)) {
if (levelOrbs[i] > 0) {
levelCompleteCheck++;
}
i++;
}
if (levelCompleteCheck != 10) {
tempLimitLevel = 10;
}
}
i = 1;
while (i <= 11) {
_root.worldOverview["levelBox" + i].boxColour.gotoAndStop(levelMedals[(i + ((worldSelect - 1) * 11)) - 1]);
tC = _root["level" + i];
if (i > tempLimitLevel) {
tC._visible = false;
}
i++;
}
i = 1;
while (i <= tempLimitLevel) {
tC = _root["level" + i];
if (i == levelSelectedWorld2) {
tC.eS = 110;
tC.endExtraY = -20;
} else {
tC.eS = 100;
tC.endExtraY = 0;
}
tC._xscale = tC.eS;
tC._yscale = tC.eS;
tC.extraY = tC.endExtraY;
tC._x = (300 - (120 * (levelSelectedWorld2 - 1))) + ((i - 1) * 120);
tC.endX = tC._x;
tC._y = tC.extraY + (((0.00022222 * Math.pow(tC._x, 2)) - (0.1333 * tC._x)) + 220);
tC._rotation = (tC._x - 300) / 50;
tC._alpha = 100 - (Math.abs(tC._x - 300) * 0.5);
tC.levelNumber = i + ((worldSelect - 1) * 11);
tC.levelText = "Level " + tC.levelNumber;
tC.colour.gotoAndStop(12 - i);
tC.stick.gotoAndStop(12 - i);
tC.i = i;
if (levelScores[tC.levelNumber - 1] == 0) {
tC.levelTick._visible = false;
tC.erase._visible = false;
}
tC.erase.onRelease = function () {
if (levelSelectedWorld2 == this._parent.i) {
levelScores[this._parent.levelNumber - 1] = 0;
this._parent.levelTick._visible = false;
this._parent.erase._visible = false;
}
};
tC.colour.onRelease = function () {
if (levelSelectedWorld2 == this._parent.i) {
levelSelect = this._parent.levelNumber;
gotoAndStop(this._parent.levelNumber + 29);
}
};
i++;
}
rightArrow.onRelease = function () {
if (musicOn) {
switchOn.start();
}
levelSelectedWorld2++;
if (levelSelectedWorld2 > tempLimitLevel) {
levelSelectedWorld2 = 1;
i = 1;
while (i <= tempLimitLevel) {
tC = _root["level" + i];
if (i == levelSelectedWorld2) {
tC.eS = 110;
tC.endExtraY = -20;
} else {
tC.eS = 100;
tC.endExtraY = 0;
}
tC._xscale = tC.eS;
tC._yscale = tC.eS;
tC.extraY = tC.endExtraY;
tC.endX = (300 - (120 * (levelSelectedWorld2 - 1))) + ((i - 1) * 120);
tC._x = tC.endX;
tC._y = tC.extraY + (((0.00022222 * Math.pow(tC._x, 2)) - (0.1333 * tC._x)) + 220);
tC._rotation = (tC._x - 300) / 50;
tC._alpha = 100 - (Math.abs(tC._x - 300) * 0.5);
if (tC._alpha <= 0) {
tC._visible = false;
} else {
tC._visible = true;
}
i++;
}
}
};
leftArrow.onRelease = function () {
if (musicOn) {
switchOn.start();
}
levelSelectedWorld2--;
if (levelSelectedWorld2 < 1) {
levelSelectedWorld2 = tempLimitLevel;
i = 1;
while (i <= tempLimitLevel) {
tC = _root["level" + i];
if (i == levelSelectedWorld2) {
tC.eS = 110;
tC.endExtraY = -20;
} else {
tC.eS = 100;
tC.endExtraY = 0;
}
tC._xscale = tC.eS;
tC._yscale = tC.eS;
tC.extraY = tC.endExtraY;
tC.endX = (300 - (120 * (levelSelectedWorld2 - 1))) + ((i - 1) * 120);
tC._x = tC.endX;
tC._y = tC.extraY + (((0.00022222 * Math.pow(tC._x, 2)) - (0.1333 * tC._x)) + 220);
tC._rotation = (tC._x - 300) / 50;
tC._alpha = 100 - (Math.abs(tC._x - 300) * 0.5);
if (tC._alpha <= 0) {
tC._visible = false;
} else {
tC._visible = true;
}
i++;
}
}
};
worldOverview._y = worldOverviewY;
world2Title.onRelease = function () {
if (worldOverviewY == -10) {
worldOverviewY = 10;
} else {
worldOverviewY = -10;
}
};
back.onRelease = function () {
if (musicOn) {
backSound.start();
}
if (menuType == 1) {
gotoAndStop (102);
} else {
gotoAndStop (97);
}
};
onEnterFrame = function () {
i = 1;
while (i <= tempLimitLevel) {
tC = _root["level" + i];
tC.endX = (300 - (120 * (levelSelectedWorld2 - 1))) + ((i - 1) * 120);
tC._x = tC._x + ((tC.endX - tC._x) / 4);
tC._y = tC.extraY + (((0.00022222 * Math.pow(tC._x, 2)) - (0.1333 * tC._x)) + 220);
tC._rotation = (tC._x - 300) / 50;
tC._xscale = tC._xscale + ((tC.eS - tC._xscale) / 4);
tC._yscale = tC._yscale + ((tC.eS - tC._yscale) / 4);
tC.extraY = tC.extraY + ((tC.endExtraY - tC.extraY) / 4);
if (i == levelSelectedWorld2) {
tC.eS = 110;
tC.endExtraY = -20;
if (tC.colour.hitTest(cursor._x, cursor._y, true)) {
tC.gotoAndStop(2);
} else {
tC.gotoAndStop(1);
}
} else {
tC.eS = 100;
tC.endExtraY = 0;
tC.gotoAndStop(1);
}
tC._alpha = 100 - (Math.abs(tC._x - 300) * 0.5);
tC.erase._alpha = 100 - (Math.abs(tC._x - 300) * 0.8);
if (tC._alpha <= 0) {
tC._visible = false;
} else {
tC._visible = true;
}
i++;
}
tempLevNum = levelSelectedWorld2 + ((worldSelect - 1) * 11);
base.levelDescription = (("Level " + tempLevNum) + ": ") + levelNames[tempLevNum - 1];
base.bestTime = "Best Time - " + framesToTime(levelTimes[tempLevNum - 1]);
base.bestScore = "Score - " + levelScores[tempLevNum - 1];
base.bestOrbs = ("Orbs - " + levelOrbs[tempLevNum - 1]) + "%";
base.medal.gotoAndStop(levelMedals[tempLevNum - 1]);
squareButton(rightArrow);
squareButton(leftArrow);
squareButton(back);
squareButton(muteButtonCircle);
squareButton(changeCursor);
squareButton(autoTipsButton);
manageCursor();
worldOverview._y = worldOverview._y + ((worldOverviewY - worldOverview._y) / 3);
if (aKeyDown == undefined) {
aKeyDown = false;
dKeyDown = false;
lKeyDown = false;
rKeyDown = false;
}
if (Key.isDown(65)) {
if (!aKeyDown) {
aKeyDown = true;
if (musicOn) {
switchOn.start();
}
levelSelectedWorld2--;
if (levelSelectedWorld2 < 1) {
levelSelectedWorld2 = tempLimitLevel;
i = 1;
while (i <= tempLimitLevel) {
tC = _root["level" + i];
if (i == levelSelectedWorld2) {
tC.eS = 110;
tC.endExtraY = -20;
} else {
tC.eS = 100;
tC.endExtraY = 0;
}
tC._xscale = tC.eS;
tC._yscale = tC.eS;
tC.extraY = tC.endExtraY;
tC.endX = (300 - (120 * (levelSelectedWorld2 - 1))) + ((i - 1) * 120);
tC._x = tC.endX;
tC._y = tC.extraY + (((0.00022222 * Math.pow(tC._x, 2)) - (0.1333 * tC._x)) + 220);
tC._rotation = (tC._x - 300) / 50;
tC._alpha = 100 - (Math.abs(tC._x - 300) * 0.5);
if (tC._alpha <= 0) {
tC._visible = false;
} else {
tC._visible = true;
}
i++;
}
}
}
} else {
aKeyDown = false;
}
if (Key.isDown(37)) {
if (!lKeyDown) {
lKeyDown = true;
if (musicOn) {
switchOn.start();
}
levelSelectedWorld2--;
if (levelSelectedWorld2 < 1) {
levelSelectedWorld2 = tempLimitLevel;
i = 1;
while (i <= tempLimitLevel) {
tC = _root["level" + i];
if (i == levelSelectedWorld2) {
tC.eS = 110;
tC.endExtraY = -20;
} else {
tC.eS = 100;
tC.endExtraY = 0;
}
tC._xscale = tC.eS;
tC._yscale = tC.eS;
tC.extraY = tC.endExtraY;
tC.endX = (300 - (120 * (levelSelectedWorld2 - 1))) + ((i - 1) * 120);
tC._x = tC.endX;
tC._y = tC.extraY + (((0.00022222 * Math.pow(tC._x, 2)) - (0.1333 * tC._x)) + 220);
tC._rotation = (tC._x - 300) / 50;
tC._alpha = 100 - (Math.abs(tC._x - 300) * 0.5);
if (tC._alpha <= 0) {
tC._visible = false;
} else {
tC._visible = true;
}
i++;
}
}
}
} else {
lKeyDown = false;
}
if (Key.isDown(68)) {
if (!dKeyDown) {
dKeyDown = true;
if (musicOn) {
switchOn.start();
}
levelSelectedWorld2++;
if (levelSelectedWorld2 > tempLimitLevel) {
levelSelectedWorld2 = 1;
i = 1;
while (i <= tempLimitLevel) {
tC = _root["level" + i];
if (i == levelSelectedWorld2) {
tC.eS = 110;
tC.endExtraY = -20;
} else {
tC.eS = 100;
tC.endExtraY = 0;
}
tC._xscale = tC.eS;
tC._yscale = tC.eS;
tC.extraY = tC.endExtraY;
tC.endX = (300 - (120 * (levelSelectedWorld2 - 1))) + ((i - 1) * 120);
tC._x = tC.endX;
tC._y = tC.extraY + (((0.00022222 * Math.pow(tC._x, 2)) - (0.1333 * tC._x)) + 220);
tC._rotation = (tC._x - 300) / 50;
tC._alpha = 100 - (Math.abs(tC._x - 300) * 0.5);
if (tC._alpha <= 0) {
tC._visible = false;
} else {
tC._visible = true;
}
i++;
}
}
}
} else {
dKeyDown = false;
}
if (Key.isDown(39)) {
if (!rKeyDown) {
rKeyDown = true;
if (musicOn) {
switchOn.start();
}
levelSelectedWorld2++;
if (levelSelectedWorld2 > tempLimitLevel) {
levelSelectedWorld2 = 1;
i = 1;
while (i <= tempLimitLevel) {
tC = _root["level" + i];
if (i == levelSelectedWorld2) {
tC.eS = 110;
tC.endExtraY = -20;
} else {
tC.eS = 100;
tC.endExtraY = 0;
}
tC._xscale = tC.eS;
tC._yscale = tC.eS;
tC.extraY = tC.endExtraY;
tC.endX = (300 - (120 * (levelSelectedWorld2 - 1))) + ((i - 1) * 120);
tC._x = tC.endX;
tC._y = tC.extraY + (((0.00022222 * Math.pow(tC._x, 2)) - (0.1333 * tC._x)) + 220);
tC._rotation = (tC._x - 300) / 50;
tC._alpha = 100 - (Math.abs(tC._x - 300) * 0.5);
if (tC._alpha <= 0) {
tC._visible = false;
} else {
tC._visible = true;
}
i++;
}
}
}
} else {
rKeyDown = false;
}
};
Frame 92
saveGame();
changeCursor.onRelease = function () {
if (musicOn) {
optionChange.start();
}
if (pointerFrame < 5) {
pointerFrame++;
} else {
pointerFrame = 1;
}
cursor.gotoAndStop(pointerFrame);
saveGame();
};
muteButtonCircle.onRelease = function () {
if (musicOn == 1) {
musicOn = 0;
aquaticVoyage.stop();
muteButtonCircle.gotoAndStop(2);
} else {
musicOn = 1;
aquaticVoyage.start(0, 999);
muteButtonCircle.gotoAndStop(1);
}
saveGame();
};
if (musicOn) {
muteButtonCircle.gotoAndStop(1);
} else {
muteButtonCircle.gotoAndStop(2);
}
autoTipsButton.onRelease = function () {
if (autoTips) {
autoTips = false;
autoTipsButton.gotoAndStop(2);
} else {
autoTips = true;
autoTipsButton.gotoAndStop(1);
}
if (musicOn) {
optionChange.start();
}
};
if (autoTips) {
autoTipsButton.gotoAndStop(1);
} else {
autoTipsButton.gotoAndStop(2);
}
l3colours = new Array(9, 11, 2, 4, 3, 5, 6, 1, 10, 8, 7);
if (levelSelectedWorld3 == undefined) {
levelSelectedWorld3 = 1;
}
worldSelect = 3;
if (limitLevel >= (worldSelect * 11)) {
tempLimitLevel = 11;
} else {
tempLimitLevel = limitLevel - ((worldSelect - 1) * 11);
}
if (levelSelectedWorld3 > tempLimitLevel) {
levelSelectedWorld3 = tempLimitLevel;
}
if (tempLimitLevel == 11) {
levelCompleteCheck = 0;
i = (worldSelect - 1) * 11;
while (i < ((worldSelect * 11) - 1)) {
if (levelOrbs[i] > 0) {
levelCompleteCheck++;
}
i++;
}
if (levelCompleteCheck != 10) {
tempLimitLevel = 10;
}
}
i = 1;
while (i <= 11) {
_root.worldOverview["levelBox" + i].boxColour.gotoAndStop(levelMedals[(i + ((worldSelect - 1) * 11)) - 1]);
tC = _root["level" + i];
if (i > tempLimitLevel) {
tC._visible = false;
}
i++;
}
i = 1;
while (i <= tempLimitLevel) {
tC = _root["level" + i];
if (i == levelSelectedWorld3) {
tC.eS = 110;
tC.endExtraY = -20;
} else {
tC.eS = 100;
tC.endExtraY = 0;
}
tC._xscale = tC.eS;
tC._yscale = tC.eS;
tC.extraY = tC.endExtraY;
tC._x = (300 - (120 * (levelSelectedWorld3 - 1))) + ((i - 1) * 120);
tC.endX = tC._x;
tC._y = tC.extraY + (((0.00022222 * Math.pow(tC._x, 2)) - (0.1333 * tC._x)) + 220);
tC._rotation = (tC._x - 300) / 50;
tC._alpha = 100 - (Math.abs(tC._x - 300) * 0.5);
tC.levelNumber = i + ((worldSelect - 1) * 11);
tC.levelText = "Level " + tC.levelNumber;
tC.colour.gotoAndStop(l3colours[i - 1]);
tC.stick.gotoAndStop(tC.colour._currentframe);
tC.i = i;
if (levelScores[tC.levelNumber - 1] == 0) {
tC.levelTick._visible = false;
tC.erase._visible = false;
}
tC.erase.onRelease = function () {
if (levelSelectedWorld3 == this._parent.i) {
levelScores[this._parent.levelNumber - 1] = 0;
this._parent.levelTick._visible = false;
this._parent.erase._visible = false;
}
};
tC.colour.onRelease = function () {
if (levelSelectedWorld3 == this._parent.i) {
levelSelect = this._parent.levelNumber;
gotoAndStop(this._parent.levelNumber + 29);
}
};
i++;
}
rightArrow.onRelease = function () {
if (musicOn) {
switchOn.start();
}
levelSelectedWorld3++;
if (levelSelectedWorld3 > tempLimitLevel) {
levelSelectedWorld3 = 1;
i = 1;
while (i <= tempLimitLevel) {
tC = _root["level" + i];
if (i == levelSelectedWorld3) {
tC.eS = 110;
tC.endExtraY = -20;
} else {
tC.eS = 100;
tC.endExtraY = 0;
}
tC._xscale = tC.eS;
tC._yscale = tC.eS;
tC.extraY = tC.endExtraY;
tC.endX = (300 - (120 * (levelSelectedWorld3 - 1))) + ((i - 1) * 120);
tC._x = tC.endX;
tC._y = tC.extraY + (((0.00022222 * Math.pow(tC._x, 2)) - (0.1333 * tC._x)) + 220);
tC._rotation = (tC._x - 300) / 50;
tC._alpha = 100 - (Math.abs(tC._x - 300) * 0.5);
if (tC._alpha <= 0) {
tC._visible = false;
} else {
tC._visible = true;
}
i++;
}
}
};
leftArrow.onRelease = function () {
if (musicOn) {
switchOn.start();
}
levelSelectedWorld3--;
if (levelSelectedWorld3 < 1) {
levelSelectedWorld3 = tempLimitLevel;
i = 1;
while (i <= tempLimitLevel) {
tC = _root["level" + i];
if (i == levelSelectedWorld3) {
tC.eS = 110;
tC.endExtraY = -20;
} else {
tC.eS = 100;
tC.endExtraY = 0;
}
tC._xscale = tC.eS;
tC._yscale = tC.eS;
tC.extraY = tC.endExtraY;
tC.endX = (300 - (120 * (levelSelectedWorld3 - 1))) + ((i - 1) * 120);
tC._x = tC.endX;
tC._y = tC.extraY + (((0.00022222 * Math.pow(tC._x, 2)) - (0.1333 * tC._x)) + 220);
tC._rotation = (tC._x - 300) / 50;
tC._alpha = 100 - (Math.abs(tC._x - 300) * 0.5);
if (tC._alpha <= 0) {
tC._visible = false;
} else {
tC._visible = true;
}
i++;
}
}
};
worldOverview._y = worldOverviewY;
world3Title.onRelease = function () {
if (worldOverviewY == -10) {
worldOverviewY = 10;
} else {
worldOverviewY = -10;
}
};
back.onRelease = function () {
if (musicOn) {
backSound.start();
}
if (menuType == 1) {
gotoAndStop (102);
} else {
gotoAndStop (97);
}
};
onEnterFrame = function () {
i = 1;
while (i <= tempLimitLevel) {
tC = _root["level" + i];
tC.endX = (300 - (120 * (levelSelectedWorld3 - 1))) + ((i - 1) * 120);
tC._x = tC._x + ((tC.endX - tC._x) / 4);
tC._y = tC.extraY + (((0.00022222 * Math.pow(tC._x, 2)) - (0.1333 * tC._x)) + 220);
tC._rotation = (tC._x - 300) / 50;
tC._xscale = tC._xscale + ((tC.eS - tC._xscale) / 4);
tC._yscale = tC._yscale + ((tC.eS - tC._yscale) / 4);
tC.extraY = tC.extraY + ((tC.endExtraY - tC.extraY) / 4);
if (i == levelSelectedWorld3) {
tC.eS = 110;
tC.endExtraY = -20;
if (tC.colour.hitTest(cursor._x, cursor._y, true)) {
tC.gotoAndStop(2);
} else {
tC.gotoAndStop(1);
}
} else {
tC.eS = 100;
tC.endExtraY = 0;
tC.gotoAndStop(1);
}
tC._alpha = 100 - (Math.abs(tC._x - 300) * 0.5);
tC.erase._alpha = 100 - (Math.abs(tC._x - 300) * 0.8);
if (tC._alpha <= 0) {
tC._visible = false;
} else {
tC._visible = true;
}
i++;
}
base.levelDescription = (("Level " + (levelSelectedWorld3 + ((worldSelect - 1) * 11))) + ": ") + levelNames[(levelSelectedWorld3 + ((worldSelect - 1) * 11)) - 1];
base.bestTime = "Best Time - " + framesToTime(levelTimes[(levelSelectedWorld3 + ((worldSelect - 1) * 11)) - 1]);
base.bestScore = "Score - " + levelScores[(levelSelectedWorld3 + ((worldSelect - 1) * 11)) - 1];
base.bestOrbs = ("Orbs - " + levelOrbs[(levelSelectedWorld3 + ((worldSelect - 1) * 11)) - 1]) + "%";
base.medal.gotoAndStop(levelMedals[(levelSelectedWorld3 + ((worldSelect - 1) * 11)) - 1]);
squareButton(rightArrow);
squareButton(leftArrow);
squareButton(back);
squareButton(muteButtonCircle);
squareButton(changeCursor);
squareButton(autoTipsButton);
manageCursor();
worldOverview._y = worldOverview._y + ((worldOverviewY - worldOverview._y) / 3);
if (aKeyDown == undefined) {
aKeyDown = false;
dKeyDown = false;
lKeyDown = false;
rKeyDown = false;
}
if (Key.isDown(65)) {
if (!aKeyDown) {
aKeyDown = true;
if (musicOn) {
switchOn.start();
}
levelSelectedWorld3--;
if (levelSelectedWorld3 < 1) {
levelSelectedWorld3 = tempLimitLevel;
i = 1;
while (i <= tempLimitLevel) {
tC = _root["level" + i];
if (i == levelSelectedWorld3) {
tC.eS = 110;
tC.endExtraY = -20;
} else {
tC.eS = 100;
tC.endExtraY = 0;
}
tC._xscale = tC.eS;
tC._yscale = tC.eS;
tC.extraY = tC.endExtraY;
tC.endX = (300 - (120 * (levelSelectedWorld3 - 1))) + ((i - 1) * 120);
tC._x = tC.endX;
tC._y = tC.extraY + (((0.00022222 * Math.pow(tC._x, 2)) - (0.1333 * tC._x)) + 220);
tC._rotation = (tC._x - 300) / 50;
tC._alpha = 100 - (Math.abs(tC._x - 300) * 0.5);
if (tC._alpha <= 0) {
tC._visible = false;
} else {
tC._visible = true;
}
i++;
}
}
}
} else {
aKeyDown = false;
}
if (Key.isDown(37)) {
if (!lKeyDown) {
lKeyDown = true;
if (musicOn) {
switchOn.start();
}
levelSelectedWorld3--;
if (levelSelectedWorld3 < 1) {
levelSelectedWorld3 = tempLimitLevel;
i = 1;
while (i <= tempLimitLevel) {
tC = _root["level" + i];
if (i == levelSelectedWorld3) {
tC.eS = 110;
tC.endExtraY = -20;
} else {
tC.eS = 100;
tC.endExtraY = 0;
}
tC._xscale = tC.eS;
tC._yscale = tC.eS;
tC.extraY = tC.endExtraY;
tC.endX = (300 - (120 * (levelSelectedWorld3 - 1))) + ((i - 1) * 120);
tC._x = tC.endX;
tC._y = tC.extraY + (((0.00022222 * Math.pow(tC._x, 2)) - (0.1333 * tC._x)) + 220);
tC._rotation = (tC._x - 300) / 50;
tC._alpha = 100 - (Math.abs(tC._x - 300) * 0.5);
if (tC._alpha <= 0) {
tC._visible = false;
} else {
tC._visible = true;
}
i++;
}
}
}
} else {
lKeyDown = false;
}
if (Key.isDown(68)) {
if (!dKeyDown) {
dKeyDown = true;
if (musicOn) {
switchOn.start();
}
levelSelectedWorld3++;
if (levelSelectedWorld3 > tempLimitLevel) {
levelSelectedWorld3 = 1;
i = 1;
while (i <= tempLimitLevel) {
tC = _root["level" + i];
if (i == levelSelectedWorld3) {
tC.eS = 110;
tC.endExtraY = -20;
} else {
tC.eS = 100;
tC.endExtraY = 0;
}
tC._xscale = tC.eS;
tC._yscale = tC.eS;
tC.extraY = tC.endExtraY;
tC.endX = (300 - (120 * (levelSelectedWorld3 - 1))) + ((i - 1) * 120);
tC._x = tC.endX;
tC._y = tC.extraY + (((0.00022222 * Math.pow(tC._x, 2)) - (0.1333 * tC._x)) + 220);
tC._rotation = (tC._x - 300) / 50;
tC._alpha = 100 - (Math.abs(tC._x - 300) * 0.5);
if (tC._alpha <= 0) {
tC._visible = false;
} else {
tC._visible = true;
}
i++;
}
}
}
} else {
dKeyDown = false;
}
if (Key.isDown(39)) {
if (!rKeyDown) {
rKeyDown = true;
if (musicOn) {
switchOn.start();
}
levelSelectedWorld3++;
if (levelSelectedWorld3 > tempLimitLevel) {
levelSelectedWorld3 = 1;
i = 1;
while (i <= tempLimitLevel) {
tC = _root["level" + i];
if (i == levelSelectedWorld3) {
tC.eS = 110;
tC.endExtraY = -20;
} else {
tC.eS = 100;
tC.endExtraY = 0;
}
tC._xscale = tC.eS;
tC._yscale = tC.eS;
tC.extraY = tC.endExtraY;
tC.endX = (300 - (120 * (levelSelectedWorld3 - 1))) + ((i - 1) * 120);
tC._x = tC.endX;
tC._y = tC.extraY + (((0.00022222 * Math.pow(tC._x, 2)) - (0.1333 * tC._x)) + 220);
tC._rotation = (tC._x - 300) / 50;
tC._alpha = 100 - (Math.abs(tC._x - 300) * 0.5);
if (tC._alpha <= 0) {
tC._visible = false;
} else {
tC._visible = true;
}
i++;
}
}
}
} else {
rKeyDown = false;
}
};
Frame 93
saveGame();
changeCursor.onRelease = function () {
if (musicOn) {
optionChange.start();
}
if (pointerFrame < 5) {
pointerFrame++;
} else {
pointerFrame = 1;
}
cursor.gotoAndStop(pointerFrame);
saveGame();
};
muteButtonCircle.onRelease = function () {
if (musicOn == 1) {
musicOn = 0;
aquaticVoyage.stop();
muteButtonCircle.gotoAndStop(2);
} else {
musicOn = 1;
aquaticVoyage.start(0, 999);
muteButtonCircle.gotoAndStop(1);
}
saveGame();
};
if (musicOn) {
muteButtonCircle.gotoAndStop(1);
} else {
muteButtonCircle.gotoAndStop(2);
}
autoTipsButton.onRelease = function () {
if (autoTips) {
autoTips = false;
autoTipsButton.gotoAndStop(2);
} else {
autoTips = true;
autoTipsButton.gotoAndStop(1);
}
if (musicOn) {
optionChange.start();
}
};
if (autoTips) {
autoTipsButton.gotoAndStop(1);
} else {
autoTipsButton.gotoAndStop(2);
}
if (levelSelectedWorld4 == undefined) {
levelSelectedWorld4 = 1;
}
worldSelect = 4;
l4colours = new Array(7, 2, 6, 10, 9, 8, 4, 3, 5, 1, 11);
if (limitLevel >= (worldSelect * 11)) {
tempLimitLevel = 11;
} else {
tempLimitLevel = limitLevel - ((worldSelect - 1) * 11);
}
if (levelSelectedWorld4 > tempLimitLevel) {
levelSelectedWorld4 = tempLimitLevel;
}
if (tempLimitLevel == 11) {
levelCompleteCheck = 0;
i = (worldSelect - 1) * 11;
while (i < ((worldSelect * 11) - 1)) {
if (levelOrbs[i] > 0) {
levelCompleteCheck++;
}
i++;
}
if (levelCompleteCheck != 10) {
tempLimitLevel = 10;
}
}
i = 1;
while (i <= 11) {
_root.worldOverview["levelBox" + i].boxColour.gotoAndStop(levelMedals[(i + ((worldSelect - 1) * 11)) - 1]);
tC = _root["level" + i];
if (i > tempLimitLevel) {
tC._visible = false;
}
i++;
}
i = 1;
while (i <= tempLimitLevel) {
tC = _root["level" + i];
if (i == levelSelectedWorld4) {
tC.eS = 110;
tC.endExtraY = -20;
} else {
tC.eS = 100;
tC.endExtraY = 0;
}
tC._xscale = tC.eS;
tC._yscale = tC.eS;
tC.extraY = tC.endExtraY;
tC._x = (300 - (120 * (levelSelectedWorld4 - 1))) + ((i - 1) * 120);
tC.endX = tC._x;
tC._y = tC.extraY + (((0.00022222 * Math.pow(tC._x, 2)) - (0.1333 * tC._x)) + 220);
tC._rotation = (tC._x - 300) / 50;
tC._alpha = 100 - (Math.abs(tC._x - 300) * 0.5);
tC.colour.gotoAndStop(l4colours[i - 1]);
tC.stick.gotoAndStop(tC.colour._currentframe);
tC.levelNumber = i + ((worldSelect - 1) * 11);
tC.levelText = "Level " + tC.levelNumber;
tC.i = i;
if (levelScores[tC.levelNumber - 1] == 0) {
tC.levelTick._visible = false;
tC.erase._visible = false;
}
tC.erase.onRelease = function () {
if (levelSelectedWorld4 == this._parent.i) {
levelScores[this._parent.levelNumber - 1] = 0;
this._parent.levelTick._visible = false;
this._parent.erase._visible = false;
}
};
tC.colour.onRelease = function () {
if (levelSelectedWorld4 == this._parent.i) {
levelSelect = this._parent.levelNumber;
gotoAndStop(this._parent.levelNumber + 29);
}
};
i++;
}
rightArrow.onRelease = function () {
if (musicOn) {
switchOn.start();
}
levelSelectedWorld4++;
if (levelSelectedWorld4 > tempLimitLevel) {
levelSelectedWorld4 = 1;
i = 1;
while (i <= tempLimitLevel) {
tC = _root["level" + i];
if (i == levelSelectedWorld4) {
tC.eS = 110;
tC.endExtraY = -20;
} else {
tC.eS = 100;
tC.endExtraY = 0;
}
tC._xscale = tC.eS;
tC._yscale = tC.eS;
tC.extraY = tC.endExtraY;
tC.endX = (300 - (120 * (levelSelectedWorld4 - 1))) + ((i - 1) * 120);
tC._x = tC.endX;
tC._y = tC.extraY + (((0.00022222 * Math.pow(tC._x, 2)) - (0.1333 * tC._x)) + 220);
tC._rotation = (tC._x - 300) / 50;
tC._alpha = 100 - (Math.abs(tC._x - 300) * 0.5);
if (tC._alpha <= 0) {
tC._visible = false;
} else {
tC._visible = true;
}
i++;
}
}
};
leftArrow.onRelease = function () {
if (musicOn) {
switchOn.start();
}
levelSelectedWorld4--;
if (levelSelectedWorld4 < 1) {
levelSelectedWorld4 = tempLimitLevel;
i = 1;
while (i <= tempLimitLevel) {
tC = _root["level" + i];
if (i == levelSelectedWorld4) {
tC.eS = 110;
tC.endExtraY = -20;
} else {
tC.eS = 100;
tC.endExtraY = 0;
}
tC._xscale = tC.eS;
tC._yscale = tC.eS;
tC.extraY = tC.endExtraY;
tC.endX = (300 - (120 * (levelSelectedWorld4 - 1))) + ((i - 1) * 120);
tC._x = tC.endX;
tC._y = tC.extraY + (((0.00022222 * Math.pow(tC._x, 2)) - (0.1333 * tC._x)) + 220);
tC._rotation = (tC._x - 300) / 50;
tC._alpha = 100 - (Math.abs(tC._x - 300) * 0.5);
if (tC._alpha <= 0) {
tC._visible = false;
} else {
tC._visible = true;
}
i++;
}
}
};
worldOverview._y = worldOverviewY;
world4Title.onRelease = function () {
if (worldOverviewY == -10) {
worldOverviewY = 10;
} else {
worldOverviewY = -10;
}
};
back.onRelease = function () {
if (musicOn) {
backSound.start();
}
if (menuType == 1) {
gotoAndStop (102);
} else {
gotoAndStop (97);
}
};
onEnterFrame = function () {
i = 1;
while (i <= tempLimitLevel) {
tC = _root["level" + i];
tC.endX = (300 - (120 * (levelSelectedWorld4 - 1))) + ((i - 1) * 120);
tC._x = tC._x + ((tC.endX - tC._x) / 4);
tC._y = tC.extraY + (((0.00022222 * Math.pow(tC._x, 2)) - (0.1333 * tC._x)) + 220);
tC._rotation = (tC._x - 300) / 50;
tC._xscale = tC._xscale + ((tC.eS - tC._xscale) / 4);
tC._yscale = tC._yscale + ((tC.eS - tC._yscale) / 4);
tC.extraY = tC.extraY + ((tC.endExtraY - tC.extraY) / 4);
if (i == levelSelectedWorld4) {
tC.eS = 110;
tC.endExtraY = -20;
if (tC.colour.hitTest(cursor._x, cursor._y, true)) {
tC.gotoAndStop(2);
} else {
tC.gotoAndStop(1);
}
} else {
tC.eS = 100;
tC.endExtraY = 0;
tC.gotoAndStop(1);
}
tC._alpha = 100 - (Math.abs(tC._x - 300) * 0.5);
tC.erase._alpha = 100 - (Math.abs(tC._x - 300) * 0.8);
if (tC._alpha <= 0) {
tC._visible = false;
} else {
tC._visible = true;
}
i++;
}
base.levelDescription = (("Level " + (levelSelectedWorld4 + ((worldSelect - 1) * 11))) + ": ") + levelNames[(levelSelectedWorld4 + ((worldSelect - 1) * 11)) - 1];
base.bestTime = "Best Time - " + framesToTime(levelTimes[(levelSelectedWorld4 + ((worldSelect - 1) * 11)) - 1]);
base.bestScore = "Score - " + levelScores[(levelSelectedWorld4 + ((worldSelect - 1) * 11)) - 1];
base.bestOrbs = ("Orbs - " + levelOrbs[(levelSelectedWorld4 + ((worldSelect - 1) * 11)) - 1]) + "%";
base.medal.gotoAndStop(levelMedals[(levelSelectedWorld4 + ((worldSelect - 1) * 11)) - 1]);
squareButton(rightArrow);
squareButton(leftArrow);
squareButton(back);
squareButton(muteButtonCircle);
squareButton(changeCursor);
squareButton(autoTipsButton);
manageCursor();
worldOverview._y = worldOverview._y + ((worldOverviewY - worldOverview._y) / 3);
if (aKeyDown == undefined) {
aKeyDown = false;
dKeyDown = false;
lKeyDown = false;
rKeyDown = false;
}
if (Key.isDown(65)) {
if (!aKeyDown) {
aKeyDown = true;
if (musicOn) {
switchOn.start();
}
levelSelectedWorld4--;
if (levelSelectedWorld4 < 1) {
levelSelectedWorld4 = tempLimitLevel;
i = 1;
while (i <= tempLimitLevel) {
tC = _root["level" + i];
if (i == levelSelectedWorld4) {
tC.eS = 110;
tC.endExtraY = -20;
} else {
tC.eS = 100;
tC.endExtraY = 0;
}
tC._xscale = tC.eS;
tC._yscale = tC.eS;
tC.extraY = tC.endExtraY;
tC.endX = (300 - (120 * (levelSelectedWorld4 - 1))) + ((i - 1) * 120);
tC._x = tC.endX;
tC._y = tC.extraY + (((0.00022222 * Math.pow(tC._x, 2)) - (0.1333 * tC._x)) + 220);
tC._rotation = (tC._x - 300) / 50;
tC._alpha = 100 - (Math.abs(tC._x - 300) * 0.5);
if (tC._alpha <= 0) {
tC._visible = false;
} else {
tC._visible = true;
}
i++;
}
}
}
} else {
aKeyDown = false;
}
if (Key.isDown(37)) {
if (!lKeyDown) {
lKeyDown = true;
if (musicOn) {
switchOn.start();
}
levelSelectedWorld4--;
if (levelSelectedWorld4 < 1) {
levelSelectedWorld4 = tempLimitLevel;
i = 1;
while (i <= tempLimitLevel) {
tC = _root["level" + i];
if (i == levelSelectedWorld4) {
tC.eS = 110;
tC.endExtraY = -20;
} else {
tC.eS = 100;
tC.endExtraY = 0;
}
tC._xscale = tC.eS;
tC._yscale = tC.eS;
tC.extraY = tC.endExtraY;
tC.endX = (300 - (120 * (levelSelectedWorld4 - 1))) + ((i - 1) * 120);
tC._x = tC.endX;
tC._y = tC.extraY + (((0.00022222 * Math.pow(tC._x, 2)) - (0.1333 * tC._x)) + 220);
tC._rotation = (tC._x - 300) / 50;
tC._alpha = 100 - (Math.abs(tC._x - 300) * 0.5);
if (tC._alpha <= 0) {
tC._visible = false;
} else {
tC._visible = true;
}
i++;
}
}
}
} else {
lKeyDown = false;
}
if (Key.isDown(68)) {
if (!dKeyDown) {
dKeyDown = true;
if (musicOn) {
switchOn.start();
}
levelSelectedWorld4++;
if (levelSelectedWorld4 > tempLimitLevel) {
levelSelectedWorld4 = 1;
i = 1;
while (i <= tempLimitLevel) {
tC = _root["level" + i];
if (i == levelSelectedWorld4) {
tC.eS = 110;
tC.endExtraY = -20;
} else {
tC.eS = 100;
tC.endExtraY = 0;
}
tC._xscale = tC.eS;
tC._yscale = tC.eS;
tC.extraY = tC.endExtraY;
tC.endX = (300 - (120 * (levelSelectedWorld4 - 1))) + ((i - 1) * 120);
tC._x = tC.endX;
tC._y = tC.extraY + (((0.00022222 * Math.pow(tC._x, 2)) - (0.1333 * tC._x)) + 220);
tC._rotation = (tC._x - 300) / 50;
tC._alpha = 100 - (Math.abs(tC._x - 300) * 0.5);
if (tC._alpha <= 0) {
tC._visible = false;
} else {
tC._visible = true;
}
i++;
}
}
}
} else {
dKeyDown = false;
}
if (Key.isDown(39)) {
if (!rKeyDown) {
rKeyDown = true;
if (musicOn) {
switchOn.start();
}
levelSelectedWorld4++;
if (levelSelectedWorld4 > tempLimitLevel) {
levelSelectedWorld4 = 1;
i = 1;
while (i <= tempLimitLevel) {
tC = _root["level" + i];
if (i == levelSelectedWorld4) {
tC.eS = 110;
tC.endExtraY = -20;
} else {
tC.eS = 100;
tC.endExtraY = 0;
}
tC._xscale = tC.eS;
tC._yscale = tC.eS;
tC.extraY = tC.endExtraY;
tC.endX = (300 - (120 * (levelSelectedWorld4 - 1))) + ((i - 1) * 120);
tC._x = tC.endX;
tC._y = tC.extraY + (((0.00022222 * Math.pow(tC._x, 2)) - (0.1333 * tC._x)) + 220);
tC._rotation = (tC._x - 300) / 50;
tC._alpha = 100 - (Math.abs(tC._x - 300) * 0.5);
if (tC._alpha <= 0) {
tC._visible = false;
} else {
tC._visible = true;
}
i++;
}
}
}
} else {
rKeyDown = false;
}
};
Frame 94
saveGame();
changeCursor.onRelease = function () {
if (musicOn) {
optionChange.start();
}
if (pointerFrame < 5) {
pointerFrame++;
} else {
pointerFrame = 1;
}
cursor.gotoAndStop(pointerFrame);
saveGame();
};
muteButtonCircle.onRelease = function () {
if (musicOn == 1) {
musicOn = 0;
aquaticVoyage.stop();
muteButtonCircle.gotoAndStop(2);
} else {
musicOn = 1;
aquaticVoyage.start(0, 999);
muteButtonCircle.gotoAndStop(1);
}
saveGame();
};
if (musicOn) {
muteButtonCircle.gotoAndStop(1);
} else {
muteButtonCircle.gotoAndStop(2);
}
autoTipsButton.onRelease = function () {
if (autoTips) {
autoTips = false;
autoTipsButton.gotoAndStop(2);
} else {
autoTips = true;
autoTipsButton.gotoAndStop(1);
}
if (musicOn) {
optionChange.start();
}
};
if (autoTips) {
autoTipsButton.gotoAndStop(1);
} else {
autoTipsButton.gotoAndStop(2);
}
if (levelSelectedWorld5 == undefined) {
levelSelectedWorld5 = 1;
}
worldSelect = 5;
l5colours = new Array(5, 4, 6, 9, 1, 7, 3, 10, 11, 8, 2);
if (limitLevel >= (worldSelect * 11)) {
tempLimitLevel = 11;
} else {
tempLimitLevel = limitLevel - ((worldSelect - 1) * 11);
}
if (levelSelectedWorld5 > tempLimitLevel) {
levelSelectedWorld5 = tempLimitLevel;
}
if (tempLimitLevel == 11) {
levelCompleteCheck = 0;
i = (worldSelect - 1) * 11;
while (i < ((worldSelect * 11) - 1)) {
if (levelOrbs[i] > 0) {
levelCompleteCheck++;
}
i++;
}
if (levelCompleteCheck != 10) {
tempLimitLevel = 10;
}
}
i = 1;
while (i <= 11) {
_root.worldOverview["levelBox" + i].boxColour.gotoAndStop(levelMedals[(i + ((worldSelect - 1) * 11)) - 1]);
tC = _root["level" + i];
if (i > tempLimitLevel) {
tC._visible = false;
}
i++;
}
i = 1;
while (i <= tempLimitLevel) {
tC = _root["level" + i];
if (i == levelSelectedWorld5) {
tC.eS = 110;
tC.endExtraY = -20;
} else {
tC.eS = 100;
tC.endExtraY = 0;
}
tC._xscale = tC.eS;
tC._yscale = tC.eS;
tC.extraY = tC.endExtraY;
tC._x = (300 - (120 * (levelSelectedWorld5 - 1))) + ((i - 1) * 120);
tC.endX = tC._x;
tC._y = tC.extraY + (((0.00022222 * Math.pow(tC._x, 2)) - (0.1333 * tC._x)) + 220);
tC._rotation = (tC._x - 300) / 50;
tC._alpha = 100 - (Math.abs(tC._x - 300) * 0.5);
tC.colour.gotoAndStop(l5colours[i - 1]);
tC.stick.gotoAndStop(tC.colour._currentframe);
tC.levelNumber = i + ((worldSelect - 1) * 11);
tC.levelText = "Level " + tC.levelNumber;
tC.i = i;
if (levelScores[tC.levelNumber - 1] == 0) {
tC.levelTick._visible = false;
tC.erase._visible = false;
}
tC.erase.onRelease = function () {
if (levelSelectedWorld5 == this._parent.i) {
levelScores[this._parent.levelNumber - 1] = 0;
this._parent.levelTick._visible = false;
this._parent.erase._visible = false;
}
};
tC.colour.onRelease = function () {
if (levelSelectedWorld5 == this._parent.i) {
levelSelect = this._parent.levelNumber;
gotoAndStop(this._parent.levelNumber + 29);
}
};
i++;
}
rightArrow.onRelease = function () {
if (musicOn) {
switchOn.start();
}
levelSelectedWorld5++;
if (levelSelectedWorld5 > tempLimitLevel) {
levelSelectedWorld5 = 1;
i = 1;
while (i <= tempLimitLevel) {
tC = _root["level" + i];
if (i == levelSelectedWorld5) {
tC.eS = 110;
tC.endExtraY = -20;
} else {
tC.eS = 100;
tC.endExtraY = 0;
}
tC._xscale = tC.eS;
tC._yscale = tC.eS;
tC.extraY = tC.endExtraY;
tC.endX = (300 - (120 * (levelSelectedWorld5 - 1))) + ((i - 1) * 120);
tC._x = tC.endX;
tC._y = tC.extraY + (((0.00022222 * Math.pow(tC._x, 2)) - (0.1333 * tC._x)) + 220);
tC._rotation = (tC._x - 300) / 50;
tC._alpha = 100 - (Math.abs(tC._x - 300) * 0.5);
if (tC._alpha <= 0) {
tC._visible = false;
} else {
tC._visible = true;
}
i++;
}
}
};
leftArrow.onRelease = function () {
if (musicOn) {
switchOn.start();
}
levelSelectedWorld5--;
if (levelSelectedWorld5 < 1) {
levelSelectedWorld5 = tempLimitLevel;
i = 1;
while (i <= tempLimitLevel) {
tC = _root["level" + i];
if (i == levelSelectedWorld5) {
tC.eS = 110;
tC.endExtraY = -20;
} else {
tC.eS = 100;
tC.endExtraY = 0;
}
tC._xscale = tC.eS;
tC._yscale = tC.eS;
tC.extraY = tC.endExtraY;
tC.endX = (300 - (120 * (levelSelectedWorld5 - 1))) + ((i - 1) * 120);
tC._x = tC.endX;
tC._y = tC.extraY + (((0.00022222 * Math.pow(tC._x, 2)) - (0.1333 * tC._x)) + 220);
tC._rotation = (tC._x - 300) / 50;
tC._alpha = 100 - (Math.abs(tC._x - 300) * 0.5);
if (tC._alpha <= 0) {
tC._visible = false;
} else {
tC._visible = true;
}
i++;
}
}
};
worldOverview._y = worldOverviewY;
world5Title.onRelease = function () {
if (worldOverviewY == -10) {
worldOverviewY = 10;
} else {
worldOverviewY = -10;
}
};
back.onRelease = function () {
if (musicOn) {
backSound.start();
}
if (menuType == 1) {
gotoAndStop (102);
} else {
gotoAndStop (97);
}
};
onEnterFrame = function () {
i = 1;
while (i <= tempLimitLevel) {
tC = _root["level" + i];
tC.endX = (300 - (120 * (levelSelectedWorld5 - 1))) + ((i - 1) * 120);
tC._x = tC._x + ((tC.endX - tC._x) / 4);
tC._y = tC.extraY + (((0.00022222 * Math.pow(tC._x, 2)) - (0.1333 * tC._x)) + 220);
tC._rotation = (tC._x - 300) / 50;
tC._xscale = tC._xscale + ((tC.eS - tC._xscale) / 4);
tC._yscale = tC._yscale + ((tC.eS - tC._yscale) / 4);
tC.extraY = tC.extraY + ((tC.endExtraY - tC.extraY) / 4);
if (i == levelSelectedWorld5) {
tC.eS = 110;
tC.endExtraY = -20;
if (tC.colour.hitTest(cursor._x, cursor._y, true)) {
tC.gotoAndStop(2);
} else {
tC.gotoAndStop(1);
}
} else {
tC.eS = 100;
tC.endExtraY = 0;
tC.gotoAndStop(1);
}
tC._alpha = 100 - (Math.abs(tC._x - 300) * 0.5);
tC.erase._alpha = 100 - (Math.abs(tC._x - 300) * 0.8);
if (tC._alpha <= 0) {
tC._visible = false;
} else {
tC._visible = true;
}
i++;
}
base.levelDescription = (("Level " + (levelSelectedWorld5 + ((worldSelect - 1) * 11))) + ": ") + levelNames[(levelSelectedWorld5 + ((worldSelect - 1) * 11)) - 1];
base.bestTime = "Best Time - " + framesToTime(levelTimes[(levelSelectedWorld5 + ((worldSelect - 1) * 11)) - 1]);
base.bestScore = "Score - " + levelScores[(levelSelectedWorld5 + ((worldSelect - 1) * 11)) - 1];
base.bestOrbs = ("Orbs - " + levelOrbs[(levelSelectedWorld5 + ((worldSelect - 1) * 11)) - 1]) + "%";
base.medal.gotoAndStop(levelMedals[(levelSelectedWorld5 + ((worldSelect - 1) * 11)) - 1]);
squareButton(rightArrow);
squareButton(leftArrow);
squareButton(back);
squareButton(muteButtonCircle);
squareButton(changeCursor);
squareButton(autoTipsButton);
manageCursor();
worldOverview._y = worldOverview._y + ((worldOverviewY - worldOverview._y) / 3);
if (aKeyDown == undefined) {
aKeyDown = false;
dKeyDown = false;
lKeyDown = false;
rKeyDown = false;
}
if (Key.isDown(65)) {
if (!aKeyDown) {
aKeyDown = true;
if (musicOn) {
switchOn.start();
}
levelSelectedWorld5--;
if (levelSelectedWorld5 < 1) {
levelSelectedWorld5 = tempLimitLevel;
i = 1;
while (i <= tempLimitLevel) {
tC = _root["level" + i];
if (i == levelSelectedWorld5) {
tC.eS = 110;
tC.endExtraY = -20;
} else {
tC.eS = 100;
tC.endExtraY = 0;
}
tC._xscale = tC.eS;
tC._yscale = tC.eS;
tC.extraY = tC.endExtraY;
tC.endX = (300 - (120 * (levelSelectedWorld5 - 1))) + ((i - 1) * 120);
tC._x = tC.endX;
tC._y = tC.extraY + (((0.00022222 * Math.pow(tC._x, 2)) - (0.1333 * tC._x)) + 220);
tC._rotation = (tC._x - 300) / 50;
tC._alpha = 100 - (Math.abs(tC._x - 300) * 0.5);
if (tC._alpha <= 0) {
tC._visible = false;
} else {
tC._visible = true;
}
i++;
}
}
}
} else {
aKeyDown = false;
}
if (Key.isDown(37)) {
if (!lKeyDown) {
lKeyDown = true;
if (musicOn) {
switchOn.start();
}
levelSelectedWorld5--;
if (levelSelectedWorld5 < 1) {
levelSelectedWorld5 = tempLimitLevel;
i = 1;
while (i <= tempLimitLevel) {
tC = _root["level" + i];
if (i == levelSelectedWorld5) {
tC.eS = 110;
tC.endExtraY = -20;
} else {
tC.eS = 100;
tC.endExtraY = 0;
}
tC._xscale = tC.eS;
tC._yscale = tC.eS;
tC.extraY = tC.endExtraY;
tC.endX = (300 - (120 * (levelSelectedWorld5 - 1))) + ((i - 1) * 120);
tC._x = tC.endX;
tC._y = tC.extraY + (((0.00022222 * Math.pow(tC._x, 2)) - (0.1333 * tC._x)) + 220);
tC._rotation = (tC._x - 300) / 50;
tC._alpha = 100 - (Math.abs(tC._x - 300) * 0.5);
if (tC._alpha <= 0) {
tC._visible = false;
} else {
tC._visible = true;
}
i++;
}
}
}
} else {
lKeyDown = false;
}
if (Key.isDown(68)) {
if (!dKeyDown) {
dKeyDown = true;
if (musicOn) {
switchOn.start();
}
levelSelectedWorld5++;
if (levelSelectedWorld5 > tempLimitLevel) {
levelSelectedWorld5 = 1;
i = 1;
while (i <= tempLimitLevel) {
tC = _root["level" + i];
if (i == levelSelectedWorld5) {
tC.eS = 110;
tC.endExtraY = -20;
} else {
tC.eS = 100;
tC.endExtraY = 0;
}
tC._xscale = tC.eS;
tC._yscale = tC.eS;
tC.extraY = tC.endExtraY;
tC.endX = (300 - (120 * (levelSelectedWorld5 - 1))) + ((i - 1) * 120);
tC._x = tC.endX;
tC._y = tC.extraY + (((0.00022222 * Math.pow(tC._x, 2)) - (0.1333 * tC._x)) + 220);
tC._rotation = (tC._x - 300) / 50;
tC._alpha = 100 - (Math.abs(tC._x - 300) * 0.5);
if (tC._alpha <= 0) {
tC._visible = false;
} else {
tC._visible = true;
}
i++;
}
}
}
} else {
dKeyDown = false;
}
if (Key.isDown(39)) {
if (!rKeyDown) {
rKeyDown = true;
if (musicOn) {
switchOn.start();
}
levelSelectedWorld5++;
if (levelSelectedWorld5 > tempLimitLevel) {
levelSelectedWorld5 = 1;
i = 1;
while (i <= tempLimitLevel) {
tC = _root["level" + i];
if (i == levelSelectedWorld5) {
tC.eS = 110;
tC.endExtraY = -20;
} else {
tC.eS = 100;
tC.endExtraY = 0;
}
tC._xscale = tC.eS;
tC._yscale = tC.eS;
tC.extraY = tC.endExtraY;
tC.endX = (300 - (120 * (levelSelectedWorld5 - 1))) + ((i - 1) * 120);
tC._x = tC.endX;
tC._y = tC.extraY + (((0.00022222 * Math.pow(tC._x, 2)) - (0.1333 * tC._x)) + 220);
tC._rotation = (tC._x - 300) / 50;
tC._alpha = 100 - (Math.abs(tC._x - 300) * 0.5);
if (tC._alpha <= 0) {
tC._visible = false;
} else {
tC._visible = true;
}
i++;
}
}
}
} else {
rKeyDown = false;
}
};
Frame 97
limitWorld = Math.ceil(limitLevel / 11);
i = 1;
while (i <= 5) {
w = _root["world" + i];
w._rotation = (i - 3) * 2.5;
w.xDif = Math.abs(cursor._x - w._x) / 10;
if (w.xDif > 20) {
w.xDif = 20;
}
w._xscale = (w._yscale = 100 - w.xDif);
w._y = 180 + (w.xDif * 2);
w.i = i;
w.onRelease = function () {
if (this.i <= limitWorld) {
if (musicOn) {
buttonPress.start();
}
gotoAndStop(this.i + 89);
}
};
if (i > limitWorld) {
w._alpha = 50;
}
i++;
}
back.onRelease = function () {
if (musicOn) {
backSound.start();
}
gotoAndStop (3);
};
subScore.onRelease = function () {
if (musicOn) {
buttonPress.start();
}
gotoAndStop (22);
};
selectWorld = 0;
initAverages();
j = 0;
while (j < 5) {
i = j * 11;
while (i < (11 * (j + 1))) {
averageOrbs[j] = averageOrbs[j] + (levelOrbs[i] / 11);
averageTimes[j] = averageTimes[j] + levelTimes[i];
averageMedals[j] = averageMedals[j] + (levelMedals[i] / 11);
averageScores[j] = averageScores[j] + levelScores[i];
if (levelOrbs[i] > 0) {
percentCompletes[j]++;
}
i++;
}
averageOrbs[j] = Math.round(averageOrbs[j]);
averageScores[j] = Math.round(averageScores[j]);
averageTimes[j] = Math.ceil(averageTimes[j]);
averageMedals[j] = Math.round(averageMedals[j]);
j++;
}
totalScore = 0;
i = 0;
while (i < 55) {
totalScore = totalScore + levelScores[i];
i++;
}
base.medal.gotoAndStop(4);
onEnterFrame = function () {
squareButton(back);
squareButton(subScore);
manageCursor();
if (selectWorld == 0) {
base.bigText = "Hover over a world to see more info";
} else if (selectWorld > limitWorld) {
base.averageOrbs = "";
base.averageTime = "";
base.averageScore = "";
base.overallMedal = "";
base.worldStatus = "";
base.bigText = ("World " + selectWorld) + " Locked";
if (limitLevel == 1) {
worldDisplay.dispText = ((("World " + tempHit) + " Locked") + newline) + "complete Level 1 to unlock more";
} else if (limitLevel == 10) {
worldDisplay.dispText = ((((("World " + tempHit) + " Locked") + newline) + "complete ") + (10 - completeLevels)) + " more levels to unlock more worlds";
} else if (limitLevel == 44) {
worldDisplay.dispText = ((((("World " + tempHit) + " Locked") + newline) + "complete ") + (44 - completeLevels)) + " more levels to unlock this world";
}
} else {
base.averageOrbs = ("Average Orbs - " + averageOrbs[selectWorld - 1]) + "%";
base.averageTime = "Total Score - " + averageScores[selectWorld - 1];
base.averageScore = "Total Time - " + framesToTime(averageTimes[selectWorld - 1]);
base.overallMedal = ((percentCompletes[selectWorld - 1] + " / 11") + newline) + "Levels Complete";
base.worldStatus = (("World " + selectWorld) + newline) + worldNames[selectWorld - 1];
base.bigText = "";
}
i = 1;
while (i <= 5) {
w = _root["world" + i];
w.xDif = Math.abs(cursor._x - w._x) / 10;
if (w.xDif > 20) {
w.xDif = 20;
}
w._xscale = (w._yscale = 100 - w.xDif);
w._y = 180 + (w.xDif * 2);
if (w.hitTest(cursor._x, cursor._y, true)) {
selectWorld = i;
w.gotoAndStop(2);
} else {
w.gotoAndStop(1);
}
i++;
}
};
Frame 98
onEnterFrame = function () {
manageCursor();
squareButton(start_btn);
squareButton(options_btn);
squareButton(custLevels_btn);
squareButton(viewScores_btn);
squareButton(ins_btn);
squareButton(credits_btn);
squareButton(bGames_btn);
squareButton(facebook);
squareButton(twitter);
squareButton(moarGames);
squareButton(ca3);
};
start_btn.onRelease = function () {
if (musicOn) {
buttonPress.start();
}
gotoAndStop (102);
};
options_btn.onRelease = function () {
if (musicOn) {
buttonPress.start();
}
gotoAndStop (99);
};
custLevels_btn.onRelease = function () {
if (musicOn) {
buttonPress.start();
}
gotoAndStop (100);
};
ins_btn.onRelease = function () {
if (musicOn) {
buttonPress.start();
}
gotoAndStop (13);
};
credits_btn.onRelease = function () {
if (musicOn) {
buttonPress.start();
}
gotoAndStop (101);
};
moarGames.onRelease = function () {
if (musicOn) {
buttonPress.start();
}
getURL ("http://www.bgames.com/?utm_source=sponsor_game&utm_medium=menu_more_games&utm_campaign=Cursor-Attack-4", "_new");
};
bGames_btn.onRelease = function () {
if (musicOn) {
buttonPress.start();
}
getURL ("http://www.bgames.com/?utm_source=sponsor_game&utm_medium=menu_logo&utm_campaign=Cursor-Attack-4", "_new");
};
facebook.onRelease = function () {
if (musicOn) {
buttonPress.start();
}
getURL ("http://www.facebook.com/sharer.php?u=http://www.bgames.com/funny-games/Cursor-Attack-4.html&t=Cursor-Attack-4", "_new");
};
twitter.onRelease = function () {
if (musicOn) {
buttonPress.start();
}
getURL ("http://twitter.com/home?status=Playing Cursor Attack at http://www.bgames.com/funny-games/Cursor-Attack-4.html", "_new");
};
ca3.onRelease = function () {
if (musicOn) {
buttonPress.start();
}
getURL ("http://www.bgames.com/funny-games/Cursor-Attack-3.html?utm_source=sponsor_game&utm_medium=ca3link&utm_campaign=Cursor-Attack-4", "_new");
};
Frame 99
newGameTimer = 0;
descTimer = 0;
pointerButton.preview.gotoAndStop(pointerFrame);
spinDirButton.preview.gotoAndStop(spinDir + 1);
if (bgFixed) {
bgButton.bgNum = bgFrame;
} else {
bgButton.bgNum = "Auto";
}
qualityButton.preview.gotoAndStop(4 - gameQual);
musicButton.preview.gotoAndStop(2 - musicOn);
onEnterFrame = function () {
manageCursor();
squareButton(pointerButton);
if (pointerButton.hitTest(cursor._x, cursor._y, true)) {
optionDesc = "Change cursor:\r" + cursorNames[pointerFrame - 1];
descTimer = 0;
}
squareButton(spinDirButton);
if (spinDirButton.hitTest(cursor._x, cursor._y, true)) {
if (spinDir == 1) {
optionDesc = "Change controls\rD - spin clockwise\rA - anti-clockwise";
} else {
optionDesc = "Change controls\rA - spin clockwise\rD - anti-clockwise";
}
descTimer = 0;
}
squareButton(bgButton);
if (bgButton.hitTest(cursor._x, cursor._y, true)) {
optionDesc = "Change backgrounds";
descTimer = 0;
}
squareButton(qualityButton);
if (qualityButton.hitTest(cursor._x, cursor._y, true)) {
optionDesc = "Change quality:\r" + qualityNames[gameQual - 1];
descTimer = 0;
}
squareButton(musicButton);
if (musicButton.hitTest(cursor._x, cursor._y, true)) {
optionDesc = "Toggle music\ron/off";
descTimer = 0;
}
squareButton(newGameButton);
if (newGameButton.hitTest(cursor._x, cursor._y, true)) {
optionDesc = "Start new game\r(Click & Hold)\rCan't be undone";
descTimer = 0;
}
squareButton(back);
squareButton(menuTypeButton);
if (menuTypeButton.hitTest(cursor._x, cursor._y, true)) {
optionDesc = "Change the menu:\r" + menuNames[menuType - 1];
descTimer = 0;
}
if (!newGameButton.hitTest(cursor._x, cursor._y, true)) {
newGameButton.dataLoader.gotoAndStop(1);
}
if (newGameButton.dataLoader._currentframe == 60) {
newGame();
pointerButton.preview.gotoAndStop(pointerFrame);
spinDirButton.preview.gotoAndStop(spinDir + 1);
bgButton.bgNum = "Auto";
qualityButton.preview.gotoAndStop(4 - gameQual);
_root._quality = qualityNames[gameQual - 1];
musicButton.preview.gotoAndStop(2 - musicOn);
aquaticVoyage.stop();
aquaticVoyage.start(0, 999);
optionChange.start();
newGameButton.dataLoader.gotoAndStop(1);
saveGame();
}
descTimer++;
if (descTimer > 30) {
optionDesc = "";
}
};
back.onRelease = function () {
if (musicOn) {
backSound.start();
}
if (menuType == 1) {
gotoAndStop (98);
} else {
gotoAndStop (3);
}
saveGame();
};
pointerButton.onRelease = function () {
if (musicOn) {
optionChange.start();
}
if (pointerFrame < 5) {
pointerFrame++;
} else {
pointerFrame = 1;
}
cursor.gotoAndStop(pointerFrame);
pointerButton.preview.gotoAndStop(pointerFrame);
};
spinDirButton.onRelease = function () {
if (musicOn) {
optionChange.start();
}
if (spinDir == 1) {
spinDir = 0;
} else {
spinDir = 1;
}
spinDirButton.preview.gotoAndStop(spinDir + 1);
};
bgButton.onRelease = function () {
if (bgFixed) {
bgFrame++;
bgButton.bgNum = bgFrame;
if (bgFrame >= (bgNum + 1)) {
bgFixed = false;
bgButton.bgNum = "Auto";
}
} else {
bgFixed = true;
bgFrame = 1;
bg.reel._y = 450;
bgButton.bgNum = bgFrame;
}
if (musicOn) {
optionChange.start();
}
};
qualityButton.onRelease = function () {
if (musicOn) {
optionChange.start();
}
gameQual--;
if (gameQual == 0) {
gameQual = 3;
}
qualityButton.preview.gotoAndStop(4 - gameQual);
_root._quality = qualityNames[gameQual - 1];
};
musicButton.onRelease = function () {
if (musicOn == 1) {
musicOn = 0;
aquaticVoyage.stop();
} else {
musicOn = 1;
aquaticVoyage.start(0, 999);
}
musicButton.preview.gotoAndStop(2 - musicOn);
};
menuTypeButton.onRelease = function () {
if (musicOn) {
optionChange.start();
}
if (menuType == 1) {
menuType = 2;
} else if (menuType == 2) {
menuType = 1;
}
};
newGameButton.onPress = function () {
newGameButton.dataLoader.gotoAndPlay(2);
};
newGameButton.onRelease = function () {
newGameButton.dataLoader.gotoAndStop(1);
};
newGameButton.onReleaseOutside = function () {
newGameButton.dataLoader.gotoAndStop(1);
};
newGameButton.onRollOut = function () {
newGameButton.dataLoader.gotoAndStop(1);
};
Frame 100
onEnterFrame = function () {
manageCursor();
squareButton(customLevelsButton);
squareButton(levelEditor);
squareButton(loadLevel);
squareButton(helpButton);
squareButton(back);
};
back.onRelease = function () {
if (musicOn) {
backSound.start();
}
gotoAndStop (98);
};
customLevelsButton.onRelease = function () {
if (musicOn) {
buttonPress.start();
}
gotoAndStop (19);
};
loadLevel.onRelease = function () {
if (musicOn) {
buttonPress.start();
}
gotoAndStop (16);
};
levelEditor.onRelease = function () {
if (musicOn) {
buttonPress.start();
}
gotoAndStop (17);
};
helpButton.onRelease = function () {
if (musicOn) {
buttonPress.start();
}
gotoAndStop (21);
};
Frame 101
creditTimer = 0;
onEnterFrame = function () {
manageCursor();
squareButton(pHogg);
if (pHogg.hitTest(cursor._x, cursor._y, true)) {
crediter = "Made the game\r...\rand is awesome";
creditTimer = 0;
}
squareButton(eHogg);
if (eHogg.hitTest(cursor._x, cursor._y, true)) {
crediter = "Aided the quest";
creditTimer = 0;
}
squareButton(mStein);
if (mStein.hitTest(cursor._x, cursor._y, true)) {
crediter = "Grand advisor";
creditTimer = 0;
}
squareButton(spoofy);
if (spoofy.hitTest(cursor._x, cursor._y, true)) {
crediter = "Made the music";
creditTimer = 0;
}
squareButton(facebook);
if (facebook.hitTest(cursor._x, cursor._y, true)) {
crediter = "Like this game?\rLike this game!";
creditTimer = 0;
}
squareButton(twitter);
if (twitter.hitTest(cursor._x, cursor._y, true)) {
crediter = "Hello. Hello\rFollow me\rOk";
creditTimer = 0;
}
squareButton(ashJim);
if (ashJim.hitTest(cursor._x, cursor._y, true)) {
crediter = "Wanted mentioning";
creditTimer = 0;
}
squareButton(back);
creditTimer++;
if (creditTimer > 30) {
crediter = "";
}
};
back.onRelease = function () {
if (musicOn) {
backSound.start();
}
gotoAndStop (98);
};
facebook.onRelease = function () {
if (musicOn) {
buttonPress.start();
}
getURL ("http://www.facebook.com/sharer.php?u=http://www.bgames.com/funny-games/Cursor-Attack-4.html&t=Cursor-Attack-4", "_new");
};
twitter.onRelease = function () {
if (musicOn) {
buttonPress.start();
}
getURL ("http://twitter.com/home?status=Playing Cursor Attack at http://www.bgames.com/funny-games/Cursor-Attack-4.html", "_new");
};
pHogg.onRelease = function () {
if (musicOn) {
buttonPress.start();
}
};
eHogg.onRelease = function () {
if (musicOn) {
buttonPress.start();
}
};
mStein.onRelease = function () {
if (musicOn) {
buttonPress.start();
}
};
spoofy.onRelease = function () {
if (musicOn) {
buttonPress.start();
}
};
ashJim.onRelease = function () {
if (musicOn) {
buttonPress.start();
}
};
Frame 102
limitWorld = Math.ceil(limitLevel / 11);
worldDisplay._alpha = 0;
worldDisplayAlpha = 0;
worldDisplay._x = cursor._x;
worldDisplay._y = cursor._y;
i = 1;
while (i <= 5) {
w = _root["world" + i];
w.i = i;
w.onRelease = function () {
if (this.i <= limitWorld) {
if (musicOn) {
buttonPress.start();
}
gotoAndStop(this.i + 89);
}
};
w.avail = true;
if (i > limitWorld) {
w.avail = false;
w.colour.gotoAndStop(2);
}
i++;
}
averageOrbs = new Array(0, 0, 0, 0, 0);
levelsDone = new Array(0, 0, 0, 0, 0);
j = 0;
while (j < 5) {
i = j * 11;
while (i < (11 * (j + 1))) {
averageOrbs[j] = averageOrbs[j] + (levelOrbs[i] / 11);
if (levelOrbs[i] > 0) {
levelsDone[j]++;
}
i++;
}
averageOrbs[j] = Math.round(averageOrbs[j]);
j++;
}
totalScore = 0;
i = 0;
while (i < 55) {
totalScore = totalScore + levelScores[i];
i++;
}
onEnterFrame = function () {
manageCursor();
i = 1;
while (i <= 5) {
w = _root["world" + i];
if (w.avail) {
squareButton(w);
}
i++;
}
squareButton(back);
squareButton(subScore);
squareButton(bGames_btn);
worldDisplay._alpha = worldDisplay._alpha + ((worldDisplayAlpha - worldDisplay._alpha) / 3);
worldDisplay._x = worldDisplay._x + ((cursor._x - worldDisplay._x) / 3);
worldDisplay._y = worldDisplay._y + ((cursor._y - worldDisplay._y) / 3);
tempHit = 0;
i = 1;
while (i <= 5) {
w = _root["world" + i];
if (w.hitTest(cursor._x, cursor._y, true)) {
tempHit = i;
}
i++;
}
if (tempHit > 0) {
worldDisplayAlpha = 100;
if (tempHit > limitWorld) {
worldDisplay.dispText = ("World " + tempHit) + " Locked";
if (limitLevel == 1) {
worldDisplay.dispText = ((("World " + tempHit) + " Locked") + newline) + "complete Level 1 to unlock more";
} else if (limitLevel == 10) {
worldDisplay.dispText = ((((("World " + tempHit) + " Locked") + newline) + "complete ") + (10 - completeLevels)) + " more levels to unlock more worlds";
} else if (limitLevel == 44) {
worldDisplay.dispText = ((((("World " + tempHit) + " Locked") + newline) + "complete ") + (44 - completeLevels)) + " more levels to unlock this world";
} else if (limitLevel == 54) {
worldDisplay.dispText = ((((("World " + tempHit) + " Locked") + newline) + "complete ") + (54 - completeLevels)) + " more levels to unlock this world";
}
} else {
worldDisplay.dispText = (((((((("World " + tempHit) + newline) + "Average Orbs - ") + averageOrbs[tempHit - 1]) + "%") + newline) + "Completed Levels - ") + levelsDone[tempHit - 1]) + " / 11";
}
} else {
worldDisplayAlpha = 0;
}
};
back.onRelease = function () {
if (musicOn) {
backSound.start();
}
gotoAndStop (98);
};
subScore.onRelease = function () {
if (musicOn) {
buttonPress.start();
}
gotoAndStop (103);
};
bGames_btn.onRelease = function () {
if (musicOn) {
buttonPress.start();
}
getURL ("http://www.bgames.com/?utm_source=sponsor_game&utm_medium=world_logo&utm_campaign=Cursor-Attack-4", "_new");
};
Frame 103
onEnterFrame = function () {
manageCursor();
squareButton(subScore);
squareButton(viewScores_btn);
squareButton(back);
};
back.onRelease = function () {
if (musicOn) {
backSound.start();
}
gotoAndStop (102);
};
viewScores_btn.onRelease = function () {
if (musicOn) {
buttonPress.start();
}
gotoAndStop (24);
};
subScore.onRelease = function () {
if (musicOn) {
buttonPress.start();
}
gotoAndStop (22);
};
Frame 104
stopAllSounds();
Frame 105
stopAllSounds();
Frame 106
attachSounds();
if (musicOn) {
aquaticVoyage.start(0, 9999);
}
menuType = 1;
if (menuType == 1) {
gotoAndStop (98);
} else {
gotoAndStop (3);
}
Symbol 39 MovieClip Frame 1
gotoAndStop(random(4) + 1);
Symbol 44 MovieClip Frame 1
gotoAndStop(random(4) + 1);
Symbol 48 MovieClip Frame 1
gotoAndStop(random(3) + 1);
Symbol 53 MovieClip Frame 1
gotoAndStop(random(4) + 1);
Symbol 58 MovieClip Frame 1
gotoAndStop(random(4) + 1);
Symbol 66 MovieClip Frame 1
stop();
Symbol 67 MovieClip [bit] Frame 1
stop();
Symbol 74 MovieClip Frame 1
stop();
Symbol 86 MovieClip [blaster] Frame 1
stop();
Symbol 91 MovieClip Frame 80
stop();
Symbol 97 MovieClip Frame 120
stop();
Symbol 99 MovieClip [transBullet] Frame 1
stop();
Symbol 102 MovieClip [exp] Frame 8
stop();
Symbol 110 MovieClip [wallBalloon] Frame 1
stop();
Symbol 117 MovieClip [asteroid] Frame 1
stop();
Symbol 127 MovieClip [levEdPop] Frame 1
stop();
Symbol 161 MovieClip [pauseNotice] Frame 1
stop();
Symbol 167 MovieClip [grey] Frame 1
stop();
Symbol 167 MovieClip [grey] Frame 20
stop();
Symbol 176 MovieClip [green] Frame 1
stop();
Symbol 176 MovieClip [green] Frame 21
stop();
Symbol 179 MovieClip [cloud] Frame 1
stop();
Symbol 179 MovieClip [cloud] Frame 296
stop();
Symbol 188 MovieClip [meteor] Frame 1
gotoAndStop(random(4) + 1);
Symbol 193 MovieClip [bomb] Frame 1
stop();
Symbol 193 MovieClip [bomb] Frame 13
stop();
Symbol 196 MovieClip [spinner] Frame 1
stop();
Symbol 196 MovieClip [spinner] Frame 30
stop();
Symbol 199 MovieClip [crystal] Frame 1
stop();
Symbol 199 MovieClip [crystal] Frame 21
stop();
Symbol 202 MovieClip [ghost] Frame 1
stop();
Symbol 202 MovieClip [ghost] Frame 21
stop();
Symbol 211 MovieClip Frame 20
stop();
Symbol 212 MovieClip [blade] Frame 1
stop();
Symbol 215 MovieClip [stone] Frame 1
stop();
Symbol 215 MovieClip [stone] Frame 30
stop();
Symbol 240 MovieClip [rocket] Frame 1
stop();
Symbol 250 MovieClip [pauseOrb] Frame 1
stop();
Symbol 250 MovieClip [pauseOrb] Frame 21
stop();
Symbol 255 MovieClip [object] Frame 1
stop();
Symbol 258 MovieClip [bullet] Frame 1
stop();
Symbol 287 MovieClip Frame 1
stop();
Symbol 302 MovieClip Frame 1
stop();
Symbol 1440 MovieClip [__Packages.mochi.as2.MochiEventDispatcher] Frame 0
class mochi.as2.MochiEventDispatcher
{
var eventTable;
function MochiEventDispatcher () {
eventTable = {};
}
function buildDelegate(thisObject, thatObject) {
var _local2 = {thisObject:thisObject, thatObject:thatObject};
if (thatObject != undefined) {
var funct = ((typeof(thatObject) == "string") ? (thisObject[thatObject]) : (thatObject));
_local2.delegate = function (args) {
funct.call(thisObject, args);
};
} else {
_local2.delegate = thisObject;
}
return(_local2);
}
function compareDelegate(d_A, d_B) {
if ((d_A.thisObject != d_B.thisObject) || (d_A.thatObject != d_B.thatObject)) {
return(false);
}
return(true);
}
function addEventListener(event, thisObject, thatObject) {
removeEventListener(event, thisObject, thatObject);
eventTable[event].push(buildDelegate(thisObject, thatObject));
}
function removeEventListener(event, thisObject, thatObject) {
var _local3 = buildDelegate(thisObject, thatObject);
if (eventTable[event] == undefined) {
eventTable[event] = [];
return(undefined);
}
for (var _local4 in eventTable[event]) {
if (!compareDelegate(eventTable[event][_local4], _local3)) {
continue;
}
eventTable[event].splice(Number(_local4), 1);
}
}
function triggerEvent(event, args) {
if (eventTable[event] == undefined) {
return(undefined);
}
for (var _local4 in eventTable[event]) {
eventTable[event][_local4].delegate(args);
}
}
}
Symbol 1441 MovieClip [__Packages.mochi.as2.MochiServices] Frame 0
class mochi.as2.MochiServices
{
static var _id, _container, _clip, _sendChannelName, __get__comChannelName, onError, _listenChannel, _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("3.9.1 as2");
}
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";
initComChannels();
}
}
//return(__get__comChannelName());
}
static function get connected() {
return(_connected);
}
static function connect(id, clip, onError) {
warnID(id, false);
if ((!_connected) && (_clip == undefined)) {
trace("MochiServices Connecting...");
_connecting = true;
init(id, clip);
}
if (onError != undefined) {
mochi.as2.MochiServices.onError = onError;
} else if (mochi.as2.MochiServices.onError == undefined) {
mochi.as2.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();
}
}
static function init(id, clip) {
_id = id;
if (clip != undefined) {
_container = clip;
} else {
_container = _root;
}
loadCommunicator(id, _container);
}
static function loadCommunicator(id, clip) {
var _local6 = "_mochiservices_com_" + id;
var _local5 = new MovieClipLoader();
var _local3 = {};
if (_clip != null) {
return(_clip);
}
if (!isNetworkAvailable) {
return(null);
}
if (urlOptions().servURL) {
_servURL = urlOptions().servURL;
}
var _local4 = _servURL + _services;
if (urlOptions().servicesURL) {
_local4 = urlOptions().servicesURL;
}
allowDomains(_local4);
_clip = clip.createEmptyMovieClip(_local6, 10336, false);
_listenChannelName = _listenChannelName + ((Math.floor(new Date().getTime()) + "_") + Math.floor(Math.random() * 99999));
listen();
if (_local3.waitInterval != null) {
clearInterval(_local3.waitInterval);
}
_local3.onLoadError = loadError;
_local3.onLoadStart = function (target_mc) {
this.isLoading = true;
};
_local3.onLoadComplete = function (target_mc) {
target_mc.MochiServices = mochi.as2.MochiServices;
};
_local3.startTime = getTimer();
_local3.wait = function () {
if ((getTimer() - this.startTime) > 10000) {
if (!this.isLoading) {
mochi.as2.MochiServices.disconnect();
mochi.as2.MochiServices.onError.apply(null, ["IOError"]);
}
clearInterval(this.waitInterval);
}
};
_local3.waitInterval = setInterval(_local3, "wait", 1000);
_local5.addListener(_local3);
_local5.loadClip((((((_local4 + "?listenLC=") + _listenChannelName) + "&mochiad_options=") + escape(_root.mochiad_options)) + "&api_version=") + getVersion(), _clip);
_sendChannel = new LocalConnection();
_sendChannel._queue = [];
return(_clip);
}
static function loadError(target_mc, errorCode, httpStatus) {
trace("MochiServices could not load.");
disconnect();
onError.apply(null, [errorCode]);
}
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.as2.MochiServices.__set__comChannelName(args.newChannel);
};
_listenChannel.allowDomain = function (d) {
return(true);
};
_listenChannel.allowInsecureDomain = _listenChannel.allowDomain;
_listenChannel._nextcallbackID = 0;
_listenChannel._callbacks = {};
_listenChannel.connect(_listenChannelName);
trace("Waiting for MochiAds services to connect...");
}
static function initComChannels() {
if (!_connected) {
_sendChannel.onStatus = function (infoObject) {
mochi.as2.MochiServices.onStatus(infoObject);
};
_sendChannel.send(_sendChannelName, "onReceive", {methodName:"handshakeDone"});
_sendChannel.send(_sendChannelName, "onReceive", {methodName:"registerGame", id:_id, version:getVersion()});
_listenChannel.onStatus = function (infoObject) {
mochi.as2.MochiServices.onStatus(infoObject);
};
_listenChannel.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];
};
_listenChannel.onEvent = function (pkg) {
switch (pkg.target) {
case "services" :
mochi.as2.MochiServices.triggerEvent(pkg.event, pkg.args);
break;
case "events" :
mochi.as2.MochiEvents.triggerEvent(pkg.event, pkg.args);
break;
case "coins" :
mochi.as2.MochiCoins.triggerEvent(pkg.event, pkg.args);
break;
case "social" :
mochi.as2.MochiSocial.triggerEvent(pkg.event, pkg.args);
}
};
_listenChannel.onError = function () {
mochi.as2.MochiServices.onError.apply(null, ["IOError"]);
};
trace("[SERVICES_API] connected!");
_connecting = false;
_connected = true;
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 = _listenChannel._callbacks[_local1.callbackID];
}
delete _listenChannel._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:_listenChannel._nextcallbackID});
} else {
if ((_clip == undefined) || (!_connecting)) {
trace("Error: MochiServices not connected. Please call MochiServices.connect(). Function: " + methodName);
handleError(args, callbackObject, callbackMethod);
flush(true);
return(undefined);
}
_sendChannel._queue.push({methodName:methodName, args:args, callbackID:_listenChannel._nextcallbackID});
}
_listenChannel._callbacks[_listenChannel._nextcallbackID] = {callbackObject:callbackObject, callbackMethod:callbackMethod};
_listenChannel._nextcallbackID++;
}
static function urlOptions() {
var _local5 = {};
var _local6;
if (_root._url.indexOf("mochiad_options") != -1) {
var _local2 = (_root._url.indexOf("mochiad_options") + "mochiad_options".length) + 1;
_local6 = _root._url.substr(_local2, _root._url.length);
} else if (_root.mochiad_options) {
_local6 = _root.mochiad_options;
}
if (_local6) {
var _local4 = _root.mochiad_options.split("&");
var _local2 = 0;
while (_local2 < _local4.length) {
var _local3 = _local4[_local2].split("=");
_local5[unescape(_local3[0])] = unescape(_local3[1]);
_local2++;
}
}
return(_local5);
}
static function warnID(bid, leaderboard) {
bid = bid.toLowerCase();
if (bid.length != 16) {
trace(("WARNING: " + (leaderboard ? "board" : "game")) + " ID is not the appropriate length");
return(undefined);
}
if (bid == "1e113c7239048b3f") {
if (leaderboard) {
trace("WARNING: Using testing board ID");
} else {
trace("WARNING: Using testing board ID as game ID");
}
return(undefined);
}
if (bid == "84993a1de4031cd8") {
if (leaderboard) {
trace("WARNING: Using testing game ID as board ID");
} else {
trace("WARNING: Using testing game ID");
}
return(undefined);
}
var _local1 = 0;
while (_local1 < bid.length) {
switch (bid.charAt(_local1)) {
case "0" :
case "1" :
case "2" :
case "3" :
case "4" :
case "5" :
case "6" :
case "7" :
case "8" :
case "9" :
case "a" :
case "b" :
case "c" :
case "d" :
case "e" :
case "f" :
break;
default :
trace("WARNING: Board ID contains illegal characters: " + bid);
return(undefined);
}
_local1++;
}
}
static function addLinkEvent(url, burl, btn, onClick) {
var timeout = 1500;
var t0 = getTimer();
var _local2 = new Object();
_local2.mav = getVersion();
_local2.swfv = btn.getSWFVersion() || 6;
_local2.swfurl = btn._url;
_local2.fv = System.capabilities.version;
_local2.os = System.capabilities.os;
_local2.lang = System.capabilities.language;
_local2.scres = (System.capabilities.screenResolutionX + "x") + System.capabilities.screenResolutionY;
var s = "?";
var _local3 = 0;
for (var _local6 in _local2) {
if (_local3 != 0) {
s = s + "&";
}
_local3++;
s = ((s + _local6) + "=") + escape(_local2[_local6]);
}
if (!(netupAttempted || (_connected))) {
var ping = btn.createEmptyMovieClip("ping", 777);
var _local7 = btn.createEmptyMovieClip("nettest", 778);
netupAttempted = true;
ping.loadMovie("http://link.mochiads.com/linkping.swf?t=" + getTimer());
_local7.onEnterFrame = function () {
if ((ping._totalframes > 0) && (ping._totalframes == ping._framesloaded)) {
delete this.onEnterFrame;
} else if ((getTimer() - t0) > timeout) {
delete this.onEnterFrame;
mochi.as2.MochiServices.netup = false;
}
};
}
var _local4 = btn.createEmptyMovieClip("clk", 1001);
_local4._alpha = 0;
_local4.beginFill(1044735);
_local4.moveTo(0, 0);
_local4.lineTo(0, btn._height);
_local4.lineTo(btn._width, btn._height);
_local4.lineTo(btn._width, 0);
_local4.lineTo(0, 0);
_local4.endFill();
_local4.onRelease = function () {
if (mochi.as2.MochiServices.netup) {
getURL (url + s, "_blank");
} else {
getURL (burl, "_blank");
}
if (onClick != undefined) {
onClick();
}
};
}
static function setContainer(clip) {
}
static function stayOnTop(clip) {
}
static function addEventListener(eventType, thisObject, thatObject) {
_dispatcher.addEventListener(eventType, thisObject, thatObject);
}
static function triggerEvent(eventType, args) {
_dispatcher.triggerEvent(eventType, args);
}
static function removeEventListener(eventType, thisObject, thatObject) {
_dispatcher.removeEventListener(eventType, thisObject, thatObject);
}
static var CONNECTED = "onConnected";
static var _servURL = "http://www.mochiads.com/static/lib/services/";
static var _services = "services.swf";
static var _mochiLC = "MochiLC.swf";
static var _listenChannelName = "__ms_";
static var _connecting = false;
static var _connected = false;
static var netup = true;
static var netupAttempted = false;
static var _dispatcher = new mochi.as2.MochiEventDispatcher();
}
Symbol 1442 MovieClip [__Packages.mochi.as2.MochiEvents] Frame 0
class mochi.as2.MochiEvents
{
function MochiEvents () {
}
static function getVersion() {
return(mochi.as2.MochiServices.getVersion());
}
static function startSession(achievementID) {
mochi.as2.MochiServices.send("events_beginSession", {achievementID:achievementID}, null, null);
}
static function setNotifications(clip, style) {
var _local2 = {};
for (var _local3 in style) {
_local2[_local3] = style[_local3];
}
_local2.clip = clip;
mochi.as2.MochiServices.send("events_setNotifications", _local2, null, null);
}
static function addEventListener(eventType, thisObject, thatObject) {
_dispatcher.addEventListener(eventType, thisObject, thatObject);
}
static function triggerEvent(eventType, args) {
_dispatcher.triggerEvent(eventType, args);
}
static function removeEventListener(eventType, thisObject, thatObject) {
_dispatcher.removeEventListener(eventType, thisObject, thatObject);
}
static function startPlay(tag) {
if (tag == undefined) {
tag = "gameplay";
}
mochi.as2.MochiServices.send("events_setRoundID", {tag:String(tag)}, null, null);
}
static function endPlay() {
mochi.as2.MochiServices.send("events_clearRoundID", null, null, null);
}
static function trackEvent(tag, value) {
mochi.as2.MochiServices.send("events_trackEvent", {tag:tag, value:value}, null, null);
}
static var ACHIEVEMENT_RECEIVED = "AchievementReceived";
static var ALIGN_TOP_LEFT = "ALIGN_TL";
static var ALIGN_TOP = "ALIGN_T";
static var ALIGN_TOP_RIGHT = "ALIGN_TR";
static var ALIGN_LEFT = "ALIGN_L";
static var ALIGN_CENTER = "ALIGN_C";
static var ALIGN_RIGHT = "ALIGN_R";
static var ALIGN_BOTTOM_LEFT = "ALIGN_BL";
static var ALIGN_BOTTOM = "ALIGN_B";
static var ALIGN_BOTTOM_RIGHT = "ALIGN_BR";
static var FORMAT_SHORT = "ShortForm";
static var FORMAT_LONG = "LongForm";
static var _dispatcher = new mochi.as2.MochiEventDispatcher();
}
Symbol 1443 MovieClip [__Packages.mochi.as2.MochiCoins] Frame 0
class mochi.as2.MochiCoins
{
function MochiCoins () {
}
static function getVersion() {
return(mochi.as2.MochiServices.getVersion());
}
static function showStore(options) {
mochi.as2.MochiServices.send("coins_showStore", {options:options}, null, null);
}
static function showItem(options) {
if ((options == undefined) || (typeof(options.item) != "string")) {
trace("ERROR: showItem call must pass an Object with an item key");
return(undefined);
}
mochi.as2.MochiServices.send("coins_showItem", {options:options}, null, null);
}
static function showVideo(options) {
if ((options == undefined) || (typeof(options.item) != "string")) {
trace("ERROR: showVideo call must pass an Object with an item key");
return(undefined);
}
mochi.as2.MochiServices.send("coins_showVideo", {options:options}, null, null);
}
static function getStoreItems() {
mochi.as2.MochiServices.send("coins_getStoreItems");
}
static function requestFunding(properties) {
mochi.as2.MochiServices.send("social_requestFunding", properties);
}
static function addEventListener(eventType, delegate) {
_dispatcher.addEventListener(eventType, delegate);
}
static function triggerEvent(eventType, args) {
_dispatcher.triggerEvent(eventType, args);
}
static function removeEventListener(eventType, delegate) {
_dispatcher.removeEventListener(eventType, delegate);
}
static var STORE_SHOW = "StoreShow";
static var STORE_HIDE = "StoreHide";
static var ITEM_OWNED = "ItemOwned";
static var ITEM_NEW = "ItemNew";
static var STORE_ITEMS = "StoreItems";
static var ERROR = "Error";
static var IO_ERROR = "IOError";
static var NO_USER = "NoUser";
static var _dispatcher = new mochi.as2.MochiEventDispatcher();
}
Symbol 1444 MovieClip [__Packages.mochi.as2.MochiSocial] Frame 0
class mochi.as2.MochiSocial
{
function MochiSocial () {
}
static function getVersion() {
return(mochi.as2.MochiServices.getVersion());
}
static function showLoginWidget(options) {
mochi.as2.MochiServices.setContainer();
mochi.as2.MochiServices.stayOnTop();
mochi.as2.MochiServices.send("social_showLoginWidget", {options:options});
}
static function hideLoginWidget() {
mochi.as2.MochiServices.send("social_hideLoginWidget");
}
static function requestLogin(properties) {
mochi.as2.MochiServices.send("social_requestLogin", properties);
}
static function getFriendsList(properties) {
mochi.as2.MochiServices.send("social_getFriendsList", properties);
}
static function postToStream(properties) {
mochi.as2.MochiServices.send("social_postToStream", properties);
}
static function inviteFriends(properties) {
mochi.as2.MochiServices.send("social_inviteFriends", properties);
}
static function requestFan(properties) {
mochi.as2.MochiServices.send("social_requestFan", properties);
}
static function saveUserProperties(properties) {
mochi.as2.MochiServices.send("social_saveUserProperties", properties);
}
static function addEventListener(eventType, delegate) {
_dispatcher.addEventListener(eventType, delegate);
}
static function triggerEvent(eventType, args) {
_dispatcher.triggerEvent(eventType, args);
}
static function removeEventListener(eventType, delegate) {
_dispatcher.removeEventListener(eventType, delegate);
}
static var LOGGED_IN = "LoggedIn";
static var LOGGED_OUT = "LoggedOut";
static var LOGIN_SHOW = "LoginShow";
static var LOGIN_HIDE = "LoginHide";
static var LOGIN_SHOWN = "LoginShown";
static var PROFILE_SHOW = "ProfileShow";
static var PROFILE_HIDE = "ProfileHide";
static var PROPERTIES_SAVED = "PropertySaved";
static var WIDGET_LOADED = "WidgetLoaded";
static var FRIEND_LIST = "FriendsList";
static var PROFILE_DATA = "ProfileData";
static var GAMEPLAY_DATA = "GameplayData";
static var ACTION_CANCELED = "onCancel";
static var ACTION_COMPLETE = "onComplete";
static var USER_INFO = "UserInfo";
static var ERROR = "Error";
static var IO_ERROR = "IOError";
static var NO_USER = "NoUser";
static var PROPERTIES_SIZE = "PropertiesSize";
static var _dispatcher = new mochi.as2.MochiEventDispatcher();
}
Symbol 1445 MovieClip [__Packages.mochi.as2.MochiScores] Frame 0
class mochi.as2.MochiScores
{
static var boardID, onClose, onError;
function MochiScores () {
}
static function setBoardID(boardID) {
mochi.as2.MochiServices.warnID(boardID, true);
mochi.as2.MochiScores.boardID = boardID;
mochi.as2.MochiServices.send("scores_setBoardID", {boardID:boardID});
}
static function showLeaderboard(options) {
options.clip = mochi.as2.MochiServices.clip;
if ((options.clip != mochi.as2.MochiServices.__get__clip()) || (mochi.as2.MochiServices.__get__childClip()._target == undefined)) {
mochi.as2.MochiServices.disconnect();
trace("WARNING! This application is attempting to connect to MochiServices inside a showLeaderboard call!");
trace("make sure MochiServices.connect is called as early in the application runtime as possible.");
mochi.as2.MochiServices.connect(mochi.as2.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 (options.score instanceof TextField) {
if (options.score.text != undefined) {
options.score = options.score.text;
}
} else if (options.score instanceof mochi.as2.MochiDigits) {
options.score = options.score.value;
}
var _local1 = Number(options.score);
if (isNaN(_local1)) {
trace(("ERROR: Submitted score '" + options.score) + "' will be rejected, score is 'Not a Number'");
} else if ((_local1 == Number.NEGATIVE_INFINITY) || (_local1 == Number.POSITIVE_INFINITY)) {
trace(("ERROR: Submitted score '" + options.score) + "' will be rejected, score is an infinite");
} else {
if (Math.floor(_local1) != _local1) {
trace(("WARNING: Submitted score '" + options.score) + "' will be truncated");
}
options.score = _local1;
}
}
if (options.onDisplay != null) {
options.onDisplay();
} else {
mochi.as2.MochiServices.__get__clip().stop();
}
if (options.onClose != null) {
onClose = options.onClose;
} else {
onClose = function () {
mochi.as2.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.as2.MochiServices.warnID(options.boardID, true);
trace("[MochiScores] NOTE: Security Sandbox Violation errors below are normal");
mochi.as2.MochiServices.send("scores_showLeaderboard", {options:options}, null, doClose);
}
static function closeLeaderboard() {
mochi.as2.MochiServices.send("scores_closeLeaderboard");
}
static function getPlayerInfo(callbackObj, callbackMethod) {
mochi.as2.MochiServices.send("scores_getPlayerInfo", null, callbackObj, callbackMethod);
}
static function submit(score, name, callbackObj, callbackMethod) {
score = Number(score);
if (isNaN(score)) {
trace(("ERROR: Submitted score '" + String(score)) + "' will be rejected, score is 'Not a Number'");
} else if ((score == Number.NEGATIVE_INFINITY) || (score == Number.POSITIVE_INFINITY)) {
trace(("ERROR: Submitted score '" + String(score)) + "' will be rejected, score is an infinite");
} else {
if (Math.floor(score) != score) {
trace(("WARNING: Submitted score '" + String(score)) + "' will be truncated");
}
score = Number(score);
}
mochi.as2.MochiServices.send("scores_submit", {score:score, name:name}, callbackObj, callbackMethod);
}
static function requestList(callbackObj, callbackMethod) {
mochi.as2.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 1446 MovieClip [__Packages.mochi.as2.MochiDigits] Frame 0
class mochi.as2.MochiDigits
{
var Encoder, Fragment, Sibling;
function MochiDigits (digit, index) {
Encoder = 0;
setValue(digit, index);
}
function get value() {
return(Number(toString()));
}
function set value(v) {
setValue(v);
//return(value);
}
function addValue(v) {
value = value + v;
}
function setValue(digit, index) {
var _local3 = digit.toString();
if ((index == undefined) || (isNaN(index))) {
index = 0;
}
Fragment = _local3.charCodeAt(index++) ^ Encoder;
if (index < _local3.length) {
Sibling = new mochi.as2.MochiDigits(digit, index);
} else {
Sibling = null;
}
reencode();
}
function reencode() {
var _local2 = int(2147483647 * Math.random());
Fragment = Fragment ^ (_local2 ^ Encoder);
Encoder = _local2;
}
function toString() {
var _local2 = String.fromCharCode(Fragment ^ Encoder);
return(((Sibling != null) ? (_local2.concat(Sibling.toString())) : (_local2)));
}
}
Symbol 310 MovieClip Frame 1
stop();
Symbol 315 MovieClip Frame 1
stop();
Symbol 320 MovieClip Frame 1
stop();
Symbol 325 MovieClip Frame 1
stop();
Symbol 330 MovieClip Frame 1
stop();
Symbol 335 MovieClip Frame 1
stop();
Symbol 340 MovieClip Frame 1
stop();
Symbol 353 MovieClip Frame 1
stop();
Symbol 357 MovieClip Frame 1
stop();
Symbol 361 MovieClip Frame 1
stop();
Symbol 365 MovieClip Frame 1
stop();
Symbol 369 MovieClip Frame 1
stop();
Symbol 373 MovieClip Frame 1
stop();
Symbol 377 MovieClip Frame 1
stop();
Symbol 405 MovieClip Frame 1
stop();
Symbol 417 MovieClip Frame 1
stop();
Symbol 422 MovieClip Frame 1
stop();
Symbol 427 MovieClip Frame 1
stop();
Symbol 440 MovieClip Frame 1
stop();
Symbol 456 MovieClip Frame 1
stop();
Symbol 456 MovieClip Frame 4
stop();
Symbol 491 MovieClip Frame 1
stop();
Symbol 497 MovieClip Frame 1
stop();
Symbol 505 MovieClip Frame 1
stop();
Symbol 513 MovieClip Frame 1
stop();
Symbol 516 MovieClip Frame 1
stop();
Symbol 526 MovieClip Frame 1
stop();
Symbol 530 MovieClip Frame 1
stop();
Symbol 534 MovieClip Frame 1
stop();
Symbol 538 MovieClip Frame 1
stop();
Symbol 542 MovieClip Frame 1
stop();
Symbol 546 MovieClip Frame 1
stop();
Symbol 550 MovieClip Frame 1
stop();
Symbol 607 MovieClip Frame 7
stop();
Symbol 636 MovieClip Frame 1
stop();
Symbol 640 MovieClip Frame 1
stop();
Symbol 648 MovieClip Frame 1
stop();
Symbol 652 MovieClip Frame 1
stop();
Symbol 656 MovieClip Frame 1
stop();
Symbol 719 MovieClip Frame 1
stop();
this.onEnterFrame = function () {
if (((Math.abs(this._xmouse) < 18) && (Math.abs(this._ymouse) < 18)) && (_root.lPropsY == 425)) {
if (this._currentframe == 1) {
gotoAndPlay (2);
}
}
};
Instance of Symbol 704 MovieClip in Symbol 719 MovieClip Frame 1
onClipEvent (load) {
this._visible = false;
}
Symbol 719 MovieClip Frame 7
stop();
this.onEnterFrame = function () {
if ((Math.abs(this._xmouse) > 15) || (Math.abs(this._ymouse) > 15)) {
if (this._currentframe == 7) {
gotoAndPlay (8);
}
}
};
Symbol 725 MovieClip Frame 1
stop();
this.onEnterFrame = function () {
if (((Math.abs(this._xmouse) < 15) && (Math.abs(this._ymouse) < 15)) && (_root.lPropsY == 425)) {
if (this._currentframe == 1) {
gotoAndPlay (2);
}
}
};
Instance of Symbol 704 MovieClip in Symbol 725 MovieClip Frame 1
onClipEvent (load) {
this._visible = false;
}
Symbol 725 MovieClip Frame 7
stop();
this.onEnterFrame = function () {
if ((Math.abs(this._xmouse) > 15) || (Math.abs(this._ymouse) > 15)) {
if (this._currentframe == 7) {
gotoAndPlay (8);
}
}
};
Symbol 729 MovieClip Frame 1
stop();
this.onEnterFrame = function () {
if (((Math.abs(this._xmouse) < 15) && (Math.abs(this._ymouse) < 15)) && (_root.lPropsY == 425)) {
if (this._currentframe == 1) {
gotoAndPlay (2);
}
}
};
Instance of Symbol 704 MovieClip in Symbol 729 MovieClip Frame 1
onClipEvent (load) {
this._visible = false;
}
Symbol 729 MovieClip Frame 7
stop();
this.onEnterFrame = function () {
if ((Math.abs(this._xmouse) > 15) || (Math.abs(this._ymouse) > 15)) {
if (this._currentframe == 7) {
gotoAndPlay (8);
}
}
};
Symbol 755 MovieClip Frame 1
stop();
Symbol 777 MovieClip Frame 1
stop();
bg._yscale = 100;
Instance of Symbol 741 MovieClip in Symbol 777 MovieClip Frame 1
onClipEvent (load) {
if (_root.obSelect.canSpeed && (_root.obSelect != 18)) {
} else {
this._visible = false;
}
}
on (release) {
_root.obSelect.speed._x = 0;
_root.obSelect.speed._y = 0;
}
Symbol 777 MovieClip Frame 2
stop();
dragger._x = _root.obSelect.orbs * 3.75;
bg._yscale = 100;
onEnterFrame = function () {
orbNum = "Orbs :" + Math.round(20 * (dragger._x / 75));
_root.obSelect.orbs = Math.round(20 * (dragger._x / 75));
};
dragger.onPress = function () {
startDrag (dragger, true, 0, 0, 75, 0);
};
dragger.onRelease = function () {
stopDrag();
};
dragger.onReleaseOutside = function () {
stopDrag();
};
Symbol 777 MovieClip Frame 3
dirDragger._x = _root.obSelect.dir * 18.75;
speedDragger._x = 3.94736842105263 * (_root.obSelect.speedVal - 1);
arrowPic.gotoAndStop(_root.obSelect.dir);
chanceDragger._x = 0.75 * _root.obSelect.randChance;
bg._yscale = 250;
onEnterFrame = function () {
_root.obSelect.dir = Math.round(4 * (dirDragger._x / 75));
_root.obSelect.speedVal = Math.round(19 * (speedDragger._x / 75)) + 1;
_root.obSelect.randChance = Math.round(100 * (chanceDragger._x / 75));
arrowPic.gotoAndStop(_root.obSelect.dir);
speedNum = "Speed: " + _root.obSelect.speedVal;
chanceNum = "Chance: " + _root.obSelect.randChance;
};
_root.sliderDrag(dirDragger);
_root.sliderDrag(speedDragger);
_root.sliderDrag(chanceDragger);
Symbol 777 MovieClip Frame 4
stop();
dragger._x = _root.obSelect.orbs * 3.75;
spinDragger._x = _root.obSelect.spinSpeed * 2.5;
bg._yscale = 175;
onEnterFrame = function () {
orbNum = "Orbs :" + Math.round(20 * (dragger._x / 75));
spinNum = "Spin Speed :" + Math.round(30 * (spinDragger._x / 75));
_root.obSelect.orbs = Math.round(20 * (dragger._x / 75));
_root.obSelect.spinSpeed = Math.round(30 * (spinDragger._x / 75));
};
_root.sliderDrag(dragger);
_root.sliderDrag(spinDragger);
Symbol 777 MovieClip Frame 5
stop();
dragger._x = _root.obSelect.orbs * 3.75;
sizeDragger._x = _root.obSelect.endSize * 0.107142857142857;
bg._yscale = 175;
onEnterFrame = function () {
_root.obSelect.orbs = Math.round(20 * (dragger._x / 75));
_root.obSelect.endSize = Math.round(700 * (sizeDragger._x / 75));
orbNum = "Orbs: " + _root.obSelect.orbs;
sizeNum = "Size: " + _root.obSelect.endSize;
};
_root.sliderDrag(dragger);
_root.sliderDrag(sizeDragger);
Symbol 777 MovieClip Frame 6
dragger._x = _root.obSelect.orbs * 3.75;
alphaDragger._x = _root.obSelect.endAlpha * 0.75;
bg._yscale = 175;
onEnterFrame = function () {
_root.obSelect.orbs = Math.round(20 * (dragger._x / 75));
_root.obSelect.endAlpha = Math.round(100 * (alphaDragger._x / 75));
orbNum = "Orbs: " + _root.obSelect.orbs;
alphaNum = "Alpha: " + _root.obSelect.endAlpha;
};
_root.sliderDrag(dragger);
_root.sliderDrag(alphaDragger);
Symbol 777 MovieClip Frame 7
chanceDragger._x = _root.obSelect.randChance * 1.5;
typeDragger._x = 25 * (_root.obSelect.bullType - 1);
bg._yscale = 175;
onEnterFrame = function () {
_root.obSelect.randChance = Math.round(50 * (chanceDragger._x / 75));
_root.obSelect.bullType = Math.round(3 * (typeDragger._x / 75)) + 1;
chanceNum = "Chance: " + _root.obSelect.randChance;
bulletPic.gotoAndStop(_root.obSelect.bullType);
};
_root.sliderDrag(chanceDragger);
_root.sliderDrag(typeDragger);
Symbol 777 MovieClip Frame 8
inputDragger._x = 12.5 * (_root.obSelect.inPut - 1);
outputDragger._x = 12.5 * (_root.obSelect.outPut - 1);
bg._yscale = 175;
onEnterFrame = function () {
_root.obSelect.inPut = Math.round(6 * (inputDragger._x / 75)) + 1;
_root.obSelect.outPut = Math.round(6 * (outputDragger._x / 75)) + 1;
inputNum = "Input: " + _root.obSelect.inPut;
outputNum = "Output: " + _root.obSelect.outPut;
};
_root.sliderDrag(inputDragger);
_root.sliderDrag(outputDragger);
Symbol 777 MovieClip Frame 9
growDragger._x = 12.5 * _root.obSelect.growSpeed;
shrinkDragger._x = 3.75 * _root.obSelect.shrinkSpeed;
bg._yscale = 175;
onEnterFrame = function () {
_root.obSelect.growSpeed = Math.round(5 * (growDragger._x / 75));
_root.obSelect.shrinkSpeed = Math.round(20 * (shrinkDragger._x / 75));
growNum = "Grow: " + _root.obSelect.growSpeed;
shrinkNum = "Shrink: " + _root.obSelect.shrinkSpeed;
};
_root.sliderDrag(growDragger);
_root.sliderDrag(shrinkDragger);
Symbol 777 MovieClip Frame 10
stop();
dragger._x = _root.obSelect.orbs * 3.75;
speedDragger._x = (_root.obSelect.speedVal - 20) * 1.25;
bg._yscale = 175;
onEnterFrame = function () {
_root.obSelect.orbs = Math.round(20 * (dragger._x / 75));
_root.obSelect.speedVal = 20 + Math.round(60 * (speedDragger._x / 75));
orbNum = "Orbs: " + _root.obSelect.orbs;
sizeNum = "Speed: " + _root.obSelect.speedVal;
};
_root.sliderDrag(dragger);
_root.sliderDrag(speedDragger);
Symbol 777 MovieClip Frame 11
gotoAndStop(_root.propBarType[_root.obSelect.type]);
Symbol 793 MovieClip Frame 1
stop();
Symbol 824 MovieClip Frame 1
stop();
Symbol 827 MovieClip Frame 1
stop();
Symbol 827 MovieClip Frame 2
stop();
Symbol 850 MovieClip Frame 1
stop();
Symbol 857 MovieClip Frame 1
stop();
Symbol 857 MovieClip Frame 33
if (_root.musicOn) {
_root.gunReload.start();
}
Symbol 857 MovieClip Frame 91
if (_root.musicOn) {
_root.gunShot.start();
}
Symbol 857 MovieClip Frame 110
if (_root.musicOn) {
_root.gunShot.start();
}
Symbol 857 MovieClip Frame 153
stop();
Symbol 876 MovieClip Frame 1
stop();
Symbol 876 MovieClip Frame 110
stop();
Symbol 876 MovieClip Frame 142
stop();
Symbol 882 MovieClip Frame 1
stop();
Symbol 897 MovieClip Frame 1
stop();
Symbol 897 MovieClip Frame 30
stop();
Symbol 917 MovieClip Frame 1
this._parent._xscale = (this._parent._yscale = 50 + random(80));
Symbol 917 MovieClip Frame 17
stop();
Symbol 918 MovieClip Frame 1
gotoAndStop(random(11) + 1);
Symbol 921 MovieClip Frame 1
stop();
Symbol 921 MovieClip Frame 75
gotoAndPlay (50);
Symbol 921 MovieClip Frame 76
stop();
Symbol 921 MovieClip Frame 151
stop();
Symbol 926 MovieClip Frame 7
gotoAndPlay (1);
Symbol 961 MovieClip Frame 10
stop();
Symbol 962 MovieClip Frame 11
stop();
Symbol 1015 MovieClip Frame 44
stop();
Symbol 1015 MovieClip Frame 67
stop();
Symbol 1015 MovieClip Frame 92
gotoAndStop (44);
Symbol 1015 MovieClip Frame 118
stop();
Symbol 1015 MovieClip Frame 137
stop();
Symbol 1015 MovieClip Frame 269
stop();
Symbol 1015 MovieClip Frame 329
gotoAndStop (44);
Symbol 1015 MovieClip Frame 375
stop();
Symbol 1015 MovieClip Frame 421
gotoAndStop (44);
Symbol 1015 MovieClip Frame 471
stop();
Symbol 1015 MovieClip Frame 521
gotoAndStop (44);
Symbol 1015 MovieClip Frame 650
stop();
Symbol 1096 MovieClip Frame 1
stop();
Symbol 1110 MovieClip Frame 1
stop();
Symbol 1122 MovieClip Frame 1
stop();
Symbol 1126 MovieClip Frame 1
stop();
Symbol 1131 MovieClip Frame 1
stop();
Symbol 1131 MovieClip Frame 30
stop();
Symbol 1132 MovieClip Frame 1
stop();
Symbol 1132 MovieClip Frame 122
stop();
Instance of Symbol 254 MovieClip [orb] in Symbol 1139 MovieClip Frame 1
onClipEvent (load) {
this._parent._visible = false;
_root.makeOrb(this._parent._x, this._parent._y, this._parent._x, this._parent._y, true);
}
Symbol 1167 MovieClip Frame 1
stop();
Symbol 1170 MovieClip Frame 1
gotoAndPlay(2 + random(60));
Symbol 1170 MovieClip Frame 88
gotoAndPlay (61);
Symbol 1181 MovieClip Frame 1
onEnterFrame = function () {
if (punch._currentframe == 1) {
if (_root.punchPad.hitTest(_root.cursor._x, _root.cursor._y, true)) {
punch.gotoAndPlay(2);
}
}
circle._rotation = circle._rotation + 0.8;
};
Symbol 1184 MovieClip Frame 1
pad._visible = false;
Symbol 1220 MovieClip Frame 1
stop();
Symbol 1220 MovieClip Frame 1088
stop();
Symbol 1234 MovieClip Frame 1
stop();
Symbol 1234 MovieClip Frame 40
stop();
Symbol 1239 MovieClip Frame 1
stop();
Symbol 1243 MovieClip Frame 6
gotoAndPlay (1);
Symbol 1243 MovieClip Frame 21
stop();
Symbol 1246 MovieClip Frame 6
gotoAndPlay (1);
Symbol 1246 MovieClip Frame 21
stop();
Symbol 1249 MovieClip Frame 6
gotoAndPlay (1);
Symbol 1249 MovieClip Frame 21
stop();
Symbol 1252 MovieClip Frame 6
gotoAndPlay (1);
Symbol 1252 MovieClip Frame 21
stop();
Symbol 1286 MovieClip Frame 1
stop();
Symbol 1286 MovieClip Frame 57
stop();
Symbol 1319 MovieClip Frame 1
stop();
Symbol 1341 MovieClip Frame 1
stop();
Symbol 1343 MovieClip Frame 1
stop();
Symbol 1345 MovieClip Frame 1
stop();
Symbol 1347 MovieClip Frame 1
stop();
Symbol 1350 MovieClip Frame 1
stop();
Symbol 1353 MovieClip Frame 1
stop();
Symbol 1357 MovieClip Frame 1
stop();
Symbol 1359 MovieClip Frame 1
stop();
Symbol 1361 MovieClip Frame 1
stop();
Symbol 1363 MovieClip Frame 1
stop();
Symbol 1365 MovieClip Frame 1
stop();
Symbol 1367 MovieClip Frame 1
stop();
Symbol 1369 MovieClip Frame 1
stop();
Symbol 1373 MovieClip Frame 1
stop();
Symbol 1376 MovieClip Frame 1
stop();
Symbol 1379 MovieClip Frame 1
stop();
Symbol 1382 MovieClip Frame 1
stop();
Symbol 1385 MovieClip Frame 1
stop();
Symbol 1387 MovieClip Frame 1
stop();
Symbol 1389 MovieClip Frame 1
stop();
Symbol 1391 MovieClip Frame 1
stop();
Symbol 1395 MovieClip Frame 1
stop();
Symbol 1418 MovieClip Frame 1
stop();
Symbol 1420 MovieClip Frame 1
stop();
Symbol 1421 MovieClip Frame 1
stop();
Symbol 1422 MovieClip Frame 1
stop();
Symbol 1423 MovieClip Frame 1
stop();
Symbol 1435 MovieClip Frame 1
stop();
Symbol 1437 MovieClip Frame 1
stop();