Frame 1
stop();
MochiAd.showPreGameAd({id:"da782eae6b604dae", res:"600x450"});
mochi.MochiServices.connect("da782eae6b604dae");
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__("e672998c", this, 10301, true);
Frame 5
stop();
Stage.showMenu = false;
var KONGREGATE = false;
var FWG = false;
var urlStart = (_url.indexOf("://") + 3);
var urlEnd = _url.indexOf("/", urlStart);
var domain = _url.substring(urlStart, urlEnd);
var LastDot = (domain.lastIndexOf(".") - 1);
var domEnd = (domain.lastIndexOf(".", LastDot) + 1);
domain = domain.substring(domEnd, domain.length);
var musicOn = true;
var sfxOn = true;
var speedUpFlag = true;
var speedDownFlag = true;
var lightningFlag = true;
var netFlag = true;
var triggerFlag = true;
var magnetismFlag = true;
var shieldFlag = false;
var superSpawnFlag = true;
var superCrystalsFlag = true;
var rotationFlag = true;
var nonUniformDropSpeedFlag = true;
var shakyMotionFlag = true;
var wavyMotionFlag = true;
var pacmanFlag = true;
var matrixFlag = true;
var tetrisFlag = true;
var symmetryFlag = true;
var snakeFlag = true;
var planesFlag = true;
var robotsFlag = true;
var tunnelFlag = true;
var arkanoidFlag = false;
var speedUpBaseProb = 400;
var speedDownBaseProb = 400;
var lightningBaseProb = 400;
var netBaseProb = 400;
var triggerBaseProb = 400;
var magnetismBaseProb = 400;
var shieldBaseProb = 400;
var superSpawnBaseProb = 400;
var superCrystalsBaseProb = 400;
var rotationBaseProb = 400;
var nonUniformDropSpeedBaseProb = 400;
var shakyMotionBaseProb = 400;
var wavyMotionBaseProb = 400;
var pacmanBaseProb = 400;
var matrixBaseProb = 400;
var tetrisBaseProb = 400;
var symmetryBaseProb = 400;
var snakeBaseProb = 400;
var planesBaseProb = 400;
var robotsBaseProb = 400;
var tunnelBaseProb = 400;
var arkanoidBaseProb = 400;
var speedUpActProb = 400;
var speedDownActProb = 400;
var lightningActProb = 400;
var netActProb = 400;
var triggerActProb = 400;
var magnetismActProb = 400;
var shieldActProb = 400;
var superSpawnActProb = 400;
var superCrystalsActProb = 400;
var rotationActProb = 400;
var nonUniformDropSpeedActProb = 400;
var shakyMotionActProb = 400;
var wavyMotionActProb = 400;
var pacmanActProb = 400;
var matrixActProb = 400;
var tetrisActProb = 400;
var symmetryActProb = 400;
var snakeActProb = 400;
var planesActProb = 400;
var robotsActProb = 400;
var tunnelActProb = 400;
var arkanoidActProb = 400;
var activeFlags = 7;
var MIN_SPEED = 4;
var MAX_SPEED = 30;
var levelSpeed = 4;
var levelUpSpeedModifier = 1.5;
var levelMinSpeed = 1;
var levelMaxSpeed = 11;
var desiredSpeed = 4;
var baseSpeed = 4;
var freePlayActive = false;
var currentLevel = 0;
var descs = ["", "Speed Up - Game speed is temporarily boosted, if it isn't at a maximum already. Speed affects the point rewards you get for collecting crystals.", "Speed Down - Game slows down temporarily, if speed isn't already at a minimum.", "Lightning - Up to 8 lightning rays emit and destroy objects on stage. A perfectly safe way to earn some points and possibly destroy some hazardous mines.", "Shield - Offers perfect protection from mines for 10 seconds, but doesn't protect against bosses or other enemies.", "Multi Spawn - Spawns a whole lot of crystals of all colors during the next couple of seconds.", "Barrier - Boosts score for all crystals leaving the bottom of the screen for 10 seconds.", "Speed Chaos - Things start moving at different speeds for the next 10 seconds. You get an extra 20% on all point rewards while it lasts.", "Mine Trigger - Safely triggers all mines currently on screen and earns you some points.", "Magnetism - Turns your blob into a crystal magnet for 10 seconds.", "Yellow Super Crystal - Turns all objects on screen into yellow crystals.", "Red Super Crystal - Turns all objects on screen into red crystals.", "Green Super Crystal - Turns all objects on screen into green crystals.", "Wavy Motion - Things start moving in wavy patterns instead of straight. Lasts 10 seconds and gives an extra 20% on all points earned while it lasts.", "Spin - For 10 seconds, things spin around themselves. And you get extra 10% on all points.", "Shaky Motion - Things start shaking, making them harder to pick up or avoid. 10% bonus points for 10 seconds.", "Symmetry - Mines and crystals appear symmetrically on screen. This can create some difficult patterns to navigate, so you get an extra 50% points for all crystals while it lasts.", "Tunnel - Make it safely between narrowing tunnel walls for an extra point reward.", "Pacman - A new take on the classic pacman game.", "1942 - Turns you into a fighter plane and gets you in a dogfight.", "...these are just some of the powerups. There are plenty more to be found in the game, as well as four different bosses. Happy playing!"];
var tunes = ["groundcontrol", "dreamland2", "Sonic03"];
var curTrack = 0;
var currentTrack = "Sonic03";
var trackLap = 0;
var fadeOutInterval;
if (_root.music_mc == undefined) {
var music_mc = _root.createEmptyMovieClip("music_mc", _root.getNextHighestDepth());
var music = new Sound(_root.music_mc);
var sfx_mc = _root.createEmptyMovieClip("sfx_mc", _root.getNextHighestDepth());
var sfx = new Sound(_root.sfx_mc);
}
getNextTrack = function () {
if (_root.curTrack >= _root.tunes.length) {
_root.curTrack = 0;
}
_root.currentTrack = _root.tunes[_root.curTrack];
_root.curTrack++;
};
fadeOut = function () {
var _local2 = _root.music.getVolume();
if (_local2 > 0) {
_local2--;
_root.music.setVolume(_local2);
} else {
clearInterval(_root.fadeOutInterval);
delete _root.music.onSoundComplete;
_root.trackLap = 0;
_root.getNextTrack();
_root.playCurrentTrack();
}
};
playCurrentTrack = function () {
_root.music.stop();
if (_root.musicOn) {
_root.music.setVolume(100);
_root.music.attachSound(_root.currentTrack);
_root.music.start(0, 1);
_root.music.onSoundComplete = function () {
if (_root.bossOneActive) {
_root.playMusic("lovebirds", 999, false);
} else if (_root.bossTwoActive) {
_root.playMusic("attack", 999, false);
} else if (_root.bossThreeActive) {
_root.playMusic("snap", 999, false);
} else if (_root.bossFourActive) {
_root.playMusic("dreamonmarco", 999, false);
} else {
_root.trackLap++;
_root.music.start(0, 1);
if (_root.trackLap == 8) {
clearInterval(_root.fadeOutInterval);
_root.fadeOutInterval = setInterval(_root, "fadeOut", 60);
_root.music.onSoundComplete = function () {
clearInterval(_root.fadeOutInterval);
delete _root.music.onSoundComplete;
_root.trackLap = 0;
_root.getNextTrack();
_root.playCurrentTrack();
};
}
}
};
}
};
playMusic = function (s, loops, getNext) {
_root.music.stop();
if (_root.musicOn) {
_root.music.attachSound("" + s);
var _local2 = 0;
if ((s != "dreamonmarco") && (s != "snap")) {
_local2 = 0.05;
}
_root.music.start(_local2, loops);
if (getNext) {
_root.music.onSoundComplete = function () {
if (_root.musicOn) {
_root.music.attachSound(_root.tunes[random(_root.tunes.length)]);
_root.music.start(0, 1);
}
};
}
}
};
playSFX = function (s, v) {
if (_root.sfxOn) {
if (v == undefined) {
_root.sfx.setVolume(100);
} else {
_root.sfx.setVolume(v);
}
_root.sfx.attachSound(s);
_root.sfx.start(0, 1);
}
};
toggleMainMenuButtons = function (active) {
if (_root._currentframe == "5") {
_root.mainMenu.startGameButton.enabled = active;
_root.mainMenu.startGameButton._visible = active;
_root.mainMenu.creditsButton.enabled = active;
_root.mainMenu.creditsButton._visible = active;
} else if (_root._currentframe == "10") {
_root.gamePausedScreen._x = ((active == true) ? 300 : -475);
_root.gamePausedScreen.newGameButton.enabled = active;
_root.gamePausedScreen.settingsButton.enabled = active;
_root.gamePausedScreen.creditsButton.enabled = active;
_root.gamePausedScreen.resumeButton.enabled = active;
}
};
mainMenu.startGameButton.filters = [new flash.filters.GlowFilter(12320699, 0.8, 10, 10, 2, 3, false, false)];
mainMenu.creditsButton.filters = [new flash.filters.GlowFilter(12320699, 0.8, 10, 10, 2, 3, false, false)];
mainMenu.startGameButton.onRollOver = (mainMenu.creditsButton.onRollOver = function () {
_root.playSFX("menuRollOver");
this.filters = [new flash.filters.GlowFilter(13434828, 1, 15, 15, 2, 3, false, false)];
});
mainMenu.startGameButton.onRollOut = (mainMenu.creditsButton.onRollOut = (mainMenu.startGameButton.onReleaseOutside = (mainMenu.creditsButton.onReleaseOutside = function () {
this.filters = [new flash.filters.GlowFilter(12320699, 0.8, 10, 10, 2, 3, false, false)];
})));
mainMenu.startGameButton.onRelease = function () {
_root.toggleMainMenuButtons(false);
_root.playModeScreen._x = 300;
};
mainMenu.creditsButton.onRelease = function () {
_root.toggleMainMenuButtons(false);
_root.creditsScreen._x = 300;
_root.creditsScreen._y = 305.7;
};
creditsScreen.backButton.onRollOver = function () {
_root.playSFX("menuRollOver");
};
creditsScreen.backButton.onRelease = function () {
if (_root._currentframe == 5) {
_root.creditsScreen._x = 855;
_root.toggleMainMenuButtons(true);
} else {
_root.creditsScreen._x = 855;
_root.gamePausedScreenCampaign._x = 300;
}
};
helpScreen.backButton.onRollOver = function () {
_root.playSFX("menuRollOver");
};
helpScreen.backButton.onRelease = function () {
_root.helpScreen._x = -475;
_root.gamePausedScreenCampaign._x = 300;
};
_root.playMusic("Sonic06", 999, false);
var i = 0;
while (i < 100) {
_root.particle.duplicateMovieClip("particle" + i, _root.getNextHighestDepth());
i++;
}
_root.frameNoGui.swapDepths(_root.getNextHighestDepth());
delete _root.onEnterFrame;
Instance of Symbol 325 MovieClip [particle] "particle" in Frame 5
onClipEvent (load) {
this._alpha = random(80) + 15;
this._width = (this._height = random(3) + 2);
initY = 450 + random(4);
initX = -200 + random(1000);
this._y = initY;
this._x = initX;
fall_speed = 1 + (Math.random() * 5);
k = -3.14159265358979 + (Math.random() * Math.PI);
rad = 0;
centerX = 300;
centerY = 225;
}
onClipEvent (enterFrame) {
rad = rad + ((k / 180) * Math.PI);
this._x = this._x + (Math.cos(rad) + ms);
this._y = this._y - fall_speed;
ms = (centerX - _root._xmouse) / 300;
if (this._y < 0) {
this._y = 450 + random(4);
this._x = -200 + random(1000);
if (Math.random() < 0.5) {
this._x = _root.thing._x;
this._y = _root.thing._y - 10;
}
}
if (this._x > 800) {
this._y = 450 + random(4);
this._x = -200 + random(1000);
}
if (this._x < -200) {
this._y = 450 + random(4);
this._x = -200 + random(1000);
}
}
Frame 10
stop();
var cr = new Array();
var crc = 0;
var pc = new Array();
var lig = new Array();
var ef = new Array();
var cr_queue = new Array();
var playerScore = 0;
var hiscorePerSecond = 0;
var playerLives = 5;
var baseSpeed = 1;
var baseSpeedStr = "00.00";
var textSpeed = 1;
var crystalspeed = 1;
var minSpawnCrystalChance = 5;
var spawnCrystalChance = 5;
var rE = 578;
var lE = 22;
var tE = 22;
var bE = 424;
var gamePaused = false;
var gameStartTime = getTimer();
var pauseTime = 0;
var gameThen = getTimer();
var timestring = "00:00:00";
var magnetismActive = false;
var magnetismActiveTime = 0;
var netActive = false;
var netActiveTime = 0;
var shieldActive = false;
var shieldActiveTime = 0;
var wavyMotionActive = false;
var wavyMotionTime = 0;
var shakyMotionActive = false;
var shakyMotionTime = 0;
var rotationActive = false;
var rotationTime = 0;
var nonUniformDropSpeedActive = false;
var nonUniformDropSpeedTime = 0;
var pacmanActive = false;
var pacmanTime = 0;
var matrixActive = false;
var matrixTime = 0;
var tetrisActive = false;
var tetrisTime = 0;
var symmetryActive = false;
var symmetryTime = 0;
var symmetrySwitch = false;
var snakeActive = false;
var snakeTime = 0;
var planesActive = false;
var planesTime = 0;
var robotsActive = false;
var robotsTime = 0;
var tunnelActive = false;
var tunnelTime = 0;
var arkanoidActive = false;
var arkanoidTime = 0;
var bossOneActive = false;
var bossTwoActive = false;
var bossThreeActive = false;
var bossFourActive = false;
var thingMinWidth = 17;
var levelInterval = 0;
var clockInterval = 0;
var speedStrInterval = 0;
var hours = 0;
var minutes = 0;
var seconds = 0;
var tuteBox = 0;
var tuteBoxOn = false;
var k = 0;
var keyListener = new Object();
var hours = 0;
var minutes = 0;
var seconds = 0;
var sq = Math.sqrt;
var po = Math.pow;
var ab = Math.abs;
var ro = Math.round;
var sin = Math.sin;
var cos = Math.cos;
var powerUpsEnabled = 0;
var speedUpFast = true;
var kongr_bossOneKilled = false;
var kongr_bossTwoKilled = false;
var kongr_bossThreeKilled = false;
var kongr_bossFourKilled = false;
var pp = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24];
var poC = 0;
updateScoresOnKongregate = function () {
if (!_root.freePlayActive) {
_root.kongregateStats.submit("points", _root.playerScore);
_root.kongregateStats.submit("boss1", ((_root.kongr_bossOneKilled == true) ? 1 : 0));
_root.kongregateStats.submit("boss2", ((_root.kongr_bossTwoKilled == true) ? 1 : 0));
_root.kongregateStats.submit("boss3", ((_root.kongr_bossThreeKilled == true) ? 1 : 0));
_root.kongregateStats.submit("boss4", ((_root.kongr_bossFourKilled == true) ? 1 : 0));
}
};
shuffleResetAr = function () {
var _local2 = 0;
while (_local2 < 200) {
var _local4 = random(25);
var _local3 = random(25);
var _local5 = _root.pp[_local4];
_root.pp[_local4] = _root.pp[_local3];
_root.pp[_local3] = _local5;
_local2++;
}
};
getOpenPos = function () {
var _local2 = 33 + (22 * _root.pp[_root.poC]);
_root.poC++;
if (_root.poC >= 24) {
_root.shuffleResetAr();
_root.poC = 0;
}
return(_local2);
};
initPausedScreenFunctionsCamp = function () {
_root.gamePausedScreenCampaign.yea1.newGameButton.onRollOver = (_root.gamePausedScreenCampaign.yea1.helpButton.onRollOver = (_root.gamePausedScreenCampaign.yea1.creditsButton.onRollOver = (_root.gamePausedScreenCampaign.yea1.optionsButton.onRollOver = (_root.gamePausedScreenCampaign.yea1.resumeButton.onRollOver = function () {
_root.playSFX("menuRollOver");
this.filters = [new flash.filters.GlowFilter(12303359, 1, 6, 6, 2, 3, false, false)];
}))));
_root.gamePausedScreenCampaign.yea1.newGameButton.onRollOut = (_root.gamePausedScreenCampaign.yea1.helpButton.onRollOut = (_root.gamePausedScreenCampaign.yea1.creditsButton.onRollOut = (_root.gamePausedScreenCampaign.yea1.optionsButton.onRollOut = (_root.gamePausedScreenCampaign.yea1.resumeButton.onRollOut = (_root.gamePausedScreenCampaign.yea1.newGameButton.onReleaseOutside = (_root.gamePausedScreenCampaign.yea1.helpButton.onReleaseOutside = (_root.gamePausedScreenCampaign.yea1.optionsButton.onReleaseOutside = (_root.gamePausedScreenCampaign.yea1.creditsButton.onReleaseOutside = (_root.gamePausedScreenCampaign.yea1.resumeButton.onReleaseOutside = function () {
this.filters = [];
})))))))));
_root.gamePausedScreenCampaign.yea1.newGameButton.onRelease = function () {
_root.gamePausedScreenCampaign._x = -475;
delete _root.frame.update;
_root.gotoAndStop("gameOver");
};
_root.gamePausedScreenCampaign.yea1.helpButton.onRelease = function () {
_root.gamePausedScreenCampaign._x = -475;
_root.helpScreen._x = 300;
_root.helpScreen._y = 225;
_root.helpScreen._alpha = 80;
_root.helpScreen.swapDepths(_root.getNextHighestDepth());
};
_root.gamePausedScreenCampaign.yea1.optionsButton.onRelease = function () {
_root.gamePausedScreenCampaign._x = -475;
_root.optionsScreen._x = 300;
_root.optionsScreen._y = 250;
_root.optionsScreen._alpha = 80;
_root.optionsScreen.swapDepths(_root.getNextHighestDepth());
};
_root.gamePausedScreenCampaign.yea1.creditsButton.onRelease = function () {
_root.gamePausedScreenCampaign._x = -475;
_root.creditsScreen._x = 300;
_root.creditsScreen._y = 250;
_root.creditsScreen.filters = [new flash.filters.GlowFilter(16777215, 1, 10, 10, 3, 3, false, false)];
_root.creditsScreen._alpha = 80;
_root.creditsScreen.swapDepths(_root.getNextHighestDepth());
};
_root.gamePausedScreenCampaign.yea1.resumeButton.onRelease = function () {
_root.toggleMainMenuButtons(false);
_root.gamePausedScreenCampaign._x = -475;
_root.gamePaused = false;
Mouse.hide();
};
};
makeBubbleBurst = function () {
};
makePausedScreen = function () {
if (_root.gamePausedScreenCampaign == undefined) {
var _local2 = _root.createEmptyMovieClip("gamePausedScreenCampaign", _root.getNextHighestDepth());
_local2.attachMovie("gamePausedScreenCampaign", "yea1", _local2.getNextHighestDepth());
_local2._x = -475;
_local2._y = 250;
_local2._alpha = 80;
_root.initPausedScreenFunctionsCamp();
}
};
toggleSFX = function (st) {
if (st) {
} else {
_root.sfx.stop();
}
};
toggleMusic = function (st) {
if (st) {
if (_root.bossOneActive) {
_root.playMusic("lovebirds", 9999, false);
} else if (_root.bossTwoActive) {
_root.playMusic("attack", 999, false);
} else if (_root.bossThreeActive) {
_root.playMusic("snap", 999, false);
} else if (_root.bossFourActive) {
_root.playMusic("dreamonmarco", 999, false);
} else {
_root.playCurrentTrack();
}
} else {
_root.music.stop();
}
};
playPowerupSound = function () {
_root.playSFX("powerupshort" + (1 + random(3)));
};
df = function (nu, tr) {
var _local2 = _root.po(10, tr);
var _local3 = _root.ro(nu * _local2) / _local2;
return(_local3);
};
updateDesiredSpeed = function (mo) {
_root.desiredSpeed = _root.desiredSpeed + mo;
if (_root.desiredSpeed < _root.levelMinSpeed) {
_root.desiredSpeed = _root.levelMinSpeed;
}
if (_root.desiredSpeed > _root.levelMaxSpeed) {
_root.desiredSpeed = _root.levelMaxSpeed;
}
if (_root.desiredSpeed < _root.MIN_SPEED) {
_root.desiredSpeed = _root.MIN_SPEED;
}
if (_root.desiredSpeed > _root.MAX_SPEED) {
_root.desiredSpeed = _root.MAX_SPEED;
}
};
updateSpeed = function () {
var _local3 = 120;
var _local2 = 12;
if (!_root.speedUpFast) {
_local3 = 12;
_local2 = 120;
}
if (_root.desiredSpeed > _root.levelSpeed) {
_root.desiredSpeed = _root.desiredSpeed - ((_root.desiredSpeed - _root.levelSpeed) / _local3);
} else if (_root.desiredSpeed < _root.levelSpeed) {
_root.desiredSpeed = _root.desiredSpeed + ((_root.levelSpeed - _root.desiredSpeed) / _local2);
}
if (_root.baseSpeed > _root.desiredSpeed) {
_root.baseSpeed = _root.baseSpeed - ((_root.baseSpeed - _root.desiredSpeed) / _local3);
} else if (_root.baseSpeed < _root.desiredSpeed) {
_root.baseSpeed = _root.baseSpeed + ((_root.desiredSpeed - _root.baseSpeed) / _local2);
}
};
thingCopyUpdate = function () {
this.thing.shield._visible = _root.shieldActive;
this.thing.pacman._visible = _root.pacmanActive;
this.thing.blueThing._visible = _root.thing.blueThing._visible;
var _local5 = getTimer();
var _local4 = _local5 - this.then;
this.then = _local5;
if (_root.snakeActive) {
this.thing.snakeSkin._visible = true;
var _local3 = 2 * (_local4 / 30);
this._width = this._width * 0.98;
} else {
this.thing.snakeSkin._visible = false;
var _local3 = 4 * (_local4 / 30);
this._width = this._width * 0.95;
}
if (_local3 > 20) {
var _local3 = 20;
}
this._y = this._y + _local3;
this._height = this._width;
this._alpha = this._alpha - _local3;
if (this._alpha <= 0) {
this.remove = true;
}
};
makeThingCopy = function (xx, yy, ww) {
_root.crc++;
var _local2 = _root.createEmptyMovieClip("tc" + _root.crc, _root.getNextHighestDepth());
var _local3 = _local2.attachMovie("thingWSnake", "thing", _local2.getNextHighestDepth());
_local2.thing.shield._visible = _root.thing.shield._visible;
_local2.thing.pacman._visible = _root.thing.pacman._visible;
_local2.thing.blueThing._visible = _root.thing.blueThing._visible;
_local2.thing.snakeSkin._visible = _root.snakeActive;
_local2._x = xx;
_local2._y = yy;
if (_root.snakeActive) {
_local2._y = _local2._y + 10;
}
_local2.cpy = true;
_local2._alpha = 50;
_local2._width = (_local2._height = ww - 2);
_local2.then = getTimer();
_local2.update = _root.thingCopyUpdate;
_local2.swapDepths(_root.thing);
_root.ef.push(_local2);
};
thingUpdateORIG = function () {
var _local5 = this._width - this.desiredWidth;
this._width = this._width - (_local5 / 24);
this._height = this._height - (_local5 / 24);
var _local7 = this._x - _xmouse;
var _local8 = this._y - _ymouse;
var _local4 = ((18 - _root.baseSpeed) * 0.3529) + 2;
this._x = this._x - (_local7 / _local4);
this._y = this._y - (_local8 / _local4);
var _local6 = getTimer();
var _local3 = _local6 - this.then;
this.then = _local6;
if (_local3 > 100) {
_local3 = 10;
} else {
this.shrink = this.shrink + _local3;
if (this.shrink > 1000) {
this.shrink = 0;
if (this._width > _root.thingMinWidth) {
this.desiredWidth = this.desiredWidth * 0.95;
}
}
}
_root.makeThingCopy(this._x, this._y, this._width);
if ((this._x + (this._width / 2)) > _root.rE) {
this._x = _root.rE - (this._width / 2);
} else if ((this._x - (this._width / 2)) < _root.lE) {
this._x = _root.lE + (this._width / 2);
}
if ((this._y + (this._height / 2)) > _root.bE) {
this._y = _root.bE - (this._height / 2);
} else if (this._y < (_root.tE + (this._height / 2))) {
this._y = _root.tE + (this._height / 2);
}
};
thingUpdate = function () {
var _local4 = this._x - _xmouse;
var _local5 = this._y - _ymouse;
var _local3 = 2;
this._x = this._x - (_local4 / _local3);
this._y = this._y - (_local5 / _local3);
if ((this._x + (this._width / 2)) > _root.rE) {
this._x = _root.rE - (this._width / 2);
} else if ((this._x - (this._width / 2)) < _root.lE) {
this._x = _root.lE + (this._width / 2);
}
if ((this._y + (this._height / 2)) > _root.bE) {
this._y = _root.bE - (this._height / 2);
} else if (this._y < (_root.tE + (this._height / 2))) {
this._y = _root.tE + (this._height / 2);
}
};
thingShotUpdate = function () {
var _local5 = getTimer();
var _local4 = _local5 - this.then;
if (_local4 > 100) {
_local4 = 10;
}
this.then = _local5;
this._y = this._y - ((10 * _local4) / 30);
if (this._y < -20) {
this.remove = true;
}
for (var _local3 in _root.cr) {
if (_root.cr[_local3].fighter == true) {
if (_root.cr[_local3].hitTest(this._x, this._y - 15, true)) {
this.remove = true;
_root.cr[_local3].hitpoints--;
}
}
}
};
makeThingShot = function (xx, yy, ww) {
var _local2 = _root.createEmptyMovieClip("ps" + _root.crc, _root.getNextHighestDepth());
var _local3 = _local2.attachMovie("thingShot", "ps", _local2.getNextHighestDepth());
_local2._x = xx;
_local2._y = yy;
_local2.cpy = true;
_local2.then = getTimer();
_local2.update = _root.thingShotUpdate;
_root.ef.push(_local2);
};
thingAlternativeUpdate = function () {
var _local5 = this._x - _xmouse;
var _local6 = this._y - _ymouse;
var _local3 = ((18 - _root.baseSpeed) * 0.3529) + 2;
this._x = this._x - (_local5 / _local3);
this._y = this._y - (_local6 / _local3);
var _local4 = getTimer();
var _local7 = _local4 - this.then;
if (_local7 > 80) {
_root.makeThingShot(this._x, this._y, this._width);
this.then = _local4;
}
if ((this._x + (this._width / 2)) > _root.rE) {
this._x = _root.rE - (this._width / 2);
} else if ((this._x - (this._width / 2)) < _root.lE) {
this._x = _root.lE + (this._width / 2);
}
if ((this._y + (this._height / 2)) > _root.bE) {
this._y = _root.bE - (this._height / 2);
} else if (this._y < (_root.tE + (this._height / 2))) {
this._y = _root.tE + (this._height / 2);
}
};
frame.update = function () {
this.swapDepths(_root.getNextHighestDepth() - 1);
};
showSpark = function (x, y) {
_root.crc++;
var _local4;
if ((random(10) % 2) == 0) {
_local4 = "spark2";
} else {
_local4 = "spark3";
}
var _local3 = this.attachMovie("" + _local4, "sp" + _root.crc, this.getNextHighestDepth());
_local3._x = x;
_local3._y = y;
_local3._alpha = 20;
_local3._xscale = 50 + random(100);
_local3._yscale = _local3._xscale;
_local3.update = function () {
this._alpha = this._alpha - 0.1;
if (this._alpha <= 0) {
this.remove = true;
}
};
_root.ef.push(_local3);
};
showSmallSign = function (s) {
_root.playSFX("message");
_root.crc++;
var _local5 = _root.createEmptyMovieClip("aSmallSign" + _root.crc, _root.getNextHighestDepth());
var _local3 = _local5.createTextField("b", _local5.getNextHighestDepth(), 450, 400, 200, 50);
var _local4 = new TextFormat();
_local4.color = 16777215 /* 0xFFFFFF */;
_local4.size = 16;
_local4.font = "MagistralC-Bold";
if (_root.planesActive) {
_local4.color = 0;
}
_local3.selectable = false;
_local3.multiline = true;
_local3.wordWrap = true;
_local3.autoSize = true;
_local4.align = "center";
_local3.text = "" + s;
_local3.antiAliasType = "advanced";
_local3.embedFonts = true;
_local3.setTextFormat(_local4);
_local3._x = 450 - (_local3._width / 2);
_local3._y = 400 - (_local3._height / 2);
_local5.update = function () {
this._y = this._y - (_root.textSpeed / 20);
this._alpha = this._alpha - 0.1;
if (this._alpha <= 0) {
this.remove = true;
}
};
_root.ef.push(_local5);
};
showBigSign = function (s, bossFour) {
_root.playSFX("message");
_root.crc++;
var _local5 = _root.createEmptyMovieClip("aSign" + _root.crc, _root.getNextHighestDepth());
var _local3 = _local5.createTextField("b", _local5.getNextHighestDepth(), 300, 200, 400, 50);
var _local4 = new TextFormat();
_local4.color = 16777215 /* 0xFFFFFF */;
_local4.size = 26;
_local4.font = "MagistralC-Bold";
if (_root.planesActive) {
_local4.color = 0;
}
_local3.selectable = false;
_local3.multiline = true;
_local3.wordWrap = true;
_local3.autoSize = true;
_local4.align = "center";
_local3.text = "" + s;
_local3.antiAliasType = "advanced";
_local3.embedFonts = true;
_local3.setTextFormat(_local4);
_local3._x = 300 - (_local3._width / 2);
_local3._y = 200 - (_local3._height / 2);
_local5.bossFour = bossFour;
_local5.update = function () {
this._y = this._y - (_root.textSpeed / 20);
this._alpha = this._alpha - 0.1;
if (this._alpha <= 0) {
this.remove = true;
if (this.bossFour == true) {
_root.onEnterFrame = _root.main;
}
}
};
_root.ef.push(_local5);
};
showText = function (s, x, y) {
_root.crc++;
var _local5 = _root.createEmptyMovieClip("aText" + _root.crc, _root.getNextHighestDepth());
var _local3 = _local5.createTextField("b", _local5.getNextHighestDepth(), x, y, 100, 40);
var _local4 = new TextFormat();
_local4.color = 15663069 /* 0xEEFFDD */;
_local4.size = 12;
_local4.font = "MagistralC-Bold";
_local3.selectable = false;
_local3.autoSize = true;
_local3.text = "" + s;
_local3.antiAliasType = "advanced";
_local3.embedFonts = true;
_local3.setTextFormat(_local4);
_local3._x = _local3._x - (_local3._width / 2);
if ((_local3._x + _local3._width) > _root.rE) {
_local3._x = _root.rE - _local3._width;
}
_local5.update = function () {
this._y = this._y - _root.textSpeed;
this._alpha = this._alpha - 2;
if (this._alpha <= 0) {
this.remove = true;
}
};
_root.ef.push(_local5);
};
showScore = function (sc, x, y) {
var _local6 = 1;
if (_root.shakyMotionActive) {
_local6 = _local6 + 0.1;
}
if (_root.wavyMotionActive) {
_local6 = _local6 + 0.2;
}
if (_root.rotationActive) {
_local6 = _local6 + 0.1;
}
if (_root.speedChaosActive) {
_local6 = _local6 + 0.2;
}
if (_root.symmetryActive) {
_local6 = _local6 + 0.5;
}
_root.playerScore = _root.playerScore + sc;
if (_root.playerScore < 0) {
_root.playerScore = 0;
}
_root.crc++;
var _local5 = _root.createEmptyMovieClip("aScore" + _root.crc, _root.getNextHighestDepth());
var _local3 = _local5.createTextField("b", _local5.getNextHighestDepth(), x, y, 100, 40);
var _local4 = new TextFormat();
if (sc > 0) {
_local4.color = 15663069 /* 0xEEFFDD */;
} else {
_local4.color = 16755370 /* 0xFFAAAA */;
}
if (_root.planesActive) {
_local4.color = 0;
}
_local4.size = 12;
_local4.font = "MagistralC-Bold";
_local3.text = "" + sc;
_local3.selectable = false;
_local3.autoSize = true;
_local3.antiAliasType = "advanced";
_local3.embedFonts = true;
_local3.setTextFormat(_local4);
_local3._x = _local3._x - (_local3._width / 2);
if ((_local3._x + _local3._width) > _root.rE) {
_local3._x = _root.rE - _local3._width;
}
if (!_root.planesActive) {
_local5.update = function () {
this._y = this._y - _root.textSpeed;
this._alpha = this._alpha - 1;
if (this._alpha <= 0) {
this.remove = true;
}
};
} else {
_local5.update = function () {
this._y = this._y - _root.textSpeed;
if (this.counter == undefined) {
this.counter = 0;
}
this.counter++;
if (this.counter > 80) {
this.remove = true;
}
};
}
_root.ef.push(_local5);
};
assignScalingVars = function (t) {
t.sumax = 100 + random(30);
t.sumin = 90 - random(20);
t.susp = 2 + random(2);
t.su = (((random(10) % 2) == 0) ? true : false);
if (t.su) {
t._xscale = t.sumin;
t._yscale = t.sumin;
} else {
t._xscale = t.sumax;
t._yscale = t.sumax;
}
};
timeMove = function () {
if (!this.lightning) {
if (!this.ghost) {
if ((random(10) % 2) == 0) {
if (this.su) {
if (this._xscale < this.sumax) {
this._xscale = this._xscale + this.susp;
this._yscale = this._yscale + this.susp;
} else {
this.su = false;
}
} else if (this._xscale > this.sumin) {
this._xscale = this._xscale - this.susp;
this._yscale = this._yscale - this.susp;
} else {
this.su = true;
}
}
}
}
var _local4 = getTimer();
var _local3 = _local4 - this.then;
if (_local3 > 100) {
_local3 = 10;
}
this.then = _local4;
var _local5 = ((this.speed + _root.baseSpeed) * _local3) / 30;
this._y = this._y + _local5;
if (this.rad == undefined) {
this.rad = 0;
}
if (!this.lightning) {
if (_root.nonUniformDropSpeedActive) {
if (this.speed == 1) {
this.speed = (1 + random(3)) + (random(1000) / 1000);
}
} else {
this.speed = 1;
}
if (_root.rotationActive) {
if (this.rotsp == undefined) {
this.rotsp = 1 + random(4);
if ((random(10) % 2) == 0) {
this.rotsp = this.rotsp * -1;
}
}
this._rotation = this._rotation + this.rotsp;
}
if (_root.wavyMotionActive) {
k = 1;
if (this.dir == undefined) {
this.dir = random(10) % 2;
}
this.rad = this.rad + ((k / 180) * Math.PI);
if (this.dir == 0) {
this._x = this._x - _root.cos(this.rad);
} else {
this._x = this._x + _root.cos(this.rad);
}
}
if (_root.shakyMotionActive == true) {
_root.k++;
if (_root.k > 50) {
_root.k = 0;
}
this.rad = this.rad + ((k / 180) * Math.PI);
this._x = this._x - _root.cos(this.rad);
}
}
};
hitPlayer = function (t) {
var _local5 = false;
var _local6 = _root.thing._width / 2;
var _local2 = _root.ab(t._x - _root.thing._x);
var _local4 = _root.ab(t._y - _root.thing._y);
if (_root.magnetismActive) {
if (_local2 < 60) {
if (_local4 < 60) {
t._x = t._x + ((t._x > _root.thing._x) ? ((-_local2) / 12) : (_local2 / 12));
t._y = t._y + ((t._y > _root.thing._y) ? ((-_local2) / 12) : (_local2 / 12));
}
}
}
if (_local2 < _local6) {
if (_local4 < _local6) {
_local5 = true;
}
}
return(_local5);
};
crystalToGembar = function () {
var _local4 = _root.ab(this._x - 300);
var _local6 = _root.ab(this._y - 420);
var _local5 = getTimer();
var _local3 = _local5 - this.then;
if (_local3 > 30) {
_local3 = 30;
}
this.then = _local5;
if (_local4 > 10) {
if (this._x < 300) {
this._x = this._x + ((_local4 / 300) * _local3);
} else {
this._x = this._x - ((_local4 / 300) * _local3);
}
this._y = this._y + ((_local6 / 300) * _local3);
} else {
this.remove = true;
_root.updateGembar(((this.ty == 1) ? 100 : undefined), ((this.ty == 2) ? 100 : undefined), ((this.ty == 3) ? 100 : undefined));
}
};
updateCrystal = function () {
this.timeMove();
if (this._y > 430) {
this.remove = true;
}
var _local3 = _root.ab(this._x - _root.thing._x);
var _local4 = _root.ab(this._y - _root.thing._y);
if (_root.hitPlayer(this) == true) {
_root.playSFX("ting2");
_root.showScore(25, this._x, this._y);
this.update = _root.crystalToGembar;
}
if (random(400) < 1) {
this.showSpark(0, -(this._height / 2));
}
};
decideCrystalSpecialType = function (ty) {
var _local5 = "";
var _local13 = _root.tetrisActive;
var _local14 = _root.pacmanActive;
var _local17 = _root.matrixActive;
var _local15 = _root.snakeActive;
var _local16 = _root.robotsActive;
var _local11 = 0;
var _local9 = 0;
var _local8 = 0;
var _local12 = 0;
var _local10 = 0;
var _local7 = getTimer();
if (_local13) {
_local11 = _local7 - _root.tetrisTime;
}
if (_local17) {
_local8 = _local7 - _root.matrixTime;
}
if (_local14) {
_local9 = _local7 - _root.pacmanTime;
}
if (_local15) {
_local12 = _local7 - _root.snakeTime;
}
if (_local16) {
_local10 = _local7 - _root.robotsTime;
}
var _local3 = [_local11, _local8, _local9, _local12, _local10];
var _local4 = 300000 /* 0x0493E0 */;
var _local6 = -1;
var _local2 = 0;
while (_local2 < 5) {
if (_local3[_local2] < _local4) {
if (_local3[_local2] != 0) {
_local4 = _local3[_local2];
_local6 = _local2;
}
}
_local2++;
}
switch (_local6) {
case -1 :
_local5 = "crystal" + ty;
break;
case 0 :
_local5 = "tetrisBlock" + (random(7) + 1);
break;
case 1 :
_local5 = "matrix" + random(2);
break;
case 2 :
_local5 = "smallPill";
break;
case 3 :
_local5 = "wrigglyWorm";
break;
case 4 :
_local5 = "weather" + (1 + random(6));
break;
}
return(_local5);
};
spawnCrystal = function (ty, xx, yy) {
_root.crc++;
var _local4 = _root.decideCrystalSpecialType(ty);
var _local2 = _root.createEmptyMovieClip("aCrystal" + _root.crc, _root.getNextHighestDepth());
var _local5 = _local2.attachMovie(_local4, _local4, _local2.getNextHighestDepth());
if (_root.pacmanActive) {
ty = 4;
} else if (_root.tetrisActive) {
ty = 5;
} else if (_root.matrixActive) {
ty = 6;
} else if (_root.snakeActive) {
ty = 7;
} else if (_root.robotsActive) {
ty = 8;
}
if (xx != undefined) {
_local2._x = xx;
} else {
_local2._x = _root.getOpenPos();
}
if (yy != undefined) {
_local2._y = yy;
} else {
_local2._y = -20;
}
_local2.ty = ty;
_local2.speed = 1;
_local2.then = getTimer();
_local2.showSpark = _root.showSpark;
_local2.timeMove = _root.timeMove;
_local2.remove = false;
_local2.update = _root.updateCrystal;
_root.assignScalingVars(_local2);
_root.cr.push(_local2);
if (_root.symmetryActive) {
if (_root.symmetrySwitch) {
_root.symmetrySwitch = false;
_root.spawnCrystal(_local2.ty, ((_local2._x >= 300) ? (300 - (_local2._x - 300)) : (600 - _local2._x)), _local2._y);
} else {
_root.symmetrySwitch = true;
}
}
};
getDist = function (x1, y1, x2, y2) {
return(_root.sq(_root.po(x1 - x2, 2) + _root.po(y1 - y2, 2)));
};
updateLightningRay = function () {
this.timeMove();
this._alpha = _root.ro(this._alpha - 1);
if (this._y > 440) {
this.remove = true;
}
};
findClosest = function (t) {
var _local5 = new Array();
_local5.push(t);
var _local4 = _root.cr.length;
if (_local4 == 0) {
return([]);
}
if (_local4 < 8) {
var _local2 = 0;
while (_local2 < _local4) {
if (_root.cr[_local2].hit != true) {
if (_root.cr[_local2].boss != true) {
_root.cr[_local2].hit = true;
_local5.push(_root.cr[_local2]);
}
}
_local2++;
}
} else {
var _local6 = 0;
var _local7 = 0;
while ((_local6 < 8) && (_local7 < 100)) {
var _local3 = random(_local4);
if (_root.cr[_local3].hit != true) {
if (_root.cr[_local3].boss != true) {
_root.cr[_local3].hit = true;
_local5.push(_root.cr[_local3]);
_local6++;
}
}
_local7++;
}
}
return(_local5);
};
lightningStrikeNew = function (t) {
var _local14 = new Array();
t.hit = true;
_local14 = _root.findClosest(t);
_root.crc++;
var _local16 = _root.createEmptyMovieClip("ray" + _root.crc, _root.getNextHighestDepth());
var _local6 = _local16.createEmptyMovieClip("ray", _local16.getNextHighestDepth());
_local6.lineStyle(1, 16777215, 100);
var _local17 = _local14.length;
var _local12 = 1;
while (_local12 < _local17) {
if (_local14[_local12] != undefined) {
if (typeof(_local14[_local12]) == "movieclip") {
var _local13 = _local14[_local12];
var _local5 = _local13._x;
var _local4 = _local13._y;
var _local8 = _local14[0]._x;
var _local7 = _local14[0]._y;
_local13.remove = true;
if (_local13.bomb) {
_root.showExplosion(_local5, _local4, false);
}
if ((_local8 > 10) && (_local7 > 10)) {
var _local15 = _root.getDist(_local5, _local4, _local8, _local7);
if (_local15 < 10) {
_local6.moveTo(_local5, _local4);
_local6.lineTo(_local8, _local7);
} else {
var _local11 = 0;
while (_local11 < (random(2) + 1)) {
var _local3 = _root.ro(_local15 / 10);
if (_local5 != undefined) {
if (_local4 != undefined) {
_local6.moveTo(_local5, _local4);
var _local2 = 0;
while (_local2 < _local3) {
var _local10 = ((((_local2 * _local8) + ((_local3 - _local2) * _local5)) / _local3) + 6) - random(12);
var _local9 = ((((_local2 * _local7) + ((_local3 - _local2) * _local4)) / _local3) + 6) - random(12);
_local6.lineTo(_local10, _local9);
_local2++;
}
_local6.lineTo(_local8, _local7);
}
}
_local11++;
}
}
}
_local6.filters = [new flash.filters.GlowFilter(8947967, 1, 8, 8, 4, 1, false, false)];
_root.showScore(100, _local5, _local4);
}
}
_local12++;
}
_local16.speed = 1;
_local16.then = getTimer();
_local16.timeMove = _root.timeMove;
_local16.remove = false;
_local16.update = _root.updateLightningRay;
_local16.lightning = true;
_root.lig.push(_local16);
_root.playSFX("lightning001");
};
updateLightning = function () {
this.timeMove();
if (this._y > 440) {
this.remove = true;
}
var _local4 = _root.ab(this._x - _root.thing._x);
var _local3 = _root.thing._width / 2;
if (_local4 < _local3) {
var _local5 = _root.ab(this._y - _root.thing._y);
if (_local5 < _local3) {
_root.showText("Lightning", this._x, this._y);
this.remove = true;
_root.lightningStrikeNew(this);
}
}
};
spawnLightning = function () {
_root.crc++;
var _local2 = _root.createEmptyMovieClip("aLightning" + _root.crc, _root.getNextHighestDepth());
var _local3 = _local2.attachMovie("lightning", "lightn", _local2.getNextHighestDepth());
_local2._x = _root.getOpenPos();
_local2._y = -20;
_local2.speed = 1;
_local2.then = getTimer();
_local2.timeMove = _root.timeMove;
_local2.remove = false;
_local2.update = _root.updateLightning;
_root.assignScalingVars(_local2);
_root.cr.push(_local2);
};
updateBossBar = function (perc) {
_root.frame.bossBar.bar._width = 146 * perc;
};
showBossBar = function (vis) {
if (vis) {
_root.updateBossBar(100);
}
_root.frame.bossBar._visible = vis;
};
bossOneShot2Update = function () {
var _local4 = getTimer();
var _local3 = _local4 - this.then;
if (_local3 > 100) {
_local3 = 10;
}
this.then = _local4;
this._x = this._x + (this.xmov * (_local3 / 30));
this._y = this._y + (this.ymov * (_local3 / 30));
this._rotation = this._rotation + 3;
if (this._x < 0) {
this.remove = true;
} else if (this._x > 600) {
this.remove = true;
}
if (this._y < 0) {
this.remove = true;
} else if (this._y > 450) {
this.remove = true;
}
if (_root.ab(this._x - _root.thing._x) < ((this._width + _root.thing._width) / 2)) {
if (_root.ab(this._y - _root.thing._y) < ((this._width + _root.thing._width) / 2)) {
_root.loseOneLife();
this.remove = true;
}
}
};
bossOneShot1Update = function () {
var _local4 = getTimer();
var _local3 = _local4 - this.then;
if (_local3 > 100) {
_local3 = 10;
}
this.then = _local4;
if (this.goingUp) {
this._x = this._x + ((this.upX - this._x) / 10);
this._y = this._y + ((30 - this._y) / 10);
if (_root.ab(this._x - this.upX) < 10) {
if (_root.ab(this._y - 30) < 10) {
this.goingUp = false;
this.goLeft = ((this._x > _root.thing._x) ? true : false);
}
}
} else {
this._y = this._y + (this.speed * (_local3 / 30));
this.speed = this.speed * 1.04;
if (this.goLeft) {
this._x = this._x - ((this._y / 100) * (_local3 / 10));
this._rotation = this._rotation + (this._y / 300);
} else {
this._x = this._x + ((this._y / 100) * (_local3 / 10));
this._rotation = this._rotation - (this._y / 300);
}
}
if (_root.thing.hitTest(this)) {
this.remove = true;
_root.loseOneLife();
}
if (this._y > 470) {
this.remove = true;
}
};
bossOneShoot = function (xx, yy, shotType, shotrot) {
_root.crc++;
var _local4 = "boss4Shot" + shotType;
var _local2 = _root.createEmptyMovieClip("bossShot" + _root.crc, _root.getNextHighestDepth());
var _local5 = _local2.attachMovie("" + _local4, "bs", _local2.getNextHighestDepth());
_local2.cpy = true;
_local2.then = getTimer();
if (shotType == 1) {
_root.playSFX("shoot" + (random(3) + 1));
_local2._x = xx;
_local2._y = yy;
_local2.speed = 6;
_local2.goingUp = true;
_local2.upX = (((random(10) % 2) == 0) ? (xx + 40) : (xx - 40));
if ((_local2.upX > 580) || (_local2.upX < 20)) {
_local2.upX = 20 + random(560);
}
_local2.update = _root.bossOneShot1Update;
} else {
if (random(10) == 1) {
_root.playSFX("ballshoot" + (random(3) + 1));
}
_local2._x = xx + 23;
_local2._y = yy - 30;
_local2.speed = 2;
_local2._rotation = shotrot;
_local2.xmov = _local2.speed * _root.sin(_local2._rotation * (Math.PI/180));
_local2.ymov = _local2.speed * _root.cos(_local2._rotation * (Math.PI/180));
_local2.update = _root.bossOneShot2Update;
}
_root.ef.push(_local2);
};
updateShotAgainstBossOne = function () {
if (!_root.gamePaused) {
var _local4 = getTimer();
var _local3 = _local4 - this.then;
if (_local3 > 100) {
_local3 = 10;
}
this.then = _local4;
this._y = this._y - (this.speed * (_local3 / 30));
this._x = this._x + (((this.xmod * (470 - this._y)) / 1000) * (_local3 / 30));
if (this._y < 0) {
this.remove = true;
}
if (this.targetObj.hitTest(this._x, this._y - 5, true)) {
this.remove = true;
this.targetObj.hitpoints--;
}
}
};
playerShootAgainstBossOne = function (t) {
_root.crc++;
var _local2 = _root.createEmptyMovieClip("playerShot" + _root.crc, _root.getNextHighestDepth());
var _local3 = _local2.attachMovie("shotAgainstBossOne", "shot", _local2.getNextHighestDepth());
_local2._y = _root.thing._y - (_root.thing._height / 2);
_local2._x = _root.thing._x;
_local2.speed = 5;
_local2.then = getTimer();
_local2.remove = false;
_local2.xmod = -1 + random(3);
_local2.targetObj = t;
_local2.update = _root.updateShotAgainstBossOne;
_root.ef.push(_local2);
};
updateBossOne = function () {
if (!_root.gamePaused) {
if ((this.state == 2) || (this.state == 3)) {
_root.playerShootAgainstBossOne(this);
}
var _local9 = random(100) / 100;
var _local6 = random(5) + 1;
var _local8 = random(5) + 1;
this.filters = [new flash.filters.GlowFilter(16776960, _local9, _local6, _local6, _local8, 3, false, false)];
var _local7 = getTimer();
var _local4 = _local7 - this.then;
if (_local4 > 100) {
_local4 = 10;
}
this.then = _local7;
var _local3 = (this.speed * _local4) / 30;
this.shotrot--;
if (this.shotrot <= -180) {
this.shotrot = 180;
}
if (this.state == 1) {
if (this._y < 125) {
this._y = this._y + (this.speed * (_local4 / 30));
} else {
this.state = 2;
}
} else if (this.state == 2) {
if (this.dest == undefined) {
this.dest = this.wp[random(8)];
this.counter = 0;
}
this.counter++;
if (this.counter >= 30) {
if (random(100) < 4) {
_root.bossOneShoot(this._x, this._y, 1, 0);
this.counter = 0;
}
}
if (_root.ab(this._x - this.dest[0]) < 10) {
if (_root.ab(this._y - this.dest[1]) < 10) {
this.dest = this.wp[random(8)];
} else if (this._y < this.dest[1]) {
this._y = this._y + _local3;
} else {
this._y = this._y - _local3;
}
} else if (this._x < this.dest[0]) {
this._x = this._x + _local3;
} else {
this._x = this._x - _local3;
}
if (this.hitpoints < 1200) {
this.state = 3;
}
} else if (this.state == 3) {
if (_root.ab(this._x - this.dest[0]) < 10) {
if (_root.ab(this._y - this.dest[1]) < 10) {
if (random(200) < 1) {
if ((random(10) % 2) == 0) {
this.dest = this.wp[0];
} else {
this.dest = this.wp[3];
}
}
} else if (this._y < this.dest[1]) {
this._y = this._y + _local3;
} else {
this._y = this._y - _local3;
}
} else if (this._x < this.dest[0]) {
this._x = this._x + _local3;
} else {
this._x = this._x - _local3;
}
this.counter++;
if (this.counter >= 12) {
_root.bossOneShoot(this._x, this._y, 2, 120 - this.shotrot);
_root.bossOneShoot(this._x, this._y, 2, 240 - this.shotrot);
_root.bossOneShoot(this._x, this._y, 2, 360 - this.shotrot);
this.counter = 0;
}
if (this.hitpoints < 300) {
this.state = 4;
}
} else if (this.state == 4) {
this.hitpoints--;
if (this.hitpoints <= 20) {
this.state = 5;
}
} else if (this.state == 5) {
this.hitpoints--;
this._width = this._width * 1.2;
if (this.hitpoints <= 0) {
this.remove = true;
_root.bossOneActive = false;
_root.playCurrentTrack();
_root.showScore(25000, this._x, this._y);
_root.showBossBar(false);
_root.kongr_bossOneKilled = true;
_root.updateScoresOnKongregate();
_root.onEnterFrame = _root.main;
}
}
var _local5 = (this.hitpoints - 300) / (this.maxHealth - 300);
if (_local5 < 0) {
_local5 = 0;
}
_root.updateBossBar(_local5);
}
};
clearStageForBoss = function (noscore) {
if (!noscore) {
_root.playSFX("darkboing");
}
_root.showBossBar(true);
for (var _local3 in _root.cr) {
if (noscore != false) {
_root.showScore(500, _root.cr[_local3]._x, _root.cr[_local3]._y);
}
_root.cr[_local3].remove = true;
}
_root.showMagnetism(false);
_root.showNet(false);
_root.showShield(false);
_root.showPacmanAvatar(false);
_root.showSnakeAvatar(false);
_root.showPlanesAvatar(false);
_root.magnetismActive = false;
_root.netActive = false;
_root.shieldActive = false;
_root.pacmanActive = false;
_root.snakeActive = false;
_root.planesTime = _root.planesTime - 35000;
_root.tunnelActive = false;
_root.tunnelController.remove = true;
_root.arkanoidActive = false;
_root.arkanoidBall.remove = true;
};
spawnBossOne = function () {
_root.clearStageForBoss();
_root.showBigSign("BOSS FIGHT #1", false);
_root.bossOneActive = true;
_root.crc++;
var _local2 = _root.createEmptyMovieClip("boss1" + _root.crc, _root.getNextHighestDepth());
var _local3 = _local2.attachMovie("robot4AsBoss", "boss1", _local2.getNextHighestDepth());
_local2._y = -800;
_local2._x = 300;
_local2.speed = 4;
_local2.then = getTimer();
_local2.state = 1;
_local2.remove = false;
_local2.hitpoints = 2400;
_local2.maxHealth = 2400;
_local2.shotrot = 180;
_local2.bossOne = true;
_local2.update = _root.updateBossOne;
_local2.boss = true;
_local2.wp = [[175, 125], [250, 125], [350, 125], [425, 125], [175, 200], [250, 200], [350, 200], [425, 200]];
_root.cr.push(_local2);
};
updateShotAgainstBossThree = function () {
if (!_root.gamePaused) {
var _local4 = getTimer();
var _local3 = _local4 - this.then;
if (_local3 > 100) {
_local3 = 10;
}
this.then = _local4;
this._y = this._y - (this.speed * (_local3 / 30));
this._x = this._x + (((this.xmod * (470 - this._y)) / 1000) * (_local3 / 30));
if (this._y < 0) {
this.remove = true;
}
if (this.targetObj.hitTest(this._x, this._y - 5, true)) {
this.remove = true;
this.targetObj.hitpoints--;
}
}
};
playerShootAgainstBossThree = function (t) {
_root.crc++;
var _local2 = _root.createEmptyMovieClip("playerShot" + _root.crc, _root.getNextHighestDepth());
var _local3 = _local2.attachMovie("shotAgainstBossThree", "shot", _local2.getNextHighestDepth());
_local2._y = _root.thing._y - _root.thing._height;
_local2._x = _root.thing._x;
_local2.speed = 5;
_local2._width = 1;
_local2.then = getTimer();
_local2.remove = false;
_local2.xmod = -1 + random(3);
_local2._xscale = _local2._xscale * (((random(10) % 2) == 0) ? 1 : -1);
_local2.targetObj = t;
_local2.update = _root.updateShotAgainstBossThree;
_root.ef.push(_local2);
};
bossThreeShot1Update = function () {
var _local4 = getTimer();
var _local3 = _local4 - this.then;
if (_local3 > 100) {
_local3 = 10;
}
this.then = _local4;
this._x = this._x + (this.xmov * (_local3 / 30));
this._y = this._y + (this.ymov * (_local3 / 30));
this._rotation = this._rotation + 3;
if (this._x < 0) {
this.remove = true;
} else if (this._x > 600) {
this.remove = true;
}
if (this._y < 0) {
this.remove = true;
} else if (this._y > 450) {
this.remove = true;
}
if (_root.ab(this._x - _root.thing._x) < ((this._width + _root.thing._width) / 2)) {
if (_root.ab(this._y - _root.thing._y) < ((this._width + _root.thing._width) / 2)) {
_root.loseOneLife();
this.remove = true;
}
}
};
bossThreeShot2Update = function () {
var _local4 = getTimer();
var _local3 = _local4 - this.then;
if (_local3 > 100) {
_local3 = 10;
}
this.then = _local4;
this._x = this._x + (this.xmov * (_local3 / 30));
this._y = this._y + (this.ymov * (_local3 / 30));
this._rotation = this._rotation + 3;
if (this._x < 0) {
this.remove = true;
} else if (this._x > 600) {
this.remove = true;
}
if (this._y < 0) {
this.remove = true;
} else if (this._y > 450) {
this.remove = true;
}
if (_root.ab(this._x - _root.thing._x) < ((this._width + _root.thing._width) / 2)) {
if (_root.ab(this._y - _root.thing._y) < ((this._width + _root.thing._width) / 2)) {
_root.loseOneLife();
this.remove = true;
}
}
};
bossThreeShoot = function (xx, yy, shotType, xmov, ymov) {
_root.crc++;
var _local3 = "bossThreeShot" + shotType;
var _local2 = _root.createEmptyMovieClip("bossShot" + _root.crc, _root.getNextHighestDepth());
var _local4 = _local2.attachMovie("" + _local3, "bs", _local2.getNextHighestDepth());
_local2.cpy = true;
_local2.then = getTimer();
_local2._x = xx;
_local2._y = yy;
_local2.speed = 6;
_local2.xmov = xmov;
_local2.ymov = ymov;
if (shotType == 1) {
_local2.update = _root.bossThreeShot1Update;
} else {
_local2.update = _root.bossThreeShot2Update;
}
_root.ef.push(_local2);
};
updateBossThree = function () {
if (!_root.gamePaused) {
if ((this.state == 2) || (this.state == 3)) {
_root.playerShootAgainstBossThree(this);
}
var _local8 = random(100) / 100;
var _local5 = random(5) + 1;
var _local7 = random(5) + 1;
this.filters = [new flash.filters.GlowFilter(16776960, _local8, _local5, _local5, _local7, 3, false, false)];
var _local6 = getTimer();
var _local3 = _local6 - this.then;
if (_local3 > 100) {
_local3 = 10;
}
this.then = _local6;
var _local9 = (this.speed * _local3) / 30;
if (this.state == 1) {
if (this._y < 125) {
this._y = this._y + (this.speed * (_local3 / 30));
} else {
this.state = 2;
}
} else if (this.state == 2) {
this.counter = this.counter + (_local3 / 20);
if (this.counter >= 3) {
this.counter = 0;
if (this.shoot == undefined) {
this.shoot = 0;
} else {
this.shoot++;
}
if (this.shoot > 11) {
this.shoot = 0;
}
switch (this.shoot) {
case 0 :
_root.bossThreeShoot(this._x - 20, this._y + 5, 1, 1, 2);
break;
case 1 :
_root.bossThreeShoot(this._x + 20, this._y + 5, 2, -1, 2);
break;
case 2 :
_root.bossThreeShoot(this._x - 20, this._y + 5, 1, 2, 2);
break;
case 3 :
_root.bossThreeShoot(this._x + 20, this._y + 5, 2, -2, 2);
break;
case 4 :
_root.bossThreeShoot(this._x - 20, this._y + 5, 1, 1, -2);
break;
case 5 :
_root.bossThreeShoot(this._x + 20, this._y + 5, 2, -1, -2);
break;
case 6 :
_root.bossThreeShoot(this._x - 20, this._y + 5, 1, 2, -2);
break;
case 7 :
_root.bossThreeShoot(this._x + 20, this._y + 5, 2, -2, -2);
break;
case 8 :
_root.bossThreeShoot(this._x - 20, this._y + 5, 1, 3, -0.2);
break;
case 9 :
_root.bossThreeShoot(this._x + 20, this._y + 5, 2, -3, -0.2);
break;
case 10 :
_root.bossThreeShoot(this._x - 20, this._y + 5, 1, 4, 0.2);
break;
case 11 :
_root.bossThreeShoot(this._x + 20, this._y + 5, 2, -4, 0.2);
break;
}
}
this.count = this.count + (0.0003 * _local3);
this._x = 300 + (this.xmov * _root.sin((this.a * this.count) + this.asp));
this._y = 160 + (this.ymov * _root.sin(this.b * this.count));
if (this.hitpoints < 200) {
this.state = 3;
}
} else if (this.state == 3) {
if (this.modif == undefined) {
this.modif = 0.0003;
} else if (this.modif >= 0.002) {
this.modif = this.modif + 0.0001;
}
this.count = this.count + (this.modif * _local3);
this._x = 300 + (this.xmov * _root.sin((this.a * this.count) + this.asp));
this._y = 160 + (this.ymov * _root.sin(this.b * this.count));
if (this.hitpoints < 50) {
this.state = 4;
}
} else if (this.state == 4) {
this.hitpoints--;
if (this.hitpoints <= 20) {
this.state = 5;
}
} else if (this.state == 5) {
this.hitpoints--;
this._width = this._width * 1.2;
if (this.hitpoints <= 0) {
this.remove = true;
_root.bossThreeActive = false;
_root.playCurrentTrack();
_root.showScore(60000, this._x, this._y);
_root.showBossBar(false);
_root.kongr_bossThreeKilled = true;
_root.updateScoresOnKongregate();
_root.onEnterFrame = _root.main;
}
}
var _local4 = (this.hitpoints - 50) / (this.maxHealth - 50);
if (_local4 < 0) {
_local4 = 0;
}
_root.updateBossBar(_local4);
}
};
spawnBossThree = function () {
_root.clearStageForBoss();
_root.showBigSign("BOSS FIGHT #3", false);
_root.bossThreeActive = true;
_root.crc++;
var _local2 = _root.createEmptyMovieClip("boss3" + _root.crc, _root.getNextHighestDepth());
var _local3 = _local2.attachMovie("bossThree", "boss3", _local2.getNextHighestDepth());
_local2._y = -800;
_local2._x = 300;
_local2.speed = 4;
_local2.then = getTimer();
_local2.state = 1;
_local2.remove = false;
_local2.hitpoints = 2600;
_local2.maxHealth = 2600;
_local2.bossThree = true;
_local2.boss = true;
_local2.update = _root.updateBossThree;
_local2.count = 0.5;
_local2.a = 3;
_local2.b = 4;
_local2.xmov = 160;
_local2.ymov = 40;
_local2.asp = (Math.PI/2);
_root.cr.push(_local2);
};
updateShotAgainstBossFour = function () {
if (!_root.gamePaused) {
var _local4 = getTimer();
var _local3 = _local4 - this.then;
if (_local3 > 100) {
_local3 = 10;
}
this.then = _local4;
this._y = this._y - (this.speed * (_local3 / 30));
this._x = this._x + (((this.xmod * (470 - this._y)) / 1000) * (_local3 / 30));
if (this._y < 0) {
this.remove = true;
}
if (this.targetObj.hitTest(this._x, this._y - 5, true)) {
this.remove = true;
this.targetObj.hitpoints--;
}
}
};
playerShootAgainstBossFour = function (t) {
_root.crc++;
var _local3 = 1 + random(3);
var _local2 = _root.createEmptyMovieClip("playerShot" + _root.crc, _root.getNextHighestDepth());
var _local4 = _local2.attachMovie("shotAgainstBossFour" + _local3, "shot", _local2.getNextHighestDepth());
_local2._y = _root.thing._y - (_root.thing._height / 2);
_local2._x = _root.thing._x;
_local2.speed = 5;
_local2.then = getTimer();
_local2.remove = false;
_local2.xmod = (((20 + random(80)) / 100) * -1) + random(3);
_local2.targetObj = t;
_local2.update = _root.updateShotAgainstBossFour;
_root.ef.push(_local2);
};
bossFourShot1Update = function () {
if (!_root.gamePaused) {
var _local3 = getTimer();
var _local4 = _local3 - this.then;
this.then = _local3;
if (this.col == undefined) {
this.col = random(16777215);
}
if (random(4) == 0) {
this.col = random(16777215);
this.filters = [new flash.filters.GlowFilter(this.col, 1, 3, 3, 3, 4, false, false)];
}
this.count = this.count + (0.0024 * _local4);
this._x = this.cx + (this.xmov * _root.sin((this.a * this.count) + this.asp));
this._y = this.cy + (this.ymov * _root.sin(this.b * this.count));
this.cx = this.cx + this.xdir;
this.cy = this.cy + this.ydir;
if (this._x < 0) {
this.remove = true;
} else if (this._x > 600) {
this.remove = true;
}
if (this._y < 0) {
this.remove = true;
} else if (this._y > 450) {
this.remove = true;
}
if (_root.ab(this._x - _root.thing._x) < ((this._width + _root.thing._width) / 2)) {
if (_root.ab(this._y - _root.thing._y) < ((this._width + _root.thing._width) / 2)) {
_root.loseOneLife();
this.remove = true;
}
}
}
};
bossFourShoot = function (xx, yy, shotType, shotrot, xdir, ydir) {
_root.crc++;
var _local3 = "bossFourShot" + shotType;
var _local2 = _root.createEmptyMovieClip("bossShot" + _root.crc, _root.getNextHighestDepth());
var _local4 = _local2.attachMovie("" + _local3, "bs", _local2.getNextHighestDepth());
_local2.cpy = true;
_local2.then = getTimer();
_local2._x = xx;
_local2._y = yy;
_local2.speed = 3;
_local2.count = 0.5;
_local2.xdir = (xdir * ((10 + random(90)) / 100)) * 2;
_local2.ydir = (ydir * ((10 + random(90)) / 100)) * 2;
_local2.cx = xx;
_local2.cy = yy;
_local2._alpha = 60 + random(40);
_local2.a = 3;
_local2.b = 2;
_local2.xmov = 50;
_local2.ymov = 20;
_local2.asp = (Math.PI/2);
_local2.update = _root.bossFourShot1Update;
_root.ef.push(_local2);
};
updateBossFour = function () {
if (!_root.gamePaused) {
if ((this.state != 1) && (this.state < 4)) {
_root.playerShootAgainstBossFour(this);
}
var _local6 = getTimer();
var _local3 = _local6 - this.then;
if (_local3 > 100) {
_local3 = 10;
}
this.then = _local6;
var _local7 = (this.speed * _local3) / 30;
if (this.col == undefined) {
this.col = random(16777215);
}
if (random(4) == 0) {
this.col = random(16777215);
this.filters = [new flash.filters.GlowFilter(this.col, 1, 3, 3, 3, 4, false, false)];
}
if (this.state == 1) {
if (this._y < 160) {
this._y = this._y + (this.speed * (_local3 / 30));
} else {
this.state = 2;
}
} else if (this.state == 2) {
this.counter++;
if (this.counter >= 30) {
if (random(100) < 6) {
_root.bossFourShoot(this._x - 90, this._y - 10, 1, 0, -1, -1);
_root.bossFourShoot(this._x - 90, this._y + 30, 1, 0, -1, 0);
_root.bossFourShoot(this._x - 90, this._y + 70, 1, 0, -1, 1);
_root.bossFourShoot(this._x + 90, this._y - 10, 1, 0, 1, -1);
_root.bossFourShoot(this._x + 90, this._y + 30, 1, 0, 1, 0);
_root.bossFourShoot(this._x + 90, this._y + 70, 1, 0, 1, 1);
this.counter = 0;
}
}
this.count = this.count + (0.0024 * _local3);
this._x = this.cx + (this.xmov * _root.sin((this.a * this.count) + this.asp));
this._y = this.cy + (this.ymov * _root.sin(this.b * this.count));
if (random(800) == 0) {
this.state = 2.5;
}
if (this.hitpoints < 500) {
this.state = 3;
}
} else if (this.state == 2.5) {
if (this._alpha > 0) {
this._alpha = this._alpha - 3;
} else {
var _local5 = random(3);
if (_local5 == 0) {
this.cx = 200;
this.cy = 180;
} else if (_local5 == 1) {
this.cx = 300;
this.cy = 160;
} else if (_local5 == 2) {
this.cx = 400;
this.cy = 180;
}
this._x = this.cx;
this._y = this.cy;
this.count = 0.5;
this.state = 2.6;
}
} else if (this.state == 2.6) {
if (this._alpha < 100) {
this._alpha = this._alpha + 3;
} else {
this.state = 2;
}
} else if (this.state == 3) {
this._rotation = this._rotation + 20;
if (this.hitpoints < 200) {
this.state = 4;
}
} else if (this.state == 4) {
this.hitpoints--;
if (this.hitpoints <= 20) {
this.state = 5;
}
} else if (this.state == 5) {
this.hitpoints--;
this._width = this._width * 1.2;
if (this.hitpoints <= 0) {
this.remove = true;
_root.bossFourActive = false;
_root.playCurrentTrack();
_root.showScore(75000, this._x, this._y);
_root.showBossBar(false);
_root.kongr_bossFourKilled = true;
_root.updateScoresOnKongregate();
_root.showBigSign("Well done!\nYou have defeated the last of the Bosses!\n", true);
}
}
var _local4 = (this.hitpoints - 200) / (this.maxHealth - 200);
if (_local4 < 0) {
_local4 = 0;
}
_root.updateBossBar(_local4);
}
};
spawnBossFour = function () {
_root.clearStageForBoss();
_root.showBigSign("BOSS FIGHT #4", false);
_root.bossFourActive = true;
_root.crc++;
var _local2 = _root.createEmptyMovieClip("boss4" + _root.crc, _root.getNextHighestDepth());
var _local3 = _local2.attachMovie("bossFour", "boss4", _local2.getNextHighestDepth());
_local2._y = -800;
_local2._x = 300;
_local2.speed = 4;
_local2.then = getTimer();
_local2.state = 1;
_local2.remove = false;
_local2.hitpoints = 2600;
_local2.maxHealth = 2600;
_local2.bossFour = true;
_local2.update = _root.updateBossFour;
_local2.boss = true;
_local2.count = 0.5;
_local2.counter = 0;
_local2.a = 3;
_local2.b = 2;
_local2.xmov = 50;
_local2.ymov = 20;
_local2.asp = (Math.PI/2);
_local2.cx = 300;
_local2.cy = 160;
_root.cr.push(_local2);
};
bossTwoShot1Update = function () {
var _local4 = getTimer();
var _local3 = _local4 - this.then;
if (_local3 > 100) {
_local3 = 10;
}
this.then = _local4;
if (this.spinLeft) {
this._rotation = this._rotation - 2;
} else {
this._rotation = this._rotation + 2;
}
if (this.goingUp) {
this._x = this._x + ((this.upX - this._x) / 10);
this._y = this._y + ((30 - this._y) / 10);
if (_root.ab(this._x - this.upX) < 10) {
if (_root.ab(this._y - 30) < 10) {
this.goingUp = false;
this.goLeft = ((this._x > _root.thing._x) ? true : false);
}
}
} else {
if (this.k == undefined) {
this.k = -3.14159265358979 + (Math.random() * Math.PI);
this.rad = random(180);
}
this.rad = this.rad + ((this.k / 180) * Math.PI);
this._x = this._x + (_root.cos(this.rad) * 6);
this._y = this._y + (this.speed * (_local3 / 30));
}
if (_root.thing.hitTest(this)) {
this.remove = true;
_root.loseOneLife();
}
if (this._y > 470) {
this.remove = true;
}
};
bossTwoShoot = function (xx, yy, shotType, shotrot) {
_root.crc++;
var _local3 = "bossTwoShot" + shotType;
var _local2 = _root.createEmptyMovieClip("bossShot" + _root.crc, _root.getNextHighestDepth());
var _local5 = _local2.attachMovie("" + _local3, "bs", _local2.getNextHighestDepth());
_local2.cpy = true;
_local2.then = getTimer();
_local2._x = xx;
_local2._y = yy;
_local2.spinLeft = (((random(10) % 2) == 0) ? true : false);
_local2.speed = 3;
_local2.goingUp = true;
_local2.upX = (((random(10) % 2) == 0) ? (xx + 40) : (xx - 40));
if ((_local2.upX > 580) || (_local2.upX < 20)) {
_local2.upX = 20 + random(560);
}
_local2.update = _root.bossTwoShot1Update;
_root.ef.push(_local2);
};
updateShotAgainstBossTwo = function () {
if (!_root.gamePaused) {
var _local4 = getTimer();
var _local3 = _local4 - this.then;
if (_local3 > 100) {
_local3 = 10;
}
this.then = _local4;
this._y = this._y - (this.speed * (_local3 / 30));
this._x = this._x + (((this.xmod * (470 - this._y)) / 1000) * (_local3 / 30));
this._width = this._width + 0.25;
if (this._y < 0) {
this.remove = true;
}
if (this.targetObj.hitTest(this._x, this._y - 5, true)) {
this.remove = true;
this.targetObj.hitpoints--;
}
}
};
playerShootAgainstBossTwo = function (t) {
_root.crc++;
var _local2 = _root.createEmptyMovieClip("playerShot" + _root.crc, _root.getNextHighestDepth());
var _local3 = _local2.attachMovie("shotAgainstBossTwo", "shot", _local2.getNextHighestDepth());
_local2._y = _root.thing._y - (_root.thing._height / 2);
_local2._x = _root.thing._x;
_local2.speed = 5;
_local2._width = 1;
_local2.then = getTimer();
_local2.remove = false;
_local2.xmod = -1 + random(3);
_local2.targetObj = t;
_local2.update = _root.updateShotAgainstBossTwo;
_root.ef.push(_local2);
};
updateBossTwo = function () {
if (!_root.gamePaused) {
if ((this.state == 2) || (this.state == 3)) {
_root.playerShootAgainstBossTwo(this);
}
var _local6 = getTimer();
var _local4 = _local6 - this.then;
if (_local4 > 100) {
_local4 = 10;
}
this.then = _local6;
var _local3 = (this.speed * _local4) / 30;
this.shotrot--;
if (this.shotrot <= -180) {
this.shotrot = 180;
}
if (this.state == 1) {
if (this._y < 125) {
this._y = this._y + (this.speed * (_local4 / 30));
} else {
this.state = 2;
}
} else if (this.state == 2) {
if (this.dest == undefined) {
this.dest = this.wp[random(8)];
this.counter = 0;
}
this.counter++;
if (this.counter >= 30) {
if (random(100) < 6) {
_root.bossTwoShoot(this._x, this._y, 1, 0);
this.counter = 0;
}
}
if (_root.ab(this._x - this.dest[0]) < 10) {
if (_root.ab(this._y - this.dest[1]) < 10) {
this.dest = this.wp[random(8)];
} else if (this._y < this.dest[1]) {
this._y = this._y + _local3;
} else {
this._y = this._y - _local3;
}
} else if (this._x < this.dest[0]) {
this._x = this._x + _local3;
} else {
this._x = this._x - _local3;
}
if (this.hitpoints < 500) {
this.state = 3;
}
} else if (this.state == 3) {
if (_root.ab(this._x - this.dest[0]) < 10) {
if (_root.ab(this._y - this.dest[1]) < 10) {
if (random(200) < 1) {
if ((random(10) % 2) == 0) {
this.dest = this.wp[0];
} else {
this.dest = this.wp[3];
}
}
} else if (this._y < this.dest[1]) {
this._y = this._y + _local3;
} else {
this._y = this._y - _local3;
}
} else if (this._x < this.dest[0]) {
this._x = this._x + _local3;
} else {
this._x = this._x - _local3;
}
this.counter++;
if (this.counter >= 25) {
_root.bossTwoShoot(this._x, this._y, 1, 0);
this.counter = 0;
}
if (this.hitpoints < 200) {
this.state = 4;
}
} else if (this.state == 4) {
this.hitpoints--;
if (this.hitpoints <= 20) {
this.state = 5;
}
} else if (this.state == 5) {
this.hitpoints--;
this._width = this._width * 1.2;
if (this.hitpoints <= 0) {
this.remove = true;
_root.bossTwoActive = false;
_root.playCurrentTrack();
_root.showScore(40000, this._x, this._y);
_root.showBossBar(false);
_root.kongr_bossTwoKilled = true;
_root.updateScoresOnKongregate();
_root.onEnterFrame = _root.main;
}
}
var _local5 = (this.hitpoints - 200) / (this.maxHealth - 200);
if (_local5 < 0) {
_local5 = 0;
}
_root.updateBossBar(_local5);
}
};
spawnBossTwo = function () {
_root.clearStageForBoss();
_root.showBigSign("BOSS FIGHT #2", false);
_root.bossTwoActive = true;
_root.crc++;
var _local2 = _root.createEmptyMovieClip("boss2" + _root.crc, _root.getNextHighestDepth());
var _local3 = _local2.attachMovie("robot3AsBoss", "boss2", _local2.getNextHighestDepth());
_local2._y = -800;
_local2._x = 300;
_local2.speed = 4;
_local2.then = getTimer();
_local2.state = 1;
_local2.remove = false;
_local2.hitpoints = 2500;
_local2.maxHealth = 2500;
_local2.boss = true;
_local2.shotrot = 180;
_local2.bossTwo = true;
_local2.update = _root.updateBossTwo;
_local2.wp = [[175, 125], [250, 125], [350, 125], [425, 125], [175, 200], [250, 200], [350, 200], [425, 200]];
_root.cr.push(_local2);
};
updateDropSpeed = function () {
this.timeMove();
if (this._y > 440) {
this.remove = true;
}
var _local4 = _root.ab(this._x - _root.thing._x);
var _local5 = _root.ab(this._y - _root.thing._y);
var _local3 = _root.thing._width / 2;
if (_local4 < _local3) {
if (_local5 < _local3) {
_root.playPowerupSound();
_root.showText("Speed Chaos", this._x, this._y);
_root.nonUniformDropSpeedActive = true;
_root.nonUniformDropSpeedTime = getTimer();
this.remove = true;
}
}
};
updateRotation = function () {
this.timeMove();
if (this._y > 440) {
this.remove = true;
}
var _local4 = _root.ab(this._x - _root.thing._x);
var _local5 = _root.ab(this._y - _root.thing._y);
var _local3 = _root.thing._width / 2;
if (_local4 < _local3) {
if (_local5 < _local3) {
_root.playPowerupSound();
_root.showText("Spin", this._x, this._y);
_root.rotationActive = true;
_root.rotationTime = getTimer();
this.remove = true;
}
}
};
spawnDropSpeed = function () {
_root.crc++;
var _local2 = _root.createEmptyMovieClip("aDropSpeed" + _root.crc, _root.getNextHighestDepth());
var _local3 = _local2.attachMovie("dropSpeed", "dropSpeed" + _root.crc, _local2.getNextHighestDepth());
_local2._x = _root.getOpenPos();
_local2._y = -20;
_local2.speed = 1;
_local2.then = getTimer();
_local2.timeMove = _root.timeMove;
_local2.remove = false;
_local2.update = _root.updateDropSpeed;
_root.assignScalingVars(_local2);
_root.cr.push(_local2);
};
spawnRotation = function () {
_root.crc++;
var _local2 = _root.createEmptyMovieClip("aRotation" + _root.crc, _root.getNextHighestDepth());
var _local3 = _local2.attachMovie("rotation", "rotation" + _root.crc, _local2.getNextHighestDepth());
_local2._x = _root.getOpenPos();
_local2._y = -20;
_local2.speed = 1;
_local2.then = getTimer();
_local2.timeMove = _root.timeMove;
_local2.remove = false;
_local2.update = _root.updateRotation;
_root.assignScalingVars(_local2);
_root.cr.push(_local2);
};
updateSnake = function () {
this.timeMove();
if (this._y > 440) {
this.remove = true;
}
var _local4 = _root.ab(this._x - _root.thing._x);
var _local5 = _root.ab(this._y - _root.thing._y);
var _local3 = _root.thing._width / 2;
if (_local4 < _local3) {
if (_local5 < _local3) {
_root.playPowerupSound();
_root.showText("Snake", this._x, this._y);
_root.snakeActive = true;
_root.snakeTime = getTimer();
_root.showSnakeAvatar(true);
this.remove = true;
}
}
};
spawnSnake = function () {
_root.crc++;
var _local2 = _root.createEmptyMovieClip("aSnake" + _root.crc, _root.getNextHighestDepth());
var _local3 = _local2.attachMovie("snake", "snake" + _root.crc, _local2.getNextHighestDepth());
_local2._x = _root.getOpenPos();
_local2._y = -20;
_local2.speed = 1;
_local2.then = getTimer();
_local2.timeMove = _root.timeMove;
_local2.remove = false;
_local2.update = _root.updateSnake;
_root.assignScalingVars(_local2);
_root.cr.push(_local2);
};
showExplosionBlack = function (x, y, playSound) {
_root.crc++;
var _local3 = _root.createEmptyMovieClip("anExplosoinBlack" + _root.crc, _root.getNextHighestDepth());
var _local4 = _local3.attachMovie("planeExplosion", "pe", _local3.getNextHighestDepth());
_local3._x = x;
_local3._y = y;
_local3.co = 30;
_local3._rotation = random(360);
_local3.update = function () {
this.co--;
if (this.co < 0) {
this.remove = true;
}
};
_root.ef.push(_local3);
if (playSound) {
_root.playSFX("bomb004");
}
};
showExplosion = function (x, y, playSound) {
if (_root.planesActive) {
_root.showExplosionBlack(x, y, playSound);
} else {
_root.crc++;
var _local3 = _root.createEmptyMovieClip("aExplosion" + _root.crc, _root.getNextHighestDepth());
var _local4 = _local3.attachMovie("bombExplosion", "be" + _root.crc, _local3.getNextHighestDepth());
_local3._x = x;
_local3._y = y;
_local3.co = 30;
_local3._rotation = random(360);
_local3.update = function () {
this.co--;
if (this.co < 0) {
this.remove = true;
}
};
_root.ef.push(_local3);
if (playSound) {
_root.playSFX("bomb004");
}
}
};
loseOneLife = function () {
_root.playSFX("whuw");
if (_root.playerLives >= 0) {
_root.frame.livesGui["life" + _root.playerLives].gotoAndPlay("blink");
}
_root.playerLives--;
if (_root.playerLives < 0) {
delete _root.frame.update;
_root.gotoAndStop("gameOver");
}
};
updateBomb = function () {
var _local5 = getTimer();
var _local3 = _local5 - this.then;
if (_local3 > 100) {
_local3 = 10;
}
this.then = _local5;
var _local9 = ((this.speed + _root.baseSpeed) * _local3) / 30;
var _local8 = (this.speed * _local3) / 30;
this._y = this._y + _local9;
this._x = this._x + ((_local8 * this.facing) ? 1 : -1);
if ((this._x < 30) || (this._x > 570)) {
this._xscale = this._xscale * -1;
this.facing = !this.facing;
}
if (this.rad == undefined) {
this.rad = 0;
}
if (this._y > 440) {
this.remove = true;
}
var _local6 = _root.ab(this._x - _root.thing._x);
var _local7 = _root.ab(this._y - _root.thing._y);
var _local4 = _root.thing._width / 2;
if (_local6 < _local4) {
if (_local7 < _local4) {
this.remove = true;
_root.showExplosion(this._x, this._y, true);
if (!_root.shieldActive) {
var _local10 = -100;
_root.thing.desiredWidth = 16;
_root.pc = new Array();
_root.loseOneLife();
}
}
}
};
spawnFish = function (xx, yy, q) {
_root.crc++;
var _local2 = _root.createEmptyMovieClip("aBomb" + _root.crc, _root.getNextHighestDepth());
var _local3 = _local2.attachMovie("bomb3", "bomb_mc", _local2.getNextHighestDepth());
if (xx != undefined) {
_local2._x = xx;
} else {
_local2._x = _root.getOpenPos();
}
if (yy != undefined) {
_local2._y = yy;
} else {
_local2._y = -20;
}
if (_local2._x < 30) {
_local2._x = 30;
} else if (_local2._x > 570) {
_local2._x = 570;
}
_local2.remove = false;
_local2.speed = 1;
_local2.then = getTimer();
_local2.bomb = true;
_local2.timeMove = _root.timeMove;
_local2.facing = q;
_local2._xscale = (_local2.facing ? 100 : -100);
_local2.update = _root.updateBomb;
_root.cr.push(_local2);
if (_root.symmetryActive) {
if (_root.symmetrySwitch) {
_root.symmetrySwitch = false;
_root.spawnBomb(((_local2._x >= 300) ? (300 - (_local2._x - 300)) : (600 - _local2._x)), _local2._y);
} else {
_root.symmetrySwitch = true;
}
}
};
spawnBomb = function (xx, yy, q) {
_root.crc++;
var _local2 = _root.createEmptyMovieClip("aBomb" + _root.crc, _root.getNextHighestDepth());
var _local3 = _local2.attachMovie("bomb3", "bomb_mc", _local2.getNextHighestDepth());
if (xx != undefined) {
_local2._x = xx;
} else {
_local2._x = _root.getOpenPos();
}
if (yy != undefined) {
_local2._y = yy;
} else {
_local2._y = -20;
}
_local2.remove = false;
_local2.speed = 1;
_local2.then = getTimer();
_local2.bomb = true;
_local2.timeMove = _root.timeMove;
_local2.facing = ((Math.random() > 0.5) ? true : false);
_local2._xscale = (_local2.facing ? 100 : -100);
_local2.update = _root.updateBomb;
if (q == true) {
_root.cr_queue.push(_local2);
} else {
_root.cr.push(_local2);
}
if (_root.symmetryActive) {
if (_root.symmetrySwitch) {
_root.symmetrySwitch = false;
_root.spawnBomb(((_local2._x >= 300) ? (300 - (_local2._x - 300)) : (600 - _local2._x)), _local2._y);
} else {
_root.symmetrySwitch = true;
}
}
};
updateBombOBSOLETE = function () {
this.timeMove();
if (this._y > 440) {
this.remove = true;
}
if (_root.matrixActive) {
this.bomb_mc.gotoAndStop("glow");
} else {
this.bomb_mc.gotoAndStop("normal");
}
var _local4 = _root.ab(this._x - _root.thing._x);
var _local5 = _root.ab(this._y - _root.thing._y);
var _local3 = _root.thing._width / 2;
if (_local4 < _local3) {
if (_local5 < _local3) {
this.remove = true;
_root.showExplosion(this._x, this._y, true);
if (!_root.shieldActive) {
var _local6 = -100;
_root.showScore(_local6, this._x, this._y);
_root.thing.desiredWidth = 16;
_root.pc = new Array();
_root.loseOneLife();
}
}
}
};
spawnBombOBSOLETE = function (xx, yy, q) {
_root.crc++;
var _local2 = _root.createEmptyMovieClip("aBomb" + _root.crc, _root.getNextHighestDepth());
var _local3 = _local2.attachMovie("bomb3", "bomb_mc", _local2.getNextHighestDepth());
if (xx != undefined) {
_local2._x = xx;
} else {
_local2._x = _root.getOpenPos();
}
if (yy != undefined) {
_local2._y = yy;
} else {
_local2._y = -20;
}
_local2.remove = false;
_local2.speed = 1;
_local2.then = getTimer();
_local2.bomb = true;
_local2.timeMove = _root.timeMove;
_root.assignScalingVars(_local2);
_local2.update = _root.updateBomb;
if (q == true) {
_root.cr_queue.push(_local2);
} else {
_root.cr.push(_local2);
}
if (_root.symmetryActive) {
if (_root.symmetrySwitch) {
_root.symmetrySwitch = false;
_root.spawnBomb(((_local2._x >= 300) ? (300 - (_local2._x - 300)) : (600 - _local2._x)), _local2._y);
} else {
_root.symmetrySwitch = true;
}
}
};
updateWaves = function () {
this.timeMove();
if (this._y > 440) {
this.remove = true;
}
var _local4 = _root.ab(this._x - _root.thing._x);
var _local5 = _root.ab(this._y - _root.thing._y);
var _local3 = _root.thing._width / 2;
if (_local4 < _local3) {
if (_local5 < _local3) {
_root.playPowerupSound();
this.remove = true;
_root.showText("Wavy Motion", this._x, this._y);
_root.wavyMotionActive = true;
_root.shakyMotionActive = false;
_root.wavyMotionTime = getTimer();
}
}
};
updateShakes = function () {
this.timeMove();
if (this._y > 440) {
this.remove = true;
}
var _local4 = _root.ab(this._x - _root.thing._x);
var _local5 = _root.ab(this._y - _root.thing._y);
var _local3 = _root.thing._width / 2;
if (_local4 < _local3) {
if (_local5 < _local3) {
_root.playPowerupSound();
this.remove = true;
_root.showText("Shaky Motion", this._x, this._y);
_root.shakyMotionActive = true;
_root.wavyMotionActive = false;
_root.shakyMotionTime = getTimer();
}
}
};
spawnWaves = function () {
_root.crc++;
var _local2 = _root.createEmptyMovieClip("aWaves" + _root.crc, _root.getNextHighestDepth());
var _local3 = _local2.attachMovie("waves", "waves" + _root.crc, _local2.getNextHighestDepth());
_local2._x = _root.getOpenPos();
_local2._y = -20;
_local2.remove = false;
_local2.speed = 1;
_local2.then = getTimer();
_local2.timeMove = _root.timeMove;
_local2.update = _root.updateWaves;
_root.assignScalingVars(_local2);
_root.cr.push(_local2);
};
spawnShakes = function () {
_root.crc++;
var _local2 = _root.createEmptyMovieClip("aShakes" + _root.crc, _root.getNextHighestDepth());
var _local3 = _local2.attachMovie("shakes", "shakes" + _root.crc, _local2.getNextHighestDepth());
_local2._x = _root.getOpenPos();
_local2._y = -20;
_local2.remove = false;
_local2.speed = 1;
_local2.then = getTimer();
_local2.timeMove = _root.timeMove;
_local2.update = _root.updateShakes;
_root.assignScalingVars(_local2);
_root.cr.push(_local2);
};
updateGhost = function () {
var _local4 = _root.thing.hitTest(this);
if (_root.rotationActive) {
if (this.rotsp == undefined) {
this.rotsp = 1 + random(4);
if ((random(10) % 2) == 0) {
this.rotsp = this.rotsp * -1;
}
}
this._rotation = this._rotation + this.rotsp;
}
if (this.chasing) {
if (this._x < _root.thing._x) {
this.xspeed = 1;
} else {
this.xspeed = -1;
}
if (this._y < _root.thing._y) {
this.yspeed = 1;
} else {
this.yspeed = -1;
}
var _local5 = getTimer();
var _local3 = _local5 - this.then;
if (_local3 > 100) {
_local3 = 10;
}
this.then = _local5;
this._x = this._x + (this.xspeed * (_local3 / 30));
this._y = this._y + (this.yspeed * (_local3 / 30));
if (_local4) {
this.remove = true;
_root.thing.desiredWidth = 16;
_root.pc = new Array();
_root.loseOneLife();
}
} else {
this.timeMove();
this._xscale = this._xscale * -1;
if (_local4) {
this.remove = true;
_root.showScore(1000, this._x, this._y);
}
if (this._x < 30) {
this.remove = true;
} else if (this._x > 580) {
this.remove = true;
}
if (this._y < 40) {
this.remove = true;
} else if (this._y > 430) {
this.remove = true;
}
}
};
updateYellowPill = function () {
if (this._y > 225) {
var _local5 = getTimer();
var _local4 = _local5 - this.then;
if (_local4 > 100) {
_local4 = 10;
}
this.then = _local5;
this._y = this._y - (this.speed * (_local4 / 30));
}
if (_root.thing.hitTest(this)) {
this.remove = true;
_root.playSFX("Crystal4-004");
for (var _local3 in _root.cr) {
if (_root.cr[_local3].ghost == true) {
_root.cr[_local3].chasing = false;
_root.cr[_local3].ghost_mc.gotoAndStop("panicky");
}
}
}
};
makeYellowPills = function () {
var _local5 = [];
var _local3 = 0;
while (_local3 < _root.cr.length) {
if (_root.cr[_local3].boss != true) {
_local5.push(new flash.geom.Point(_root.cr[_local3]._x, _root.cr[_local3]._y));
_root.cr[_local3].remove = true;
}
_local3++;
}
var _local4 = 0;
while (_local4 < _local5.length) {
_root.crc++;
var _local6 = 1;
var _local2 = _root.createEmptyMovieClip("aSmallPill" + _root.crc, _root.getNextHighestDepth());
var _local7 = _local2.attachMovie("smallPill", "smallPill", _local2.getNextHighestDepth());
_local2.speed = 1;
_local2._x = _local5[_local4].x;
_local2._y = _local5[_local4].y;
_local2.ty = 4;
_local2.then = getTimer();
_local2.remove = false;
_local2.timeMove = _root.timeMove;
_local2.update = _root.updateCrystal;
_root.assignScalingVars(_local2);
_root.cr_queue.push(_local2);
_local4++;
}
};
updatePacman = function () {
this.timeMove();
if (this._y > 440) {
this.remove = true;
}
var _local6 = _root.ab(this._x - _root.thing._x);
var _local7 = _root.ab(this._y - _root.thing._y);
var _local5 = _root.thing._width / 2;
if (_local6 < _local5) {
if (_local7 < _local5) {
_root.playPowerupSound();
_root.makeYellowPills();
this.remove = true;
_root.showText("Pacman", this._x, this._y);
_root.showPacmanAvatar(true);
_root.pacmanActive = true;
_root.pacmanTime = getTimer();
var _local3 = 0;
while (_local3 < 4) {
_root.crc++;
var _local4 = _root.createEmptyMovieClip("ghost" + _root.crc, _root.getNextHighestDepth());
var _local8 = _local4.attachMovie("ghost" + (_local3 + 1), "ghost_mc", _local4.getNextHighestDepth());
_local4._x = ((_local3 < 2) ? 0 : 600);
_local4._y = (((_local3 % 2) == 0) ? -20 : 470);
_local4.ghost = true;
_local4.remove = false;
_local4.speed = 0.25;
_local4.xspeed = 1;
_local4.yspeed = 1;
_local4.then = getTimer();
_local4.timeMove = _root.timeMove;
_local4.update = _root.updateGhost;
_local4.chasing = true;
_root.cr_queue.push(_local4);
_local3++;
}
_root.crc++;
var _local4 = _root.createEmptyMovieClip("yellowPill" + _root.crc, _root.getNextHighestDepth());
var _local8 = _local4.attachMovie("yellowPill", "yellowPill", _local4.getNextHighestDepth());
_local4._x = 300;
_local4._y = 750;
_local4.remove = false;
_local4.speed = 2;
_local4.then = getTimer();
_local4.update = _root.updateYellowPill;
_root.cr_queue.push(_local4);
}
}
};
spawnPacman = function () {
_root.crc++;
var _local2 = _root.createEmptyMovieClip("pacman" + _root.crc, _root.getNextHighestDepth());
var _local3 = _local2.attachMovie("pacmanpowerup", "pacmanpowerup", _local2.getNextHighestDepth());
_local2._x = _root.getOpenPos();
_local2._y = -20;
_local2.remove = false;
_local2.speed = 1;
_local2.then = getTimer();
_local2.timeMove = _root.timeMove;
_local2.update = _root.updatePacman;
_root.assignScalingVars(_local2);
_root.cr.push(_local2);
};
doTetris = function () {
var _local5 = [];
var _local3 = 0;
while (_local3 < _root.cr.length) {
if (_root.cr[_local3].boss != true) {
_local5.push(new flash.geom.Point(_root.cr[_local3]._x, _root.cr[_local3]._y));
_root.cr[_local3].remove = true;
}
_local3++;
}
var _local4 = 0;
while (_local4 < _local5.length) {
_root.crc++;
var _local6 = random(7) + 1;
var _local2 = _root.createEmptyMovieClip("aTetris" + _root.crc, _root.getNextHighestDepth());
var _local7 = _local2.attachMovie("tetrisBlock" + _local6, "tBlock", _local2.getNextHighestDepth());
_local2.speed = 1;
_local2._x = _local5[_local4].x;
_local2._y = _local5[_local4].y;
_local2.ty = 5;
_local2.then = getTimer();
_local2.remove = false;
_local2.timeMove = _root.timeMove;
_local2.update = _root.updateCrystal;
_root.assignScalingVars(_local2);
_root.cr_queue.push(_local2);
_local4++;
}
};
updateTetris = function () {
this.timeMove();
if (this._y > 440) {
this.remove = true;
}
var _local4 = _root.ab(this._x - _root.thing._x);
var _local5 = _root.ab(this._y - _root.thing._y);
var _local3 = _root.thing._width / 2;
if (_local4 < _local3) {
if (_local5 < _local3) {
_root.playPowerupSound();
this.remove = true;
_root.showText("Tetris", this._x, this._y);
_root.tetrisActive = true;
_root.tetrisTime = getTimer();
_root.doTetris();
}
}
};
spawnTetris = function () {
_root.crc++;
var _local2 = _root.createEmptyMovieClip("tetris" + _root.crc, _root.getNextHighestDepth());
var _local3 = _local2.attachMovie("tetris", "tetris", _local2.getNextHighestDepth());
_local2._x = _root.getOpenPos();
_local2._y = -20;
_local2.remove = false;
_local2.speed = 1;
_local2.then = getTimer();
_local2.timeMove = _root.timeMove;
_local2.update = _root.updateTetris;
_root.assignScalingVars(_local2);
_root.cr.push(_local2);
};
updateSymmetry = function () {
this.timeMove();
if (this._y > 440) {
this.remove = true;
}
var _local4 = _root.ab(this._x - _root.thing._x);
var _local5 = _root.ab(this._y - _root.thing._y);
var _local3 = _root.thing._width / 2;
if (_local4 < _local3) {
if (_local5 < _local3) {
_root.playPowerupSound();
this.remove = true;
_root.showText("Symmetry", this._x, this._y);
_root.symmetryActive = true;
_root.symmetryTime = getTimer();
_root.symmetrySwicth = true;
}
}
};
spawnSymmetry = function () {
_root.crc++;
var _local2 = _root.createEmptyMovieClip("symmetry" + _root.crc, _root.getNextHighestDepth());
var _local3 = _local2.attachMovie("symmetry", "symmetry", _local2.getNextHighestDepth());
_local2._x = _root.getOpenPos();
_local2._y = -20;
_local2.remove = false;
_local2.speed = 1;
_local2.then = getTimer();
_local2.timeMove = _root.timeMove;
_local2.update = _root.updateSymmetry;
_root.assignScalingVars(_local2);
_root.cr.push(_local2);
};
whiteBg.update = function () {
if (_root.planesActive) {
var _local4 = getTimer();
var _local3 = _local4 - _root.planesTime;
if (this._currentframe == 1) {
this.play();
} else if (this._currentframe == 95) {
_root.planesActive = false;
_root.showPlanesAvatar(false);
this.gotoAndStop("fadein");
}
if ((_local3 > 15000) && (this._currentframe == 35)) {
this.play();
}
}
};
updateFighterPlane = function () {
var _local4 = getTimer();
var _local3 = _local4 - this.then;
if (_local3 > 100) {
_local3 = 10;
}
this.then = _local4;
if (this.xspeed != 0) {
if (this.xspeed > 0) {
this._x = this._x + ((this.xspeed + _root.baseSpeed) * (_local3 / 30));
} else {
this._x = this._x + ((this.xspeed - _root.baseSpeed) * (_local3 / 30));
}
}
this._y = this._y + ((this.yspeed + _root.baseSpeed) * (_local3 / 30));
if (this.hitpoints < 1) {
this.remove = true;
_root.showScore(200, this._x, this._y);
_root.showExplosionBlack(this._x, this._y, true);
}
if (this._y > 470) {
this.remove = true;
}
};
spawnFighterPlane = function () {
_root.crc++;
var _local2 = _root.createEmptyMovieClip("fighterPlane" + _root.crc, _root.getNextHighestDepth());
var _local3 = _local2.attachMovie("fighterPlane", "fighterPlane", _local2.getNextHighestDepth());
_local2._y = -40;
_local2.fighter = true;
_local2.remove = false;
_local2.xspeed = -1 + random(3);
_local2._rotation = ((_local2.xspeed == -1) ? -135 : (((_local2.xspeed == 0) ? 180 : 135)));
_local2._x = ((_local2.xspeed == -1) ? 700 : (((_local2.xspeed == 0) ? (100 + random(400)) : -100)));
_local2.yspeed = 1 + ((random(10) + 1) / 10);
_local2.then = getTimer();
_local2.hitpoints = 1;
_local2.update = _root.updateFighterPlane;
_root.cr_queue.push(_local2);
};
updateBomberPlane = function () {
var _local4 = getTimer();
var _local3 = _local4 - this.then;
if (_local3 > 100) {
_local3 = 10;
}
this.then = _local4;
this._y = this._y + ((this.yspeed + _root.baseSpeed) * (_local3 / 30));
if (this.hitpoints < 1) {
this.remove = true;
_root.showScore(800, this._x, this._y);
_root.showExplosionBlack(this._x, this._y, true);
}
if (this._y > 500) {
this.remove = true;
}
};
spawnBomberPlane = function () {
_root.crc++;
var _local2 = _root.createEmptyMovieClip("bomberPlane" + _root.crc, _root.getNextHighestDepth());
var _local3 = _local2.attachMovie("bomberPlane", "bomberPlane", _local2.getNextHighestDepth());
_local2._y = -40;
_local2.fighter = true;
_local2.remove = false;
_local2._x = 50 + random(500);
_local2.yspeed = 0.25;
_local2.hitpoints = 5;
_local2.then = getTimer();
_local2.timeMove = _root.timeMove;
_local2.update = _root.updateBomberPlane;
_root.cr_queue.push(_local2);
};
doPlanes = function () {
var _local3 = [];
var _local2 = 0;
while (_local2 < _root.cr.length) {
if (_root.cr[_local2].boss != true) {
_local3.push(new flash.geom.Point(_root.cr[_local2]._x, _root.cr[_local2]._y));
_root.cr[_local2].remove = true;
}
_local2++;
}
};
updatePlanes = function () {
this.timeMove();
if (this._y > 440) {
this.remove = true;
}
var _local4 = _root.ab(this._x - _root.thing._x);
var _local5 = _root.ab(this._y - _root.thing._y);
var _local3 = _root.thing._width / 2;
if (_local4 < _local3) {
if (_local5 < _local3) {
_root.playPowerupSound();
this.remove = true;
_root.showText("1945", this._x, this._y);
_root.planesActive = true;
_root.planesTime = getTimer();
_root.doPlanes();
_root.showPlanesAvatar(true);
}
}
};
spawnPlanes = function () {
_root.crc++;
var _local2 = _root.createEmptyMovieClip("planes" + _root.crc, _root.getNextHighestDepth());
var _local3 = _local2.attachMovie("planes", "planes", _local2.getNextHighestDepth());
_local2._x = _root.getOpenPos();
_local2._y = -20;
_local2.remove = false;
_local2.speed = 1;
_local2.then = getTimer();
_local2.timeMove = _root.timeMove;
_local2.update = _root.updatePlanes;
_root.assignScalingVars(_local2);
_root.cr.push(_local2);
};
bossbg.update = function () {
var _local6 = _root.bossOneActive;
var _local5 = _root.bossTwoActive;
var _local4 = _root.bossThreeActive;
var _local3 = _root.bossFourActive;
if (((_local6 || (_local5)) || (_local4)) || (_local3)) {
var _local7 = getTimer();
var _local8 = _local7 - this.then;
if (this._currentframe == 1) {
this.play();
} else if (this._currentframe == 95) {
this.gotoAndStop("fadein");
}
}
if ((!(((_local6 || (_local5)) || (_local4)) || (_local3))) && (this._currentframe == 35)) {
this.play();
}
};
matrixbg.update = function () {
if (_root.matrixActive) {
var _local4 = getTimer();
var _local3 = _local4 - _root.matrixTime;
if (this._currentframe == 1) {
this.play();
} else if (this._currentframe == 95) {
_root.matrixActive = false;
this.gotoAndStop("fadein");
}
if ((_local3 > 15000) && (this._currentframe == 35)) {
this.play();
}
}
};
doMatrix = function () {
var _local5 = [];
var _local3 = 0;
while (_local3 < _root.cr.length) {
if (_root.cr[_local3].boss != true) {
_local5.push(new flash.geom.Point(_root.cr[_local3]._x, _root.cr[_local3]._y));
_root.cr[_local3].remove = true;
}
_local3++;
}
var _local4 = 0;
while (_local4 < _local5.length) {
_root.crc++;
var _local2 = _root.createEmptyMovieClip("aMatrix" + _root.crc, _root.getNextHighestDepth());
var _local6 = _local2.attachMovie("matrix" + ty, "matrix", _local2.getNextHighestDepth());
_local2.speed = 1;
_local2._x = _local5[_local4].x;
_local2._y = _local5[_local4].y;
_local2.ty = 6;
_local2.then = getTimer();
_local2.remove = false;
_local2.timeMove = _root.timeMove;
_local2.update = _root.updateCrystal;
_root.assignScalingVars(_local2);
_root.cr_queue.push(_local2);
_local4++;
}
};
updateMatrix = function () {
this.timeMove();
if (this._y > 440) {
this.remove = true;
}
var _local4 = _root.ab(this._x - _root.thing._x);
var _local5 = _root.ab(this._y - _root.thing._y);
var _local3 = _root.thing._width / 2;
if (_local4 < _local3) {
if (_local5 < _local3) {
_root.playPowerupSound();
this.remove = true;
_root.showText("The Matrix", this._x, this._y);
_root.matrixActive = true;
_root.matrixTime = getTimer();
_root.doMatrix();
}
}
};
spawnMatrix = function () {
_root.crc++;
var _local2 = _root.createEmptyMovieClip("matrix" + _root.crc, _root.getNextHighestDepth());
var _local3 = _local2.attachMovie("matrix", "matrix", _local2.getNextHighestDepth());
_local2._x = _root.getOpenPos();
_local2._y = -20;
_local2.remove = false;
_local2.speed = 1;
_local2.then = getTimer();
_local2.timeMove = _root.timeMove;
_local2.update = _root.updateMatrix;
_root.assignScalingVars(_local2);
_root.cr.push(_local2);
};
showNet = function (st) {
_root.net._visible = st;
};
showMagnetism = function (st) {
_root.frame.magnetismIcon._visible = st;
};
showShield = function (st) {
_root.thing.shield._visible = st;
};
showPacmanAvatar = function (st) {
_root.thing.pacman._visible = st;
_root.thing.blueThing._visible = !st;
};
showSnakeAvatar = function (st) {
_root.thing.snakeHead._visible = st;
_root.thing.blueThing._visible = !st;
};
showPlanesAvatar = function (st) {
if (st) {
_root.thing.planeHolder.attachMovie("playerPlane", "playerPlane", _root.thing.planeHolder.getNextHighestDepth());
_root.thing._width = 50;
_root.thing._height = 36.5;
_root.thing.blueThing._visible = false;
_root.thing.pacman._visible = false;
_root.thing.snakeHead._visible = false;
_root.showShield(false);
_root.thing.update = _root.thingAlternativeUpdate;
} else {
_root.thing.planeHolder.playerPlane.removeMovieClip();
_root.thing._width = 36;
_root.thing._height = 47;
_root.thing.blueThing._visible = true;
_root.thing.update = _root.thingUpdate;
}
};
updateMagnetism = function () {
this.timeMove();
if (this._y > 440) {
this.remove = true;
}
var _local4 = _root.ab(this._x - _root.thing._x);
var _local5 = _root.ab(this._y - _root.thing._y);
var _local3 = _root.thing._width / 2;
if (_local4 < _local3) {
if (_local5 < _local3) {
_root.playPowerupSound();
this.remove = true;
_root.showText("Magnetism", this._x, this._y);
_root.magnetismActive = true;
_root.magnetismActiveTime = getTimer();
_root.showMagnetism(true);
}
}
};
updateBombTrigger = function () {
this.timeMove();
if (this._y > 440) {
this.remove = true;
}
var _local5 = _root.ab(this._x - _root.thing._x);
var _local6 = _root.ab(this._y - _root.thing._y);
var _local4 = _root.thing._width / 2;
if (_local5 < _local4) {
if (_local6 < _local4) {
this.remove = true;
_root.showText("Mine Trigger", this._x, this._y);
_root.playSFX("bomb004");
for (var _local3 in _root.cr) {
if (_root.cr[_local3].bomb == true) {
_root.cr[_local3].remove = true;
_root.showExplosion(_root.cr[_local3]._x, _root.cr[_local3]._y, false);
_root.showScore(100, _root.cr[_local3]._x, _root.cr[_local3]._y);
}
}
}
}
};
spawnBombTrigger = function () {
_root.crc++;
var _local2 = _root.createEmptyMovieClip("aBombTrigger" + _root.crc, _root.getNextHighestDepth());
var _local3 = _local2.attachMovie("bombTrigger", "bombTrigger" + _root.crc, _local2.getNextHighestDepth());
_local2._x = _root.getOpenPos();
_local2._y = -20;
_local2.remove = false;
_local2.speed = 1;
_local2.then = getTimer();
_local2.timeMove = _root.timeMove;
_local2.update = _root.updateBombTrigger;
_root.assignScalingVars(_local2);
_root.cr.push(_local2);
};
updateNet = function () {
this.timeMove();
if (this._y > 440) {
this.remove = true;
}
var _local4 = _root.ab(this._x - _root.thing._x);
var _local5 = _root.ab(this._y - _root.thing._y);
var _local3 = _root.thing._width / 2;
if (_local4 < _local3) {
if (_local5 < _local3) {
_root.playPowerupSound();
this.remove = true;
_root.showText("Barrier", this._x, this._y);
_root.netActive = true;
_root.netActiveTime = getTimer();
_root.showNet(true);
}
}
};
spawnNet = function () {
_root.crc++;
var _local2 = _root.createEmptyMovieClip("aNet" + _root.crc, _root.getNextHighestDepth());
var _local3 = _local2.attachMovie("net", "net" + _root.crc, _local2.getNextHighestDepth());
_local2._x = _root.getOpenPos();
_local2._y = -20;
_local2.remove = false;
_local2.speed = 1;
_local2.then = getTimer();
_local2.timeMove = _root.timeMove;
_local2.update = _root.updateNet;
_root.assignScalingVars(_local2);
_root.cr.push(_local2);
};
updateShield = function () {
this.timeMove();
if (this._y > 440) {
this.remove = true;
}
var _local4 = _root.ab(this._x - _root.thing._x);
var _local5 = _root.ab(this._y - _root.thing._y);
var _local3 = _root.thing._width / 2;
if (_local4 < _local3) {
if (_local5 < _local3) {
_root.playPowerupSound();
this.remove = true;
_root.showText("Shield", this._x, this._y);
_root.shieldActive = true;
_root.shieldActiveTime = getTimer();
_root.showShield(true);
}
}
};
spawnShield = function () {
_root.crc++;
var _local2 = _root.createEmptyMovieClip("aShield" + _root.crc, _root.getNextHighestDepth());
var _local3 = _local2.attachMovie("shield", "shield" + _root.crc, _local2.getNextHighestDepth());
_local2._x = _root.getOpenPos();
_local2._y = -20;
_local2.remove = false;
_local2.speed = 1;
_local2.then = getTimer();
_local2.timeMove = _root.timeMove;
_local2.update = _root.updateShield;
_root.assignScalingVars(_local2);
_root.cr.push(_local2);
};
spawnMagnetism = function () {
_root.crc++;
var _local2 = _root.createEmptyMovieClip("aMagnetism" + _root.crc, _root.getNextHighestDepth());
var _local3 = _local2.attachMovie("magnetism", "magnetism" + _root.crc, _local2.getNextHighestDepth());
_local2._x = _root.getOpenPos();
_local2._y = -20;
_local2.remove = false;
_local2.speed = 1;
_local2.then = getTimer();
_local2.timeMove = _root.timeMove;
_local2.update = _root.updateMagnetism;
_root.assignScalingVars(_local2);
_root.cr.push(_local2);
};
doSuperSpawn = function () {
_root.spawnCrystalChance = 50;
};
updateSuperSpawn = function () {
this.timeMove();
if (this._y > 440) {
this.remove = true;
}
var _local4 = _root.ab(this._x - _root.thing._x);
var _local5 = _root.ab(this._y - _root.thing._y);
var _local3 = _root.thing._width / 2;
if (_local4 < _local3) {
if (_local5 < _local3) {
_root.playPowerupSound();
this.remove = true;
_root.showText("Super Spawn", this._x, this._y);
_root.doSuperSpawn();
}
}
};
spawnSuperSpawn = function () {
_root.crc++;
var _local2 = _root.createEmptyMovieClip("aSuperSpawn" + _root.crc, _root.getNextHighestDepth());
var _local3 = _local2.attachMovie("superSpawn", "superSpawn" + _root.crc, _local2.getNextHighestDepth());
_local2._x = _root.getOpenPos();
_local2._y = -20;
_local2.remove = false;
_local2.speed = 1;
_local2.then = getTimer();
_local2.timeMove = _root.timeMove;
_local2.update = _root.updateSuperSpawn;
_root.assignScalingVars(_local2);
_root.cr.push(_local2);
};
doSuperCrystal = function (ty) {
var _local5 = [];
var _local3 = 0;
while (_local3 < _root.cr.length) {
if (_root.cr[_local3].boss != true) {
_local5.push(new flash.geom.Point(_root.cr[_local3]._x, _root.cr[_local3]._y));
_root.cr[_local3].remove = true;
}
_local3++;
}
var _local4 = 0;
while (_local4 < _local5.length) {
_root.crc++;
var _local2 = _root.createEmptyMovieClip("aSuperCrystalOffSpring" + _root.crc, _root.getNextHighestDepth());
var _local7 = _local2.attachMovie("crystal" + ty, "crystal1" + _root.crc, _local2.getNextHighestDepth());
_local2.speed = 1;
_local2._x = _local5[_local4].x;
_local2._y = _local5[_local4].y;
_local2.ty = ty;
_local2.showSpark = _root.showSpark;
_local2.then = getTimer();
_local2.remove = false;
_local2.timeMove = _root.timeMove;
_local2.update = _root.updateCrystal;
_root.assignScalingVars(_local2);
_root.cr_queue.push(_local2);
_local4++;
}
};
updateSuperCrystal = function () {
this.timeMove();
if (this._y > 440) {
this.remove = true;
}
var _local4 = _root.ab(this._x - _root.thing._x);
var _local5 = _root.ab(this._y - _root.thing._y);
var _local3 = _root.thing._width / 2;
if (_local4 < _local3) {
if (_local5 < _local3) {
_root.playPowerupSound();
this.remove = true;
_root.showText("Super Crystal", this._x, this._y);
this.boss = true;
_root.doSuperCrystal(this.ty);
}
}
};
spawnSuperCrystal = function () {
_root.crc++;
var _local4;
var _local6;
var _local3 = _root.pc[_root.pc.length - 1];
if (((_local3 != 1) && (_local3 != 2)) && (_local3 != 3)) {
_local3 = random(3) + 1;
}
switch (_local3) {
case 1 :
_local4 = "superCrystalGreen";
break;
case 2 :
_local4 = "superCrystalRed";
break;
case 3 :
_local4 = "superCrystalYellow";
break;
default :
_local4 = "superCrystalGreen";
_local3 = 1;
}
var _local2 = _root.createEmptyMovieClip("aSuperCrystal" + _root.crc, _root.getNextHighestDepth());
var _local5 = _local2.attachMovie("" + _local4, "" + _local4, _local2.getNextHighestDepth());
_local2._x = _root.getOpenPos();
_local2._y = -20;
_local2.remove = false;
_local2.speed = 1;
_local2.then = getTimer();
_local2.timeMove = _root.timeMove;
_local2.ty = _local3;
_local2.update = _root.updateSuperCrystal;
_root.assignScalingVars(_local2);
_root.cr.push(_local2);
};
removeArkanoid = function () {
_root.arkanoidActive = false;
_root.arkanoidBall.remove = true;
var _local2 = 0;
while (_local2 < _root.cr.length) {
if (_root.cr[_local2].arkBlock) {
_root.cr[_local2].remove = true;
_root.showScore(10, _root.cr[_local2]._x, _root.cr[_local2]._y);
}
_local2++;
}
};
arkanoidBallUpdate = function () {
if (!_root.gamePaused) {
_root.crc++;
var _local3 = _root.createEmptyMovieClip("arkanoidTail" + _root.crc, _root.getNextHighestDepth());
var _local8 = _local3.attachMovie("arkanoidBallInside", "arkBall", _local3.getNextHighestDepth());
_local3._x = this._x;
_local3._y = this._y;
_local3.remove = false;
if (_root.arkanoidBall.steel) {
_local3.arkBall.gotoAndStop("steel");
} else {
_local3.arkBall.gotoAndStop("normal");
}
_local3.update = function () {
if (!_root.gamePaused) {
if (_root.arkanoidBall.steel) {
this.arkBall.gotoAndStop("steel");
} else {
this.arkBall.gotoAndStop("normal");
}
this._alpha = this._alpha - 8;
this._xscale = this._xscale * 0.95;
this._yscale = this._yscale * 0.95;
if (this._alpha < 1) {
this.remove = true;
}
}
};
_root.cr_queue.push(_local3);
if (this.steel) {
this.a1.gotoAndStop("steel");
} else {
this.a1.gotoAndStop("normal");
}
if (this.down == undefined) {
this.down = false;
this.speed = 8;
this.steel = false;
this.xmov = 0.25 + (random(500) / 1000);
this.ymov = 1 - this.xmov;
this.then = getTimer();
}
var _local7 = getTimer();
var _local4 = _local7 - this.then;
this.then = _local7;
if (_local4 > 100) {
_local4 = 10;
}
this._x = this._x + ((this.xmov * this.speed) * (_local4 / 30));
this._y = this._y + ((this.ymov * this.speed) * (_local4 / 30));
var _local6 = false;
var _local5 = false;
if (this._x < 25) {
this._x = 25;
_local5 = true;
} else if (this._x > 575) {
this._x = 575;
_local5 = true;
}
if (this._y < 20) {
this._y = 20;
_local6 = true;
} else if (this._y > 425) {
this._y = 425;
_local6 = true;
}
if (_local5) {
this.xmov = this.xmov * -1;
}
if (_local6) {
this.ymov = this.ymov * -1;
}
}
};
updateSteelBallPowerup = function () {
this.timeMove();
if (this._y > 440) {
this.remove = true;
}
var _local4 = _root.ab(this._x - _root.thing._x);
var _local5 = _root.ab(this._y - _root.thing._y);
var _local3 = _root.thing._width / 2;
if (_local4 < _local3) {
if (_local5 < _local3) {
this.remove = true;
_root.showText("Super Ball", this._x, this._y);
_root.arkanoidBall.steel = true;
}
}
};
spawnArkanoidSteelBall = function (xx, yy) {
_root.crc++;
var _local2 = _root.createEmptyMovieClip("steelballpowerup" + _root.crc, _root.getNextHighestDepth());
var _local3 = _local2.attachMovie("arkanoidSteelBall", "stB", _local2.getNextHighestDepth());
_local2._x = xx;
_local2._y = yy;
_local2.remove = false;
_local2.then = getTimer();
_local2.timeMove = _root.timeMove;
_local2.speed = 1;
_local2.update = _root.updateSteelBallPowerup;
_root.cr_queue.push(_local2);
};
updateArkanoidBlock = function () {
if (!_root.gamePaused) {
if (!this.inPlace) {
this._x = this._x + ((this._destx - this._x) / 5);
this._y = this._y + ((this._desty - this._y) / 5);
if (_root.ab(this._x - this._destx) < 1) {
if (_root.ab(this._y - this._desty) < 1) {
this._x = this._destx;
this._y = this._desty;
this.inPlace = true;
}
}
} else {
var _local3 = _root.arkanoidBall._y;
if (_local3 < 180) {
if (_root.ab(this._y - _local3) < 20) {
var _local6 = _root.arkanoidBall._x;
if (_root.ab(this._x - _local6) < 50) {
if (_root.arkanoidBall.hitTest(this)) {
this.hp--;
if (this.hp <= 0) {
this.remove = true;
_root.showScore(100, this._x, this._y);
if (random(100) < 10) {
_root.spawnArkanoidSteelBall(this._x, this._y);
}
} else {
this.ark.gotoAndStop("broken");
}
if (!_root.arkanoidBall.steel) {
var _local5 = _root.arkanoidBall._y;
var _local4 = this._y + (this._height / 2);
if (_local5 > _local4) {
while (_root.arkanoidBall.hitTest(this)) {
_root.arkanoidBall._y++;
}
_root.arkanoidBall.ymov = _root.arkanoidBall.ymov * -1;
} else {
_root.arkanoidBall.xmov = _root.arkanoidBall.xmov * -1;
if (this._x > _root.arkanoidBall._x) {
while (_root.arkanoidBall.hitTest(this)) {
_root.arkanoidBall._x--;
}
} else {
while (_root.arkanoidBall.hitTest(this)) {
_root.arkanoidBall._x++;
}
}
}
}
}
}
}
}
}
}
};
makeArkanoidBlock = function (ty, x, y) {
_root.crc++;
var _local2 = _root.createEmptyMovieClip("ab" + _root.crc, _root.getNextHighestDepth());
var _local4 = _local2.attachMovie("ark" + ty, "ark", _local2.getNextHighestDepth());
_local2._x = -random(800);
if ((random(10) % 2) == 0) {
_local2._x = _local2._x * -1;
_local2._x = _local2._x + 600;
}
_local2._y = -100;
_local2._destx = 60 + (x * 40);
_local2._desty = 40 + (y * 15);
_local2.inPlace = false;
_local2.update = _root.updateArkanoidBlock;
_local2.remove = false;
_local2.arkBlock = true;
_local2.hp = 1;
_local2._alpha = 60;
if (ty == 5) {
_local2.hp = 2;
}
_root.cr_queue.push(_local2);
};
makeArkanoidGrid = function () {
var _local4 = [[5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5], [2, 2, 2, 4, 2, 2, 5, 3, 3, 1, 3, 3, 3], [2, 2, 4, 4, 2, 2, 5, 3, 3, 1, 1, 3, 3], [2, 4, 4, 4, 4, 4, 5, 1, 1, 1, 1, 1, 3], [4, 4, 4, 4, 4, 4, 5, 1, 1, 1, 1, 1, 1], [2, 4, 4, 4, 4, 4, 5, 1, 1, 1, 1, 1, 3], [2, 2, 4, 4, 2, 2, 5, 3, 3, 1, 1, 3, 3], [2, 2, 2, 4, 2, 2, 5, 3, 3, 1, 3, 3, 3], [5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5]];
var _local3 = 0;
while (_local3 < _local4.length) {
var _local2 = 0;
while (_local2 < _local4[_local3].length) {
_root.makeArkanoidBlock(_local4[_local3][_local2], _local2, _local3);
_local2++;
}
_local3++;
}
};
doArkanoid = function () {
_root.clearStageForBoss(false);
_root.makeArkanoidGrid();
_root.arkanoidActive = true;
_root.arkanoidTime = getTimer();
var _local2 = _root.createEmptyMovieClip("arkanoidBall", _root.getNextHighestDepth());
var _local3 = _local2.attachMovie("arkanoidBallInside", "a1", _local2.getNextHighestDepth());
_local2.update = _root.arkanoidBallUpdate;
_local2._x = 300;
_local2._y = 350;
_root.ef.push(_local2);
};
updateArkanoid = function () {
this.timeMove();
if (this._y > 440) {
this.remove = true;
}
var _local4 = _root.ab(this._x - _root.thing._x);
var _local5 = _root.ab(this._y - _root.thing._y);
var _local3 = _root.thing._width / 2;
if (_local4 < _local3) {
if (_local5 < _local3) {
_root.playPowerupSound();
this.remove = true;
if (!_root.arkanoidActive) {
_root.showText("Arkanoid", this._x, this._y);
_root.doArkanoid();
}
}
}
};
spawnArkanoid = function () {
_root.crc++;
var _local2 = _root.createEmptyMovieClip("aArkanoid" + _root.crc, _root.getNextHighestDepth());
var _local3 = _local2.attachMovie("arkanoid", "arkanoid", _local2.getNextHighestDepth());
_local2._x = _root.getOpenPos();
_local2._y = -20;
_local2.remove = false;
_local2.speed = 0.8;
_local2.then = getTimer();
_local2.timeMove = _root.timeMove;
_local2.update = _root.updateArkanoid;
_root.assignScalingVars(_local2);
_root.cr.push(_local2);
};
updateGembar = function (a1, a2, a3) {
if (a1 != undefined) {
_root.frame.gembar.cont.one._alpha = a1;
}
if (a2 != undefined) {
_root.frame.gembar.cont.two._alpha = a2;
}
if (a3 != undefined) {
_root.frame.gembar.cont.three._alpha = a3;
}
if (((_root.frame.gembar.cont.one._alpha + _root.frame.gembar.cont.two._alpha) + _root.frame.gembar.cont.three._alpha) == 300) {
_root.updateGembar(10, 10, 10);
_root.frame.gembar.cont.white._alpha = 100;
_root.frame.gembar.cont.white.onEnterFrame = function () {
this._alpha = this._alpha - 10;
if (this._alpha <= 0) {
delete this.onEnterFrame;
}
};
_root.doRings();
}
};
addToGembar = function (a1, a2, a3) {
if (a1 != undefined) {
_root.frame.gembar.cont.one._alpha = _root.frame.gembar.cont.one._alpha + a1;
}
if (a2 != undefined) {
_root.frame.gembar.cont.two._alpha = _root.frame.gembar.cont.two._alpha + a2;
}
if (a3 != undefined) {
_root.frame.gembar.cont.three._alpha = _root.frame.gembar.cont.three._alpha + a3;
}
};
updateRing = function () {
this.timeMove();
if (this._y > 440) {
this.remove = true;
}
var _local4 = _root.ab(this._x - _root.thing._x);
var _local5 = _root.ab(this._y - _root.thing._y);
var _local3 = _root.thing._width / 2;
if (_local4 < _local3) {
if (_local5 < _local3) {
this.remove = true;
_root.playSFX("ring_sound", 40);
_root.showScore(100, this._x, this._y);
}
}
};
spawnRing = function (xx) {
_root.crc++;
var _local2 = _root.createEmptyMovieClip("ring" + _root.crc, _root.getNextHighestDepth());
var _local3 = _local2.attachMovie("ring", "ring", 1);
_local2._x = xx;
_local2._y = -20;
_local2.remove = false;
_local2.speed = 0.8;
_local2.then = getTimer();
_local2.timeMove = _root.timeMove;
_local2.update = _root.updateRing;
_root.assignScalingVars(_local2);
_root.cr.push(_local2);
};
updateRingsController = function () {
var _local2 = getTimer();
var _local4 = _local2 - this.then;
if (_local4 > 200) {
if (this.spawnAmount > 0) {
this.spawnAmount--;
this.then = _local2;
spawnRing(this.pos);
var _local3 = (((random(10) % 3) == 0) ? 0 : ((((random(10) % 2) == 0) ? 10 : 15)));
if (this.right) {
this.pos = this.pos + _local3;
if (this.pos > 560) {
this.right = false;
}
} else {
this.pos = this.pos - _local3;
if (this.pos < 40) {
this.right = true;
}
}
} else {
this.remove = true;
}
}
};
doRings = function () {
_root.tunnelActive = true;
_root.tunnelTime = getTimer();
var _local2 = _root.createEmptyMovieClip("tunnelController", _root.getNextHighestDepth());
_local2.update = _root.updateRingsController;
_local2.pos = 40 + random(520);
_local2.right = (((random(10) % 2) == 0) ? true : false);
_local2.spawnAmount = 3 + random(_root.currentLevel * 2);
_local2.remove = false;
_local2.then = getTimer();
_root.ef.push(_local2);
};
REFupdateRingsController = function () {
var _local5 = getTimer();
var _local6 = _local5 - this.then;
if (_local6 > 200) {
this.then = _local5;
_root.spawnBomb(this.leftx, -20);
_root.spawnBomb(this.rightx, -20);
var _local4 = 25 - random(50);
var _local3 = 0;
if ((this.dist > 50) || (this.smaller == false)) {
_local3 = random(24);
} else {
_local4 = 8 - random(16);
if (random(10) == 1) {
this.smaller = false;
}
}
if (!this.smaller) {
_local3 = _local3 * -1;
}
this.leftx = this.leftx + (_local4 + (_local3 / 2));
this.rightx = this.rightx + (_local4 - (_local3 / 2));
if (this.leftx < 20) {
this.leftx = 20;
this.rightx = this.dist;
}
if (this.rightx > 580) {
this.rightx = 580;
this.leftx = 580 - this.dist;
}
this.dist = this.rightx - this.leftx;
}
};
REFdoRings = function () {
_root.tunnelActive = true;
_root.tunnelTime = getTimer();
var _local2 = _root.createEmptyMovieClip("tunnelController", _root.getNextHighestDepth());
_local2.update = _root.updateRingsController;
_local2.leftx = 20;
_local2.rightx = 580;
_local2.dist = 580;
_local2.remove = false;
_local2.smaller = true;
_local2.then = getTimer();
_root.ef.push(_local2);
};
doRobots = function () {
_root.robotsActive = true;
_root.robotsTime = getTimer();
};
updateRobots = function () {
this.timeMove();
if (this._y > 440) {
this.remove = true;
}
var _local4 = _root.ab(this._x - _root.thing._x);
var _local5 = _root.ab(this._y - _root.thing._y);
var _local3 = _root.thing._width / 2;
if (_local4 < _local3) {
if (_local5 < _local3) {
_root.playPowerupSound();
this.remove = true;
_root.showText("Feel good", this._x, this._y);
_root.doRobots();
}
}
};
spawnRobots = function () {
_root.crc++;
var _local2 = _root.createEmptyMovieClip("aRobots" + _root.crc, _root.getNextHighestDepth());
var _local3 = _local2.attachMovie("robots", "robots", _local2.getNextHighestDepth());
_local2._x = _root.getOpenPos();
_local2._y = -20;
_local2.remove = false;
_local2.speed = 0.8;
_local2.then = getTimer();
_local2.timeMove = _root.timeMove;
_local2.update = _root.updateRobots;
_root.assignScalingVars(_local2);
_root.cr.push(_local2);
};
updateSpeedDown = function () {
this.timeMove();
if (this._y > 440) {
this.remove = true;
}
var _local4 = _root.ab(this._x - _root.thing._x);
var _local5 = _root.ab(this._y - _root.thing._y);
var _local3 = _root.thing._width / 2;
if (_local4 < _local3) {
if (_local5 < _local3) {
_root.playPowerupSound();
this.remove = true;
_root.showText("Speed Down", this._x, this._y);
_root.updateDesiredSpeed(-3);
_root.speedUpFast = false;
}
}
};
spawnSpeedDown = function () {
_root.crc++;
var _local2 = _root.createEmptyMovieClip("aSpeedDown" + _root.crc, _root.getNextHighestDepth());
var _local3 = _local2.attachMovie("speedDown", "speedDown" + _root.crc, _local2.getNextHighestDepth());
_local2._x = _root.getOpenPos();
_local2._y = -20;
_local2.remove = false;
_local2.speed = 0.8;
_local2.then = getTimer();
_local2.timeMove = _root.timeMove;
_local2.update = _root.updateSpeedDown;
_root.assignScalingVars(_local2);
_root.cr.push(_local2);
};
updateSpeedUp = function () {
this.timeMove();
if (this._y > 440) {
this.remove = true;
}
var _local4 = _root.ab(this._x - _root.thing._x);
var _local5 = _root.ab(this._y - _root.thing._y);
var _local3 = _root.thing._width / 2;
if (_local4 < _local3) {
if (_local5 < _local3) {
_root.playPowerupSound();
this.remove = true;
_root.showText("Speed Up", this._x, this._y);
_root.updateDesiredSpeed(3);
_root.speedUpFast = true;
}
}
};
updateLevelUpBar = function () {
this.timeMove();
if (this._y > 440) {
this._y = -100;
delete this.update;
}
};
makeLevelUpBar = function () {
_root.levelUpBar._x = 0;
_root.levelUpBar._y = -100;
_root.levelUpBar.remove = false;
_root.levelUpBar.speed = 1.2;
_root.levelUpBar.then = getTimer();
_root.levelUpBar.timeMove = _root.timeMove;
_root.levelUpBar.update = _root.updateLevelUpBar;
_root.levelUpBar._alpha = 60;
_root.levelUpBar.lightning = true;
_root.cr.push(_root.levelUpBar);
};
spawnSpeedUp = function () {
_root.crc++;
var _local2 = _root.createEmptyMovieClip("aSpeedUp" + _root.crc, _root.getNextHighestDepth());
var _local3 = _local2.attachMovie("speedUp", "speedUp" + _root.crc, _local2.getNextHighestDepth());
_local2._x = _root.getOpenPos();
_local2._y = -20;
_local2.remove = false;
_local2.speed = 1.2;
_local2.then = getTimer();
_local2.timeMove = _root.timeMove;
_local2.update = _root.updateSpeedUp;
_root.assignScalingVars(_local2);
_root.cr.push(_local2);
};
updateTimersOnUnpause = function () {
var _local3 = getTimer();
var _local2 = _local3 - _root.pauseTime;
_root.matrixTime = _root.matrixTime + _local2;
_root.planesTime = _root.planesTime + _local2;
_root.pacmanTime = _root.pacmanTime + _local2;
_root.robotsTime = _root.robotsTime + _local2;
_root.snakeTime = _root.snakeTime + _local2;
_root.symmetryTime = _root.symmetryTime + _local2;
_root.tunnelTime = _root.tunnelTime + _local2;
_root.arkanoidTime = _root.arkanoidTime + _local2;
_root.tetrisTime = _root.tetrisTime + _local2;
_root.nonUniformDropSpeedTime = _root.nonUniformDropSpeedTime + _local2;
_root.rotationTime = _root.rotationTime + _local2;
_root.shakyMotionTime = _root.shakyMotionTime + _local2;
_root.wavyMotionTime = _root.wavyMotionTime + _local2;
_root.shieldActiveTime = _root.shieldActiveTime + _local2;
_root.netActiveTime = _root.netActiveTime + _local2;
_root.magnetismActiveTime = _root.magnetismActiveTime + _local2;
};
keyListener.onKeyDown = function () {
if (Key.getCode() == 32) {
_root.gamePaused = !_root.gamePaused;
if (_root.gamePaused) {
_root.pauseTime = getTimer();
Mouse.show();
_root.gamePausedScreenCampaign._x = 300;
_root.toggleMainMenuButtons(true);
_root.gamePausedScreenCampaign.swapDepths(_root.getNextHighestDepth());
_root.frame.swapDepths(_root.getNextHighestDepth());
} else {
_root.gamePausedScreenCampaign._x = -475;
_root.gamePausedScreenFreePlay._x = -475;
_root.creditsScreen._x = -475;
_root.helpScreen._x = -475;
_root.optionsScreen._x = -475;
_root.toggleMainMenuButtons(false);
Mouse.hide();
_root.updateTimersOnUnpause();
}
}
};
updateSpeedStr = function () {
if (!_root.gamePaused) {
_root.baseSpeedStr = "" + _root.df(_root.baseSpeed, 2);
}
};
clock = function () {
if (!_root.gamePaused) {
_root.seconds++;
if (_root.seconds == 60) {
if (!_root.freePlayActive) {
_root.kongregateStats.submit("campaignMinutes", 1);
} else {
_root.kongregateStats.submit("freePlayMinutes", 1);
}
_root.seconds = 0;
_root.minutes++;
if (_root.minutes == 60) {
_root.minutes = 0;
_root.hours++;
}
}
_root.timestring = ((_root.hours > 9) ? (hours) : ("0" + _root.hours));
_root.timestring = _root.timestring + ":";
_root.timestring = _root.timestring + ((_root.minutes > 9) ? (_root.minutes) : ("0" + _root.minutes));
_root.timestring = _root.timestring + ":";
_root.timestring = _root.timestring + ((_root.seconds > 9) ? (_root.seconds) : ("0" + _root.seconds));
}
};
updateSpawnProbabilities = function () {
var _local2 = _root.powerUpsEnabled;
_local2 = _local2 * 0.15;
_root.speedUpActProb = _root.ro(_root.speedUpBaseProb * _local2);
_root.speedDownActProb = _root.ro(_root.speedDownBaseProb * _local2);
_root.lightningActProb = _root.ro(_root.lightningBaseProb * _local2);
_root.netActProb = _root.ro(_root.netBaseProb * _local2);
_root.triggerActProb = _root.ro(_root.triggerBaseProb * _local2);
_root.magnetismActProb = _root.ro(_root.magnetismBaseProb * _local2);
_root.shieldActProb = _root.ro(_root.shieldBaseProb * _local2);
_root.superSpawnActProb = _root.ro(_root.superSpawnBaseProb * _local2);
_root.superCrystalsActProb = _root.ro(_root.superCrystalsBaseProb * _local2);
_root.rotationActProb = _root.ro(_root.rotationBaseProb * _local2);
_root.nonUniformDropSpeedActProb = _root.ro(_root.nonUniformDropSpeedBaseProb * _local2);
_root.shakyMotionActProb = _root.ro(_root.shakyMotionBaseProb * _local2);
_root.wavyMotionActProb = _root.ro(_root.wavyMotionBaseProb * _local2);
_root.pacmanActProb = _root.ro(_root.pacmanBaseProb * _local2);
_root.matrixActProb = _root.ro(_root.matrixBaseProb * _local2);
_root.tetrisActProb = _root.ro(_root.tetrisBaseProb * _local2);
_root.symmetryActProb = _root.ro(_root.symmetryBaseProb * _local2);
_root.snakeActProb = _root.ro(_root.snakeBaseProb * _local2);
_root.planesActProb = _root.ro(_root.planesBaseProb * _local2);
_root.robotsActProb = _root.ro(_root.robotsBaseProb * _local2);
_root.tunnelActProb = _root.ro(_root.tunnelBaseProb * _local2);
};
levelUp = function () {
if (!_root.freePlayActive) {
_root.updateScoresOnKongregate();
}
if (!_root.gamePaused) {
if (!_root.bossOneActive) {
if (!_root.bossTwoActive) {
if (!_root.bossThreeActive) {
if (!_root.bossFourActive) {
if (_root.levelSpeed < _root.MAX_SPEED) {
_root.levelSpeed = _root.levelSpeed + _root.levelUpSpeedModifier;
_root.levelMaxSpeed = _root.levelMaxSpeed + _root.levelUpSpeedModifier;
_root.levelMinSpeed = _root.levelMinSpeed + _root.levelUpSpeedModifier;
_root.updateDesiredSpeed(_root.levelUpSpeedModifier);
if (_root.levelSpeed > _root.MAX_SPEED) {
_root.levelSpeed = _root.MAX_SPEED;
}
if (_root.levelMaxSpeed > _root.MAX_SPEED) {
_root.levelMaxSpeed = _root.MAX_SPEED;
}
if (_root.levelMinSpeed > _root.MAX_SPEED) {
_root.levelMinSpeed = _root.MAX_SPEED;
}
}
_root.currentLevel++;
_root.makeLevelUpBar();
}
}
}
}
}
};
disableAllFlags = function () {
_root.speedUpFlag = false;
_root.speedDownFlag = false;
_root.lightningFlag = false;
_root.netFlag = false;
_root.triggerFlag = false;
_root.magnetismFlag = false;
_root.shieldFlag = false;
_root.superSpawnFlag = false;
_root.superCrystalsFlag = false;
_root.rotationFlag = false;
_root.nonUniformDropSpeedFlag = false;
_root.shakyMotionFlag = false;
_root.wavyMotionFlag = false;
_root.pacmanFlag = false;
_root.matrixFlag = false;
_root.tetrisFlag = false;
_root.symmetryFlag = false;
_root.snakeFlag = false;
_root.planesFlag = false;
_root.robotsFlag = false;
_root.tunnelFlag = false;
_root.arkanoidFlag = false;
};
showLivesGui = function (sh) {
_root.frame.livesGui._visible = sh;
};
boss1main = function () {
if (_root.cr_queue.length > 0) {
_root.cr = _root.cr.concat(_root.cr_queue);
_root.cr_queue = [];
}
if (!_root.gamePaused) {
_root.updateSpeed();
_root.thing.update();
_root.frame.update();
_root.matrixbg.update();
_root.whiteBg.update();
_root.bossbg.update();
var _local4 = new Array();
for (var _local6 in _root.cr) {
if (!_root.cr[_local6].remove) {
_root.cr[_local6].update();
_local4.push(_root.cr[_local6]);
} else {
_root.cr[_local6].removeMovieClip();
}
}
_root.cr = _local4;
var _local2 = new Array();
for (var _local5 in _root.lig) {
if (!_root.lig[_local5].remove) {
_root.lig[_local5].update();
_local2.push(_root.lig[_local5]);
} else {
_root.lig[_local5].removeMovieClip();
}
}
_root.lig = _local2;
var _local3 = new Array();
for (var _local7 in _root.ef) {
if (!_root.ef[_local7].remove) {
_root.ef[_local7].update();
_local3.push(_root.ef[_local7]);
} else {
_root.ef[_local7].removeMovieClip();
}
}
_root.ef = _local3;
}
};
spawnFishSequence = function () {
trace("running function spawnfishsequence");
var _local7 = 4;
var _local8 = 2;
var _local3 = 0;
while (_local3 < _local8) {
var _local4 = ((Math.random() < 0.5) ? true : false);
var _local6 = 30 - random(60);
var _local5 = 30 * (1 + random(3));
var _local2 = 0;
while (_local2 < _local7) {
_root.spawnFish((600 / _local3) + _local6, -(_local2 * _local5), _local4);
_local2++;
}
_local3++;
}
trace((((_local7 + ",") + _local8) + ",") + _local4);
};
main = function () {
if (_root.cr_queue.length > 0) {
_root.cr = _root.cr.concat(_root.cr_queue);
_root.cr_queue = [];
}
if (!_root.gamePaused) {
_root.updateSpeed();
_root.thing.update();
_root.frame.update();
_root.matrixbg.update();
_root.whiteBg.update();
_root.bossbg.update();
if (!_root.planesActive) {
if (random(100) < _root.spawnCrystalChance) {
_root.spawnCrystal(random(3) + 1);
}
if (_root.spawnCrystalChance > _root.minSpawnCrystalChance) {
if (random(3) == 0) {
_root.spawnCrystalChance--;
}
}
}
if (_root.tunnelActive == false) {
}
if (random(100) < _root.activeFlags) {
_root.spawnBomb();
}
if (!_root.symmetryActive) {
if (!_root.planesActive) {
if (_root.speedUpFlag) {
if (random(_root.speedUpActProb) < 1) {
_root.spawnSpeedUp();
}
}
if (_root.speedDownFlag) {
if (random(_root.speedDownActProb) < 1) {
_root.spawnSpeedDown();
}
}
if (_root.lightningFlag) {
if (random(_root.lightningActProb) < 1) {
_root.spawnLightning();
}
}
if (_root.superSpawnFlag) {
if (random(_root.superSpawnActProb) < 1) {
_root.spawnSuperSpawn();
}
}
if (_root.magnetismFlag) {
if (random(_root.magnetismActProb) < 1) {
_root.spawnMagnetism();
}
}
if (_root.netFlag) {
if (random(_root.netActProb) < 1) {
_root.spawnNet();
}
}
if (_root.triggerFlag) {
if (random(_root.triggerActProb) < 1) {
_root.spawnBombTrigger();
}
}
if (_root.shieldFlag) {
if (random(_root.shieldActProb) < 1) {
_root.spawnShield();
}
}
if (_root.superCrystalsFlag) {
if (random(_root.superCrystalsActProb) < 1) {
_root.spawnSuperCrystal();
}
}
if (_root.wavyMotionFlag) {
if (random(_root.wavyMotionActProb) < 1) {
_root.spawnWaves();
}
}
if (_root.shakyMotionFlag) {
if (random(_root.shakyMotionActProb) < 1) {
_root.spawnShakes();
}
}
if (_root.rotationFlag) {
if (random(_root.rotationActProb) < 1) {
_root.spawnRotation();
}
}
if (_root.nonUniformDropSpeedFlag) {
if (random(_root.nonUniformDropSpeedActProb) < 1) {
_root.spawnDropSpeed();
}
}
if (_root.pacmanFlag) {
if (_root.pacmanActive == false) {
if (random(_root.pacmanActProb) < 1) {
_root.spawnPacman();
}
}
}
if (_root.matrixFlag) {
if (_root.matrixActive == false) {
if (random(_root.matrixActProb) < 1) {
_root.spawnMatrix();
}
}
}
if (_root.tetrisFlag) {
if (_root.tetrisActive == false) {
if (random(_root.tetrisActProb) < 1) {
_root.spawnTetris();
}
}
}
if (_root.symmetryFlag) {
if (_root.symmetryActive == false) {
if (random(_root.symmetryActProb) < 1) {
_root.spawnSymmetry();
}
}
}
if (_root.snakeFlag) {
if (_root.snakeActive == false) {
if (random(_root.snakeActProb) < 1) {
_root.spawnSnake();
}
}
}
if (_root.planesFlag) {
if (_root.planesActive == false) {
if (random(_root.planesActProb) < 1) {
_root.spawnPlanes();
}
}
}
if (_root.robotsFlag) {
if (_root.robotsActive == false) {
if (random(_root.robotsActProb) < 1) {
_root.spawnRobots();
}
}
}
if (_root.arkanoidFlag) {
if (_root.arkanoidActive == false) {
if (random(_root.arkanoidActProb) < 1) {
_root.spawnArkanoid();
}
}
}
} else {
if (random(100) < 1) {
_root.spawnFighterPlane();
}
if (random(200) < 1) {
_root.spawnBomberPlane();
}
}
}
var _local2 = getTimer();
if (_root.magnetismActive) {
if ((_local2 - _root.magnetismActiveTime) > 10000) {
_root.magnetismActive = false;
_root.showMagnetism(false);
}
}
if (_root.netActive) {
if ((_local2 - _root.netActiveTime) > 10000) {
_root.netActive = false;
_root.showNet(false);
}
}
if (_root.shieldActive) {
if ((_local2 - _root.shieldActiveTime) > 10000) {
_root.shieldActive = false;
_root.showShield(false);
}
}
if (_root.wavyMotionActive) {
if ((_local2 - _root.wavyMotionTime) > 10000) {
_root.wavyMotionActive = false;
}
}
if (_root.shakyMotionActive) {
if ((_local2 - _root.shakyMotionTime) > 10000) {
_root.shakyMotionActive = false;
}
}
if (_root.rotationActive) {
if ((_local2 - _root.rotationTime) > 10000) {
_root.rotationActive = false;
}
}
if (_root.nonUniformDropSpeedActive) {
if ((_local2 - _root.nonUniformDropSpeedTime) > 10000) {
_root.nonUniformDropSpeedActive = false;
}
}
if (_root.pacmanActive) {
if ((_local2 - _root.pacmanTime) > 15000) {
_root.pacmanActive = false;
_root.showPacmanAvatar(false);
}
}
if (_root.tetrisActive) {
if ((_local2 - _root.tetrisTime) > 15000) {
_root.tetrisActive = false;
}
}
if (_root.symmetryActive) {
if ((_local2 - _root.symmetryTime) > 15000) {
_root.symmetryActive = false;
}
}
if (_root.snakeActive) {
if ((_local2 - _root.snakeTime) > 15000) {
_root.snakeActive = false;
_root.showSnakeAvatar(false);
}
}
if (_root.robotsActive) {
if ((_local2 - _root.robotsTime) > 15000) {
_root.robotsActive = false;
}
}
if (_root.tunnelActive) {
if ((_local2 - _root.tunnelTime) > 30000) {
_root.tunnelActive = false;
_root.tunnelController.remove = true;
_root.showText("Tunnel Bonus:", 300, 212);
_root.showScore(1000, 300, 230);
}
}
if (_root.arkanoidActive) {
if ((_local2 - _root.arkanoidTime) > 30000) {
_root.removeArkanoid();
}
}
var _local5 = new Array();
for (var _local7 in _root.cr) {
if (!_root.cr[_local7].remove) {
_root.cr[_local7].update();
_local5.push(_root.cr[_local7]);
} else {
_root.cr[_local7].removeMovieClip();
}
}
_root.cr = _local5;
var _local3 = new Array();
for (var _local6 in _root.lig) {
if (!_root.lig[_local6].remove) {
_root.lig[_local6].update();
_local3.push(_root.lig[_local6]);
} else {
_root.lig[_local6].removeMovieClip();
}
}
_root.lig = _local3;
var _local4 = new Array();
for (var _local8 in _root.ef) {
if (!_root.ef[_local8].remove) {
_root.ef[_local8].update();
_local4.push(_root.ef[_local8]);
} else {
_root.ef[_local8].removeMovieClip();
}
}
_root.ef = _local4;
}
};
showInfoBox = function (id, msg) {
_root.tuteBoxOn = true;
_root.aInfo.removeMovieClip();
var _local3 = _root.createEmptyMovieClip("aInfo", _root.getNextHighestDepth());
var _local4 = _local3.attachMovie("infoBox" + id, "infoBox" + getTimer(), _local3.getNextHighestDepth());
_local4.box.msg.text = msg;
_local3._alpha = 80;
_local3._x = 300;
_local3._y = 225;
_local4.play();
_local4.box.continueButton.onRelease = function () {
_root.playSFX("pageflip");
this._parent._parent.play();
_root.tuteBox++;
};
if (id == 0) {
_local4.box.skipButton.onRelease = function () {
this._parent._parent.play();
_root.tuteBox = 5;
};
}
};
mainTute1 = function () {
if (!_root.gamePaused) {
_root.updateSpeed();
_root.thing.update();
_root.frame.update();
var _local3 = new Array();
for (var _local4 in _root.ef) {
if (!_root.ef[_local4].remove) {
_root.ef[_local4].update();
_local3.push(_root.ef[_local4]);
} else {
_root.ef[_local4].removeMovieClip();
}
}
_root.ef = _local3;
if (_root.tuteBoxOn == false) {
switch (_root.tuteBox) {
case 0 :
_root.showInfoBox(0, "Just a few things you need to know before playing...\n\n1. You control Sonic. See how he follows when you move the mouse.");
break;
case 1 :
_root.showInfoBox(1, "2. This bar shows how many lives you have left. Preserve them by avoiding collision with spiky badniks ( ).");
break;
case 20 :
_root.showInfoBox(2, "3. This is the time you spent playing.");
break;
case 2 :
_root.showInfoBox(3, "4. These are your points. You earn them by collecting crystals ( , , ) and rings ( ).\n\nIn order to unlock a series of rings, collect one crystal of each color.");
break;
case 3 :
_root.showInfoBox(4, "5. This is the current game speed. The game speeds up at every checkpoint you pass.");
break;
case 40 :
_root.showInfoBox(5, "6. Powerups like these ( , , ) can offer new abilities or alter the game world to create special challenges. Press <SPACEBAR> anytime to bring up the HELP menu and read more about powerups.");
break;
case 4 :
_root.showInfoBox(6, "That's pretty much it.\n\nRemember you can press <SPACEBAR> to bring up the menu.");
break;
case 5 :
_root.onEnterFrame = main;
Key.addListener(_root.keyListener);
_root.levelInterval = setInterval(this, "levelUp", 15000);
_root.clockInterval = setInterval(this, "clock", 1000);
_root.speedStrInterval = setInterval(this, "updateSpeedStr", 100);
Mouse.hide();
break;
}
}
}
};
OBSOLETEmainTute1 = function () {
if (!_root.gamePaused) {
_root.updateSpeed();
_root.thing.update();
_root.frame.update();
var _local3 = new Array();
for (var _local4 in _root.ef) {
if (!_root.ef[_local4].remove) {
_root.ef[_local4].update();
_local3.push(_root.ef[_local4]);
} else {
_root.ef[_local4].removeMovieClip();
}
}
_root.ef = _local3;
if (_root.tuteBoxOn == false) {
switch (_root.tuteBox) {
case 0 :
_root.showInfoBox(0, "Just a few things you need to know before playing...\n\n1. You control Sonic. See how he follows when you move the mouse.");
break;
case 1 :
_root.showInfoBox(1, "2. This bar shows how many lives you have left. Preserve them by avoiding collision with spiky badniks ( ).");
break;
case 2 :
_root.showInfoBox(2, "3. This is the time you spent playing. The longer you play, the more features and powerups will become unlocked. The game also speeds up slightly over time.");
break;
case 3 :
_root.showInfoBox(3, "4. These are your points. You earn them mainly by collecting crystals ( , , ).\n\nYou get more points for collecting longer series of crystals of the same color.");
break;
case 4 :
_root.showInfoBox(4, "5. This is the current game speed. Score is based on speed, so you get more points the faster you go.");
break;
case 5 :
_root.showInfoBox(5, "6. Powerups like these ( , , ) can offer new abilities or alter the game world to create special challenges. Press <SPACEBAR> anytime to bring up the HELP menu and read more about powerups.");
break;
case 6 :
_root.showInfoBox(6, "That's pretty much it.\n\nTry collecting some crystals while avoiding the mines.\n\nRemember you can press <SPACEBAR> to bring up the menu.");
break;
case 7 :
_root.onEnterFrame = main;
Key.addListener(_root.keyListener);
_root.levelInterval = setInterval(this, "levelUp", 15000);
_root.clockInterval = setInterval(this, "clock", 1000);
_root.speedStrInterval = setInterval(this, "updateSpeedStr", 100);
Mouse.hide();
break;
}
}
}
};
mainTute2 = function () {
if (!_root.gamePaused) {
_root.updateSpeed();
_root.thing.update();
_root.frame.update();
var _local3 = new Array();
for (var _local4 in _root.ef) {
if (!_root.ef[_local4].remove) {
_root.ef[_local4].update();
_local3.push(_root.ef[_local4]);
} else {
_root.ef[_local4].removeMovieClip();
}
}
_root.ef = _local3;
if (_root.tuteBoxOn == false) {
switch (_root.tuteBox) {
case 0 :
_root.showInfoBox(0, "Welcome to 'free play mode'\nJust a few things you need to know before playing...\n\n1. You control the blue blob that follows the mouse cursor around.");
break;
case 1 :
_root.showInfoBox(1, "2. This bar shows how many lives you have left. Preserve them by avoiding collision with dangerous mines ( ).");
break;
case 2 :
_root.showInfoBox(2, "3. This is the time you spent playing. The game speeds up slightly over time.");
break;
case 3 :
_root.showInfoBox(3, "4. These are your points. You earn them mainly by collecting crystals ( , , ). You get more points for collecting longer series of crystals of the same color.\n\nIn free play you won't be able to submit your final score.");
break;
case 4 :
_root.showInfoBox(4, "5. This is the current game speed. Score is based on speed, so you get more points the faster you go.");
break;
case 5 :
_root.showInfoBox(5, "6. Powerups like these ( , , ) can offer new abilities or alter the game world to create special challenges. In free play mode they're all enabled from the beginning!");
break;
case 6 :
_root.showInfoBox(6, "That's pretty much it.\nHave fun experimenting in free play mode. Try collecting some crystals while avoiding the mines.\n\nRemember you can press <SPACEBAR> to bring up the menu at any time.");
break;
case 7 :
_root.onEnterFrame = main;
Key.addListener(_root.keyListener);
_root.levelInterval = setInterval(this, "levelUp", 60000);
_root.clockInterval = setInterval(this, "clock", 1000);
_root.speedStrInterval = setInterval(this, "updateSpeedStr", 100);
Mouse.hide();
break;
}
}
}
};
_root.showLivesGui(true);
if (_root.freePlayActive) {
_root.onEnterFrame = mainTute2;
} else {
_root.disableAllFlags();
_root.onEnterFrame = mainTute1;
}
thing.update = _root.thingUpdate;
_root.makePausedScreen();
_root.showMagnetism(false);
_root.showNet(false);
_root.showShield(false);
_root.showPacmanAvatar(false);
_root.showSnakeAvatar(false);
_root.showPlanesAvatar(false);
_root.showBossBar(false);
_root.updateGembar(10, 10, 10);
_root.thing.then = getTimer();
_root.thing.shrink = 0;
_root.thing.desiredWidth = 16;
_root.shuffleResetAr();
_root.playCurrentTrack();
Frame 20
stop();
Mouse.show();
_root.thing.removeMovieClip();
_root.updateScoresOnKongregate();
delete _root.music.onSoundComplete;
_root.playMusic("Sonic14", 999, false);
delete _root.onEnterFrame;
_root.onEnterFrame = function () {
};
clearInterval(_root.levelInterval);
clearInterval(_root.clockInterval);
clearInterval(_root.speedStrInterval);
_root.frame.removeMovieClip();
_root.helpScreen.removeMovieClip();
_root.creditsScreen.removeMovieClip();
_root.optionsScreen.removeMovieClip();
_root.levelupBar.removeMovieClip();
for (var j in _root.lig) {
_root.lig[j].removeMovieClip();
}
for (var i in _root.cr) {
_root.cr[i].removeMovieClip();
}
for (var m in _root.ef) {
_root.ef[m].removeMovieClip();
}
if (_root.cr_queue.length > 0) {
for (var lol in _root.cr_queue) {
_root.cr_queue[lol].removeMovieClip();
}
}
_root.lig = [];
_root.cr = [];
_root.ef = [];
_root.cr_queue = [];
var i = 0;
while (i < 100) {
_root["particle" + i].removeMovieClip();
i++;
}
_root.aInfo.removeMovieClip();
_root.frameNoGui.removeMovieClip();
_root.frameNoGui2.removeMovieClip();
for (var j in _root) {
if (typeof(_root[j]) == "movieclip") {
if (_root[j].cpy == true) {
_root[j].removeMovieClip();
}
}
}
Key.removeListener(keyListener);
delete _root.keyListener;
scoresCallback = function (res) {
var _local8 = _root.createEmptyMovieClip("aKongLead", _root.getNextHighestDepth());
var _local6 = _local8.createTextField("bPos", _local8.getNextHighestDepth(), 0, 200, 30, 300);
var _local4 = _local8.createTextField("bName", _local8.getNextHighestDepth(), 50, 200, 100, 300);
var _local5 = _local8.createTextField("bScore", _local8.getNextHighestDepth(), 150, 200, 180, 300);
var _local9 = new TextFormat();
_local9.color = 16777215 /* 0xFFFFFF */;
_local9.size = 12;
_local9.font = "MagistralC-Bold";
var _local10 = new TextFormat();
_local10.color = 16777215 /* 0xFFFFFF */;
_local10.size = 12;
_local10.font = "MagistralC-Bold";
_local6.selectable = false;
_local6.multiline = true;
_local6.wordWrap = true;
_local4.selectable = false;
_local4.multiline = true;
_local4.wordWrap = true;
_local5.selectable = false;
_local5.multiline = true;
_local5.wordWrap = true;
_local9.align = "right";
_local10.align = "left";
var _local2 = 0;
while (_local2 < 10) {
var _local3 = _local2 + 1;
_local6.text = _local6.text + (_local3 + ".\n");
_local4.text = _local4.text + (res.list[_local2].username + newline);
_local5.text = _local5.text + (res.list[_local2].score + newline);
_local2++;
}
_local6.antiAliasType = "advanced";
_local6.embedFonts = true;
_local6.setTextFormat(_local9);
_local6._x = 0;
_local6._y = 200 - (b._height / 2);
_local4.antiAliasType = "advanced";
_local4.embedFonts = true;
_local4.setTextFormat(_local10);
_local4._x = 30;
_local4._y = 200 - (b._height / 2);
_local5.antiAliasType = "advanced";
_local5.embedFonts = true;
_local5.setTextFormat(_local9);
_local5._x = 150;
_local5._y = 200 - (b._height / 2);
_local8._x = 300 - (_local8._width / 2);
_local8._y = -70;
};
if (!_root.freePlayActive) {
_root.submitScoreLabel.text = "do you want to submit your score?";
_root.continueButton._visible = false;
_root.yesButton.onRelease = function () {
mochi.MochiScores.showLeaderboard({boardID:"b2b94607cc8294c7", score:_root.playerScore});
};
} else {
_root.submitScoreLabel.text = "no highscores in free play mode";
_root.noButton._visible = false;
_root.yesButton._visible = false;
_root.continueButton.onRelease = function () {
_root.play();
};
_root.continueButton.onRollOver = function () {
_root.playSFX("uhuw");
this.gotoAndStop("highlight");
};
_root.continueButton.onReleaseOutside = (_root.continueButton.onRollOut = function () {
this.gotoAndStop("normal");
});
}
_root.noButton.onRelease = function () {
_root.play();
};
_root.yesButton.onRollOver = function () {
_root.playSFX("uhuw");
this.gotoAndStop("highlight");
};
_root.noButton.onRollOver = function () {
_root.playSFX("whuw");
this.gotoAndStop("highlight");
};
_root.noButton.onReleaseOutside = (_root.yesButton.onReleaseOutside = (_root.noButton.onRollOut = (_root.yesButton.onRollOut = function () {
this.gotoAndStop("normal");
})));
Frame 21
stop();
_root.gotoAndPlay("init");
Symbol 85 MovieClip Frame 1
stop();
Symbol 85 MovieClip Frame 10
stop();
Symbol 107 MovieClip [spark2] Frame 35
if (_root.gamePaused) {
this.stop();
this.remove = true;
}
Symbol 112 MovieClip [planeExplosion] Frame 6
stop();
Symbol 114 MovieClip [bombExplosion] Frame 6
stop();
Symbol 138 MovieClip [bomb3] Frame 1
Symbol 138 MovieClip [bomb3] Frame 30
this.gotoAndPlay("normal");
Symbol 138 MovieClip [bomb3] Frame 31
stop();
Symbol 139 MovieClip [infoBox1] Frame 10
stop();
Symbol 139 MovieClip [infoBox1] Frame 20
_root.tuteBoxOn = false;
this.removeMovieClip();
Symbol 143 MovieClip [infoBox2] Frame 10
stop();
Symbol 143 MovieClip [infoBox2] Frame 20
_root.tuteBoxOn = false;
this.removeMovieClip();
Symbol 147 MovieClip [infoBox4] Frame 10
stop();
Symbol 147 MovieClip [infoBox4] Frame 20
_root.tuteBoxOn = false;
this.removeMovieClip();
Symbol 169 MovieClip [infoBox3] Frame 10
stop();
Symbol 169 MovieClip [infoBox3] Frame 20
_root.tuteBoxOn = false;
this.removeMovieClip();
Symbol 179 MovieClip [infoBox5] Frame 10
stop();
Symbol 179 MovieClip [infoBox5] Frame 20
_root.tuteBoxOn = false;
this.removeMovieClip();
Symbol 180 MovieClip [infoBox6] Frame 10
stop();
Symbol 180 MovieClip [infoBox6] Frame 20
_root.tuteBoxOn = false;
this.removeMovieClip();
Symbol 185 MovieClip [infoBox0] Frame 10
stop();
Symbol 185 MovieClip [infoBox0] Frame 20
_root.tuteBoxOn = false;
this.removeMovieClip();
Symbol 190 MovieClip [ghost4] Frame 1
stop();
Symbol 190 MovieClip [ghost4] Frame 10
stop();
Symbol 193 MovieClip [ghost3] Frame 1
stop();
Symbol 193 MovieClip [ghost3] Frame 10
stop();
Symbol 196 MovieClip [ghost2] Frame 1
stop();
Symbol 196 MovieClip [ghost2] Frame 10
stop();
Symbol 199 MovieClip [ghost1] Frame 1
stop();
Symbol 199 MovieClip [ghost1] Frame 10
stop();
Symbol 302 MovieClip Frame 1
stop();
Symbol 302 MovieClip Frame 60
stop();
Symbol 320 MovieClip [whitebg] Frame 1
stop();
Symbol 320 MovieClip [whitebg] Frame 35
stop();
Symbol 320 MovieClip [whitebg] Frame 95
stop();
Symbol 323 MovieClip [matrixBg] Frame 1
stop();
Symbol 323 MovieClip [matrixBg] Frame 35
stop();
Symbol 323 MovieClip [matrixBg] Frame 95
stop();
Symbol 505 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)) {
trace("MochiServices Connecting...");
_connecting = true;
init(id, clip);
}
if (onError != undefined) {
mochi.MochiServices.onError = onError;
} else if (mochi.MochiServices.onError == undefined) {
mochi.MochiServices.onError = function (errorCode) {
trace(errorCode);
};
}
}
static function disconnect() {
if (_connected || (_connecting)) {
_connecting = (_connected = false);
flush(true);
if (_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) {
trace("MochiServices could not load.");
mochi.MochiServices.disconnect();
mochi.MochiServices.onError.apply(null, [errorCode]);
};
_loaderListener.onLoadStart = function (target_mc) {
this.isLoading = true;
};
_loaderListener.startTime = getTimer();
_loaderListener.wait = function () {
if ((getTimer() - this.startTime) > 10000) {
if (!this.isLoading) {
mochi.MochiServices.disconnect();
mochi.MochiServices.onError.apply(null, ["IOError"]);
}
clearInterval(this.waitInterval);
}
};
_loaderListener.waitInterval = setInterval(_loaderListener, "wait", 1000);
_loader.addListener(_loaderListener);
_loader.loadClip(_gatewayURL, _clip);
_sendChannel = new LocalConnection();
_sendChannel._queue = [];
_rcvChannel = new LocalConnection();
_rcvChannel.allowDomain = function (d) {
return(true);
};
_rcvChannel.allowInsecureDomain = _rcvChannel.allowDomain;
_rcvChannel._nextcallbackID = 0;
_rcvChannel._callbacks = {};
listen();
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);
trace("Waiting for MochiAds services to connect...");
}
static function initComChannels() {
if (!_connected) {
_sendChannel.onStatus = function (infoObject) {
mochi.MochiServices.onStatus(infoObject);
};
_sendChannel.send(_sendChannelName, "onReceive", {methodName:"handshakeDone"});
_sendChannel.send(_sendChannelName, "onReceive", {methodName:"registerGame", id:_id, clip:_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);
trace("connected!");
_connecting = false;
_connected = true;
_listenChannel.close();
while (_sendChannel._queue.length > 0) {
_sendChannel.send(_sendChannelName, "onReceive", _sendChannel._queue.shift());
}
}
}
static function flush(error) {
var _local1;
var _local2;
while (_sendChannel._queue.length > 0) {
_local1 = _sendChannel._queue.shift();
if (_local1.callbackID != null) {
_local2 = _rcvChannel._callbacks[_local1.callbackID];
}
delete _rcvChannel._callbacks[_local1.callbackID];
if (error) {
handleError(_local1.args, _local2.callbackObject, _local2.callbackMethod);
}
}
}
static function handleError(args, callbackObject, callbackMethod) {
if (args != null) {
if (args.onError != null) {
args.onError.apply(null, ["NotConnected"]);
}
}
if (callbackMethod != null) {
args = {};
args.error = true;
args.errorCode = "NotConnected";
if ((callbackObject != null) && (typeof(callbackMethod) == "string")) {
callbackObject[callbackMethod](args);
} else if (callbackMethod != null) {
callbackMethod.apply(args);
}
}
}
static function send(methodName, args, callbackObject, callbackMethod) {
if (_connected) {
_sendChannel.send(_sendChannelName, "onReceive", {methodName:methodName, args:args, callbackID:_rcvChannel._nextcallbackID});
} else {
if ((_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 506 MovieClip [__Packages.MochiAd] Frame 0
class MochiAd
{
function MochiAd () {
}
static function getVersion() {
return("2.6");
}
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 () {
trace("[MochiAd] Couldn't load an ad, make sure that your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, 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) {
trace("[MOCHIAD rpcTestFn] " + 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 () {
trace("[MochiAd] Couldn't load an ad, make sure that your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, 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) {
trace("[MOCHIAD rpcTestFn] " + 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 () {
trace("[MochiAd] Couldn't load an ad, make sure that your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, 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) {
trace("[MOCHIAD rpcTestFn] " + 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) {
trace("[MochiAd] DEPRECATED: showPreloaderAd was renamed to showPreGameAd in 2.0");
showPreGameAd(options);
}
static function showTimedAd(options) {
trace("[MochiAd] DEPRECATED: showTimedAd was renamed to showInterLevelAd in 2.0");
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") {
trace("[MochiAd] WARNING: Using the MochiAds test identifier, make sure to use the code from your dashboard, not this example!");
}
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);
break;
default :
trace("[mochiads rpc] unknown rpc id: " + arg.id);
}
}
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 507 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 445 MovieClip Frame 1
this.onRollOver = function () {
_root.playSFX("menuRollOver");
this.filters = [new flash.filters.GlowFilter(12303359, 1, 6, 6, 2, 3, false, false)];
};
this.onRollOut = (this.onReleaseOutside = function () {
this.filters = [];
});
Symbol 452 MovieClip Frame 1
mariosoniclogo.onRelease = function () {
getURL ("http://mariosonicgames.com", "_blank");
};
sonicteamlogo.onRelease = function () {
getURL ("http://www.sonicteam.com", "_blank");
};
segalogo.onRelease = function () {
getURL ("http://www.sega.com", "_blank");
};
Symbol 463 MovieClip Frame 1
var h = 1;
while (h < 21) {
this["d" + h].id = h;
this["d" + h].desc = _root.descs[h];
this["d" + h].filters = [new flash.filters.GlowFilter(11184895, 1, 3, 3, 3, 3, false, false)];
this["d" + h].onRollOver = function () {
_root.playSFX("menuRollOver");
this.filters = [new flash.filters.GlowFilter(16777215, 1, 6, 6, 3, 3, false, false)];
this._parent.description.text = this.desc;
};
this["d" + h].onRollOut = (this["d" + h].onReleaseOutside = function () {
this.filters = [new flash.filters.GlowFilter(11184895, 1, 3, 3, 3, 3, false, false)];
});
h++;
}
Symbol 472 MovieClip Frame 1
campModeButton.filters = [new flash.filters.GlowFilter(14540287, 0.8, 10, 10, 2, 3, false, false)];
campModeButton.onRollOver = (freePlayModeButton.onRollOver = function () {
_root.playSFX("menuRollOver");
this.filters = [new flash.filters.GlowFilter(16777215, 1, 15, 15, 2, 3, false, false)];
});
campModeButton.onRollOut = (freePlayModeButton.onRollOut = (campModeButton.onReleaseOutside = (freePlayModeButton.onReleaseOutside = function () {
this.filters = [new flash.filters.GlowFilter(14540287, 0.8, 10, 10, 2, 3, false, false)];
})));
campModeButton.onRelease = function () {
_root.freePlayActive = false;
_root.kongregateStats.submit("campaignChosen", 1);
_root.gotoAndPlay("game");
};
sponsorlink.onRelease = function () {
getURL ("http://mariosonicgames.com", "_blank");
};
Symbol 475 MovieClip Frame 1
stop();
Symbol 475 MovieClip Frame 35
stop();
Symbol 475 MovieClip Frame 95
stop();
Symbol 490 MovieClip Frame 1
sfxButton.onRollOver = (musicButton.onRollOver = (backButton.onRollOver = function () {
_root.playSFX("menuRollOver");
this.filters = [new flash.filters.GlowFilter(12303359, 1, 6, 6, 2, 3, false, false)];
}));
sfxButton.onRollOut = (sfxButton.onReleaseOutside = (backButton.onRollOut = (backButton.onReleaseOutside = (musicButton.onRollOut = (musicButton.onReleaseOutside = function () {
this.filters = [];
})))));
sfxButton.onRelease = function () {
_root.sfxOn = !_root.sfxOn;
_root.toggleSFX(_root.sfxOn);
this.statusString.text = ((_root.sfxOn == true) ? "SFX: ON" : "SFX: OFF");
};
musicButton.onRelease = function () {
_root.musicOn = !_root.musicOn;
_root.toggleMusic(_root.musicOn);
this.statusString.text = ((_root.musicOn == true) ? "MUSIC: ON" : "MUSIC: OFF");
};
backButton.onRelease = function () {
_root.optionsScreen._x = -475;
_root.gamePausedScreenCampaign._x = 300;
};
Symbol 498 MovieClip Frame 1
stop();
Symbol 498 MovieClip Frame 10
stop();
Symbol 501 MovieClip Frame 1
stop();
Symbol 501 MovieClip Frame 10
stop();
Symbol 504 MovieClip Frame 1
stop();
Symbol 504 MovieClip Frame 10
stop();