Frame 1
function clearScreen() {
removeMovieClip("Player");
removeMovieClip("Interface");
var _local1 = 0;
while (_local1 <= starIndexMax) {
removeMovieClip("Star" + _local1);
_local1++;
}
}
function levelUp() {
level++;
numOfPlates++;
if (balanceAccel > 0.25) {
balanceAccel = balanceAccel - 0.05;
}
if (tipAngle > 30) {
tipAngle = tipAngle - 0.5;
}
if (enemyCounterMax > 10) {
enemyCounterMax = enemyCounterMax - 2;
}
if (starSpeed < 30) {
starSpeed = starSpeed + 0.5;
}
}
function enemyThrowStar(theEnemy) {
SFX.gotoAndPlay("ThrowStar");
attachMovie("star", "Star" + starIndex, starDepth + starIndex);
theStar = _root["Star" + starIndex];
theStar._x = theEnemy._x;
theStar._y = theEnemy._y;
if (wonkyAim) {
theStar.starMoveX = randInt(-starSpeed, starSpeed);
}
theStar.onEnterFrame = function () {
if (this.active) {
this._rotation = this._rotation - 30;
destY = this._y + starSpeed;
if (wonkyAim) {
destX = this._x + this.starMoveX;
} else {
destX = this._x;
}
if (gameInPlay) {
if (Player.hitTest(destX, destY, true) || (Stack.hitTest(destX, destY, true))) {
SFX.gotoAndPlay("StarHitPlayer");
this.gotoAndPlay("HitPlayer");
if (carryingStack) {
if (destX < Player._x) {
Balance._x = 2000;
} else {
Balance._x = -2000;
}
} else {
Player.gotoAndPlay("Hit");
}
}
}
if ((destX < leftEdge) || (destX > rightEdge)) {
removeMovieClip(this);
}
if (destY <= floorY) {
this._x = destX;
this._y = destY;
} else {
SFX.gotoAndPlay("StarHitFloor");
this.gotoAndPlay("HitFloor");
}
}
};
if (starIndex < starIndexMax) {
starIndex++;
} else {
starIndex = 0;
}
}
function removeStack() {
stopAllSounds();
if (playerNum == 2) {
SFX.gotoAndPlay("DropOffAlt");
} else {
SFX.gotoAndPlay("DropOff");
}
score = score + numOfPlates;
carryingStack = false;
removeMovieClip("Balance");
removeMovieClip("Stack");
}
function createStack() {
levelUp();
if (playerNum == 2) {
SFX.gotoAndPlay("PickUpAlt");
} else {
SFX.gotoAndPlay("PickUp");
}
if (playerNum == 2) {
createEmptyMovieClip("Stack", 1001);
} else {
createEmptyMovieClip("Stack", 10);
}
stackColor = new Color(_root.Stack);
Stack._x = Player._x + Player.Hand._x;
Stack._y = Player._y + Player.Hand._y;
var _local2 = 1;
while (_local2 <= numOfPlates) {
Stack.attachMovie(plateType, "Plate" + _local2, _local2);
thePlate = Stack["Plate" + _local2];
thePlate._y = thePlate._y - ((_local2 - 1) * plateHeight);
_local2++;
}
attachMovie("balance", "Balance", 15);
Balance._x = Player._x + Player.Hand._x;
Balance._y = (Player._y + Player.Hand._y) - Stack._height;
carryingStack = true;
Balance.onEnterFrame = function () {
if (gameInPlay) {
if (stackStatus == "tipping") {
if (Stack._rotation < 0) {
if ((Stack._rotation - 10) > -90) {
Stack._rotation = Stack._rotation - 10;
} else {
Stack._rotation = -90;
}
} else if (Stack._rotation > 0) {
if ((Stack._rotation + 10) < 90) {
Stack._rotation = Stack._rotation + 10;
} else {
Stack._rotation = 90;
}
}
var _local2 = 1;
while (_local2 <= numOfPlates) {
thePlate = Stack["Plate" + _local2];
thePlate._y = thePlate._y - (_local2 * 0.5);
_local2++;
}
if ((Stack._y + 2) < _root.floorY) {
Stack._y = Stack._y + 2;
} else {
Stack._y = _root.floorY;
if (Stack._rotation < 0) {
Stack._rotation = -90;
} else if (Stack._rotation > 0) {
Stack._rotation = 90;
}
stackStatus = "dropped";
if (playerNum == 2) {
SFX.gotoAndPlay("CrashAlt");
} else {
SFX.gotoAndPlay("Crash");
}
_local2 = 1;
while (_local2 <= numOfPlates) {
thePlate = Stack["Plate" + _local2];
thePlate._rotation = randInt(1, 360);
thePlate._x = thePlate._x + randInt(-25, 25);
thePlate.gotoAndPlay("Break" + _root.randInt(1, 3));
_local2++;
}
gotoAndPlay ("GameOver");
}
} else if (stackStatus == "carried") {
if (carryingStack) {
Stack._x = Player._x + Player.Hand._x;
shiftBalance();
}
}
}
};
}
function shiftBalance() {
var _local3 = (Player._x + Player.Hand._x) - Balance._x;
var _local4 = (Player._y + Player.Hand._y) - Balance._y;
var _local2 = Math.atan(_local4 / _local3) / (Math.PI/180);
if (_local3 < 0) {
_local2 = _local2 + 180;
}
if ((_local3 >= 0) && (_local4 < 0)) {
_local2 = _local2 + 360;
}
Stack._rotation = _local2 - 90;
if (!playerBusy) {
if ((Stack._rotation < tipAngle) && (Stack._rotation >= (tipAngle * tipWarning))) {
SFX.gotoAndPlay("StartTilt");
stackColor.setTint(255, 102, 0, 75);
Player.Anim.Head.gotoAndStop("Tilt");
} else if ((Stack._rotation > (-tipAngle)) && (Stack._rotation <= ((-tipAngle) * tipWarning))) {
SFX.gotoAndPlay("StartTilt");
stackColor.setTint(255, 102, 0, 75);
Player.Anim.Head.gotoAndStop("Tilt");
} else if (Stack._rotation >= tipAngle) {
SFX.gotoAndPlay("StopTilt");
stackColor.removeTint();
stackStatus = "tipping";
Player.gotoAndPlay("TipRight");
} else if (Stack._rotation <= (-tipAngle)) {
SFX.gotoAndPlay("StopTilt");
stackColor.removeTint();
stackStatus = "tipping";
Player.gotoAndPlay("TipLeft");
} else {
Player.Anim.Head.gotoAndStop("Stop");
SFX.gotoAndPlay("StopTilt");
stackColor.removeTint();
}
}
this.lastDist = this.dist;
this.dist = (Player._x + Player.Hand._x) - Balance._x;
if (this.dist < 0) {
if (balanceMove > (-balanceMoveMax)) {
balanceMove = balanceMove - balanceAccel;
}
} else if (this.dist >= 0) {
if (balanceMove < balanceMoveMax) {
balanceMove = balanceMove + balanceAccel;
}
}
if ((this.lastDist > 5) && (this.dist < 5)) {
if (playerNum == 1) {
SFX.gotoAndPlay("Rattle");
}
} else if ((this.lastDist < 5) && (this.dist > 5)) {
if (playerNum == 1) {
SFX.gotoAndPlay("Rattle");
}
}
balanceMove = balanceMove * balanceDecel;
Balance._x = Balance._x + balanceMove;
}
function randInt(num0, num1) {
if (arguments.length == 1) {
return(Math.round(Math.random() * num0));
}
return(Math.round(Math.random() * Math.abs(num0 - num1)) + num0);
}
function shuffle(theArray) {
i = 0;
while (i < (theArray.length - 1)) {
var _local2 = Math.round(Math.random() * i);
var _local3 = theArray[i];
theArray[i] = theArray[_local2];
theArray[_local2] = _local3;
i++;
}
return(theArray);
}
stop();
fscommand ("allowscale", false);
funcHITBOX = function (arEvent, arAction) {
lString = ((("javascript: _hbLink ('/flash/" + arEvent.toLowerCase()) + "/") + arAction.toLowerCase()) + "','left','0,0,0,0')";
getURL (lString);
};
Color.prototype.setTint = function (r, g, b, amount) {
var _local4 = 100 - amount;
var _local2 = new Object();
_local2.ra = (_local2.ga = (_local2.ba = _local4));
var _local3 = amount / 100;
_local2.rb = r * _local3;
_local2.gb = g * _local3;
_local2.bb = b * _local3;
this.setTransform(_local2);
};
Color.prototype.removeTint = function () {
this.setTint(0, 0, 0, 0);
};
Frame 10
stop();
var cheatCodes = ["GOLOGBOY", "ELTOMATO", "WONKYAIM"];
var defaultText = "";
var codeInput = defaultText;
var activeCode = null;
CodeEntry.codeField.restrict = "A-Z 0-9";
Frame 20
stop();
Frame 30
var level = 0;
var score = 0;
var gameInPlay = false;
var carryingStack = false;
var playerBusy = false;
var numOfPlates = 9;
var balanceMoveMax = 10;
var balanceMove = 0;
var balanceAccel = 0.75;
var balanceDecel = 0.9;
var tipAngle = 40;
var tipWarning = 0.6;
var stackStatus = "carried";
var leftEdge = 0;
var rightEdge = 550;
var topEdge = 100;
var bottomEdge = 375;
var floorY = 310;
var enemyCounter = 0;
var enemyCounterMax = 100;
var enemyAttackDelay = 30;
var enemiesActive = 0;
var enemiesActiveMax = 9;
var starSpeed = 5;
var starIndex = 0;
var starIndexMax = 100;
var starDepth = 2000;
var playerStartX = 0;
var playerStartY = 330;
var playerAccel = 0.5;
var playerDecel = 0.25;
var playerMoveMax = 15;
var playerMove = 0;
var wonkyAim = false;
var playerNum = 1;
var plateType = "plate";
var plateHeight = 4;
if (activeCode != null) {
if (activeCode == "GOLOGBOY") {
playerNum = 2;
plateType = "log";
plateHeight = 10;
} else if (activeCode == "ELTOMATO") {
playerNum = 3;
} else if (activeCode == "WONKYAIM") {
wonkyAim = true;
}
}
attachMovie("interface", "Interface", 10000);
if (playerNum == 2) {
Interface.StackIcon.gotoAndStop(2);
Interface.ScoreIcon.gotoAndStop(2);
}
attachMovie("player" + playerNum, "Player", 1000);
Player._x = playerStartX;
Player._y = playerStartY;
Player.gotoAndStop(1);
gotoAndPlay ("Play");
Frame 40
Player.gotoAndPlay("Start");
gameInPlay = true;
stop();
Interface.onEnterFrame = function () {
if (gameInPlay) {
enemyCounter++;
if (enemyCounter >= enemyCounterMax) {
if (enemiesActive < enemiesActiveMax) {
do {
match = false;
var _local2 = randInt(1, 9);
if (_root["Enemy" + _local2].amIBusy == true) {
match = true;
}
} while (match == true);
_root["Enemy" + _local2].gotoAndPlay("Attack");
enemiesActive++;
}
enemyCounter = 0;
}
}
};
Player.onEnterFrame = function () {
if (gameInPlay) {
if (!playerBusy) {
if (Key.isDown(37)) {
Player.Anim.gotoAndStop("Run");
if (playerMove > (-playerMoveMax)) {
playerMove = playerMove - playerAccel;
}
if (!carryingStack) {
Player._xscale = 100;
}
} else if (Key.isDown(39)) {
Player.Anim.gotoAndStop("Run");
if (playerMove < playerMoveMax) {
playerMove = playerMove + playerAccel;
}
if (!carryingStack) {
Player._xscale = -100;
}
} else if (playerMove != 0) {
Player.Anim.gotoAndStop("Run");
if (playerMove < 0) {
playerMove = playerMove + playerDecel;
} else {
playerMove = playerMove - playerDecel;
}
} else {
Player.Anim.gotoAndStop("Stop");
}
var _local1 = Player._x + playerMove;
if (_local1 <= leftEdge) {
_local1 = leftEdge;
playerMove = 0;
if (!carryingStack) {
Player._xscale = 100;
Player.gotoAndPlay("PickUp");
}
} else if (_local1 >= rightEdge) {
_local1 = rightEdge;
playerMove = 0;
if (carryingStack && (stackStatus != "tipping")) {
Player.gotoAndPlay("DropOff");
}
}
Player._x = _local1;
}
}
};
Frame 50
gameInPlay = false;
Interface.gotoAndPlay("GameOver");
stop();
Symbol 7 MovieClip Frame 1
stop();
Symbol 7 MovieClip Frame 10
stop();
Symbol 14 MovieClip Frame 1
stop();
Symbol 14 MovieClip Frame 20
stop();
Symbol 15 MovieClip [player3] Frame 1
stop();
Symbol 15 MovieClip [player3] Frame 5
stop();
Symbol 15 MovieClip [player3] Frame 15
_root.playerBusy = true;
Symbol 15 MovieClip [player3] Frame 31
_root.removeStack();
Symbol 15 MovieClip [player3] Frame 45
_root.playerBusy = false;
gotoAndStop ("Left");
Symbol 15 MovieClip [player3] Frame 50
stop();
Symbol 15 MovieClip [player3] Frame 60
_root.playerBusy = true;
Symbol 15 MovieClip [player3] Frame 76
_root.createStack();
Symbol 15 MovieClip [player3] Frame 90
_root.playerBusy = false;
gotoAndPlay ("Right");
Symbol 15 MovieClip [player3] Frame 100
_root.playerBusy = true;
Symbol 15 MovieClip [player3] Frame 106
_root.SFX.gotoAndPlay("FallDown");
Symbol 15 MovieClip [player3] Frame 110
stop();
Symbol 15 MovieClip [player3] Frame 120
_root.playerBusy = true;
Symbol 15 MovieClip [player3] Frame 126
_root.SFX.gotoAndPlay("FallDown");
Symbol 15 MovieClip [player3] Frame 130
stop();
Symbol 15 MovieClip [player3] Frame 135
_root.playerBusy = true;
Symbol 15 MovieClip [player3] Frame 141
_root.SFX.gotoAndPlay("FallDown");
Symbol 15 MovieClip [player3] Frame 145
_root.gotoAndPlay("GameOver");
stop();
Symbol 21 MovieClip Frame 1
if (_root.hatCheat) {
Tuque._visible = true;
Tuque.gotoAndStop(_root.tuqueColour);
} else {
Tuque._visible = false;
}
Symbol 22 MovieClip Frame 1
stop();
Symbol 22 MovieClip Frame 10
stop();
Symbol 24 MovieClip Frame 1
stop();
Symbol 24 MovieClip Frame 20
stop();
Symbol 25 MovieClip [player2] Frame 1
stop();
Symbol 25 MovieClip [player2] Frame 5
stop();
Symbol 25 MovieClip [player2] Frame 15
_root.playerBusy = true;
Symbol 25 MovieClip [player2] Frame 31
_root.removeStack();
Symbol 25 MovieClip [player2] Frame 45
_root.playerBusy = false;
gotoAndStop ("Left");
Symbol 25 MovieClip [player2] Frame 50
stop();
Symbol 25 MovieClip [player2] Frame 60
_root.playerBusy = true;
Symbol 25 MovieClip [player2] Frame 76
_root.createStack();
Symbol 25 MovieClip [player2] Frame 90
_root.playerBusy = false;
gotoAndPlay ("Right");
Symbol 25 MovieClip [player2] Frame 100
_root.playerBusy = true;
Symbol 25 MovieClip [player2] Frame 106
_root.SFX.gotoAndPlay("FallDown");
Symbol 25 MovieClip [player2] Frame 110
stop();
Symbol 25 MovieClip [player2] Frame 120
_root.playerBusy = true;
Symbol 25 MovieClip [player2] Frame 126
_root.SFX.gotoAndPlay("FallDown");
Symbol 25 MovieClip [player2] Frame 130
stop();
Symbol 25 MovieClip [player2] Frame 135
_root.playerBusy = true;
Symbol 25 MovieClip [player2] Frame 141
_root.SFX.gotoAndPlay("FallDown");
Symbol 25 MovieClip [player2] Frame 145
_root.gotoAndPlay("GameOver");
stop();
Symbol 32 MovieClip Frame 1
stop();
Symbol 34 MovieClip Frame 1
stop();
Symbol 34 MovieClip Frame 10
stop();
Symbol 37 MovieClip Frame 1
stop();
Symbol 37 MovieClip Frame 20
stop();
Symbol 38 MovieClip [player1] Frame 1
stop();
Symbol 38 MovieClip [player1] Frame 5
stop();
Symbol 38 MovieClip [player1] Frame 15
_root.playerBusy = true;
Symbol 38 MovieClip [player1] Frame 31
_root.removeStack();
Symbol 38 MovieClip [player1] Frame 45
_root.playerBusy = false;
gotoAndStop ("Left");
Symbol 38 MovieClip [player1] Frame 50
stop();
Symbol 38 MovieClip [player1] Frame 60
_root.playerBusy = true;
Symbol 38 MovieClip [player1] Frame 76
_root.createStack();
Symbol 38 MovieClip [player1] Frame 90
_root.playerBusy = false;
gotoAndPlay ("Right");
Symbol 38 MovieClip [player1] Frame 100
_root.playerBusy = true;
Symbol 38 MovieClip [player1] Frame 106
_root.SFX.gotoAndPlay("FallDown");
Symbol 38 MovieClip [player1] Frame 110
stop();
Symbol 38 MovieClip [player1] Frame 120
_root.playerBusy = true;
Symbol 38 MovieClip [player1] Frame 126
_root.SFX.gotoAndPlay("FallDown");
Symbol 38 MovieClip [player1] Frame 130
stop();
Symbol 38 MovieClip [player1] Frame 135
_root.playerBusy = true;
Symbol 38 MovieClip [player1] Frame 141
_root.SFX.gotoAndPlay("FallDown");
Symbol 38 MovieClip [player1] Frame 145
_root.gotoAndPlay("GameOver");
stop();
Symbol 47 MovieClip [plate] Frame 1
stop();
Symbol 47 MovieClip [plate] Frame 16
removeMovieClip(this);
stop();
Symbol 47 MovieClip [plate] Frame 30
removeMovieClip(this);
stop();
Symbol 47 MovieClip [plate] Frame 54
removeMovieClip(this);
stop();
Symbol 49 MovieClip Frame 1
stop();
Symbol 52 MovieClip Frame 1
stop();
Symbol 58 Button
on (press) {
stopAllSounds();
_root.SFX.gotoAndPlay("Click");
_root.gotoAndStop("Title");
_root.clearScreen();
}
Symbol 59 MovieClip [interface] Frame 1
stop();
Symbol 59 MovieClip [interface] Frame 60
_root.SFX.gotoAndPlay("GameOver");
stop();
Symbol 61 MovieClip [tomato] Frame 1
stop();
Symbol 61 MovieClip [tomato] Frame 16
removeMovieClip(this);
stop();
Symbol 61 MovieClip [tomato] Frame 30
removeMovieClip(this);
stop();
Symbol 61 MovieClip [tomato] Frame 54
removeMovieClip(this);
stop();
Symbol 62 MovieClip [log] Frame 1
stop();
Symbol 62 MovieClip [log] Frame 16
removeMovieClip(this);
stop();
Symbol 62 MovieClip [log] Frame 30
removeMovieClip(this);
stop();
Symbol 62 MovieClip [log] Frame 54
removeMovieClip(this);
stop();
Symbol 68 MovieClip [star] Frame 1
active = true;
stop();
Symbol 68 MovieClip [star] Frame 5
active = false;
this._rotation = 0;
Symbol 68 MovieClip [star] Frame 10
removeMovieClip(this);
Symbol 68 MovieClip [star] Frame 15
active = false;
Symbol 68 MovieClip [star] Frame 20
removeMovieClip(this);
Symbol 79 MovieClip Frame 1
amIBusy = false;
stop();
Symbol 79 MovieClip Frame 5
amIBusy = true;
Symbol 79 MovieClip Frame 40
_root.enemyThrowStar(this);
Symbol 79 MovieClip Frame 45
_root.enemiesActive--;
Symbol 87 Button
on (press) {
_root.SFX.gotoAndPlay("Click");
_root.funcHITBOX("instructions", "view_instructions");
gotoAndPlay ("HowTo");
}
Symbol 92 Button
on (press) {
_root.SFX.gotoAndPlay("Click");
_root.funcHITBOX("misc", "entercode");
gotoAndPlay ("EnterCode");
}
Symbol 113 MovieClip Frame 1
stop();
Symbol 113 MovieClip Frame 6
gotoAndStop (1);
Symbol 113 MovieClip Frame 16
gotoAndStop (1);
Symbol 113 MovieClip Frame 26
gotoAndStop (1);
Symbol 113 MovieClip Frame 36
gotoAndStop (1);
Symbol 113 MovieClip Frame 46
gotoAndStop (1);
Symbol 113 MovieClip Frame 56
gotoAndStop (1);
Symbol 113 MovieClip Frame 66
gotoAndStop (1);
Symbol 113 MovieClip Frame 76
gotoAndStop (1);
Symbol 113 MovieClip Frame 86
gotoAndStop (1);
Symbol 113 MovieClip Frame 96
gotoAndStop (1);
Symbol 113 MovieClip Frame 106
gotoAndStop (1);
Symbol 113 MovieClip Frame 116
gotoAndStop (1);
Symbol 113 MovieClip Frame 126
gotoAndStop (1);
Symbol 113 MovieClip Frame 136
gotoAndStop (1);
Symbol 113 MovieClip Frame 146
gotoAndStop (1);
Symbol 115 Button
on (press) {
_root.SFX.gotoAndPlay("Click");
_root.funcHITBOX("play_activity", "play_from_cheat");
gotoAndPlay ("Start");
}
Symbol 120 Button
on (press) {
_root.SFX.gotoAndPlay("Click");
var match = false;
var i = 0;
while (i < _root.cheatCodes.length) {
var theCode = _root.cheatCodes[i];
if (_root.codeInput == theCode) {
match = true;
break;
}
i++;
}
if (match == true) {
_root.funcHITBOX("misc", "valid_cheat_code_" + _root.codeInput);
gotoAndPlay ("Valid");
} else {
gotoAndPlay ("Invalid");
}
}
Symbol 123 MovieClip Frame 1
play();
Symbol 123 MovieClip Frame 2
Selection.setFocus("codeField");
stop();
Symbol 123 MovieClip Frame 10
_root.activeCode = _root.codeInput;
stop();
Symbol 123 MovieClip Frame 20
_root.activeCode = null;
Symbol 126 Button
on (press) {
_root.SFX.gotoAndPlay("Click");
_root.funcHITBOX("play_activity", "play");
gotoAndPlay ("Start");
}