Frame 1
var leaderboardID = "6a3e4e7619666fb8";
mochi.MochiServices.connect("e8b8145527e9fb49");
function __com_mochibot__(swfid, mc, lv, trk) {
var x;
var g;
var s;
var fv;
var sb;
var u;
var res;
var mb;
var mbc;
var pv;
mb = "__mochibot__";
mbc = "mochibot.com";
g = (_global ? (_global) : (_level0._root));
if (g[mb + swfid]) {
return(g[mb + swfid]);
}
s = System.security;
x = mc._root.getSWFVersion;
fv = (x ? (mc.getSWFVersion()) : ((_global ? 6 : 5)));
if (!s) {
s = {};
}
sb = s.sandboxType;
if (sb == "localWithFile") {
return(null);
}
x = s.allowDomain;
if (x) {
s.allowDomain(mbc);
}
x = s.allowInsecureDomain;
if (x) {
s.allowInsecureDomain(mbc);
}
pv = ((fv == 5) ? (getVersion()) : (System.capabilities.version));
u = (((((((((((("http://" + mbc) + "/my/core.swf?mv=8&fv=") + fv) + "&v=") + escape(pv)) + "&swfid=") + escape(swfid)) + "&l=") + lv) + "&f=") + mc) + (sb ? ("&sb=" + sb) : "")) + (trk ? "&t=1" : "");
lv = ((fv > 6) ? (mc.getNextHighestDepth()) : ((g[mb + "level"] ? (g[mb + "level"] + 1) : (lv))));
g[mb + "level"] = lv;
if (fv == 5) {
res = "_level" + lv;
if (!eval (res)) {
loadMovieNum (u, lv);
}
} else {
res = mc.createEmptyMovieClip(mb + swfid, lv);
res.loadMovie(u);
}
return(res);
}
__com_mochibot__("2d0d8622", this, 10301, true);
sounds = new Object();
sounds.fire = new Sound();
sounds.fire.attachSound("takeoff");
sounds.planet = new Sound();
sounds.planet.attachSound("planet");
sounds.pickupFx = new Sound();
sounds.pickupFx.attachSound("pickupFx");
sounds.musicObject = new Sound();
sounds.musicObject.attachSound("music");
sounds.doh = new Sound();
sounds.doh.attachSound("doh");
sounds.cheer = new Sound();
sounds.cheer.attachSound("cheer");
sounds.ohno = new Sound();
sounds.ohno.attachSound("ohno");
sounds.bounceFx = new Sound();
sounds.bounceFx.attachSound("bounceFx");
sounds.extraLifeFx = new Sound();
sounds.extraLifeFx.attachSound("bonusx4");
sounds.levelComplete = new Sound();
sounds.levelComplete.attachSound("GainLife");
sounds.Explosion = new Sound();
sounds.Explosion.attachSound("explosion");
sounds.GameOverRobot = new Sound();
sounds.GameOverRobot.attachSound("gameoverFx");
sounds.Appear = new Sound();
sounds.Appear.attachSound("Appear");
sounds.GotSaucer = new Sound();
sounds.GotSaucer.attachSound("GotSaucer");
sounds.enterGame = new Sound();
sounds.enterGame.attachSound("entergame");
Frame 2
sounds.musicObject.start(0, 1000);
var asteroidFrame = 4;
var sunFrame = 3;
var sunMass = 40;
var enemies1 = new Array();
var enemies2 = new Array();
var enemies3 = new Array();
var enemies4 = new Array();
var enemies5 = new Array();
var enemies6 = new Array();
var enemies7 = new Array();
var enemies8 = new Array();
var enemies9 = new Array("alien");
var enemies10 = new Array();
var enemies11 = new Array();
var enemies12 = new Array("alien");
var enemies13 = new Array();
var enemies14 = new Array("alien");
var enemies15 = new Array("alien");
var enemies = new Array(enemies1, enemies2, enemies3, enemies4, enemies5, enemies6, enemies7, enemies8, enemies9, enemies10, enemies11, enemies12, enemies13, enemies14, enemies15, enemies16, enemies17, enemies18, enemies19, enemies20);
var numberToComplete = new Array(13, 4, 6, 5, 5, 6, 2, 6, 6, 5, 5, 4, 5, 5, 5, 6, 8, 9, 10, 11, 12);
var numberOfObstacles = new Array(25, 4, 6, 5, 5, 6, 2, 6, 5, 4, 5, 3, 3, 3, 2, 2, 4, 4, 4, 4, 5);
var numberOfObstacles2 = new Array(25, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 2, 2, 3, 3, 4, 5, 6, 7, 7);
var numberOfSuns = new Array(0, 1, 1, 1, 1, 1, 1, 2, 1, 1, 2, 5, 3, 3, 2, 3, 1, 2, 2, 2, 2);
var numberOfAsteroids = new Array(0, 0, 0, 1, 3, 5, 8, 2, 3, 4, 5, 4, 5, 5, 5, 6, 9, 2, 2, 2, 2);
function setupGame() {
Game = new GameGame(gameMc, this, 736, 576, 138, 32, startLives);
Presentation = new GamePresentation(this);
Presentation.setupSplashScreen(splashScreenElements);
this.onEnterFrame = mainLoop;
}
function runSounds() {
if (soundFade == "out") {
soundFadeControl = soundFadeControl - 2;
setAllSounds(soundFadeControl);
if (soundFadeControl == 0) {
soundSwitch = "off";
soundFade = "done";
}
} else if (soundFade == "in") {
soundFadeControl = soundFadeControl + 2;
setAllSounds(soundFadeControl);
if (soundFadeControl >= 50) {
soundSwitch = "on";
soundFade = "done";
}
}
}
function setAllSounds(soundFadeControl) {
sounds.fire.setVolume(soundFadeControl);
sounds.fireMissile.setVolume(soundFadeControl);
sounds.musicObject.setVolume(soundFadeControl);
sounds.doh.setVolume(soundFadeControl);
sounds.cheer.setVolume(soundFadeControl);
sounds.popFX.setVolume(soundFadeControl);
sounds.extraPoints.setVolume(soundFadeControl);
sounds.levelComplete.setVolume(soundFadeControl);
sounds.pickupFx.setVolume(soundFadeControl);
sounds.GameOverRobot.setVolume(soundFadeControl);
sounds.Appear.setVolume(soundFadeControl);
sounds.bounceFx.setVolume(soundFadeControl);
}
function quitGame() {
obj.vx = 0;
obj.vy = 0;
Player.gun = Player.mC.attachMovie("arrow1", "TurretMc", 1);
obj.clip.removeMovieClip();
Game.msgMc.removeMovieClip();
Game.oxygenLevel = 100;
Game.gameState = "game_over_restart";
}
function clearSprites() {
var _local3 = Game.missilesArray.length - 1;
var _local1 = _local3;
while (_local1 >= 0) {
Game.missilesArray[_local1].remove();
_local1--;
}
var _local2 = Game.enemyArray.length - 1;
_local1 = _local2;
while (_local1 >= 0) {
Game.enemyArray[_local1].remove();
_local1--;
}
}
function mainLoop() {
runSounds();
if (Game.gameState == "setup") {
clearSprites();
Game.setupGerms();
Player = new GamePlayer(Game.playerMc, this, 300, 300);
Player.findPlanetToStart();
Game.setupEnemies();
Game.clockDelay = 20;
Presentation.splashScreenMc.removeMovieClip();
Game.msgMc = Game.inGameMsgsMc.attachMovie("getReadyMsgAnim", "getready", 1);
Game.msgMc._x = Game.movieWidth / 2;
Game.msgMc._y = (Game.movieHeight / 2) - 40;
obj.vx = 3;
obj.vy = 0;
obj.x = Game.xPlayerStart;
obj.y = Game.yPlayerStart;
Game.minutes = Game.StartTimer;
Game.sec = 0;
Game.oxygenLevel = 100;
Game.setOxygen();
Game.displayTime();
Game.goodGuysArray.splice(0);
Game.sizeTarget = numberToComplete[Game.levelNumber];
Game.lives = startLives;
Game.setLives();
Game.setTarget();
Game.setScore();
Game.setLevel();
if (musicPlaying == "off") {
Game.turnMusicOff();
} else {
Game.turnMusicOn();
}
Game.gameState = "pre_start";
} else if (Game.gameState == "start_new_level") {
Game.levelNumber++;
clearSprites();
Game.setupGerms();
Game.clockDelay = 20;
Player.findPlanetToStart();
Game.enemyArray.splice(0);
Game.setupEnemies();
Game.saucerChance = 60;
Game.saucerDelay = -1;
if (Useful1.RandomNumber(1, 100) < (Game.saucerChance + Game.levelNumber)) {
Game.saucerDelay = Useful1.RandomNumber(50, 200);
}
Game.sizeTarget = numberToComplete[Game.levelNumber];
Game.msgMc = Game.inGameMsgsMc.attachMovie("getReadyMsgAnim", "getready", 1);
Game.msgMc._x = Game.movieWidth / 2;
Game.msgMc._y = (Game.movieHeight / 2) - 40;
obj.vx = 3;
obj.vy = 0;
Game.minutes = Game.StartTimer;
Game.sec = 0;
Game.displayTime();
Game.bonusCountArray.splice(0);
Game.lives = startLives;
Game.setLives();
Game.setTarget();
Game.setScore();
Game.setLevel();
Game.gameState = "pre_start";
} else if (Game.gameState == "restart") {
Game.score = 0;
Game.setScore();
Game.gameState = "pre_start";
} else if (Game.gameState == "game_over_restart") {
Game.resetMcs();
clearSprites();
Game.enemyArray.splice(0);
Game.clockDelay = 20;
Game.oxygenLevel = 100;
Game.setOxygen();
Game.resetMcs();
Presentation.setupSplashScreen(splashScreenElements);
Game.score = 0;
Game.levelNumber = 1;
Game.bonusCountArray.splice(0);
Game.saucerChance = 50;
Game.saucerDelay = -1;
if (Useful1.RandomNumber(1, 100) < (Game.saucerChance + Game.levelNumber)) {
Game.saucerDelay = Useful1.RandomNumber(50, 400);
}
Game.gameState = "waiting_to_start";
} else if (Game.gameState == "pre_start") {
Game.mainLoop();
} else if (Game.gameState == "start_game") {
Game.mainLoop();
} else if (Game.gameState == "display_bonus") {
Player.gun.monkey.frames.gotoAndStop("stand");
bonusCountDelay--;
if (bonusCountDelay == 0) {
bonusCountDelay = 1;
trace(Game.timeBonus);
if (Game.timeBonus > Game.currentTimeBonus) {
Game.currentTimeBonus++;
Game.msgMc.msg.timeBonus.text = ("+" + Game.currentTimeBonus) + "x10";
Game.score = Game.score + 10;
Game.setScore();
} else {
Game.msgMc.msg.totalScore.text = Game.score;
Game.setScore();
Game.msgMc.play();
}
}
} else if (Game.gameState == "play") {
Game.mainLoop();
}
}
function setupGoodGuy(mCName, xStart, yStart, grav, rg) {
var _local3 = Game.inGameObjectsMc.attachMovie(mCName, "gg" + Game.numberOfDropped, Game.numberOfDropped);
var _local2 = Useful1.RandomNumber(5, 10);
_local2 = _local2 / 10;
Game.goodGuysArray.push(new GoodGuy(_local3, this, xStart, yStart, _local2, mCName, grav, rg));
}
function setupPickups() {
var _local3 = 0;
while (_local3 < Game.levelHeightBlocks) {
var _local1 = 0;
while (_local1 < Game.levelWidthBlocks) {
var _local2 = (_local3 * Game.levelWidthBlocks) + _local1;
if ((_local3 == 0) or (_local3 == (Game.levelHeightBlocks - 3))) {
squareNamesArray[_local2] = "edgeSquare";
} else if ((_local1 == 0) or (_local1 == (Game.levelWidthBlocks - 1))) {
squareNamesArray[_local2] = "edgeSquare";
} else {
squareNamesArray[_local2] = "square";
}
_local1++;
}
_local3++;
}
}
function setupPanel() {
ix = 0;
iy = 0;
ii = 0;
var _local2 = 0;
while (_local2 < gameObjectNames.length) {
var _local1 = Game.inGameStatsMc.ingamestatsmc;
_local1 = _local1.wg;
trace(_local1._name);
_local1 = _local1["w" + (_local2 + 1)];
trace(_local1._name);
_local1 = _local1.wb;
trace(_local1._name);
Game.rightPanelGameObjects[_local2] = _local1;
Game.rightPanelGameObjects[_local2].indexA = _local2;
Game.rightPanelGameObjects[_local2].gameObjectBtn.onRelease = clickRightPanelObject;
Game.rightPanelGameObjects[_local2].gameObjectBtn.onRollOver = rollOverRightPanelObject;
Game.rightPanelGameObjects[_local2].gameObjectBtn.onRollOut = rollOutRightPanelObject;
_local2++;
}
}
function clickRightPanelObject() {
trace(this._parent.indexA);
Game.currentPickedUp = mousePointer.attachMovie(rightPanelGameObjectNames[this._parent.indexA], "pickedup", 1);
if (gameObjectRange[this._parent.indexA] != 0) {
rangeCircle = mousePointer.attachMovie(gameObjectRange[this._parent.indexA], "range", 0);
rangeCircle._x = rangeCircle._x + (blockSize / 2);
rangeCircle._y = rangeCircle._y + (blockSize / 2);
} else {
removeMovieClip(rangeCircle);
}
Game.currentPickedUp.indexA = this._parent.indexA;
}
function rollOverRightPanelObject() {
trace("roll over");
}
function rollOutRightPanelObject() {
trace("roll out");
}
function dropGameObject() {
var _local4 = _xmouse;
var _local3 = _ymouse;
if (Game.currentPickedUp != undefined) {
if (checkIfOverLapping() == true) {
var _local5 = 0;
trace(Game.currentPickedUp.indexA);
var _local2 = gameObjectCost[Game.currentPickedUp.indexA];
var _local1 = Game.score;
_local1 = _local1 - _local2;
if (_local1 >= 0) {
setupGoodGuy("magnet1", _local4, _local3, 0.7, 100);
if (rt.gameObjectNames[currentPickedUp.indexA] != "magnet") {
}
Game.numberOfDropped++;
}
}
}
}
function checkIfOverLapping() {
if ((_xmouse > (736 - blockSize)) or (_xmouse < blockSize)) {
return(false);
}
return(true);
}
var gameMc = this.createEmptyMovieClip("gameMc", 0);
var Useful1 = new Useful();
var Player;
var scrollOff = 0;
var startReal = true;
var Game;
var Presentation;
var Player;
var Background;
var Wave;
var SoundClass;
var parallaxLayersNames = new Array();
obj = {x:ball._x, y:ball._y, vx:3, vy:0};
var xLevelStart = 0;
var yLevelStart = -2100;
var ballMc;
var squareNamesArray = new Array();
var mousePointer = this.attachMovie("crosshair", "crosshair", 50);
mousePointer.yOld = 0;
var bonusCountDelay = 1;
var splashScreenElements = ["playInfo", "instructionsInfo", "controlsInfo", "highscoresInfo", "SplashMusicBtn"];
var startLives = 5;
keyboard = new Object();
var PLAYER_STATUS = "";
keyboard.onKeyDown = function () {
};
keyboard.onKeyUp = function () {
if (Key.getCode() == 80) {
if (Game.pauseSwitch == false) {
if (Game.gameState == "play") {
Game.pauseOn();
}
} else {
Game.pauseOff();
}
}
};
Key.addListener(keyboard);
var distantPointX = 0;
var distantPointY = 0;
var newDistance = 0;
mousePointer.onEnterFrame = function () {
this._x = _xmouse;
yOld = this._y;
this._y = _ymouse;
};
var mouseButton = false;
this.onMouseUp = function () {
mouseButton = false;
};
this.onMouseDown = function () {
mouseButton = true;
};
var soundControl = 1;
var soundFade;
var soundFadeControl = 100;
soundMc.soundBtn.onRelease = function () {
if (soundControl == 0) {
soundControl = 1;
soundFade = "in";
soundMc.soundControlMc.gotoAndStop(1);
} else {
soundControl = 0;
soundFade = "out";
soundMc.soundControlMc.gotoAndStop(2);
}
};
var soundSwitch = "on";
var musicPlaying = "on";
var rightPanelGameObjectNames = new Array("gameObject4", "gameObject3", "gameObject1", "gameObject2", "gameObject5", "gameObject1", "gameObject1", "gameObject1", "gameObject1");
var gameObjectNames = new Array("moneyDrop", "manWithBat", "tower1", "redTurret", "blueTurret", "spaceMine", "blueForceField", "towerBase", "towerBase", "towerBase", "towerBase");
var gameObjectCost = Array(1, 10, 20, 15, 5, 4, 3, 2, 1);
var gameObjectRange = Array("shortRangeCircle", "longRangeCircle", 0, 0, 0, 0, 0, 0);
setupGame();
setupPanel();
var blockSize = 32;
stop();
Symbol 19 MovieClip [points] Frame 21
this.removeMovieClip();
Symbol 25 MovieClip [towerExplodeBit] Frame 1
gotoAndStop(_parent.ballColour);
Symbol 26 MovieClip [towerExplodeAnim] Frame 12
removeMovieClip("");
stop();
Symbol 27 MovieClip [explosion] Frame 1
var z = 0;
var Count = 0;
var particles = this.createEmptyMovieClip("particles", 0);
var mC = "";
var rot = 0;
var newMc;
particles.onEnterFrame = function () {
while (z < 20) {
Count++;
mC = "s" + Count;
rot = Number(random(360)) + 1;
newMc = attachMovie("towerExplodeAnim", mC, Count);
newMC._xscale = 20 + Number(Count * 0.5);
newMc._rotation = rot;
newMc.ballColour = ballColour;
z++;
}
z = 0;
if (Count > 20) {
removeMovieClip(this);
}
};
Symbol 28 MovieClip [explosionEnemy] Frame 1
var z = 0;
var Count = 0;
var particles = this.createEmptyMovieClip("particles", 0);
var mC = "";
var rot = 0;
var newMc;
particles.onEnterFrame = function () {
while (z < 6) {
Count++;
mC = "s" + Count;
rot = Number(random(360)) + 1;
newMc = attachMovie("rocket", mC, Count);
newMC._xscale = 20 + Number(Count * 0.5);
newMc._rotation = rot;
z++;
}
z = 0;
if (Count > 20) {
removeMovieClip(this);
}
};
Symbol 29 MovieClip [explosion2] Frame 1
var z = 0;
var Count = 0;
var particles = this.createEmptyMovieClip("particles", 0);
var mC = "";
var rot = 0;
var newMc;
particles.onEnterFrame = function () {
while (z < 35) {
Count++;
mC = "s" + Count;
rot = Number(random(360)) + 1;
newMc = attachMovie("towerExplodeAnim", mC, Count);
newMC._xscale = 20 + Number(Count * 0.5);
newMc._rotation = rot;
z++;
}
z = 0;
if (Count > 30) {
removeMovieClip(this);
}
};
Symbol 70 MovieClip Frame 1
submitBtn.onRelease = function () {
gotoAndStop ("submit");
};
score.text = _root.Game.score;
stop();
quitBtn.onRelease = function () {
_root.quitGame();
};
Symbol 70 MovieClip Frame 2
function moveOn() {
_root.quitGame();
}
mochi.MochiScores.showLeaderboard({boardID:_root.leaderboardID, clip:_root, score:_root.Game.score, onClose:moveOn, onError:moveOn});
stop();
Symbol 70 MovieClip Frame 3
_root.quitGame();
Symbol 71 MovieClip [endScreen] Frame 1
play();
Symbol 75 MovieClip Frame 6
stop();
Symbol 79 MovieClip [sun] Frame 1
stop();
Symbol 79 MovieClip [sun] Frame 5
stop();
Symbol 87 MovieClip [asteroid1] Frame 1
stop();
Symbol 87 MovieClip [asteroid1] Frame 8
_parent._parent.asteroid = "done";
stop();
Symbol 88 MovieClip Frame 1
stop();
Symbol 91 MovieClip [badBall] Frame 1
stop();
Symbol 98 MovieClip Frame 1
stop();
Symbol 98 MovieClip Frame 10
gotoAndStop (1);
Symbol 109 MovieClip [ballCharacter] Frame 1
stop();
Symbol 155 MovieClip [spaceMonkey] Frame 1
stop();
Symbol 161 MovieClip [M_stars1] Frame 15
this.removeMovieClip();
Symbol 162 MovieClip [starAnim] Frame 1
i = 1;
heart.onEnterFrame = function () {
if (_currentframe != 13) {
myMovie = heart.duplicateMovieClip("heart" + i, i);
myMovie._rotation = Math.random() * 360;
myMovie._xscale = scale;
myMovie._yscale = scale;
scale = (Math.random() * 80) + 20;
i++;
}
};
Symbol 162 MovieClip [starAnim] Frame 24
this.removeMovieClip();
stop();
Symbol 167 MovieClip [line] Frame 1
stop();
Symbol 167 MovieClip [line] Frame 6
stop();
Symbol 167 MovieClip [line] Frame 10
gotoAndStop (1);
Symbol 167 MovieClip [line] Frame 15
stop();
Symbol 167 MovieClip [line] Frame 20
gotoAndStop (1);
Symbol 167 MovieClip [line] Frame 33
gotoAndPlay ("colour");
Symbol 172 MovieClip Frame 1
submitBtn.onRelease = function () {
gotoAndStop ("submit");
};
score.text = _parent._parent._parent._parent._parent._parent._parent.Game.score;
stop();
quitBtn.onRelease = function () {
_parent._parent._parent._parent._parent._parent._parent.quitGame();
};
Symbol 172 MovieClip Frame 2
function moveOn() {
_parent._parent.play();
}
mochi.MochiScores.showLeaderboard({boardID:_root.leaderboardID, clip:_root, score:_parent._parent._parent._parent._parent._parent._parent.Game.score, onClose:moveOn, onError:moveOn});
stop();
Symbol 172 MovieClip Frame 3
_parent._parent.play();
Symbol 174 MovieClip [gameOverMsgAnim] Frame 64
stop();
Symbol 174 MovieClip [gameOverMsgAnim] Frame 77
_parent._parent._parent._parent._parent.Game.gameState = "game_over_restart";
stop();
Symbol 180 MovieClip Frame 1
stop();
Symbol 184 MovieClip Frame 1
stop();
Symbol 186 MovieClip [loseLifeMsgAnim] Frame 48
if (_parent._parent._parent._parent._parent.Game.gameState != "restart") {
_parent._parent._parent._parent._parent.Game.gameState = "restart";
}
this.removeMovieClip();
Symbol 189 MovieClip [getReadyMsgAnim] Frame 1
msg.sizeTarget.text = _parent._parent._parent._parent._parent.Game.sizeTarget;
Symbol 189 MovieClip [getReadyMsgAnim] Frame 23
msg.sizeTarget.text = _parent._parent._parent._parent._parent.Game.sizeTarget;
Symbol 189 MovieClip [getReadyMsgAnim] Frame 86
_parent._parent._parent._parent._parent.Game.gameState = "play";
this.removeMovieClip();
Symbol 197 MovieClip [levelCompleteMsgs] Frame 1
stop();
Symbol 199 MovieClip [levelCompleteMsgAnim] Frame 15
msg.titleMc.gotoAndStop(howWellDone);
Symbol 199 MovieClip [levelCompleteMsgAnim] Frame 31
_parent._parent._parent._parent._parent.Game.gameState = "display_bonus";
_parent._parent._parent._parent._parent.sounds.levelComplete.start(0, 1);
stop();
Symbol 199 MovieClip [levelCompleteMsgAnim] Frame 81
_parent._parent._parent._parent._parent.Game.gameState = "start_new_level";
stop();
Symbol 203 MovieClip [pausedMsgAnim] Frame 33
stop();
Symbol 203 MovieClip [pausedMsgAnim] Frame 42
this.removeMovieClip();
Symbol 211 MovieClip [CannonManRoll] Frame 1
stop();
Symbol 217 MovieClip [bullet] Frame 1
stop();
Symbol 223 MovieClip Frame 256
_parent.myObject.mCDeath();
Symbol 267 MovieClip Frame 1
stop();
Symbol 267 MovieClip Frame 13
myObject.fireNow();
Symbol 275 MovieClip Frame 1
stop();
Symbol 281 MovieClip [mainface] Frame 1
stop();
Symbol 285 MovieClip [goldLostAnim] Frame 16
this.removeMovieClip();
Symbol 290 MovieClip [square] Frame 1
stop();
Symbol 301 MovieClip Frame 1
stop();
Symbol 324 MovieClip [man with pistol anim] Frame 1
stop();
Symbol 340 MovieClip Frame 1
stop();
Symbol 382 MovieClip Frame 1
this.loadMovie("http://www.motionjam.com/fgm_ads/fgm_ad_v1.swf?" + Math.random(20));
Symbol 404 MovieClip [splashInfo] Frame 1
stop();
Symbol 404 MovieClip [splashInfo] Frame 2
stop();
backBtn.onRelease = function () {
_root.Presentation.setupPresentationElements2();
gotoAndStop (1);
};
Symbol 404 MovieClip [splashInfo] Frame 3
backBtn.onRelease = function () {
_root.Presentation.setupPresentationElements2();
gotoAndStop (1);
};
Symbol 404 MovieClip [splashInfo] Frame 4
function moveOn() {
_root.Presentation.setupPresentationElements2();
trace(this._currentframe);
gotoAndStop (1);
}
backBtn.onRelease = function () {
_root.mochi.MochiScores.closeLeaderboard();
this._parent.mochi.MochiScores.closeLeaderboard();
moveOn();
};
var leaderBoardMc = this.createEmptyMovieClip("leaderBoard", 1);
leaderBoardMc._x = -360;
leaderBoardMc._y = -200;
mochi.MochiScores.showLeaderboard({boardID:_root.leaderboardID, clip:leaderBoardMc, onClose:moveOn, onError:moveOn});
stop();
Symbol 428 MovieClip [balloonMaskGradient] Frame 1
stop();
Symbol 430 MovieClip [balloonMaskMc] Frame 1
stop();
Symbol 434 MovieClip [balloon] Frame 1
maskMc.setMask(balloonMaskMc);
stop();
Symbol 434 MovieClip [balloon] Frame 5
this.removeMovieClip();
Symbol 441 MovieClip [bonusMc1] Frame 16
this.removeMovieClip();
Symbol 446 MovieClip [bonusMc2] Frame 16
this.removeMovieClip();
Symbol 451 MovieClip [bonusMc3] Frame 16
this.removeMovieClip();
Symbol 456 MovieClip [bonusMc4] Frame 16
this.removeMovieClip();
Symbol 465 MovieClip [flySaucer] Frame 1
stop();
Symbol 470 MovieClip [bonusMc1000] Frame 16
this.removeMovieClip();
Symbol 474 MovieClip Frame 1
stop();
Symbol 488 MovieClip [Ball] Frame 1
stop();
Symbol 491 MovieClip [SplashMusicBtn] Frame 1
if (_root.musicPlaying == "off") {
musicMc.gotoAndStop(2);
}
musicBtn.onRelease = function () {
if (musicMc._currentframe == 1) {
this._parent._parent._parent._parent._parent._parent._parent._parent.soundFade = "out";
this._parent._parent._parent._parent._parent._parent._parent._parent.musicPlaying = "off";
musicMc.gotoAndStop(2);
} else {
this._parent._parent._parent._parent._parent._parent._parent._parent.soundFade = "in";
this._parent._parent._parent._parent._parent._parent._parent._parent.musicPlaying = "on";
musicMc.gotoAndStop(1);
}
};
Symbol 520 MovieClip [SplashScreenButtonsAnim] Frame 31
stop();
Symbol 524 MovieClip [__Packages.mochi.MochiScores] Frame 0
class mochi.MochiScores
{
static var boardID, onClose, onError;
function MochiScores () {
}
static function setBoardID(boardID) {
mochi.MochiScores.boardID = boardID;
mochi.MochiServices.send("scores_setBoardID", {boardID:boardID});
}
static function showLeaderboard(options) {
if (options.clip != null) {
if (options.clip.__mochiservicesMC != mochi.MochiServices.__get__clip()) {
mochi.MochiServices.disconnect();
mochi.MochiServices.connect(mochi.MochiServices.__get__id(), options.clip);
}
delete options.clip;
}
if (options.onDisplay != null) {
options.onDisplay();
} else {
mochi.MochiServices.__get__clip().stop();
}
if (options.onClose != null) {
onClose = options.onClose;
} else {
onClose = function () {
if (mochi.MochiServices.__get__clip() == _root.__mochiservicesMC) {
mochi.MochiServices.__get__clip()._parent.gameOverMc.play();
} else {
mochi.MochiServices.__get__clip().gameOverMc.play();
}
};
}
if (options.onError != null) {
onError = options.onError;
} else {
onError = onClose;
}
if (options.boardID == null) {
if (boardID != null) {
options.boardID = boardID;
}
}
mochi.MochiServices.send("scores_showLeaderboard", {options:options}, null, doClose);
}
static function getPlayerInfo(callbackObj, callbackMethod) {
mochi.MochiServices.send("scores_getPlayerInfo", null, callbackObj, callbackMethod);
}
static function submit(score, name, callbackObj, callbackMethod) {
mochi.MochiServices.send("scores_submit", {score:score, name:name}, callbackObj, callbackMethod);
}
static function requestList(callbackObj, callbackMethod) {
mochi.MochiServices.send("scores_requestList", null, callbackObj, callbackMethod);
}
static function doClose(args) {
if (args.error == true) {
if (args.errorCode == undefined) {
args.errorCode = "IOError";
}
onError.apply(null, [args.errorCode]);
} else {
onClose.apply();
}
}
}
Symbol 525 MovieClip [__Packages.mochi.MochiServices] Frame 0
class mochi.MochiServices
{
static var _id, _container, _sendChannelName, _rcvChannelName, __get__comChannelName, onError, _listenChannel, _rcvChannel, _loader, _loaderListener, _sendChannel;
function MochiServices () {
}
static function get id() {
return(_id);
}
static function get clip() {
return(_container);
}
static function getVersion() {
return("1.2");
}
static function allowDomains(server) {
var _local1 = server.split("/")[2].split(":")[0];
if (System.security) {
if (System.security.allowDomain) {
System.security.allowDomain("*");
System.security.allowDomain(_local1);
}
if (System.security.allowInsecureDomain) {
System.security.allowInsecureDomain("*");
System.security.allowInsecureDomain(_local1);
}
}
return(_local1);
}
static function get isNetworkAvailable() {
if (System.security) {
var _local1 = System.security;
if (_local1.sandboxType == "localWithFile") {
return(false);
}
}
return(true);
}
static function set comChannelName(val) {
if (val != undefined) {
if (val.length > 3) {
_sendChannelName = val + "_fromgame";
_rcvChannelName = val;
initComChannels();
}
}
//return(__get__comChannelName());
}
static function get connected() {
return(_connected);
}
static function connect(id, clip, onError) {
if ((!_connected) && (_container == undefined)) {
trace("MochiServices Connecting...");
_connecting = true;
init(id, clip);
}
if (onError != undefined) {
mochi.MochiServices.onError = onError;
} else if (mochi.MochiServices.onError == undefined) {
mochi.MochiServices.onError = function (errorCode) {
trace(errorCode);
};
}
}
static function disconnect() {
if (_connected || (_connecting)) {
_connecting = (_connected = false);
flush(true);
if (_container != undefined) {
_container.removeMovieClip();
delete _container;
}
_listenChannel.close();
_rcvChannel.close();
}
}
static function init(id, clip) {
_id = id;
if (clip != undefined) {
_container = clip.createEmptyMovieClip("__mochiservicesMC", clip.getNextHighestDepth());
} else {
_container = _root.createEmptyMovieClip("__mochiservicesMC", _root.getNextHighestDepth());
}
loadCommunicator(id, _container);
}
static function loadCommunicator(id, clip) {
if (!isNetworkAvailable) {
return(undefined);
}
allowDomains(_gatewayURL);
_loader = new MovieClipLoader();
if (_loaderListener.waitInterval != null) {
clearInterval(_loaderListener.waitInterval);
}
_loaderListener = {};
_loaderListener.onLoadError = function (target_mc, errorCode, httpStatus) {
trace("MochiServices could not load.");
mochi.MochiServices.disconnect();
mochi.MochiServices.onError.apply(null, [errorCode]);
};
_loaderListener.onLoadStart = function (target_mc) {
this.isLoading = true;
};
_loaderListener.startTime = getTimer();
_loaderListener.wait = function () {
if ((getTimer() - this.startTime) > 10000) {
if (!this.isLoading) {
mochi.MochiServices.disconnect();
mochi.MochiServices.onError.apply(null, ["IOError"]);
}
clearInterval(this.waitInterval);
}
};
_loaderListener.waitInterval = setInterval(_loaderListener, "wait", 1000);
_loader.addListener(_loaderListener);
_loader.loadClip(_gatewayURL, clip);
_sendChannel = new LocalConnection();
_sendChannel._queue = [];
_rcvChannel = new LocalConnection();
_rcvChannel.allowDomain = function (d) {
return(true);
};
_rcvChannel.allowInsecureDomain = _rcvChannel.allowDomain;
_rcvChannel._nextcallbackID = 0;
_rcvChannel._callbacks = {};
listen();
}
static function onStatus(infoObject) {
if (!(infoObject.level === "error")) {
} else {
_connected = false;
_listenChannel.connect(_listenChannelName);
}
}
static function listen() {
_listenChannel = new LocalConnection();
_listenChannel.handshake = function (args) {
mochi.MochiServices.__set__comChannelName(args.newChannel);
};
_listenChannel.allowDomain = function (d) {
return(true);
};
_listenChannel.allowInsecureDomain = _listenChannel.allowDomain;
_listenChannel.connect(_listenChannelName);
trace("Waiting for MochiAds services to connect...");
}
static function initComChannels() {
if (!_connected) {
_sendChannel.onStatus = function (infoObject) {
mochi.MochiServices.onStatus(infoObject);
};
_sendChannel.send(_sendChannelName, "onReceive", {methodName:"handshakeDone"});
_sendChannel.send(_sendChannelName, "onReceive", {methodName:"registerGame", id:_id, clip:_container, version:getVersion()});
_rcvChannel.onStatus = function (infoObject) {
mochi.MochiServices.onStatus(infoObject);
};
_rcvChannel.onReceive = function (pkg) {
var _local5 = pkg.callbackID;
var _local4 = this._callbacks[_local5];
if (!_local4) {
return(undefined);
}
var _local2 = _local4.callbackMethod;
var _local3 = _local4.callbackObject;
if (_local3 && (typeof(_local2) == "string")) {
_local2 = _local3[_local2];
}
if (_local2 != undefined) {
_local2.apply(_local3, pkg.args);
}
delete this._callbacks[_local5];
};
_rcvChannel.onError = function () {
mochi.MochiServices.onError.apply(null, ["IOError"]);
};
_rcvChannel.connect(_rcvChannelName);
trace("connected!");
_connecting = false;
_connected = true;
_listenChannel.close();
while (_sendChannel._queue.length > 0) {
_sendChannel.send(_sendChannelName, "onReceive", _sendChannel._queue.shift());
}
}
}
static function flush(error) {
var _local1;
var _local2;
while (_sendChannel._queue.length > 0) {
_local1 = _sendChannel._queue.shift();
if (_local1.callbackID != null) {
_local2 = _rcvChannel._callbacks[_local1.callbackID];
}
delete _rcvChannel._callbacks[_local1.callbackID];
if (error) {
handleError(_local1.args, _local2.callbackObject, _local2.callbackMethod);
}
}
}
static function handleError(args, callbackObject, callbackMethod) {
if (args != null) {
if (args.onError != null) {
args.onError.apply(null, ["NotConnected"]);
}
}
if (callbackMethod != null) {
args = {};
args.error = true;
args.errorCode = "NotConnected";
if ((callbackObject != null) && (typeof(callbackMethod) == "string")) {
callbackObject[callbackMethod](args);
} else if (callbackMethod != null) {
callbackMethod.apply(args);
}
}
}
static function send(methodName, args, callbackObject, callbackMethod) {
if (_connected) {
_sendChannel.send(_sendChannelName, "onReceive", {methodName:methodName, args:args, callbackID:_rcvChannel._nextcallbackID});
} else {
if ((_container == undefined) || (!_connecting)) {
onError.apply(null, ["NotConnected"]);
handleError(args, callbackObject, callbackMethod);
flush(true);
return(undefined);
}
_sendChannel._queue.push({methodName:methodName, args:args, callbackID:_rcvChannel._nextcallbackID});
}
_rcvChannel._callbacks[_rcvChannel._nextcallbackID] = {callbackObject:callbackObject, callbackMethod:callbackMethod};
_rcvChannel._nextcallbackID++;
}
static var _gatewayURL = "http://www.mochiads.com/static/lib/services/services.swf";
static var _listenChannelName = "__mochiservices";
static var _connecting = false;
static var _connected = false;
}
Symbol 526 MovieClip [__Packages.GamePlayer] Frame 0
class GamePlayer
{
var missileDistFromGun, root, shotsFired, shotsLimit, mouseOldX, mouseOldY, numberOfMissiles, scrollSpeed, keypress, jumpTime, mouseButton, planetIndex, oldRotation, mC, shotStrength, playerState, vectorData, oxygenIncreaseDelay, gun;
function GamePlayer (clip, rt, xStart, yStart) {
missileDistFromGun = 40;
xOrigin = xStart;
yOrigin = yStart;
dx = 0;
root = rt;
dy = 0;
angle = 0;
shotsFired = 0;
shotsLimit = 2;
xPos = 0;
yPos = 0;
xVel = 0;
yVel = 0;
xVelOld = 0;
mouseOldX = 0;
mouseOldY = 0;
numberOfMissiles = 0;
yVelOld = 0;
scrollSpeed = 10;
keypress = 0;
jump = 0;
jumpTime = 10;
mouseButton = 0;
planetIndex = 0;
oldRotation = 0;
mC = clip;
shotStrength = 6;
playerState = "standing";
vectorData = new Object();
oxygenIncreaseDelay = 10;
gun = mC.attachMovie("line", "line", 1);
updatePosition();
}
function mainLoop() {
mC._rotation = ((root.Game.movieWidth / 2) - root._xmouse) * 0.1;
mC._x = root._xmouse;
mC._y = root._ymouse;
}
function updatePosition() {
var _local3 = mC._x;
var _local2 = mC._y;
xPos = xPos + xVel;
yPos = yPos + yVel;
mC._x = xOrigin + xPos;
mC._y = yOrigin + yPos;
}
var xOrigin = 0;
var yOrigin = 0;
var xPos = 0;
var yPos = 0;
var s = 0;
var playerleft = 0;
var playerright = 0;
var jump = 0;
var moveplayerup = 0;
var playerdown = 0;
var playerup = 0;
var Oldplayerup = 0;
var Oldplayerdown = 0;
var Oldplayerright = 0;
var Oldplayerleft = 0;
var xVel = 0;
var yVel = 0;
var xVelOld = 0;
var yVelOld = 0;
var santaspeed = 2;
var distantPointX = 0;
var distantPointY = 0;
var newDistance = 0;
var multidirectional = 0;
var dx = 0;
var dy = 0;
var angle = 0;
}
Symbol 527 MovieClip [__Packages.GoodGuy] Frame 0
class GoodGuy
{
var root, mC, arrayIndex, hits, gravity, delayToFire, gotGold, energyBarOn, xDir, target, homing, ringDrop, movingCloser, energyMc;
function GoodGuy (clip, rt, xStart, yStart, grav) {
root = rt;
mC = clip;
arrayIndex = 0;
hits = 0;
gravity = grav;
xOrigin = xStart;
yOrigin = yStart;
yPos = 0;
xVel = 0;
vx = 0;
vy = 0;
yVel = 0;
delayToFire = 30;
angle = 0.2;
gotGold = 0;
energyBarOn = 0;
degrees = 0;
radius = 255;
centerX = root.movieWidth / 2;
centerY = root.movieHeight / 2;
xDir = 1;
target = undefined;
numberOfMissiles = 0;
energyStart = 100;
energy = energyStart;
homing = 0;
ringDrop = 20;
movingCloser = 0;
delayToFire = 50;
}
function collisionDetection() {
checkWalls(mC);
if (root.Game.pickupType == "colour") {
var _local2 = 0;
while (_local2 < root.Game.goodGuysArray.length) {
if (this != root.Game.goodGuysArray[_local2]) {
if (mC._currentframe == root.Game.goodGuysArray[_local2].mC._currentframe) {
if (mC.hitTest(root.Game.goodGuysArray[_local2].mC)) {
root.Game.goodGuysArray[_local2].remove();
var _local3 = root.Game.inGameExplosionsMc.attachMovie("explosion", "explosion" + root.Game.numberOfDropped, root.Game.numberOfDropped + 1000);
_local3.ballColour = mC._currentframe;
_local3._x = mC._x;
_local3._y = mC._y;
root.Game.numberOfDropped++;
_local3 = root.Game.inGameScoreMc.attachMovie("points", "points" + root.Game.starAnims, root.Game.starAnims + 1000);
_local3._x = mC._x;
_local3._y = mC._y;
root.Game.starAnims++;
_local3.txt.pointsTxt.text = 20;
}
}
}
_local2++;
}
}
}
function checkWalls(ball) {
if (ball._x < (root.Game.left + ball._width)) {
ball._x = root.Game.left + ball._width;
vx = vx * -1;
} else if (ball._x > (root.Game.right - ball._width)) {
ball._x = root.Game.right - ball._width;
vx = vx * -1;
}
if (ball._y > (root.Game.bottom - (ball._height / 2))) {
remove();
root.Game.loseLife();
}
}
function checkForPickUp() {
if (mC._currentframe > 5) {
root.Game.pickupDelay = 100;
if (mC._currentframe == 6) {
root.Player.gun.gotoAndPlay("big");
root.Game.pickupType = "stretch";
} else {
if (mC._currentframe == 7) {
if (mC.hitTest(root.Player.mC)) {
root.Player.gun.gotoAndPlay("small");
root.Game.pickupType = "shrink";
// unexpected jump
}
return(false);
}
if (mC._currentframe == 8) {
root.Player.gun.gotoAndPlay("colour");
root.Game.pickupType = "colour";
} else if (mC._currentframe == 9) {
root.Player.gun.gotoAndPlay("slow");
root.Game.pickupType = "slow";
}
}
var _local2 = root.Game.inGameScoreMc.attachMovie("points", "points" + root.Game.starAnims, root.Game.starAnims + 1000);
_local2._x = mC._x;
_local2._y = mC._y;
root.Game.starAnims++;
_local2.txt.pointsTxt.text = root.Game.pickupType;
remove();
return(true);
}
return(false);
}
function mainLoop() {
collisionDetection();
var _local2 = mC;
vy = vy + gravity;
if (root.Game.pickupType == "slow") {
_local2._x = _local2._x + (vx / 2);
_local2._y = _local2._y + (vy / 2);
} else {
_local2._x = _local2._x + vx;
_local2._y = _local2._y + vy;
}
var _local7 = root.Player.mC.getBounds(root);
if (mC.hitTest(root.Player.mC)) {
if ((_local2._x > _local7.xMin) && (_local2._x < _local7.xMax)) {
var _local9 = (root.Player.mC._rotation * Math.PI) / 180;
var _local3 = Math.cos(_local9);
var _local4 = Math.sin(_local9);
var _local12 = _local2._x - root.Player.mC._x;
var _local11 = _local2._y - root.Player.mC._y;
var _local5 = (_local3 * _local11) - (_local4 * _local12);
if (_local5 > ((-_local2._height) / 2)) {
if (checkForPickUp()) {
root.sounds.pickupFx.start(0, 1);
} else {
root.sounds.bounceFx.start(0, 1);
}
root.Game.increaseScore(1);
var _local8 = (_local3 * _local12) + (_local4 * _local11);
var _local10 = (_local3 * vx) + (_local4 * vy);
var _local6 = (_local3 * vy) - (_local4 * vx);
_local5 = (-_local2._height) / 2;
_local6 = -8;
_local12 = (_local3 * _local8) - (_local4 * _local5);
_local11 = (_local3 * _local5) + (_local4 * _local8);
vx = (_local3 * _local10) - (_local4 * _local6);
vy = (_local3 * _local6) + (_local4 * _local10);
_local2._x = root.Player.mC._x + _local12;
_local2._y = root.Player.mC._y + _local11;
}
}
}
}
function decreaseEnergy() {
energy = energy - 10;
if (energyBarOn == 0) {
energyBarOn = 1;
energyMc = mC.attachMovie("energyBar2", "energyBar" + root.scoreIndex, root.scoreIndex + 12000);
energyMc.enemy = this;
}
energyMc._x = 0;
energyMc._y = -35;
var _local3 = energy / 10;
trace(energyMc._name);
energyMc.bar.bar._y = int(10 - _local3);
if (energy <= 0) {
if (gotGold == 1) {
var _local2 = root.inGameBackMc.attachMovie("goldLostAnim", "goldFound" + root.lostGold, root.lostGold);
_local2.g.g.text = "+1";
root.Game.increaseMoney();
var _local4 = (root.inGameBackMc._x - root.inGameBackMc._x) - root.inGameBackMc._x;
_local2._x = mC._x + _local4;
_local2._y = mC._y - root.inGameBackMc._y;
_local2._x + 340;
trace(_local2._x);
trace(_local2._y);
}
remove();
}
}
function remove() {
var _local2 = 0;
while (_local2 < root.Game.goodGuysArray.length) {
if (this == root.Game.goodGuysArray[_local2]) {
arrayIndex = _local2;
}
_local2++;
}
mC.removeMovieClip();
root.Game.goodGuysArray.splice(_local2, 1);
}
function updatePosition() {
xPos = xPos + xVel;
yPos = yPos + yVel;
mC._x = xOrigin + xPos;
mC._y = yOrigin + yPos;
}
var xOrigin = 0;
var yOrigin = 0;
var xPos = 0;
var yPos = 0;
var xVel = 0;
var yVel = 0;
var vx = 0;
var vy = 0;
var angle = 0;
var degrees = 0;
var centerX = 0;
var centerY = 0;
var radius = 0;
var speed = 0;
var cost = 0;
var playerleft = 0;
var playerright = 0;
var gameObjectType = "";
var energyStart = 0;
var energy = 0;
var delayToFireMissile = 60;
var numberOfMissiles = 0;
}
Symbol 528 MovieClip [__Packages.Game] Frame 0
class Game
{
var root, startGame, money, energy;
function Game (m, e, rt) {
root = rt;
startGame = 0;
money = m;
energy = e;
}
function increaseMoney(increase) {
money = money + increase;
}
function decreaseMoney(decrease) {
money = money - decrease;
}
function increaseEnergy(increase) {
energy = energy - increase;
if (energy <= 0) {
energy = 0;
}
}
function decreaseEnergy(decrease) {
energy = energy - decrease;
if (energy <= 0) {
startGame = 0;
root._parent.gotoAndStop("gameOver");
}
}
}
Symbol 529 MovieClip [__Packages.GamePresentation] Frame 0
class GamePresentation
{
var rt, mC, splashScreenMc, optionsMc, elementMc, btnType, myObject;
function GamePresentation (rt2) {
rt = rt2;
mC = rt.Game.presentationMc;
}
function setupSplashScreen(elementsPositions) {
splashScreenMc = mC.attachMovie("SplashScreen", "splashscreenmc", 1);
var _local2 = splashScreenMc.attachMovie("splashInfo", "screens", 100);
_local2._x = 355;
_local2._y = 200;
setupPresentationElements();
}
function setupPresentationElements() {
optionsMc = splashScreenMc.createEmptyMovieClip("options", 1);
var _local4 = optionsMc.attachMovie("SplashScreenButtons", "splashscreenbtns", 1);
_local4._x = 105;
_local4._y = 130;
var _local2 = 0;
while (_local2 < rt.splashScreenElements.length) {
var _local3 = rt.splashScreenElements;
elementMc = _local4.buttons[_local3[_local2]];
trace(elementMc);
elementMc.btn.btnType = _local3[_local2];
elementMc.btn.splashScreenMc = splashScreenMc;
elementMc.btn.myObject = this;
elementMc.btn.onRelease = clickRightSplashSceenBtn;
elementMc.btn.onRollOver = rollOverSplashSceenBtn;
elementMc.btn.onRollOut = rollOutSplashSceenBtn;
_local2++;
}
}
function setupPresentationElements2() {
optionsMc = splashScreenMc.createEmptyMovieClip("options", 1);
var _local4 = optionsMc.attachMovie("SplashScreenButtons", "splashscreenbtns", 1);
_local4.buttons.gotoAndStop(105);
_local4._x = 105;
_local4._y = 130;
var _local2 = 0;
while (_local2 < rt.splashScreenElements.length) {
var _local3 = rt.splashScreenElements;
elementMc = _local4.buttons[_local3[_local2]];
trace(elementMc);
elementMc.btn.btnType = _local3[_local2];
elementMc.btn.splashScreenMc = splashScreenMc;
elementMc.btn.myObject = this;
elementMc.btn.onRelease = clickRightSplashSceenBtn;
elementMc.btn.onRollOver = rollOverSplashSceenBtn;
elementMc.btn.onRollOut = rollOutSplashSceenBtn;
_local2++;
}
}
function clickRightSplashSceenBtn() {
if (btnType == "playInfo") {
myObject.rt.Game.gameState = "setup";
} else if (btnType == "instructionsInfo") {
splashScreenMc.screens.gotoAndStop("showinstructions");
splashScreenMc.options.removeMovieClip();
} else if (btnType == "controlsInfo") {
splashScreenMc.screens.gotoAndStop("showcontrols");
splashScreenMc.options.removeMovieClip();
} else if (btnType == "highscoresInfo") {
splashScreenMc.screens.gotoAndStop("showhighscores");
splashScreenMc.options.removeMovieClip();
}
}
function rollOverSplashSceenBtn() {
}
function rollOutSplashSceenBtn() {
if (btnType == "playBtnAnim") {
} else if (btnType == "instructionsBtnAnim") {
} else if (btnType == "controlsBtnAnim") {
} else if (btnType == "highscoresBtnAnim") {
}
}
function RandomNumber(x, y) {
return(Math.round(Math.random() * (y - x)) + x);
}
function getArcVelocity(gravity, speed, xStart, yStart, xEnd, yEnd) {
var _local1 = new Object();
var _local3 = xEnd - xStart;
var _local4 = yEnd - yStart;
var _local6 = Math.sqrt((_local3 * _local3) + (_local4 * _local4));
var _local2 = Math.ceil(_local6 / speed);
_local1.gravity = gravity;
_local1.steps = _local2;
_local1.xStep = _local3 / _local2;
_local1.yStep = _local4 / _local2;
if (gravity > 0) {
_local1.yStep = _local1.yStep - ((_local2 * gravity) / 2);
}
return(_local1);
}
function localToGlobalXY(mc1) {
var _local3 = new Object();
_local3.newX = 0;
_local3.newY = 0;
var _local2 = mc1;
while (_local2 != _root) {
var _local6 = _local3.newX * (_local2._xscale / 100);
var _local5 = _local3.newY * (_local2._yscale / 100);
var _local4 = _local2._rotation * (Math.PI/180);
_local3.newX = (_local6 * Math.cos(_local4)) - (_local5 * Math.sin(_local4));
_local3.newY = (_local6 * Math.sin(_local4)) + (_local5 * Math.cos(_local4));
_local3.newX = _local3.newX + _local2._x;
_local3.newY = _local3.newY + _local2._y;
_local2 = _local2._parent;
}
return(_local3);
}
function radian(degree) {
return((Math.PI/180) * degree);
}
function addThrust(rot, speed) {
var _local2 = new Object();
_local2.xVel = Math.cos(radian(rot)) * speed;
_local2.yVel = Math.sin(radian(rot)) * speed;
return(_local2);
}
}
Symbol 530 MovieClip [__Packages.GameGame] Frame 0
class GameGame
{
var mC, rt, numBalls, movieWidth, movieHeight, blockSize, levelWidthBlocks, levelHeightBlocks, levelWidth, levelHeight, gameState, lostGold, numberOfMissiles, inGameMc, presentationMc, inGameActionMc, inGameStatsMc, inGameContainerMc, ballMc, inGameMsgsMc, playerMc, inGameBackgroundParallaxMc, inGameBackgroundMc, inGameEnemyMc, inGameMissilesMc, inGameExplosionsMc, inGameScoreMc, inGameObjectsMc, missilesArray, enemyArray, goodGuysArray, targetArray, numberOfDropped, rightPanelGameObjects, gameObjects, backgroundSquaresArray, currentPickedUp, score, oxygenLevel, sizeTarget, bestScore, starAnimDelay, lives, meterLevel, meterLevelSpeed, gameStartDelay, meterLevelDir, scoreIndex, xMidway, yMidway, starTrails, cannonManFlying, ballChainArray, badGuysArray, bonusCountArray, spring, friction, gravity, springLength, ballCount, saucerChance, saucerDelay, left, right, top, bottom, levelNumber, scaleSpeed, balloonPlotted, extraPointsSound, secDisplay, minDisplay, StartTimer, clockDelay, minutes, sec, fulltime, bottomEdge, rightEdge, pauseSwitch, pauseMc, msgMc, endScreenMc, currentTimeBonus, timeBonus, delay, delayForBalls, ballsNumber, pickupType, pickupDelay;
function GameGame (mc, rt2, sw, sh, levelW, levelH, startLives) {
mC = mc;
rt = rt2;
numBalls = 15;
movieWidth = sw;
movieHeight = sh;
blockSize = 32;
levelWidthBlocks = levelW;
levelHeightBlocks = levelH;
levelWidth = levelWidthBlocks * blockSize;
levelHeight = levelHeightBlocks * blockSize;
gameState = "loading";
lostGold = 0;
numberOfMissiles = 0;
inGameMc = mC.createEmptyMovieClip("inGameMc", 0);
presentationMc = mC.createEmptyMovieClip("presentationMc", 1);
inGameActionMc = inGameMc.createEmptyMovieClip("inGameActionMc", 0);
inGameStatsMc = inGameMc.createEmptyMovieClip("inGameStatsMc", 1);
inGameContainerMc = inGameActionMc.createEmptyMovieClip("inGameBackgroundMc", 9);
ballMc = inGameActionMc.createEmptyMovieClip("cannonman", 10);
inGameMsgsMc = inGameActionMc.createEmptyMovieClip("cannonman", 11);
playerMc = inGameContainerMc.createEmptyMovieClip("player", 6);
inGameBackgroundParallaxMc = inGameActionMc.createEmptyMovieClip("inGameBackgroundParallaxMc2", 0);
inGameBackgroundMc = inGameContainerMc.createEmptyMovieClip("inGameBackgroundMc", 0);
inGameEnemyMc = inGameContainerMc.createEmptyMovieClip("inGameEnemysMc", 1);
inGameMissilesMc = inGameContainerMc.createEmptyMovieClip("inGameMissilesMc", 2);
inGameExplosionsMc = inGameContainerMc.createEmptyMovieClip("inGameExplosionsMc", 3);
inGameScoreMc = inGameContainerMc.createEmptyMovieClip("inGameScoresMc", 4);
inGameObjectsMc = inGameContainerMc.createEmptyMovieClip("inGameObjectsMc", 5);
missilesArray = new Array();
enemyArray = new Array();
goodGuysArray = new Array();
targetArray = new Array();
numberOfDropped = 0;
rightPanelGameObjects = new Array();
gameObjects = new Array();
backgroundSquaresArray = new Array();
currentPickedUp = undefined;
score = 0;
oxygenLevel = 100;
sizeTarget = 0;
bestScore = 0;
starAnimDelay = 4;
lives = startLives;
meterLevel = 0;
meterLevelSpeed = 20;
gameStartDelay = 20;
meterLevelDir = meterLevelSpeed;
scoreIndex = 0;
xMidway = 0;
yMidway = 0;
starTrails = 0;
cannonManFlying = 0;
ballChainArray = new Array();
badGuysArray = new Array();
bonusCountArray = new Array();
spring = 0.1;
friction = 0.8;
gravity = 5;
springLength = 10;
ballCount = 3;
saucerChance = 50;
saucerDelay = -1;
saucerDelay = rt.Useful1.RandomNumber(50, 400);
left = -20;
right = movieWidth - 20;
top = 0;
bottom = movieHeight;
levelNumber = 1;
scaleSpeed = 8;
balloonPlotted = false;
extraPointsSound = false;
secDisplay = "00";
minDisplay = "00";
StartTimer = 1;
clockDelay = 10;
minutes = StartTimer;
sec = 0;
fulltime = 0;
bottomEdge = movieHeight;
rightEdge = movieWidth;
pauseSwitch = false;
setupPanel();
}
function setupPanel() {
var _local3 = inGameStatsMc.attachMovie("weapons", "ingamestatsmc", 1);
_local3._y = movieHeight - (blockSize * 2);
var _local2 = _local3.wg;
_local2 = _local2.stats;
_local2.musicBtn.myObject = this;
_local2.musicBtn.myMc = _local2;
_local2.quitBtn.myObject = this;
if (rt.soundSwitch == "off") {
_local2.musicBtn._parent.music.gotoAndStop(2);
}
_local2.musicBtn.onRelease = function () {
if (this.myMc.music._currentframe == 1) {
this.myObject.rt.soundFade = "out";
this.myMc.music.gotoAndStop("off");
this.myObject.rt.musicPlaying = "off";
} else {
this.myObject.rt.soundFade = "in";
this.myMc.music.gotoAndStop("on");
this.myObject.rt.musicPlaying = "on";
}
};
_local2.quitBtn.onRelease = function () {
if (this.myObject.rt.Game.pauseSwitch == false) {
this.myObject.rt.obj.vx = 0;
this.myObject.rt.obj.vy = 0;
this.myObject.rt.Game.balloonPlotted = false;
this.myObject.rt.obj.clip.removeMovieClip();
this.myObject.rt.Game.msgMc.removeMovieClip();
this.myObject.rt.Game.gameState = "game_over_restart";
}
};
}
function turnMusicOff() {
var _local2 = inGameStatsMc.ingamestatsmc;
_local2 = _local2.wg;
_local2 = _local2.stats;
_local2.music.gotoAndStop(2);
}
function turnMusicOn() {
var _local2 = inGameStatsMc.ingamestatsmc;
_local2 = _local2.wg;
_local2 = _local2.stats;
_local2.music.gotoAndStop(1);
}
function pauseOn() {
pauseSwitch = true;
gameState = "pause";
pauseMc = inGameMc.attachMovie("pauseMc", "pauseMc", 3);
}
function pauseOff() {
pauseSwitch = false;
gameState = "play";
pauseMc.removeMovieClip();
}
function resetMcs() {
inGameEnemyMc = inGameContainerMc.createEmptyMovieClip("inGameEnemysMc", 1);
inGameMissilesMc = inGameContainerMc.createEmptyMovieClip("inGameMissilesMc", 2);
inGameExplosionsMc = inGameContainerMc.createEmptyMovieClip("inGameExplosionsMc", 3);
inGameScoreMc = inGameContainerMc.createEmptyMovieClip("inGameScoresMc", 4);
inGameObjectsMc = inGameContainerMc.createEmptyMovieClip("inGameObjectsMc", 5);
}
function gameOver(gameOverType) {
rt.Player.gun.monkey.frames.gotoAndStop("stand");
rt.saucerObject.stop();
extraPointsSound = false;
if (gameOverType == "out_of_time") {
gameState = "game_over";
msgMc = inGameMsgsMc.attachMovie("gameOverMsgAnim", "gameover", 1);
msgMc._x = movieWidth / 2;
msgMc._x = msgMc._x - 12;
msgMc._y = movieHeight / 2;
msgMc._y = msgMc._y - 4;
rt.sounds.GameOverRobot.start(0, 1);
} else if (levelNumber == 15) {
gameState = "game_over";
endScreenMc = presentationMc.attachMovie("endScreen", "gameComplete", 1);
endScreenMc._x = (movieWidth / 2) - 17;
endScreenMc._y = movieHeight / 2;
endScreenMc.balloon.balloon.furries._alpha = 100;
} else {
gameState = "level_complete";
msgMc = inGameMsgsMc.attachMovie("levelCompleteMsgAnim", "levelComplete", 1);
msgMc._x = movieWidth / 2;
msgMc._y = (movieHeight / 2) - 60;
currentTimeBonus = 0;
timeBonus = minutes * 60;
timeBonus = timeBonus + sec;
var _local2 = 20;
var _local3 = 30;
var _local4 = 46.1538461538462;
if (timeBonus < _local2) {
msgMc.howWellDone = 1;
}
if (timeBonus < _local3) {
msgMc.howWellDone = 2;
} else {
msgMc.howWellDone = 3;
}
}
}
function setupEnemy(mCName) {
}
function setupEnemies() {
enemyArray.splice(0);
var _local3 = rt.enemies[levelNumber - 1];
var _local2 = 0;
while (_local2 < _local3.length) {
setupEnemy(_local3[_local2]);
_local2++;
}
}
function removeGerms() {
var _local2 = 0;
while (_local2 < badGuysArray.length) {
var _local3 = badGuysArray[_local2];
_local3.swapDepths(1);
_local3.removeMovieClip();
_local2++;
}
}
function fireGun(xStart, yStart, vx, vy, myParent) {
}
function setupBalls() {
delay--;
if (delay == 0) {
delay = delayForBalls;
delayForBalls--;
if (delayForBalls < 10) {
delayForBalls = 10;
}
var _local3 = inGameObjectsMc.attachMovie("ball", "ball" + ballsNumber, ballsNumber);
ballsNumber++;
var _local5 = 0;
var _local4 = rt.Useful1.RandomNumber(20, 460);
_local3._x = _local4;
var _local2 = rt.Useful1.RandomNumber(1, 9);
if (_local2 > 5) {
if (pickupType != "") {
_local2 = rt.Useful1.RandomNumber(1, 5);
}
}
_local3.gotoAndStop(_local2);
goodGuysArray.push(new GoodGuy(_local3, rt, _local4, _local5, 0.5));
}
}
function setupGerms() {
removeGerms();
badGuysArray.splice(0);
delayForBalls = 100;
delay = delayForBalls;
ballsNumber = 0;
lives = 5;
pickupType = "";
setLevel();
inGameEnemyMc = inGameContainerMc.createEmptyMovieClip("inGameEnemysMc", 1);
inGameMissilesMc = inGameContainerMc.createEmptyMovieClip("inGameMissilesMc", 2);
inGameExplosionsMc = inGameContainerMc.createEmptyMovieClip("inGameExplosionsMc", 3);
inGameScoreMc = inGameContainerMc.createEmptyMovieClip("inGameScoresMc", 4);
inGameObjectsMc = inGameContainerMc.createEmptyMovieClip("inGameObjectsMc", 5);
rt.Player.updatePosition();
}
function checkForGameOver() {
if (sizeTarget == 0) {
gameOver("level_complete");
} else if (oxygenLevel == 0) {
gameOver("out_of_time");
}
}
function runPickups() {
if (pickupType == "stretch") {
pickupDelay--;
if (pickupDelay == 0) {
rt.Player.gun.play();
pickupType = "";
}
} else if (pickupType == "shrink") {
pickupDelay--;
if (pickupDelay == 0) {
rt.Player.gun.play();
pickupType = "";
}
} else if (pickupType == "colour") {
pickupDelay--;
if (pickupDelay == 0) {
rt.Player.gun.gotoAndStop(1);
pickupType = "";
}
} else if (pickupType == "slow") {
pickupDelay--;
if (pickupDelay == 0) {
pickupType = "";
}
}
}
function mainLoop() {
if (gameState == "play") {
checkForGameOver();
setupBalls();
runPickups();
var _local2 = 0;
while (_local2 < goodGuysArray.length) {
goodGuysArray[_local2].mainLoop();
_local2++;
}
rt.Player.mainLoop();
doStarTrail();
}
}
function checkBallCollision(ball1, ball2, mCWidth) {
var _local2 = rt.Useful1.getDistance(ball1, ball2);
_local2 = _local2 - (ball2._width / 2);
_local2 = _local2 - mCWidth;
if (_local2 < 0) {
return(true);
}
return(false);
}
function explode(ind) {
badGuysArray[ind].gotoAndStop("myColour");
}
function doStarTrail() {
if (rt.Player.playerState == "flying") {
starAnimDelay--;
if (starAnimDelay == 0) {
starAnimDelay = 4;
msgMc = inGameExplosionsMc.attachMovie("starAnim", "stars" + starTrails, starTrails);
msgMc._x = rt.Player.mC._x;
msgMc._y = rt.Player.mC._y;
msgMc._x = msgMc._x - rt.Player.vectorData.xPos;
msgMc._y = msgMc._y - rt.Player.vectorData.yPos;
msgMc._xscale = (msgMc._yscale = 20);
starTrails++;
}
}
}
function decreaseScore() {
}
function increaseScore(increase) {
var _local3 = int(score / 700);
score = int(score + increase);
var _local2 = int(score / 700);
if (_local3 != _local2) {
rt.sounds.extraLifeFx.start(0, 1);
lives++;
setLevel();
}
if (score > 0) {
setScore();
}
}
function setLives() {
var _local2 = inGameStatsMc.ingamestatsmc;
_local2 = _local2.wg;
_local2 = _local2.stats;
_local2.lives.text = lives;
}
function decreaseOxygen(d) {
oxygenLevel = oxygenLevel - d;
if (oxygenLevel < 0) {
oxygenLevel = 0;
}
setOxygen();
}
function increaseOxygen(d) {
oxygenLevel = oxygenLevel + d;
if (oxygenLevel > 100) {
oxygenLevel = 100;
}
setOxygen();
}
function loseLife() {
lives--;
if (lives == 0) {
gameOver("out_of_time");
}
setLevel();
}
function setOxygen() {
var _local2 = inGameStatsMc.ingamestatsmc;
_local2 = _local2.wg;
_local2 = _local2.stats;
_local2.sizeTarget.text = oxygenLevel;
}
function setLevel() {
var _local2 = inGameStatsMc.ingamestatsmc;
_local2 = _local2.wg;
_local2 = _local2.stats;
_local2.level.text = lives;
}
function setScore() {
var _local2 = inGameStatsMc.ingamestatsmc;
_local2 = _local2.wg;
_local2 = _local2.stats;
if (score > 99999) {
score = 99999 /* 0x01869F */;
}
if (score < 10) {
_local2.score.text = "0000" + score;
} else if (score < 100) {
_local2.score.text = "000" + score;
} else if (score < 1000) {
_local2.score.text = "00" + score;
} else if (score < 10000) {
_local2.score.text = "0" + score;
} else {
_local2.score.text = score;
}
}
function setBest() {
var _local2 = inGameStatsMc.ingamestatsmc;
_local2 = _local2.wg;
_local2 = _local2.stats;
if (bestScore < 10) {
_local2.bestScore.text = "0000" + bestScore;
} else if (bestScore < 100) {
_local2.bestScore.text = "000" + bestScore;
} else if (bestScore < 1000) {
_local2.bestScore.text = "00" + bestScore;
} else if (bestScore < 10000) {
_local2.bestScore.text = "0" + bestScore;
} else {
_local2.bestScore.text = bestScore;
}
}
function doClock() {
clockDelay--;
if (clockDelay == 0) {
clockDelay = 20;
countDown();
}
}
function countDown() {
sec--;
if (sec < 0) {
minutes--;
sec = 59;
if (minutes < 0) {
minutes = 0;
sec = 0;
gameOver("out_of_time");
}
}
displayTime();
}
function displayTime() {
if (sec < 10) {
secDisplay = "0" + sec;
} else {
secDisplay = String(sec);
}
if (minutes < 10) {
minDisplay = "0" + minutes;
} else {
minDisplay = String(minutes);
}
var _local2 = inGameStatsMc.ingamestatsmc;
_local2 = _local2.wg;
trace(_local2._name);
_local2 = _local2.stats;
_local2.time.text = ((minDisplay + ":") + secDisplay) + "s";
}
}
Symbol 531 MovieClip [__Packages.Useful] Frame 0
class Useful
{
function Useful () {
}
function getDistance(xx1, yy1, xx2, yy2) {
var _local4 = xx1;
var _local3 = yy1;
var _local2 = xx2;
var _local1 = yy2;
_local2 = _local4 - _local2;
_local1 = _local3 - _local1;
return(Math.sqrt((_local2 * _local2) + (_local1 * _local1)));
}
function RandomNumber(x, y) {
return(Math.round(Math.random() * (y - x)) + x);
}
function getArcVelocity(gravity, speed, xStart, yStart, xEnd, yEnd) {
var _local1 = new Object();
var _local3 = xEnd - xStart;
var _local4 = yEnd - yStart;
var _local6 = Math.sqrt((_local3 * _local3) + (_local4 * _local4));
var _local2 = Math.ceil(_local6 / speed);
_local1.gravity = gravity;
_local1.steps = _local2;
_local1.xStep = _local3 / _local2;
_local1.yStep = _local4 / _local2;
if (gravity > 0) {
_local1.yStep = _local1.yStep - ((_local2 * gravity) / 2);
}
return(_local1);
}
function localToGlobalXY(mc1) {
var _local3 = new Object();
_local3.newX = 0;
_local3.newY = 0;
var _local2 = mc1;
while (_local2 != _root) {
var _local6 = _local3.newX * (_local2._xscale / 100);
var _local5 = _local3.newY * (_local2._yscale / 100);
var _local4 = _local2._rotation * (Math.PI/180);
_local3.newX = (_local6 * Math.cos(_local4)) - (_local5 * Math.sin(_local4));
_local3.newY = (_local6 * Math.sin(_local4)) + (_local5 * Math.cos(_local4));
_local3.newX = _local3.newX + _local2._x;
_local3.newY = _local3.newY + _local2._y;
_local2 = _local2._parent;
}
return(_local3);
}
function radian(degree) {
return((degree * Math.PI) / 180);
}
function addThrust(rot, speed) {
var _local2 = new Object();
_local2.xVel = Math.cos(radian(rot)) * speed;
_local2.yVel = Math.sin(radian(rot)) * speed;
return(_local2);
}
function getVectorFromAngle(rotationVar) {
var _local1 = new Object();
var _local2 = (rotationVar * Math.PI) / 180;
_local1.vx = Math.cos(_local2);
_local1.vy = Math.sin(_local2);
return(_local1);
}
function capVectorSpeed(vx, vy, max) {
var _local2 = new Object();
var _local1 = Math.sqrt((vx * vx) + (vy * vy));
if (_local1 > max) {
vx = vx * (max / _local1);
vy = vy * (max / _local1);
}
_local2.vx = vx;
_local2.vy = vy;
return(_local2);
}
function pointTowards(xx, yy, xx2, yy2) {
var _local1 = new Object();
var _local3 = xx - xx2;
var _local2 = yy - yy2;
_local1.spriteAngle = Math.atan2(_local2, _local3);
_local1.spriteRotation = (_local1.spriteAngle * 180) / Math.PI;
_local1.vx = Math.cos(_local1.spriteAngle);
_local1.vy = Math.sin(_local1.spriteAngle);
return(_local1);
}
function rotateXY(centerX, centerY, radius, ringAngle) {
var _local2 = (Math.PI * ringAngle) / 180;
var _local1 = new Object();
_local1.xPos = centerX + (Math.cos(_local2) * radius);
_local1.yPos = centerY + (Math.sin(_local2) * radius);
return(_local1);
}
}