Frame 1
function check_domain() {
if (_root._url.indexOf("kongregate.com") > -1) {
_global.kongregate_site = true;
} else if (_root._url.indexOf("agame.com") > -1) {
_global.kongregate_site = true;
} else if (_root._url.indexOf("mindjolt.com") > -1) {
_global.mindjolt_site = true;
}
}
_global.mindjolt_site = false;
_global.kongregate_site = false;
check_domain();
com.mindjolt.api.as2.MindJoltSponsoredAPI.connect("77B4023C", "01448796BCF48912");
startGameCounter = 0;
var framesLoaded = this.getBytesLoaded();
var totalFrames = this.getBytesTotal();
var percentLoaded2 = int(((framesLoaded - 382031) / (totalFrames - 382031)) * 100);
loadingScreen.loadingTxt = percentLoaded2 + " %";
loadingScreen.gotoAndStop(percentLoaded2 / 2);
var CPMStarPoolID = 1437;
var CPMStarSubPoolID = 15090;
if (_global.kongregate_site == false) {
System.security.allowDomain("server.cpmstar.com");
adBox.loadMovie((("http://server.cpmstar.com/adviewas2.swf?poolid=" + CPMStarPoolID) + "&subpoolid=") + CPMStarSubPoolID);
}
loadingScreen.stop();
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__("f041e4b8", this, 10301, true);
Frame 3
if (framesLoaded == totalFrames) {
gotoAndPlay ("display_ad");
} else {
gotoAndPlay ("loop1");
}
Frame 5
if (startGameCounter == 20) {
if (_global.kongregate_site == false) {
gotoAndStop ("show_btn");
} else {
gotoAndStop ("show_mj_anim");
}
} else {
startGameCounter++;
gotoAndPlay ("display_ad");
}
Frame 8
stop();
sounds = new Object();
sounds.fire = new Sound(this);
sounds.fire.attachSound("fire");
sounds.fireMissile = new Sound(this);
sounds.fireMissile.attachSound("bing");
sounds.musicObject = new Sound(this);
sounds.musicObject.attachSound("music");
sounds.doh = new Sound(this);
sounds.doh.attachSound("doh");
sounds.cheer = new Sound(this);
sounds.cheer.attachSound("cheer");
sounds.popFX = new Sound(this);
sounds.popFX.attachSound("pop");
sounds.extraPoints = new Sound(this);
sounds.extraPoints.attachSound("bonusx4");
sounds.levelComplete = new Sound(this);
sounds.levelComplete.attachSound("gainlife");
sounds.Explosion = new Sound(this);
sounds.Explosion.attachSound("explosion");
sounds.GameOverRobot = new Sound(this);
sounds.GameOverRobot.attachSound("GameOverRobot");
sounds.Appear = new Sound(this);
sounds.Appear.attachSound("Appear");
sounds.GotSaucer = new Sound(this);
sounds.GotSaucer.attachSound("GotSaucer");
sounds.musicObject.start(0, 1000);
var balloonLevelSizes = new Array(13, 5, 5, 5, 7, 8, 9, 9, 10, 10, 12, 12, 13, 14, 15, 15, 16, 17, 17, 18, 18, 19, 19, 19, 20, 20, 21, 21, 21, 22, 22, 22, 23, 23, 24, 24, 24, 24, 26, 26, 26, 26, 26, 26, 27, 27, 27, 28, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30);
var numberOfSpikies = new Array(25, 10, 7, 8, 9, 10, 11, 12, 13, 14, 14, 14, 15, 16, 17, 18, 19, 20, 20, 20, 20, 21, 21, 22, 22, 22, 23, 23, 23, 24, 24, 24, 24, 25, 25, 25, 25, 26, 27, 27, 27, 27, 27, 27, 28, 28, 29, 29, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30);
function setupGame() {
Game = new GameGame(gameMc, this, 700, 560, 8, 20, 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.Explosion.setVolume(soundFadeControl);
sounds.GameOverRobot.setVolume(soundFadeControl);
sounds.Appear.setVolume(soundFadeControl);
sounds.GotSaucer.setVolume(soundFadeControl);
}
function quitGame() {
obj.vx = 0;
obj.vy = 0;
Game.score2 = 0;
Player.myCurrentScore = 0;
obj.clip.removeMovieClip();
Game.msgMc.removeMovieClip();
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") {
Game.setupGerms();
clearSprites();
Game.clockDelay = 20;
Player = new GamePlayer(Game.ballMc, this, 300, 300, Key);
Presentation.splashScreenMc.removeMovieClip();
Game.saucerChance = 50;
Game.saucerDelay = -1;
if (Useful1.RandomNumber(1, 100) < (Game.saucerChance + Game.levelNumber)) {
Game.saucerDelay = Useful1.RandomNumber(50, 400);
}
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.displayTime();
Game.goodGuysArray.splice(0);
Game.sizeTarget = balloonLevelSizes[Game.levelNumber - 1];
Game.lives = startLives;
Game.setLives();
Game.setTarget();
Game.setScore();
Game.setScore2();
Game.setLevel();
Player.xOrigin = _xmouse;
Player.xPos = 0;
Game.oldMouseX = _xmouse;
Game.oldMouseY = _ymouse;
Game.changeStatsColour();
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;
Game.saucerChance = 60;
Game.saucerDelay = -1;
if (Useful1.RandomNumber(1, 100) < (Game.saucerChance + Game.levelNumber)) {
Game.saucerDelay = Useful1.RandomNumber(50, 200);
}
Game.enemyArray.splice(0);
Game.sizeTarget = balloonLevelSizes[Game.levelNumber - 1];
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.setScore2();
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") {
clearSprites();
Game.enemyArray.splice(0);
Game.clockDelay = 20;
Presentation.setupSplashScreen(splashScreenElements);
Game.score = 0;
Game.levelNumber = 1;
Game.bonusCountArray.splice(0);
Player.myCurrentScore = 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") {
bonusCountDelay--;
if (bonusCountDelay == 0) {
bonusCountDelay = 1;
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;
_local1 = _local1["w" + (_local2 + 1)];
_local1 = _local1.wb;
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() {
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() {
}
function rollOutRightPanelObject() {
}
function dropGameObject() {
var _local4 = _xmouse;
var _local3 = _ymouse;
if (Game.currentPickedUp != undefined) {
if (checkIfOverLapping() == true) {
var _local5 = 0;
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 CollisionDetectionObj = new CollisionDetection();
var ballColour = new Array("orange", "purple", "green", "blue", "red");
var Useful1 = new Useful();
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;
keyboard = new Object();
var PLAYER_STATUS = "";
var keypress = 0;
keyboard.onKeyDown = function () {
if (Game.pickupType != "multi") {
if (Key.isDown(38)) {
PLAYER_STATUS = "UP";
}
if (Key.isDown(40)) {
PLAYER_STATUS = "DOWN";
}
if (Key.getCode() == 65) {
keypress = 1;
} else if (Key.getCode() == 83) {
keypress = 2;
}
}
};
keyboard.onKeyUp = function () {
if (PLAYER_STATUS == "UP") {
if (Key.getCode() == 38) {
Player.currentColour--;
if (Player.currentColour < 0) {
Player.currentColour = 4;
}
Game.changeStatsColour();
Player.gun.bChar.gotoAndStop(ballColour[Player.currentColour]);
PLAYER_STATUS = "";
}
} else if (PLAYER_STATUS == "DOWN") {
if (Key.getCode() == 40) {
Player.currentColour++;
if (Player.currentColour > 4) {
Player.currentColour = 0;
}
Game.changeStatsColour();
Player.gun.bChar.gotoAndStop(ballColour[Player.currentColour]);
PLAYER_STATUS = "";
}
}
if (Key.getCode() == 80) {
if (Game.pauseSwitch == false) {
if (Game.gameState == "play") {
Game.pauseOn();
}
} else {
Game.pauseOff();
}
}
if (keypress == 1) {
if (Key.getCode() == 65) {
Player.currentColour--;
if (Player.currentColour < 0) {
Player.currentColour = 4;
}
Game.changeStatsColour();
Player.gun.bChar.gotoAndStop(ballColour[Player.currentColour]);
}
} else if (keypress == 2) {
if (Key.getCode() == 83) {
Player.currentColour++;
if (Player.currentColour > 4) {
Player.currentColour = 0;
}
Game.changeStatsColour();
Player.gun.bChar.gotoAndStop(ballColour[Player.currentColour]);
}
}
};
Key.addListener(keyboard);
var squareNamesArray = new Array();
var mousePointer = this.attachMovie("crosshair", "crosshair", 50);
mousePointer.yOld = 0;
var bonusCountDelay = 1;
var titleInfo = {mCName:"title", xPos:80, yPos:30};
var playInfo = {mCName:"playBtnAnim", xPos:170, yPos:120};
var instructionsInfo = {mCName:"instructionsBtnAnim", xPos:60, yPos:200};
var controlsInfo = {mCName:"controlsBtnAnim", xPos:80, yPos:240};
var highscoresInfo = {mCName:"highscoresBtnAnim", xPos:60, yPos:400};
var SplashMusicBtn = {mCName:"SplashMusicBtn", xPos:250, yPos:460};
var moreGamesBtn = {mCName:"moreGamesBtn", xPos:260, yPos:340};
if (_global.mindjolt_site == true) {
var splashScreenElements = [playInfo, instructionsInfo, controlsInfo, SplashMusicBtn, moreGamesBtn];
} else {
var splashScreenElements = [playInfo, instructionsInfo, controlsInfo, highscoresInfo, SplashMusicBtn, moreGamesBtn];
}
var startLives = 3000;
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 45 MovieClip Frame 1
score.text = _parent._parent._parent._parent._parent._parent._parent.Game.score;
var score2 = _parent._parent._parent._parent._parent._parent._parent.Game.score;
submitBtn.onRelease = function () {
if ((nameTxt.text != undefined) and (nameTxt.text != "")) {
_root.MindJoltSponsoredAPI.submitScore(nameTxt.text, score2);
gotoAndStop (2);
}
};
moreGamesBtn.onRelease = function () {
_parent._parent._parent._parent._parent._parent._parent.MindJoltSponsoredAPI.openLink(5);
};
viewhighscores.onRelease = function () {
_parent._parent._parent._parent._parent._parent._parent.MindJoltSponsoredAPI.openLink(4);
};
stop();
quitBtn.onRelease = function () {
_parent._parent._parent._parent._parent._parent._parent.quitGame();
};
Symbol 46 MovieClip [gameOverMsg] Frame 1
if (_global.mindjolt_site == true) {
msg.gotoAndStop(3);
ScoreAPI = new LocalConnection();
ScoreAPI.send(_root.com_mindjolt_api, "submitScore", _parent._parent._parent._parent._parent._parent.Game.score);
}
Symbol 47 MovieClip [gameOverMsgAnim] Frame 10
stop();
Symbol 47 MovieClip [gameOverMsgAnim] Frame 23
_parent._parent._parent._parent._parent.Game.gameState = "game_over_restart";
stop();
Symbol 57 MovieClip Frame 1
stop();
Symbol 57 MovieClip Frame 10
gotoAndStop (1);
Symbol 68 MovieClip [ballCharacter] Frame 1
stop();
Symbol 73 MovieClip [badBall] Frame 1
stop();
Symbol 73 MovieClip [badBall] Frame 5
stop();
Symbol 73 MovieClip [badBall] Frame 18
this.removeMovieClip();
Symbol 77 MovieClip [M_stars1] Frame 15
this.removeMovieClip();
Symbol 78 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 78 MovieClip [starAnim] Frame 24
this.removeMovieClip();
stop();
Symbol 112 MovieClip Frame 1
stop();
Symbol 116 MovieClip Frame 1
stop();
Symbol 118 MovieClip [loseLifeMsgAnim] Frame 48
if (_parent._parent._parent._parent._parent.Game.gameState != "restart") {
_parent._parent._parent._parent._parent.Game.gameState = "restart";
}
this.removeMovieClip();
Symbol 122 MovieClip [getReadyMsgAnim] Frame 11
msg.sizeTarget.text = _parent._parent._parent._parent._parent.Game.sizeTarget;
Symbol 122 MovieClip [getReadyMsgAnim] Frame 74
_parent._parent._parent._parent._parent.Game.gameState = "play";
this.removeMovieClip();
Symbol 131 MovieClip [levelCompleteMsgs] Frame 1
stop();
Symbol 133 MovieClip [levelCompleteMsgAnim] Frame 15
msg.titleMc.gotoAndStop(howWellDone);
Symbol 133 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 133 MovieClip [levelCompleteMsgAnim] Frame 81
_parent._parent._parent._parent._parent.Game.gameState = "start_new_level";
stop();
Symbol 137 MovieClip [pausedMsgAnim] Frame 33
stop();
Symbol 137 MovieClip [pausedMsgAnim] Frame 42
this.removeMovieClip();
Symbol 142 MovieClip [square] Frame 1
stop();
Symbol 148 MovieClip Frame 1
stop();
Symbol 148 MovieClip Frame 11
_parent.deathDone = true;
_parent.removeMovieClip();
Symbol 174 MovieClip Frame 1
stop();
Symbol 174 MovieClip Frame 15
stop();
Symbol 178 MovieClip Frame 1
stop();
Symbol 178 MovieClip Frame 11
_parent.deathDone = true;
Symbol 182 MovieClip Frame 1
stop();
Symbol 182 MovieClip Frame 11
_parent.deathDone = true;
Symbol 186 MovieClip Frame 1
stop();
Symbol 186 MovieClip Frame 11
_parent.deathDone = true;
Symbol 190 MovieClip Frame 1
stop();
Symbol 190 MovieClip Frame 11
_parent.deathDone = true;
Symbol 197 MovieClip Frame 1
stop();
Symbol 197 MovieClip Frame 11
_parent.deathDone = true;
_parent.removeMovieClip();
Symbol 199 MovieClip Frame 1
stop();
Symbol 199 MovieClip Frame 11
_parent.deathDone = true;
_parent.removeMovieClip();
Symbol 200 MovieClip [tiles] Frame 1
stop();
Symbol 203 MovieClip Frame 1
stop();
Symbol 215 MovieClip Frame 1
stop();
Symbol 221 MovieClip [weapons] Frame 1
t1.t1.gotoAndStop(1);
t2.t1.gotoAndStop(2);
t3.t1.gotoAndStop(3);
t4.t1.gotoAndStop(4);
t5.t1.gotoAndStop(5);
Symbol 241 Button
on (release) {
getURL ("http://www.flashgamemaker.com", _blank);
}
Symbol 249 Button
on (release) {
_root.MindJoltSponsoredAPI.openLink(6);
}
Symbol 255 MovieClip [SplashScreen] Frame 1
Symbol 274 MovieClip [splashInfo] Frame 1
stop();
Symbol 274 MovieClip [splashInfo] Frame 2
stop();
backBtn.onRelease = function () {
_root.Presentation.setupPresentationElements();
gotoAndStop (1);
};
nextBtn.onRelease = function () {
gotoAndStop (3);
};
Symbol 274 MovieClip [splashInfo] Frame 3
backBtn.onRelease = function () {
_root.Presentation.setupPresentationElements();
gotoAndStop (1);
};
Symbol 274 MovieClip [splashInfo] Frame 4
function moveOn() {
_root.Presentation.setupPresentationElements();
gotoAndStop (1);
}
backBtn.onRelease = function () {
_root.mochi.MochiScores.closeLeaderboard();
moveOn();
};
var leaderBoardMc = this.createEmptyMovieClip("leaderBoard", 1);
leaderBoardMc._x = -360;
leaderBoardMc._y = -200;
mochi.MochiScores.showLeaderboard({boardID:"e55af2c20016c000", clip:leaderBoardMc, onClose:moveOn, onError:moveOn});
stop();
Symbol 278 MovieClip Frame 1
stop();
Symbol 280 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.soundFade = "out";
this._parent._parent._parent._parent._parent._parent.musicPlaying = "off";
musicMc.gotoAndStop(2);
} else {
this._parent._parent._parent._parent._parent._parent.soundFade = "in";
this._parent._parent._parent._parent._parent._parent.musicPlaying = "on";
musicMc.gotoAndStop(1);
}
};
Symbol 286 MovieClip [bonusMc1] Frame 16
this.removeMovieClip();
Symbol 291 MovieClip [bonusMc2] Frame 16
this.removeMovieClip();
Symbol 296 MovieClip [bonusMc3] Frame 16
this.removeMovieClip();
Symbol 301 MovieClip [bonusMc4] Frame 16
this.removeMovieClip();
Symbol 308 MovieClip [bonusMc1000] Frame 16
this.removeMovieClip();
Symbol 311 MovieClip [points] Frame 21
this.removeMovieClip();
Symbol 312 MovieClip [ballFade] Frame 6
this.removeMovieClip();
Symbol 315 MovieClip [points50] Frame 13
this.removeMovieClip();
Symbol 321 MovieClip [previewMc] Frame 1
stop();
Symbol 367 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 368 MovieClip [__Packages.mochi.MochiServices] Frame 0
class mochi.MochiServices
{
static var _id, _container, _clip, _sendChannelName, _rcvChannelName, __get__comChannelName, onError, _listenChannel, _rcvChannel, _loader, _loaderListener, _sendChannel;
function MochiServices () {
}
static function get id() {
return(_id);
}
static function get clip() {
return(_container);
}
static function get childClip() {
return(_clip);
}
static function getVersion() {
return("1.31");
}
static function allowDomains(server) {
var _local1 = server.split("/")[2].split(":")[0];
if (System.security) {
if (System.security.allowDomain) {
System.security.allowDomain("*");
System.security.allowDomain(_local1);
}
if (System.security.allowInsecureDomain) {
System.security.allowInsecureDomain("*");
System.security.allowInsecureDomain(_local1);
}
}
return(_local1);
}
static function get isNetworkAvailable() {
if (System.security) {
var _local1 = System.security;
if (_local1.sandboxType == "localWithFile") {
return(false);
}
}
return(true);
}
static function set comChannelName(val) {
if (val != undefined) {
if (val.length > 3) {
_sendChannelName = val + "_fromgame";
_rcvChannelName = val;
initComChannels();
}
}
//return(__get__comChannelName());
}
static function get connected() {
return(_connected);
}
static function connect(id, clip, onError) {
if ((!_connected) && (_clip == undefined)) {
_connecting = true;
init(id, clip);
}
if (onError != undefined) {
mochi.MochiServices.onError = onError;
} else if (mochi.MochiServices.onError == undefined) {
mochi.MochiServices.onError = function (errorCode) {
};
}
}
static function disconnect() {
if (_connected || (_connecting)) {
_connecting = (_connected = false);
flush(true);
if (_clip != undefined) {
_clip.removeMovieClip();
delete _clip;
}
_listenChannel.close();
_rcvChannel.close();
}
}
static function init(id, clip) {
_id = id;
if (clip != undefined) {
_container = clip;
} else {
_container = _root;
}
loadCommunicator(id, _container);
}
static function loadCommunicator(id, clip) {
var _local2 = "_mochiservices_com_" + id;
if (_clip != null) {
return(_clip);
}
if (!isNetworkAvailable) {
return(null);
}
allowDomains(_gatewayURL);
_clip = clip.createEmptyMovieClip(_local2, 10336, false);
_loader = new MovieClipLoader();
if (_loaderListener.waitInterval != null) {
clearInterval(_loaderListener.waitInterval);
}
_loaderListener = {};
_loaderListener.onLoadError = function (target_mc, errorCode, httpStatus) {
mochi.MochiServices.disconnect();
mochi.MochiServices.onError.apply(null, [errorCode]);
};
_loaderListener.onLoadStart = function (target_mc) {
this.isLoading = true;
};
_loaderListener.startTime = getTimer();
_loaderListener.wait = function () {
if ((getTimer() - this.startTime) > 10000) {
if (!this.isLoading) {
mochi.MochiServices.disconnect();
mochi.MochiServices.onError.apply(null, ["IOError"]);
}
clearInterval(this.waitInterval);
}
};
_loaderListener.waitInterval = setInterval(_loaderListener, "wait", 1000);
_loader.addListener(_loaderListener);
_loader.loadClip(_gatewayURL, _clip);
_sendChannel = new LocalConnection();
_sendChannel._queue = [];
_rcvChannel = new LocalConnection();
_rcvChannel.allowDomain = function (d) {
return(true);
};
_rcvChannel.allowInsecureDomain = _rcvChannel.allowDomain;
_rcvChannel._nextcallbackID = 0;
_rcvChannel._callbacks = {};
listen();
return(_clip);
}
static function onStatus(infoObject) {
if (!(infoObject.level === "error")) {
} else {
_connected = false;
_listenChannel.connect(_listenChannelName);
}
}
static function listen() {
_listenChannel = new LocalConnection();
_listenChannel.handshake = function (args) {
mochi.MochiServices.__set__comChannelName(args.newChannel);
};
_listenChannel.allowDomain = function (d) {
return(true);
};
_listenChannel.allowInsecureDomain = _listenChannel.allowDomain;
_listenChannel.connect(_listenChannelName);
}
static function initComChannels() {
if (!_connected) {
_sendChannel.onStatus = function (infoObject) {
mochi.MochiServices.onStatus(infoObject);
};
_sendChannel.send(_sendChannelName, "onReceive", {methodName:"handshakeDone"});
_sendChannel.send(_sendChannelName, "onReceive", {methodName:"registerGame", id:_id, clip:_clip, version:getVersion()});
_rcvChannel.onStatus = function (infoObject) {
mochi.MochiServices.onStatus(infoObject);
};
_rcvChannel.onReceive = function (pkg) {
var _local5 = pkg.callbackID;
var _local4 = this._callbacks[_local5];
if (!_local4) {
return(undefined);
}
var _local2 = _local4.callbackMethod;
var _local3 = _local4.callbackObject;
if (_local3 && (typeof(_local2) == "string")) {
_local2 = _local3[_local2];
}
if (_local2 != undefined) {
_local2.apply(_local3, pkg.args);
}
delete this._callbacks[_local5];
};
_rcvChannel.onError = function () {
mochi.MochiServices.onError.apply(null, ["IOError"]);
};
_rcvChannel.connect(_rcvChannelName);
_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 ((_clip == undefined) || (!_connecting)) {
onError.apply(null, ["NotConnected"]);
handleError(args, callbackObject, callbackMethod);
flush(true);
return(undefined);
}
_sendChannel._queue.push({methodName:methodName, args:args, callbackID:_rcvChannel._nextcallbackID});
}
_rcvChannel._callbacks[_rcvChannel._nextcallbackID] = {callbackObject:callbackObject, callbackMethod:callbackMethod};
_rcvChannel._nextcallbackID++;
}
static var _gatewayURL = "http://www.mochiads.com/static/lib/services/services.swf";
static var _listenChannelName = "__mochiservices";
static var _connecting = false;
static var _connected = false;
}
Symbol 369 MovieClip [__Packages.com.mindjolt.api.as2.MindJoltSponsoredAPI] Frame 0
class com.mindjolt.api.as2.MindJoltSponsoredAPI
{
static var flashCookie, gameId, key;
function MindJoltSponsoredAPI () {
}
static function connect(_gameId, _key) {
_root.MindJoltSponsoredAPI = com.mindjolt.api.as2.MindJoltSponsoredAPI;
if (!connected) {
flashCookie = SharedObject.getLocal("com.mindjolt", "/");
gameId = _gameId.toUpperCase();
key = _key.toUpperCase();
connected = true;
}
}
static function submitScore(name, score, mode) {
var _local4 = null;
if (flashCookie.data.userToken != null) {
_local4 = flashCookie.data.userToken;
} else {
_local4 = null;
}
var _local8 = new com.meychi.ascrypt.RC4();
var _local5 = com.meychi.ascrypt.RC4.encrypt((((("score=" + score) + "&name=") + escape(name)) + ((mode != null) ? ("&mode=" + escape(mode)) : "")) + ((_local4 != null) ? ("&userToken=" + escape(_local4)) : ""), key);
var _local3 = new LoadVars();
var _local6 = new LoadVars();
_local3.gameId = gameId;
_local3.session = _local5;
_local6.onLoad = function (success) {
if (success) {
var _local4 = this.session;
if (_local4 != null) {
var _local5 = new com.meychi.ascrypt.RC4();
var _local2 = new LoadVars();
_local2.decode(com.meychi.ascrypt.RC4.decrypt(_local4, com.mindjolt.api.as2.MindJoltSponsoredAPI.key));
var _local3 = _local2.userToken;
if (_local3 != null) {
com.mindjolt.api.as2.MindJoltSponsoredAPI.flashCookie.data.userToken = _local3;
com.mindjolt.api.as2.MindJoltSponsoredAPI.flashCookie.flush();
}
}
}
};
_local3.sendAndLoad("http://game.mindjolt.com/servlet/GameScore", _local6, "POST");
}
static function openLink(linkId, mode) {
var _local1 = ((((("http://game.mindjolt.com/servlet/GameLink?key=" + gameId) + "&link=") + linkId) + ((mode != null) ? ("&mode=" + escape(mode)) : "")) + "&httpref=") + escape(_url);
getURL (_local1, "_blank");
}
static var connected = false;
}
Symbol 370 MovieClip [__Packages.com.meychi.ascrypt.RC4] Frame 0
class com.meychi.ascrypt.RC4
{
function RC4 () {
}
static function encrypt(src, key) {
var _local3 = strToChars(src);
var _local1 = strToChars(key);
var _local2 = calculate(_local3, _local1);
return(charsToHex(_local2));
}
static function decrypt(src, key) {
var _local3 = hexToChars(src);
var _local1 = strToChars(key);
var _local2 = calculate(_local3, _local1);
return(charsToStr(_local2));
}
static function initialize(pwd) {
var _local2 = 0;
var _local3;
var _local4 = pwd.length;
var _local1 = 0;
while (_local1 <= 255) {
mykey[_local1] = pwd[_local1 % _local4];
sbox[_local1] = _local1;
_local1++;
}
_local1 = 0;
while (_local1 <= 255) {
_local2 = ((_local2 + sbox[_local1]) + mykey[_local1]) % 256;
_local3 = sbox[_local1];
sbox[_local1] = sbox[_local2];
sbox[_local2] = _local3;
_local1++;
}
}
static function calculate(plaintxt, psw) {
initialize(psw);
var _local1 = 0;
var _local2 = 0;
var _local9 = new Array();
var _local7;
var _local5;
var _local6;
var _local3 = 0;
while (_local3 < plaintxt.length) {
_local1 = (_local1 + 1) % 256;
_local2 = (_local2 + sbox[_local1]) % 256;
_local5 = sbox[_local1];
sbox[_local1] = sbox[_local2];
sbox[_local2] = _local5;
var _local4 = (sbox[_local1] + sbox[_local2]) % 256;
_local7 = sbox[_local4];
_local6 = plaintxt[_local3] ^ _local7;
_local9.push(_local6);
_local3++;
}
return(_local9);
}
static function charsToHex(chars) {
var _local4 = new String("");
var _local3 = new Array("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f");
var _local1 = 0;
while (_local1 < chars.length) {
_local4 = _local4 + (_local3[chars[_local1] >> 4] + _local3[chars[_local1] & 15]);
_local1++;
}
return(_local4);
}
static function hexToChars(hex) {
var _local3 = new Array();
var _local1 = ((hex.substr(0, 2) == "0x") ? 2 : 0);
while (_local1 < hex.length) {
_local3.push(parseInt(hex.substr(_local1, 2), 16));
_local1 = _local1 + 2;
}
return(_local3);
}
static function charsToStr(chars) {
var _local3 = new String("");
var _local1 = 0;
while (_local1 < chars.length) {
_local3 = _local3 + String.fromCharCode(chars[_local1]);
_local1++;
}
return(_local3);
}
static function strToChars(str) {
var _local3 = new Array();
var _local1 = 0;
while (_local1 < str.length) {
_local3.push(str.charCodeAt(_local1));
_local1++;
}
return(_local3);
}
static var sbox = new Array(255);
static var mykey = new Array(255);
}
Symbol 371 MovieClip [__Packages.GamePlayer] Frame 0
class GamePlayer
{
var KeyCheck, missileDistFromGun, root, currentColour, shotsFired, shotsLimit, numberOfMissiles, keypress, jumpTime, mouseButton, mC, shotStrength, previewMc, gun, gravitySpeed, speed, pickupDelay, myCurrentScore;
function GamePlayer (clip, rt, xStart, yStart, k) {
KeyCheck = k;
missileDistFromGun = 40;
xOrigin = xStart;
yOrigin = yStart;
dx = 0;
root = rt;
dy = 0;
currentColour = 0;
angle = 0;
shotsFired = 0;
shotsLimit = 2;
xPos = 0;
yPos = 0;
xVel = 0;
yVel = 0;
xVelOld = 0;
numberOfMissiles = 0;
yVelOld = 0;
keypress = 0;
jump = 0;
jumpTime = 10;
mouseButton = 0;
mC = clip;
shotStrength = 6;
previewMc = mC.attachMovie("previewMc2", "tilePreview", 0);
previewMc._alpha = 50;
gun = mC.attachMovie("ballMan", "BallMc", 1);
gravitySpeed = 2;
speed = 5;
pickupDelay = 0;
myCurrentScore = 0;
updatePosition();
}
function mainLoop() {
if (pickupDelay != 0) {
pickupDelay--;
if (pickupDelay == 0) {
root.Game.pickupAdded = false;
if (root.Game.pickupType == "speed") {
root.Game.pickupType = "";
speed = 5;
gravitySpeed = 2;
} else if (root.Game.pickupType == "multi") {
root.Game.pickupType = "";
gun.bChar.gotoAndStop(currentColour + 1);
}
} else if (root.Game.pickupType == "speed") {
var _local6 = root.Game.inGameScoreMc.attachMovie("ballFade", "ballFade" + root.Game.starAnims, root.Game.starAnims + 1000);
_local6._x = mC._x;
_local6._y = mC._y;
_local6.bChar.gotoAndStop(root.ballColour[currentColour]);
root.Game.starAnims++;
}
}
yVel = yVel + gravitySpeed;
var _local12 = 0;
var _local13 = jump;
if (KeyCheck.isDown(32)) {
root.Game.gameCounter = 1;
}
if (KeyCheck.isDown(37)) {
xVel = -speed;
_local12 = 1;
}
if (KeyCheck.isDown(39)) {
xVel = speed;
_local12 = 1;
}
if (_local12 == 0) {
xVel = xVel / 1.2;
}
var _local10 = int(mC._x / 70);
var _local11 = int(mC._y / 28);
var _local8 = _local11 - 1;
while (_local8 < (_local11 + 3)) {
var _local5 = _local10 - 1;
while (_local5 < (_local10 + 3)) {
var _local2 = (root.Game.levelWidthBlocks * _local8) + _local5;
if ((root.Game.tilesArray[_local2] != 0) and (root.Game.tilesArray[_local2] != undefined)) {
var _local9 = xVel;
var _local4 = yVel;
var _local3 = root.CollisionDetectionObj.CheckMoving(gun, root.Game.tilesArray[_local2].mC, xVel, yVel, root);
if (_local3.hit == true) {
gun.bChar.mouth.gotoAndPlay("stop");
root.sounds.fire.start(0, 1);
xVel = _local3.vx;
yVel = _local3.vy;
_local9 = xVel;
_local4 = yVel;
if (root.Game.tilesArray[_local2].mC.energy == 1) {
if (root.Game.tilesArray[_local2].mC.energy2 == 100) {
root.Game.tilesArray[_local2].mC.ice.play();
}
root.Game.tilesArray[_local2].mC.energy2 = root.Game.tilesArray[_local2].mC.energy2 - 50;
if (root.Game.tilesArray[_local2].mC.energy2 <= 0) {
if (root.Game.pickupType == "multi") {
root.sounds.popFX.start(0, 1);
root.Game.tilesArray[_local2].doDeath();
var _local6 = root.Game.inGameScoreMc.attachMovie("points", "points" + root.Game.starAnims, root.Game.starAnims + 1000);
_local6._x = root.Game.tilesArray[_local2].mC._x + 35;
_local6._y = root.Game.tilesArray[_local2].mC._y + 14;
root.Game.tilesArray[_local2] = 0;
root.Game.starAnims++;
_local6.txt.pointsTxt.text = 10;
root.Game.increaseScore(10);
} else if (root.Game.tilesArray[_local2].mC._currentframe == (root.Player.currentColour + 1)) {
root.sounds.popFX.start(0, 1);
root.Game.tilesArray[_local2].doDeath();
var _local6 = root.Game.inGameScoreMc.attachMovie("points", "points" + root.Game.starAnims, root.Game.starAnims + 1000);
_local6._x = root.Game.tilesArray[_local2].mC._x + 35;
_local6._y = root.Game.tilesArray[_local2].mC._y + 14;
root.Game.tilesArray[_local2] = 0;
root.Game.starAnims++;
_local6.txt.pointsTxt.text = 10;
root.Game.increaseScore(10);
}
}
} else if (root.Game.tilesArray[_local2].mC.pickup == "speed") {
root.sounds.fireMissile.start(0, 1);
root.Game.tilesArray[_local2].doDeath();
speed = 10;
gravitySpeed = 6;
root.Game.pickupType = "speed";
pickupDelay = 200;
var _local6 = root.Game.inGameScoreMc.attachMovie("points", "points" + root.Game.starAnims, root.Game.starAnims + 1000);
_local6._x = root.Game.tilesArray[_local2].mC._x + 35;
_local6._y = root.Game.tilesArray[_local2].mC._y + 14;
root.Game.tilesArray[_local2] = 0;
root.Game.starAnims++;
_local6.txt.pointsTxt.text = 10;
root.Game.increaseScore(10);
} else if (root.Game.tilesArray[_local2].mC.pickup == "multi") {
root.sounds.fireMissile.start(0, 1);
gun.bChar.gotoAndStop("white");
root.Game.tilesArray[_local2].doDeath();
root.Game.pickupType = "multi";
pickupDelay = 200;
var _local6 = root.Game.inGameScoreMc.attachMovie("points", "points" + root.Game.starAnims, root.Game.starAnims + 1000);
_local6._x = root.Game.tilesArray[_local2].mC._x + 35;
_local6._y = root.Game.tilesArray[_local2].mC._y + 14;
root.Game.tilesArray[_local2] = 0;
root.Game.starAnims++;
_local6.txt.pointsTxt.text = 10;
root.Game.increaseScore(10);
} else if (root.Game.pickupType == "multi") {
root.sounds.popFX.start(0, 1);
root.Game.tilesArray[_local2].doDeath();
var _local6 = root.Game.inGameScoreMc.attachMovie("points", "points" + root.Game.starAnims, root.Game.starAnims + 1000);
_local6._x = root.Game.tilesArray[_local2].mC._x + 35;
_local6._y = root.Game.tilesArray[_local2].mC._y + 14;
root.Game.tilesArray[_local2] = 0;
root.Game.starAnims++;
_local6.txt.pointsTxt.text = 10;
root.Game.increaseScore(10);
} else if (root.Game.tilesArray[_local2].mC._currentframe == 7) {
if ((int(root.Game.tilesArray[_local2].mC.tile.tile._currentframe / 20) + 1) == (root.Player.currentColour + 1)) {
root.sounds.popFX.start(0, 1);
root.Game.tilesArray[_local2].doDeath();
var _local6 = root.Game.inGameScoreMc.attachMovie("points", "points" + root.Game.starAnims, root.Game.starAnims + 1000);
_local6._x = root.Game.tilesArray[_local2].mC._x + 35;
_local6._y = root.Game.tilesArray[_local2].mC._y + 14;
root.Game.tilesArray[_local2] = 0;
root.Game.starAnims++;
_local6.txt.pointsTxt.text = 10;
root.Game.increaseScore(10);
}
} else if (root.Game.tilesArray[_local2].mC._currentframe == (currentColour + 1)) {
if (myCurrentScore == 0) {
myCurrentScore = 1;
} else {
myCurrentScore = myCurrentScore * 2;
}
root.sounds.popFX.start(0, 1);
root.Game.tilesArray[_local2].doDeath();
var _local6 = root.Game.inGameScoreMc.attachMovie("points", "points" + root.Game.starAnims, root.Game.starAnims + 1000);
_local6._x = root.Game.tilesArray[_local2].mC._x + 35;
_local6._y = root.Game.tilesArray[_local2].mC._y + 14;
root.Game.tilesArray[_local2] = 0;
root.Game.starAnims++;
var _local7 = myCurrentScore * 10;
if (_local7 > 10240) {
_local7 = 10240;
}
_local6.txt.pointsTxt.text = _local7;
root.Game.score2 = myCurrentScore * 10;
root.Game.setScore2();
} else if ((_local3.hitEdge == "bottom") or (_local3.hitEdge == "top")) {
var _local7 = myCurrentScore * 10;
if (_local7 > 10240) {
_local7 = 10240;
}
root.Game.increaseScore(_local7);
myCurrentScore = 0;
root.Game.score2 = 0;
root.Game.setScore2();
}
if (_local3.hitEdge == "top") {
if (_local4 < 0) {
if (gravitySpeed == 6) {
yVel = -30;
} else {
yVel = -20;
}
} else if (gravitySpeed == 6) {
yVel = -30;
} else {
yVel = -20;
}
xVel = 0;
} else if (_local3.hitEdge == "bottom") {
if (_local4 < 0) {
yVel = (_local4 - _local4) - _local4;
} else {
yVel = -_local4;
}
xVel = 0;
} else if (_local3.hitEdge == "left") {
yVel = _local4;
} else if (_local3.hitEdge == "right") {
yVel = _local4;
}
yVel = yVel * 0.977;
}
}
_local5++;
}
_local8++;
}
if ((yOrigin + yPos) < 0) {
yVel = 10;
} else if ((yOrigin + yPos) > (root.Game.movieHeight - 32)) {
yVel = -20;
} else if ((xOrigin + xPos) < 10) {
xVel = 10;
} else if ((xOrigin + xPos) > (root.Game.movieWidth - 160)) {
xVel = -10;
}
updatePosition();
}
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 multidirectional = 0;
var dx = 0;
var dy = 0;
var angle = 0;
}
Symbol 372 MovieClip [__Packages.CollisionDetection] Frame 0
class CollisionDetection
{
var rect_1a, rect_1b, rect_1c, rect_2a, rect_2b, rect_2c, intersectingArea, Overlap, side, hoz, left, right, yd, clipBounds, clipBounds2;
function CollisionDetection () {
rect_1a = new flash.geom.Rectangle();
rect_1b = new flash.geom.Rectangle();
rect_1c = new flash.geom.Rectangle();
rect_2a = new flash.geom.Rectangle();
rect_2b = new flash.geom.Rectangle();
rect_2c = new flash.geom.Rectangle();
intersectingArea = new flash.geom.Rectangle();
Overlap = 0;
xOverlap = 0;
yOverlap = 0;
xOverlap2 = 0;
yOverlap2 = 0;
side = 0;
hoz = 0;
left = 0;
right = 0;
yd = 0;
}
function CheckMoving(sprite1, sprite2, vx, vy, origin) {
var _local2 = new Object();
_local2.vx = vx;
_local2.vy = vy;
CheckBounds(origin, sprite1, sprite2, vx, vy, 0, 0);
xOverlap2 = xOverlap;
yOverlap2 = yOverlap;
if (Overlap == 2) {
AdjustSprite(_local2);
_local2.hit = true;
return(_local2);
}
_local2.hit = false;
return(_local2);
}
function AdjustSprite(sprite1) {
if (intersectingArea.width > intersectingArea.height) {
if (rect_1a.y > rect_2a.y) {
sprite1.vy = int(sprite1.vy + intersectingArea.height) + 1;
sprite1.hitEdge = "bottom";
} else {
sprite1.vy = int(sprite1.vy - intersectingArea.height) - 1;
sprite1.hitEdge = "top";
}
} else if (intersectingArea.width < intersectingArea.height) {
if (rect_1a.x > rect_2a.x) {
sprite1.vx = int(sprite1.vx + intersectingArea.width) - 1;
sprite1.hitEdge = "right";
} else {
sprite1.vx = int(sprite1.vx - intersectingArea.width) - 1;
sprite1.hitEdge = "left";
}
} else {
sprite1.vx = int(sprite1.vx - intersectingArea.width) + 1;
sprite1.vy = int(sprite1.vy - intersectingArea.height) + 1;
sprite1.hitEdge = "corner";
}
}
function CheckBounds(origin, obj, obj2, xVel, yVel, xVel2, yVel2) {
Overlap = 0;
clipBounds = obj.getBounds(origin);
rect_1a.x = clipBounds.xMin;
rect_1a.y = clipBounds.yMin;
rect_1a.width = clipBounds.xMax - clipBounds.xMin;
rect_1a.height = clipBounds.yMax - clipBounds.yMin;
rect_1b.x = clipBounds.xMin;
rect_1b.y = clipBounds.yMin;
rect_1b.width = clipBounds.xMax - clipBounds.xMin;
rect_1b.height = clipBounds.yMax - clipBounds.yMin;
rect_1b.offset(xVel, yVel);
rect_1c = rect_1a.union(rect_1b);
clipBounds2 = obj2.getBounds(origin);
rect_2a.x = clipBounds2.xMin;
rect_2a.y = clipBounds2.yMin;
rect_2a.width = clipBounds2.xMax - clipBounds2.xMin;
rect_2a.height = clipBounds2.yMax - clipBounds2.yMin;
rect_2b.x = clipBounds2.xMin;
rect_2b.y = clipBounds2.yMin;
rect_2b.width = clipBounds2.xMax - clipBounds2.xMin;
rect_2b.height = clipBounds2.yMax - clipBounds2.yMin;
rect_2b.offset(xVel2, yVel2);
rect_2c = rect_2a.union(rect_2b);
intersectingArea = rect_1c.intersection(rect_2c);
if ((intersectingArea.width != 0) or (intersectingArea.height != 0)) {
Overlap = 2;
}
}
var xOverlap = 0;
var yOverlap = 0;
var xOverlap2 = 0;
var yOverlap2 = 0;
}
Symbol 373 MovieClip [__Packages.GoodGuy] Frame 0
class GoodGuy
{
var root, mC, range, arrayIndex, hits, gravity, delayToFire, gotGold, energyBarOn, xDir, target, homing, ringDrop, movingCloser, spriteType, goldMc, energyMc;
function GoodGuy (clip, rt, xStart, yStart, sp, st, grav, rg) {
root = rt;
mC = clip;
range = rg;
arrayIndex = 0;
hits = 0;
gravity = grav;
xOrigin = xStart;
yOrigin = yStart;
xOrigin = xOrigin - (root.Background.xOrigin + root.Background.xPos);
yOrigin = yOrigin - (root.Background.yOrigin + root.Background.yPos);
xPos = 0;
yPos = 0;
xVel = 0;
yVel = 0;
delayToFire = 30;
angle = 0.2;
gotGold = 0;
energyBarOn = 0;
degrees = 0;
radius = 255;
centerX = root.movieWidth / 2;
centerY = root.movieHeight / 2;
speed = sp;
xDir = 1;
target = undefined;
numberOfMissiles = 0;
energyStart = 100;
energy = energyStart;
homing = 0;
ringDrop = 20;
movingCloser = 0;
delayToFire = 50;
spriteType = st;
updatePosition();
}
function applyGravity() {
yVel = yVel + 1;
}
function main(index1, index2) {
if (spriteType == "man") {
fireMissile();
moveEnemy();
checkForTurret();
} else if (spriteType == "turret") {
applyGravity();
groundCollision();
fireMissile();
}
updatePosition();
}
function fireMissile() {
if (target == undefined) {
target = root.Game.findTarget();
}
var _local7 = mC._x - target.mC._x;
var _local4 = (mC._y - 60) - target.mC._y;
var _local5 = Math.atan2(_local4, _local7);
mC.gun._rotation = (_local5 * 180) / Math.PI;
delayToFire--;
if (delayToFire == 0) {
delayToFire = 100;
var _local2 = "bullet";
var _local3 = root.Game.inGameMissilesMc.attachMovie(_local2, "missile" + numberOfMissiles, numberOfMissiles);
var _local6 = (angle * 180) / Math.PI;
_local3._rotation = _local6 + 180;
numberOfMissiles++;
var _local8 = 40;
root.Game.missilesArray.push(new Missile2(_local3, mC._x, mC._y, root, _local2));
}
}
function checkForTurret() {
if (gotGold == 0) {
if (mC.m.hitTest(root.playerMc)) {
gotGold = 1;
goldMc = mC.attachMovie("bagOfGold", "g", 1);
goldMc._y = -10;
changeDirection();
}
}
}
function groundCollision() {
var _local6 = yVel;
var _local3 = yVel;
if (_local3 < 0) {
_local3 = (_local3 - _local3) - _local3;
}
var _local4 = mC._x + root.Background.mC._x;
var _local5 = mC._y + root.Background.mC._y;
var _local2 = 0;
while (_local2 < int(_local3)) {
if (root.Game.inGameBackgroundMc.hitTest(_local4, _local5 + _local2, true)) {
break;
}
_local2++;
}
yVel = yVel - int(_local6);
yVel = _local2 + yVel;
}
function moveEnemy() {
var _local5 = yVel;
var _local3 = yVel;
if (_local3 < 0) {
_local3 = (_local3 - _local3) - _local3;
}
var _local6 = mC._x + root.Background.mC._x;
var _local7 = mC._y + root.Background.mC._y;
var _local2 = 0;
while (_local2 < int(_local3)) {
if (root.Game.inGameBackgroundMc.hitTest(_local6, _local7 + _local2, true)) {
break;
}
_local2++;
}
yVel = yVel - int(_local5);
yVel = _local2 + yVel;
xVel = xDir * speed;
updatePosition();
_local6 = mC._x + root.Background.mC._x;
_local7 = mC._y + root.Background.mC._y;
if (root.Game.inGameBackgroundMc.hitTest(_local6, _local7 + _local2, true)) {
var _local4 = 0;
_local2 = 0;
while (_local2 < 10) {
yPos--;
mC._x = xOrigin + xPos;
mC._y = yOrigin + yPos;
if (root.Game.inGameBackgroundMc.hitTest(mC._x + root.scrollIndexX, mC._y, true) == false) {
_local4 = 1;
break;
}
_local2++;
}
if (_local4 == 0) {
changeDirection();
}
}
if (xPos > 1000) {
xDir = -1;
} else if (xPos < -180) {
xDir = 1;
if (gotGold == 1) {
root.Game.grabMoney(this);
}
}
if (xVel > 0) {
mC._xscale = -100;
} else {
mC._xscale = 100;
}
}
function changeDirection() {
if (xDir < 0) {
xDir = 1;
} else {
xDir = -1;
}
}
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;
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;
}
remove();
}
}
function remove(i, i3) {
i = 0;
while (i < root.enemyArray.length) {
if (this == root.enemyArray[i]) {
arrayIndex = i;
}
i++;
}
mC.removeMovieClip();
root.enemyArray.splice(i, 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 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 374 MovieClip [__Packages.Missile2] Frame 0
class Missile2
{
var root, myParent, mC, mType, bonusCount, arrayIndex;
function Missile2 (clip, xStart, yStart, rt, type, xv, yv, pp, bonusC) {
root = rt;
xOrigin = xStart;
yOrigin = yStart;
myParent = pp;
xPos = 0;
yPos = 0;
xVel = xv;
yVel = yv;
mC = clip;
mType = type;
bonusCount = bonusC;
updatePosition();
}
function missileControl(ii) {
checkForOffStage(ii);
updatePosition();
collisionDetection();
}
function mCDeath() {
var _local3 = root.Game.inGameExplosionsMc.attachMovie("explosion", "explosion" + root.Game.scoreIndex, root.Game.scoreIndex);
_local3._x = mC._x;
_local3._y = mC._y;
root.Game.scoreIndex++;
var _local4 = "bonusMc" + root.Game.bonusCountArray[bonusCount];
if (root.Game.bonusCountArray[bonusCount] == 4) {
root.sounds.extraPoints.start(0, 1);
}
root.Game.bonusCountArray[bonusCount]++;
var _local2 = root.Game.inGameScoreMc.attachMovie(_local4, "bonus" + root.Game.scoreIndex, root.Game.scoreIndex);
_local2._x = mC._x;
_local2._y = mC._y;
root.Game.scoreIndex++;
remove();
return(undefined);
}
function plotSticky(xx, yy) {
var _local2 = root.inGameBackMc.attachMovie("StickyProjectile", "sticky" + root.stickies, root.stickies);
var _local3 = (root.inGameBackMc._x - root.inGameBackMc._x) - root.inGameBackMc._x;
_local2._x = mC._x + _local3;
_local2._y = yy - root.inGameBackMc._y;
root.stickies++;
root.stickysArray.push(new Sticky(root, mC._x, mC._y, _local2));
}
function collisionDetection() {
var _local3 = 0;
while (_local3 < root.Game.badGuysArray.length) {
var _local2 = root.Game.badGuysArray[_local3];
if (myParent != _local2) {
if (_local2.collision.hitTest(mC)) {
if (_local2.used == false) {
root.Game.fireMissiles(_local2);
mCDeath();
} else {
root.Game.sizeTarget--;
root.Game.setTarget();
root.sounds.Explosion.start(0, 1);
_local2.gotoAndPlay("hit");
root.Game.badGuysArray.splice(_local3, 1);
root.Game.increaseScore(10 * root.Game.bonusCountArray[bonusCount]);
mCDeath();
}
}
}
_local3++;
}
_local3 = 0;
while (_local3 < root.Game.enemyArray.length) {
var _local4 = root.Game.enemyArray[_local3].mC;
var _local5 = _local4.collision;
if (_local5.hitTest(mC)) {
root.saucerObject.stop();
root.sounds.GotSaucer.start(0, 1);
root.Game.doSaucerEffect(_local4);
}
_local3++;
}
}
function remove() {
var _local2 = 0;
while (_local2 < root.Game.missilesArray.length) {
if (this == root.Game.missilesArray[_local2]) {
arrayIndex = _local2;
}
_local2++;
}
mC.removeMovieClip();
root.Game.missilesArray.splice(arrayIndex, 1);
}
function checkForOffStage(ii) {
if (mC._x < 0) {
remove();
}
if (mC._y < 0) {
remove();
}
if (mC._x > root.Game.movieWidth) {
remove();
}
if (mC._y > root.Game.movieHeight) {
remove();
}
}
function applyGravity() {
yVel = yVel + 1;
}
function updatePosition() {
xPos = xPos + xVel;
yPos = yPos + yVel;
var _local3 = mC._x;
var _local2 = mC._y;
mC._x = xOrigin + xPos;
mC._y = yOrigin + yPos;
var _local6 = mC._x - _local3;
var _local4 = mC._y - _local2;
var _local5 = Math.atan2(_local4, _local6);
mC._rotation = (_local5 * 180) / Math.PI;
}
var xOrigin = 0;
var yOrigin = 0;
var xPos = 0;
var yPos = 0;
var xVel = 0;
var yVel = 0;
}
Symbol 375 MovieClip [__Packages.Sticky] Frame 0
class Sticky
{
var root, mC, arrayIndex;
function Sticky (rt, xStart, yStart, clip) {
root = rt;
xOrigin = xStart;
yOrigin = yStart;
xPos = 0;
yPos = 0;
xVel = 0;
yVel = 0;
mC = clip;
mC.myObject = this;
}
function main() {
applyGravity();
collisionDetection();
updatePosition();
}
function mCDeath() {
remove();
return(undefined);
}
function collisionDetection() {
if (yVel > 0) {
var _local10 = yVel;
var _local5 = yVel;
if (_local5 < 0) {
_local5 = (_local5 - _local5) - _local5;
}
var _local7 = false;
var _local6 = 0;
var _local9 = (root.inGameBackMc._x - root.inGameBackMc._x) - root.inGameBackMc._x;
var _local11 = xOrigin + _local9;
var _local8 = new Object();
_local8.x1 = mC._x;
_local8.y1 = mC._y;
root.inGameBackMc.localToGlobal(_local8.x1, _local8.y1);
var _local2 = 0;
while (_local2 < int(_local5)) {
var _local3 = mC._x + root.inGameBackMc._x;
_local3 = _local3 + root.scrollIndexX;
var _local4 = (mC._y = mC._y + root.inGameBackMc._y);
_local4 = _local4 + 10;
if (root.inGameBackMc.hitTest(_local3, _local4 + _local2, true)) {
_local7 = true;
_local6 = _local2;
_local2 = int(_local5);
}
_local2++;
}
if (_local7 == true) {
yVel = yVel - int(_local10);
yVel = _local6 + yVel;
}
}
}
function remove() {
var _local2 = 0;
while (_local2 < root.stickysArray.length) {
if (this == root.stickysArray[_local2]) {
arrayIndex = _local2;
}
_local2++;
}
mC.removeMovieClip();
root.stickysArray.splice(arrayIndex, 1);
}
function applyGravity() {
yVel = yVel + 16;
}
function updatePosition() {
xPos = xPos + xVel;
yPos = yPos + yVel;
var _local6 = mC._x;
var _local5 = mC._y;
var _local2 = (root.inGameBackMc._x - root.inGameBackMc._x) - root.inGameBackMc._x;
var _local4 = xOrigin + _local2;
var _local3 = yOrigin - root.inGameBackMc._y;
mC._x = _local4 + xPos;
mC._y = _local3 + yPos;
}
var xOrigin = 0;
var yOrigin = 0;
var xPos = 0;
var yPos = 0;
var xVel = 0;
var yVel = 0;
}
Symbol 376 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 377 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 = 360;
_local2._y = 240;
setupPresentationElements();
}
function setupPresentationElements() {
optionsMc = splashScreenMc.createEmptyMovieClip("options", 1);
var _local3 = 0;
while (_local3 < rt.splashScreenElements.length) {
var _local2 = rt.splashScreenElements[_local3];
if (_local2.mCName != "title") {
elementMc = optionsMc.attachMovie(_local2.mCName, _local2.mCName, _local3);
elementMc._x = _local2.xPos;
elementMc._y = _local2.yPos;
} else {
elementMc = splashScreenMc.attachMovie(_local2.mCName, _local2.mCName, _local3);
elementMc._x = _local2.xPos;
elementMc._y = _local2.yPos;
}
if (_local2.mCName != "title") {
elementMc.btn.btnType = _local2.mCName;
elementMc.btn.splashScreenMc = splashScreenMc;
elementMc.btn.myObject = this;
elementMc.btn.onRelease = clickRightSplashSceenBtn;
elementMc.btn.onRollOver = rollOverSplashSceenBtn;
elementMc.btn.onRollOut = rollOutSplashSceenBtn;
}
_local3++;
}
}
function clickRightSplashSceenBtn() {
if (btnType == "playBtnAnim") {
myObject.rt.Game.gameState = "setup";
} else if (btnType == "instructionsBtnAnim") {
splashScreenMc.screens.gotoAndStop("showinstructions");
splashScreenMc.options.removeMovieClip();
} else if (btnType == "controlsBtnAnim") {
splashScreenMc.screens.gotoAndStop("showcontrols");
splashScreenMc.options.removeMovieClip();
} else if (btnType == "highscoresBtnAnim") {
myObject.rt.MindJoltSponsoredAPI.openLink(3);
} else if (btnType == "moreGamesBtn") {
myObject.rt.MindJoltSponsoredAPI.openLink(2);
}
}
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 378 MovieClip [__Packages.GameGame] Frame 0
class GameGame
{
var mC, rt, numBalls, movieWidth, movieHeight, blockSize, blockSizeY, 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, score2, 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, mouseButton, moveUpSpeed, gameCounter, tileLevelHeight, tilesArray, starAnims, levelCountdown, pauseSwitch, currentPickup, pickupType, pickupAdded, statsMc, powerMeter, msgMc, tilesNumber, oldMouseX, oldMouseY, pauseMc;
function GameGame (mc, rt2, sw, sh, levelW, levelH, startLives) {
mC = mc;
rt = rt2;
numBalls = 15;
movieWidth = sw;
movieHeight = sh;
blockSize = 70;
blockSizeY = 28;
levelWidthBlocks = levelW;
levelHeightBlocks = levelH;
levelWidth = levelWidthBlocks * blockSize;
levelHeight = levelHeightBlocks * blockSizeY;
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;
score2 = 0;
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;
mouseButton = false;
moveUpSpeed = 180;
gameCounter = moveUpSpeed;
tileLevelHeight = 0;
tilesArray = new Array();
starAnims = 0;
levelCountdown = 1000;
pauseSwitch = false;
currentPickup = "";
pickupType = "";
pickupAdded = false;
setupPanel();
}
function changeStatsColour() {
statsMc.t1.gotoAndStop(1);
statsMc.t2.gotoAndStop(1);
statsMc.t3.gotoAndStop(1);
statsMc.t4.gotoAndStop(1);
statsMc.t5.gotoAndStop(1);
var _local4 = statsMc["t" + String(rt.Player.currentColour + 1)];
_local4.gotoAndStop(2);
var _local3 = rt.Player.currentColour;
if (_local3 < 1) {
_local3 = 5;
}
var _local2 = rt.Player.currentColour + 2;
if (_local2 > 5) {
_local2 = 1;
}
rt.Player.previewMc.prevColour1.gotoAndStop(_local3);
rt.Player.previewMc.nextColour1.gotoAndStop(_local2);
_local3 = rt.Player.currentColour - 1;
if (_local3 < 1) {
_local3 = _local3 + 5;
}
_local2 = rt.Player.currentColour + 3;
if (_local2 > 5) {
_local2 = _local2 - 5;
}
rt.Player.previewMc.prevColour2.gotoAndStop(_local3);
rt.Player.previewMc.nextColour2.gotoAndStop(_local2);
}
function setupPanel() {
statsMc = inGameStatsMc.attachMovie("weapons", "ingamestatsmc", 1);
statsMc._x = movieWidth - (blockSize * 2);
var _local2 = statsMc.wg;
_local2 = _local2.stats;
_local2.musicBtn.myObject = this;
_local2.musicBtn.myMc = _local2;
_local2.quitBtn.myObject = this;
if (rt.musicPlaying == "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 () {
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 deleteMeter() {
powerMeter.removeMovieClip();
}
function displayMeter() {
rt.mousePointer.attachMovie("shotStrengthMeter", "meter", 2);
}
function setupMeter() {
powerMeter = playerMc.attachMovie("shotStrengthMeter", "meter", 2);
}
function gameOver(gameOverType) {
increaseScore(score2);
score2 = 0;
rt.saucerObject.stop();
extraPointsSound = false;
rt.obj.vx = 0;
rt.obj.vy = 0;
rt.obj.clip._rotation = 0;
if (gameOverType == "out_of_time") {
gameState = "game_over";
msgMc = inGameMsgsMc.attachMovie("gameOverMsgAnim", "gameover", 1);
msgMc._x = movieWidth / 2;
msgMc._y = movieHeight / 2;
rt.sounds.doh.start(0, 1);
} else if (gameOverType == "game_complete") {
rt.sounds.cheer.start(0, 1);
gameState = "game_over";
msgMc = inGameMsgsMc.attachMovie("gameCompleteMsg", "gameComplete", 1);
msgMc._x = movieWidth / 2;
msgMc._y = movieHeight / 2;
} else {
rt.sounds.cheer.start(0, 1);
gameState = "game_over";
msgMc = inGameMsgsMc.attachMovie("gameOverMsgAnim", "gameComplete", 1);
msgMc._x = movieWidth / 2;
msgMc._y = movieHeight / 2;
}
}
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) {
var _local2 = "bullet";
var _local3 = inGameMissilesMc.attachMovie(_local2, "missile" + numberOfMissiles, numberOfMissiles);
numberOfMissiles++;
missilesArray.push(new Missile2(_local3, xStart, yStart, rt, _local2, vx, vy, myParent, bonusCountArray.length - 1));
missilesArray[missilesArray.length - 1].updatePosition();
}
function setupGerms() {
changeStatsColour();
pickupType = "";
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);
moveUpSpeed = 180;
score2 = 0;
gameCounter = moveUpSpeed;
tileLevelHeight = 0;
levelCountdown = 1000;
tilesNumber = 0;
pickupAdded = false;
removeGerms();
tilesArray.splice(0);
badGuysArray.splice(0);
tileLevelHeight = 19;
newTiles();
}
function moveArrayContentsUp() {
var _local6 = new Array();
var _local3 = tileLevelHeight;
while (_local3 < levelHeightBlocks) {
var _local2 = 0;
while (_local2 < levelWidthBlocks) {
var _local5 = (levelWidthBlocks * _local3) + _local2;
var _local4 = (levelWidthBlocks * (_local3 - 1)) + _local2;
tilesArray[_local4] = tilesArray[_local5];
_local2++;
}
_local3++;
}
tileLevelHeight--;
}
function newTiles() {
var _local7 = levelHeightBlocks - 1;
var _local3 = 0;
while (_local3 < levelWidthBlocks) {
var _local2 = inGameEnemyMc.attachMovie("tiles", "tile" + tilesNumber, tilesNumber + 1000);
_local2._x = _local3 * _local2._width;
_local2._y = _local2._height * _local7;
var _local6 = (levelWidthBlocks * _local7) + _local3;
_local2.used = false;
var _local4 = rt.Useful1.RandomNumber(1, 1000);
_local4 = _local4 + (levelNumber * 2);
if (pickupAdded == false) {
if (_local4 > 960) {
_local2.gotoAndStop(6);
pickupAdded = true;
var _local5 = rt.Useful1.RandomNumber(1, 2);
if (_local5 == 1) {
_local2.tile.tile.pickup.text = "speed";
_local2.pickup = "speed";
} else {
_local2.tile.tile.pickup.text = "multi";
_local2.pickup = "multi";
}
} else {
_local4 = rt.Useful1.RandomNumber(1, 1000);
_local4 = _local4 + (levelNumber * 4);
if (_local4 > 900) {
_local2.gotoAndStop(7);
_local2.multi = "true";
} else if (_local4 > 870) {
_local2.ice.gotoAndStop(2);
_local2.energy2 = 100;
_local2.energy = 1;
} else {
_local2.gotoAndStop(rt.Useful1.RandomNumber(1, 5));
}
}
} else {
_local4 = rt.Useful1.RandomNumber(1, 1000);
_local4 = _local4 + (levelNumber * 4);
if (_local4 > 900) {
_local2.gotoAndStop(7);
_local2.multi = "true";
} else if (_local4 > 970) {
_local2.ice.gotoAndStop(2);
_local2.energy2 = 100;
_local2.energy = 1;
} else {
_local2.gotoAndStop(rt.Useful1.RandomNumber(1, 5));
}
}
badGuysArray.push(new Enemy1(_local2, rt, _local2._x, _local2._y));
tilesArray[_local6] = badGuysArray[badGuysArray.length - 1];
tilesNumber++;
_local3++;
}
}
function runGerms() {
gameCounter--;
if (gameCounter == 0) {
gameCounter = moveUpSpeed;
var _local2 = 0;
while (_local2 < badGuysArray.length) {
badGuysArray[_local2].moveEnemy();
_local2++;
}
moveArrayContentsUp();
newTiles();
}
}
function checkForGameOver() {
var _local2 = 0;
while (_local2 < levelWidthBlocks) {
if ((tilesArray[_local2] != undefined) and (tilesArray[_local2] != 0)) {
gameOver("out_of_time");
}
_local2++;
}
}
function fireMissiles(ball) {
ball.used = true;
ball.play();
bonusCountArray.push(1);
fireGun(ball._x, ball._y, 10, 0, ball);
fireGun(ball._x, ball._y, -10, 0, ball);
fireGun(ball._x, ball._y, 0, 10, ball);
fireGun(ball._x, ball._y, 0, -10, ball);
if (ball._xscale != 40) {
ball._xscale = ball._xscale - 40;
ball._yscale = ball._xscale;
}
rt.mouseButton = false;
rt.sounds.fire.start(0, 1);
}
function checkForNewLevel() {
levelCountdown--;
if (levelCountdown == 0) {
levelCountdown = 1000;
moveUpSpeed = moveUpSpeed - 3;
levelNumber++;
if (levelNumber > 50) {
gameOver("game_complete");
} else {
setLevel();
}
}
}
function cleanUp() {
var _local8 = int(rt.Player.mC._x / 70);
var _local9 = int(rt.Player.mC._y / 28);
var _local3 = _local9 - 3;
while (_local3 < (_local9 + 5)) {
var _local2 = _local8 - 3;
while (_local2 < (_local8 + 5)) {
if ((_local2 >= 0) and (_local2 < 8)) {
if ((_local3 >= 0) and (_local3 < 20)) {
if ((tilesArray[(_local3 * levelWidthBlocks) + _local2] != undefined) and (tilesArray[(_local3 * levelWidthBlocks) + _local2] != 0)) {
var _local5 = -1;
if (tilesArray[(_local3 * levelWidthBlocks) + _local2].death == true) {
if (tilesArray[(_local3 * levelWidthBlocks) + _local2].deathDone == false) {
if ((tilesArray[(_local3 * levelWidthBlocks) + _local2]._mC._x < 0) or (tilesArray[(_local3 * levelWidthBlocks) + _local2]._mC._x > 700)) {
tilesArray[(_local3 * levelWidthBlocks) + _local2].remove();
tilesArray[(_local3 * levelWidthBlocks) + _local2] = 0;
_local5 = 1;
}
}
}
if (_local5 == -1) {
var _local4 = 0;
while (_local4 < badGuysArray.length) {
var _local7 = _local3 * 28;
var _local6 = _local2 * 70;
if (_local6 == badGuysArray[_local4].mC._x) {
if (_local7 == badGuysArray[_local4].mC._y) {
if (badGuysArray[_local4].deathDone == false) {
_local5 = _local4;
}
}
}
_local4++;
}
if (_local5 == -1) {
tilesArray[(_local3 * levelWidthBlocks) + _local2] = 0;
}
}
}
}
}
_local2++;
}
_local3++;
}
}
function mainLoop() {
checkForGameOver();
checkForNewLevel();
if (gameState == "play") {
runGerms();
}
var _local2 = 0;
while (_local2 < missilesArray.length) {
missilesArray[_local2].missileControl(_local2);
_local2++;
}
_local2 = 0;
while (_local2 < badGuysArray.length) {
badGuysArray[_local2].main();
_local2++;
}
rt.Player.mainLoop();
setScore();
mouseButton = rt.mouseButton;
oldMouseX = rt._xmouse;
oldMouseY = rt._ymouse;
cleanUp();
}
function pauseOn() {
pauseSwitch = true;
gameState = "pause";
pauseMc = inGameMc.attachMovie("pauseMc", "pauseMc", 3);
}
function pauseOff() {
pauseSwitch = false;
gameState = "play";
pauseMc.removeMovieClip();
}
function doSaucerEffect(saucer) {
if (saucer._currentframe == 1) {
var _local7 = 0;
var _local3 = 0;
while (_local3 < badGuysArray.length) {
var _local2 = badGuysArray[_local3];
if (_local2.used == true) {
_local2.used = false;
_local2.gotoAndStop(1);
}
_local3++;
}
if (_local7 == badGuysArray.length) {
gameOver("out_of_time");
}
} else if (saucer._currentframe == 2) {
var _local6 = "bonusMc1000";
var _local5 = rt.Game.inGameScoreMc.attachMovie(_local6, "bonus" + rt.Game.scoreIndex, rt.Game.scoreIndex);
_local5._x = saucer._x;
_local5._y = saucer._y;
increaseScore(1000);
rt.Game.scoreIndex++;
} else if (saucer._currentframe == 3) {
clockDelay = 100;
}
enemyArray[0].remove();
}
function doSaucer() {
if (enemyArray.length == 0) {
if (saucerDelay >= 0) {
saucerDelay--;
if (saucerDelay == 0) {
rt.saucerObject.start(0, 100);
var _local4 = "flySaucer";
var _local2 = inGameMissilesMc.attachMovie(_local4, "missile" + numberOfMissiles, numberOfMissiles);
_local2.gotoAndStop(rt.Useful1.RandomNumber(1, 3));
numberOfMissiles++;
var _local3 = 2;
_local3 = _local3 + int(levelNumber / 3);
enemyArray.push(new FlySaucer(_local2, rt, -200, movieHeight / 2, _local3, rt.Useful1.RandomNumber(1, 180)));
}
}
}
}
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 (cannonManFlying == 1) {
starAnimDelay--;
if (starAnimDelay == 0) {
starAnimDelay = 4;
msgMc = inGameExplosionsMc.attachMovie("starAnim", "stars" + starTrails, starTrails);
msgMc._x = rt.obj.x;
msgMc._x = msgMc._x - rt.Background.xOrigin;
msgMc._x = msgMc._x - rt.Background.xPos;
msgMc._y = rt.obj.y;
msgMc._y = msgMc._y - rt.Background.yOrigin;
msgMc._y = msgMc._y - rt.Background.yPos;
starTrails++;
}
}
}
function decreaseScore() {
}
function increaseScore(increase) {
score = int(score + increase);
if (score > 0) {
if (score > 999999) {
score = 999999 /* 0x0F423F */;
}
setScore();
}
}
function increaseScore2(increase) {
score2 = int(score2 + increase);
if (score2 > 0) {
if (score2 > 10240) {
score2 = 10240;
}
setScore2();
}
}
function setLives() {
var _local2 = inGameStatsMc.ingamestatsmc;
_local2 = _local2.wg;
_local2 = _local2.stats;
_local2.lives.text = lives;
}
function setTarget() {
var _local2 = inGameStatsMc.ingamestatsmc;
_local2 = _local2.wg;
_local2 = _local2.stats;
_local2.sizeTarget.text = sizeTarget;
}
function setLevel() {
var _local2 = inGameStatsMc.ingamestatsmc;
_local2 = _local2.wg;
_local2 = _local2.stats;
_local2.level.text = levelNumber;
}
function setScore() {
var _local2 = inGameStatsMc.ingamestatsmc;
_local2 = _local2.wg;
_local2 = _local2.stats;
if (score > 999999) {
score = 999999 /* 0x0F423F */;
}
if (score < 10) {
_local2.score.text = "00000" + score;
} else if (score < 100) {
_local2.score.text = "0000" + score;
} else if (score < 1000) {
_local2.score.text = "000" + score;
} else if (score < 10000) {
_local2.score.text = "00" + score;
} else if (score < 100000) {
_local2.score.text = "0" + score;
} else {
_local2.score.text = score;
}
}
function setScore2() {
var _local2 = inGameStatsMc.ingamestatsmc;
_local2 = _local2.wg;
_local2 = _local2.stats;
if (score2 > 10240) {
score2 = 10240;
}
if (score2 < 10) {
_local2.score2.text = "00000" + score2;
} else if (score2 < 100) {
_local2.score2.text = "0000" + score2;
} else if (score2 < 1000) {
_local2.score2.text = "000" + score2;
} else if (score2 < 10000) {
_local2.score2.text = "00" + score2;
} else if (score2 < 100000) {
_local2.score2.text = "0" + score2;
} else {
_local2.score2.text = score2;
}
}
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;
_local2 = _local2.stats;
_local2.time.text = ((minDisplay + ":") + secDisplay) + "s";
}
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);
}
var myColour = 7;
}
Symbol 379 MovieClip [__Packages.Enemy1] Frame 0
class Enemy1
{
var root, currentRing, arrayIndex, hits, ringRadius, delayToFire, gotGold, energyBarOn, xDir, mC, homing, ringDrop, movingCloser, falling, death, deathDone, multiple, deathDelay, energyMc;
function Enemy1 (clip, rt, xStart, yStart) {
root = rt;
currentRing = 1;
arrayIndex = 0;
hits = 0;
ringRadius = 255;
xOrigin = xStart;
yOrigin = yStart;
xPos = 0;
yPos = 0;
xVel = 0;
yVel = 0;
delayToFire = 100;
angle = 0.2;
gotGold = 0;
energyBarOn = 0;
degrees = 0;
radius = 255;
centerX = root.movieWidth / 2;
centerY = root.movieHeight / 2;
xDir = 1;
mC = clip;
mC.deathDone = false;
numberOfMissiles = 0;
energyStart = 100;
energy = energyStart;
homing = 0;
ringDrop = 20;
movingCloser = 0;
delayToFire = 50;
falling = false;
death = false;
deathDone = false;
multiple = 0;
deathDelay = 40;
}
function applyGravity() {
yVel = yVel + 1;
}
function main() {
if (death == false) {
checkTileBelow();
} else {
if (mC.deathDone == true) {
remove();
}
deathDelay--;
if (deathDelay == 0) {
remove();
}
}
}
function fireMissile() {
delayToFire--;
if (delayToFire == 0) {
delayToFire = 100;
var _local3 = "StickyProjectile";
var _local4 = root.inGameMissilesMc.attachMovie(_local3, "missile" + root.Game.numberOfMissiles, root.Game.numberOfMissiles);
var _local5 = (root.Player.angle * 180) / Math.PI;
_local4._rotation = _local5 + 180;
root.Game.numberOfMissiles++;
var _local2 = root.Useful.getArcVelocity(1, 10, mC._x, mC._y, root.playerMc._x, root.playerMc._y);
root.missilesArray.push(new Missile2(_local4, root.playerMc._x + ((-_local2.xStep) * root.missileDistFromGun), root.playerMc._y + ((-_local2.yStep) * root.missileDistFromGun), root, _local3));
root.missilesArray[root.missilesArray.length - 1].xVel = -_local2.xStep;
root.missilesArray[root.missilesArray.length - 1].yVel = -_local2.yStep;
}
}
function checkTileBelow() {
var _local9 = int(mC._x / 70);
var _local10 = int(mC._y / 28);
var _local12 = (root.Game.levelWidthBlocks * _local10) + _local9;
if (falling == false) {
if (_local10 < 19) {
_local10++;
var _local11 = (root.Game.levelWidthBlocks * _local10) + _local9;
if ((root.Game.tilesArray[_local11] == 0) or (root.Game.tilesArray[_local11] == undefined)) {
_local9 = int(mC._x / 70);
_local10 = int(mC._y / 28);
_local11 = (root.Game.levelWidthBlocks * _local10) + _local9;
root.Game.tilesArray[_local11] = 0;
falling = true;
}
}
} else {
yVel = 7;
_local9 = int(mC._x / 70);
_local10 = int((mC._y + yVel) / 28);
var _local13 = _local10 * 28;
if (_local13 == (mC._y + yVel)) {
_local12 = (root.Game.levelWidthBlocks * _local10) + _local9;
var _local2 = new Array();
var _local3 = 0;
while (_local3 < root.Game.badGuysArray.length) {
var _local6 = int(root.Game.badGuysArray[_local3].mC._x / 70);
if (_local6 == _local9) {
if (root.Game.badGuysArray[_local3].death == false) {
_local2.push(root.Game.badGuysArray[_local3]);
}
}
_local3++;
}
_local2.sortOn(mC._y, Array.NUMERIC);
var _local5 = 0;
_local3 = 0;
while (_local3 < _local2.length) {
if (_local2[_local3] == this) {
_local5 = _local3;
}
_local3++;
}
var _local8 = -1;
_local3 = _local5 - 1;
while (_local3 >= 0) {
if (_local2[_local3].mC._currentframe == mC._currentframe) {
_local8 = _local3;
} else {
_local3 = -1;
}
_local3--;
}
if (_local8 >= 0) {
var _local7 = 1;
_local3 = _local8;
while (_local3 < _local2.length) {
if (_local2[_local3].mC._currentframe == mC._currentframe) {
_local2[_local3].doDeath();
doPoints(_local2[_local3].mC._x, _local2[_local3].mC._y, 10);
root.Game.increaseScore2(10);
_local7++;
root.sounds.extraPoints.start(0, 1);
if (_local7 == 5) {
root.sounds.levelComplete.start(0, 1);
var _local4 = root.Game.inGameScoreMc.attachMovie("points50", "points" + root.Game.starAnims, root.Game.starAnims + 1000);
_local4._x = mC._x + 35;
_local4._y = mC._y + 14;
root.Game.starAnims++;
}
} else {
_local3 = _local2.length;
}
_local3++;
}
} else if (_local2[_local5 + 1].mC._currentframe != mC._currentframe) {
root.Game.tilesArray[_local12] = this;
updatePosition();
yVel = 0;
falling = false;
} else {
var _local7 = 1;
doDeath();
doPoints(_local2[_local3].mC._x, _local2[_local3].mC._y, 10);
root.Game.increaseScore2(10);
_local7++;
_local3 = _local5 + 1;
while (_local3 < _local2.length) {
if (_local2[_local3].mC._currentframe == mC._currentframe) {
_local2[_local3].doDeath();
doPoints(_local2[_local3].mC._x, _local2[_local3].mC._y, 10);
root.Game.increaseScore2(10);
_local7++;
root.sounds.extraPoints.start(0, 1);
if (_local7 == 5) {
root.sounds.levelComplete.start(0, 1);
var _local4 = root.Game.inGameScoreMc.attachMovie("points50", "points" + root.Game.starAnims, root.Game.starAnims + 1000);
_local4._x = mC._x + 35;
_local4._y = mC._y + 14;
root.Game.increaseScore2(50);
root.Game.starAnims++;
}
} else {
_local3 = _local2.length;
}
_local3++;
}
}
}
}
updatePosition();
}
function doPoints(xx, yy, sc) {
if (xx != undefined) {
var _local2 = root.Game.inGameScoreMc.attachMovie("points", "points" + root.Game.starAnims, root.Game.starAnims + 1000);
_local2._x = xx + 35;
_local2._y = yy + 14;
root.Game.starAnims++;
_local2.txt.pointsTxt.text = "X" + sc;
}
}
function moveEnemy() {
yVel = -28;
updatePosition();
yVel = 0;
}
function changeDirection() {
if (xDir < 0) {
xDir = 1;
} else {
xDir = -1;
}
}
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;
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;
}
remove();
}
}
function doDeath() {
mC.tile.play();
death = true;
}
function remove() {
var _local4 = int(mC._x / 70);
var _local5 = int(mC._y / 28);
var _local6 = (root.Game.levelWidthBlocks * _local5) + _local4;
if (deathDelay != 0) {
var _local3 = root.Game.inGameExplosionsMc.attachMovie("starAnim", "starAnim" + root.Game.starAnims, root.Game.starAnims + 1000);
_local3._x = mC._x + 35;
_local3._y = mC._y + 14;
_local3._xscale = 50;
_local3._yscale = 50;
root.Game.starAnims++;
}
var _local2 = 0;
while (_local2 < root.Game.badGuysArray.length) {
if (this == root.Game.badGuysArray[_local2]) {
arrayIndex = _local2;
}
_local2++;
}
mC.swapDepths(1);
mC.removeMovieClip();
root.Game.badGuysArray.splice(arrayIndex, 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 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 380 MovieClip [__Packages.FlySaucer] Frame 0
class FlySaucer
{
var root, currentRing, arrayIndex, hits, ringRadius, delayToFire, gotGold, energyBarOn, xDir, mC, homing, ringDrop, movingCloser;
function FlySaucer (clip, rt, xStart, yStart, sp, rotateVar) {
root = rt;
currentRing = 1;
arrayIndex = 0;
hits = 0;
ringRadius = 255;
xOrigin = xStart;
yOrigin = yStart;
xPos = 200;
yPos = 0;
xVel = 0;
yVel = 0;
delayToFire = 100;
angle = 0.2;
gotGold = 0;
energyBarOn = 0;
degrees = 0;
radius = 255;
centerX = root.movieWidth / 2;
centerY = root.movieHeight / 2;
speed = sp;
xDir = 1;
mC = clip;
numberOfMissiles = 0;
energyStart = 100;
energy = energyStart;
homing = 0;
ringDrop = 20;
movingCloser = 0;
delayToFire = 50;
var _local2 = root.Useful1.RandomNumber(1, 20);
_local2 = _local2 - 10;
_local2 = _local2 / 10;
xVel = speed;
var _local3 = root.Useful1.RandomNumber(1, 10);
if (_local3 > 4) {
yVel = -speed;
} else {
yVel = speed;
}
yVel = yVel + _local2;
updatePosition();
}
function main() {
checkForOffStage();
updatePosition();
}
function checkForOffStage() {
if (mC._x < 0) {
remove();
}
if (mC._y < 0) {
remove();
}
if (mC._x > root.Game.movieWidth) {
remove();
}
if (mC._y > root.Game.movieHeight) {
remove();
}
}
function fireMissile() {
delayToFire--;
if (delayToFire == 0) {
delayToFire = 100;
var _local3 = "StickyProjectile";
var _local4 = root.inGameMissilesMc.attachMovie(_local3, "missile" + root.Game.numberOfMissiles, root.Game.numberOfMissiles);
var _local5 = (root.Player.angle * 180) / Math.PI;
_local4._rotation = _local5 + 180;
root.Game.numberOfMissiles++;
var _local2 = root.Useful.getArcVelocity(1, 10, mC._x, mC._y, root.playerMc._x, root.playerMc._y);
root.missilesArray.push(new Missile2(_local4, root.playerMc._x + ((-_local2.xStep) * root.missileDistFromGun), root.playerMc._y + ((-_local2.yStep) * root.missileDistFromGun), root, _local3));
root.missilesArray[root.missilesArray.length - 1].xVel = -_local2.xStep;
root.missilesArray[root.missilesArray.length - 1].yVel = -_local2.yStep;
}
}
function remove() {
root.saucerObject.stop();
var _local3 = root.Game.inGameExplosionsMc.attachMovie("saucerExplosion", "sexplosion2000", 2000);
_local3._x = mC._x;
_local3._y = mC._y;
var _local2 = 0;
while (_local2 < root.enemyArray.length) {
if (this == root.enemyArray[_local2]) {
arrayIndex = _local2;
}
_local2++;
}
mC.removeMovieClip();
root.enemyArray.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 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 381 MovieClip [__Packages.Useful] Frame 0
class Useful
{
function Useful () {
}
function getDistance(mc1, mc2) {
var _local4 = mc1._x;
var _local3 = mc1._y;
var _local2 = mc2._x;
var _local1 = mc2._y;
_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((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);
}
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);
}
}
Symbol 333 Button
on (release) {
gotoAndStop ("show_mj_anim");
}
Symbol 343 MovieClip Frame 1
this._visible = false;
Symbol 345 Button
on (release) {
_root.MindJoltSponsoredAPI.openLink(1);
}
Symbol 364 MovieClip Frame 38
stop();
Symbol 366 MovieClip Frame 1
_parent.stop();
Symbol 366 MovieClip Frame 54
mindlogo.stop();
Symbol 366 MovieClip Frame 60
mindlogo.play();
Symbol 366 MovieClip Frame 177
_parent.play();
stop();