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("D1849A01", "AE428545EA8957A0");
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);
if (_global.kongregate_site == false) {
var CPMStarContentSpotID = "111Q997793EE";
System.security.allowDomain("server.cpmstar.com");
adBox.loadMovie("http://server.cpmstar.com/adviewas2.swf?contentspotid=" + CPMStarContentSpotID);
}
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__("477c8394", this, 10301, true);
Frame 3
if (framesLoaded == totalFrames) {
gotoAndPlay ("display_ad");
} else {
gotoAndPlay ("loop1");
}
Frame 5
if (startGameCounter == 80) {
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("GameOverFx");
sounds.Appear = new Sound(this);
sounds.Appear.attachSound("Appear");
sounds.newBall = new Sound(this);
sounds.newBall.attachSound("newBallFx");
sounds.musicObject.start(0, 1000);
function setupGame() {
Game = new GameGame(gameMc, this, 700, 560, 10, 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.playerMc, this, 280, 280, Key);
Presentation.splashScreenMc.removeMovieClip();
Game.msgMc = Game.inGameMsgsMc.attachMovie("getReadyMsgAnim", "getready", 1);
Game.msgMc._x = Game.movieWidth / 2;
Game.msgMc._y = (Game.movieHeight / 2) - 40;
obj.vx = 3;
obj.vy = 0;
obj.x = Game.xPlayerStart;
obj.y = Game.yPlayerStart;
Game.minutes = Game.StartTimer;
Game.sec = 0;
Game.displayTime();
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") {
Game.turnOffTip();
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;
var mouseButtonUp = false;
this.onMouseUp = function () {
mouseButton = false;
mouseButtonUp = true;
};
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 34 MovieClip [backgrounds] Frame 1
stop();
Symbol 45 MovieClip Frame 1
stop();
Symbol 71 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 72 MovieClip [gameOverMsg] Frame 1
if (_root.Game.levelNumber > 20) {
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 73 MovieClip [gameOverMsgAnim] Frame 10
stop();
Symbol 73 MovieClip [gameOverMsgAnim] Frame 23
_parent._parent._parent._parent._parent.Game.gameState = "game_over_restart";
stop();
Symbol 82 MovieClip Frame 1
stop();
Symbol 82 MovieClip Frame 10
gotoAndStop (1);
Symbol 93 MovieClip [ballCharacter] Frame 1
stop();
Symbol 101 MovieClip Frame 8
_parent._parent.removeMovieClip();
Symbol 102 MovieClip Frame 1
stop();
Symbol 104 MovieClip Frame 1
stop();
Symbol 106 MovieClip Frame 1
stop();
Symbol 108 MovieClip Frame 1
stop();
Symbol 110 MovieClip Frame 1
stop();
Symbol 112 MovieClip Frame 1
stop();
Symbol 114 MovieClip Frame 1
stop();
Symbol 116 MovieClip Frame 1
stop();
Symbol 118 MovieClip Frame 1
stop();
Symbol 120 MovieClip Frame 1
stop();
Symbol 122 MovieClip Frame 1
stop();
Symbol 124 MovieClip Frame 1
stop();
Symbol 128 MovieClip Frame 1
stop();
Symbol 129 MovieClip [tiles] Frame 1
stop();
Symbol 133 MovieClip [badBall] Frame 1
stop();
Symbol 133 MovieClip [badBall] Frame 5
stop();
Symbol 133 MovieClip [badBall] Frame 18
this.removeMovieClip();
Symbol 137 MovieClip [M_stars1] Frame 15
this.removeMovieClip();
Symbol 138 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 138 MovieClip [starAnim] Frame 24
this.removeMovieClip();
stop();
Symbol 144 MovieClip Frame 1
stop();
Symbol 148 MovieClip Frame 1
stop();
Symbol 150 MovieClip [loseLifeMsgAnim] Frame 48
if (_parent._parent._parent._parent._parent.Game.gameState != "restart") {
_parent._parent._parent._parent._parent.Game.gameState = "restart";
}
this.removeMovieClip();
Symbol 154 MovieClip [getReadyMsgAnim] Frame 11
msg.levelTxt.text = "Level " + _parent._parent._parent._parent._parent.Game.levelNumber;
Symbol 154 MovieClip [getReadyMsgAnim] Frame 74
_parent._parent._parent._parent._parent.Game.gameState = "play";
this.removeMovieClip();
Symbol 163 MovieClip [levelCompleteMsgs] Frame 1
stop();
Symbol 165 MovieClip [levelCompleteMsgAnim] Frame 15
msg.titleMc.gotoAndStop(howWellDone);
Symbol 165 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 165 MovieClip [levelCompleteMsgAnim] Frame 81
_parent._parent._parent._parent._parent.Game.gameState = "start_new_level";
stop();
Symbol 169 MovieClip [pausedMsgAnim] Frame 33
stop();
Symbol 169 MovieClip [pausedMsgAnim] Frame 42
this.removeMovieClip();
Symbol 174 MovieClip [square] Frame 1
stop();
Symbol 188 MovieClip Frame 1
stop();
Symbol 199 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 214 Button
on (release) {
getURL ("http://www.flashgamemaker.com", _blank);
}
Symbol 222 Button
on (release) {
_root.MindJoltSponsoredAPI.openLink(6);
}
Symbol 260 MovieClip [splashInfo] Frame 1
stop();
Symbol 260 MovieClip [splashInfo] Frame 2
stop();
backBtn.onRelease = function () {
_root.Presentation.setupPresentationElements();
gotoAndStop (1);
};
nextBtn.onRelease = function () {
gotoAndStop (3);
};
Symbol 260 MovieClip [splashInfo] Frame 3
backBtn2.onRelease = function () {
gotoAndStop (2);
};
backBtn.onRelease = function () {
_root.Presentation.setupPresentationElements();
gotoAndStop (1);
};
nextBtn.onRelease = function () {
gotoAndStop (4);
};
Symbol 260 MovieClip [splashInfo] Frame 4
backBtn2.onRelease = function () {
gotoAndStop (3);
};
backBtn.onRelease = function () {
_root.Presentation.setupPresentationElements();
gotoAndStop (1);
};
Symbol 260 MovieClip [splashInfo] Frame 5
backBtn.onRelease = function () {
_root.Presentation.setupPresentationElements();
gotoAndStop (1);
};
Symbol 260 MovieClip [splashInfo] Frame 6
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 261 MovieClip [SplashScreen] Frame 1
var numberOfBalls = 48;
var gapAngle = (360 / numberOfBalls);
var angle = 0;
var centerX = 0;
var centerY = 0;
var ringMc = this.createEmptyMovieClip("ringMc", 100);
var i = 0;
while (i < numberOfBalls) {
var ball = ringMc.attachMovie("tiles", "tile" + i, i);
ball.gotoAndStop(_root.Useful1.RandomNumber(1, 10));
newAngle = (Math.PI * angle) / 180;
radius = 192;
ball._x = centerX + (Math.cos(newAngle) * radius);
ball._y = centerY + (Math.sin(newAngle) * radius);
angle = angle + gapAngle;
if (angle >= 360) {
angle = angle - 360;
}
i++;
}
ringMc._x = 790;
ringMc._y = 710;
ringMc._xscale = 220;
ringMc._yscale = ringMc._xscale;
ringMc._alpha = 40;
ringMc.onEnterFrame = function () {
this._rotation = this._rotation + 0.2;
};
var numberOfBalls = 40;
var gapAngle = (360 / numberOfBalls);
var angle = 0;
var centerX = 0;
var centerY = 0;
var ringMc2 = this.createEmptyMovieClip("ringMc2", 101);
var i = 0;
while (i < numberOfBalls) {
var ball = ringMc2.attachMovie("tiles", "tile" + i, i);
ball.gotoAndStop(_root.Useful1.RandomNumber(1, 10));
newAngle = (Math.PI * angle) / 180;
radius = 160;
ball._x = centerX + (Math.cos(newAngle) * radius);
ball._y = centerY + (Math.sin(newAngle) * radius);
angle = angle + gapAngle;
if (angle >= 360) {
angle = angle - 360;
}
i++;
}
ringMc2._x = 790;
ringMc2._y = 710;
ringMc2._xscale = 220;
ringMc2._yscale = ringMc2._xscale;
ringMc2._alpha = 40;
ringMc2.onEnterFrame = function () {
this._rotation = this._rotation + 0.1;
};
var numberOfBalls = 32;
var gapAngle = (360 / numberOfBalls);
var angle = 0;
var centerX = 0;
var centerY = 0;
var ringMc3 = this.createEmptyMovieClip("ringMc3", 102);
var i = 0;
while (i < numberOfBalls) {
var ball = ringMc3.attachMovie("tiles", "tile" + i, i);
ball.gotoAndStop(_root.Useful1.RandomNumber(1, 10));
newAngle = (Math.PI * angle) / 180;
radius = 128;
ball._x = centerX + (Math.cos(newAngle) * radius);
ball._y = centerY + (Math.sin(newAngle) * radius);
angle = angle + gapAngle;
if (angle >= 360) {
angle = angle - 360;
}
i++;
}
ringMc3._x = 790;
ringMc3._y = 710;
ringMc3._xscale = 220;
ringMc3._yscale = ringMc2._xscale;
ringMc3._alpha = 40;
ringMc3.onEnterFrame = function () {
this._rotation = this._rotation + 0.1;
};
Symbol 268 MovieClip [bonusMc1] Frame 16
this.removeMovieClip();
Symbol 273 MovieClip [bonusMc2] Frame 16
this.removeMovieClip();
Symbol 278 MovieClip [bonusMc3] Frame 16
this.removeMovieClip();
Symbol 283 MovieClip [bonusMc4] Frame 16
this.removeMovieClip();
Symbol 290 MovieClip [bonusMc1000] Frame 16
this.removeMovieClip();
Symbol 293 MovieClip [points] Frame 12
this.removeMovieClip();
Symbol 294 MovieClip [ballFade] Frame 6
this.removeMovieClip();
Symbol 297 MovieClip [points50] Frame 13
this.removeMovieClip();
Symbol 303 MovieClip [previewMc] Frame 1
stop();
Symbol 323 MovieClip Frame 1
stop();
Symbol 325 MovieClip [SplashMusicBtn] Frame 1
if (_root.musicPlaying == "off") {
musicMc.gotoAndStop(2);
}
musicBtn.onRelease = function () {
if (musicMc._currentframe == 1) {
_root.soundFade = "out";
_root.musicPlaying = "off";
musicMc.gotoAndStop(2);
} else {
_root.soundFade = "in";
_root.musicPlaying = "on";
musicMc.gotoAndStop(1);
}
};
Symbol 347 MovieClip [splashscreenbuttons] Frame 1
if (_global.mindjolt_site == false) {
gotoAndStop (2);
}
stop();
Symbol 347 MovieClip [splashscreenbuttons] Frame 2
highscoresBtnAnim.onRelease = function () {
_root.MindJoltSponsoredAPI.openLink(3);
};
moreGamesBtnAnim.onRelease = function () {
_root.MindJoltSponsoredAPI.openLink(2);
};
Symbol 351 MovieClip [tipsMc] Frame 1
stop();
Symbol 396 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 397 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 398 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 399 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 400 MovieClip [__Packages.GamePlayer] Frame 0
class GamePlayer
{
var KeyCheck, missileDistFromGun, root, currentColour, shotsFired, shotsLimit, numberOfMissiles, keypress, jumpTime, mouseButton, mC, shotStrength, 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;
gun = mC.attachMovie("arrow", "BallMc", 1);
gravitySpeed = 2;
speed = 5;
pickupDelay = 0;
myCurrentScore = 0;
updatePosition();
}
function mainLoop() {
var _local2 = root.Useful1.pointTowards(mC._x, mC._y, root._xmouse, root._ymouse);
mC._rotation = _local2.spriteRotation;
}
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 401 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 402 MovieClip [__Packages.GoodGuy] Frame 0
class GoodGuy
{
var root, mC, arrayIndex, hits, delayToFire, gapAngle, gotGold, energyBarOn, ringNumber, xDir, target, homing, ringDrop, toKill, dropping, movingCloser, rotationDirection, edgeBall, holeX, holeY, dropAngle, dropRingNumber, energyMc, globalAngle;
function GoodGuy (clip, rt, xStart, yStart, ag, rad) {
root = rt;
mC = clip;
arrayIndex = 0;
hits = 0;
xOrigin = xStart;
yOrigin = yStart;
xPos = 0;
yPos = 0;
xVel = 0;
yVel = 0;
delayToFire = 30;
var _local3 = rad * root.Game.startBallsNumber;
gapAngle = 360 / _local3;
angle = ag * gapAngle;
gotGold = 0;
energyBarOn = 0;
degrees = 0;
ringNumber = rad;
radius = rad * root.Game.ballRadius;
centerX = root.Game.gameWindowWidth / 2;
centerY = root.Game.movieHeight / 2;
xDir = 1;
target = undefined;
numberOfMissiles = 0;
energyStart = 100;
energy = energyStart;
homing = 0;
ringDrop = 20;
toKill = false;
dropping = false;
movingCloser = 0;
delayToFire = 50;
rotationDirection = "";
edgeBall = false;
updateRotation();
}
function lockToSlot() {
var _local2 = int(angle / gapAngle);
if (root.Game.rotationDirection == "clockWise") {
var _local3 = _local2 * gapAngle;
if (angle > (_local3 + (gapAngle / 2))) {
_local2 = (_local2 + 1) * gapAngle;
} else {
_local2 = _local3;
}
} else {
var _local3 = _local2 * gapAngle;
if (angle > (_local3 + (gapAngle / 2))) {
_local2 = (_local2 + 1) * gapAngle;
} else {
_local2 = _local3;
}
}
angle = _local2;
updateRotation();
}
function rotateClockWise(ballRot) {
rotationDirection = "clockWise";
angle = angle + ballRot;
if (angle >= 360) {
angle = angle - 360;
}
updateRotation();
}
function rotateAntiClockWise(ballRot) {
rotationDirection = "antiClockWise";
angle = angle - (-ballRot);
if (angle < 0) {
angle = angle + 360;
}
updateRotation();
}
function checkForHoles(ringImIn) {
var _local4 = new Object();
_local4.found = false;
_local4.holeIndex = 0;
_local4.ringIndex = -1;
var _local3 = 5;
while (_local3 >= 0) {
var _local5 = 0;
var _local2 = 0;
while (_local2 < root.Game.ringsArray[_local3].length) {
if (root.Game.ringsArray[_local3][_local2] == 0) {
_local4.holeIndex = _local2;
_local4.ringIndex = _local3;
_local5++;
}
_local2++;
}
if (_local5 == 0) {
if (_local4.ringIndex >= 0) {
_local4.found = true;
}
return(_local4);
}
_local3--;
}
return(_local4);
}
function mainLoop(i2) {
if (edgeBall == true) {
var _local5 = int(radius / root.Game.ballRadius);
if (_local5 < root.Game.numberOfRings) {
var _local3 = checkForHoles(_local5);
if (_local3.found == true) {
if ((_local3.ringIndex + 1) == 2) {
if (mC._currentframe == 12) {
remove();
} else {
root.Game.ringsArray[_local3.ringIndex][_local3.holeIndex] = new GoodGuy(mC, root, mC._x, mC._y, _local3.holeIndex, _local3.ringIndex + 1);
}
} else {
root.Game.ringsArray[_local3.ringIndex][_local3.holeIndex] = new GoodGuy(mC, root, mC._x, mC._y, _local3.holeIndex, _local3.ringIndex + 1);
}
toKill = true;
} else {
var _local4 = false;
var _local2 = 0;
while (_local2 < root.Game.ringsArray[5].length) {
if (root.Game.ringsArray[5][_local2] == 0) {
_local4 = true;
}
_local2++;
}
if (_local4 == false) {
root.Game.gameOver("out_of_time");
} else {
if ((_local3.ringIndex + 1) == 2) {
if (mC._currentframe == 12) {
remove();
} else {
root.Game.ringsArray[_local3.ringIndex][_local3.holeIndex] = new GoodGuy(mC, root, mC._x, mC._y, _local3.holeIndex, _local3.ringIndex + 1);
}
} else {
root.Game.ringsArray[_local3.ringIndex][_local3.holeIndex] = new GoodGuy(mC, root, mC._x, mC._y, _local3.holeIndex, _local3.ringIndex + 1);
}
toKill = true;
}
}
}
radius = radius - 6;
updateEdgeRotation();
} else if (dropping == true) {
var _local6 = root.Useful1.getDistance(holeX, holeY, mC._x, mC._y);
if (_local6 < 10) {
angle = dropAngle;
ringNumber = dropRingNumber;
dropping = false;
root.Game.ballsDroppingNumber--;
}
if (dropping == true) {
updatePosition();
if (mC._currentframe == 12) {
if (ringNumber == 3) {
remove();
}
}
} else {
updateRotation();
}
} else {
updateRotation();
}
}
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 = -25;
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() {
root.sounds.popFX.start(0, 1);
mC.ball.gotoAndStop(2);
toKill = true;
}
function calcFinishPosition() {
var _local2 = root.Game.ringsAngleArray[dropRingNumber - 1];
var _local3 = _local2 + dropAngle;
if (_local3 >= 360) {
_local3 = _local3 - 360;
}
_local2 = (Math.PI * _local3) / 180;
var _local4 = dropRingNumber * root.Game.ballRadius;
holeX = centerX + (Math.cos(_local2) * _local4);
holeY = centerY + (Math.sin(_local2) * _local4);
}
function updateRotation() {
var _local2 = root.Game.ringsAngleArray[ringNumber - 1];
globalAngle = _local2 + angle;
if (globalAngle >= 360) {
globalAngle = globalAngle - 360;
}
_local2 = (Math.PI * globalAngle) / 180;
radius = ringNumber * root.Game.ballRadius;
mC._x = centerX + (Math.cos(_local2) * radius);
mC._y = centerY + (Math.sin(_local2) * radius);
}
function updateEdgeRotation() {
var _local2 = root.Game.ringsAngleArray[ringNumber - 1];
globalAngle = angle;
if (globalAngle >= 360) {
globalAngle = globalAngle - 360;
}
_local2 = (Math.PI * globalAngle) / 180;
mC._x = centerX + (Math.cos(_local2) * radius);
mC._y = centerY + (Math.sin(_local2) * radius);
}
function updatePosition() {
xPos = xPos + xVel;
yPos = yPos + yVel;
mC._x = mC._x + xPos;
mC._y = mC._y + 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 403 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 404 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);
setupPresentationElements();
}
function setupPresentationElements() {
optionsMc = splashScreenMc.createEmptyMovieClip("options", 1);
var _local4 = optionsMc.attachMovie("splashscreenbuttons", "splashscreenbtns", 1);
_local4._x = 70;
_local4._y = 150;
var _local2 = 0;
while (_local2 < rt.splashScreenElements.length) {
var _local3 = rt.splashScreenElements;
elementMc = _local4[_local3[_local2].mCName];
elementMc.btn.btnType = _local3[_local2].mCName;
elementMc.btn.splashScreenMc = splashScreenMc;
elementMc.btn.myObject = this;
elementMc.btn.onRelease = clickRightSplashSceenBtn;
elementMc.btn.onRollOver = rollOverSplashSceenBtn;
elementMc.btn.onRollOut = rollOutSplashSceenBtn;
_local2++;
}
}
function clickRightSplashSceenBtn() {
if (btnType == "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 405 MovieClip [__Packages.GameGame] Frame 0
class GameGame
{
var mC, rt, numBalls, startBallsNumber, movieWidth, gameWindowWidth, movieHeight, blockSize, blockSizeY, ballRadius, 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, ringsAngleArray, gapAngleArray, score, score2, sizeTarget, bestScore, starAnimDelay, lives, meterLevel, meterLevelSpeed, gameStartDelay, meterLevelDir, scoreIndex, xMidway, yMidway, starTrails, cannonManFlying, ballDeleted, 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, dragBalls, starAnims, levelCountdown, pauseSwitch, currentPickup, pickupType, pickupAdded, numberOfRings, edgeBallsReleaseD, edgeBallsRelease, statsMc, powerMeter, msgMc, backgroundMc, tilesNumber, holesFound, scoreArray, ballsDropping, ballsDroppingNumber, stored, tip, edgeRingsArray, edgeRingsMovingArray, ringsArray, rotationDirection, ringType, colourGroups, mouseRotation, ballRot, mouseRotationOld, pauseMc;
function GameGame (mc, rt2, sw, sh, levelW, levelH, startLives) {
mC = mc;
rt = rt2;
numBalls = 15;
startBallsNumber = 8;
movieWidth = sw;
gameWindowWidth = movieWidth - 140;
movieHeight = sh;
blockSize = 70;
blockSizeY = 28;
ballRadius = 32;
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;
ringsAngleArray = new Array();
gapAngleArray = new Array();
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;
ballDeleted = false;
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();
dragBalls = false;
starAnims = 0;
levelCountdown = 1000;
pauseSwitch = false;
currentPickup = "";
pickupType = "";
pickupAdded = false;
numberOfRings = 6;
edgeBallsReleaseD = 100;
edgeBallsRelease = edgeBallsReleaseD;
setupPanel();
}
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) {
turnOffTip();
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("gameOverMsgAnim", "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() {
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);
backgroundMc = inGameBackgroundMc.attachMovie("backgrounds", "background", 0);
moveUpSpeed = 180;
score2 = 0;
gameCounter = moveUpSpeed;
tileLevelHeight = 0;
levelCountdown = 1000;
tilesNumber = 0;
pickupAdded = false;
removeGerms();
tilesArray.splice(0);
badGuysArray.splice(0);
holesFound = false;
ringsAngleArray = new Array();
gapAngleArray = new Array();
scoreArray = new Array();
ballsDropping = false;
ballsDroppingNumber = 0;
stored = false;
setupBackgroundTiles();
edgeBallsReleaseD = 128;
edgeBallsRelease = edgeBallsReleaseD;
tip = false;
edgeBalls();
startBalls();
tileLevelHeight = 19;
}
function setupBackgroundTiles() {
var _local5;
var _local4 = 0;
while (_local4 < levelHeightBlocks) {
var _local3 = 0;
while (_local3 < levelWidthBlocks) {
_local5 = (_local4 * levelWidthBlocks) + _local3;
var _local2 = backgroundMc.attachMovie("BackTiles", "tile" + _local5, _local5);
_local2._x = _local3 * _local2._width;
_local2._y = _local4 * _local2._height;
_local2.gotoAndStop(rt.Useful1.RandomNumber(1, 1));
_local3++;
}
_local4++;
}
var _local6 = backgroundMc.attachMovie("backgrounds", "backgroundGrad", _local5 + 1);
_local6._x = 0;
_local6._y = 0;
_local6.gotoAndStop(rt.Useful1.RandomNumber(1, 10));
_local6._alpha = 70;
var _local7 = backgroundMc.attachMovie("tubeMc", "tubeMc", _local5 + 2);
_local7._x = 8;
_local7._y = 10;
}
function edgeBalls() {
edgeRingsArray = new Array();
edgeRingsMovingArray = new Array();
var _local6 = 8;
var _local7 = _local6 * startBallsNumber;
var _local8 = 360 / _local7;
_local7 = startBallsNumber * _local6;
var _local3 = 0;
while (_local3 < _local7) {
var _local2 = inGameEnemyMc.attachMovie("tiles", "tile" + tilesNumber, tilesNumber + 1000);
_local2._x = gameWindowWidth / 2;
_local2._y = movieHeight / 2;
var _local5 = rt.Useful1.RandomNumber(1 + levelNumber, 100);
if (_local5 > 80) {
if (_local5 > 85) {
_local2.gotoAndStop(12);
} else {
_local2.gotoAndStop(11);
}
} else {
_local2.gotoAndStop(rt.Useful1.RandomNumber(1, 10));
}
edgeRingsArray.push(new GoodGuy(_local2, rt, _local2._x, _local2._y, _local3, _local6));
edgeRingsArray[edgeRingsArray.length - 1].updateEdgeRotation();
edgeRingsArray[edgeRingsArray.length - 1].edgeBall = true;
tilesNumber++;
_local3++;
}
var _local4 = new Array();
_local6 = 0;
_local3 = edgeRingsArray.length / 2;
while (_local3 < edgeRingsArray.length) {
_local4[_local6] = edgeRingsArray[_local3];
_local6++;
_local3++;
}
_local3 = 0;
while (_local3 < (edgeRingsArray.length / 2)) {
_local4[(edgeRingsArray.length / 2) + _local3] = edgeRingsArray[_local3];
_local3++;
}
edgeRingsArray = new Array();
_local3 = 0;
while (_local3 < _local4.length) {
edgeRingsArray[_local3] = _local4[_local3];
_local3++;
}
}
function runEdgeBalls() {
if (edgeRingsArray.length > 0) {
if (Key.isDown(32)) {
edgeBallsRelease = 1;
}
edgeBallsRelease--;
if (edgeBallsRelease == 0) {
edgeBallsReleaseD = edgeBallsReleaseD - levelNumber;
if (edgeBallsReleaseD < 10) {
edgeBallsReleaseD = 10;
}
edgeBallsRelease = edgeBallsReleaseD;
rt.sounds.newBall.start(0, 1);
edgeRingsMovingArray.push(edgeRingsArray[0]);
edgeRingsArray.shift();
}
}
}
function startBalls() {
ringsArray = new Array();
var _local3 = 1;
while (_local3 < (numberOfRings + 1)) {
ringsAngleArray.push(Number(0));
ringsArray.push(new Array());
var _local5 = _local3 * startBallsNumber;
var _local6 = 360 / _local5;
gapAngleArray.push(_local6);
_local5 = startBallsNumber * _local3;
var _local4 = 0;
while (_local4 < _local5) {
if (_local3 < numberOfRings) {
var _local2 = inGameEnemyMc.attachMovie("tiles", "tile" + tilesNumber, tilesNumber + 1000);
_local2._x = gameWindowWidth / 2;
_local2._y = movieHeight / 2;
_local2.gotoAndStop(rt.Useful1.RandomNumber(1, 10));
ringsArray[ringsArray.length - 1].push(new GoodGuy(_local2, rt, _local2._x, _local2._y, _local4, _local3));
tilesNumber++;
} else {
ringsArray[ringsArray.length - 1].push(Number(0));
}
_local4++;
}
_local3++;
}
}
function checkForNewLevel() {
if (edgeRingsArray.length == 0) {
if (edgeRingsMovingArray.length == 0) {
backgroundMc.backgroundGrad.gotoAndStop(rt.Useful1.RandomNumber(1, 10));
levelNumber++;
if (levelNumber > 20) {
gameOver("game_complete");
} else {
edgeBallsReleaseD = 90;
edgeBallsRelease = edgeBallsReleaseD;
edgeBalls();
setLevel();
msgMc = inGameMsgsMc.attachMovie("getReadyMsgAnim", "getready", 1);
msgMc._x = movieWidth / 2;
msgMc._y = (movieHeight / 2) - 40;
gameState = "pre_start";
}
}
}
}
function rotateClockWise(ballRot, ringType) {
rotationDirection = "clockWise";
ringsAngleArray[ringType] = ringsAngleArray[ringType] + ballRot;
if (ringsAngleArray[ringType] >= 360) {
ringsAngleArray[ringType] = ringsAngleArray[ringType] - 360;
}
}
function rotateAntiClockWise(ballRot, ringType) {
rotationDirection = "antiClockWise";
ringsAngleArray[ringType] = ringsAngleArray[ringType] - (-ballRot);
if (ringsAngleArray[ringType] < 0) {
ringsAngleArray[ringType] = ringsAngleArray[ringType] + 360;
}
}
function lockToSlot() {
var _local4 = gapAngleArray[ringType - 1];
var _local5 = ringsAngleArray[ringType - 1];
var _local3 = int(_local5 / _local4);
if (rotationDirection == "clockWise") {
var _local6 = _local3 * _local4;
if (_local5 > (_local6 + (_local4 / 2))) {
_local3 = (_local3 + 1) * _local4;
} else {
_local3 = _local6;
}
} else {
var _local6 = _local3 * _local4;
if (_local5 > (_local6 + (_local4 / 2))) {
_local3 = (_local3 + 1) * _local4;
} else {
_local3 = _local6;
}
}
ringsAngleArray[ringType - 1] = _local3;
var _local2 = 0;
while (_local2 < goodGuysArray.length) {
goodGuysArray[_local2].mainLoop();
_local2++;
}
}
function anglediff(a1, a2) {
a1 = Math.abs(wrapValue((a1 + 180) - a2) - 180);
return(a1);
}
function wrapValue(val) {
if (val >= 360) {
val = val - 360;
}
return(val);
}
function checkForHoles() {
var _local2 = 1;
while (_local2 < numberOfRings) {
var _local12 = _local2 * startBallsNumber;
var _local9 = 360 / _local12;
var _local11 = _local2 + (1 * startBallsNumber);
var _local13 = 360 / _local11;
var _local14 = 0;
var _local5 = 0;
while (_local5 < ringsArray[_local2 - 1].length) {
if (ringsArray[_local2 - 1][_local5] == 0) {
var _local6 = _local5 * _local9;
_local6 = _local6 + ringsAngleArray[_local2 - 1];
if (_local6 >= 360) {
_local6 = _local6 - 360;
}
var _local3 = new Array();
var _local4 = 0;
while (_local4 < ringsArray[_local2].length) {
if (ringsArray[_local2][_local4] != 0) {
var _local10 = false;
var _local7 = anglediff(ringsArray[_local2][_local4].globalAngle, _local6);
if (_local7 < 30) {
ringsArray[_local2][_local4].tempAngle = _local7;
ringsArray[_local2][_local4].tempRingIndex = _local2;
ringsArray[_local2][_local4].tempRingIndex2 = _local4;
_local3.push(ringsArray[_local2][_local4]);
}
}
_local4++;
}
_local3.sortOn("tempAngle", Array.NUMERIC);
if (_local3.length != 0) {
if (_local3[0].ringNumber != (_local2 + 1)) {
}
_local3[0].dropAngle = _local5 * _local9;
_local3[0].dropRingNumber = _local2;
_local3[0].dropping = true;
_local3[0].calcFinishPosition();
var _local8 = rt.Useful1.pointTowards(_local3[0].holeX, _local3[0].holeY, _local3[0].mC._x, _local3[0].mC._y);
_local3[0].xVel = _local8.vx;
_local3[0].yVel = _local8.vy;
_local3[0].xPos = 0;
_local3[0].yPos = 0;
ringsArray[_local2 - 1][_local5] = _local3[0];
ringsArray[_local3[0].tempRingIndex][_local3[0].tempRingIndex2] = 0;
_local4 = ringsArray[_local2].length;
holesFound = true;
ballsDropping = true;
ballsDroppingNumber++;
}
}
_local5++;
}
_local2++;
}
}
function putInGroup(ball, ball2) {
if ((ball.mC._currentframe == 12) or (ball2.mC._currentframe == 12)) {
} else {
var _local7 = false;
var _local5;
var _local2 = 0;
while (_local2 < colourGroups.length) {
var _local3 = 0;
while (_local3 < colourGroups[_local2].length) {
if (colourGroups[_local2][_local3] == ball) {
_local7 = true;
_local5 = colourGroups[_local2];
_local3 = colourGroups[_local2].length;
_local2 = colourGroups.length;
}
_local3++;
}
_local2++;
}
if (_local7 == false) {
colourGroups.push(new Array());
if ((ball != 0) and (ball != undefined)) {
colourGroups[colourGroups.length - 1].push(ball);
}
if ((ball2 != 0) and (ball2 != undefined)) {
colourGroups[colourGroups.length - 1].push(ball2);
}
} else {
var _local9 = false;
var _local4 = 0;
while (_local4 < _local5.length) {
if (_local5[_local4] == ball2) {
_local9 = true;
}
_local4++;
}
if (_local9 == false) {
if ((ball2 != 0) and (ball2 != undefined)) {
_local5.push(ball2);
}
}
}
}
}
function checkForMatches() {
var _local8 = false;
colourGroups = new Array();
var _local6 = 0;
while (_local6 < ringsArray.length) {
var _local5 = 0;
while (_local5 < ringsArray[_local6].length) {
var _local3 = _local5 + 1;
if (_local3 >= ringsArray[_local6].length) {
_local8 = true;
_local3 = _local3 - ringsArray[_local6].length;
}
if (ringsArray[_local6][_local5].mC._currentframe == ringsArray[_local6][_local3].mC._currentframe) {
putInGroup(ringsArray[_local6][_local5], ringsArray[_local6][_local3]);
} else if ((ringsArray[_local6][_local5].mC._currentframe == 11) or (ringsArray[_local6][_local3].mC._currentframe == 11)) {
putInGroup(ringsArray[_local6][_local5], ringsArray[_local6][_local3]);
}
if (_local6 < (ringsArray.length - 1)) {
var _local2 = 0;
while (_local2 < ringsArray[_local6 + 1].length) {
var _local7 = anglediff(ringsArray[_local6][_local5].globalAngle, ringsArray[_local6 + 1][_local2].globalAngle);
if (_local7 < 12) {
if (ringsArray[_local6][_local5].mC._currentframe == ringsArray[_local6 + 1][_local2].mC._currentframe) {
putInGroup(ringsArray[_local6][_local5], ringsArray[_local6 + 1][_local2]);
} else if ((ringsArray[_local6][_local5].mC._currentframe == 11) or (ringsArray[_local6 + 1][_local2].mC._currentframe == 11)) {
putInGroup(ringsArray[_local6][_local5], ringsArray[_local6 + 1][_local2]);
}
}
_local2++;
}
}
_local5++;
}
_local6++;
}
var _local12 = 0;
var _local13 = 0;
var _local9 = false;
var _local11 = 0;
var _local10 = 0;
var _local2 = 0;
while (_local2 < colourGroups.length) {
if (colourGroups[_local2].length >= 3) {
if (_local8 == true) {
}
_local13 = colourGroups[_local2].length;
_local12++;
var _local4 = 0;
while (_local4 < colourGroups[_local2].length) {
if (colourGroups[_local2][_local4].mC._x > 0) {
_local11 = colourGroups[_local2][_local4].mC._x;
_local10 = colourGroups[_local2][_local4].mC._y;
_local9 = true;
}
colourGroups[_local2][_local4].remove();
_local4++;
}
}
_local2++;
}
if (_local12 == 1) {
if (_local9 == true) {
_local9 = false;
var _local14 = inGameScoreMc.attachMovie("points", "points" + starAnims, starAnims + 1000);
_local14._x = _local11;
_local14._y = _local10;
starAnims++;
if (_local13 == 3) {
_local14.txt.pointsTxt.text = 10;
increaseScore(10);
} else if (_local13 == 4) {
_local14.txt.pointsTxt.text = 20;
increaseScore(20);
} else if (_local13 > 4) {
_local14.txt.pointsTxt.text = 50;
increaseScore(30);
}
}
} else if (_local12 > 1) {
if (_local9 == true) {
var _local14 = inGameScoreMc.attachMovie("points", "points" + starAnims, starAnims + 1000);
_local14._x = _local11;
_local14._y = _local10;
starAnims++;
if (_local12 == 2) {
_local14.txt.pointsTxt.text = "X2 BONUS";
increaseScore(200);
} else if (_local12 == 3) {
_local14.txt.pointsTxt.text = "X3 BONUS";
increaseScore(300);
} else if (_local12 == 4) {
_local14.txt.pointsTxt.text = "X4 BONUS";
increaseScore(400);
} else if (_local12 > 4) {
_local14.txt.pointsTxt.text = "SUPER\nBONUS";
increaseScore(1000);
}
}
}
_local6 = 0;
while (_local6 < ringsArray.length) {
var _local5 = 0;
while (_local5 < ringsArray[_local6].length) {
if (ringsArray[_local6][_local5].toKill == true) {
ringsArray[_local6][_local5] = 0;
}
_local5++;
}
_local6++;
}
}
function putInGroupMoving(ball, ball2) {
var _local7 = false;
var _local5;
var _local2 = 0;
while (_local2 < colourGroups.length) {
var _local3 = 0;
while (_local3 < colourGroups[_local2].length) {
if (colourGroups[_local2][_local3] == ball) {
_local7 = true;
_local5 = colourGroups[_local2];
_local3 = colourGroups[_local2].length;
_local2 = colourGroups.length;
}
_local3++;
}
_local2++;
}
if (_local7 == false) {
var _local9 = false;
var _local4 = 0;
while (_local4 < colourGroups[_local2].length) {
if (colourGroups[_local2][_local4] == ball2) {
colourGroups[_local2].push(ball);
stored = true;
}
_local4++;
}
} else {
var _local9 = false;
var _local4 = 0;
while (_local4 < _local5.length) {
if (_local5[_local4] == ball2) {
_local9 = true;
}
_local4++;
}
if (_local9 == false) {
_local5.push(ball2);
stored = true;
}
}
}
function checkForMatchesMoving() {
colourGroups = new Array();
var _local2 = 0;
while (_local2 < ringsArray.length) {
stored = false;
var _local3 = 0;
while (_local3 < ringsArray[_local2].length) {
var _local4 = _local3 + 1;
if (_local4 >= ringsArray[_local2].length) {
_local4 = _local4 - ringsArray[_local2].length;
}
if (ringsArray[_local2][_local3].mC._currentframe == ringsArray[_local2][_local4].mC._currentframe) {
putInGroup(ringsArray[_local2][_local3], ringsArray[_local2][_local4]);
} else if ((ringsArray[_local2][_local3].mC._currentframe == 11) or (ringsArray[_local2][_local4].mC._currentframe == 11)) {
putInGroup(ringsArray[_local2][_local3], ringsArray[_local2][_local4]);
}
if (_local2 < (ringsArray.length - 1)) {
var _local5 = 0;
while (_local5 < ringsArray[_local2 + 1].length) {
var _local7 = anglediff(ringsArray[_local2][_local3].globalAngle, ringsArray[_local2 + 1][_local5].globalAngle);
if (_local7 < 12) {
if (ringsArray[_local2][_local3].mC._currentframe == ringsArray[_local2 + 1][_local5].mC._currentframe) {
putInGroup(ringsArray[_local2][_local3], ringsArray[_local2 + 1][_local5]);
} else if ((ringsArray[_local2][_local3].mC._currentframe == 11) or (ringsArray[_local2 + 1][_local5].mC._currentframe == 11)) {
putInGroup(ringsArray[_local2][_local3], ringsArray[_local2 + 1][_local5]);
}
}
_local5++;
}
}
_local3++;
}
_local2++;
}
var _local5 = 0;
while (_local5 < colourGroups.length) {
if (colourGroups[_local5].length >= 3) {
var _local8 = false;
var _local6 = 0;
while (_local6 < colourGroups[_local5].length) {
if (ringType == colourGroups[_local5][_local6].ringNumber) {
_local8 = true;
break;
}
_local6++;
}
if (_local8 == true) {
_local6 = 0;
while (_local6 < colourGroups[_local5].length) {
colourGroups[_local5][_local6].mC.highlightMc.gotoAndStop(2);
_local6++;
}
}
}
_local5++;
}
}
function mainLoop() {
if (gameState == "play") {
if (ballsDropping == false) {
var _local6 = rt.Useful1.pointTowards(gameWindowWidth / 2, movieHeight / 2, rt._xmouse, rt._ymouse);
mouseRotation = _local6.spriteRotation;
if (rt.mouseButton == true) {
if (dragBalls == false) {
var _local3 = 0;
while (_local3 < ringsArray.length) {
var _local2 = 0;
while (_local2 < ringsArray[_local3].length) {
if (ringsArray[_local3][_local2].mC.hitTest(rt._xmouse, rt._ymouse, true)) {
dragBalls = true;
ringType = ringsArray[_local3][_local2].ringNumber;
break;
}
_local2++;
}
_local3++;
}
}
if (dragBalls == true) {
ballRot = mouseRotation - mouseRotationOld;
if (mouseRotation > mouseRotationOld) {
rotateClockWise(ballRot, ringType - 1);
} else if (mouseRotation < mouseRotationOld) {
rotateAntiClockWise(ballRot, ringType - 1);
}
var _local3 = 0;
while (_local3 < ringsArray.length) {
var _local2 = 0;
while (_local2 < ringsArray[_local3].length) {
ringsArray[_local3][_local2].mC.highlightMc.gotoAndStop(1);
_local2++;
}
_local3++;
}
checkForMatchesMoving();
}
} else if (rt.mouseButtonUp == true) {
rt.mouseButtonUp = false;
if (dragBalls == true) {
lockToSlot();
dragBalls = false;
checkForMatches();
checkForHoles();
}
} else {
if (holesFound == true) {
holesFound = false;
checkForMatches();
checkForHoles();
}
checkForNewLevel();
}
}
mouseRotationOld = mouseRotation;
}
var _local4 = false;
var _local3 = 0;
while (_local3 < ringsArray.length) {
var _local2 = 0;
while (_local2 < ringsArray[_local3].length) {
if (ringsArray[_local3][_local2].toKill == true) {
ringsArray[_local3][_local2] = 0;
} else {
ringsArray[_local3][_local2].mainLoop(_local3);
}
if (ringsArray[_local3][_local2].dropping == true) {
if (ringsArray[_local3][_local2].toKill == false) {
_local4 = true;
}
}
_local2++;
}
_local3++;
}
runEdgeBalls();
_local3 = 0;
while (_local3 < scoreArray.length) {
scoreArray[_local3].mainLoop();
_local3++;
}
_local3 = 0;
while (_local3 < edgeRingsMovingArray.length) {
if (edgeRingsMovingArray[_local3].toKill == true) {
edgeRingsMovingArray.splice(_local3, 1);
} else {
edgeRingsMovingArray[_local3].mainLoop();
}
_local3++;
}
if (_local4 == false) {
if (ballsDropping == true) {
holesFound = false;
ballsDropping = false;
checkForMatches();
checkForHoles();
}
}
rt.Player.mainLoop();
var _local5 = rt.Useful1.getDistance(rt._xmouse, rt._ymouse, gameWindowWidth / 2, movieHeight / 2);
if ((_local5 > 240) and (_local5 < 280)) {
turnOnTip(1);
if (rt.mouseButton == true) {
edgeBallsRelease = 1;
}
} else {
turnOffTip();
}
}
function turnOnTip(tipType) {
if (tip == false) {
tip = true;
rt.mousePointer.attachMovie("tipsMc", "tipMc", 1);
rt.mousePointer.gotoAndStop(tipType);
}
}
function turnOffTip() {
if (tip == true) {
tip = false;
rt.mousePointer.tipMc.removeMovieClip();
}
}
function pauseOn() {
pauseSwitch = true;
gameState = "pause";
pauseMc = inGameMc.attachMovie("pauseMc", "pauseMc", 3);
}
function pauseOff() {
pauseSwitch = false;
gameState = "play";
pauseMc.removeMovieClip();
}
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 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);
}
}
Symbol 406 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 407 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 408 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 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 362 Button
on (release) {
gotoAndStop ("show_mj_anim");
}
Symbol 372 MovieClip Frame 1
this._visible = false;
Symbol 374 Button
on (release) {
_root.MindJoltSponsoredAPI.openLink(1);
}
Symbol 393 MovieClip Frame 38
stop();
Symbol 395 MovieClip Frame 1
_parent.stop();
Symbol 395 MovieClip Frame 54
mindlogo.stop();
Symbol 395 MovieClip Frame 60
mindlogo.play();
Symbol 395 MovieClip Frame 177
_parent.play();
stop();