Frame 2
gShockwave = true;
if (_framesloaded < 9) {
gotoAndPlay (1);
}
Frame 3
actualURL = this._url.split("?")[0];
validLoad = true;
if (Stage.scaleMode != "exactFit") {
validLoad = false;
thisurl = thisurl + "CP failure code 1";
}
if ((actualURL != "http://www.pizmogames.com/games/sugarcrash/sugarcrash.swf") and (actualURL != "http://pizmogames.com/games/sugarcrash/sugarcrash.swf")) {
validLoad = false;
cpError = "CP failure code 2";
}
if (gLoadedFromHtml != "true") {
cpError = "CP failure code 3";
validLoad = false;
}
if ((!validLoad) and (!gShockwave)) {
getURL ("http://www.pizmogames.com");
stop();
}
Frame 4
mcSound.loadMovie("media/sound.swf");
if (!gShockwave) {
gotoAndPlay ("pizmo");
}
Frame 5
function 160() {
_level0.swHighScoreObject.player1Score = _root.gPoints;
}
function 110() {
_root.HSHubSubmitter._visible = true;
_root.disabler._visible = false;
_root.31();
_root.gWhereToGo = "title";
}
System.security.allowDomain("shockwave.com");
_level0.swHighScoreObject = new Object();
_level0.swHighScoreObject.showTab = "view";
_level0.swHighScoreObject.gameId = "sugar";
_level0.swHighScoreObject.gameTitle = "Sugar Crash";
_level0.swHighScoreObject.screenWidth = 552;
_level0.swHighScoreObject.screenHeight = 470;
_level0.swHighScoreObject.scoreDescriptor = "points";
_level0.swHighScoreObject.numPlayers = 1;
_level0.swHighScoreObject.player2Score = 0;
_level0.swHighScoreObject.player3Score = 0;
_level0.swHighScoreObject.player4Score = 0;
_level0.HSHubURL = "http://www.shockwave.com/content/highscores/scorez-2002.swf";
Frame 8
if (starttime == undefined) {
starttime = getTimer();
delaySeconds = 2;
gotoAndPlay(_currentframe - 1);
} else if ((getTimer() - starttime) < (delaySeconds * 1000)) {
gotoAndPlay(_currentframe - 1);
} else {
starttime = undefined;
}
Frame 15
if (starttime == undefined) {
starttime = getTimer();
delaySeconds = 2;
gotoAndPlay(_currentframe - 1);
} else if ((getTimer() - starttime) < (delaySeconds * 1000)) {
gotoAndPlay(_currentframe - 1);
} else {
starttime = undefined;
}
Frame 19
if (starttime == undefined) {
starttime = getTimer();
delaySeconds = 2;
gotoAndPlay(_currentframe - 1);
} else if ((getTimer() - starttime) < (delaySeconds * 1000)) {
gotoAndPlay(_currentframe - 1);
} else {
starttime = undefined;
}
Instance of Symbol 278 MovieClip "mcSugarLevel" in Frame 22
onClipEvent (enterFrame) {
f = Math.floor(_root.53() / 2);
f = Math.max(1, f);
if (f > _currentframe) {
gotoAndStop(f);
}
}
Frame 23
function 70() {
gLocalInfo = SharedObject.getLocal("SugarCrashData", "/");
if (gLocalInfo.data.highestLevelSolved == undefined) {
gLocalInfo.data.highestLevelSolved = 0;
gLocalInfo.data.currentLevel = 1;
}
if (gLocalInfo.data.showTips == undefined) {
gLocalInfo.data.showTips = true;
}
initialLevelNum = gLocalInfo.data.currentLevel;
if (mcDebug.allowAllLevels) {
gLocalInfo.data.highestLevelSolved = 100;
}
gLocalInfo.flush();
}
function 83(2) {
}
function 127() {
getURL ("JavaScript:popUpWindow(\"../../sendtofriend/sugarcrash.html\",\"Send_to_Friend\",460,410)");
}
function 14() {
getURL ("http://www.cafepress.com/pizmogames/", "Pizmo Games Store");
}
function 19(_arg1) {
var _local2 = Math.min(Number(gLocalInfo.data.highestLevelSolved) + 2, gAllLevelDataArr.length - 1);
_local2 = gAllLevelDataArr.length - 1;
initialLevelNum = Number(initialLevelNum);
_arg1 = Number(_arg1);
if (((initialLevelNum + _arg1) <= _local2) and ((initialLevelNum + _arg1) > 0)) {
initialLevelNum = initialLevelNum + _arg1;
}
132();
39(((((("maxLevel: " + _local2) + ",gAllLevelDataArr:") + gAllLevelDataArr.length) + ",initialLevelNum:") + initialLevelNum) + _arg1);
}
function 132() {
var _local1 = Math.min(gLocalInfo.data.highestLevelSolved + 2, gAllLevelDataArr.length - 1);
_local1 = gAllLevelDataArr.length - 1;
if (initialLevelNum == _local1) {
mcNextLevelButton._alpha = 50;
} else {
mcNextLevelButton._alpha = 100;
}
if (initialLevelNum == 1) {
mcPrevLevelButton._alpha = 50;
} else {
mcPrevLevelButton._alpha = 100;
}
}
function 140() {
gLocalInfo.data.showTips = false;
gLocalInfo.flush();
}
function 4(type) {
var _local1;
switch (type) {
case "brick" :
_local1 = 5;
break;
case "powerup" :
_local1 = 10;
break;
case "balloon" :
_local1 = 20;
break;
case "hoop" :
_local1 = 35;
break;
case "boss" :
_local1 = 25;
break;
case "bossKill" :
_local1 = 100;
}
gPoints = gPoints + _local1;
160();
}
function 43(_arg5, _arg3, _arg4, _arg2) {
var _local1;
_local1 = ((_arg5 - _arg4) * (_arg5 - _arg4)) + ((_arg3 - _arg2) * (_arg3 - _arg2));
return(_local1);
}
function 44(_arg2, _arg1) {
var _local3;
_local3 = ((_arg2._x - _arg1._x) * (_arg2._x - _arg1._x)) + ((_arg2._y - _arg1._y) * (_arg2._y - _arg1._y));
return(_local3);
}
function 112(x, y, _arg1) {
return(!((((x < _arg1.left) or (x > _arg1.right)) or (y > _arg1.bottom)) or (y < _arg1.top)));
}
function 145(_arg1) {
if (gameState == "paused") {
38();
if (_arg1 == undefined) {
mcMessage.gotoAndStop(1);
}
} else {
108();
if (_arg1 == undefined) {
mcMessage.gotoAndStop("paused");
}
}
}
function 108() {
gPrevGameState = gameState;
gameState = "paused";
}
function 38() {
gameState = gPrevGameState;
}
function 109() {
if (gameState == "paused") {
mcSound.stateBeforePause = mcSound.soundOn;
mcSound.setSound(false);
} else {
mcSound.setSound(mcSound.stateBeforePause);
}
}
function 41(_arg2, _arg3) {
var _local1 = 0;
while (_local1 < _arg2.length) {
if (_arg2[_local1] == _arg3) {
_arg2.splice(_local1, 1);
}
_local1++;
}
}
function 17() {
theta = Math.atan2(-mcKid.velocityY, -mcKid.velocityX);
thetaDeg = (theta * 180) / 3.1217;
thetaDeg = thetaDeg - 90;
return(thetaDeg);
}
function 15(_arg4, _arg2, _arg3, _arg1) {
theta = Math.atan2(_arg1 - _arg2, _arg3 - _arg4);
thetaDeg = (theta * 180) / 3.1217;
thetaDeg = thetaDeg - 90;
return(thetaDeg);
}
function 122(_arg2, _arg1) {
var _local3 = 123(_arg2, _arg1);
if (firstTime == undefined) {
trace("^^^^^^^^^^^^^^^^^^^^^");
146(_local3);
146(_arg2);
146(_arg1);
firstTime = 1;
}
return((_local3.width < ((_arg2.right - _arg2.left) + (_arg1.right - _arg1.left))) and (_local3.height < ((_arg2.bottom - _arg2.top) + (_arg1.bottom - _arg1.top))));
}
function 123(_arg3, _arg2) {
var _local1 = new Object();
_local1.left = Math.min(_arg3.left, _arg2.left);
_local1.right = Math.max(_arg3.right, _arg2.right);
_local1.top = Math.min(_arg3.top, _arg2.top);
_local1.bottom = Math.max(_arg3.bottom, _arg2.bottom);
_local1.width = _local1.right - _local1.left;
_local1.height = _local1.bottom - _local1.top;
return(_local1);
}
function 169(_arg2, _arg1) {
var _local3 = ((112(_arg2.left, _arg2.top, _arg1) or 112(_arg2.right, _arg2.top, _arg1)) or 112(_arg2.left, _arg2.bottom, _arg1)) or 112(_arg2.right, _arg2.bottom, _arg1);
var _local4 = ((112(_arg1.left, _arg1.top, _arg2) or 112(_arg1.right, _arg1.top, _arg2)) or 112(_arg1.left, _arg1.bottom, _arg2)) or 112(_arg1.right, _arg1.bottom, _arg2);
return(_local3 or _local4);
}
function 168(_arg3, _arg2) {
var _local4 = true;
var _local1 = new Object();
_local1.left = Math.min(_arg3.left, _arg2.left);
_local1.top = Math.min(_arg3.top, _arg2.top);
_local1.right = Math.max(_arg3.right, _arg2.right);
_local1.bottom = Math.max(_arg3.bottom, _arg2.bottom);
if ((_local1.right - _local1.left) >= (((_arg3.right - _arg3.left) + _arg2.right) - _arg2.left)) {
_local4 = false;
}
if ((_local1.bottom - _local1.top) >= (((_arg3.bottom - _arg3.top) + _arg2.bottom) - _arg2.top)) {
_local4 = false;
}
return(_local4);
}
function 104(_arg1, x, y) {
Set("119", new Object());
119.left = _arg1.left + x;
119.top = _arg1.top + y;
119.right = _arg1.right + x;
119.bottom = _arg1.bottom + y;
119.width = 119.right - 119.bottom;
119.height = 119.bottom - 119.top;
return(119);
}
function 167(_arg1, _arg2, x, y) {
_arg1.left = _arg2.left + x;
_arg1.top = _arg2.top + y;
_arg1.right = _arg2.right + x;
_arg1.bottom = _arg2.bottom + y;
}
function 16(_arg2, _arg1) {
return(15(_arg2._x, _arg2._y, _arg1._x, _arg1._y));
}
function 9() {
var _local1;
if (gameState == "paused") {
145();
} else {
switch (mcPlayer["143"]) {
case "gum" :
if (mcKid.state == "stuck") {
mcKid.state = "normal";
mcSound.playSound2("bounce2");
}
32();
for (_local1 in gMonkeyArray) {
if (gMonkeyArray[_local1].state == "stuck") {
gMonkeyArray[_local1].state = "normal";
}
}
break;
case "nerds" :
if (gameState != "normal") {
break;
}
50();
}
}
}
function 129(_arg1) {
var _local2 = new Object();
_local2.bottom = _arg1._y + (_arg1._height / 2);
_local2.right = _arg1._x + (_arg1._width / 2);
_local2.top = _arg1._y - (_arg1._height / 2);
_local2.left = _arg1._x - (_arg1._width / 2);
_local2.width = _arg1._width;
_local2.height = _arg1._height;
_arg1["119"] = _local2;
_arg1.collisionRect = _local2;
}
function 146(_arg1) {
147(_arg1);
}
function 147(_arg2) {
var _local1;
trace(("------- trace object: " + _arg2) + "-------");
for (_local1 in _arg2) {
trace((_local1 + ":") + _arg2[_local1]);
}
trace("----------------------------");
}
function 148(v) {
trace((v + ":") + eval (v));
}
function 40(_arg1, _arg2) {
if (gDebug.showCollisionRects) {
_arg1._x = _arg2.left;
_arg1._y = _arg2.top;
_arg1._width = (-_arg1._x) + _arg2.right;
_arg1._height = (-_arg1._y) + _arg2.bottom;
}
}
function 91(n, d) {
num = n - (Math.floor(n / d) * d);
return(num);
}
function 53() {
if (mcLevels == undefined) {
mcLevelsCurrentFrame = 1;
mcLevelsTotalFrames = 63;
} else {
mcLevelsCurrentFrame = mcLevels._currentframe;
mcLevelsTotalFrames = mcLevels._totalframes;
}
var _local3 = (_root.getBytesTotal() + _root.mcSound.getBytesTotal()) + (mcLevelsTotalFrames * 4000);
var _local2 = (_root.getBytesLoaded() + _root.mcSound.getBytesLoaded()) + (mcLevelsCurrentFrame * 4000);
return((_local2 / _local3) * 100);
}
function 54() {
var _local3 = _root.getBytesTotal() + _root.mcSound.getBytesTotal();
var _local2 = _root.getBytesLoaded() + _root.mcSound.getBytesLoaded();
return((_local2 / _local3) * 100);
}
function 39(_arg1) {
debugOutputRef.text = debugOutputRef.text + (_arg1 + newline);
}
Frame 24
function 64() {
groundY = 390;
mcDebug.gumStickPerpetual = false;
mcDebug.allowAllLevels = true;
gBoardRect = {left:mcBoardRect._x, top:mcBoardRect._y, right:mcBoardRect._x + mcBoardRect._width, bottom:mcBoardRect._y + mcBoardRect._height};
gBoardRect.width = mcBoardRect._width;
gBoardRect.height = mcBoardRect._height;
gBoardRect.centerX = (gBoardRect.left + gBoardRect.right) / 2;
gBossCandyDirArray = new Object();
gBossCandyDirArray.x = new Array(1, 1, -1, -1);
gBossCandyDirArray.y = new Array(-1, 1, 1, -1);
70();
gPowerUpExclusions = new Array();
gPowerUpExclusions.nerds = new Array(1, 2, 3, 4, 5);
gPowerUpExclusions.gum = new Array(1);
gPowerUpExclusions.pillow = new Array(1, 2, 3);
gPowerUpExclusions.barrel = new Array(1, 2, 21);
}
function 63() {
gOldYMouse = _ymouse;
gNextDepth = 200;
gLevelNum = initialLevelNum;
67();
gNumLives = 3;
mcNumLives.gotoAndStop(gNumLives + 1);
gPowerUpArray = new Array();
gPowerUpsToDelete = new Array();
mcGumSite.numSites = 6;
gPoints = 0;
160();
}
function 68() {
var _local2;
var _local4;
var _local3;
var _local1;
mcKid.mcWordBalloon.gotoAndPlay("empty");
sTime = getTimer();
sNumFrames = 0;
gWhereToGo = "play loop";
mcPlayer.normalcollisionDist = 50;
mcPlayer.collisionDist = mcPlayer.normalcollisionDist;
mcPlayer.oldx = mcPlayer._x;
gBarrierArr = new Array();
for (_local2 in mcItems) {
mcItems[_local2].removeMovieClip();
}
for (_local2 in mcItemsTop) {
mcItemsTop[_local2].removeMovieClip();
}
gItemArray = new Array();
_local3 = gAllLevelDataArr[gLevelNum];
for (_local2 in _local3) {
itemEntry = _local3[_local2];
mcItems.attachMovie(itemEntry.type + itemEntry.subType, ((itemEntry.type + "_") + itemEntry.subtype) + gNextDepth, gNextDepth, itemEntry.initParams);
_local1 = mcItems[((itemEntry.type + "_") + itemEntry.subtype) + gNextDepth];
gNextDepth++;
switch (itemEntry.type) {
case "balloon" :
if (gItemArray.target == undefined) {
gItemArray.target = new Array();
}
gItemArray.target.push(_local1);
_local1.mcBalloon.gotoAndStop(itemEntry.initParams.balloonType);
_local1.subType = itemEntry.subtype;
_local1.hitsLeft = 1;
129(_local1);
_local1.state = "normal";
break;
case "bigballoon" :
if (gItemArray.bigballoon == undefined) {
gItemArray.bigballoon = new Array();
}
gItemArray.bigballoon.push(_local1);
_local1.velocityX = 0;
_local1.velocityY = 0;
_local1.time = 1;
_local1.gravity = 0;
_local1.speedfactor = 1;
129(_local1);
_local1.state = "normal";
_local1.oldX = _local1._x;
_local1.oldY = _local1._y;
break;
case "brick" :
if (gItemArray[itemEntry.type] == undefined) {
gItemArray[itemEntry.type] = new Array();
}
gItemArray[itemEntry.type].push(_local1);
break;
case "metal" :
if (gItemArray.brick == undefined) {
gItemArray.brick = new Array();
}
gItemArray.brick.push(_local1);
break;
case "hoop" :
if (gItemArray.hoop == undefined) {
gItemArray.hoop = new Array();
}
gItemArray.hoop.push(_local1);
66(_local1);
152(_local1);
break;
case "gloom" :
if (gItemArray.gloom == undefined) {
gItemArray.gloom = new Array();
}
gItemArray.gloom.push(_local1);
break;
case "suction" :
if (gItemArray.suction == undefined) {
gItemArray.suction = new Array();
}
gItemArray.suction.push(_local1);
_local1.mcSuckPath._visible = false;
break;
case "boss" :
mcBoss = _local1;
62();
break;
case "napmat" :
mcNapMat = _local1;
mcNapMat.mcPad.numNapsLeft = 3;
mcNapMat.gotoAndStop("normal");
if ((mcNapMat.velocityX != 0) and (mcNapMat.velocityX != undefined)) {
mcNapMat.mcPad._y = mcNapMat.mcShadow._y - 5;
} else {
mcNapMat.mcPad._y = mcNapMat.mcShadow._y;
}
_local1.time = 1;
_local1.gravity = 0;
_local1.speedfactor = 1;
129(_local1);
129(_local1.mcCollisionRect);
_local1.collisionOffsetRect = _local1.mcCollisionRect["119"];
_local1.oldX = _local1._x;
_local1.oldY = _local1._y;
}
}
gHoopArray = gItemArray.hoop;
gBrickArray = gItemArray.brick;
gTargetArray = gItemArray.target;
gGloomArray = gItemArray.gloom;
if (gGloomArray != undefined) {
mcSound.playSound("gloom");
}
gSuctionArray = gItemArray.suction;
if (mcBoss != undefined) {
gGameTheme = "boss theme";
} else {
gGameTheme = "game theme";
}
69(false);
gNerdBullets = undefined;
if (mcBoss != undefined) {
mcBackground.gotoAndStop(2);
}
gLevelIntros = new Array(one_based_dummy, 0, 0, 0, "sucky suction", "hoop", 0, 0, "gloom", 0);
if ((gLevelIntros[glevelNum] != 0) and (glevelIntros[gLevelNum] != undefined)) {
mcItemIntros.gotoAndPlay(gLevelIntros[gLevelNum]);
}
gNumFrames = 0;
gLocalInfo.data.currentLevel = gLevelNum;
gLocalInfo.flush();
83("sugc_initlev_" + gLevelNum);
}
function 62() {
var _local1;
trace("initboss");
mcBoss._visible = true;
mcBoss.velocityX = 0;
mcBoss.velocityY = 2;
mcBoss.maxY = mcBoss._y;
mcBoss.minyLimit = mcBoss._y;
mcBoss._y = -100;
mcBoss._x = gBoardRect.left + (gBoardRect.width / 2);
var _local2 = mcBoss._width / 2;
mcBoss.collisionOffsetRect = {left:-_local2, top:-_local2, right:_local2, bottom:_local2};
mcBoss.state = "normal";
mcBoss.anim = "appear";
mcBoss.damage = 0;
mcBoss.damageMax = 100;
gBossCandyArray = new Array();
_local1 = 0;
while (_local1 < 14) {
mcItemsTop.attachMovie("bosscandy", "mcBossCandy" + _local1, gNextDepth);
gNextDepth++;
mcBossCandy = mcItemsTop["mcBossCandy" + _local1];
mcBossCandy.state = "idle";
mcBossCandy._x = -100;
mcBossCandy.time = 1;
mcBossCandy.speedFactor = 0.75;
gBossCandyArray.push(mcBossCandy);
_local1++;
}
mcSound.playSound("boss init");
mcBoss.collisionRect = 129(mcBoss);
mcBoss.oldCollisionRect = mcBoss.collisionRect;
}
function 150() {
if (mcBoss != undefined) {
var _local1;
var _local2;
debugBossAnim = "boss anim:" + mcBoss.anim;
if (mcBoss.state == "normal") {
switch (mcBoss.anim) {
case "appear" :
if (mcBoss._y >= mcBoss.maxY) {
mcBoss.velocityX = 4;
mcBoss.velocityY = 0;
mcBoss.anim = "backandforth";
mcBoss.animRepeats = random(2) + 1;
}
break;
case "shake" :
if ((mcBoss.velocityY > 0) and (mcBoss._y >= mcBoss.maxY)) {
_local2 = true;
}
if ((mcBoss.velocityY < 0) and (mcBoss._y <= mcBoss.minY)) {
_local2 = true;
}
if (_local2) {
mcBoss.velocityY = mcBoss.velocityY * -1;
mcBoss.animRepeats--;
if (mcBoss.animRepeats == 0) {
mcBoss.anim = "up";
mcBoss.velocityX = 0;
mcBoss.velocityY = -3;
mcBoss.animRepeats = 2;
mcBoss.minY = mcBoss.minYLimit;
}
}
break;
case "backandforth" :
if (((mcBoss._x + (mcBoss._width / 2)) > gBoardRect.right) and (mcBoss.velocityX > 0)) {
_local2 = true;
}
if (((mcBoss._x - (mcBoss._width / 2)) < gBoardRect.left) and (mcBoss.velocityX < 0)) {
_local2 = true;
}
if (random(300) == 1) {
_local2 = true;
mcBoss.animRepeats = 0;
}
if (_local2 != undefined) {
mcBoss.velocityX = mcBoss.velocityX * -1;
mcBoss.animRepeats--;
if (mcBoss.animRepeats <= 0) {
mcBoss.anim = "down";
mcBoss.velocityX = 0;
mcBoss.velocityY = 3;
mcBoss.maxY = (mcOrigY + 60) + random(80);
}
}
break;
case "up" :
if (mcBoss._y <= mcBoss.minY) {
mcBoss.velocityY = 0;
mcBoss.velocityX = -2;
mcBoss.anim = "backandforth";
mcBoss.animRepeats = 1 + random(2);
}
break;
case "down" :
if (mcBoss._y >= mcBoss.maxY) {
mcBoss.velocityY = -4;
mcBoss.velocityX = 0;
mcBoss.anim = "shake";
mcBoss.minY = mcBoss.maxY - 15;
mcBoss.animRepeats = 4 + random(4);
}
break;
case "justbumped" :
mcBoss.stopBumpBackFrames--;
if (mcBoss.stopBumpBackFrames != 0) {
break;
}
mcBoss.anim = mcBoss.prevAnim;
mcBoss.velocityY = mcBoss.prevVelocityY;
mcBoss.velocityX = mcBoss.prevVelocityX;
}
mcBoss.newx = mcBoss._x + mcBoss.velocityX;
mcBoss.newY = mcBoss._y + mcBoss.velocityY;
40(mcRect3, mcBoss.collisionRect);
var _local4 = 27(mcKid, mcBoss);
if (_local4.sideHitArr != undefined) {
10(_local4, 8);
mcKid.velocityX = _local4.newVelocityX;
mcKid.velocityY = _local4.newVelocityY;
}
133(mcBoss);
if (112(mcBoss._x, mcBoss._y, gBoardRect)) {
if (random(40) == 1) {
136();
}
}
} else {
mcBoss.delayFrames--;
if (mcBoss.delayFrames == 0) {
mcMessage.gotoAndPlay("goody bag");
145("noMessage");
}
}
candiesActive = false;
var _local3 = gBossCandyArray.length;
_local1 = 0;
while (_local1 < _local3) {
if (gBossCandyArray[_local1].state == "active") {
candiesActive = true;
mcBossCandy = gBossCandyArray[_local1];
mcBossCandy._rotation = mcBossCandy._rotation + mcBossCandy.rotDelta;
18(mcBossCandy, true);
21(mcBossCandy);
133(mcBossCandy);
if (mcBossCandy.state == "idle") {
mcBossCandy._y = 2000;
}
if (mcKid.state == "normal") {
if (44(mcKid, mcBossCandy) < 2500) {
mcBossCandy.gotoAndPlay("hit");
mcBossCandy.state = "hit";
if (!mcDebug.sugarImmune) {
mcKid.sugarLevel = mcKid.sugarLevel + 5;
162();
mcKid.myColor.setTransform(mcKid.whiteColorTransform);
mcKid.switchToNormalColorFrames = 5;
}
}
}
if (mcBoss.state == "die") {
if (mcPlayer.mcHitArea.hitTest(mcBossCandy._x, mcBossCandy._y, false)) {
mcBossCandy.gotoAndPlay("hit");
mcBossCandy.state = "hit";
mcSound.playSound("boss candy catch");
mcPlayer.gotoAndPlay("bag eat");
mcPlayer.delayFrames = 3;
mcPlayer.myColor.setTransform(mcPlayer.whiteColorTransform);
mcPlayer.switchToNormalColorFrames = 3;
}
}
}
_local1++;
}
if (mcBoss.state == "die") {
if (!candiesActive) {
52();
}
}
}
}
function 10(_arg1, _arg2) {
mcBoss.damage = mcBoss.damage + _arg2;
mcPlayer.justHitBoss = true;
if (mcBoss.damage >= mcBoss.damageMax) {
bossKilled();
} else {
mcBoss.gotoAndPlay("hit");
mcSound.playSound("boss hit " + (random(4) + 1));
}
mcBoss.prevAnim = mcBoss.anim;
mcBoss.anim = "justbumped";
mcBoss.prevVelocityY = mcBoss.velocityY;
mcBoss.prevVelocityX = mcBoss.velocityX;
mcBoss.stopBumpBackFrames = 8;
switch (_arg1.primarySideHit) {
case "l" :
mcBoss.newX = mcBoss.newX + 16;
mcBoss.velocityX = -2;
mcBoss.velocityY = 0;
break;
case "r" :
mcBoss.newX = mcBoss.newX - 16;
mcBoss.velocityX = 2;
mcBoss.velocityY = 0;
break;
case "b" :
mcBoss.newY = mcBoss.newY - 16;
mcBoss.velocityX = 0;
mcBoss.velocityY = 2;
break;
case "t" :
mcBoss.newY = mcBoss.newY + 16;
mcBoss.velocityX = 0;
mcBoss.velocityY = -2;
}
4("boss");
}
function bossKilled() {
mcBoss.gotoAndPlay("die");
mcBoss.state = "die";
mcBoss.delayFrames = 5;
mcSound.playSound("boss die");
77();
for (i in gBossCandyArray) {
if (gBossCandyArray[i].state == "idle") {
135(gBossCandyArray[i]);
gBossCandyArray[i].gravity = 0.3;
gBossCandyArray[i].velocityX = random(10) - 5;
gBossCandyArray[i].velocityY = -i;
}
}
134("bag");
mcPlayer.frameCountToReturnToNormal = undefined;
mcKid._y = groundY - 40;
mcKid._rotation = 0;
mcKid._x = mcNapMat._x;
mcKid.mcShadow._visible = false;
mcNapMat.mcArrow._visible = false;
mcKid.sugarlevel = 0;
if (mcKid.state != "nap") {
_root.mcPlayer.swapDepths(_root.mcKid);
}
162();
mcKid.gotoAndPlay("rise");
mcKid.gotoAndStop(mcKid._currentframe + 2);
mcKid.state = "gameovernap";
4("bossKilled");
}
function 136() {
var _local1;
var _local3;
for (var _local2 in gBossCandyArray) {
if (gBossCandyArray[_local2].state == "idle") {
_local1 = gBossCandyArray[_local2];
}
}
if (_local1 != undefined) {
135(_local1, _local3);
mcSound.playSound("boss fire");
}
}
function 135(mcBossCandy, 99) {
var 73 = 4;
if (99 == undefined) {
mcBossCandy._x = mcBoss._x;
mcBossCandy._y = mcBoss._y;
mcBossCandy.velocityX = 9 - random(18);
mcBossCandy.velocityY = -3 - random(9);
} else {
mcNozzle = eval ("mcItems.mcBoss.mcNozzle" + 99);
mcBossCandy._x = mcBoss._x + mcNozzle._x;
mcBossCandy._y = mcBoss._y + mcNozzle._y;
mcBossCandy.velocityX = gBossCandyDirArray.x[99] * 73;
mcBossCandy.velocityY = -73;
}
mcBossCandy.rotDelta = random(30) - 5;
mcBossCandy.oldX = mcBossCandy._x;
mcBossCandy.oldY = mcBossCandy._y;
mcBossCandy.gravity = 0.5;
mcBossCandy.speedfactor = 0.75;
mcBossCandy.gotoAndStop(random(3) + 1);
mcBossCandy.state = "active";
}
function 66(_arg1) {
129(_arg1);
_arg1.numHits = 0;
_arg1.numHitsMax = 8;
mcItemsTop.attachMovie("hoopfront", "mcHoopFront" + gNextDepth, gNextDepth);
_arg1.mcHoopFront = mcItemsTop["mcHoopFront" + gNextDepth];
gNextDepth++;
trace("mcHoop.mcHoopFront:" + _arg1.mcHoopFront);
_arg1.mcHoopFront._x = _arg1._x;
_arg1.mcHoopFront._y = _arg1._y;
_arg1.collisionRectTop = {collisionrect:{left:0, top:0, right:0, bottom:0}};
_arg1.collisionRectBottom = {collisionrect:{left:0, top:0, right:0, bottom:0}};
_arg1.topCollisionPt = {x:4, y:-40};
_arg1.bottomCollisionPt = {x:4, y:40};
gBarrierArr.push(_arg1.collisionRectTop);
gBarrierArr.push(_arg1.collisionRectBottom);
_arg1.collisionOffsetRect = {left:-20, top:-10, right:20, bottom:10};
}
function 153() {
for (var _local1 in gHoopArray) {
152(gHoopArray[_local1]);
}
}
function 152(_arg1) {
if (_arg1.velocityX != 0) {
_arg1.prevX = _arg1._x;
_arg1._x = _arg1._x + _arg1.velocityX;
_arg1.mcHoopFront._x = _arg1.mcHoopFront._x + _arg1.velocityX;
if ((_arg1.velocityX > 0) and (_arg1._x > (gBoardRect.right - 110))) {
_arg1.velocityX = _arg1.velocityX * -1;
}
if ((_arg1.velocityX < 0) and (_arg1._x < (gBoardRect.left + 110))) {
_arg1.velocityX = _arg1.velocityX * -1;
}
}
_arg1._rotation = _arg1._rotation + _arg1.dRot;
_arg1.mcHoopFront._rotation = _arg1.mcHoopFront._rotation + _arg1.dRot;
131(_arg1);
}
function 131(_arg1) {
_arg1.topCollisionPt = {x:0, y:-90};
_arg1.localToGlobal(_arg1.topCollisionPt);
_arg1.bottomCollisionPt = {x:0, y:90};
_arg1.localToGlobal(_arg1.bottomCollisionPt);
_arg1.collisionRectBottom.oldCollisionRect = _arg1.collisionRectBottom.collisionRect;
_arg1.collisionRectBottom.collisionRect = 104(_arg1.collisionOffsetRect, _arg1.bottomCollisionPt.x, _arg1.bottomCollisionPt.y);
_arg1.collisionRectTop.oldCollisionRect = _arg1.collisionRectBottom.collisionRect;
_arg1.collisionRectTop.collisionRect = 104(_arg1.collisionOffsetRect, _arg1.topCollisionPt.x, _arg1.topCollisionPt.y);
}
function 29(_arg2) {
var _local3 = 0;
while (_local3 < gHoopArray.length) {
var _local1 = gHoopArray[_local3];
if ((_arg2._y < _local1["119"].bottom) and (_arg2._y > _local1["119"].top)) {
if ((((_arg2._x - _local1._x) * (_arg2.newX - (_local1._x + _local1.velocityX))) <= 0) or (((_arg2._x - _local1.prevX) * (_arg2.newX - (_local1.prevX + _local1.velocityX))) <= 0)) {
55(_local1);
}
}
_local3++;
}
}
function 55(_arg1) {
var _local2 = true;
if (_arg1.frameLastTimeThrough != undefined) {
if (((gNumFrames - _arg1.frameLastTimeThrough) < 10) and ((Math.abs(mcKid.velocityX) / mcKid.velocityX) == _arg1.kidDirLastTimeThrough)) {
_local2 = false;
}
}
if (_local2) {
_arg1.gotoAndPlay("hit");
_arg1.frameLastTimeThrough = gNumFrames;
_arg1.kidDirLastTimeThrough = Math.abs(mcKid.velocityX) / mcKid.velocityX;
_arg1.numHits++;
_arg1.mcHoopElem.gotoAndStop(_arg1.numHits + 1);
_arg1.mcHoopFront.mcHoopElem.gotoAndStop(_arg1.numHits + 1);
mcSound.playSound("through hoop");
4("hoop");
26();
}
}
function 69(_arg1) {
if ((gLevelNum == initialLevelNum) or _arg1) {
mcKid.State = "bored";
gameState = "init";
mcKid.gotoAndPlay("bored");
mcKid.velocityX = 0;
mcKid.velocityY = 0;
134("sugar");
mcSound.playMusic("bored theme");
if (_arg1) {
mcKid._y = groundY - 5;
}
} else {
if (mcKid.state == "nap") {
164();
}
mcKid.velocityX = 0;
gameState = "normal";
mcKid.gotoAndPlay("rise");
mcSound.playMusic(gGameTheme);
}
mcKid.oldX = mcKid._x;
mcKid.oldY = mcKid._y;
mcKid.sugarLevel = 0;
mcKid.switchToNormalColorFrames = 0;
mcPlayer.switchToNormalColorFrames = 0;
162();
mcNapMat.mcPad.numNapsLeft = 3;
mcNapMat.gotoAndStop("normal");
mcPlayer.mcFace.gotoAndStop("smile");
mcKid.successiveShortBrickBounces = 0;
}
function 134(_arg1) {
if (_arg1 != mcPlayer["143"]) {
if (mcPlayer["143"] == "mollases") {
mcSound.playMusic("game theme");
}
mcPlayer["143"] = _arg1;
mcPlayer.whereToGo = mcPlayer["143"] + " idle";
}
}
function 1() {
var _local3 = gTargetArray.length;
var _local2 = 0;
while (_local2 < _local3) {
var _local1 = gTargetArray[_local2];
if (_local1["45"] != 0) {
_local1._x = _local1._x + _local1["45"];
distToDestination = Math.abs(_local1._x - _local1.destinationX);
if (distToDestination < Math.abs(_local1["45"])) {
_local1["45"] = 0;
}
if ((gTargetArray[_local2]["45"] > 0) and (_local1._x > (gBoardRect.right + 40))) {
_local1._x = -40;
}
if ((gTargetArray[_local2]["45"] < 0) and (_local1._x < (gBoardRect.left - 40))) {
_local1._x = gBoardRect.right + 40;
}
}
_local2++;
}
}
function 159() {
var _local3;
var _local1;
var _local2;
_local2 = gPowerUpArray.length;
if (_local2 == 0) {
if ((random(600) == 1) and (mcKid["143"] != "gum")) {
5("gum");
}
if ((random(900) == 1) and (mcKid["143"] != "brownie")) {
5("brownie");
}
if ((random(1200) == 1) and (mcKid["143"] != "mollases")) {
5("mollases");
}
if ((random(1800) == 1) and (mcKid["143"] != "nerds")) {
5("nerds");
}
if (random(900) == 1) {
5("pillow");
}
if (random(700) == 1) {
if ((gMonkeyArray.length == 0) or (gMonkeyArray == undefined)) {
5("barrel");
}
}
}
_local1 = 0;
while (_local1 < _local2) {
mcPowerUp = gPowerUpArray[_local1];
mcPowerUp._y = mcPowerUp._y + mcPowerUp["46"];
xDist = Math.abs(mcPowerUp._x - mcPlayer._x);
if ((mcPowerUp._y > (mcPlayer._y - 30)) and (xDist < 80)) {
if (mcPowerUp.state == "normal") {
if (mcBoss.state != "die") {
mcPowerUp.gotoAndPlay(mcPowerUp.type + " hit");
mcPowerUp.state = "hit";
mcSound.playSound("sweet change");
4("powerup");
if (gLocalInfo.data.showTips) {
gTipName = mcPowerUp.type;
if (!gLocalInfo.data.tipsUsed[gTipName]) {
mcMessage.gotoAndPlay("tip");
if (gLocalInfo.data.tipsUsed == undefined) {
gLocalInfo.data.tipsUsed = new Array();
}
gLocalInfo.data.tipsUsed[gTipName] = true;
gLocalInfo.flush();
108();
}
}
switch (mcPowerUp.type) {
case "barrel" :
71(mcPowerUp._x, mcPowerUp._y);
mcSound.playSound2("monkeybounce");
break;
case "pillow" :
mcNapMat.mcPad.numNapsLeft++;
mcNapMat.gotoAndPlay("normal");
break;
case "brownie" :
mcPlayer.collisionDist = 100;
mcPlayer.frameCountToReturnToNormal = gNumFrames + 105;
134(mcPowerUp.type);
32();
break;
case "nerds" :
mcPlayer.collisionDist = 50;
mcPlayer.frameCountToReturnToNormal = gNumFrames + 147;
134(mcPowerUp.type);
mcPlayer.numBulletsLeft = 30;
72();
break;
case "gum" :
mcPlayer.collisionDist = 60;
mcPlayer.frameCountToReturnToNormal = gNumFrames + 147;
if (mcDebug.gumStickPerpetual) {
mcPlayer.frameCountToReturnToNormal = mcPlayer.frameCountToReturnToNormal * 1000;
}
134(mcPowerUp.type);
break;
case "mollases" :
mcPlayer.collisionDist = 60;
mcPlayer.frameCountToReturnToNormal = gNumFrames + 105;
134(mcPowerUp.type);
mcSound.playMusic("game theme slow");
32();
}
}
}
}
if (mcPowerUp._y > gBoardRect.bottom) {
gPowerUpsToDelete.push(mcPowerUp);
}
_local1++;
}
if (gPowerUpsToDelete.length > 0) {
_local1 = 0;
while (_local1 < gPowerUpsToDelete.length) {
78(gPowerUpsToDelete[_local1]);
_local1++;
}
gPowerUpsToDelete = new Array();
}
}
function 78(mcPowerUp) {
trace("old power up length:" + gPowerUpArray.length);
mcPowerUp.removeMovieClip();
41(gPowerUpArray, mcPowerUp);
trace("new power up length:" + gPowerUpArray.length);
}
function 5(type) {
if (mcPlayer["143"] != type) {
var 7 = true;
var i = 0;
while (i < gPowerUpExclusions[type].length) {
if (gPowerUpExclusions[type][i] == Number(gLevelNum)) {
Set("7", false);
}
i++;
}
if ((mcBoss != undefined) and (mcBoss.state == "die")) {
Set("7", false);
}
if (7) {
mcPowerUps.attachMovie("powerup", "mcPowerUp" + gNextDepth, gNextDepth);
mcPowerUp = eval ("mcPowerUps.mcPowerUp" + gNextDepth);
gNextDepth++;
gPowerUpArray.push(mcPowerUp);
mcPowerUp.state = "normal";
mcPowerUp.type = type;
mcPowerUp.gotoAndPlay(type);
mcPowerUp._x = (gBoardRect.left + 80) + random(gBoardRect.width - 160);
mcPowerUp._y = -100;
mcPowerUp["46"] = 4;
mcPowerUp.gotoAndPlay(mcPowerUp.type);
trace(((("created power up of type " + type) + ":") + mcPowerUp) + emptyPower);
}
}
}
function 139() {
var _local1;
var _local5;
var _local4;
var _local3;
var _local6;
debugA2 = gLocalInfo.data.showTips;
switch (gameState) {
case "normal" :
_local1 = 0;
while (_local1 < gSuctionArray.length) {
gSuctionArray[_local1].prevOnState = gSuctionArray[_local1].mcSuckPath._visible;
gSuctionArray[_local1].mcSuckPath._visible = false;
_local1++;
}
158();
156();
159();
150();
153();
155();
154();
157();
gNumFrames++;
break;
case "init" :
158();
154();
150();
153();
gNumFrames++;
break;
case "lose" :
154();
111();
gNumFrames++;
break;
case "pause" :
}
debugkidstate = mcKid.state;
sNumFrames++;
if (sNumFrames == 84) {
var _local2 = getTimer();
debugfps = int(((1000 / (_local2 - sTime)) * 21) * 4);
sNumFrames = 0;
sTime = _local2;
}
}
function 154() {
var _local5;
mcKid.newY = mcKid._y;
mcKid.newX = mcKid._x;
mcKid.oldVelocityY = mcKid.velocityY;
if (mcKid.switchToNormalColorFrames > 0) {
mcKid.switchToNormalColorFrames--;
if (mcKid.switchToNormalColorFrames == 0) {
mcKid.myColor.setTransform(mcKid.defaultColorTransform);
}
}
switch (mcKid.state) {
case "bored" :
gKidToPlayerDx = mcKid._x - mcPlayer._x;
if (((gKidToPlayerDx * (mcKid._x - mcPlayer.oldX)) < 0) or 24(mcKid)) {
mcKid.mcWordBalloon.gotoAndPlay("empty");
11();
mcKid.state = "normal";
gameState = "normal";
mcSound.playMusic(gGameTheme);
}
break;
case "nap" :
if (mcKid.sugarLevel > 0) {
mcKid.sugarLevel = mcKid.sugarLevel - 1;
mcKid.newX = mcNapMat._x - 5;
mcKid.newY = mcNapMat._y + mcNapMat.mcPad._y;
mcKid.oldX = mcKid.newX;
mcKid.oldY = mcKid.newY;
} else {
164();
_root.mcPlayer.swapDepths(_root.mcKid);
}
162();
break;
case "stuck" :
if (mcPlayer["143"] != "gum") {
11();
mcKid.state = "normal";
32();
} else {
mcKid.newX = mcPlayer._x + gKidToPlayerDx;
if (mcPlayer._x != mcPlayer.oldX) {
151();
}
}
break;
case "trapped" :
mcKid.countdownToDie--;
if (mcKid.countdownToDie == 0) {
81("trapped");
}
case "dropped" :
break;
case "sugarcrashing" :
mcKid.newX = mcKid._x + mcKid.velocityX;
mcKid.newY = mcKid._y + mcKid.velocityY;
soundToPlay = undefined;
if ((mcKid.newY <= (boardRect.top + 50)) and (mcKid.velocityY < 0)) {
mcKid.newY = boardRect.top + 50;
mcKid.velocityY = -0.97 * mcKid.velocityY;
mcKid._rotation = 17();
soundToPlay = "sugarbounce1";
}
if (mcKid.newX >= (gBoardRect.right - 35)) {
mcKid.newX = gBoardRect.right - 35;
mcKid.velocityX = -0.97 * mcKid.velocityX;
mcKid._rotation = 17();
soundToPlay = "sugarbounce2";
}
if (mcKid.newX <= (gBoardRect.left + 35)) {
mcKid.newX = gBoardRect.left + 35;
mcKid.velocityX = -0.97 * mcKid.velocityX;
mcKid._rotation = 17();
soundToPlay = "sugarbounce3";
}
if ((mcKid.newY > groundY) and (mcKid.velocityY > 0)) {
mcKid.newY = boardRect.top + 50;
mcKid.newY = groundY;
mcKid.velocityY = -0.97 * mcKid.velocityY;
xdir = Math.abs(mcKid.velocityX) / mcKid.velocityX;
mcKid.groundBounceCount++;
mcKid._rotation = 17();
if (mcKid.groundBounceCount == 4) {
newY = groundY;
81("sugarcrashed");
soundToPlay = undefined;
} else {
soundToPlay = "bounce1";
}
}
if (soundToPlay != undefined) {
mcSound.playSound2(soundToPlay);
}
break;
case "normal" :
if ((Math.abs(mcKid.velocityY) > 0) or (mcKid._y < (groundY - 90))) {
18(mcKid, true);
if (mcKid.newY > groundY) {
if (gameState == "normal") {
mcKid.newY = groundY;
if (!mcDebug.BounceGroundFlag) {
if (mcPlayer["143"] == "bag") {
mcKid.velocityY = 0;
mcKid.velocityX = 0;
mcKid.state = "afterboss";
} else {
81("dropped");
}
}
}
}
if (mcKid.newX >= (gBoardRect.right - 35)) {
mcKid.newX = gBoardRect.right - 35;
mcKid.velocityX = -1 * mcKid.velocityX;
}
if (mcKid.newX <= (gBoardRect.left + 35)) {
mcKid.newX = gBoardRect.left + 35;
mcKid.velocityX = -1 * mcKid.velocityX;
}
if ((mcKid.velocityY < 0) and (mcKid.newY < (gBoardRect.top - 800))) {
mcKid.velocityY = 0;
}
if (mcKid.velocityY > 0) {
var _local4 = 27(mcKid, mcNapMat);
if ((_local4.sideHitArr != undefined) and (mcNapMat.mcPad.numNapsLeft > 0)) {
126();
}
}
if (mcKid.state == "normal") {
if ((mcKid.oldVelocityY * mcKid.velocityY) <= 0) {
if (mcKid.velocityY < 0) {
var _local3 = "rise";
} else {
var _local3 = "fall";
}
if (_local3 != mcKid._currentframe) {
mcKid.gotoAndPlay(_local3);
mcKid.gotoAndStop(mcKid._currentframe + mcKid.poseNum);
}
}
mcKid._rotation = mcKid._rotation + mcKid.rotDelta;
}
}
if ((gameState == "normal") and (mcKid.state == "normal")) {
gKidToPlayerDx = mcKid._x - mcPlayer._x;
if (24(mcKid)) {
trace("mcKid.velocityY:" + mcKid.velocityY);
11();
if ((mcPlayer["143"] == "gum") and (mcKid.state == "normal")) {
mcSound.playSound("gum stick");
mcKid.state = "stuck";
65();
151();
}
}
}
if (((gameState == "normal") or (gameState == "init")) and (!mcKid.firstFallOfLevel)) {
20(mcKid);
22(mcKid, true);
28(mcKid);
var _local2 = 0;
while (_local2 < gGloomArray.length) {
if (gGloomArray[_local2].gloomy) {
if (23(mcKid, gGloomArray[_local2].mcCollisionCircle)) {
gGloomArray[_local2].gloomy = false;
gGloomArray[_local2].gotoAndPlay("lift");
mcSound.playSound("gloom lift");
}
}
_local2++;
}
29(mcKid);
}
break;
case "sugarcrashed" :
}
133(mcKid);
mcKid.mcShadow._x = mcKid._x;
debugB = (Math.floor(mcKid.velocityX) + ",") + Math.floor(mcKid.velocityY);
40(mcRect1, mcKid.collisionRect);
}
function 65() {
mcGumSite.mcKidProxies = new Array();
var _local1 = 0;
while (_local1 <= mcGumSite.numSites) {
mcGumSite.mcKidProxy.duplicateMovieClip("mcKidProxy" + _local1, gNextDepth);
gNextDepth++;
mcGumSite["mcKidProxy" + _local1]._alpha = 50 + (_local1 / mcGumSite.numSites);
mcGumSite["mcKidProxy" + _local1]._xscale = 100 - ((_local1 / mcGumSite.numSites) * 50);
mcGumSite["mcKidProxy" + _local1]._yscale = mcGumSite["mcKidProxy" + _local1]._xscale;
mcGumSite.mcKidProxies.push(mcGumSite["mcKidProxy" + _local1]);
_local1++;
}
}
function 151() {
var _local2;
var _local1;
mcGumSite.mcKidProxy._x = mcKid._x;
mcGumSite.mcKidProxy._y = mcKid._y;
mcGumSite.mcKidProxy.velocityY = mcKid.velocityY;
mcGumSite.mcKidProxy.velocityX = mcKid.velocityX;
mcGumSite.mcKidProxy.oldX = mcKid.oldX;
mcGumSite.mcKidProxy.oldY = mcKid.oldY;
mcGumSite.mcKidProxy.time = mcKid.time;
mcGumSite.mcKidProxy.gravity = mcKid.gravity;
mcGumSite.mcKidProxy.speedfactor = mcKid.speedfactor;
mcGumSite.mcKidProxy.collisionOffsetRect = mcKid.collisionOffsetRect;
_local2 = 0;
while (_local2 <= mcGumSite.numSites) {
mcGumSite.mcKidProxies[_local2]._x = mcGumSite.mcKidProxy._x;
mcGumSite.mcKidProxies[_local2]._y = mcGumSite.mcKidProxy._y;
_local1 = 0;
while (_local1 <= 3) {
18(mcGumSite.mcKidProxy, false);
21(mcGumSite.mcKidProxy);
20(mcGumSite.mcKidProxy);
22(mcGumSite.mcKidProxy, false);
133(mcGumSite.mcKidProxy);
_local1++;
}
_local2++;
}
mcGumSite.mcKidProxy._x = -1000;
}
function 32() {
var _local1;
_local1 = 0;
while (_local1 <= mcGumSite.numSites) {
mcGumSite["mcKidProxy" + _local1].removeMovieClip();
_local1++;
}
}
function 149() {
if (gBigBalloonArray != undefined) {
var _local1;
for (var _local2 in gBigBalloonArray) {
_local1 = gBigBalloonArray[_local2];
if (_local1.velocityX != 0) {
18(_local1);
trace(((((("mcBigBalloon:" + _local1._x) + ",") + _local1._y) + _local1.newX) + ",") + _local1.newY);
21(_local1);
20(_local1);
22(_local1);
_local1.velocityX = _local1.velocityX * 0.98;
_local1.velocityY = _local1.velocityY * 0.98;
133(_local1);
}
if (24(_local1)) {
bounce(_local1);
}
}
}
}
function 28(_arg1) {
var _local3;
var _local4 = 0;
while (_local4 < gTargetArray.length) {
_local3 = gTargetArray[_local4];
if (_local3.state == "normal") {
if (44(_local3, _arg1) < 3600) {
58(_local3);
Set("45", _arg1._x - _local3._x);
Set("46", _arg1._y - _local3._y);
_arg1.velocityY = 2;
}
}
_local4++;
}
var _local2;
for (var _local6 in gBigBalloonArray) {
_local2 = gBigBalloonArray[_local6];
if (_local2._y < (groundY - 100)) {
if (44(_local2, _arg1) < 8100) {
var 45 = (_local2._x - _arg1._x);
var 46 = (_local2._y - _arg1._y);
var _local5 = 1.5 * Math.sqrt((_arg1.velocityX * _arg1.velocityX) + (_arg1.velocityY * _arg1.velocityY));
_local2.velocityX = (45 / 90) * _local5;
_local2.velocityY = (46 / 90) * _local5;
_arg1.velocityX = _arg1.velocityX * 0.75;
_arg1.velocityY = _arg1.velocityY * 0.75;
}
}
}
}
function 58(mcTarget) {
var _local2 = "pop" + (1 + random(2));
mcSound.playSound2(_local2);
mcTarget.hitsLeft--;
if (mcTarget.hitsLeft == 0) {
mcTarget.gotoAndPlay("hit");
mcTarget.state = "hit";
} else {
mcTarget.gotoAndStop(mcTarget._currentframe - 3);
}
4("balloon");
26();
}
function 26() {
var _local3 = true;
var _local4 = gTargetArray.length;
var _local1 = 0;
while (_local1 < _local4) {
mcTarget = gTargetArray[_local1];
if (mcTarget.state != "hit") {
_local3 = false;
}
_local1++;
}
if (mcBoss != undefined) {
_local3 = false;
}
_local1 = 0;
while (_local1 < gHoopArray.length) {
var _local2 = gHoopArray[_local1];
if (_local2.numHits < _local2.numHitsMax) {
_local3 = false;
}
_local1++;
}
if (_local3) {
80();
}
}
function 24(_arg2) {
return(((_arg2.velocityY >= 0) and (_arg2._y >= ((_root.mcPlayer._y - 75) + _root.mcPlayer.mcHead._y))) and (Math.abs(_arg2._x - mcPlayer._x) < mcPlayer.collisionDist));
}
function 71(x, y) {
var i;
var mcMonkey;
numMonkeys = 2;
gMonkeyArray = new Array();
i = 0;
while (i < numMonkeys) {
mcMonkeys.mcMonkeyDummy.duplicateMovieClip("mcMonkey" + i, gNextDepth);
gNextDepth++;
mcMonkey = eval ("mcMonkeys.mcMonkey" + i);
mcMonkey.state = "normal";
gMonkeyArray.push(mcMonkey);
mcMonkey._x = x;
mcMonkey._y = y;
mcMonkey.oldx = mcMonkey._x;
mcMonkey.oldy = mcMonkey._y;
mcMonkey.dRot = 0;
mcMonkey.gravity = 0.5;
mcMonkey.speedFactor = 0.75 + (gLevelNum * 0.01);
mcMonkey.velocityY = -12 - (i * 5);
mcMonkey.velocityX = i * 3;
mcMonkey.velocityMax = 17;
mcMonkey.time = 1;
mcMonkey.dRot = 10 + random(7);
mcMonkey.firstFallOfLevel = false;
12(mcMonkey);
if (random(2) == 1) {
mcMonkey.dRot = mcMonkey.dRot * -1;
}
mcMonkey.collisionOffsetRect = {left:-15, top:-15, right:15, bottom:15};
i++;
}
}
function 155() {
var _local2;
_local2 = 0;
while (_local2 < 2) {
var _local5 = false;
var _local1 = gMonkeyArray[_local2];
switch (_local1.state) {
case "normal" :
18(_local1, true);
21(_local1);
if (_local1.state == "idle") {
_local1.gotoAndPlay("die");
_local1.state = "die";
_local1._rotation = 0;
mcSound.playSound("monkey die");
}
if ((_local1.velocityY > 0) and _local1.mcHitArea.hitTest(mcPlayer.mcHitArea)) {
12(_local1);
_local1.firstFallOfLevel = false;
mcSound.playSound("monkeybounce");
if (mcPlayer["143"] == "gum") {
_local1.state = "stuck";
_local1.dxToPlayer = _local1._x - mcPlayer._x;
}
var _local4;
if (_local1.dRot == 0) {
_local4 = 0;
} else {
_local4 = Math.abs(_local1.dRot) / _local1.dRot;
}
var _local3 = _local4;
while (_local3 == _local4) {
_local3 = random(3) - 1;
}
_local1.dRot = _local3 * (10 + random(7));
if (_local1.dRot == 0) {
_local1._rotation = 0;
}
}
20(_local1);
29(_local1);
if (!_local1.firstFallOfLevel) {
28(_local1);
22(_local1, true);
}
_local1._rotation = _local1._rotation + _local1.dRot;
break;
case "stuck" :
trace("monkey stuck");
if (mcPlayer["143"] != "gum") {
_local1.state = "normal";
} else {
_local1.newX = mcPlayer._x + _local1.dxToPlayer;
}
}
133(_local1);
if (_local1.state == "dead") {
_local5 = true;
}
_local2++;
}
if (_local5) {
numMonkeys = gMonkeyArray.length;
_local2 = numMonkeys - 1;
while (_local2 >= 0) {
if (gMonkeyArray[_local2].state == "dead") {
gMonkeyArray[_local2]._visible = false;
removeMovieClip(gMonkeyArray[_local2]);
gMonkeyArray.splice(_local2, 1);
}
_local2--;
}
}
}
function 72() {
if (gNerdBullets == undefined) {
var 84 = 4;
gNerdBullets = new Array();
var j = 0;
while (j < 84) {
mcItems.attachMovie("nerdbullet", "mcNerdBullet" + j, gNextDepth, {46:0});
gNextDepth++;
var 94 = eval ("mcItems.mcNerdBullet" + j);
gNerdBullets.push(94);
j++;
}
}
}
function 50() {
if (mcPlayer.numBulletsLeft > 0) {
var _local2;
var _local3;
var _local1 = 0;
while (_local1 < gNerdBullets.length) {
if (gNerdBullets[_local1]["46"] == 0) {
if (_local2 == undefined) {
_local2 = gNerdBullets[_local1];
} else {
_local3 = gNerdBullets[_local1];
}
}
_local1++;
}
if (_local3 != undefined) {
mcSound.playSound("geek shoot");
_local2.gotoAndStop(1);
_local3.gotoAndStop(2);
_local2._x = mcPlayer._x - 13;
_local2._y = mcPlayer._y - 30;
_local3._x = mcPlayer._x + 11;
_local3._y = mcPlayer._y - 30;
_local2["46"] = -9;
_local3["46"] = -9;
mcPlayer.numBulletsLeft = mcPlayer.numBulletsLeft - 2;
}
}
}
function 157() {
var _local6 = gNerdBullets.length;
var _local3 = 0;
while (_local3 < _local6) {
if (gNerdBullets[_local3]["46"] != 0) {
var _local1 = gNerdBullets[_local3];
_local1._y = _local1._y + gNerdBullets[_local3]["46"];
if (_local1._y < (gBoardRect.top - 5)) {
_local1["46"] = 0;
}
var _local4 = gBrickArray.length;
var _local2 = 0;
while (_local2 < _local4) {
if (gBrickArray[_local2].hits < 2) {
if (112(_local1._x, _local1._y, gBrickArray[_local2].collisionRect)) {
gBrickArray[_local2].sideHit = "b";
59(gBrickArray[_local2]);
_local1.76();
}
}
_local2++;
}
_local4 = gTargetArray.length;
_local2 = 0;
while (_local2 < _local4) {
if (gTargetArray[_local2].hitsLeft > 0) {
if (112(_local1._x, _local1._y, gTargetArray[_local2].collisionRect)) {
58(gTargetArray[_local2]);
_local1.76();
}
}
_local2++;
}
if (mcBoss != undefined) {
if (112(_local1._x, _local1._y, mcBoss.collisionRect)) {
10({primarySideHit:"b"}, 3);
_local1.76();
}
}
}
_local3++;
}
}
function 20(_arg2) {
iMax = gBarrierArr.length;
i = 0;
while (i < iMax) {
barrier = gBarrierArr[i];
var _local1 = 27(_arg2, barrier);
if (_local1.sideHitArr != undefined) {
_arg2.velocityX = _local1.newVelocityX;
_arg2.velocityY = _local1.newVelocityY;
18(_arg2, true);
mcSound.playSound("sugarbounce" + String(random(3) + 1));
}
i++;
}
}
function 22(_arg6, _arg12) {
var _local10 = gBrickArray.length;
var _local4;
var _local1;
var _local11;
var _local8 = _arg6.velocityX;
var _local9 = _arg6.velocityY;
var _local7 = 0;
while (_local7 < _local10) {
_local1 = gBrickArray[_local7];
if (_local1.hits < 2) {
_local1["36"] = 27(_arg6, _local1);
if (_local1["36"] != undefined) {
if (_local4 != undefined) {
var _local5;
var _local3 = 0;
while (_local3 < _local1["36"].sideHitArr.length) {
var _local2 = 0;
while (_local2 < _local4["36"].sideHitArr.length) {
if (_local1["36"].sideHitArr[_local3] == _local4["36"].sideHitArr[_local2]) {
_local5 = _local1["36"].sideHitArr[_local3];
}
_local2++;
}
_local3++;
}
if (44(_arg6, _local4) > 44(_arg6, _local1)) {
_local4 = _local1;
_local4.sideHit = _local1["36"].primarySideHit;
trace("collisionInfo.primarySideHit:" + _local1["36"].primarySideHit);
_local8 = _local1["36"].newVelocityX;
_local9 = _local1["36"].newVelocityY;
}
} else {
_local4 = _local1;
_local4.sideHit = _local1["36"].primarySideHit;
trace("collisionInfo.primarySideHit:" + _local1["36"].primarySideHit);
146(_local11);
_local8 = _local1["36"].newVelocityX;
_local9 = _local1["36"].newVelocityY;
}
if (_local5 != undefined) {
if ((_local5 == "l") or (_local5 == "r")) {
_local9 = _arg6.velocityY;
}
if ((_local5 == "b") or (_local5 == "t")) {
_local8 = _arg6.velocityX;
}
_local4.sideHit = _local5;
}
}
}
_local7++;
}
if (_local4 != undefined) {
if (_arg12) {
59(_local4);
}
_arg6.velocityX = _local8;
_arg6.velocityY = _local9;
if (_arg6 == mcKid) {
if ((gNumFrames - mcKid.lastBrickHitFrame) > 15) {
mcKid.successiveShortBrickBounces = 0;
} else {
mcKid.successiveShortBrickBounces++;
if (mcKid.successiveShortBrickBounces > 20) {
mcKid.state = "trapped";
mcKid.velocityX = 0;
mcKid.velocityY = 0;
mcKid.countdownToDie = 40;
mcKid._rotation = 0;
mcKid.mcWordBalloon.gotoAndStop("trapped");
mcKid.gotoAndStop(1);
}
}
mcKid.lastBrickHitFrame = gNumFrames;
}
18(_arg6, true);
40(mcRect2, _local4.collisionRect);
}
}
function 59(_arg1) {
var _local2 = "sugarbounce" + String(random(3) + 1);
if (_arg1.type != "metal") {
_arg1.hits++;
if (_arg1.hits <= 1) {
_arg1.gotoAndPlay(_arg1.sideHit);
} else {
_arg1.gotoAndPlay("dead");
_local2 = "brick break " + String(random(2));
39("random brick sound:" + _local2);
}
4("brick");
}
mcSound.playSound(_local2);
}
function 21(_arg1) {
if ((_arg1.velocityX > 0) and (((_arg1._x + _arg1.velocityX) + (_arg1._width / 2)) > gBoardRect.right)) {
_arg1.velocityX = _arg1.velocityX * -1;
}
if ((_arg1.velocityX < 0) and (((_arg1._x + _arg1.velocityX) - (_arg1._width / 2)) < gBoardRect.left)) {
_arg1.velocityX = _arg1.velocityX * -1;
}
if (_arg1.gravity == 0) {
if ((_arg1.velocityY < 0) and (((_arg1._y + _arg1.velocityY) - (_arg1._height / 2)) < gBoardRect.top)) {
_arg1.velocityY = _arg1.velocityY * -1;
}
}
if ((_arg1.velocityY > 0) and (((_arg1._y + _arg1.velocityY) + (_arg1._height / 2)) > gBoardRect.bottom)) {
_arg1.state = "idle";
if (_arg1.gravity == 0) {
_arg1.velocityY = _arg1.velocityY * -1;
}
}
}
function 77() {
i = 0;
while (i < gPowerUpArray.length) {
mcPowerUp = gPowerUpArray[i];
mcPowerUp.gotoAndPlay(mcPowerUp.type + " hit");
mcPowerUp.state = "hit";
i++;
}
}
function 81(_arg1) {
var _local2;
mcKid.gotoAndPlay(_arg1);
mcKid.state = _arg1;
mcKid.mcWordBalloon.gotoAndPlay(_arg1);
mcKid._rotation = 0;
gWhereToGo = "lose";
gameState = "lose";
mcPlayer.mcFace.gotoAndStop("frown");
mcPlayer.whereToGo = mcPlayer["143"] + " idle";
77();
_local2 = 0;
while (_local2 < gMonkeyArray.length) {
if (gMonkeyArray[_local2].state == "normal") {
gMonkeyArray[_local2].gotoAndPlay("die");
gMonkeyArray[_local2].state = "die";
gMonkeyArray[_local2]._rotation = 0;
}
_local2++;
}
_local2 = 0;
while (_local2 < gNerdBullets.length) {
gNerdBullets[_local2].76();
_local2++;
}
for (_local2 in gSuctionArray) {
gSuctionArray[_local2].mcSuckPath._visible = false;
}
gNumLives--;
mcNumLives.gotoAndStop(gNumLives + 1);
mcPlayer.targetX = undefined;
if ((_arg1 == "dropped") or (_arg1 == "sugarcrashed")) {
mcSound.playSound2("dropped");
49();
}
39("life lost: " + _arg1);
mcSound.playSound("dropped theme");
mcSound.music.stop();
mcNapMat.mcArrow._visible = false;
}
function 161() {
var _local1;
for (var _local2 in gSuctionArray) {
_local1 = gSuctionArray[_local2];
if (_local1["46"] != 0) {
_local1._y;
}
}
}
function 18(_arg2, _arg4) {
var _local5 = _arg2.speedFactor;
if (mcPlayer["143"] != "mollases") {
if (_arg2.velocityY > 0) {
_local5 = _local5 * 0.85;
}
}
_arg2.velocityY = _arg2.velocityY + ((_arg2.gravity * _arg2.time) * _local5);
_arg2.newY = _arg2.oldY + ((_arg2.velocityY * _arg2.time) * _local5);
_arg2.newX = _arg2.oldX + ((_arg2.velocityX * _arg2.time) * _local5);
if (_arg2.gravity != 0) {
var _local1;
var _local3 = 0;
while (_local3 < gSuctionArray.length) {
_local1 = gSuctionArray[_local3];
trace((_arg2 + " mcSuction.prevOnState:") + _local1.mcSuckPath._visible);
if (_local1._rotation == 0) {
if ((_arg2.newX > (_local1._x - 50)) and (_arg2.newX < (_local1._x + 50))) {
_arg2.velocityY = _arg2.velocityY + 0.6;
_arg2.velocityX = _arg2.velocityX * 0.99;
if (_arg4) {
_local1.mcSuckPath._visible = true;
if (!_local1.prevOnState) {
mcSound.playSound("suck");
}
}
}
}
if (_local1._rotation == 90) {
if ((_arg2.newY > (_local1._y - 50)) and (_arg2.newY < (_local1._y + 50))) {
_arg2.velocityX = _arg2.velocityX - 0.6;
_arg2.velocityY = _arg2.velocityY * 0.99;
if (_arg4) {
_local1.mcSuckPath._visible = true;
if (!_local1.prevOnState) {
mcSound.playSound("suck");
}
}
}
}
if (_local1._rotation == -90) {
if ((_arg2.newY > (_local1._y - 50)) and (_arg2.newY < (_local1._y + 50))) {
_arg2.velocityX = _arg2.velocityX + 0.6;
_arg2.velocityY = _arg2.velocityY * 0.99;
if (_arg4) {
_local1.mcSuckPath._visible = true;
if (!_local1.prevOnState) {
mcSound.playSound("suck");
}
}
}
}
_local3++;
}
}
}
function 133(_arg1) {
_arg1.oldX = _arg1.newX;
_arg1.oldY = _arg1.newY;
_arg1._y = _arg1.newY;
_arg1._x = _arg1.newX;
_arg1.oldCollisionRect = _arg1.collisionRect;
_arg1.collisionRect = 104(_arg1.collisionOffsetRect, _arg1._x, _arg1._y);
}
function 80() {
gWhereToGo = "win";
mcNapMat.mcArrow._visible = false;
var _local1 = 0;
while (_local1 < gNerdBullets.length) {
gNerdBullets[_local1].76();
_local1++;
}
gLocalInfo.data.highestLevelSolved = Math.max(gLocalInfo.data.highestLevelSolved, gLevelNum);
gLocalInfo.flush();
mcSound.playSound2("win theme");
mcSound.music.stop();
gotoAndPlay ("win");
32();
83("sugc_levelwon_" + gLevelNum);
}
function 97() {
var _local1;
var _local2;
gLevelNum++;
_local1 = 0;
while (_local1 < numBalloonColumns) {
_local2 = 0;
while (_local2 < numBalloonRows) {
mcItems[(("mcTarget" + _local1) + "_") + _local2].removeMovieClip();
_local2++;
}
_local1++;
}
mcKid.firstFallOfLevel = true;
_local1 = 0;
while (_local1 < gMonkeyArray.length) {
gMonkeyArray[_local1].gotoAndPlay("die");
gMonkeyArray[_local1].state = "die";
gMonkeyArray[_local1]._rotation = 0;
_local1++;
}
mcSound.sound2.stop();
gotoAndPlay ("init level");
}
function 52() {
gWhereToGo = "game won";
mcBoss.state = "doubledead";
mcPlayer.gotoAndStop("bag full");
mcPlayer.whereToGo = "bag full";
mcPlayer.myColor.setTransform(mcPlayer.defaultColorTransform);
mcSound.playMusic("game win theme");
}
function 11() {
if (mcKid.velocityY == 0) {
mcSound.playSound("first bounce");
mcKid.velocityX = -2;
mcKid.velocityY = -16.8;
mcKid.firstFallOfLevel = false;
} else {
if (mcKid.firstFallOfLevel) {
mcKid.velocityX = mcKid.velocityX * 0.75;
mcKid.velocityY = mcKid.velocityY * 0.75;
mcKid.firstFallOfLevel = false;
}
12(mcKid);
mcKid._rotation = 17();
if (mcPlayer["143"] != "gum") {
mcSound.playSound2("bounce2");
}
}
debugD = (("kid rot pt:" + int(point.x)) + ",") + int(point.y);
mcHitAnim = 48();
mcHitAnim._x = mcKid._x;
mcHitAnim._y = mcKid._y;
mcHitAnim._rotation = mcKid._rotation;
mcHitAnim.play();
if (!mcDebug.sugarImmune) {
mcKid.sugarLevel = mcKid.sugarLevel + 7.5;
}
oldPose = mcKid.poseNum;
while (mcKid.poseNum == oldPose) {
mcKid.poseNum = random(4);
}
mcKid.rotDelta = 0;
if ((random(3) == 1) and (mcKid.velocityY < (-(mcKid.velocityMax - 8)))) {
mcKid.rotDelta = (7 * Math.abs(mcKid.velocityX)) / mcKid.velocityX;
if (random(3) == 1) {
mcKid.rotDelta = mcKid.rotDelta * 2;
}
}
if (mcPlayer["143"] != "gum") {
mcKid.myColor.setTransform(mcKid.whiteColorTransform);
mcKid.switchToNormalColorFrames = 2;
}
mcKid.gotoAndPlay("rise");
mcKid.gotoAndStop(mcKid._currentframe + mcKid.poseNum);
162();
if (mcKid.sugarLevel >= mcKid.sugarLevelMax) {
mcKid.velocityY = -50;
mcKid.velocityX = (mcKid.velocityX / Math.abs(mcKid.velocityX)) * 50;
mcKid.gotoAndStop("sugar crash");
mcKid.state = "sugarcrashing";
mcKid.groundBounceCount = 0;
gameState = "lose";
mcPlayer.mcFace.gotoAndStop("frown");
mcKid._rotation = 17();
mcSound.playsound("sugarcrash");
}
debugV = mcKid.velocityY;
}
function 12(_arg1) {
theta = 16(_arg1, mcPlayer);
theta = Math.max(theta, -45);
theta = Math.min(theta, 45);
mcPlayer.mcRotationDummy._rotation = theta;
_arg1.oldY = _arg1._y;
_arg1.oldX = _arg1._x;
totalVelocity = Math.sqrt((_arg1.velocityX * _arg1.velocityX) + (_arg1.velocityY * _arg1.velocityY));
totalVelocity = totalVelocity * 1.13;
totalVelocity = Math.min(totalVelocity, _arg1.velocityMax);
totalVelocity = Math.max(totalVelocity, -_arg1.velocityMax);
var _local2 = {x:mcPlayer.mcRotationDummy.mcPoint._x, y:mcPlayer.mcRotationDummy.mcPoint._y};
mcPlayer.mcRotationDummy.localToGlobal(_local2);
_local2.x = _local2.x - mcPlayer._x;
_local2.y = _local2.y - mcPlayer._y;
_arg1.velocityX = (_local2.x / 100) * totalVelocity;
_arg1.velocityY = (_local2.y / 100) * totalVelocity;
}
function 162() {
mcKid.sugarLevel = Math.min(mcKid.sugarLevel, mcKid.sugarLevelMax);
mcKid.sugarLevel = Math.max(mcKid.sugarLevel, 0);
var _local1 = int((mcKid.sugarLevel / mcKid.sugarLevelMax) * 50);
if (_local1 < 1) {
_local1 = 1;
}
mcNapMat.mcArrow._visible = ((_local1 > 35) and (mcKid.state != "nap")) and (mcNapMat.mcPad.numNapsLeft > 0);
mcSugarLevel.gotoAndStop(_local1);
if (_local1 > 35) {
var _local2 = 5 - Math.floor(((50 - _local1) / 15) * 2);
} else {
var _local2 = 1 + Math.floor((_local1 / 36) * 3);
}
mcKid.mcMouth.gotoAndStop(_local2);
}
function 126() {
if (mcKid.sugarLevel > 0) {
mcNapMat.mcPad.numNapsLeft--;
mcSound.music.setVolume(0);
mcSound.playMusic2("napping theme");
mcKid.gotoAndPlay("nap");
mcKid.state = "nap";
mcKid.velocityBeforeNapX = mcKid.velocityX;
mcKid.velocityBeforeNapY = mcKid.velocityY;
mcKid.velocityY = 0;
mcKid.velocityX = 0;
mcKid._rotation = 0;
_root.mcPlayer.swapDepths(_root.mcKid);
mcKid._x = mcNapMat._x - 5;
mcKid._y = mcNapMat._y + mcNapMat.mcPad._y;
} else {
mcKid.velocityY = mcKid.velocityY * -1;
mcKid.firstFallOfLevel = false;
}
}
function 164() {
var _local1;
mcKid.state = "normal";
mcKid.gotoAndPlay("rise");
mcKid.velocityY = Math.abs(mcKid.velocityBeforeNapY) * -1.1;
mcKid.velocityY = Math.min(-12, mcKid.velocityY);
mcKid.velocityY = Math.max(-21, mcKid.velocityY);
mcKid.velocityX = mcKid.velocityBeforeNapX * 1.1;
mcKid.velocityX = -5;
mcSound.music.setVolume(40);
mcSound.music2.stop();
mcSound.playSound("first bounce");
if (mcNapMat.mcPad.numNapsLeft == 0) {
mcNapMat.gotoAndPlay("disappear");
}
}
function 49() {
var _local1 = 100;
if (mcKid._x < 100) {
newPlayerX = mcKid._x + _local1;
} else if (mcKid._x > (gBoardRect.right - 100)) {
newPlayerX = mcKid._x - _local1;
} else if (mcPlayer._x > mcKid._x) {
newPlayerX = mcKid._x + _local1;
} else {
newPlayerX = mcKid._x - _local1;
}
mcPlayer.targetX = newPlayerX;
}
function 156() {
18(mcNapMat, eval("TRUE"));
133(mcNapMat);
if (mcNapMat.velocityX != 0) {
if ((mcNapMat._x > (gboardRect.right - (mcNapMat._width / 2))) or (mcNapMat._x < (gBoardRect.left + (mcNapMat._width / 2)))) {
mcNapMat.velocityX = mcNapMat.velocityX * -1;
}
}
}
function 158() {
mcPlayer.oldX = mcPlayer._x;
newPlayerX = Math.min(_xmouse, 540);
if (mcPlayer.switchToNormalColorFrames > 0) {
mcPlayer.switchToNormalColorFrames--;
if (mcPlayer.switchToNormalColorFrames == 0) {
mcPlayer.myColor.setTransform(mcPlayer.defaultColorTransform);
}
}
if (newPlayerX != mcPlayer._x) {
mcPlayer.state = "walk";
mcPlayer.whereToGo = (mcPlayer["143"] + " ") + mcPlayer.state;
mcPlayer._x = newPlayerX;
mcPlayer.timeOfLastMove = getTimer();
} else if ((getTimer() - mcPlayer.timeOfLastMove) > mcPlayer.ticksNotMovingBeforeGoingIdle) {
mcPlayer.state = "idle";
mcPlayer.whereToGo = (mcPlayer["143"] + " ") + mcPlayer.state;
}
if (mcPlayer["143"] != "sugar") {
if ((gNumFrames > mcPlayer.frameCountToReturnToNormal) and (mcPlayer.frameCountToReturnToNormal != undefined)) {
134("sugar");
mcPlayer.collisionDist = mcPlayer.normalcollisionDist;
32();
}
if (mcPlayer["143"] == "bag") {
if (mcPlayer.delayFrames > 0) {
mcPlayer.whereToGo = "bag eating";
mcPlayer.delayFrames--;
}
}
}
111();
}
function 67() {
var _local6;
var _local5;
initX = 160;
initY = 380;
mcKid._x = initX;
mcKid._y = groundY;
mcKid.velocityY = 0;
mcKid.velocityX = 0;
mcKid.collisionOffsetRect = {left:-30, top:-40, right:30, bottom:17};
mcKid.velocityMax = 22;
mcKid.oldX = initX;
mcKid.oldY = initY;
mcKid.time = 1;
mcKid.gravity = 0.7;
mcKid.speedFactor = 0.75 + Number(0.01 * gLevelNum);
trace((("mcKid.speedFactor:" + mcKid.speedFactor) + ",gLevelNum:") + gLevelNum);
mcKid.sugarLevel = 0;
mcKid.sugarLevelMax = 100;
mcKid.mcShadow = mcShadow;
mcShadow._y = groundY + 30;
130(mcKid);
130(mcPlayer);
}
function 31() {
var _local1;
var _local2;
for (_local1 in mcItems) {
mcItems[_local1].removeMovieClip();
}
_local1 = 0;
while (_local1 < gPowerUpArray.length) {
gPowerUpArray[_local1].removeMovieClip();
_local1++;
}
_local1 = 0;
while (_local1 < gMonkeyArray.length) {
gMonkeyArray[_local1].removeMovieClip();
_local1++;
}
gNerdBullets = undefined;
mcShadow._x = -1000;
32();
stopAllSounds();
mcKid._x = -1000;
mcBoss = undefined;
}
function 23(_arg3, _arg2) {
var _local1 = ((_arg3._width / 2) + (_arg2._width / 2)) * ((_arg3._width / 2) + (_arg2._width / 2));
return(44(_arg3, _arg2) < _local1);
}
function 27(_arg2, _arg10) {
var _local1;
var _local5 = 123(_arg2.collisionRect, _arg10.collisionRect);
var _local3 = _arg2.collisionRect;
var _local4 = _arg10.collisionRect;
var _local6 = _local5.width - (((_local3.right - _local3.left) + _local4.right) - _local4.left);
var _local7 = _local5.height - (((_local3.bottom - _local3.top) + _local4.bottom) - _local4.top);
if ((_local6 <= 0) and (_local7 <= 0)) {
_local1 = {sideHitArr:new Array(), primarySideHit:undefined, newVelocityX:_arg2.velocityX, newVelocityY:_arg2.velocityY};
if (_local6 > _local7) {
if (_local3.left == _local5.left) {
if (_arg2.velocityX > 0) {
_local1.primarySideHit = "l";
_local1.newVelocityX = -0.85 * Math.abs(_arg2.velocityX);
if (_local1.newVelocityX > -3) {
_local1.newVelocityX = -3;
}
}
} else if (_arg2.velocityX < 0) {
_local1.primarySideHit = "r";
_local1.newVelocityX = 0.85 * Math.abs(_arg2.velocityX);
if (_local1.newVelocityX < 3) {
_local1.newVelocityX = 3;
}
}
} else if (_local3.top == _local5.top) {
if (_arg2.velocityY > 0) {
_local1.primarySideHit = "t";
_local1.newVelocityY = -0.85 * Math.abs(_arg2.velocityY);
if (_local1.newVelocityY > -3) {
_local1.newVelocityY = -3;
}
}
} else if (_arg2.velocityY < 0) {
_local1.primarySideHit = "b";
_local1.newVelocityY = 0.7 * Math.abs(_arg2.velocityY);
if (_local1.newVelocityY < 3) {
_local1.newVelocityY = 3;
}
}
}
if (_local1.primarySideHit == undefined) {
_local1 = undefined;
}
return(_local1);
}
function 111() {
if (mcPlayer._x > mcKid._x) {
mcPlayer.mcFace._xscale = -Math.abs(mcPlayer.mcFace._xscale);
} else {
mcPlayer.mcFace._xscale = Math.abs(mcPlayer.mcFace._xscale);
}
}
function 48() {
if (mcHitAnim0.state == "active") {
var _local1 = mcHitAnim1;
} else {
var _local1 = mcHitAnim0;
}
return(_local1);
}
function 130(_arg1) {
_arg1.myColor = new Color(_arg1);
_arg1.defaultColorTransform = _arg1.myColor.getTransform();
_arg1.redColorTransform = new Object();
_arg1.redColorTransform = {ra:"255", rb:"0", ga:"0", gb:"0", ba:"0", bb:"0", aa:"100", ab:"100"};
_arg1.whiteColorTransform = new Object();
_arg1.whiteColorTransform = {ra:"255", rb:"99", ga:"255", gb:"99", ba:"255", bb:"99", aa:"100", ab:"100"};
}
Frame 26
if (_root.54() < 100) {
gotoAndPlay ("loading");
}
Frame 29
stop();
Instance of Symbol 291 MovieClip "mcLevels" in Frame 29
onClipEvent (load) {
_y = 10000;
readingLevels = true;
}
Frame 32
64();
mcSound.playSound("title");
Instance of Symbol 443 MovieClip in Frame 32
onClipEvent (load) {
if (_root.gShockwave) {
_visible = false;
}
}
Instance of Symbol 447 MovieClip in Frame 32
onClipEvent (load) {
if (!_root.gShockwave) {
_visible = false;
}
}
Frame 35
mcSound.playMusic("panting");
stop();
Instance of Symbol 291 MovieClip "mcLevels" in Frame 38
onClipEvent (load) {
readingLevels = false;
}
onClipEvent (enterFrame) {
if (String(_root.initialLevelNum) == "NaN") {
_root.initialLevelNum = 1;
}
newFrame = 1 + ((_root.initialLevelNum - 1) * 3);
if (newFrame != _currentframe) {
gotoAndStop(newFrame);
}
}
Frame 39
stopAllSounds();
mcSound.playMusic("choose level theme");
if (mcSound.soundOn) {
}
132();
stop();
Frame 43
63();
Frame 45
68();
Frame 47
139();
Frame 48
if ((mcPlayer["143"] != "mollases") or (gameState == "lose")) {
139();
}
gotoAndPlay(gWhereToGo);
Frame 55
stop();
Frame 60
if (mcPlayer.targetX != undefined) {
deltaToTarget = mcPlayer.targetX - mcPlayer._x;
deltaX = 12;
if (Math.abs(deltaToTarget) > deltaX) {
Set("42", Math.abs(deltaToTarget) / deltaToTarget);
mcPlayer._x = mcPlayer._x + (42 * deltaX);
}
pointFaceTowardsKid();
}
if (gNumLives > 0) {
if (delayStartTime == undefined) {
delayStartTime = getTimer();
} else if ((getTimer() - delayStartTime) > 3000) {
69(true);
gWhereToGo = "play loop";
mcKid.mcWordballoon.gotoAndStop("empty");
delayStartTime = undefined;
}
}
gotoAndPlay(gWhereToGo);
Frame 65
gotoAndPlay(gWhereToGo);
Frame 67
gWhereToGo = "game won loop";
Instance of Symbol 632 MovieClip "HSHubSubmitter" in Frame 75
onClipEvent (load) {
docount = false;
}
onClipEvent (enterFrame) {
if (docount) {
trycount++;
if ((_level2.getBytesTotal() == -1) && (trycount > 60)) {
docount = false;
trycount = 0;
}
}
}
Instance of Symbol 620 MovieClip "disabler" in Frame 75
onClipEvent (load) {
_visible = false;
}
Frame 76
gotoAndPlay(gWhereToGo);
Symbol 3 MovieClip Frame 1
var 37 = _parent;
37.registerSkinElement(track_mc, "scrollTrack");
Symbol 4 MovieClip [FScrollBarSymbol] Frame 1
#initclip 2
FScrollBarClass = function () {
if (this._height == 4) {
return(undefined);
}
this.init();
this.minPos = (this.maxPos = (this.pageSize = (this.largeScroll = 0)));
this.smallScroll = 1;
this.width = (this.horizontal ? (this._width) : (this._height));
this._xscale = (this._yscale = 100);
this.setScrollPosition(0);
this.tabEnabled = false;
if (this._targetInstanceName.length > 0) {
this.setScrollTarget(this._parent[this._targetInstanceName]);
}
this.tabChildren = false;
this.setSize(this.width);
};
FScrollBarClass.prototype = new FUIComponentClass();
FScrollBarClass.prototype.setHorizontal = function (_arg2) {
if (this.horizontal && (!_arg2)) {
this._xscale = 100;
this._rotation = 0;
} else if (_arg2 && (!this.horizontal)) {
this._xscale = -100;
this._rotation = -90;
}
this.horizontal = _arg2;
};
FScrollBarClass.prototype.setScrollProperties = function (_arg5, _arg3, _arg4) {
if (!this.enable) {
return(undefined);
}
this.pageSize = _arg5;
this.minPos = Math.max(_arg3, 0);
this.maxPos = Math.max(_arg4, 0);
this.scrollPosition = Math.max(this.minPos, this.scrollPosition);
this.scrollPosition = Math.min(this.maxPos, this.scrollPosition);
if ((this.maxPos - this.minPos) <= 0) {
this.scrollThumb_mc.removeMovieClip();
this.upArrow_mc.gotoAndStop(3);
this.downArrow_mc.gotoAndStop(3);
this.downArrow_mc.onPress = (this.downArrow_mc.onRelease = (this.downArrow_mc.onDragOut = null));
this.upArrow_mc.onPress = (this.upArrow_mc.onRelease = (this.upArrow_mc.onDragOut = null));
this.scrollTrack_mc.onPress = (this.scrollTrack_mc.onRelease = null);
this.scrollTrack_mc.onDragOut = (this.scrollTrack_mc.onRollOut = null);
this.scrollTrack_mc.useHandCursor = false;
} else {
var _local2 = this.getScrollPosition();
this.upArrow_mc.gotoAndStop(1);
this.downArrow_mc.gotoAndStop(1);
this.upArrow_mc.onPress = (this.upArrow_mc.onDragOver = this.startUpScroller);
this.upArrow_mc.onRelease = (this.upArrow_mc.onDragOut = this.stopScrolling);
this.downArrow_mc.onPress = (this.downArrow_mc.onDragOver = this.startDownScroller);
this.downArrow_mc.onRelease = (this.downArrow_mc.onDragOut = this.stopScrolling);
this.scrollTrack_mc.onPress = (this.scrollTrack_mc.onDragOver = this.startTrackScroller);
this.scrollTrack_mc.onRelease = this.stopScrolling;
this.scrollTrack_mc.onDragOut = this.stopScrolling;
this.scrollTrack_mc.onRollOut = this.stopScrolling;
this.scrollTrack_mc.useHandCursor = false;
this.attachMovie("ScrollThumb", "scrollThumb_mc", 3);
this.scrollThumb_mc._x = 0;
this.scrollThumb_mc._y = this.upArrow_mc._height;
this.scrollThumb_mc.onPress = this.startDragThumb;
this.scrollThumb_mc.controller = this;
this.scrollThumb_mc.onRelease = (this.scrollThumb_mc.onReleaseOutside = this.stopDragThumb);
this.scrollThumb_mc.useHandCursor = false;
this.thumbHeight = (this.pageSize / ((this.maxPos - this.minPos) + this.pageSize)) * this.trackSize;
this.thumbMid_mc = this.scrollThumb_mc.mc_sliderMid;
this.thumbTop_mc = this.scrollThumb_mc.mc_sliderTop;
this.thumbBot_mc = this.scrollThumb_mc.mc_sliderBot;
this.thumbHeight = Math.max(this.thumbHeight, 6);
this.midHeight = (this.thumbHeight - this.thumbTop_mc._height) - this.thumbBot_mc._height;
this.thumbMid_mc._yScale = (this.midHeight * 100) / this.thumbMid_mc._height;
this.thumbMid_mc._y = this.thumbTop_mc._height;
this.thumbBot_mc._y = this.thumbTop_mc._height + this.midHeight;
this.scrollTop = this.scrollThumb_mc._y;
this.trackHeight = this.trackSize - this.thumbHeight;
this.scrollBot = this.trackHeight + this.scrollTop;
_local2 = Math.min(_local2, this.maxPos);
this.setScrollPosition(Math.max(_local2, this.minPos));
}
};
FScrollBarClass.prototype.getScrollPosition = function () {
return(this.scrollPosition);
};
FScrollBarClass.prototype.setScrollPosition = function (_arg2) {
this.scrollPosition = _arg2;
if (this.scrollThumb_mc != undefined) {
_arg2 = Math.min(_arg2, this.maxPos);
_arg2 = Math.max(_arg2, this.minPos);
}
this.scrollThumb_mc._y = (((_arg2 - this.minPos) * this.trackHeight) / (this.maxPos - this.minPos)) + this.scrollTop;
this.executeCallBack();
};
FScrollBarClass.prototype.setLargeScroll = function (_arg2) {
this.largeScroll = _arg2;
};
FScrollBarClass.prototype.setSmallScroll = function (_arg2) {
this.smallScroll = _arg2;
};
FScrollBarClass.prototype.setEnabled = function (_arg2) {
var _local3 = this.enable;
if (_arg2 && (!_local3)) {
this.enable = _arg2;
if (this.textField != undefined) {
this.setScrollTarget(this.textField);
} else {
this.setScrollProperties(this.pageSize, this.cachedMinPos, this.cachedMaxPos);
this.setScrollPosition(this.cachedPos);
}
this.clickFilter = undefined;
} else if ((!_arg2) && (_local3)) {
this.textField.removeListener(this);
this.cachedPos = this.getScrollPosition();
this.cachedMinPos = this.minPos;
this.cachedMaxPos = this.maxPos;
if (this.clickFilter == undefined) {
this.setScrollProperties(this.pageSize, 0, 0);
} else {
this.clickFilter = true;
}
this.enable = _arg2;
}
};
FScrollBarClass.prototype.setSize = function (_arg2) {
if (this._height == 1) {
return(undefined);
}
this.width = _arg2;
this.scrollTrack_mc._yscale = 100;
this.scrollTrack_mc._yscale = (100 * this.width) / this.scrollTrack_mc._height;
if (this.upArrow_mc == undefined) {
this.attachMovie("UpArrow", "upArrow_mc", 1);
this.attachMovie("DownArrow", "downArrow_mc", 2);
this.downArrow_mc.controller = (this.upArrow_mc.controller = this);
this.upArrow_mc.useHandCursor = (this.downArrow_mc.useHandCursor = false);
this.upArrow_mc._x = (this.upArrow_mc._y = 0);
this.downArrow_mc._x = 0;
}
this.scrollTrack_mc.controller = this;
this.downArrow_mc._y = this.width - this.downArrow_mc._height;
this.trackSize = this.width - (2 * this.downArrow_mc._height);
if (this.textField != undefined) {
this.onTextChanged();
} else {
this.setScrollProperties(this.pageSize, this.minPos, this.maxPos);
}
};
FScrollBarClass.prototype.scrollIt = function (_arg5, _arg4) {
var _local3 = this.smallScroll;
if (_arg5 != "one") {
_local3 = ((this.largeScroll == 0) ? (this.pageSize) : (this.largeScroll));
}
var _local2 = this.getScrollPosition() + (_arg4 * _local3);
if (_local2 > this.maxPos) {
_local2 = this.maxPos;
} else if (_local2 < this.minPos) {
_local2 = this.minPos;
}
this.setScrollPosition(_local2);
};
FScrollBarClass.prototype.startDragThumb = function () {
this.lastY = this._ymouse;
this.onMouseMove = this.controller.dragThumb;
};
FScrollBarClass.prototype.dragThumb = function () {
this.scrollMove = this._ymouse - this.lastY;
this.scrollMove = this.scrollMove + this._y;
if (this.scrollMove < this.controller.scrollTop) {
this.scrollMove = this.controller.scrollTop;
} else if (this.scrollMove > this.controller.scrollBot) {
this.scrollMove = this.controller.scrollBot;
}
this._y = this.scrollMove;
var _local2 = this.controller;
_local2.scrollPosition = Math.round(((_local2.maxPos - _local2.minPos) * (this._y - _local2.scrollTop)) / _local2.trackHeight) + _local2.minPos;
this.controller.isScrolling = true;
updateAfterEvent();
this.controller.executeCallBack();
};
FScrollBarClass.prototype.stopDragThumb = function () {
this.controller.isScrolling = false;
this.onMouseMove = null;
};
FScrollBarClass.prototype.startTrackScroller = function () {
this.controller.trackScroller();
this.controller.scrolling = setInterval(this.controller, "scrollInterval", 500, "page", -1);
};
FScrollBarClass.prototype.scrollInterval = function (_arg2, _arg3) {
clearInterval(this.scrolling);
if (_arg2 == "page") {
this.trackScroller();
} else {
this.scrollIt(_arg2, _arg3);
}
this.scrolling = setInterval(this, "scrollInterval", 35, _arg2, _arg3);
};
FScrollBarClass.prototype.trackScroller = function () {
if ((this.scrollThumb_mc._y + this.thumbHeight) < this._ymouse) {
this.scrollIt("page", 1);
} else if (this.scrollThumb_mc._y > this._ymouse) {
this.scrollIt("page", -1);
}
};
FScrollBarClass.prototype.stopScrolling = function () {
this.controller.downArrow_mc.gotoAndStop(1);
this.controller.upArrow_mc.gotoAndStop(1);
clearInterval(this.controller.scrolling);
};
FScrollBarClass.prototype.startUpScroller = function () {
this.controller.upArrow_mc.gotoAndStop(2);
this.controller.scrollIt("one", -1);
this.controller.scrolling = setInterval(this.controller, "scrollInterval", 500, "one", -1);
};
FScrollBarClass.prototype.startDownScroller = function () {
this.controller.downArrow_mc.gotoAndStop(2);
this.controller.scrollIt("one", 1);
this.controller.scrolling = setInterval(this.controller, "scrollInterval", 500, "one", 1);
};
FScrollBarClass.prototype.setScrollTarget = function (_arg2) {
if (_arg2 == undefined) {
this.textField.removeListener(this);
delete this.textField[(this.horizontal ? "hScroller" : "vScroller")];
if ((this.textField.hScroller != undefined) && (this.textField.vScroller != undefined)) {
this.textField.unwatch("text");
this.textField.unwatch("htmltext");
}
}
this.textField = undefined;
if (!(_arg2 instanceof TextField)) {
return(undefined);
}
this.textField = _arg2;
this.textField[(this.horizontal ? "hScroller" : "vScroller")] = this;
this.onTextChanged();
this.onChanged = function () {
this.onTextChanged();
};
this.onScroller = function () {
if (!this.isScrolling) {
if (!this.horizontal) {
this.setScrollPosition(this.textField.scroll);
} else {
this.setScrollPosition(this.textField.hscroll);
}
}
};
this.textField.addListener(this);
this.textField.watch("text", this.callback);
this.textField.watch("htmlText", this.callback);
};
FScrollBarClass.prototype.callback = function (_param1, _param2, _arg2) {
clearInterval(this.hScroller.synchScroll);
clearInterval(this.vScroller.synchScroll);
this.hScroller.synchScroll = setInterval(this.hScroller, "onTextChanged", 50);
this.vScroller.synchScroll = setInterval(this.vScroller, "onTextChanged", 50);
return(_arg2);
};
FScrollBarClass.prototype.onTextChanged = function () {
if ((!this.enable) || (this.textField == undefined)) {
return(undefined);
}
clearInterval(this.synchScroll);
if (this.horizontal) {
var _local2 = this.textField.hscroll;
this.setScrollProperties(this.textField._width, 0, this.textField.maxhscroll);
this.setScrollPosition(Math.min(_local2, this.textField.maxhscroll));
} else {
var _local2 = this.textField.scroll;
var _local3 = this.textField.bottomScroll - this.textField.scroll;
this.setScrollProperties(_local3, 1, this.textField.maxscroll);
this.setScrollPosition(Math.min(_local2, this.textField.maxscroll));
}
};
FScrollBarClass.prototype.executeCallBack = function () {
if (this.textField == undefined) {
super.executeCallBack();
} else if (this.horizontal) {
this.textField.hscroll = this.getScrollPosition();
} else {
this.textField.scroll = this.getScrollPosition();
}
};
Object.registerClass("FScrollBarSymbol", FScrollBarClass);
#endinitclip
Symbol 5 MovieClip [FUIComponentSymbol] Frame 1
#initclip 1
function FUIComponentClass() {
this.init();
}
FUIComponentClass.prototype = new MovieClip();
FUIComponentClass.prototype.init = function () {
this.enable = true;
this.focused = false;
this.useHandCursor = false;
this._accImpl = new Object();
this._accImpl.stub = true;
this.styleTable = new Array();
if (_global.globalStyleFormat == undefined) {
_global.globalStyleFormat = new FStyleFormat();
globalStyleFormat["74"] = true;
_global._focusControl = new Object();
_global._focusControl.onSetFocus = function (_arg1, _arg2) {
_arg1.myOnKillFocus();
_arg2.myOnSetFocus();
};
Selection.addListener(_global._focusControl);
}
if (this._name != undefined) {
this._focusrect = false;
this.tabEnabled = true;
this.focusEnabled = true;
this.tabChildren = false;
this.tabFocused = true;
if (this.hostStyle == undefined) {
globalStyleFormat.addListener(this);
} else {
this.styleTable = this.hostStyle;
}
this.deadPreview._visible = false;
this.deadPreview._width = (this.deadPreview._height = 1);
this.methodTable = new Object();
this.keyListener = new Object();
this.keyListener.controller = this;
this.keyListener.onKeyDown = function () {
this.controller.myOnKeyDown();
};
this.keyListener.onKeyUp = function () {
this.controller.myOnKeyUp();
};
for (var _local3 in this.styleFormat_prm) {
this.setStyleProperty(_local3, this.styleFormat_prm[_local3]);
}
}
};
FUIComponentClass.prototype.setEnabled = function (_arg3) {
this.enable = ((arguments.length > 0) ? (_arg3) : true);
this.tabEnabled = (this.focusEnabled = _arg3);
if ((!this.enable) && (this.focused)) {
Selection.setFocus(undefined);
}
};
FUIComponentClass.prototype.getEnabled = function () {
return(this.enable);
};
FUIComponentClass.prototype.setSize = function (w, h) {
this.width = w;
this.height = h;
this.focusRect.removeMovieClip();
};
FUIComponentClass.prototype.setChangeHandler = function (_arg3, _arg2) {
this.handlerObj = ((_arg2 == undefined) ? (this._parent) : (_arg2));
this.changeHandler = _arg3;
};
FUIComponentClass.prototype.invalidate = function (_arg2) {
this.methodTable[_arg2] = true;
this.onEnterFrame = this.cleanUI;
};
FUIComponentClass.prototype.cleanUI = function () {
if (this.methodTable.setSize) {
this.setSize(this.width, this.height);
} else {
this.cleanUINotSize();
}
this.methodTable = new Object();
delete this.onEnterFrame;
};
FUIComponentClass.prototype.cleanUINotSize = function () {
for (var _local2 in this.methodTable) {
this[_local2]();
}
};
FUIComponentClass.prototype.drawRect = function (x, y, w, h) {
var _local4 = this.styleTable.focusRectInner["163"];
var _local5 = this.styleTable.focusRectOuter["163"];
if (_local4 == undefined) {
_local4 = 16777215 /* 0xFFFFFF */;
}
if (_local5 == undefined) {
_local5 = 0;
}
this.createEmptyMovieClip("focusRect", 1000);
this.focusRect.controller = this;
this.focusRect.lineStyle(1, _local5);
this.focusRect.moveTo(x, y);
this.focusRect.lineTo(x + w, y);
this.focusRect.lineTo(x + w, y + h);
this.focusRect.lineTo(x, y + h);
this.focusRect.lineTo(x, y);
this.focusRect.lineStyle(1, _local4);
this.focusRect.moveTo(x + 1, y + 1);
this.focusRect.lineTo((x + w) - 1, y + 1);
this.focusRect.lineTo((x + w) - 1, (y + h) - 1);
this.focusRect.lineTo(x + 1, (y + h) - 1);
this.focusRect.lineTo(x + 1, y + 1);
};
FUIComponentClass.prototype.pressFocus = function () {
this.tabFocused = false;
this.focusRect.removeMovieClip();
Selection.setFocus(this);
};
FUIComponentClass.prototype.drawFocusRect = function () {
this.drawRect(-2, -2, this.width + 4, this.height + 4);
};
FUIComponentClass.prototype.myOnSetFocus = function () {
this.focused = true;
Key.addListener(this.keyListener);
if (this.tabFocused) {
this.drawFocusRect();
}
};
FUIComponentClass.prototype.myOnKillFocus = function () {
this.tabFocused = true;
this.focused = false;
this.focusRect.removeMovieClip();
Key.removeListener(this.keyListener);
};
FUIComponentClass.prototype.executeCallBack = function () {
this.handlerObj[this.changeHandler](this);
};
FUIComponentClass.prototype.updateStyleProperty = function (_arg2, _arg3) {
this.setStyleProperty(_arg3, _arg2[_arg3], _arg2["74"]);
};
FUIComponentClass.prototype.setStyleProperty = function (_arg3, _arg6, _arg19) {
if (_arg6 == "") {
return(undefined);
}
var _local17 = parseInt(_arg6);
if (!isNaN(_local17)) {
_arg6 = _local17;
}
var _local16 = ((arguments.length > 2) ? (_arg19) : false);
if (this.styleTable[_arg3] == undefined) {
this.styleTable[_arg3] = new Object();
this.styleTable[_arg3].useGlobal = true;
}
if (this.styleTable[_arg3].useGlobal || (!_local16)) {
this.styleTable[_arg3]["163"] = _arg6;
if (this.setCustomStyleProperty(_arg3, _arg6)) {
} else if (_arg3 == "embedFonts") {
this.invalidate("setSize");
} else if (_arg3.subString(0, 4) == "text") {
if (this.textStyle == undefined) {
this.textStyle = new TextFormat();
}
var _local18 = _arg3.subString(4, _arg3.length);
this.textStyle[_local18] = _arg6;
this.invalidate("setSize");
} else {
for (var _local15 in this.styleTable[_arg3].coloredMCs) {
var _local4 = new Color(this.styleTable[_arg3].coloredMCs[_local15]);
if (this.styleTable[_arg3]["163"] == undefined) {
var _local5 = {ra:"100", rb:"0", ga:"100", gb:"0", ba:"100", bb:"0", aa:"100", ab:"0"};
_local4.setTransform(_local5);
} else {
_local4.setRGB(_arg6);
}
}
}
this.styleTable[_arg3].useGlobal = _local16;
}
};
FUIComponentClass.prototype.registerSkinElement = function (_arg4, _arg2) {
if (this.styleTable[_arg2] == undefined) {
this.styleTable[_arg2] = new Object();
this.styleTable[_arg2].useGlobal = true;
}
if (this.styleTable[_arg2].coloredMCs == undefined) {
this.styleTable[_arg2].coloredMCs = new Object();
}
this.styleTable[_arg2].coloredMCs[_arg4] = _arg4;
if (this.styleTable[_arg2]["163"] != undefined) {
var _local3 = new Color(_arg4);
_local3.setRGB(this.styleTable[_arg2]["163"]);
}
};
_global.FStyleFormat = function () {
this.nonStyles = {listeners:true, 74:true, isAStyle:true, addListener:true, removeListener:true, nonStyles:true, applyChanges:true};
this.listeners = new Object();
this["74"] = false;
if (arguments.length > 0) {
for (var _local3 in arguments[0]) {
this[_local3] = arguments[0][_local3];
}
}
};
_global.FStyleFormat.prototype = new Object();
FStyleFormat.prototype.addListener = function () {
var _local3 = 0;
while (_local3 < arguments.length) {
var _local4 = arguments[_local3];
this.listeners[arguments[_local3]] = _local4;
for (var _local5 in this) {
if (this.isAStyle(_local5)) {
_local4.updateStyleProperty(this, _local5.toString());
}
}
_local3++;
}
};
FStyleFormat.prototype.removeListener = function (_arg2) {
this.listeners[_arg2] = undefined;
for (var _local4 in this) {
if (this.isAStyle(_local4)) {
if (_arg2.styleTable[_local4].useGlobal == this["74"]) {
_arg2.styleTable[_local4].useGlobal = true;
var _local3 = (this["74"] ? undefined : (globalStyleFormat[_local4]));
_arg2.setStyleProperty(_local4, _local3, true);
}
}
}
};
FStyleFormat.prototype.applyChanges = function () {
var _local6 = 0;
for (var _local5 in this.listeners) {
var _local3 = this.listeners[_local5];
if (arguments.length > 0) {
var _local4 = 0;
while (_local4 < arguments.length) {
if (this.isAStyle(arguments[_local4])) {
_local3.updateStyleProperty(this, arguments[_local4]);
}
_local4++;
}
} else {
for (var _local4 in this) {
if (this.isAStyle(_local4)) {
_local3.updateStyleProperty(this, _local4.toString());
}
}
}
}
};
FStyleFormat.prototype.isAStyle = function (name) {
return((this.nonStyles[name] ? false : true));
};
#endinitclip
Symbol 18 MovieClip Frame 1
var 37 = _parent._parent;
37.registerSkinElement(arrow_mc, "arrow");
37.registerSkinElement(face_mc, "face");
37.registerSkinElement(shadow_mc, "shadow");
37.registerSkinElement(darkshadow_mc, "darkshadow");
37.registerSkinElement(highlight_mc, "highlight");
37.registerSkinElement(highlight3D_mc, "highlight3D");
Symbol 28 MovieClip Frame 1
var 37 = _parent._parent;
37.registerSkinElement(arrow_mc, "arrow");
37.registerSkinElement(face_mc, "face");
37.registerSkinElement(shadow_mc, "shadow");
37.registerSkinElement(darkshadow_mc, "darkshadow");
37.registerSkinElement(highlight_mc, "highlight");
37.registerSkinElement(highlight3D_mc, "highlight3D");
Symbol 37 MovieClip Frame 1
var 37 = _parent._parent;
37.registerSkinElement(arrow_mc, "foregroundDisabled");
37.registerSkinElement(face_mc, "face");
37.registerSkinElement(shadow_mc, "shadow");
37.registerSkinElement(darkshadow_mc, "darkshadow");
37.registerSkinElement(highlight_mc, "highlight");
37.registerSkinElement(highlight3D_mc, "highlight3D");
Symbol 38 MovieClip [UpArrow] Frame 1
stop();
Symbol 38 MovieClip [UpArrow] Frame 2
stop();
Symbol 38 MovieClip [UpArrow] Frame 3
stop();
Symbol 45 MovieClip Frame 1
var 37 = _parent._parent;
37.registerSkinElement(shadow_mc, "shadow");
37.registerSkinElement(darkshadow_mc, "darkshadow");
37.registerSkinElement(highlight_mc, "highlight");
37.registerSkinElement(highlight3D_mc, "highlight3D");
Symbol 52 MovieClip Frame 1
var 37 = _parent._parent;
37.registerSkinElement(face_mc, "face");
37.registerSkinElement(shadow_mc, "shadow");
37.registerSkinElement(darkshadow_mc, "darkshadow");
37.registerSkinElement(highlight_mc, "highlight");
37.registerSkinElement(highlight3D_mc, "highlight3D");
Symbol 57 MovieClip Frame 1
var 37 = _parent._parent;
37.registerSkinElement(highlight3D_mc, "highlight3D");
37.registerSkinElement(shadow_mc, "shadow");
37.registerSkinElement(darkshadow_mc, "darkshadow");
37.registerSkinElement(highlight_mc, "highlight");
Symbol 58 MovieClip [ScrollThumb] Frame 1
stop();
Symbol 66 MovieClip Frame 1
var 37 = _parent._parent;
37.registerSkinElement(arrow_mc, "arrow");
37.registerSkinElement(face_mc, "face");
37.registerSkinElement(shadow_mc, "shadow");
37.registerSkinElement(darkshadow_mc, "darkshadow");
37.registerSkinElement(highlight_mc, "highlight");
37.registerSkinElement(highlight3D_mc, "highlight3D");
Symbol 74 MovieClip Frame 1
var 37 = _parent._parent;
37.registerSkinElement(arrow_mc, "arrow");
37.registerSkinElement(face_mc, "face");
37.registerSkinElement(shadow_mc, "shadow");
37.registerSkinElement(darkshadow_mc, "darkshadow");
37.registerSkinElement(highlight_mc, "highlight");
37.registerSkinElement(highlight3D_mc, "highlight3D");
Symbol 82 MovieClip Frame 1
var 37 = _parent._parent;
37.registerSkinElement(arrow_mc, "foregroundDisabled");
37.registerSkinElement(face_mc, "face");
37.registerSkinElement(shadow_mc, "shadow");
37.registerSkinElement(darkshadow_mc, "darkshadow");
37.registerSkinElement(highlight_mc, "highlight");
37.registerSkinElement(highlight3D_mc, "highlight3D");
Symbol 83 MovieClip [DownArrow] Frame 1
stop();
Symbol 83 MovieClip [DownArrow] Frame 2
stop();
Symbol 83 MovieClip [DownArrow] Frame 3
stop();
Symbol 88 MovieClip [nerdbullet] Frame 1
function 76() {
gotoAndPlay ("die");
}
stop();
Symbol 88 MovieClip [nerdbullet] Frame 4
Set("46", 0);
_y = -1000;
stop();
Symbol 97 MovieClip [metal13] Frame 1
hits = -99999;
type = "metalThin";
collisionRect = new Object();
collisionRect.left = _x + mcCollisionRect._x;
collisionRect.top = _y + mcCollisionRect._y;
collisionRect.right = collisionRect.left + mcCollisionRect._width;
collisionRect.bottom = collisionRect.top + mccollisionRect._height;
oldCollisionRect = collisionRect;
stop();
Instance of Symbol 92 MovieClip "mcCollisionRect" in Symbol 97 MovieClip [metal13] Frame 1
onClipEvent (load) {
_visible = false;
}
Symbol 105 MovieClip Frame 1
gotoAndPlay(random(10));
Symbol 105 MovieClip Frame 29
gotoAndPlay (2);
Symbol 114 MovieClip [bigballoon] Frame 1
type = "bigballoon";
stop();
Symbol 114 MovieClip [bigballoon] Frame 11
state = "hit";
stop();
Symbol 125 MovieClip Frame 1
stop();
Symbol 146 MovieClip [powerup] Frame 1
stop();
Symbol 146 MovieClip [powerup] Frame 3
stop();
Symbol 146 MovieClip [powerup] Frame 10
_root.78(this);
stop();
Symbol 146 MovieClip [powerup] Frame 13
stop();
Symbol 146 MovieClip [powerup] Frame 18
_root.78(this);
stop();
Symbol 146 MovieClip [powerup] Frame 22
stop();
Symbol 146 MovieClip [powerup] Frame 25
_root.78(this);
stop();
Symbol 146 MovieClip [powerup] Frame 28
stop();
Symbol 146 MovieClip [powerup] Frame 32
_root.78(this);
stop();
Symbol 146 MovieClip [powerup] Frame 36
stop();
Symbol 146 MovieClip [powerup] Frame 39
_root.78(this);
stop();
Symbol 146 MovieClip [powerup] Frame 42
stop();
Symbol 146 MovieClip [powerup] Frame 45
_root.78(this);
stop();
Symbol 152 MovieClip [bosscandy] Frame 1
stop();
Symbol 152 MovieClip [bosscandy] Frame 5
state = "idle";
stop();
Symbol 162 MovieClip Frame 1
stop();
Symbol 169 MovieClip Frame 1
stop();
Symbol 170 MovieClip [balloon] Frame 1
type = "balloon";
gotoAndPlay(random(20));
Symbol 170 MovieClip [balloon] Frame 22
gotoAndPlay ("normal loop");
Instance of Symbol 169 MovieClip "mcFunMessage" in Symbol 170 MovieClip [balloon] Frame 23
onClipEvent (load) {
gotoAndPlay(_parent.mcBalloon._currentframe);
}
Symbol 170 MovieClip [balloon] Frame 31
state = "hit";
stop();
Symbol 177 MovieClip [boss] Frame 1
type = "boss";
Symbol 177 MovieClip [boss] Frame 2
stop();
Symbol 177 MovieClip [boss] Frame 4
gotoAndPlay ("normal");
Symbol 177 MovieClip [boss] Frame 7
stop();
Symbol 183 MovieClip [gloom1] Frame 1
function 82() {
gloomy = false;
gotoAndPlay ("lift");
}
type = "gloom";
subType = "1";
gloomy = true;
stop();
Symbol 183 MovieClip [gloom1] Frame 12
stop();
Symbol 189 MovieClip [gloom0] Frame 1
function 82() {
gloomy = false;
gotoAndPlay ("lift");
}
type = "gloom";
subType = "0";
gloomy = true;
nameText = initialParams.nameText;
stop();
Symbol 189 MovieClip [gloom0] Frame 11
stop();
Symbol 191 MovieClip [gloom2] Frame 1
type = "gloom";
subType = "2";
gloomy = true;
nameText = initialParams.nameText;
stop();
Symbol 191 MovieClip [gloom2] Frame 11
stop();
Symbol 194 MovieClip [metal12] Frame 1
hits = -99999;
type = "metal";
subType = "12";
collisionRect = new Object();
collisionRect.left = _x + mcCollisionRect._x;
collisionRect.top = _y + mcCollisionRect._y;
collisionRect.right = collisionRect.left + mcCollisionRect._width;
collisionRect.bottom = collisionRect.top + mccollisionRect._height;
oldCollisionRect = collisionRect;
_root.traceobj(collisionRect);
stop();
Instance of Symbol 92 MovieClip "mcCollisionRect" in Symbol 194 MovieClip [metal12] Frame 1
onClipEvent (load) {
_visible = false;
}
Symbol 209 MovieClip Frame 1
stop();
Symbol 212 MovieClip [hoop] Frame 2
type = "hoop";
Symbol 212 MovieClip [hoop] Frame 3
stop();
Symbol 220 MovieClip [suction] Frame 1
type = "suction";
Symbol 222 MovieClip [metal] Frame 1
hits = -99999;
type = "metal";
collisionRect = new Object();
collisionRect.left = _x + mcCollisionRect._x;
collisionRect.top = _y + mcCollisionRect._y;
collisionRect.right = collisionRect.left + mcCollisionRect._width;
collisionRect.bottom = collisionRect.top + mccollisionRect._height;
oldCollisionRect = collisionRect;
stop();
Instance of Symbol 92 MovieClip "mcCollisionRect" in Symbol 222 MovieClip [metal] Frame 1
onClipEvent (load) {
_visible = false;
}
Symbol 236 MovieClip [brick] Frame 1
hits = 0;
type = "brick";
collisionRect = {left:_x - (_width / 2), top:_y - (_height / 2), right:_x + (_width / 2), bottom:_y + (_height / 2)};
oldCollisionRect = {left:_x - (_width / 2), top:_y - (_height / 2), right:_x + (_width / 2), bottom:_y + (_height / 2)};
stop();
Symbol 236 MovieClip [brick] Frame 4
stop();
Symbol 236 MovieClip [brick] Frame 6
stop();
Symbol 236 MovieClip [brick] Frame 8
stop();
Symbol 236 MovieClip [brick] Frame 10
stop();
Symbol 236 MovieClip [brick] Frame 12
stop();
state = "dead";
this.removeMovieClip();
Symbol 250 MovieClip [napmat] Frame 1
type = "napmat";
Instance of Symbol 245 MovieClip "mcCollisionRect" in Symbol 250 MovieClip [napmat] Frame 1
onClipEvent (load) {
_visible = false;
}
Instance of Symbol 248 MovieClip "mcArrow" in Symbol 250 MovieClip [napmat] Frame 3
onClipEvent (load) {
_visible = false;
}
Symbol 250 MovieClip [napmat] Frame 4
stop();
Symbol 250 MovieClip [napmat] Frame 7
stop();
Symbol 250 MovieClip [napmat] Frame 10
gotoAndPlay ("normal");
Symbol 271 MovieClip Frame 1
stop();
Symbol 278 MovieClip Frame 1
stop();
Symbol 284 Button
on (release) {
5(debugPowerupToAdd);
}
Symbol 287 MovieClip Frame 1
type = "balloon";
initParams = {balloontype:1};
Symbol 288 MovieClip Frame 1
type = "balloon";
if (initParams == undefined) {
initParams = {balloontype:3};
} else {
initParams.balloontype = 3;
}
Symbol 289 MovieClip Frame 1
type = "balloon";
initParams = {balloontype:4};
Symbol 290 MovieClip Frame 1
type = "balloon";
initParams = {balloontype:2};
Symbol 291 MovieClip Frame 1
function 118() {
if (readingLevels) {
var _local3;
var _local4;
if (_root.gAllLevelDataArr == undefined) {
_root.gAllLevelDataArr = new Array(notZeroBased);
}
if (_root.gAllLevelDataArr[_currentframe - 1] == undefined) {
levelData = new Array();
trace("--------------------------------reading level:" + _root.gAllLevelDataArr.length);
for (objName in this) {
_local3 = this[objName];
if (_local3.type != undefined) {
_local4 = {type:_local3.type, subtype:_local3.subtype, initParams:_local3.initParams};
if (_local4.initParams == undefined) {
_local4.initParams = new Object();
}
_local4.initParams._x = Math.round(_local3._x);
_local4.initParams._y = Math.round(_local3._y);
_local4.initParams._rotation = Math.round(_local3._rotation);
levelData.push(_local4);
}
}
_root.gAllLevelDataArr.push(levelData);
}
}
}
function 6() {
trace("done reading levels");
trace("num levels in _root.gAllLevelDataArr:" + _root.gAllLevelDataArr.length);
_root.play();
}
function 128() {
typeCodeArr = new Array();
nextTypeCodeNum = 0;
subtypeCodeArr = new Array();
paramCodeArr = new Array();
nextParamCodeNum = 0;
allLevelDataStr = "";
var _local6 = 0;
while (_local6 < _root.gAllLevelDataArr.length) {
trace("serializing level " + _local6);
levelData = _root.gAllLevelDataArr[_local6];
levelDataStr = "";
var _local4 = 0;
while (_local4 < levelData.length) {
var _local2 = levelData[_local4];
trace("item:" + _local4);
entryStr = "";
if (typeCodeArr[_local2.type] == undefined) {
var _local3 = String(nextTypeCodeNum);
if (_local3.length == 1) {
_local3 = "0" + _local3;
}
typeCodeArr[_local2.type] = _local3;
nextTypeCodeNum++;
}
entryStr = entryStr + ("type:" + typeCodeArr[_local2.type]);
if (_local2.subtype != undefined) {
var _local5 = String(_local2.subtype);
if (subtypeCodeArr[_local5] == undefined) {
var _local3 = String(subtypeCodeArr.length);
if (_local3.length == 1) {
_local3 = "0" + _local3;
}
}
subtypeCodeArr[_local2.type] = _local3;
}
entryStr = entryStr + (("," + subTypeCodeArr[_local5]) + ",");
for (var _local7 in _local2.initParams) {
if (paramCodeArr[_local7] == undefined) {
var _local3 = String(nextParamCodeNum);
if (_local3.length == 1) {
_local3 = "0" + _local3;
}
nextParamCodeNum++;
paramCodeArr[_local7] = _local3;
}
entryStr = entryStr + (((paramCodeArr[_local7] + "=") + _local2.initParams[_local7]) + "&");
}
if (levelDataStr != "") {
levelDataStr = levelDataStr + "~";
}
levelDataStr = levelDataStr + ("initparams:" + entryStr);
_local4++;
}
allLevelDataStr = allLevelDataStr + ("|" + levelDataStr);
_local6++;
}
trace(allLevelDataStr);
stop();
}
if (!readingLevels) {
stop();
}
Symbol 291 MovieClip Frame 2
118();
Instance of Symbol 250 MovieClip [napmat] in Symbol 291 MovieClip Frame 4
onClipEvent (load) {
initParams = {45:0, randomizeFlag:true};
}
Symbol 291 MovieClip Frame 5
118();
Instance of Symbol 250 MovieClip [napmat] in Symbol 291 MovieClip Frame 7
onClipEvent (load) {
initParams = {45:-1, randomizeFlag:false};
}
Symbol 291 MovieClip Frame 8
118();
Instance of Symbol 250 MovieClip [napmat] in Symbol 291 MovieClip Frame 10
onClipEvent (load) {
initParams = {45:-1, randomizeFlag:false};
}
Symbol 291 MovieClip Frame 11
118();
Instance of Symbol 212 MovieClip [hoop] in Symbol 291 MovieClip Frame 13
onClipEvent (load) {
}
Instance of Symbol 250 MovieClip [napmat] in Symbol 291 MovieClip Frame 13
onClipEvent (load) {
initParams = {45:-1, randomizeFlag:false};
}
Symbol 291 MovieClip Frame 14
118();
Symbol 291 MovieClip Frame 17
118();
Symbol 291 MovieClip Frame 20
118();
Instance of Symbol 191 MovieClip [gloom2] in Symbol 291 MovieClip Frame 22
onClipEvent (load) {
initialParams = {nameText:"\ngloom"};
}
Symbol 291 MovieClip Frame 23
118();
Symbol 291 MovieClip Frame 26
118();
Symbol 291 MovieClip Frame 29
118();
Symbol 291 MovieClip Frame 32
118();
Symbol 291 MovieClip Frame 35
118();
Instance of Symbol 212 MovieClip [hoop] in Symbol 291 MovieClip Frame 37
onClipEvent (load) {
initParams = {velocityX:-2};
}
Instance of Symbol 250 MovieClip [napmat] in Symbol 291 MovieClip Frame 37
onClipEvent (load) {
initParams = {velocityX:0, randomizeFlag:false};
}
Symbol 291 MovieClip Frame 38
118();
Symbol 291 MovieClip Frame 41
118();
Symbol 291 MovieClip Frame 44
118();
Symbol 291 MovieClip Frame 47
118();
Symbol 291 MovieClip Frame 50
118();
Symbol 291 MovieClip Frame 53
118();
Instance of Symbol 250 MovieClip [napmat] in Symbol 291 MovieClip Frame 55
onClipEvent (load) {
initParams = {45:0, randomizeFlag:true};
}
Symbol 291 MovieClip Frame 56
118();
Instance of Symbol 189 MovieClip [gloom0] in Symbol 291 MovieClip Frame 58
onClipEvent (load) {
initialParams = {nameText:"a deeper gloom"};
}
Symbol 291 MovieClip Frame 59
118();
Symbol 291 MovieClip Frame 62
118();
Symbol 291 MovieClip Frame 63
6();
Symbol 310 MovieClip Frame 1
stop();
Symbol 317 MovieClip Frame 1
stop();
Symbol 324 MovieClip Frame 1
stop();
Symbol 328 MovieClip Frame 1
stop();
Symbol 335 MovieClip Frame 1
stop();
Symbol 347 MovieClip Frame 1
stop();
Symbol 353 MovieClip Frame 1
function init() {
Set("143", "sugar");
whereToGo = 143 + " idle";
ticksNotMovingBeforeGoingIdle = 300;
}
init();
Instance of Symbol 245 MovieClip "mcHitArea" in Symbol 353 MovieClip Frame 1
onClipEvent (load) {
_visible = false;
}
Symbol 353 MovieClip Frame 4
gotoAndPlay(whereToGo);
Symbol 353 MovieClip Frame 9
gotoAndPlay(whereToGo);
Symbol 353 MovieClip Frame 14
gotoAndPlay(whereToGo);
Symbol 353 MovieClip Frame 19
gotoAndPlay(whereToGo);
Symbol 353 MovieClip Frame 24
gotoAndPlay(whereToGo);
Symbol 353 MovieClip Frame 29
gotoAndPlay(whereToGo);
Symbol 353 MovieClip Frame 32
gotoAndPlay(whereToGo);
Symbol 353 MovieClip Frame 37
gotoAndPlay(whereToGo);
Symbol 353 MovieClip Frame 41
gotoAndPlay(whereToGo);
Symbol 353 MovieClip Frame 46
gotoAndPlay(whereToGo);
Symbol 353 MovieClip Frame 50
gotoAndPlay(whereToGo);
Symbol 353 MovieClip Frame 55
gotoAndPlay(whereToGo);
Instance of Symbol 152 MovieClip [bosscandy] in Symbol 353 MovieClip Frame 56
onClipEvent (load) {
gotoAndStop(random(3) + 1);
}
Instance of Symbol 152 MovieClip [bosscandy] in Symbol 353 MovieClip Frame 56
onClipEvent (load) {
gotoAndStop(random(3) + 1);
}
Instance of Symbol 152 MovieClip [bosscandy] in Symbol 353 MovieClip Frame 56
onClipEvent (load) {
gotoAndStop(random(3) + 1);
}
Instance of Symbol 152 MovieClip [bosscandy] in Symbol 353 MovieClip Frame 56
onClipEvent (load) {
gotoAndStop(random(3) + 1);
}
Instance of Symbol 152 MovieClip [bosscandy] in Symbol 353 MovieClip Frame 56
onClipEvent (load) {
gotoAndStop(random(3) + 1);
}
Instance of Symbol 152 MovieClip [bosscandy] in Symbol 353 MovieClip Frame 56
onClipEvent (load) {
gotoAndStop(random(3) + 1);
}
Symbol 353 MovieClip Frame 57
gotoAndPlay ("bag idle");
Symbol 353 MovieClip Frame 59
stop();
Symbol 365 MovieClip Frame 2
stop();
Symbol 365 MovieClip Frame 4
stop();
Symbol 365 MovieClip Frame 8
if (_parent._x > (_root.gBoardRect.right - 130)) {
gotoAndPlay ("dropped r");
}
Symbol 365 MovieClip Frame 10
stop();
Symbol 365 MovieClip Frame 12
stop();
Symbol 365 MovieClip Frame 16
stop();
Symbol 365 MovieClip Frame 19
stop();
Symbol 372 MovieClip Frame 1
stop();
state = "idle";
Symbol 372 MovieClip Frame 2
state = "active";
Symbol 379 MovieClip Frame 1
f = (40 - blinkSpeed) + random(30);
gotoAndPlay(f);
Symbol 392 MovieClip Frame 1
stop();
Instance of Symbol 379 MovieClip in Symbol 392 MovieClip Frame 3
onClipEvent (load) {
blinkSpeed = 20;
}
Instance of Symbol 379 MovieClip in Symbol 392 MovieClip Frame 3
onClipEvent (load) {
blinkSpeed = 20;
}
Instance of Symbol 385 MovieClip in Symbol 392 MovieClip Frame 4
onClipEvent (load) {
gotoAndPlay(random(_totalframes));
}
Instance of Symbol 385 MovieClip in Symbol 392 MovieClip Frame 4
onClipEvent (load) {
gotoAndPlay(random(_totalframes));
}
Instance of Symbol 379 MovieClip in Symbol 392 MovieClip Frame 4
onClipEvent (load) {
blinkSpeed = 40;
}
Instance of Symbol 379 MovieClip in Symbol 392 MovieClip Frame 4
onClipEvent (load) {
blinkSpeed = 40;
}
Instance of Symbol 385 MovieClip in Symbol 392 MovieClip Frame 6
onClipEvent (load) {
gotoAndPlay(random(_totalframes));
}
Instance of Symbol 385 MovieClip in Symbol 392 MovieClip Frame 6
onClipEvent (load) {
gotoAndPlay(random(_totalframes));
}
Symbol 416 MovieClip Frame 49
gotoAndPlay ("loop");
Symbol 430 MovieClip Frame 1
stop();
Symbol 430 MovieClip Frame 3
stop();
Symbol 430 MovieClip Frame 7
stop();
Symbol 430 MovieClip Frame 10
stop();
Symbol 430 MovieClip Frame 15
stop();
Symbol 430 MovieClip Frame 19
stop();
Symbol 430 MovieClip Frame 26
gotoAndPlay ("sugarcrashed");
Symbol 430 MovieClip Frame 34
stop();
Symbol 430 MovieClip Frame 38
stop();
Symbol 435 Button
on (release) {
initialLevelNum = gLocalInfo.data.currentLevel;
play();
}
Symbol 442 Button
on (release) {
_root.mcMessage.gotoAndPlay("about");
}
Symbol 446 Button
on (release) {
_root.108();
_root.mcMessage.gotoAndPlay("credits");
}
Symbol 450 Button
on (release) {
_root.145();
_root.109();
}
Symbol 456 Button
on (release) {
_root.145();
gotoAndPlay ("empty");
}
Symbol 462 Button
on (release) {
_root.140();
_root.145();
gotoAndPlay ("empty");
}
Symbol 464 Button
on (release) {
_root.145();
gotoAndPlay ("empty");
}
Symbol 471 MovieClip Frame 1
gotoAndPlay(_root.gTipName);
mcPowerUp.gotoAndStop(_root.gTipName);
Symbol 471 MovieClip Frame 4
stop();
Symbol 471 MovieClip Frame 6
stop();
Symbol 471 MovieClip Frame 9
stop();
Symbol 471 MovieClip Frame 12
stop();
Symbol 471 MovieClip Frame 15
stop();
Symbol 471 MovieClip Frame 18
stop();
Symbol 479 Button
on (release) {
_root.145();
gotoAndPlay ("empty");
}
Symbol 486 Button
on (release) {
_root.145();
gotoAndPlay ("empty");
}
Symbol 490 Button
on (release) {
_root.145();
_root.109();
}
Symbol 492 MovieClip Frame 2
stop();
Symbol 492 MovieClip Frame 23
stop();
Symbol 492 MovieClip Frame 32
stop();
Symbol 492 MovieClip Frame 41
stop();
Symbol 492 MovieClip Frame 53
stop();
Symbol 508 Button
on (release) {
play();
}
Symbol 511 Button
on (release) {
_root.19(-1);
}
Symbol 512 Button
on (release) {
_root.19(1);
}
Symbol 519 Button
on (release) {
gotoAndPlay ("pu");
}
Symbol 527 Button
on (release) {
gotoAndPlay (1);
}
Instance of Symbol 245 MovieClip "mcHitArea" in Symbol 534 MovieClip Frame 1
onClipEvent (load) {
_visible = false;
}
Instance of Symbol 430 MovieClip in Symbol 534 MovieClip Frame 1
onClipEvent (load) {
gotoAndPlay ("nap");
}
Symbol 534 MovieClip Frame 2
stop();
Symbol 534 MovieClip Frame 4
stop();
Instance of Symbol 146 MovieClip [powerup] in Symbol 534 MovieClip Frame 4
onClipEvent (load) {
gotoAndStop ("brownie");
}
Instance of Symbol 146 MovieClip [powerup] in Symbol 534 MovieClip Frame 4
onClipEvent (load) {
gotoAndStop ("mollases");
}
Instance of Symbol 146 MovieClip [powerup] in Symbol 534 MovieClip Frame 4
onClipEvent (load) {
gotoAndStop ("pillow");
}
Instance of Symbol 146 MovieClip [powerup] in Symbol 534 MovieClip Frame 4
onClipEvent (load) {
gotoAndStop ("nerds");
}
Instance of Symbol 146 MovieClip [powerup] in Symbol 534 MovieClip Frame 4
onClipEvent (load) {
gotoAndStop ("barrel");
}
Symbol 541 MovieClip Frame 1
stop();
Symbol 550 MovieClip Frame 1
stop();
Instance of Symbol 245 MovieClip "mcHitArea" in Symbol 550 MovieClip Frame 1
onClipEvent (load) {
_visible = false;
}
Symbol 550 MovieClip Frame 9
state = "dead";
stop();
Symbol 557 MovieClip Frame 1
stop();
Symbol 563 Button
on (release) {
31();
mcSound.playSound("title");
gotoAndPlay ("title");
}
Symbol 569 MovieClip Frame 1
stop();
Symbol 572 Button
on (release) {
5("barrel");
}
Symbol 573 Button
on (release) {
5("gum");
}
Symbol 575 Button
on (release) {
145();
109();
}
Symbol 576 Button
on (release) {
5("mollases");
}
Symbol 581 Button
on (release) {
80();
}
Symbol 582 Button
on (release) {
5("nerds");
}
Symbol 586 Button
on (release) {
5("pillow");
}
Symbol 587 Button
on (release) {
5("brownie");
}
Symbol 596 MovieClip Frame 1
function 25() {
if (delayTimeStart == undefined) {
delayTimeStart = getTimer();
delaySeconds = 7;
gotoAndPlay(_currentframe - 1);
} else {
timeElapsed = getTimer() - delayTimeStart;
if (timeElapsed < (delaySeconds * 1000)) {
gotoAndPlay(_currentframe - 1);
timeLeft = (delaySeconds * 1000) - timeElapsed;
if (timeLeft < 2000) {
_alpha = (100 - (timeLeft / 2000));
}
} else {
delayTimeStart = undefined;
gotoAndPlay ("empty");
}
}
}
Symbol 596 MovieClip Frame 2
stop();
Instance of Symbol 245 MovieClip "mcHitArea" in Symbol 596 MovieClip Frame 3
onClipEvent (load) {
_visible = false;
}
Symbol 596 MovieClip Frame 4
stop();
Symbol 596 MovieClip Frame 8
25();
Symbol 596 MovieClip Frame 11
25();
Symbol 596 MovieClip Frame 14
25();
Symbol 596 MovieClip Frame 17
25();
Symbol 598 Button
on (release) {
9();
}
Symbol 601 Button
on (release) {
_root.97();
}
Symbol 604 MovieClip Frame 27
stop();
Symbol 609 Button
on (release) {
_root.31();
_root.gWhereToGo = "title";
}
Symbol 612 Button
on (release) {
getURL ("JavaScript:popUpWindow(\"../../sendtofriend/sugarcrash.html\",\"Send_to_Friend\",460,310)");
}
Symbol 616 Button
on (release) {
_root.swHighScoreObject.showTab = "submit";
_visible = false;
docount = true;
_root.disabler._visible = true;
loadMovieNum (_root.HSHubURL, 2);
}
Symbol 622 MovieClip Frame 1
gotoAndPlay(_root.mcKid.state);
Symbol 622 MovieClip Frame 13
if (_root.gNumLives > 0) {
stop();
}
Symbol 622 MovieClip Frame 30
_root.mcSound.playSound("game over theme");
Instance of Symbol 617 MovieClip "HSHubSubmitter" in Symbol 622 MovieClip Frame 31
onClipEvent (load) {
docount = false;
}
onClipEvent (enterFrame) {
if (docount) {
trycount++;
if ((_level2.getBytesTotal() == -1) && (trycount > 60)) {
docount = false;
trycount = 0;
}
}
}
Instance of Symbol 620 MovieClip "disabler" in Symbol 622 MovieClip Frame 31
onClipEvent (load) {
_visible = false;
}
Symbol 622 MovieClip Frame 57
gotoAndPlay ("sugarcrash loop");
Symbol 622 MovieClip Frame 63
if (_root.gNumLives > 0) {
stop();
}
Symbol 622 MovieClip Frame 66
if (_root.gNumLives > 0) {
stop();
}
Symbol 622 MovieClip Frame 93
_root.mcSound.playSound("game over theme");
Symbol 622 MovieClip Frame 94
stop();
Instance of Symbol 617 MovieClip "HSHubSubmitter" in Symbol 622 MovieClip Frame 94
onClipEvent (load) {
docount = false;
}
onClipEvent (enterFrame) {
if (docount) {
trycount++;
if ((_level2.getBytesTotal() == -1) && (trycount > 60)) {
docount = false;
trycount = 0;
}
}
}
Instance of Symbol 620 MovieClip "disabler" in Symbol 622 MovieClip Frame 94
onClipEvent (load) {
_visible = false;
}
Symbol 626 Button
on (release) {
_root.cleanupGame();
_root.gWhereToGo = "title";
}
Symbol 629 MovieClip Frame 4
stop();
Instance of Symbol 152 MovieClip [bosscandy] in Symbol 630 MovieClip Frame 1
onClipEvent (load) {
gotoAndStop(random(3) + 1);
}
Instance of Symbol 152 MovieClip [bosscandy] in Symbol 630 MovieClip Frame 1
onClipEvent (load) {
gotoAndStop(random(3) + 1);
}
Instance of Symbol 152 MovieClip [bosscandy] in Symbol 630 MovieClip Frame 1
onClipEvent (load) {
gotoAndStop(random(3) + 1);
}
Instance of Symbol 152 MovieClip [bosscandy] in Symbol 630 MovieClip Frame 1
onClipEvent (load) {
gotoAndStop(random(3) + 1);
}
Instance of Symbol 152 MovieClip [bosscandy] in Symbol 630 MovieClip Frame 1
onClipEvent (load) {
gotoAndStop(random(3) + 1);
}
Instance of Symbol 152 MovieClip [bosscandy] in Symbol 630 MovieClip Frame 1
onClipEvent (load) {
gotoAndStop(random(3) + 1);
}
Instance of Symbol 245 MovieClip "mcHitArea" in Symbol 630 MovieClip Frame 1
onClipEvent (load) {
_visible = false;
}
Symbol 630 MovieClip Frame 27
gotoAndPlay (1);