Frame 1
stop();
var cm = new ContextMenu();
cm.builtInItems.zoom = false;
cm.builtInItems.print = false;
this.menu = cm;
pl2._xscale = 0;
this.onEnterFrame = function () {
var _local2 = (this.getBytesLoaded() / this.getBytesTotal()) * 100;
pl2._xscale = _local2;
perText.text = Math.round(_local2) + "%";
if (_local2 == 100) {
gotoAndPlay (3);
delete this.onEnterFrame;
}
};
Frame 3
function onEnterFrame() {
if (!isPaused) {
checkBalls();
var _local1 = 0;
while (_local1 < linesArr.length) {
checkLine(linesArr[_local1]);
_local1++;
}
_local1 = 0;
while (_local1 < vacuumsArr.length) {
checkVacuum(vacuumsArr[_local1]);
_local1++;
}
_local1 = 0;
while (_local1 < fishArr.length) {
checkFish(fishArr[_local1]);
_local1++;
}
}
}
function initMenu() {
pauseGame(false);
if (!mainMenu) {
var mainMenu = this.attachMovie("mainMenu", "mainMenu", _root.getNextHighestDepth());
} else {
if (!mainMenu._visible) {
mainMenu._visible = true;
}
mainMenu.passField.text = "";
}
if (isNaN(currentLevel)) {
mainMenu.startBtn.theText.text = "START GAME";
mainMenu.pauseHead._visible = false;
} else {
mainMenu.startBtn.theText.text = "RESUME GAME";
mainMenu.pauseHead._visible = true;
}
mainMenu.startBtn.onRelease = function () {
if (isNaN(currentLevel)) {
initLevel();
} else {
pauseGame(true);
mainMenu._visible = false;
mainMenu.removeMovieClip();
}
};
mainMenu.startBtn.alphaNum = -5;
if (isNaN(currentLevel)) {
mainMenu.startBtn.onEnterFrame = function () {
this._alpha = this._alpha + this.alphaNum;
if (this._alpha >= 100) {
this.alphaNum = -5;
} else if (this._alpha <= 35) {
this.alphaNum = 5;
}
};
}
mainMenu.passBtn.onRelease = function () {
if (this._parent.passField.text != "") {
pauseGame(true);
mainMenu._visible = false;
this.removeMovieClip(mainMenu);
getPassword(this._parent.passField.text);
}
};
mainMenu.linkBtn.onRelease = function () {
getURL ("http://www.tylersticka.com", _parent);
};
mainMenu._x = (Stage.width / 2) - (mainMenu._width / 2);
mainMenu._y = (Stage.height / 2) - (mainMenu._height / 2);
mainMenu.versionNum.text = versionNum;
if (isNaN(currentLevel)) {
createLava();
}
}
function initLevel(levelNum) {
if (isPaused) {
isPaused = false;
}
resetStage();
ballsLost = 0;
timePlayed = 0;
levelWon = false;
if (levelNum) {
currentLevel = levelNum;
} else if (isNaN(currentLevel)) {
currentLevel = 0;
} else {
if ((currentLevel + 1) >= levelsArr.length) {
currentLevel = 0;
finishedGame();
return(false);
}
currentLevel++;
}
if (levelsArr[currentLevel].vacuums) {
createVacuums(levelsArr[currentLevel].vacuums);
}
createShooter(levelsArr[currentLevel].shooter);
createGoal(levelsArr[currentLevel].goal);
createLines(levelsArr[currentLevel].lines);
if (levelsArr[currentLevel].arms) {
createRobotArms(levelsArr[currentLevel].arms);
}
if (levelsArr[currentLevel].barriers) {
createBarriers(levelsArr[currentLevel].barriers);
}
if (levelsArr[currentLevel].fish) {
createFish(levelsArr[currentLevel].fish);
}
createWalls(levelsArr[currentLevel].walls);
createText();
timePlayedId = setInterval(timeCounter, 1000);
}
function finishedGame() {
resetStage();
if (!finished_01) {
var finished_01 = this.attachMovie("final_score", "finished_01", _root.getNextHighestDepth());
}
finished_01._x = Stage.width / 2;
finished_01._y = Stage.height / 2;
if (score_cheats) {
finished_01.scoreText.text = "cheater!";
finished_01.nocheats.text = finished_01.nocheats.text + (score_total + " cheatin' points.");
finished_01.cheat01._visible = false;
finished_01.cheat02._visible = false;
finished_01.cheat03._visible = false;
finished_01.cheat04._visible = false;
finished_01.allcheats._visible = false;
} else {
scoring();
finished_01.scoreText.text = score_total;
finished_01.nocheats._visible = false;
if (score_total < 75000) {
finished_01.cheat02._visible = false;
}
if (score_total < 100000) {
finished_01.cheat03._visible = false;
}
if (score_total < 110000) {
finished_01.cheat04._visible = false;
finished_01.allcheats._visible = false;
}
}
if (score_total < 75000) {
finished_01.cheat02._visible = false;
}
if (score_total < 100000) {
finished_01.cheat03._visible = false;
}
if (score_total < 110000) {
finished_01.cheat04._visible = false;
finished_01.allcheats._visible = false;
}
finished_01.playBtn.onRelease = function () {
finished_01.removeMovieClip();
delete finished_01;
delete currentLevel;
score_total = 0;
if (confettiMC) {
delete confettiMC.onEnterFrame;
confettiMC.removeMovieClip();
delete confettiMC;
}
tracking();
initMenu();
};
finished_01.plugBtn.onRelease = function () {
getURL ("http://www.tylersticka.com", _parent);
};
confetti();
}
function confetti(confettiAmount) {
if (!confettiMC) {
this.createEmptyMovieClip("confettiMC", this.getNextHighestDepth());
}
if (!confettiAmount) {
confettiAmount = 50;
}
var confettiArr = new Array();
var _local4 = [15107786, 8840883, 16114824, 16095368];
var _local2 = 0;
while (_local2 < confettiAmount) {
confettiArr[_local2] = confettiMC.createEmptyMovieClip("confetti" + _local2, confettiMC.getNextHighestDepth());
var _local3 = Math.round(Math.random() * _local4.length);
drawRectangle(confettiArr[_local2], 7, 7, _local4[_local3], 100);
confettiArr[_local2].vx = (Math.random() * 2) - 1;
confettiArr[_local2].vy = (Math.random() * 3) + 1;
confettiArr[_local2]._rotation = Math.random() * 360;
confettiArr[_local2]._x = Math.random() * Stage.width;
confettiArr[_local2]._y = (Math.random() * 100) - 100;
_local2++;
}
confettiMC.onEnterFrame = function () {
var _local1 = 0;
while (_local1 < confettiArr.length) {
confettiArr[_local1]._x = confettiArr[_local1]._x + confettiArr[_local1].vx;
confettiArr[_local1]._rotation = confettiArr[_local1]._rotation + confettiArr[_local1].vx;
confettiArr[_local1]._y = confettiArr[_local1]._y + confettiArr[_local1].vy;
if ((confettiArr[_local1]._y - confettiArr[_local1]._height) > Stage.height) {
confettiArr[_local1]._y = -confettiArr[_local1]._height;
confettiArr[_local1]._x = Math.random() * Stage.width;
}
_local1++;
}
};
}
function createRobotArms(theArms) {
if (robotArmsArr.length > 0) {
robotArmsArr = new Array();
}
var _local4 = 0;
while (_local4 < theArms.length) {
robotArmsArr[_local4] = this.createEmptyMovieClip("robotArm" + _local4, _root.getNextHighestDepth());
levelObjects.push(robotArmsArr[_local4]);
robotArmsArr[_local4].limb1 = robotArmsArr[_local4].attachMovie("arm_limb", "limb1", robotArmsArr[_local4].getNextHighestDepth());
robotArmsArr[_local4].limb1._x = getPerStage(theArms[_local4][0], "width");
robotArmsArr[_local4].limb1._y = getPerStage(theArms[_local4][1], "height");
robotArmsArr[_local4].limb2 = robotArmsArr[_local4].attachMovie("arm_hand", "limb2", robotArmsArr[_local4].getNextHighestDepth());
robotArmsArr[_local4].segLength = robotArmsArr[_local4].limb1._width;
robotArmsArr[_local4].onEnterFrame = function () {
if (this.theTarget && (isNaN(this.theTarget._x))) {
delete this.theTarget;
}
var _local2 = 0;
while (_local2 < ballsArr.length) {
if (!isNaN(ballsArr[_local2]._x)) {
var _local12 = ballsArr[_local2]._x - this.limb2._x;
var _local11 = ballsArr[_local2]._y - this.limb2._y;
var _local8 = Math.atan2(dy, dx);
if (!this.theTarget) {
this.theTarget = ballsArr[_local2];
} else {
var _local14 = this.theTarget._x - this.limb2._x;
var _local13 = this.theTarget._y - this.limb2._y;
var _local6 = Math.atan2(dy, dx);
if (_local8 < _local6) {
this.theTarget = ballsArr[_local2];
}
}
var _local3 = (this.limb2._rotation * Math.PI) / 180;
var _local10 = this.limb2._x + (Math.cos(_local3) * this.segLength);
var _local9 = this.limb2._y + (Math.sin(_local3) * this.segLength);
var _local5 = _local10 - ballsArr[_local2]._x;
var _local4 = _local9 - ballsArr[_local2]._y;
var _local7 = Math.sqrt((_local5 * _local5) + (_local4 * _local4));
if ((_local7 < (ballsArr[_local2]._width / 2)) && (!ball.fish)) {
ballsArr[_local2].vx = ballsArr[_local2].vx + ((Math.random() * 2) - 1);
ballsArr[_local2].vy = ballsArr[_local2].vy - 1;
}
}
_local2++;
}
if (!this.theTarget) {
var dx = (_xmouse - this.limb2._x);
var dy = (_ymouse - this.limb2._y);
var _local17 = Math.atan2(dy, dx);
this.limb2._rotation = (_local17 * 180) / Math.PI;
var _local16 = _xmouse - (Math.cos(_local17) * this.segLength);
var _local15 = _ymouse - (Math.sin(_local17) * this.segLength);
} else {
var dx = (this.theTarget._x - this.limb2._x);
var dy = (this.theTarget._y - this.limb2._y);
var _local17 = Math.atan2(dy, dx);
this.limb2._rotation = (_local17 * 180) / Math.PI;
var _local16 = this.theTarget._x - (Math.cos(_local17) * this.segLength);
var _local15 = this.theTarget._y - (Math.sin(_local17) * this.segLength);
}
var dx = (_local16 - this.limb1._x);
var dy = (_local15 - this.limb1._y);
var _local17 = Math.atan2(dy, dx);
this.limb1._rotation = (_local17 * 180) / Math.PI;
this.limb2._x = this.limb1._x + (Math.cos((this.limb1._rotation * Math.PI) / 180) * this.segLength);
this.limb2._y = this.limb1._y + (Math.sin((this.limb1._rotation * Math.PI) / 180) * this.segLength);
};
robotArmsArr[_local4].filters = [dropShadowLite];
_local4++;
}
}
function createFish(theFish) {
if (fishArr.length > 0) {
fishArr = new Array();
}
var _local3 = 0;
while (_local3 < theFish.length) {
if (mattLohkamp) {
fishArr[_local3] = this.attachMovie("lohkamp_fish", "fish" + _local3, _root.getNextHighestDepth());
} else {
fishArr[_local3] = this.attachMovie("fish", "fish" + _local3, _root.getNextHighestDepth());
}
fishArr[_local3]._x = (fishArr[_local3].origx = getPerStage(theFish[_local3][0], "width"));
fishArr[_local3]._y = Stage.height;
fishArr[_local3].origvy = theFish[_local3][1];
fishArr[_local3].vy = theFish[_local3][1];
if (theFish[_local3][3]) {
fishArr[_local3].vx = theFish[_local3][3];
} else {
fishArr[_local3].vx = 0;
}
fishArr[_local3].minDrop = Stage.height + (((2 * theFish[_local3][2]) * 30) * (1 + (gravity * Math.exp(theFish[_local3][2]))));
fishArr[_local3].falling = false;
fishArr[_local3].filters = [dropShadowLite];
hitLava(fishArr[_local3]);
levelObjects.push(fishArr[_local3]);
_local3++;
}
}
function checkFish(fish) {
fish._y = fish._y - fish.vy;
fish.vy = fish.vy - gravity;
fish._x = fish._x + fish.vx;
if (fish.vx != 0) {
fish._rotation = fish._rotation + (fish.vx * 0.2);
}
if (fish._y >= fish.minDrop) {
fish._y = Stage.height;
fish.vy = fish.origvy;
fish._x = fish.origx;
fish._rotation = 0;
}
if (fish._y == Stage.height) {
hitLava(fish);
}
var _local2 = 0;
while (_local2 < ballsArr.length) {
if (fish.hitTest(ballsArr[_local2]) && ((ballsArr[_local2]._y - (ballsArr[_local2]._width / 2)) <= fish._y)) {
ballsArr[_local2].fish = fish;
ballsArr[_local2].onEnterFrame = function () {
this._x = this.fish._x;
this._y = this.fish._y;
};
}
_local2++;
}
}
function createText() {
if ((!shooter) || (shooter._x <= (Stage.width / 2))) {
if (!scoreTextMC) {
this.createEmptyMovieClip("scoreTextMC", this.getNextHighestDepth());
}
if (!scoreText) {
scoreTextMC.createTextField("scoreText", 20000, Stage.width / 2, 10, (Stage.width / 2) - 10, 35);
}
scoreTextMC.scoreText._x = Stage.width / 2;
scoreTextMC.scoreText.text = (("Level " + (currentLevel + 1)) + " | Score: ") + score_total;
scoreTextMC.scoreText.embedFonts = true;
scoreTextMC.scoreText.setTextFormat(scoreFormat);
scoreTextMC.scoreText.selectable = false;
levelObjects.push(scoreTextMC);
if (!helpBtn) {
var helpBtn = this.attachMovie("icon_help", "helpBtn", this.getNextHighestDepth());
}
helpBtn._y = (scoreTextMC.scoreText._y + scoreTextMC.scoreText._height) + 1;
helpBtn._x = ((scoreTextMC.scoreText._x + scoreTextMC.scoreText._width) - helpBtn._width) + 5;
helpBtn.onRelease = function () {
initMenu();
};
levelObjects.push(helpBtn);
if (!clearBtn) {
var clearBtn = this.attachMovie("icon_clear", "clearBtn", this.getNextHighestDepth());
}
clearBtn._y = scoreTextMC.scoreText._y + scoreTextMC.scoreText._height;
clearBtn._x = (((scoreTextMC.scoreText._x + scoreTextMC.scoreText._width) - clearBtn._width) - helpBtn._width) - 10;
clearBtn.onRelease = function () {
var _local1 = 0;
while (_local1 < ballsArr.length) {
if (ballsArr[_local1]._x) {
deleteBall(ballsArr[_local1]);
}
_local1++;
}
_local1 = 0;
while (_local1 < linesArr.length) {
linesArr[_local1].removeMovieClip();
_local1++;
}
linesArr = new Array();
createLines(levelsArr[currentLevel].lines);
};
levelObjects.push(clearBtn);
if (!clearBallBtn) {
var clearBallBtn = this.attachMovie("icon_clear_balls", "clearBallBtn", this.getNextHighestDepth());
}
clearBallBtn._y = scoreTextMC.scoreText._y + scoreTextMC.scoreText._height;
clearBallBtn._x = (((scoreTextMC.scoreText._x + scoreTextMC.scoreText._width) - (clearBallBtn._width * 2)) - clearBtn._width) - helpBtn._width;
clearBallBtn.onRelease = function () {
var _local1 = 0;
while (_local1 < ballsArr.length) {
if (ballsArr[_local1]._x) {
deleteBall(ballsArr[_local1]);
}
_local1++;
}
};
levelObjects.push(clearBallBtn);
} else {
if (!scoreTextMC) {
this.createEmptyMovieClip("scoreTextMC", this.getNextHighestDepth());
}
if (!scoreText) {
scoreTextMC.createTextField("scoreText", 20000, 10, 10, (Stage.width / 2) - 10, 35);
}
scoreTextMC.scoreText._x = 10;
scoreTextMC.scoreText.text = (("Level " + (currentLevel + 1)) + " | Score: ") + score_total;
scoreTextMC.scoreText.embedFonts = true;
scoreTextMC.scoreText.setTextFormat(scoreFormat2);
scoreTextMC.scoreText.selectable = false;
levelObjects.push(scoreTextMC);
if (!helpBtn) {
var helpBtn = this.attachMovie("icon_help", "helpBtn", this.getNextHighestDepth());
}
helpBtn._y = (scoreTextMC.scoreText._y + scoreTextMC.scoreText._height) + 1;
helpBtn._x = scoreTextMC.scoreText._x + (helpBtn._width / 2);
helpBtn.onRelease = function () {
initMenu();
};
levelObjects.push(helpBtn);
if (!clearBtn) {
var clearBtn = this.attachMovie("icon_clear", "clearBtn", this.getNextHighestDepth());
}
clearBtn._y = scoreTextMC.scoreText._y + scoreTextMC.scoreText._height;
clearBtn._x = ((scoreTextMC.scoreText._x + 10) + helpBtn._width) + clearBtn._width;
clearBtn.onRelease = function () {
var _local1 = 0;
while (_local1 < ballsArr.length) {
if (ballsArr[_local1]._x) {
deleteBall(ballsArr[_local1]);
}
_local1++;
}
_local1 = 0;
while (_local1 < linesArr.length) {
linesArr[_local1].removeMovieClip();
_local1++;
}
linesArr = new Array();
createLines(levelsArr[currentLevel].lines);
};
levelObjects.push(clearBtn);
if (!clearBallBtn) {
var clearBallBtn = this.attachMovie("icon_clear_balls", "clearBallBtn", this.getNextHighestDepth());
}
clearBallBtn._y = scoreTextMC.scoreText._y + scoreTextMC.scoreText._height;
clearBallBtn._x = ((scoreTextMC.scoreText._x + helpBtn._width) + clearBtn._width) + (clearBallBtn._width * 2);
clearBallBtn.onRelease = function () {
var _local1 = 0;
while (_local1 < ballsArr.length) {
if (ballsArr[_local1]._x) {
deleteBall(ballsArr[_local1]);
}
_local1++;
}
};
levelObjects.push(clearBallBtn);
}
if (!levelTextMC) {
this.attachMovie("levelTextMC", "levelTextMC", 300000);
}
levelTextMC.levelText.text = "LEVEL " + (currentLevel + 1);
levelTextMC.levelText.selectable = false;
levelTextMC._y = Stage.height + (levelTextMC._height / 2);
levelTextMC._x = Stage.width / 2;
levelObjects.push(levelTextMC);
levelTextMC.onEnterFrame = function () {
this._y = this._y - 10;
if (this._y <= -200) {
delete this.onEnterFrame;
}
};
}
function createLava() {
var _local2 = 0;
while (_local2 < lavaAmount) {
lavaArr[_local2] = attachMovie("lava", "lava" + _local2, this.getNextHighestDepth());
var _local3 = new Color(lavaArr[_local2]);
lavaArr[_local2]._x = Stage.width * Math.random();
if (_local2 < (lavaAmount * 0.3)) {
_local3.setRGB(15413249);
lavaArr[_local2]._y = Stage.height - (Math.random() * (Stage.height * 0.03));
} else if ((_local2 >= (lavaAmount * 0.3)) && (_local2 < (lavaAmount * 0.6))) {
_local3.setRGB(16013067);
lavaArr[_local2]._y = Stage.height - (Math.random() * (Stage.height * 0.03));
} else {
_local3.setRGB(16777011);
lavaArr[_local2]._y = Stage.height - (Math.random() * (Stage.height * 0.015));
lavaArr[_local2]._xscale = (lavaArr[_local2]._yscale = 75);
}
var _local4 = Math.random();
var _local5 = Math.random();
if (_local4 > 0.5) {
lavaArr[_local2].direcFlow = "left";
} else {
lavaArr[_local2].direcFlow = "right";
}
if (_local5 > 0.5) {
lavaArr[_local2].direcFlow2 = "down";
} else {
lavaArr[_local2].direcFlow2 = "up";
}
lavaArr[_local2].hSpeed = Math.random() * 2;
lavaArr[_local2].vSpeed = Math.random() * 0.75;
lavaArr[_local2].onEnterFrame = function () {
if (this.direcFlow == "left") {
this._x = this._x - this.hSpeed;
} else {
this._x = this._x + this.hSpeed;
}
if (this.direcFlow2 == "down") {
this._y = this._y - this.vSpeed;
} else {
this._y = this._y + this.vSpeed;
}
if (this._x <= left) {
this.direcFlow = "right";
}
if (this._x >= right) {
this.direcFlow = "left";
}
if (this._y <= (bottom - (this._height / lavaMag))) {
this.direcFlow2 = "up";
}
if (this._y >= (bottom + (this._height / lavaMag))) {
this.direcFlow2 = "down";
}
};
_local2++;
}
}
function createShooter(theShooter) {
if (!shooter) {
if (!mattLohkamp) {
var shooter = attachMovie("shooter", "shooter", 10000);
} else {
var shooter = attachMovie("lohkamp_shooter", "shooter", 10000);
}
}
shooter._x = getPerStage(theShooter[0], "width");
shooter._y = getPerStage(theShooter[1], "height");
shooter._rotation = theShooter[2];
shooter.redarrow.onEnterFrame = function () {
if (_root.numBalls >= _root.ballLimit) {
this._visible = true;
} else {
this._visible = false;
}
};
shooter.onRollOver = function () {
this.onEnterFrame = function () {
if (_root.numBalls >= _root.ballLimit) {
this.hover._visible = false;
this.cross._visible = true;
if (this.cross._alpha <= 100) {
this.cross._alpha = this.cross._alpha + 10;
} else {
delete this.onEnterFrame;
}
} else {
this.hover._visible = true;
this.cross._visible = false;
if (this.hover._alpha <= 100) {
this.hover._alpha = this.hover._alpha + 10;
} else {
delete this.onEnterFrame;
}
}
};
};
shooter.onRollOut = function () {
delete this.onEnterFrame;
this.onEnterFrame = function () {
if (_root.numBalls >= _root.ballLimit) {
this.hover._visible = false;
this.cross._visible = true;
if (this.cross._alpha >= 0) {
this.cross._alpha = this.cross._alpha - 10;
} else {
delete this.onEnterFrame;
}
} else {
this.hover._visible = true;
this.cross._visible = false;
if (this.hover._alpha >= 0) {
this.hover._alpha = this.hover._alpha - 10;
} else {
delete this.onEnterFrame;
}
}
};
};
if (!shooter.onPress) {
shooter.onPress = createBall;
}
levelObjects.push(shooter);
}
function createGoal(theGoal) {
if (!goal) {
if (!mattLohkamp) {
var goal = attachMovie("goal", "goal", 10001);
} else {
var goal = attachMovie("lohkamp_goal", "goal", 10001);
}
}
goal._x = Stage.width - getPerStage(theGoal[0], "width");
goal._y = Stage.height - getPerStage(theGoal[1], "height");
goal._rotation = theGoal[2];
levelObjects.push(goal);
}
function createLines(theLines) {
if (linesArr.length > 0) {
linesArr = new Array();
}
var _local3 = 0;
while (_local3 < theLines.length) {
linesArr[_local3] = attachMovie("line", "line" + _local3, _root.getNextHighestDepth());
levelObjects.push(linesArr[_local3]);
linesArr[_local3]._x = getPerStage(theLines[_local3][0], "width");
linesArr[_local3]._y = getPerStage(theLines[_local3][1], "height");
linesArr[_local3]._rotation = theLines[_local3][2];
linesArr[_local3].innerLine._xscale = theLines[_local3][3];
linesArr[_local3].pointLeft._x = linesArr[_local3].innerLine._x - (linesArr[_local3].innerLine._width / 2);
linesArr[_local3].pointRight._x = linesArr[_local3].innerLine._x + (linesArr[_local3].innerLine._width / 2);
if (!theLines[_local3][4]) {
linesArr[_local3].dragger._visible = false;
linesArr[_local3].dragEnabled = false;
} else {
linesArr[_local3].dragEnabled = true;
linesArr[_local3].dragger.onRollOver = function () {
createCursor("drag");
};
linesArr[_local3].dragger.onRollOut = function () {
removeCursor();
};
linesArr[_local3].dragger.onPress = function () {
createCursor("drag");
this._parent.startDrag();
};
linesArr[_local3].dragger.onRelease = function () {
this._parent.stopDrag();
};
linesArr[_local3].dragger.onReleaseOutside = function () {
removeCursor();
this._parent.stopDrag();
};
}
if (!theLines[_local3][5]) {
linesArr[_local3].pointLeft._visible = false;
linesArr[_local3].pointRight._visible = false;
linesArr[_local3].rotateEnabled = false;
} else {
linesArr[_local3].rotateEnabled = true;
linesArr[_local3].pointRight.onRollOver = (linesArr[_local3].pointLeft.onRollOver = function () {
createCursor("rotate");
});
linesArr[_local3].pointRight.onRollOut = (linesArr[_local3].pointLeft.onRollOut = function () {
removeCursor();
});
linesArr[_local3].pointRight.onPress = function () {
createCursor("rotate");
this._parent.rotating = true;
this._parent.dragLeft = false;
};
linesArr[_local3].pointLeft.onPress = function () {
createCursor("rotate");
this._parent.rotating = true;
this._parent.dragLeft = true;
};
linesArr[_local3].pointRight.onRelease = (linesArr[_local3].pointLeft.onRelease = function () {
this._parent.rotating = false;
});
linesArr[_local3].pointRight.onReleaseOutside = (linesArr[_local3].pointLeft.onReleaseOutside = function () {
this._parent.rotating = false;
removeCursor();
});
linesArr[_local3].onEnterFrame = function () {
if (this.rotating) {
lineRotate(this);
}
};
}
linesArr[_local3].filters = [dropShadow];
_local3++;
}
}
function createBarriers(theBarriers) {
var _local4 = 0;
while (_local4 < theBarriers.length) {
var _local3 = this.createEmptyMovieClip("barrier" + _local4, this.getNextHighestDepth());
levelObjects.push(_local3);
if (theBarriers[_local4][0]) {
drawRectangle(_local3, (theBarriers[_local4][1] / 100) * Stage.width, 4, 14935011, 100);
} else {
drawRectangle(_local3, 4, (theBarriers[_local4][1] / 100) * Stage.height, 14935011, 100);
}
_local3._x = (theBarriers[_local4][2] / 100) * Stage.width;
_local3._y = ((theBarriers[_local4][3] / 100) * Stage.height) - (_local3._height / 2);
_local3.onEnterFrame = function () {
var _local3 = 0;
while (_local3 < ballsArr.length) {
var _local2 = ballsArr[_local3];
if (this.hitTest(_local2) && (!_local2.vac)) {
var _local7 = this._x + (this._width / 2);
var _local6 = this._y + (this._height / 2);
var _local5 = _local2._x + (_local2._width / 2);
var _local4 = _local2._x - (_local2._width / 2);
var _local8 = _local2._y - (_local2._height / 2);
var _local9 = _local2._y + (_local2._height / 2);
if (this._width < this._height) {
if (_local2._x <= _local7) {
_local2._x = _local2._x - (_local5 - this._x);
} else {
_local2._x = _local2._x + ((this._x + this._width) - _local4);
}
_local2.vx = _local2.vx * -0.75;
} else {
if (_local2._y <= _local6) {
_local2._y = _local2._y - (_local9 - this._y);
} else {
_local2._y = _local2._y + ((this._y + this._height) - _local8);
}
_local2.vy = _local2.vy * -0.75;
if ((_local2._x <= this._x) && (_local2.vx > 0)) {
_local2._x = _local2._x - (_local5 - this._x);
_local2.vx = _local2.vx * -0.75;
} else if ((_local2._x >= (this._x + this._width)) && (_local2.vx < 0)) {
_local2._x = _local2._x + ((this._x + this._width) - _local4);
_local2.vx = _local2.vx * -0.75;
}
}
}
_local3++;
}
};
_local3.filters = [dropShadow];
_local4++;
}
}
function createVacuums(theVacuums) {
vacuumsArr = new Array();
var _local1 = 0;
while (_local1 < theVacuums.length) {
vacuumsArr[_local1] = attachMovie("vacuum", "vacuum" + _local1, levelObjects.length + 1);
levelObjects.push(vacuumsArr[_local1]);
vacuumsArr[_local1]._x = getPerStage(theVacuums[_local1][0], "width");
vacuumsArr[_local1]._y = getPerStage(theVacuums[_local1][1], "height");
_local1++;
}
}
function createWalls(theWalls) {
if (theWalls[0]) {
this.createEmptyMovieClip("wallTop", this.getNextHighestDepth());
drawRectangle(wallTop, Stage.width, 4, 14935011, 100);
wallTop._x = (wallTop._y = 0);
levelObjects.push(wallTop);
}
if (theWalls[2]) {
this.createEmptyMovieClip("wallBottom", this.getNextHighestDepth());
drawRectangle(wallBottom, Stage.width, 4, 14935011, 100);
wallBottom._x = 0;
wallBottom._y = Stage.height - wallBottom._height;
levelObjects.push(wallBottom);
} else {
createLava();
}
if (theWalls[1]) {
this.createEmptyMovieClip("wallRight", this.getNextHighestDepth());
drawRectangle(wallRight, 4, Stage.height, 14935011, 100);
wallRight._x = Stage.width - wallRight._width;
wallRight._y = 0;
levelObjects.push(wallRight);
}
if (theWalls[3]) {
this.createEmptyMovieClip("wallLeft", this.getNextHighestDepth());
drawRectangle(wallLeft, 4, Stage.height, 14935011, 100);
wallLeft._x = (wallLeft._y = 0);
levelObjects.push(wallLeft);
}
}
function createBall() {
if ((!ballsArr[ballsArr.length - 1].hitTest(shooter)) & (numBalls < ballLimit)) {
if (!mattLohkamp) {
ballsArr[ballsArr.length] = attachMovie("ball", "ball" + ballsArr.length, (levelObjects.length + ballsArr.length) + 1);
} else {
ballsArr[ballsArr.length] = attachMovie("lohkamp_ball", "ball" + ballsArr.length, (levelObjects.length + ballsArr.length) + 1);
}
if (shooter) {
ballsArr[ballsArr.length - 1]._x = shooter._x;
ballsArr[ballsArr.length - 1]._y = shooter._y;
ballsArr[ballsArr.length - 1].vy = startGrav;
} else {
ballsArr[ballsArr.length - 1]._x = Math.random() * Stage.width;
ballsArr[ballsArr.length - 1]._y = 0;
ballsArr[ballsArr.length - 1].vy = 0;
}
ballsArr[ballsArr.length - 1].vx = 0;
ballsArr[ballsArr.length - 1]._width = (ballsArr[ballsArr.length - 1]._height = ballSize);
numBalls++;
if (throwEnabled) {
ballsArr[ballsArr.length - 1].onPress = function () {
this.oldX = this._x;
this.oldY = this._y;
this.dragging = true;
this.startDrag();
};
ballsArr[ballsArr.length - 1].onRelease = (ballsArr[ballsArr.length - 1].onReleaseOutside = function () {
this.dragging = false;
this.stopDrag();
});
}
}
}
function checkBalls() {
var _local10 = 0;
while (_local10 < ballsArr.length) {
var _local1 = ballsArr[_local10];
if (_local1.dragging) {
_local1.vx = _local1._x - _local1.oldX;
_local1.vy = _local1._y - _local1.oldY;
_local1.oldX = _local1._x;
_local1.oldY = _local1._y;
} else {
var _local6 = _local10 + 1;
while (_local6 < ballsArr.length) {
var _local2 = ballsArr[_local6];
var _local5 = _local2._x - _local1._x;
var _local3 = _local2._y - _local1._y;
var _local12 = Math.sqrt((_local5 * _local5) + (_local3 * _local3));
var _local4 = (_local1._width / 2) + (_local2._width / 2);
if (((_local12 < _local4) && (!_local1.fish)) && (!_local2.fish)) {
var _local9 = Math.atan2(_local3, _local5);
var _local13 = _local1._x + (Math.cos(_local9) * _local4);
var _local11 = _local1._y + (Math.sin(_local9) * _local4);
var _local8 = (_local13 - _local2._x) * spring;
var _local7 = (_local11 - _local2._y) * spring;
_local1.vx = _local1.vx - _local8;
_local1.vy = _local1.vy - _local7;
_local2.vx = _local2.vx + _local8;
_local2.vy = _local2.vy + _local7;
}
_local6++;
}
_local1.vy = _local1.vy + gravity;
_local1._x = _local1._x + _local1.vx;
_local1._y = _local1._y + _local1.vy;
_local1._y = _local1._y + _local1.vy;
}
switch (levelsArr[currentLevel].walls[0]) {
case true :
if ((_local1._y - (_local1._width / 2)) < top) {
_local1._y = top + (_local1._width / 2);
_local1.vy = _local1.vy * -0.9;
}
break;
case false :
if ((_local1._y - _local1._width) >= top) {
break;
}
deleteBall(_local1, "lava");
}
switch (levelsArr[currentLevel].walls[1]) {
case true :
if ((_local1._x + (_local1._width / 2)) > right) {
_local1._x = right - (_local1._width / 2);
_local1.vx = _local1.vx * -0.9;
}
break;
case false :
if ((_local1._x + _local1._width) <= right) {
break;
}
deleteBall(_local1, "lava");
}
switch (levelsArr[currentLevel].walls[2]) {
case true :
if ((_local1._y + (_local1._width / 2)) > bottom) {
_local1._y = bottom - (_local1._width / 2);
_local1.vy = _local1.vy * -0.9;
}
break;
case false :
if ((_local1._y + (_local1._width / 2)) <= bottom) {
break;
}
deleteBall(_local1, "lava");
}
switch (levelsArr[currentLevel].walls[3]) {
case true :
if ((_local1._x - (_local1._width / 2)) < left) {
_local1._x = left + (_local1._width / 2);
_local1.vx = _local1.vx * -0.9;
}
break;
case false :
if ((_local1._x - _local1._width) >= left) {
break;
}
deleteBall(_local1, "lava");
}
if (_local1.hitTest(goal)) {
checkGoal(_local1);
}
_local10++;
}
}
function checkLine(line) {
if ((line._x - (line._width / 2)) < left) {
line._x = line._width / 2;
} else if ((line._x + (line._width / 2)) > right) {
line._x = Stage.width - (line._width / 2);
} else if ((line._y - (line._height / 2)) < top) {
line._y = line._height / 2;
} else if ((line._y + (line._height / 2)) > bottom) {
line._y = Stage.height - (line._height / 2);
}
var _local16 = line.getBounds(this);
var _local12 = 0;
while (_local12 < ballsArr.length) {
var _local2 = ballsArr[_local12];
var _local11 = false;
if (vacuumsArr.length > 0) {
var _local5 = 0;
while (_local5 < vacuumsArr.length) {
if (vacuumsArr[_local5].hitcircle.hitTest(_local2)) {
_local11 = true;
break;
}
_local5++;
}
}
if ((((_local2._x > _local16.xMin) && (_local2._x < _local16.xMax)) && (!_local11)) && (!_local2.fish)) {
var _local14 = (line._rotation * Math.PI) / 180;
var _local3 = Math.cos(_local14);
var _local4 = Math.sin(_local14);
var _local10 = _local2._x - line._x;
var _local8 = _local2._y - line._y;
var _local7 = (_local3 * _local8) - (_local4 * _local10);
var _local9 = (_local3 * _local2.vy) - (_local4 * _local2.vx);
if ((_local7 > ((-_local2._height) / 2)) && (_local7 < _local9)) {
var _local13 = (_local3 * _local10) + (_local4 * _local8);
var _local15 = (_local3 * _local2.vx) + (_local4 * _local2.vy);
_local7 = (-_local2._height) / 2;
_local9 = _local9 * bounce;
_local10 = (_local3 * _local13) - (_local4 * _local7);
_local8 = (_local3 * _local7) + (_local4 * _local13);
_local2.vx = (_local3 * _local15) - (_local4 * _local9);
_local2.vy = (_local3 * _local9) + (_local4 * _local15);
_local2._x = line._x + _local10;
_local2._y = line._y + _local8;
}
}
_local12++;
}
if (numBalls > 0) {
if (line.dragEnabled == true) {
line.dragger._visible = false;
}
if (line.rotateEnabled == true) {
line.pointLeft._visible = false;
line.pointRight._visible = false;
}
} else {
if (line.dragEnabled == true) {
line.dragger._visible = true;
}
if (line.rotateEnabled == true) {
line.pointLeft._visible = true;
line.pointRight._visible = true;
}
}
}
function checkVacuum(vacuum) {
var _local4 = false;
var _local2 = 0;
while (_local2 < ballsArr.length) {
dx = vacuum._x - ballsArr[_local2]._x;
dy = vacuum._y - ballsArr[_local2]._y;
dist = Math.sqrt((dx * dx) + (dy * dy));
if ((!isNaN(dist)) && (dist <= (ballsArr[_local2]._width * 2))) {
_local4 = true;
vacuum.door1.onEnterFrame = function () {
if (this._x > -52) {
this._x = this._x - 5;
}
};
vacuum.door2.onEnterFrame = function () {
if (this._x < 52) {
this._x = this._x + 5;
}
};
vacuum.motion.onEnterFrame = function () {
if (this._alpha < 25) {
this._alpha = this._alpha + 5;
}
this._rotation = this._rotation + 15;
};
}
if (vacuum.hitcircle.hitTest(ballsArr[_local2])) {
ballsArr[_local2].vac = true;
ballsArr[_local2].vx = (vacuum._x - ballsArr[_local2]._x) / 4;
ballsArr[_local2].vy = (vacuum._y - ballsArr[_local2]._y) / 4;
ballsArr[_local2].onEnterFrame = function (vacuum) {
if (this._xscale > 1) {
this._xscale = this._xscale - 10;
this._yscale = this._yscale - 10;
this._alpha = this._alpha - 5;
} else {
delete this.onEnterFrame;
deleteBall(this);
}
};
}
_local2++;
}
if (!_local4) {
vacuum.motion._alpha = 0;
delete vacuum.motion.onEnterFrame;
vacuum.door1.onEnterFrame = function () {
if (this._x < -26) {
this._x = this._x + 5;
}
};
vacuum.door2.onEnterFrame = function () {
if (this._x > 26) {
this._x = this._x - 5;
}
};
}
}
function checkGoal(ball) {
if ((levelWon || (!ball.hitTest(goal))) || (ball.fish)) {
return(false);
}
var _local4 = ball._x - (ball._width / 2);
var _local7 = ball._x + (ball._width / 2);
var _local8 = ball._y + (ball._height / 2);
var _local3 = goal._x - (goal._width / 2);
var _local2 = goal._x + (goal._width / 2);
var _local5 = goal._y - goal._height;
var _local6 = ball._x - (ball._width / 4);
var _local9 = ball._x + (ball._width / 4);
var _local10 = ball._y + (ball._height / 4);
if (((_local6 >= _local3) && (_local9 <= _local2)) && (_local8 >= _local5)) {
ball._x = goal._x;
ball.vx = 0;
levelWon = true;
wonLevel();
} else {
if (ball._x < goal._x) {
ball._x = ball._x - (_local7 - _local3);
} else if (ball._x > goal._x) {
ball._x = ball._x + (_local2 - _local4);
}
ball.vx = ball.vx * -0.75;
ball.vy = ball.vy * -0.75;
}
}
function hitLava(ball, color, uniqueY) {
if (!color) {
color = 16777011 /* 0xFFFF33 */;
}
var _local3 = hitLavaArr.length;
hitLavaArr[_local3] = this.createEmptyMovieClip("hitLava" + _local3, this.getNextHighestDepth());
hitLavaArr[_local3].numActiveSpecs = hitLavaSpecs;
hitLavaArr[_local3].splashes = new Array();
var _local6 = 0;
while (_local6 < hitLavaSpecs) {
hitLavaArr[_local3].splashes[_local6] = hitLavaArr[_local3].createEmptyMovieClip("spec" + _local6, hitLavaArr[_local3].getNextHighestDepth());
drawCircle(hitLavaArr[_local3].splashes[_local6], 2, color, 100);
if (uniqueY) {
hitLavaArr[_local3].splashes[_local6]._y = (Math.random() * ball._height) + (ball._y - (ball._height / 2));
} else {
hitLavaArr[_local3].splashes[_local6]._y = Stage.height;
}
hitLavaArr[_local3].splashes[_local6]._x = (Math.random() * ball._width) + (ball._x - (ball._width / 2));
hitLavaArr[_local3].splashes[_local6].vx = (Math.random() * 4) - 2;
hitLavaArr[_local3].splashes[_local6].vy = (Math.random() * -4) - 4;
_local6++;
}
hitLavaArr[_local3].onEnterFrame = function () {
var _local4 = 0;
while (_local4 < this.splashes.length) {
var _local3 = this.splashes[_local4];
_local3.vy = _local3.vy + _root.gravity;
_local3._x = _local3._x + _local3.vx;
_local3._y = _local3._y + _local3.vy;
_local4++;
}
var _local5 = true;
_local4 = 0;
while (_local4 < this.splashes.length) {
if (_local3._y < (Stage.height * 2)) {
_local5 = false;
}
_local4++;
}
if (_local5) {
delete this.onEnterFrame;
removeMovieClip(this);
}
};
}
function createCursor(cursorName) {
Mouse.hide();
removeMovieClip(cursor);
attachMovie("cursor_" + cursorName, "cursor", _root.getNextHighestDepth());
cursor._x = _xmouse;
cursor._y = _ymouse;
cursor.onMouseMove = function () {
this._x = _xmouse;
this._y = _ymouse;
updateAfterEvent();
};
}
function removeCursor() {
Mouse.show();
delete cursor.onMouseMove;
removeMovieClip(cursor);
}
function getPassword(passText) {
passText = passText.toLowerCase();
if (passText == "waterloosunset") {
ballLimit = 10;
score_cheats = true;
} else if (passText == "ziggyplayedguitar") {
gravity = 0.2;
score_cheats = true;
} else if (passText == "debaser") {
throwEnabled = true;
score_cheats = true;
} else if (passText == "fivefootone") {
ballSize = 20;
score_cheats = true;
} else if (passText == "mattlohkamp") {
mattLohkamp = true;
} else {
var _local1 = 0;
while (_local1 < levelsArr.length) {
if (levelsArr[_local1].pass && (levelsArr[_local1].pass == passText)) {
score_total = 0;
initLevel(_local1);
break;
}
_local1++;
}
}
if (isNaN(currentLevel)) {
initLevel();
}
}
function calcScore() {
var _local1 = new Array();
if ((score_ballBonus - (score_ballLoss * ballsLost)) > 0) {
_local1[0] = score_ballBonus - (score_ballLoss * ballsLost);
} else {
_local1[0] = 0;
}
if ((score_timeBonus - (score_timeLoss * timePlayed)) > 0) {
_local1[1] = score_timeBonus - (score_timeLoss * timePlayed);
} else {
_local1[1] = 0;
}
_local1[2] = currentLevel * score_levelBonus;
_local1[_local1.length] = 0;
var _local2 = 0;
while (_local2 < (_local1.length - 1)) {
_local1[_local1.length - 1] = _local1[_local1.length - 1] + _local1[_local2];
_local2++;
}
levelsArr[currentLevel].score = _local1[_local1.length - 1];
score_total = score_total + levelsArr[currentLevel].score;
return(_local1);
}
function wonLevel() {
pauseGame(false);
var _local3 = _root.attachMovie("scoreWin", "scoreWin", _root.getNextHighestDepth());
_local3._x = (Stage.width / 2) - (_local3._width / 2);
_local3._y = (Stage.height / 2) - (_local3._height / 2);
_local3.scoreWinHead.text = ("YOU BEAT LEVEL " + (currentLevel + 1)) + "!";
var _local4 = calcScore();
_local3.ballText.text = _local4[0];
_local3.timeText.text = _local4[1];
_local3.levelText.text = _local4[2];
_local3.totalText.text = _local4[3];
if (levelsArr[currentLevel].pass) {
_local3.passText.text = "Level Password: " + levelsArr[currentLevel].pass;
} else {
_local3.passText.text = "Level Password: (none for this level)";
}
_local3.continueBtn.onRelease = function () {
pauseGame(true);
initLevel();
};
_local3.continueBtn.alphaNum = -5;
_local3.continueBtn.onEnterFrame = function () {
this._alpha = this._alpha + this.alphaNum;
if (this._alpha >= 100) {
this.alphaNum = -5;
} else if (this._alpha <= 35) {
this.alphaNum = 5;
}
};
}
function lineRotate(thisLine) {
var _local4 = _xmouse - thisLine._x;
var _local3 = _ymouse - thisLine._y;
var _local1 = getDegrees(Math.atan2(_local3, _local4));
if (thisLine.dragLeft) {
if ((_local1 >= 130) | (_local1 <= -130)) {
thisLine._rotation = _local1 - 180;
}
} else if ((_local1 >= -50) & (_local1 <= 50)) {
thisLine._rotation = _local1;
}
}
function deleteBall(ball, effect) {
if ((!levelsArr[currentLevel].walls[2]) && (effect == "lava")) {
hitLava(ball);
} else if (effect == "explode") {
explodeBall(ball);
}
ball.removeMovieClip();
ballsLost++;
numBalls--;
}
function timeCounter() {
if (!isPaused) {
timePlayed++;
}
}
function getDegrees(radians) {
var _local1 = (radians * 180) / Math.PI;
return(_local1);
}
function getPerStage(percent, direct) {
if (direct == "width") {
var _local1 = Stage.width;
} else {
var _local1 = Stage.height;
}
return((percent * 0.01) * _local1);
}
function resetStage() {
clearInterval(timePlayedId);
Mouse.show();
for (k in this) {
if (typeof(this[k]) == "movieclip") {
this[k].removeMovieClip();
}
}
levelObjects = new Array();
ballsArr = new Array();
numBalls = 0;
}
function drawRectangle(target_mc, boxWidth, boxHeight, fillColor, fillAlpha) {
with (target_mc) {
beginFill(fillColor, fillAlpha);
moveTo(0, 0);
lineTo(boxWidth, 0);
lineTo(boxWidth, boxHeight);
lineTo(0, boxHeight);
lineTo(0, 0);
endFill();
}
}
function pauseGame(hideElements) {
if (!isPaused) {
isPaused = true;
} else {
isPaused = false;
}
var _local1 = 0;
while (_local1 < levelObjects.length) {
levelObjects[_local1]._visible = hideElements;
_local1++;
}
_local1 = 0;
while (_local1 < ballsArr.length) {
ballsArr[_local1]._visible = hideElements;
_local1++;
}
}
function drawCircle(target_mc, radius, fillColor, fillAlpha) {
var x = radius;
var y = radius;
with (target_mc) {
beginFill(fillColor, fillAlpha);
moveTo(x + radius, y);
curveTo(radius + x, (0.414213562373095 * radius) + y, (0.707106781186547 * radius) + x, (0.707106781186547 * radius) + y);
curveTo((0.414213562373095 * radius) + x, radius + y, x, radius + y);
curveTo((-0.414213562373095 * radius) + x, radius + y, (-0.707106781186547 * radius) + x, (0.707106781186547 * radius) + y);
curveTo((-radius) + x, (0.414213562373095 * radius) + y, (-radius) + x, y);
curveTo((-radius) + x, (-0.414213562373095 * radius) + y, (-0.707106781186547 * radius) + x, (-0.707106781186547 * radius) + y);
curveTo((-0.414213562373095 * radius) + x, (-radius) + y, x, (-radius) + y);
curveTo((0.414213562373095 * radius) + x, (-radius) + y, (0.707106781186547 * radius) + x, (-0.707106781186547 * radius) + y);
curveTo(radius + x, (-0.414213562373095 * radius) + y, radius + x, y);
endFill();
}
}
function drawRoundedRectangle(target_mc, boxWidth, boxHeight, cornerRadius, fillColor, fillAlpha) {
with (target_mc) {
beginFill(fillColor, fillAlpha);
moveTo(cornerRadius, 0);
lineTo(boxWidth - cornerRadius, 0);
curveTo(boxWidth, 0, boxWidth, cornerRadius);
lineTo(boxWidth, cornerRadius);
lineTo(boxWidth, boxHeight - cornerRadius);
curveTo(boxWidth, boxHeight, boxWidth - cornerRadius, boxHeight);
lineTo(boxWidth - cornerRadius, boxHeight);
lineTo(cornerRadius, boxHeight);
curveTo(0, boxHeight, 0, boxHeight - cornerRadius);
lineTo(0, boxHeight - cornerRadius);
lineTo(0, cornerRadius);
curveTo(0, 0, cornerRadius, 0);
lineTo(cornerRadius, 0);
endFill();
}
}
function tracking() {
myURL = "http://www.gamegarage.co.uk/scripts/";
url = myURL + "tracking.php";
lv = new LoadVars();
lv.game_id = _root.game_id;
lv.user_id = _root.user_id;
lv.sendAndLoad(url, lv, "POST");
}
function scoring() {
myURL = "http://www.gamegarage.co.uk/scripts/";
url = myURL + "score.php";
lv = new LoadVars();
lv.game_id = _root.game_id;
lv.user_id = _root.user_id;
lv.score = score_total;
lv.alg = ((_root.game_id + _root.user_id) + XXXXXX) + "a83l9xj";
lv.sendAndLoad(url, lv, "POST");
}
stop();
tracking();
var versionNum = "Version 1.0 GG";
Stage.scaleMode = "noscale";
Stage.align = "TL";
bgGradient._width = Stage.width;
bgGradient._height = Stage.height;
bgGradient._x = Stage.width / 2;
bgGradient._y = Stage.height / 2;
var left = 0;
var right = Stage.width;
var top = 0;
var bottom = Stage.height;
var spring = 0.5;
var gravity = 0.5;
var startGrav = 2;
var bounce = -0.7;
var ballSize = 40;
var numBalls = 0;
var ballLimit = 1;
var lavaAmount = 30;
var lavaMag = 7;
var hitLavaSpecs = 40;
var score_total = 0;
var score_timeBonus = 1000;
var score_timeLoss = 10;
var score_ballBonus = 1000;
var score_ballLoss = 100;
var score_levelBonus = 100;
var score_cheats = false;
var mattLohkamp = false;
var ballsLost = 0;
var timePlayed = 0;
var timePlayedId = null;
var antiGrav = false;
var throwEnabled = false;
var firstPlay = true;
var isPaused = true;
var dropShadow = (new flash.filters.DropShadowFilter(5, 90, 0, 0.7, 2, 10, 2, 3));
var dropShadowLite = (new flash.filters.DropShadowFilter(10, 90, 0, 0.2, 2, 10, 2, 3));
var scoreFormat = new TextFormat();
scoreFormat.font = "Verdana";
scoreFormat.size = 12;
scoreFormat.color = 16777215 /* 0xFFFFFF */;
scoreFormat.align = "right";
scoreFormat.bold = true;
var scoreFormat2 = new TextFormat();
scoreFormat2.font = "Verdana";
scoreFormat2.size = 12;
scoreFormat2.color = 16777215 /* 0xFFFFFF */;
scoreFormat2.align = "left";
scoreFormat1.bold = true;
var levelFormat = new TextFormat();
levelFormat.font = "Futura";
levelFormat.size = 100;
levelFormat.color = 16777215 /* 0xFFFFFF */;
levelFormat.align = "center";
var levelsArr = new Array();
var levelObjects = new Array();
var ballsArr = new Array();
var linesArr = new Array();
var wallsArr = new Array();
var barriersArr = new Array();
var vacuumsArr = new Array();
var fishArr = new Array();
var robotArmsArr = new Array();
var lavaArr = new Array();
var hitLavaArr = new Array();
var levelWon = false;
var currentLevel;
levelsArr[0] = new Object();
levelsArr[0].shooter = [15, 0, 0];
levelsArr[0].lines = [[50, 30, 0, 150, true, true], [50, 50, 0, 150, true, true]];
levelsArr[0].walls = [true, true, false, true];
levelsArr[0].goal = [15, 0, 0];
levelsArr[1] = new Object();
levelsArr[1].pass = "ifeelheavymetal";
levelsArr[1].shooter = [15, 0, 0];
levelsArr[1].lines = [[50, 30, 0, 100, true, true], [50, 50, 0, 100, true, true], [50, 70, 0, 100, true, true]];
levelsArr[1].walls = [true, true, false, true];
levelsArr[1].goal = [15, 0, 0];
levelsArr[2] = new Object();
levelsArr[2].pass = "blazzaboo";
levelsArr[2].shooter = [15, 0, 0];
levelsArr[2].lines = [[50, 50, 0, 200, true, true]];
levelsArr[2].walls = [true, true, false, true];
levelsArr[2].goal = [15, 0, 0];
levelsArr[3] = new Object();
levelsArr[3].pass = "ringostarr";
levelsArr[3].shooter = [15, 0, 0];
levelsArr[3].lines = [[50, 30, 0, 100, true, true], [50, 50, 0, 100, true, true], [22, 22, -20, 75, false, false]];
levelsArr[3].walls = [true, true, false, true];
levelsArr[3].goal = [15, 0, 0];
levelsArr[4] = new Object();
levelsArr[4].pass = "hailhailrocknroll";
levelsArr[4].shooter = [15, 0, 0];
levelsArr[4].lines = [[50, 30, 0, 50, true, true], [50, 50, 0, 50, true, true], [50, 70, 0, 50, true, true]];
levelsArr[4].walls = [true, true, false, true];
levelsArr[4].goal = [15, 0, 0];
levelsArr[5] = new Object();
levelsArr[5].pass = "marqueemoon";
levelsArr[5].shooter = [15, 0, 0];
levelsArr[5].lines = [[50, 30, 0, 30, true, true], [50, 50, 0, 30, true, true], [50, 70, 0, 30, true, true]];
levelsArr[5].walls = [true, true, false, true];
levelsArr[5].goal = [15, 0, 0];
levelsArr[6] = new Object();
levelsArr[6].pass = "milkwasabadchoice";
levelsArr[6].shooter = [25, 0, 0];
levelsArr[6].lines = [[50, 30, 0, 30, true, true], [50, 50, 0, 30, true, true]];
levelsArr[6].walls = [true, true, false, true];
levelsArr[6].goal = [25, 0, 0];
levelsArr[7] = new Object();
levelsArr[7].pass = "samusisfemale";
levelsArr[7].shooter = [35, 0, 0];
levelsArr[7].lines = [[50, 50, 0, 30, true, true]];
levelsArr[7].walls = [true, true, false, true];
levelsArr[7].goal = [35, 0, 0];
levelsArr[8] = new Object();
levelsArr[8].pass = "lettertoelise";
levelsArr[8].shooter = [25, 0, 0];
levelsArr[8].lines = [[35, 30, 0, 170, true, true]];
levelsArr[8].walls = [true, true, false, true];
levelsArr[8].barriers = [[false, 50, 75, 75]];
levelsArr[8].goal = [15, 0, 0];
levelsArr[9] = new Object();
levelsArr[9].pass = "wassailingsong";
levelsArr[9].shooter = [15, 0, 0];
levelsArr[9].lines = [[35, 30, 0, 75, true, true], [35, 60, 0, 100, true, true]];
levelsArr[9].walls = [true, true, false, true];
levelsArr[9].barriers = [[false, 50, 75, 75]];
levelsArr[9].goal = [15, 0, 0];
levelsArr[10] = new Object();
levelsArr[10].pass = "shadowinvain";
levelsArr[10].shooter = [15, 0, 0];
levelsArr[10].lines = [[35, 25, 0, 50, true, true], [35, 50, 0, 50, true, true], [35, 75, 0, 50, true, true]];
levelsArr[10].walls = [true, true, false, true];
levelsArr[10].barriers = [[true, 40, 60, 65]];
levelsArr[10].goal = [15, 0, 0];
levelsArr[11] = new Object();
levelsArr[11].pass = "danabnormal";
levelsArr[11].shooter = [85, 0, 0];
levelsArr[11].lines = [[35, 25, 0, 125, true, true], [35, 50, 0, 50, true, true], [35, 75, 0, 100, true, true]];
levelsArr[11].walls = [true, true, false, true];
levelsArr[11].barriers = [[true, 40, 60, 65]];
levelsArr[11].goal = [15, 0, 0];
levelsArr[12] = new Object();
levelsArr[12].pass = "cruiserscreekuh";
levelsArr[12].shooter = [75, 0, 0];
levelsArr[12].lines = [[60, 25, 0, 125, true, true], [60, 50, 0, 50, true, true]];
levelsArr[12].walls = [true, true, false, true];
levelsArr[12].barriers = [[false, 75, 25, 25]];
levelsArr[12].goal = [85, 0, 0];
levelsArr[13] = new Object();
levelsArr[13].pass = "mallorylikespolkadots";
levelsArr[13].shooter = [15, 0, 0];
levelsArr[13].lines = [[50, 50, 0, 200, true, true]];
levelsArr[13].walls = [true, true, false, true];
levelsArr[13].vacuums = [[15, 40], [85, 60]];
levelsArr[13].goal = [15, 0, 0];
levelsArr[14] = new Object();
levelsArr[14].pass = "mysterymeat";
levelsArr[14].shooter = [15, 0, 0];
levelsArr[14].lines = [[50, 30, 0, 30, true, true], [50, 50, 0, 30, true, true], [50, 70, 0, 30, true, true]];
levelsArr[14].walls = [true, true, false, true];
levelsArr[14].vacuums = [[25, 50], [75, 50]];
levelsArr[14].goal = [15, 0, 0];
levelsArr[15] = new Object();
levelsArr[15].pass = "punklolita";
levelsArr[15].shooter = [50, 0, 0];
levelsArr[15].lines = [[50, 30, 0, 50, true, true], [50, 70, 0, 50, true, true]];
levelsArr[15].walls = [true, true, false, true];
levelsArr[15].vacuums = [[50, 50]];
levelsArr[15].goal = [50, 0, 0];
levelsArr[16] = new Object();
levelsArr[16].shooter = [50, 0, 0];
levelsArr[16].pass = "coffeeandtv";
levelsArr[16].lines = [[50, 30, 0, 60, true, true], [50, 50, 0, 100, true, true]];
levelsArr[16].barriers = [[true, 25, 38, 70]];
levelsArr[16].vacuums = [[35, 60], [65, 60]];
levelsArr[16].walls = [true, true, false, true];
levelsArr[16].goal = [50, 0, 0];
levelsArr[17] = new Object();
levelsArr[17].shooter = [65, 0, 0];
levelsArr[17].pass = "lifeduringwartime";
levelsArr[17].lines = [[50, 50, 0, 75, true, true], [50, 35, 0, 25, true, true]];
levelsArr[17].barriers = [[true, 50, 25, 70]];
levelsArr[17].walls = [true, true, false, true];
levelsArr[17].goal = [65, 0, 0];
levelsArr[18] = new Object();
levelsArr[18].shooter = [25, 0, 0];
levelsArr[18].pass = "sitdownstandup";
levelsArr[18].lines = [[50, 50, 0, 75, true, true]];
levelsArr[18].vacuums = [[25, 30]];
levelsArr[18].walls = [true, true, false, true];
levelsArr[18].goal = [25, 0, 0];
levelsArr[19] = new Object();
levelsArr[19].shooter = [25, 0, 0];
levelsArr[19].pass = "keepfishin";
levelsArr[19].lines = [[50, 50, 0, 150, true, true]];
levelsArr[19].fish = [[50, 17, 2]];
levelsArr[19].walls = [true, true, false, true];
levelsArr[19].goal = [25, 0, 0];
levelsArr[20] = new Object();
levelsArr[20].shooter = [25, 0, 0];
levelsArr[20].pass = "keepfishin";
levelsArr[20].lines = [[50, 50, 0, 150, true, true]];
levelsArr[20].fish = [[35, 17, 2], [65, 17, 3]];
levelsArr[20].walls = [true, true, false, true];
levelsArr[20].goal = [25, 0, 0];
levelsArr[21] = new Object();
levelsArr[21].pass = "dancethemantaray";
levelsArr[21].shooter = [15, 0, 0];
levelsArr[21].lines = [[50, 30, 0, 100, true, true], [50, 50, 0, 100, true, true]];
levelsArr[21].walls = [true, true, false, true];
levelsArr[21].fish = [[65, 14, 2, 3]];
levelsArr[21].goal = [15, 0, 0];
levelsArr[22] = new Object();
levelsArr[22].pass = "thislevelhasnoramps";
levelsArr[22].shooter = [50, 0, 0];
levelsArr[22].walls = [true, true, false, true];
levelsArr[22].fish = [[35, 15, 0.5, 4], [65, 15, 0.5, -4]];
levelsArr[22].goal = [50, 0, 0];
levelsArr[23] = new Object();
levelsArr[23].pass = "iamtheeggman";
levelsArr[23].shooter = [50, 0, 0];
levelsArr[23].walls = [true, true, false, true];
levelsArr[23].lines = [[50, 35, 0, 75, true, true], [50, 65, 0, 75, true, true]];
levelsArr[23].vacuums = [[50, 50]];
levelsArr[23].fish = [[35, 15, 2, 4], [65, 15, 2, -4]];
levelsArr[23].goal = [50, 0, 0];
levelsArr[24] = new Object();
levelsArr[24].pass = "needahand";
levelsArr[24].shooter = [15, 0, 0];
levelsArr[24].lines = [[50, 50, 0, 200, true, true]];
levelsArr[24].walls = [true, true, false, true];
levelsArr[24].arms = [[85, 25]];
levelsArr[24].goal = [15, 0, 0];
levelsArr[25] = new Object();
levelsArr[25].pass = "grooveisintheheart";
levelsArr[25].shooter = [15, 0, 0];
levelsArr[25].lines = [[50, 35, 0, 100, true, true], [50, 65, 0, 100, true, true]];
levelsArr[25].walls = [true, true, false, true];
levelsArr[25].arms = [[85, 25], [15, 85]];
levelsArr[25].goal = [15, 0, 0];
levelsArr[26] = new Object();
levelsArr[26].pass = "bigdaddyc";
levelsArr[26].shooter = [15, 0, 0];
levelsArr[26].lines = [[50, 35, 0, 100, true, true], [50, 65, 0, 100, true, true]];
levelsArr[26].walls = [true, true, false, true];
levelsArr[26].arms = [[50, 100]];
levelsArr[26].goal = [15, 0, 0];
levelsArr[27] = new Object();
levelsArr[27].pass = "suckerfish";
levelsArr[27].shooter = [15, 0, 0];
levelsArr[27].lines = [[50, 50, 0, 200, true, true]];
levelsArr[27].walls = [true, true, false, true];
levelsArr[27].vacuums = [[15, 40], [85, 60]];
levelsArr[27].fish = [[50, 17, 1]];
levelsArr[27].goal = [15, 0, 0];
levelsArr[28] = new Object();
levelsArr[28].pass = "twitsatsea";
levelsArr[28].shooter = [15, 0, 0];
levelsArr[28].lines = [[50, 35, 0, 50, true, true], [50, 50, 0, 50, true, true], [50, 65, 0, 50, true, true]];
levelsArr[28].walls = [true, true, false, true];
levelsArr[28].vacuums = [[15, 40], [85, 60]];
levelsArr[28].fish = [[50, 17, 1]];
levelsArr[28].goal = [15, 0, 0];
levelsArr[29] = new Object();
levelsArr[29].pass = "youseemstarshaped";
levelsArr[29].shooter = [15, 0, 0];
levelsArr[29].lines = [[50, 35, 0, 50, true, true], [50, 50, 0, 50, true, true], [50, 65, 0, 50, true, true]];
levelsArr[29].walls = [true, true, false, true];
levelsArr[29].vacuums = [[15, 40], [85, 60]];
levelsArr[29].fish = [[50, 17, 1]];
levelsArr[29].arms = [[80, 10], [20, 90]];
levelsArr[29].goal = [15, 0, 0];
levelsArr[30] = new Object();
levelsArr[30].pass = "onefootinthegrave";
levelsArr[30].shooter = [15, 0, 0];
levelsArr[30].lines = [[50, 25, 0, 200, true, true]];
levelsArr[30].walls = [true, true, false, true];
levelsArr[30].arms = [[10, 80], [30, 80], [50, 80]];
levelsArr[30].goal = [15, 0, 0];
levelsArr[31] = new Object();
levelsArr[31].pass = "theresnootherway";
levelsArr[31].shooter = [15, 0, 0];
levelsArr[31].lines = [[50, 25, 0, 75, true, true], [50, 50, 0, 75, true, true]];
levelsArr[31].walls = [true, true, false, true];
levelsArr[31].arms = [[75, 10]];
levelsArr[31].barriers = [[false, 50, 75, 80]];
levelsArr[31].goal = [15, 0, 0];
levelsArr[32] = new Object();
levelsArr[32].pass = "shakeappeal";
levelsArr[32].shooter = [15, 0, 0];
levelsArr[32].lines = [[50, 35, 0, 50, true, true], [50, 55, 0, 200, true, true]];
levelsArr[32].walls = [true, true, false, true];
levelsArr[32].arms = [[90, 10]];
levelsArr[32].barriers = [[true, 60, 0, 65]];
levelsArr[32].fish = [[85, 12, 2]];
levelsArr[32].goal = [85, 0, 0];
initMenu();
var keyListener = new Object();
keyListener.onKeyUp = function () {
if (((Key.getAscii() == 13) && (mainMenu)) && (mainMenu.passField.text != "")) {
pauseGame(true);
mainMenu._visible = false;
this.removeMovieClip(mainMenu);
getPassword(mainMenu.passField.text);
} else if (Key.getAscii() == 32) {
if ((!mainMenu) || (mainMenu._visible == false)) {
initMenu();
}
}
};
Key.addListener(keyListener);