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("I4DFM9A0", "39EA82BCE428545E");
MochiAd.showPreGameAd({id:"b80ab4d6fe6301a9", res:"700x560"});
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__("b1917e17", this, 10301, true);
sounds = new Object();
sounds.fire = new Sound();
sounds.fire.attachSound("fire");
sounds.fireMissile = new Sound();
sounds.fireMissile.attachSound("bing");
saucerObject = new Sound(this.createEmptyMovieClip("snd2", 1002));
saucerObject.attachSound("SaucerLoop");
saucerObject.setVolume(50);
musicObject = new Sound(this.createEmptyMovieClip("snd", 1000));
musicObject.attachSound("music");
musicObject.setVolume(20);
sounds.doh = new Sound();
sounds.doh.attachSound("doh");
sounds.cheer = new Sound();
sounds.cheer.attachSound("cheer");
sounds.popFX = new Sound();
sounds.popFX.attachSound("crunchFx");
sounds.extraPoints = new Sound();
sounds.extraPoints.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("GameOverRobot");
sounds.Appear = new Sound();
sounds.Appear.attachSound("Appear");
sounds.GotSaucer = new Sound();
sounds.GotSaucer.attachSound("GotSaucer");
Frame 3
currentDomain = _root._url.split("/");
currentDomain = currentDomain[2];
if (currentDomain.indexOf("mindjolt.com") != -1) {
currentDomain = "mindjolt";
}
gotoAndPlay ("advert");
Frame 9
if (currentDomain == "mindjolt") {
gotoAndPlay ("mjintro_short");
} else {
gotoAndPlay ("mjintro_long");
}
Frame 16
gotoAndPlay ("start_game");
Instance of Symbol 278 MovieClip in Frame 24
/* no clip actions */
Frame 25
gotoAndStop ("start_game");
Frame 36
musicObject.start(0, 1000);
var blocksLeft = new Array(25);
function setupGame() {
Game = new GameGame(gameMc, this, 700, 576, 17, 14, startLives);
Presentation = new GamePresentation(this);
Presentation.setupSplashScreen(splashScreenElements);
this.onEnterFrame = mainLoop;
}
function runSounds() {
if (soundFade == "out") {
soundFadeControl = soundFadeControl - 2;
musicObject.setVolume(soundFadeControl);
if (soundFadeControl == 0) {
soundSwitch = "off";
soundFade = "done";
}
} else if (soundFade == "in") {
soundFadeControl = soundFadeControl + 2;
musicObject.setVolume(soundFadeControl);
if (soundFadeControl >= 20) {
soundSwitch = "on";
soundFade = "done";
}
}
}
function quitGame() {
obj.vx = 0;
obj.vy = 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") {
backgroundMc.back.gotoAndStop(Useful1.RandomNumber(1, 10));
Game.setupGerms();
clearSprites();
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;
Game.sizeTarget = balloonLevelSizes[Game.levelNumber - 1];
Game.lives = startLives;
Game.setLives();
Game.setBlocksLeft();
Game.setTarget();
Game.setScore();
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.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;
Game.bonusCountArray.splice(0);
Game.lives = startLives;
Game.setLives();
Game.setBlocksLeft();
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") {
clearSprites();
Game.enemyArray.splice(0);
Presentation.setupSplashScreen(splashScreenElements);
Game.score = 0;
Game.blocksLeftOld = 190;
Game.levelIncrease = 8;
Game.levelNumber = 1;
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 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 (Key.isDown(32)) {
PLAYER_STATUS = "SPACE";
}
if (Key.getCode() == 65) {
keypress = 1;
} else if (Key.getCode() == 83) {
keypress = 2;
}
};
keyboard.onKeyUp = function () {
if (PLAYER_STATUS == "SPACE") {
if (Game.pickupType != "multi") {
if (Key.getCode() == 32) {
if (Game.gameState == "play") {
PLAYER_STATUS = "FREE";
Player.currentColour++;
if (Player.currentColour > 4) {
Player.currentColour = 0;
}
Game.changeStatsColour();
Player.gun.bChar.gotoAndStop(ballColour[Player.currentColour]);
}
}
}
}
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:220};
var instructionsInfo = {mCName:"instructionsBtnAnim", xPos:60, yPos:280};
var controlsInfo = {mCName:"controlsBtnAnim", xPos:80, yPos:300};
var highscoresInfo = {mCName:"highscoresBtnAnim", xPos:60, yPos:385};
var SplashMusicBtn = {mCName:"SplashMusicBtn", xPos:275, yPos:460};
var moreGamesBtn = {mCName:"moreGamesBtn", xPos:325, yPos:440};
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;
var mouseButtonUp = false;
this.onMouseUp = function () {
mouseButton = false;
mouseButtonUp = true;
};
this.onMouseDown = function () {
mouseButton = true;
mouseButtonUp = false;
};
var soundControl = 1;
var soundFade;
var soundFadeControl = 20;
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";
setupGame();
setupPanel();
var blockSize = 32;
stop();
Symbol 13 MovieClip Frame 1
stop();
Symbol 35 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 36 MovieClip [gameOverMsg] Frame 1
if (_root.Game.levelNumber >= 100) {
msg.endTitle.gotoAndStop(2);
}
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 37 MovieClip [gameOverMsgAnim] Frame 10
stop();
Symbol 37 MovieClip [gameOverMsgAnim] Frame 23
_parent._parent._parent._parent._parent.Game.gameState = "game_over_restart";
stop();
Symbol 40 MovieClip [tipsMc] Frame 1
stop();
Symbol 63 MovieClip Frame 1
stop();
Symbol 89 MovieClip [M_stars1] Frame 15
this.removeMovieClip();
Symbol 90 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 90 MovieClip [starAnim] Frame 18
this.removeMovieClip();
stop();
Symbol 118 MovieClip [getReadyMsgAnim] Frame 11
msg.levelText.text = "Level " + _parent._parent._parent._parent._parent.Game.levelNumber;
Symbol 118 MovieClip [getReadyMsgAnim] Frame 74
_parent._parent._parent._parent._parent.Game.gameState = "play";
this.removeMovieClip();
Symbol 127 MovieClip [levelCompleteMsgs] Frame 1
stop();
Symbol 129 MovieClip [levelCompleteMsgAnim] Frame 15
msg.titleMc.gotoAndStop(howWellDone);
Symbol 129 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 129 MovieClip [levelCompleteMsgAnim] Frame 81
_parent._parent._parent._parent._parent.Game.gameState = "start_new_level";
stop();
Symbol 136 MovieClip [pausedMsgAnim] Frame 33
stop();
Symbol 136 MovieClip [pausedMsgAnim] Frame 42
this.removeMovieClip();
Symbol 153 Button
on (release) {
getURL ("http://www.flashgamemaker.com", _blank);
}
Symbol 162 MovieClip [blockGreen] Frame 1
stop();
Symbol 168 Button
on (release) {
_root.MindJoltSponsoredAPI.openLink(6);
}
Symbol 170 MovieClip [SplashScreen] Frame 1
function snowFall() {
this._y = this._y + this.yp;
if (this._y > 600) {
this._y = this.startY;
this._x = random(640);
}
this._x = this._x + (random(4) - 2);
}
var moving = 0;
var c = 0;
this.onEnterFrame = function () {
if (moving < 70) {
var _local2 = this.attachMovie("snow", "sbn" + c, 5000 + c);
var _local3 = random(70) + 10;
_local2.yp = random(4) + 1;
_local2._x = random(700);
_local2._xscale = _local3;
_local2._yscale = _local3;
_local2.startY = 0;
_local2.onEnterFrame = snowFall;
c++;
moving++;
}
};
Symbol 188 MovieClip [splashInfo] Frame 1
stop();
Symbol 188 MovieClip [splashInfo] Frame 2
stop();
backBtn.onRelease = function () {
_root.Presentation.setupPresentationElements();
gotoAndStop (1);
};
Symbol 188 MovieClip [splashInfo] Frame 3
backBtn.onRelease = function () {
_root.Presentation.setupPresentationElements();
gotoAndStop (1);
};
Symbol 188 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:"2f14dc51bbc61254", clip:leaderBoardMc, onClose:moveOn, onError:moveOn});
stop();
Symbol 191 MovieClip Frame 1
stop();
Symbol 193 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 204 MovieClip Frame 1
stop();
Symbol 212 MovieClip Frame 1
stop();
Symbol 213 MovieClip [points] Frame 21
this.removeMovieClip();
Symbol 216 MovieClip Frame 1
stop();
Symbol 221 MovieClip Frame 1
stop();
Symbol 221 MovieClip Frame 10
_parent.removeMovieClip();
Symbol 226 MovieClip Frame 1
stop();
Symbol 226 MovieClip Frame 8
_parent.removeMovieClip();
Symbol 231 MovieClip Frame 1
stop();
Symbol 231 MovieClip Frame 8
_parent.removeMovieClip();
Symbol 236 MovieClip Frame 1
stop();
Symbol 236 MovieClip Frame 8
_parent.removeMovieClip();
Symbol 243 MovieClip [blocks] Frame 1
stop();
Symbol 279 MovieClip [__Packages.mochi.MochiScores] Frame 0
class mochi.MochiScores
{
static var boardID, onClose, onError;
function MochiScores () {
}
static function setBoardID(boardID) {
mochi.MochiScores.boardID = boardID;
mochi.MochiServices.send("scores_setBoardID", {boardID:boardID});
}
static function showLeaderboard(options) {
if (options.clip != null) {
if ((options.clip != mochi.MochiServices.__get__clip()) || (mochi.MochiServices.__get__childClip()._target == undefined)) {
mochi.MochiServices.disconnect();
mochi.MochiServices.connect(mochi.MochiServices.__get__id(), options.clip);
}
delete options.clip;
}
if (options.name != null) {
if (typeof(options.name) == "object") {
if (options.name.text != undefined) {
options.name = options.name.text;
}
}
}
if (options.score != null) {
if (typeof(options.score) == "object") {
if (options.score.text != undefined) {
options.score = options.score.text;
}
}
}
if (options.onDisplay != null) {
options.onDisplay();
} else {
mochi.MochiServices.__get__clip().stop();
}
if (options.onClose != null) {
onClose = options.onClose;
} else {
onClose = function () {
mochi.MochiServices.__get__clip().play();
};
}
if (options.onError != null) {
onError = options.onError;
} else {
onError = onClose;
}
if (options.boardID == null) {
if (boardID != null) {
options.boardID = boardID;
}
}
mochi.MochiServices.send("scores_showLeaderboard", {options:options}, null, doClose);
}
static function closeLeaderboard() {
mochi.MochiServices.send("scores_closeLeaderboard");
}
static function getPlayerInfo(callbackObj, callbackMethod) {
mochi.MochiServices.send("scores_getPlayerInfo", null, callbackObj, callbackMethod);
}
static function submit(score, name, callbackObj, callbackMethod) {
mochi.MochiServices.send("scores_submit", {score:score, name:name}, callbackObj, callbackMethod);
}
static function requestList(callbackObj, callbackMethod) {
mochi.MochiServices.send("scores_requestList", null, callbackObj, callbackMethod);
}
static function scoresArrayToObjects(scores) {
var _local5 = {};
var _local1;
var _local4;
var _local2;
var _local6;
for (var _local8 in scores) {
if (typeof(scores[_local8]) == "object") {
if ((scores[_local8].cols != null) && (scores[_local8].rows != null)) {
_local5[_local8] = [];
_local2 = scores[_local8];
_local4 = 0;
while (_local4 < _local2.rows.length) {
_local6 = {};
_local1 = 0;
while (_local1 < _local2.cols.length) {
_local6[_local2.cols[_local1]] = _local2.rows[_local4][_local1];
_local1++;
}
_local5[_local8].push(_local6);
_local4++;
}
} else {
_local5[_local8] = {};
for (var _local7 in scores[_local8]) {
_local5[_local8][_local7] = scores[_local8][_local7];
}
}
} else {
_local5[_local8] = scores[_local8];
}
}
return(_local5);
}
static function doClose(args) {
if (args.error == true) {
if (args.errorCode == undefined) {
args.errorCode = "IOError";
}
onError.apply(null, [args.errorCode]);
} else {
onClose.apply();
}
}
}
Symbol 280 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.35");
}
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 ((args.options != null) && (args.options.onError != null)) {
args.options.onError.apply(null, ["NotConnected"]);
}
}
if (callbackMethod != null) {
args = {};
args.error = true;
args.errorCode = "NotConnected";
if ((callbackObject != null) && (typeof(callbackMethod) == "string")) {
callbackObject[callbackMethod](args);
} else if (callbackMethod != null) {
callbackMethod.apply(args);
}
}
}
static function send(methodName, args, callbackObject, callbackMethod) {
if (_connected) {
_sendChannel.send(_sendChannelName, "onReceive", {methodName:methodName, args:args, callbackID:_rcvChannel._nextcallbackID});
} else {
if ((_clip == undefined) || (!_connecting)) {
onError.apply(null, ["NotConnected"]);
handleError(args, callbackObject, callbackMethod);
flush(true);
return(undefined);
}
_sendChannel._queue.push({methodName:methodName, args:args, callbackID:_rcvChannel._nextcallbackID});
}
_rcvChannel._callbacks[_rcvChannel._nextcallbackID] = {callbackObject:callbackObject, callbackMethod:callbackMethod};
_rcvChannel._nextcallbackID++;
}
static function addLinkEvent(url, burl, btn, onClick) {
var _local2 = new Object();
_local2.mav = getVersion();
_local2.swfv = btn.getSWFVersion() || 6;
_local2.swfurl = btn._url;
_local2.fv = System.capabilities.version;
_local2.os = System.capabilities.os;
_local2.lang = System.capabilities.language;
_local2.scres = (System.capabilities.screenResolutionX + "x") + System.capabilities.screenResolutionY;
var s = "?";
var _local3 = 0;
for (var _local6 in _local2) {
if (_local3 != 0) {
s = s + "&";
}
_local3++;
s = ((s + _local6) + "=") + escape(_local2[_local6]);
}
var _local4 = btn.createEmptyMovieClip("clk", 1001);
_local4._alpha = 0;
_local4.beginFill(1044735);
_local4.moveTo(0, 0);
_local4.lineTo(0, btn._height);
_local4.lineTo(btn._width, btn._height);
_local4.lineTo(btn._width, 0);
_local4.lineTo(0, 0);
_local4.endFill();
_local4.onRelease = function () {
var _local3;
var _local2 = new LoadVars();
var timeout = 1500;
var t0 = getTimer();
var ping = this.createEmptyMovieClip("ping", 777);
this.onEnterFrame = function () {
if ((ping._totalframes > 0) && (ping._totalframes == ping._framesloaded)) {
delete this.onEnterFrame;
delete this.ping;
getURL (url + s, "_blank");
} else if ((getTimer() - t0) > timeout) {
delete this.onEnterFrame;
delete this.ping;
getURL (burl, "_blank");
}
};
ping.loadMovie("http://x.mochiads.com/linkping.swf?t=" + getTimer());
if (onClick != undefined) {
onClick();
}
};
}
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 281 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 282 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 283 MovieClip [__Packages.MochiAd] Frame 0
class MochiAd
{
function MochiAd () {
}
static function getVersion() {
return("2.7");
}
static function showPreGameAd(options) {
var _local26 = {clip:_root, ad_timeout:3000, fadeout_time:250, regpt:"o", method:"showPreloaderAd", color:16747008, background:16777161, outline:13994812, no_progress_bar:false, ad_started:function () {
this.clip.stop();
}, ad_finished:function () {
this.clip.play();
}, ad_failed:function () {
}, ad_loaded:function (width, height) {
}, ad_skipped:function () {
}, ad_progress:function (percent) {
}};
options = _parseOptions(options, _local26);
if ("c862232051e0a94e1c3609b3916ddb17".substr(0) == "dfeada81ac97cde83665f81c12da7def") {
options.ad_started();
options.ad_finished();
return(undefined);
}
var clip = options.clip;
var _local22 = 11000;
var _local25 = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!load(options)) {
options.ad_failed();
options.ad_finished();
return(undefined);
}
options.ad_started();
var mc = clip._mochiad;
mc.onUnload = function () {
options.ad_finished();
};
var _local14 = _getRes(options);
var _local4 = _local14[0];
var _local13 = _local14[1];
mc._x = _local4 * 0.5;
mc._y = _local13 * 0.5;
var chk = mc.createEmptyMovieClip("_mochiad_wait", 3);
chk._x = _local4 * -0.5;
chk._y = _local13 * -0.5;
var _local6 = chk.createEmptyMovieClip("_mochiad_bar", 4);
if (options.no_progress_bar) {
_local6._visible = false;
delete options.no_progress_bar;
} else {
_local6._x = 10;
_local6._y = _local13 - 20;
}
var _local21 = options.color;
delete options.color;
var _local19 = options.background;
delete options.background;
var _local23 = options.outline;
delete options.outline;
var _local5 = _local6.createEmptyMovieClip("_outline", 1);
_local5.beginFill(_local19);
_local5.moveTo(0, 0);
_local5.lineTo(_local4 - 20, 0);
_local5.lineTo(_local4 - 20, 10);
_local5.lineTo(0, 10);
_local5.lineTo(0, 0);
_local5.endFill();
var _local3 = _local6.createEmptyMovieClip("_inside", 2);
_local3.beginFill(_local21);
_local3.moveTo(0, 0);
_local3.lineTo(_local4 - 20, 0);
_local3.lineTo(_local4 - 20, 10);
_local3.lineTo(0, 10);
_local3.lineTo(0, 0);
_local3.endFill();
_local3._xscale = 0;
var _local7 = _local6.createEmptyMovieClip("_outline", 3);
_local7.lineStyle(0, _local23, 100);
_local7.moveTo(0, 0);
_local7.lineTo(_local4 - 20, 0);
_local7.lineTo(_local4 - 20, 10);
_local7.lineTo(0, 10);
_local7.lineTo(0, 0);
chk.ad_msec = _local22;
chk.ad_timeout = _local25;
chk.started = getTimer();
chk.showing = false;
chk.last_pcnt = 0;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function () {
var _local2 = 100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time));
if (_local2 > 0) {
this._parent._alpha = _local2;
} else {
var _local3 = this._parent._parent;
MochiAd.unload(_local3);
delete this.onEnterFrame;
}
};
mc.lc.regContLC = function (lc_name) {
mc._containerLCName = lc_name;
};
var sendHostProgress = false;
mc.lc.sendHostLoadProgress = function (lc_name) {
sendHostProgress = true;
};
mc.lc.adLoaded = options.ad_loaded;
mc.lc.adSkipped = options.ad_skipped;
mc.lc.adjustProgress = function (msec) {
var _local2 = this.mc._mochiad_wait;
_local2.server_control = true;
_local2.started = getTimer();
_local2.ad_msec = msec;
};
mc.lc.rpc = function (callbackID, arg) {
MochiAd.rpc(clip, callbackID, arg);
};
mc.rpcTestFn = function (s) {
return(s);
};
chk.onEnterFrame = function () {
var _local6 = this._parent._parent;
var _local11 = this._parent._mochiad_ctr;
var _local5 = getTimer() - this.started;
var _local3 = false;
var _local4 = _local6.getBytesTotal();
var _local8 = _local6.getBytesLoaded();
var _local2 = (100 * _local8) / _local4;
var _local10 = (100 * _local5) / chk.ad_msec;
var _local9 = this._mochiad_bar._inside;
var _local13 = Math.min(100, Math.min(_local2 || 0, _local10));
_local13 = Math.max(this.last_pcnt, _local13);
this.last_pcnt = _local13;
_local9._xscale = _local13;
options.ad_progress(_local13);
if (sendHostProgress) {
clip._mochiad.lc.send(clip._mochiad._containerLCName, "notify", {id:"hostLoadPcnt", pcnt:_local2});
if (_local2 == 100) {
sendHostProgress = false;
}
}
if (!chk.showing) {
var _local7 = _local11.getBytesTotal();
if ((_local7 > 0) || (typeof(_local7) == "undefined")) {
chk.showing = true;
chk.started = getTimer();
} else if ((_local5 > chk.ad_timeout) && (_local2 == 100)) {
options.ad_failed();
_local3 = true;
}
}
if (_local5 > chk.ad_msec) {
_local3 = true;
}
if (((_local4 > 0) && (_local8 >= _local4)) && (_local3)) {
if (this.server_control) {
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = chk.fadeFunction;
}
}
};
}
static function showClickAwayAd(options) {
var _local9 = {clip:_root, ad_timeout:2000, fadeout_time:250, regpt:"o", method:"showClickAwayAd", res:"300x250", no_bg:true, ad_started:function () {
}, ad_finished:function () {
}, ad_loaded:function (width, height) {
}, ad_failed:function () {
}, ad_skipped:function () {
}};
options = _parseOptions(options, _local9);
var clip = options.clip;
var _local8 = options.ad_timeout;
delete options.ad_timeout;
if (!load(options)) {
options.ad_failed();
options.ad_finished();
return(undefined);
}
options.ad_started();
var mc = clip._mochiad;
mc.onUnload = function () {
options.ad_finished();
};
var _local4 = _getRes(options);
var _local10 = _local4[0];
var _local7 = _local4[1];
mc._x = _local10 * 0.5;
mc._y = _local7 * 0.5;
var chk = mc.createEmptyMovieClip("_mochiad_wait", 3);
chk.ad_timeout = _local8;
chk.started = getTimer();
chk.showing = false;
mc.lc.adLoaded = options.ad_loaded;
mc.lc.adSkipped = options.ad_skipped;
mc.lc.rpc = function (callbackID, arg) {
MochiAd.rpc(clip, callbackID, arg);
};
mc.rpcTestFn = function (s) {
return(s);
};
var _local20 = false;
mc.lc.regContLC = function (lc_name) {
mc._containerLCName = lc_name;
};
chk.onEnterFrame = function () {
var _local5 = this._parent._mochiad_ctr;
var _local4 = getTimer() - this.started;
var _local2 = false;
if (!chk.showing) {
var _local3 = _local5.getBytesTotal();
if ((_local3 > 0) || (typeof(_local3) == "undefined")) {
_local2 = true;
chk.showing = true;
chk.started = getTimer();
} else if (_local4 > chk.ad_timeout) {
options.ad_failed();
_local2 = true;
}
}
if (_local2) {
delete this.onEnterFrame;
}
};
}
static function showInterLevelAd(options) {
var _local13 = {clip:_root, ad_timeout:2000, fadeout_time:250, regpt:"o", method:"showTimedAd", ad_started:function () {
this.clip.stop();
}, ad_finished:function () {
this.clip.play();
}, ad_failed:function () {
}, ad_loaded:function (width, height) {
}, ad_skipped:function () {
}};
options = _parseOptions(options, _local13);
var clip = options.clip;
var _local10 = 11000;
var _local12 = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!load(options)) {
options.ad_failed();
options.ad_finished();
return(undefined);
}
options.ad_started();
var mc = clip._mochiad;
mc.onUnload = function () {
options.ad_finished();
};
var _local5 = _getRes(options);
var _local14 = _local5[0];
var _local11 = _local5[1];
mc._x = _local14 * 0.5;
mc._y = _local11 * 0.5;
var chk = mc.createEmptyMovieClip("_mochiad_wait", 3);
chk.ad_msec = _local10;
chk.ad_timeout = _local12;
chk.started = getTimer();
chk.showing = false;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function () {
var _local2 = 100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time));
if (_local2 > 0) {
this._parent._alpha = _local2;
} else {
var _local3 = this._parent._parent;
MochiAd.unload(_local3);
delete this.onEnterFrame;
}
};
mc.lc.adLoaded = options.ad_loaded;
mc.lc.adSkipped = options.ad_skipped;
mc.lc.adjustProgress = function (msec) {
var _local2 = this.mc._mochiad_wait;
_local2.server_control = true;
_local2.started = getTimer();
_local2.ad_msec = msec - 250;
};
mc.lc.rpc = function (callbackID, arg) {
MochiAd.rpc(clip, callbackID, arg);
};
mc.rpcTestFn = function (s) {
return(s);
};
chk.onEnterFrame = function () {
var _local5 = this._parent._mochiad_ctr;
var _local4 = getTimer() - this.started;
var _local2 = false;
if (!chk.showing) {
var _local3 = _local5.getBytesTotal();
if ((_local3 > 0) || (typeof(_local3) == "undefined")) {
chk.showing = true;
chk.started = getTimer();
} else if (_local4 > chk.ad_timeout) {
options.ad_failed();
_local2 = true;
}
}
if (_local4 > chk.ad_msec) {
_local2 = true;
}
if (_local2) {
if (this.server_control) {
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = this.fadeFunction;
}
}
};
}
static function showPreloaderAd(options) {
showPreGameAd(options);
}
static function showTimedAd(options) {
showInterLevelAd(options);
}
static function _allowDomains(server) {
var _local1 = server.split("/")[2].split(":")[0];
if (System.security) {
if (System.security.allowDomain) {
System.security.allowDomain("*");
System.security.allowDomain(_local1);
}
if (System.security.allowInsecureDomain) {
System.security.allowInsecureDomain("*");
System.security.allowInsecureDomain(_local1);
}
}
return(_local1);
}
static function load(options) {
var _local13 = {clip:_root, server:"http://x.mochiads.com/srv/1/", method:"load", depth:10333, id:"_UNKNOWN_"};
options = _parseOptions(options, _local13);
options.swfv = options.clip.getSWFVersion() || 6;
options.mav = getVersion();
var _local9 = options.clip;
if (!_isNetworkAvailable()) {
return(null);
}
if (_local9._mochiad_loaded) {
return(null);
}
var _local12 = options.depth;
delete options.depth;
var _local6 = _local9.createEmptyMovieClip("_mochiad", _local12);
var _local11 = _getRes(options);
options.res = (_local11[0] + "x") + _local11[1];
options.server = options.server + options.id;
delete options.id;
_local9._mochiad_loaded = true;
var _local4 = _local6.createEmptyMovieClip("_mochiad_ctr", 1);
for (var _local7 in options) {
_local4[_local7] = options[_local7];
}
var _local10 = _local4.server;
delete _local4.server;
var _local14 = _allowDomains(_local10);
_local6.onEnterFrame = function () {
if (this._mochiad_ctr._url != this._url) {
this.onEnterFrame = function () {
if (!this._mochiad_ctr) {
delete this.onEnterFrame;
MochiAd.unload(this._parent);
}
};
}
};
var _local5 = new LocalConnection();
var _local8 = ["", Math.floor(new Date().getTime()), random(999999)].join("_");
_local5.mc = _local6;
_local5.name = _local8;
_local5.hostname = _local14;
_local5.allowDomain = function (d) {
return(true);
};
_local5.allowInsecureDomain = _local5.allowDomain;
_local5.connect(_local8);
_local6.lc = _local5;
_local4.lc = _local8;
_local4.st = getTimer();
_local4.loadMovie(_local10 + ".swf", "POST");
return(_local6);
}
static function unload(clip) {
if (typeof(clip) == "undefined") {
clip = _root;
}
if (clip.clip && (clip.clip._mochiad)) {
clip = clip.clip;
}
if (!clip._mochiad) {
return(false);
}
if (clip._mochiad._containerLCName != undefined) {
clip._mochiad.lc.send(clip._mochiad._containerLCName, "notify", {id:"unload"});
}
clip._mochiad.removeMovieClip();
delete clip._mochiad_loaded;
delete clip._mochiad;
return(true);
}
static function _isNetworkAvailable() {
if (System.security) {
var _local1 = System.security;
if (_local1.sandboxType == "localWithFile") {
return(false);
}
}
return(true);
}
static function _getRes(options) {
var _local3 = options.clip.getBounds();
var _local2 = 0;
var _local1 = 0;
if (typeof(options.res) != "undefined") {
var _local4 = options.res.split("x");
_local2 = parseFloat(_local4[0]);
_local1 = parseFloat(_local4[1]);
} else {
_local2 = _local3.xMax - _local3.xMin;
_local1 = _local3.yMax - _local3.yMin;
}
if ((_local2 == 0) || (_local1 == 0)) {
_local2 = Stage.width;
_local1 = Stage.height;
}
return([_local2, _local1]);
}
static function _parseOptions(options, defaults) {
var _local4 = {};
for (var _local8 in defaults) {
_local4[_local8] = defaults[_local8];
}
if (options) {
for (var _local8 in options) {
_local4[_local8] = options[_local8];
}
}
if (_root.mochiad_options) {
var _local5 = _root.mochiad_options.split("&");
var _local2 = 0;
while (_local2 < _local5.length) {
var _local3 = _local5[_local2].split("=");
_local4[unescape(_local3[0])] = unescape(_local3[1]);
_local2++;
}
}
if (_local4.id == "test") {
}
return(_local4);
}
static function rpc(clip, callbackID, arg) {
switch (arg.id) {
case "setValue" :
setValue(clip, arg.objectName, arg.value);
break;
case "getValue" :
var _local4 = getValue(clip, arg.objectName);
clip._mochiad.lc.send(clip._mochiad._containerLCName, "rpcResult", callbackID, _local4);
break;
case "runMethod" :
var _local3 = runMethod(clip, arg.method, arg.args);
clip._mochiad.lc.send(clip._mochiad._containerLCName, "rpcResult", callbackID, _local3);
}
}
static function setValue(base, objectName, value) {
var _local2 = objectName.split(".");
var _local1;
_local1 = 0;
while (_local1 < (_local2.length - 1)) {
if ((base[_local2[_local1]] == undefined) || (base[_local2[_local1]] == null)) {
return(undefined);
}
base = base[_local2[_local1]];
_local1++;
}
base[_local2[_local1]] = value;
}
static function getValue(base, objectName) {
var _local2 = objectName.split(".");
var _local1;
_local1 = 0;
while (_local1 < (_local2.length - 1)) {
if ((base[_local2[_local1]] == undefined) || (base[_local2[_local1]] == null)) {
return(undefined);
}
base = base[_local2[_local1]];
_local1++;
}
return(base[_local2[_local1]]);
}
static function runMethod(base, methodName, argsArray) {
var _local2 = methodName.split(".");
var _local1;
_local1 = 0;
while (_local1 < (_local2.length - 1)) {
if ((base[_local2[_local1]] == undefined) || (base[_local2[_local1]] == null)) {
return(undefined);
}
base = base[_local2[_local1]];
_local1++;
}
if (typeof(base[_local2[_local1]]) == "function") {
return(base[_local2[_local1]].apply(base, argsArray));
}
return(undefined);
}
}
Symbol 284 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 285 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 286 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 287 MovieClip [__Packages.GameGame] Frame 0
class GameGame
{
var mC, rt, numBalls, movieWidth, movieHeight, blockSize, blockSizeY, levelWidthBlocks, levelHeightBlocks, levelWidth, levelHeight, GridStartX, GridStartY, 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, dropShadow, score, 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, levelIncrease, secDisplay, minDisplay, StartTimer, clockDelay, minutes, sec, fulltime, mouseButton, moveUpSpeed, blocksLeftOld, gameCounter, tileLevelHeight, tilesArray, starAnims, levelCountdown, pauseSwitch, currentPickup, pickupType, pickupAdded, statsMc, powerMeter, msgMc, currentTimeBonus, blocksLeft, timeBonus, backgroundMc, tip, pickedUpBlock, tempGroupArray, movingAcross, movingMcs, oldIY, oldIX, oldMc, falling, backgroundLevelMc, blocksMc, pauseMc;
function GameGame (mc, rt2, sw, sh, levelW, levelH, startLives) {
mC = mc;
rt = rt2;
numBalls = 15;
movieWidth = sw;
movieHeight = sh;
blockSize = 30;
blockSizeY = 48;
levelWidthBlocks = levelW;
levelHeightBlocks = levelH;
levelWidth = levelWidthBlocks * blockSize;
levelHeight = levelHeightBlocks * blockSize;
GridStartX = 30;
GridStartY = 30;
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;
dropShadow = new flash.filters.GlowFilter(16777215, 1, 8, 8, 3, 1);
score = 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;
levelIncrease = 8;
secDisplay = "00";
minDisplay = "00";
StartTimer = 1;
clockDelay = 10;
minutes = StartTimer;
sec = 0;
fulltime = 0;
mouseButton = false;
moveUpSpeed = 180;
blocksLeftOld = 190;
gameCounter = moveUpSpeed;
tileLevelHeight = 0;
tilesArray = new Array();
starAnims = 0;
levelCountdown = 1000;
pauseSwitch = false;
currentPickup = "";
pickupType = "";
pickupAdded = false;
setupPanel();
}
function setupPanel() {
statsMc = inGameStatsMc.attachMovie("weapons", "ingamestatsmc", 1);
statsMc._y = movieHeight;
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.gameOver("out_of_time");
};
}
function deleteMeter() {
powerMeter.removeMovieClip();
}
function displayMeter() {
rt.mousePointer.attachMovie("shotStrengthMeter", "meter", 2);
}
function setupMeter() {
powerMeter = playerMc.attachMovie("shotStrengthMeter", "meter", 2);
}
function gameOver(gameOverType) {
turnOffTip();
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 {
gameState = "level_complete";
msgMc = inGameMsgsMc.attachMovie("levelCompleteMsgAnim", "levelComplete", 1);
msgMc._x = movieWidth / 2;
msgMc._y = (movieHeight / 2) - 60;
currentTimeBonus = 0;
if (blocksLeft == 0) {
timeBonus = 10;
msgMc.howWellDone = 1;
} else if (blocksLeft > -10) {
timeBonus = -blocksLeft;
msgMc.howWellDone = 2;
} else {
timeBonus = -blocksLeft;
msgMc.howWellDone = 3;
}
}
}
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() {
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);
backgroundMc = inGameBackgroundMc.createEmptyMovieClip("backgrounds", 0);
removeGerms();
tip = false;
tilesArray.splice(0);
pickedUpBlock = 0;
badGuysArray.splice(0);
goodGuysArray = new Array();
tempGroupArray = new Array();
setupBlocks();
movingAcross = false;
movingMcs = 0;
blocksLeftOld = blocksLeftOld + levelIncrease;
levelIncrease = levelIncrease - 1;
if (levelIncrease < 1) {
levelIncrease = 1;
}
if (blocksLeftOld > ((levelHeightBlocks * levelWidthBlocks) - 5)) {
blocksLeftOld = (levelHeightBlocks * levelWidthBlocks) - 5;
}
blocksLeft = blocksLeftOld;
}
function checkForEnd() {
var _local5 = false;
var _local2 = 0;
while (_local2 < tilesArray.length) {
var _local3 = 0;
while (_local3 < tilesArray[_local2].length) {
if (tilesArray[_local2][_local3] != 0) {
var _local4 = tilesArray[_local2][_local3]._currentframe;
if (SeedFill_2(_local3 - 1, _local2, _local4)) {
_local2 = tilesArray.length;
_local3 = tilesArray[_local2].length;
_local5 = true;
} else if (SeedFill_2(_local3 + 1, _local2, _local4)) {
_local2 = tilesArray.length;
_local3 = tilesArray[_local2].length;
_local5 = true;
} else if (SeedFill_2(_local3, _local2 - 1, _local4)) {
_local2 = tilesArray.length;
_local3 = tilesArray[_local2].length;
_local5 = true;
} else if (SeedFill_2(_local3, _local2 + 1, _local4)) {
_local2 = tilesArray.length;
_local3 = tilesArray[_local2].length;
_local5 = true;
}
}
_local3++;
}
_local2++;
}
if (_local5 == false) {
if (blocksLeft > 0) {
gameOver("out_of_time");
} else {
gameOver("level_complete");
}
}
}
function SeedFill_2(xx, yy, fill_color) {
if (fill_color == tilesArray[yy][xx]._currentframe) {
return(true);
}
return(false);
}
function highlightBlock() {
var _local4 = int((rt._xmouse - GridStartX) / blockSize);
var _local3 = int((rt._ymouse - GridStartY) / blockSize);
if ((_local4 != oldIX) or (_local3 != oldIY)) {
oldIX = _local4;
oldIY = _local3;
oldMc = tilesArray[_local3][_local4];
var _local2 = 0;
while (_local2 < tempGroupArray.length) {
tempGroupArray[_local2].filters = [];
tempGroupArray[_local2].highlightMc.gotoAndStop(1);
_local2++;
}
if (checkForGroup(rt._xmouse, rt._ymouse)) {
if (tempGroupArray.length > 0) {
_local2 = 0;
while (_local2 < tempGroupArray.length) {
tempGroupArray[_local2].filters = [dropShadow];
_local2++;
}
turnOnTip(calcPoints(tempGroupArray.length), tempGroupArray.length);
} else {
turnOffTip();
}
} else {
turnOffTip();
}
} else if (tilesArray[_local3][_local4] != oldMc) {
oldMc = tilesArray[_local3][_local4];
var _local2 = 0;
while (_local2 < tempGroupArray.length) {
tempGroupArray[_local2].filters = [];
tempGroupArray[_local2].highlightMc.gotoAndStop(1);
_local2++;
}
if (checkForGroup(rt._xmouse, rt._ymouse)) {
if (tempGroupArray.length > 0) {
_local2 = 0;
while (_local2 < tempGroupArray.length) {
tempGroupArray[_local2].filters = [dropShadow];
_local2++;
}
turnOnTip(calcPoints(tempGroupArray.length), tempGroupArray.length);
} else {
turnOffTip();
}
} else {
turnOffTip();
}
}
}
function calcPoints(points) {
if (points == 1) {
var _local3 = rt.Useful1.RandomNumber(1, 200);
_local3 = _local3 * levelNumber;
_local3 = -_local3;
} else {
var _local3 = (points * points) * 3;
}
return(_local3);
}
function deleteBlock() {
if (falling == false) {
if (movingMcs == 0) {
var _local5 = 0;
while (_local5 < tempGroupArray.length) {
tempGroupArray[_local5].filters = [];
tempGroupArray[_local5].highlightMc.gotoAndStop(1);
_local5++;
}
if (checkForGroup(rt._xmouse, rt._ymouse)) {
if (tempGroupArray.length > 0) {
_local5 = 0;
while (_local5 < tempGroupArray.length) {
var _local4 = 0;
while (_local4 < tilesArray.length) {
var _local3 = 0;
while (_local3 < tilesArray[_local4].length) {
if (tilesArray[_local4][_local3] == tempGroupArray[_local5]) {
var _local2 = 0;
while (_local2 < goodGuysArray.length) {
if (tempGroupArray[_local5] == goodGuysArray[_local2].mC) {
goodGuysArray.splice(_local2, 1);
break;
}
_local2++;
}
tilesArray[_local4][_local3] = 0;
}
_local3++;
}
_local4++;
}
tempGroupArray[_local5].swapDepths(0);
tempGroupArray[_local5].filters = [];
tempGroupArray[_local5].ball.gotoAndPlay(2);
blocksLeft--;
_local5++;
}
increaseScore(calcPoints(tempGroupArray.length));
var _local6 = inGameExplosionsMc.attachMovie("starAnim", "starAnim" + starAnims, starAnims + 1000);
_local6._x = tempGroupArray[0]._x + 40;
_local6._y = tempGroupArray[0]._y + 40;
_local6._xscale = 100;
_local6._yscale = 100;
starAnims++;
rt.sounds.popFX.start(0, 1);
}
}
}
}
}
function checkForGroup(xx, yy) {
var _local3 = int((xx - GridStartX) / blockSize);
var _local2 = int((yy - GridStartY) / blockSize);
if (tilesArray[_local2][_local3] == 0) {
return(false);
}
if (_local3 < levelWidthBlocks) {
if (_local2 < levelHeightBlocks) {
var _local5 = (levelWidthBlocks * _local2) + _local3;
tempGroupArray = new Array();
var _local4 = tilesArray[_local2][_local3]._currentframe;
SeedFill_1(_local3 - 1, _local2, _local4);
SeedFill_1(_local3 + 1, _local2, _local4);
SeedFill_1(_local3, _local2 - 1, _local4);
SeedFill_1(_local3, _local2 + 1, _local4);
return(true);
}
return(false);
}
return(false);
}
function SeedFill_1(xx, yy, fill_color) {
var _local5 = tilesArray;
if (fill_color == _local5[yy][xx]._currentframe) {
var _local6 = false;
var _local2 = 0;
while (_local2 < tempGroupArray.length) {
if (tempGroupArray[_local2] == _local5[yy][xx]) {
_local6 = true;
}
_local2++;
}
if (_local6 == false) {
tempGroupArray.push(_local5[yy][xx]);
SeedFill_1(xx - 1, yy, fill_color);
SeedFill_1(xx + 1, yy, fill_color);
SeedFill_1(xx, yy - 1, fill_color);
SeedFill_1(xx, yy + 1, fill_color);
}
}
}
function setupBlocks() {
backgroundLevelMc = backgroundMc.attachMovie("backgroundMc", "backgroundMc", 10);
backgroundLevelMc._x = 0;
backgroundLevelMc._y = 0;
blocksMc = inGameEnemyMc.createEmptyMovieClip("blocksMc", 0);
blocksMc._x = GridStartX;
blocksMc._y = GridStartY;
tilesArray = new Array();
var _local4 = 0;
while (_local4 < int(levelHeightBlocks)) {
tilesArray[_local4] = new Array();
var _local3 = 0;
while (_local3 < int(levelWidthBlocks)) {
var _local5 = (levelWidthBlocks * _local4) + _local3;
var _local2 = blocksMc.attachMovie("blocks", "block" + _local5, _local5);
_local2.gotoAndStop(rt.Useful1.RandomNumber(1, 4));
_local2._alpha = 90;
tilesArray[_local4][_local3] = _local2;
goodGuysArray.push(new GoodGuy(_local2, rt, _local3 * 30, _local4 * 30, 15, _local2._currentframe));
_local2._x = _local3 * 30;
_local2._y = _local4 * 30;
_local3++;
}
_local4++;
}
}
function setupBackground() {
backgroundLevelMc = backgroundMc.attachMovie("backgroundMc", "backgroundMc", 10);
backgroundLevelMc._x = 0;
backgroundLevelMc._y = 0;
backgroundLevelMc.gotoAndStop(levelNumber);
var _local3 = rt.Useful1.countMcs(backgroundLevelMc.levelMc);
var _local2 = 0;
while (_local2 < _local3.length) {
if (_local3[_local2]._totalframes == 1) {
goodGuysArray.push(new GoodGuy(_local3[_local2], rt, _local3[_local2]._x, _local3[_local2]._y, 2, _local3[_local2]._totalframes));
}
_local2++;
}
}
function checkForGameOver() {
var _local3 = 0;
var _local2 = 0;
while (_local2 < badGuysArray.length) {
if (badGuysArray[_local2]._currentframe == 7) {
_local3++;
}
_local2++;
}
if (badGuysArray.length == _local3) {
gameOver("level_Complete");
}
}
function checkForClearColumn() {
if (movingMcs == 0) {
var _local7 = new Array();
var _local4 = 0;
while (_local4 < int(levelWidthBlocks)) {
var _local6 = 0;
var _local5 = 0;
while (_local5 < tilesArray.length) {
if (tilesArray[_local5][_local4] == 0) {
_local6++;
}
_local5++;
}
if (_local6 == tilesArray.length) {
if (_local4 > (levelWidthBlocks / 2)) {
var _local3 = _local4 + 1;
while (_local3 < levelWidthBlocks) {
var _local2 = 0;
while (_local2 < tilesArray.length) {
if ((tilesArray[_local2][_local3] != undefined) and (tilesArray[_local2][_local3] != 0)) {
tilesArray[_local2][_local3].moveAcross = "left";
movingMcs++;
}
_local2++;
}
_local3++;
}
_local5 = tilesArray.length;
_local4 = levelWidthBlocks;
} else if (_local7.length > 0) {
var _local3 = 0;
while (_local3 < _local4) {
var _local2 = 0;
while (_local2 < tilesArray.length) {
if ((tilesArray[_local2][_local3] != undefined) and (tilesArray[_local2][_local3] != 0)) {
tilesArray[_local2][_local3].moveAcross = "right";
movingMcs++;
}
_local2++;
}
_local3++;
}
_local5 = tilesArray.length;
_local4 = levelWidthBlocks;
}
} else {
_local7.push("true");
}
_local4++;
}
}
}
function mainLoop() {
if (gameState == "play") {
if (rt.mouseButton == true) {
rt.mouseButton = false;
deleteBlock();
setScore();
setBlocksLeft();
}
falling = false;
var _local3 = true;
var _local2 = 0;
while (_local2 < goodGuysArray.length) {
goodGuysArray[_local2].mainLoop();
if (goodGuysArray[_local2].mC.moveAcross != "") {
_local3 = false;
}
_local2++;
}
if (_local3 == true) {
movingMcs = 0;
}
if (falling == false) {
checkForClearColumn();
if (movingMcs == 0) {
checkForEnd();
highlightBlock();
}
}
}
}
function turnOnTip(tipType, single) {
tip = true;
var _local2 = rt.mousePointer.attachMovie("tipsMc", "tipMc", 1);
_local2.tipMc.txt.text = tipType;
_local2._y = -20;
}
function turnOffTip() {
if (tip == true) {
tip = false;
rt.mousePointer.tipMc.removeMovieClip();
}
}
function reduceScore(ball) {
var _local2 = inGameScoreMc.attachMovie("points", "points" + starAnims, starAnims + 1000);
_local2._x = ball._x + 35;
_local2._y = ball._y + 14;
starAnims++;
_local2.txt.gotoAndStop(2);
_local2.txt.pointsTxt.text = -10;
decreaseScore(10);
}
function pauseOn() {
pauseSwitch = true;
gameState = "pause";
pauseMc = inGameMc.attachMovie("pauseMc", "pauseMc", 3);
}
function pauseOff() {
pauseSwitch = false;
gameState = "play";
pauseMc.removeMovieClip();
}
function decreaseScore(decrease) {
score = int(score - decrease);
if (score >= 0) {
setScore();
} else {
score = 0;
setScore();
}
}
function increaseScore(increase) {
score = int(score + increase);
if (score > 0) {
setScore();
}
}
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;
_local2.level2.text = levelNumber;
}
function setScore() {
var _local2 = inGameStatsMc.ingamestatsmc;
_local2 = _local2.wg;
_local2 = _local2.stats;
var _local3 = int(rt._xmouse / 70);
var _local4 = int(rt._ymouse / 28);
var _local5 = (levelWidthBlocks * _local4) + _local3;
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;
}
_local2.score2.text = _local2.score.text;
}
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");
}
}
}
function setBlocksLeft() {
var _local2 = inGameStatsMc.ingamestatsmc;
_local2 = _local2.wg;
_local2 = _local2.stats;
_local2.leftTxt.text = blocksLeft;
_local2.leftTxt2.text = blocksLeft;
}
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 288 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 289 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 290 MovieClip [__Packages.GoodGuy] Frame 0
class GoodGuy
{
var root, mC, range, arrayIndex, hits, gravity, toKill, delayToFire, gotGold, energyBarOn, xDir, movingAcrossDelay, target, homing, ringDrop, movingCloser, spriteType, energyMc;
function GoodGuy (clip, rt, xStart, yStart, sp, st) {
root = rt;
mC = clip;
range = 5;
arrayIndex = 0;
hits = 0;
gravity = 0;
xOrigin = xStart;
toKill = false;
yOrigin = yStart;
xPos = 0;
yPos = 0;
xVel = 0;
yVel = 0;
delayToFire = 30;
angle = 0.2;
gotGold = 0;
energyBarOn = 0;
degrees = 0;
speed = sp;
xDir = 1;
movingAcrossDelay = 0;
target = undefined;
numberOfMissiles = 0;
energyStart = 100;
energy = energyStart;
homing = 0;
ringDrop = 20;
movingCloser = 0;
delayToFire = 50;
spriteType = st;
}
function applyGravity() {
yVel = yVel + 1;
}
function mainLoop(indx) {
var _local3 = xOrigin + xPos;
var _local2 = yOrigin + yPos;
_local3 = int(_local3 / root.Game.blockSize);
_local2 = int(_local2 / root.Game.blockSize);
if ((mC.moveAcross != "left") and (mC.moveAcross != "right")) {
if (root.Game.movingMcs == 0) {
if (_local2 < (root.Game.levelHeightBlocks - 1)) {
if ((root.Game.tilesArray[_local2 + 1][_local3] == undefined) or (root.Game.tilesArray[_local2 + 1][_local3] == 0)) {
root.Game.tilesArray[_local2][_local3] = 0;
yVel = speed;
root.Game.falling = true;
} else {
root.Game.tilesArray[_local2][_local3] = mC;
yVel = 0;
}
} else {
root.Game.tilesArray[_local2][_local3] = mC;
yVel = 0;
}
}
} else if (mC.moveAcross == "left") {
movingAcrossDelay++;
if (movingAcrossDelay == 2) {
xVel = 0;
mC.moveAcross = "";
movingAcrossDelay = 0;
root.Game.movingMcs--;
root.Game.tilesArray[_local2][_local3] = mC;
} else {
xVel = -(speed * 2);
root.Game.tilesArray[_local2][_local3] = 0;
}
} else if (mC.moveAcross == "right") {
movingAcrossDelay++;
if (movingAcrossDelay == 2) {
xVel = 0;
mC.moveAcross = "";
movingAcrossDelay = 0;
root.Game.movingMcs--;
root.Game.tilesArray[_local2][_local3] = mC;
} else {
xVel = speed * 2;
root.Game.tilesArray[_local2][_local3] = 0;
}
}
updatePosition();
}
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++;
}
}
}
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 291 MovieClip [__Packages.Useful] Frame 0
class Useful
{
function Useful () {
}
function bounce(mc, targetX, targetY, spring, vx, vy, friction) {
var _local4 = (targetX - mc._xscale) * spring;
var _local3 = (targetY - mc._xscale) * spring;
vx = vx + _local4;
vy = vy + _local3;
vx = vx * friction;
vy = vy * friction;
mc._xscale = mc._xscale + vx;
mc._yscale = mc._xscale;
}
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 countMcs(mC) {
var _local2 = new Array();
var _local3 = 0;
for (_local3 in mC) {
if (typeof(mC[_local3]) == "movieclip") {
_local2.push(mC[_local3]);
}
}
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);
}
function dashTo(startx, starty, endx, endy, len, gap, mC) {
if (arguments.length < 6) {
return(false);
}
var _local12;
var _local9;
var _local8;
var _local10;
var _local3;
var _local2;
_local12 = len + gap;
_local9 = endx - startx;
_local8 = endy - starty;
var _local11 = Math.sqrt((_local9 * _local9) + (_local8 * _local8));
_local10 = Math.floor(Math.abs(_local11 / _local12));
var _local5 = Math.atan2(_local8, _local9);
_local3 = startx;
_local2 = starty;
_local9 = Math.cos(_local5) * _local12;
_local8 = Math.sin(_local5) * _local12;
var _local4 = 0;
while (_local4 < _local10) {
mC.moveTo(_local3, _local2);
mC.lineTo(_local3 + (Math.cos(_local5) * len), _local2 + (Math.sin(_local5) * len));
_local3 = _local3 + _local9;
_local2 = _local2 + _local8;
_local4++;
}
mC.moveTo(_local3, _local2);
_local11 = Math.sqrt(((endx - _local3) * (endx - _local3)) + ((endy - _local2) * (endy - _local2)));
if (_local11 > len) {
mC.lineTo(_local3 + (Math.cos(_local5) * len), _local2 + (Math.sin(_local5) * len));
} else if (_local11 > 0) {
mC.lineTo(_local3 + (Math.cos(_local5) * _local11), _local2 + (Math.sin(_local5) * _local11));
}
mC.moveTo(endx, endy);
}
function drawDash(startx, starty, endx, endy, len, gap) {
_root.clear();
_root.lineStyle(2, 6719658);
_root.dashTo(startx, starty, endx, endy, len, gap);
updateAfterEvent();
}
}
Symbol 254 MovieClip Frame 1
this.visible = false;
Symbol 256 Button
on (release) {
_root.MindJoltSponsoredAPI.openLink(1);
}
Symbol 275 MovieClip Frame 38
stop();
Symbol 277 MovieClip Frame 1
marker._visible = false;
_parent.stop();
Symbol 277 MovieClip Frame 54
mindlogo.stop();
Symbol 277 MovieClip Frame 60
mindlogo.play();
Symbol 277 MovieClip Frame 177
_parent.play();
stop();
Symbol 278 MovieClip Frame 1
marker._visible = false;
_parent.stop();
Symbol 278 MovieClip Frame 10
mindlogo.stop();
Symbol 278 MovieClip Frame 16
mindlogo.play();
Symbol 278 MovieClip Frame 73
_parent.play();
stop();