Frame 1
stop();
Instance of Symbol 45 MovieClip in Frame 1
onClipEvent (load) {
_root.stop();
}
onClipEvent (enterFrame) {
if (_root._framesloaded >= _root._totalframes) {
_root.gotoAndStop("miniclipintro");
} else {
this.bytesload.gotoAndStop(Math.ceil((_root.getBytesLoaded() / _root.getBytesTotal()) * this.bytesload._totalframes));
}
}
Frame 2
stop();
Frame 3
function getPlayerVersion() {
var playerVersion = getVersion();
myLength = length(playerVersion);
while (i <= myLength) {
i = i + 1;
temp = substring(playerVersion, i, 1);
if (temp eq " ") {
platform = substring(playerVersion, 1, i - 1);
majorVersion = substring(playerVersion, i + 1, 1);
secondHalf = substring(playerVersion, i + 1, myLength - i);
minorVersion = substring(secondHalf, 5, 2);
}
}
}
function getUserSettings() {
var userSO = SharedObject.getLocal("bunch_settings", "/");
if (userSO.data.firsttime == undefined) {
userSO.data.firsttime = true;
userSO.data.soundOn = true;
userSO.data.firstPuzzlePlayed = true;
userSO.data.firstClassicPlayed = true;
userSO.data.firstTimeTrialPlayed = true;
userSO.flush(100);
} else {
_root.firsttime = Boolean(userSO.data.firsttime);
_root.soundOn = Boolean(userSO.data.soundOn);
_root.firstPuzzlePlayed = Boolean(userSO.data.firstPuzzlePlayed);
_root.firstClassicPlayed = Boolean(userSO.data.firstClassicPlayed);
_root.firstTimeTrialPlayed = Boolean(userSO.data.firstTimeTrialPlayed);
}
}
function gotoWebsite() {
getURL ("http://www.devlabs.com/default.asp?game=bunch", "_blank");
}
function loadLevelString() {
_root.levelfile_toload = "<LevelData><Level NUmber=\"1\"><Balls>,700,701,302,503,404,405,506,107,410,111,612,713,114,115,616,317,420,721,422,323,624,725,626,427,230,731,332,633,234,135,236,237,640,141,242,743,144,445,446,147,350,251,352,153,554,755,656,757,560,361,462,163,664,565,366,467,770,671,272,473,574,775,476,177.</Balls><Squares>s05,125,135,145,144,143.</Squares></Level>";
_root.levelfile_toload = _root.levelfile_toload + "<Level NUmber=\"1\"><Balls>,400,401,602,103,204,705,506,407,110,711,112,213,114,415,116,517,420,521,122,323,424,625,626,727,330,531,732,133,734,135,136,737,640,241,342,743,644,545,246,247,650,451,352,453,654,255,156,457,160,261,162,163,564,465,366,767,470,371,672,673,774,675,376,577.</Balls><Squares>s04,644,654,664,674 s03,734,724,733.</Squares></Level>";
_root.levelfile_toload = _root.levelfile_toload + "<Level NUmber=\"1\"><Balls>,300,301,202,403,704,405,606,107,710,711,112,413,114,615,216,617,220,321,222,523,124,425,526,427,430,131,132,333,734,435,336,437,540,741,342,443,144,545,146,247,750,251,152,653,154,555,156,357,760,561,662,763,764,465,266,767,170,471,772,573,574,775,776,477.</Balls><Squares>s06,112,113,122,123,132,133 s05,301,311,321,331,341 s05,425,435,445,455,436.</Squares></Level>";
_root.levelfile_toload = _root.levelfile_toload + "<Level NUmber=\"1\"><Balls>,200,301,702,303,404,705,206,607,710,211,512,213,614,215,616,717,120,521,122,723,224,425,226,427,430,731,732,533,234,435,736,537,540,641,442,143,744,745,646,247,350,651,152,253,654,255,356,157,560,261,562,563,264,465,266,167,270,371,172,273,574,175,376,277.</Balls><Squares>s04,551,552,553,543 s09,224,225,226,234,235,236,244,245,246 s03,407,417,427.</Squares></Level>";
_root.levelfile_toload = _root.levelfile_toload + "<Level NUmber=\"1\"><Balls>,400,101,402,503,204,405,406,607,510,611,212,513,614,215,716,117,720,521,722,223,524,125,126,327,530,731,132,733,734,435,236,637,140,541,642,543,544,645,546,747,450,751,752,253,254,355,356,257,760,661,462,563,564,765,166,167,470,571,172,473,274,575,476,277.</Balls><Squares>s04,720,730,740,750 s08,523,522,521,531,541,551,552,553 s06,214,224,234,244,254,264 s04,125,135,145,155.</Squares></Level>";
_root.levelfile_toload = _root.levelfile_toload + "</LevelData>";
}
fscommand ("showmenu", "false");
var disableGameStart = false;
var cheatStatus = 0;
var allBalls;
var key = "test";
var showGameTypeIntro1 = true;
var showGameTypeIntro2 = true;
var showGameTypeIntro3 = true;
var levelfile_toload;
var cells;
var groups;
var bunches;
var randomNumbers;
var score_names;
var score_levels;
var score_scores;
var isBallDataToLoad = false;
var complete = "Complete";
var ballData;
var squareData;
var newSlotName;
var slotselected = 0;
var playerScoreToLoad;
var savedLevelToLoad = 0;
var isSave;
var shapeCount;
var shapePlacementIndex;
var maxGroupSize = 30;
var maxCell = 7;
var minCell = 1;
var topStart = 33;
var leftStart = 320;
var cellWidth = 36;
var cellHeight = 36;
var baseScore = 0;
var speedBallMax = 300;
var invalidMovePenalty_score = 100;
var speedBallCount = 0;
var depth;
var source_x;
var source_y;
var dest_x;
var dest_y;
var totalShapeCount;
var shapes;
var xShape;
var yShape;
var shapesRemoved;
var playerScore = 0;
var gameOn;
var harvestOn;
var pauseOn;
var areyousureOn;
var totalGroups;
var currentGroupNumber;
var harvestScore = 0;
var harvestType;
var highestScore;
var lostballsAnimated = false;
var soundOn = true;
var sound = new Sound();
var windowmodeOn = false;
var selected_mcVisibleState = false;
var helpURL = "http://www.devlabs.com/games/bunch/bunchhelp.htm";
var getfull_link = "http://www.miniclip.com/buy_bunch.htm";
var copyright_clicked_count = 0;
var shapeObjects;
var noMatch;
var gameTypeToLoad;
var selectedshape_name = "";
var selectedshape2_name = "";
var pixelsMoved = 0;
var shapesGrouped;
var levelIncrement = 100;
var maxRottenFruit = 100;
var advertOn = true;
var isEmailSubmitted = false;
var slotNumber;
var firstTime;
var levelData;
var slotData;
var cheatEnabled = false;
var playmove_sound;
var lastClassicLevel = 5;
var lastLevel = 5;
var currentLevel = 1;
var gameLevel = 1;
var newGameLevel = 1;
var timerOn;
var goRottenOnHarvest;
var invalidMovePenalty;
var rottenPenalty;
var rottenFruit;
var biggestGroup;
var mouseStartXPos;
var mouseStartYPos;
var mouseCurrentXPos;
var mouseCurrentYPos;
var xThreshold = 10;
var yThreshold = 10;
var shapeHeld = false;
var collectionTimeRemaining;
var collectionTimeStart;
var collectionTimeEnd;
var collectionTime;
var collections;
var collectMax = 10;
var sequences;
var sequenceCount = 0;
var baseGroupScore = 5;
var timeUsed;
var timeAllowed = 60;
var validRegKey = false;
var customerEmail = "";
var registryValue;
var registryChecked = false;
var checkScreenRegistrySetting = false;
var checkSoundRegistrySetting = false;
var checkKeyRegistrySetting = false;
var checkTimeUsedRegistrySetting = false;
var showFullScreenOnLoad;
var recordTimeUsed = true;
var recordingTime = false;
var spaceBarPressedAtleastOnce = false;
var firstClassicPlayed = true;
var firstPuzzlePlayed = true;
var firstTimeTrialPlayed = true;
var showInGameHelp = false;
_root.getUserSettings();
_root.loadLevelString();
Frame 4
function startGame() {
if (target_mc._visible) {
shape1back_mc._visible = false;
shape2back_mc._visible = false;
shape3back_mc._visible = false;
shape4back_mc._visible = false;
shape5back_mc._visible = false;
shape6back_mc._visible = false;
shape7back_mc._visible = false;
shape1_mc._visible = false;
shape2_mc._visible = false;
shape3_mc._visible = false;
shape4_mc._visible = false;
shape5_mc._visible = false;
shape6_mc._visible = false;
shape7_mc._visible = false;
target_mc._visible = false;
invalid_mc._visible = false;
}
duplicateMovieClip (target_mc, "selected_mc", 100000);
duplicateMovieClip (invalid_mc, "invalidmove_mc", 99999);
gameOn = false;
harvestOn = false;
pauseOn = false;
areyousureOn = false;
currentLevel = 1;
collectionTime = 0;
collections = 0;
buzzerCount = 0;
levelcounter_mc.levelup_mc.level = currentLevel;
shapesGrouped = 0;
endoflevel_mc._visible = false;
switch (gameType) {
case 1 :
_root.timerOn = false;
collectiontimer_mc._visible = false;
gamemode_mc.mode = "PUZZLE";
_root.invalidMovePenalty = false;
_root.invalidMovePenalty_score = 0;
_root.baseScore = 30;
levellabel_mc.gotoAndStop("level");
break;
case 2 :
_root.timerOn = true;
gamemode_mc.mode = "CLASSIC";
_root.collectpoints_mc._visible = true;
collectiontimer_mc._visible = false;
levellabel_mc.gotoAndStop("level");
break;
case 3 :
_root.timerOn = true;
gamemode_mc.mode = "TIME TRIAL";
levellabel_mc._visible = true;
levelcounter_mc._visible = false;
_root.collectpoints_mc._visible = false;
timer_mc.timeLimit = 300;
_root.baseScore = 30;
_root.goRottenOnHarvest = false;
_root.invalidMovePenalty = true;
_root.invalidMovePenalty_score = 10;
_root.rottenPenalty = 2;
levellabel_mc.gotoAndStop("timeleft");
}
if (gameType == 2) {
switch (gameLevel) {
case 1 :
timer_mc.timeLimit = 180;
_root.baseScore = 5;
_root.goRottenOnHarvest = false;
_root.invalidMovePenalty = false;
_root.invalidMovePenalty_score = 0;
_root.rottenPenalty = 0;
break;
case 2 :
timer_mc.timeLimit = 150;
_root.baseScore = 10;
_root.goRottenOnHarvest = false;
_root.invalidMovePenalty = true;
_root.invalidMovePenalty_score = 10;
_root.rottenPenalty = 0;
break;
case 3 :
timer_mc.timeLimit = 120;
_root.baseScore = 30;
_root.goRottenOnHarvest = false;
_root.invalidMovePenalty = true;
_root.invalidMovePenalty_score = 50;
_root.rottenPenalty = 2;
}
}
timer_mc._visible = timerOn;
if (!timerOn) {
leftStart = 180;
} else {
leftStart = 190;
}
highestScore = 0;
playerScore = 0;
rottenFruit = 0;
biggestGroup = 0;
scorecounter_mc.score = 0;
emptycover_mc._visible = false;
if (gameType == 1) {
if (savedLevelToLoad > 0) {
currentLevel = savedLevelToLoad;
playerScore = playerScoreToLoad;
levelcounter_mc.levelup_mc.level = savedLevelToLoad;
scorecounter_mc.score = playerScoreToLoad;
}
loadLevel();
} else {
initialiseCells();
}
}
function initialiseVariables() {
selected_mc._visible = false;
invalidmove_mc._visible = false;
if (cells.length > 0) {
clearCells();
}
if (bunches.length > 0) {
removeSquareBunches();
}
cells = new Array();
shapeCount = new Array();
index = 0;
while (index < 8) {
shapeCount.push(0);
index++;
}
x = 0;
while (x < 8) {
cells.push(new Array(8));
x++;
}
totalShapeCount = 0;
selectedshape_name = "";
selectedshape2_name = "";
pixelsMoved = 0;
}
function restartGame() {
timer_mc.stop();
gotoAndStop (5);
}
function encryptText(input) {
var myText = input;
var result = "";
var code = 0;
var charCount;
var result;
var encChar;
charCount = 0;
while (charCount < key.length) {
code = code + key.charCodeAt(charCount);
charCount++;
}
charCount = 0;
while (charCount < myText.length) {
encChar = myText.charCodeAt(charCount) + code;
result = result + (encChar + "-");
charCount++;
}
return(result.substr(0, result.length - 2));
}
function decryptText(input) {
var myText = input;
var myArray;
var result = "";
var code = 0;
var count;
var charCount;
var result;
myText = input;
charCount = 0;
while (charCount < key.length) {
code = code + key.charCodeAt(charCount);
charCount++;
}
myArray = myText.split("-");
count = 0;
while (count < myArray.length) {
result = result + String.fromCharCode(myArray[count] - code);
count++;
}
return(result);
}
function isTopTenScore(players_score) {
var index;
var isTopTen = false;
index = 0;
while (index < 10) {
if (players_score > Number(_root.score_scores[index])) {
isTopTen = true;
break;
}
index++;
}
return(isTopTen);
}
function saveSlotDataFirstTime(slotSO) {
var index;
var name;
var level;
var score;
slot_names = new Array(10);
slot_levels = new Array(10);
slot_scores = new Array(10);
slot_status = new Array(10);
slot_balldata = new Array(10);
slot_squaredata = new Array(10);
slotSO.data.slotnames = slot_names;
slotSO.data.slotlevels = slot_levels;
slotSO.data.slotscores = slot_scores;
slotSO.data.slotstatus = slot_status;
slotSO.data.balldata = slot_balldata;
slotSO.data.squaredata = slot_squaredata;
index = 0;
while (index < 10) {
slotSO.data.slotnames[index] = "Empty Slot";
slotSO.data.slotlevels[index] = "-";
slotSO.data.slotscores[index] = "-";
slotSO.data.slotstatus[index] = "";
index++;
}
slotSO.data.firsttime = "false";
slotSO.flush(5000);
}
function saveScore(nametosave, scoretosave, leveltosave) {
var index;
var insertion_index = -1;
index = 0;
while (index < 10) {
if (Number(scoretosave) > Number(_root.score_scores[index])) {
insertion_index = index;
break;
}
index++;
}
if (insertion_index >= 0) {
index = 9;
while (index > insertion_index) {
_root.score_names[index] = _root.score_names[index - 1];
_root.score_scores[index] = _root.score_scores[index - 1];
if (gameType != 3) {
_root.score_levels[index] = _root.score_levels[index - 1];
}
index--;
}
_root.score_names[insertion_index] = nametosave;
_root.score_scores[insertion_index] = scoretosave;
var diffLetter;
switch (gameLevel) {
case 1 :
diffLetter = "E";
break;
case 2 :
diffLetter = "M";
break;
case 3 :
diffLetter = "H";
}
if (gameType == 2) {
if (leveltosave >= lastClassicLevel) {
_root.score_levels[insertion_index] = ("Complete (" + diffLetter) + ")";
} else {
_root.score_levels[insertion_index] = ((leveltosave + " (") + diffLetter) + ")";
}
} else if (gameType == 1) {
_root.score_levels[insertion_index] = leveltosave;
}
saveScoreData();
}
}
function saveScoreData() {
var scoresSO = SharedObject.getLocal("bunch_scores", "/");
if (scoresSO.data.firsttime == undefined) {
saveScoreDataFirstTime();
}
index = 0;
while (index < 10) {
scoresSO.data.score[gameType - 1][index] = _root.score_scores[index];
if (gameType != 3) {
scoresSO.data.level[gameType - 1][index] = _root.score_levels[index];
}
scoresSO.data.name[gameType - 1][index] = _root.score_names[index];
index++;
}
scoresSO.flush(1000);
}
function saveScoreDataFirstTime() {
var scoresSO = SharedObject.getLocal("bunch_scores", "/");
var gamenames = new Array();
gamenames.push(new Array(10));
gamenames.push(new Array(10));
gamenames.push(new Array(10));
var gamescores = new Array();
gamescores.push(new Array(10));
gamescores.push(new Array(10));
gamescores.push(new Array(10));
var gamelevels = new Array();
gamelevels.push(new Array(10));
gamelevels.push(new Array(10));
gamelevels.push(new Array(10));
scoresSO.data.score = gamescores;
scoresSO.data.level = gamelevels;
scoresSO.data.name = gamenames;
gameIndex = 0;
while (gameIndex < 3) {
index = 0;
while (index < 10) {
scoresSO.data.score[gameIndex][index] = "0";
scoresSO.data.level[gameIndex][index] = "0";
scoresSO.data.name[gameIndex][index] = "Empty";
index++;
}
gameIndex++;
}
scoresSO.data.firsttime = "false";
scoresSO.flush(1000);
}
function resetScores() {
var scoresSO = SharedObject.getLocal("bunch_scores", "/");
scoresSO.data.firsttime = undefined;
scoresSO.flush(1000);
}
function loadScores(number) {
_root.gameTypeToLoad = number;
var scoresSO = SharedObject.getLocal("bunch_scores", "/");
if (scoresSO.data.firsttime == undefined) {
saveScoreDataFirstTime();
}
var index;
var name;
var level;
var score;
_root.score_names = new Array(10);
_root.score_levels = new Array(10);
_root.score_scores = new Array(10);
index = 0;
while (index < 10) {
name = "mainmenu_mc.scoretab_mc.localscores_mc.name_" + (index + 1);
level = "mainmenu_mc.scoretab_mc.localscores_mc.level_" + (index + 1);
score = "mainmenu_mc.scoretab_mc.localscores_mc.score_" + (index + 1);
_root.score_names[index] = scoresSO.data.name[_root.gameTypeToLoad - 1][index];
mainmenu_mc.scoretab_mc.localscores_mc["name_" + (index + 1)] = _root.score_names[index];
if (gameTypeToLoad != 3) {
_root.score_levels[index] = scoresSO.data.level[_root.gameTypeToLoad - 1][index];
if ((gameTypeToLoad == 1) && (_root.score_levels[index] >= _root.lastLevel)) {
mainmenu_mc.scoretab_mc.localscores_mc["level_" + (index + 1)] = "Complete";
} else {
mainmenu_mc.scoretab_mc.localscores_mc["level_" + (index + 1)] = _root.score_levels[index];
}
} else {
mainmenu_mc.scoretab_mc.localscores_mc["level_" + (index + 1)] = "NA";
}
_root.score_scores[index] = scoresSO.data.score[_root.gameTypeToLoad - 1][index];
mainmenu_mc.scoretab_mc.localscores_mc["score_" + (index + 1)] = _root.score_scores[index];
index++;
}
}
function startPuzzleGame() {
_root.mainmenu_mc.attachMovie("loadinglevel", "loadinglevel1", 1000);
setProperty("_root.mainmenu_mc.loadinglevel1", _x , 13);
setProperty("_root.mainmenu_mc.loadinglevel1", _y , -48);
}
function loadLevel() {
var indexLevel;
var levelXML = new XML();
levelXML.ignoreWhite = true;
levelXML.parseXML(_root.levelfile_toload);
var objNode = levelXML.firstChild;
var objLevel;
_root.levelData = new Array();
indexLevel = 0;
while (indexLevel < lastLevel) {
_root.levelData.push(new Array());
objLevel = objNode.childNodes[indexLevel];
ballData = new String(objLevel.childNodes[0].firstChild.nodeValue);
squareData = new String(objLevel.childNodes[1].firstChild.nodeValue);
_root.levelData[indexLevel][0] = ballData;
_root.levelData[indexLevel][1] = squareData;
indexLevel++;
}
if (isBallDataToLoad) {
loadSlotData();
} else {
openLevel();
}
}
function loadSlotData() {
var slotSO = SharedObject.getLocal("bunch_slots", "/");
_root.slotData = new Array();
_root.slotData.push(new Array());
_root.slotData[0][0] = slotSO.data.balldata[_root.slotselected - 1];
_root.slotData[0][1] = slotSO.data.squaredata[_root.slotselected - 1];
openLevel();
}
function openLevel() {
initialiseVariables();
var shapeNumber;
var x;
var y;
var char;
var index = 0;
if (isBallDataToLoad) {
ballData = slotData[0][0];
squareData = slotData[0][1];
} else {
ballData = levelData[currentLevel - 1][0];
squareData = levelData[currentLevel - 1][1];
}
var dataString = ballData;
do {
char = ballData.charAt(index);
if (char == ",") {
shapeNumber = Number(ballData.charAt(index + 1));
x = Number(ballData.charAt(index + 2));
y = Number(ballData.charAt(index + 3));
cells[x][y] = shapeNumber;
index = index + 4;
} else {
index++;
}
} while (char != ".");
depth = 1;
var totalSquareCount = 1;
var square;
var squareGroup = -1;
var squareCount;
index = 0;
bunches = new Array();
do {
char = squareData.charAt(index);
if (char == "s") {
squareGroup++;
squareCount = 0;
bunches.push(new Array(Number(squareData.charAt(index + 1) add squareData.charAt(index + 2))));
index = index + 3;
} else if (char == ",") {
square = new Object();
square.number = Number(squareData.charAt(index + 1));
square.instanceName = (("square_" + square.number) + "_") + totalSquareCount;
square.xCell = Number(squareData.charAt(index + 2));
square.yCell = Number(squareData.charAt(index + 3));
bunches[squareGroup][squareCount] = square;
squareCount++;
totalSquareCount++;
duplicateMovieClip (eval (("shape" + square.number) + "back_mc"), square.instanceName, depth);
setProperty(square.instanceName, _x , getXCellPos(square.xCell));
setProperty(square.instanceName, _y , getYCellPos(square.yCell));
depth++;
index = index + 4;
} else {
index++;
}
} while (char != ".");
_root.mainmenu_mc.loadinglevel1.removeMovieClip();
placeShapesInCells();
}
function saveSlotName(saveType) {
var slotSO = SharedObject.getLocal("bunch_slots", "/");
if (saveType == "new") {
saveNewSlotData(slotSO);
} else {
saveOldSlotData(slotSO);
}
}
function saveNewSlotData(slotSO) {
var index;
slotSO.data.slotnames[_root.slotselected - 1] = _root.newSlotName;
slotSO.data.slotscores[_root.slotselected - 1] = playerScore;
slotSO.data.slotlevels[_root.slotselected - 1] = currentLevel;
slotSO.data.slotstatus[_root.slotselected - 1] = "newlevel";
slotSO.flush(5000);
if (currentLevel == 1) {
mainmenu_mc.savedslots_mc.gotoAndStop("newslotconfirmed");
} else if (isTopTenScore(playerScore)) {
_root.saveScore(_root.newSlotName, playerScore, currentLevel);
}
}
function saveOldSlotData(slotSO) {
var index;
slotSO.data.slotnames[_root.slotselected - 1] = _root.newSlotName;
slotSO.data.slotscores[_root.slotselected - 1] = playerScore;
slotSO.data.slotlevels[_root.slotselected - 1] = currentLevel;
slotSO.data.slotstatus[_root.slotselected - 1] = "savedlevel";
getCurrentLevelData();
if (_root.ballData != "") {
slotSO.data.balldata[_root.slotselected - 1] = balldata;
slotSO.data.squaredata[_root.slotselected - 1] = squaredata;
}
slotSO.flush(5000);
}
function getCurrentLevelData() {
var x;
var y;
var groupIndex;
var elementIndex;
var square;
ballData = "";
squareData = "";
x = 0;
while (x < 8) {
y = 0;
while (y < 8) {
ballData = ballData + ((("," + String(getShapeNumber(cells[x][y]))) + String(x)) + String(y));
y++;
}
ballData = ballData + " ";
x++;
}
ballData = ballData + ".";
groupIndex = 0;
while (groupIndex < bunches.length) {
if (bunches[groupIndex].length > 9) {
squareData = squareData + ("s" + String(bunches[groupIndex].length));
} else {
squareData = squareData + ("s0" + String(bunches[groupIndex].length));
}
elementIndex = 0;
while (elementIndex < bunches[groupIndex].length) {
square = bunches[groupIndex][elementIndex];
squareData = squareData + ((("," + String(square.number)) + String(square.xCell)) + String(square.yCell));
elementIndex++;
}
squareData = squareData + " ";
groupIndex++;
}
squareData = squareData + ".";
}
function writeStringToFile(stringToWrite, filename) {
_level0.rc = "?";
fscommand ("ARG", "_level0.rc");
fscommand ("ARG", (_level0.ssStartDir + "\\") + filename);
fscommand ("ARG", stringToWrite);
fscommand ("FILESYS2.WRITETOFILE");
}
function initialiseCells() {
var shapeNumber;
var x;
var y;
initialiseVariables();
x = 0;
while (x < 8) {
y = 0;
while (y < 8) {
shapeNumber = getRandomShapeNumber();
cells[x][y] = shapeNumber;
y++;
}
x++;
}
setShapesInCellsWithNoGroups();
placeShapesInCells();
}
function clearCells() {
var instanceName;
x = 0;
while (x < 8) {
y = 0;
while (y < 8) {
if (cells[x][y] != 0) {
removeShape(eval (cells[x][y]));
cells[x][y] = 0;
}
y++;
}
x++;
}
}
function placeShapesInCells() {
var obj;
var index;
var exists;
var randomNumber;
randomNumbers = null;
randomNumbers = new Array(64);
index = 0;
while (index < 64) {
exists = false;
do {
if (!exists) {
randomNumber = Math.floor(Math.random() * 64) + 1;
}
exists = isRandomNumberExist(randomNumber);
if (exists) {
randomNumber++;
}
if (randomNumber > 64) {
randomNumber = 1;
}
} while (exists);
obj = new Object();
obj.number = randomNumber;
obj.x = Math.floor(randomNumber / 8);
obj.y = randomNumber % 8;
if (obj.y == 0) {
if (obj.x != 0) {
obj.x--;
obj.y = 7;
}
} else {
obj.y--;
}
randomNumbers[index] = obj;
index++;
}
depth = 65;
shapePlacementIndex = 0;
gotoAndPlay (20);
}
function createShapeInGrid() {
obj = randomNumbers[shapePlacementIndex];
instanceName = createNewShape(cells[obj.x][obj.y]);
cells[obj.x][obj.y] = instanceName;
setProperty(instanceName, _x , getXCellPos(obj.x));
setProperty(instanceName, _y , getYCellPos(obj.y));
eval (instanceName).xCell = obj.x;
eval (instanceName).yCell = obj.y;
shapePlacementIndex++;
}
function isRandomNumberExist(randomNumber) {
var exists = false;
index = 0;
while (index < 64) {
if (randomNumbers[index].number == randomNumber) {
exists = true;
break;
}
index++;
}
return(exists);
}
function getXCellPos(x) {
var xPos = (leftStart + (x * cellWidth));
return(xPos);
}
function getYCellPos(y) {
var yPos = (topStart + (y * cellHeight));
return(yPos);
}
function initialiseGroups() {
var x;
var y;
var shapeObject;
var index;
shapeObjects = new Array();
index = 0;
while (index < 8) {
shapeObjects.push(new Array(8));
index++;
}
x = 0;
while (x < 8) {
y = 0;
while (y < 8) {
shapeObject = new Object();
shapeObject.shapeInstanceName = cells[x][y];
shapeObject.xCell = x;
shapeObject.yCell = y;
shapeObjects[x][y] = shapeObject;
y++;
}
x++;
}
x = 0;
while (x < 8) {
y = 0;
while (y < 8) {
setShapeObjectsAdjacent(shapeObjects[x][y]);
y++;
}
x++;
}
groups = null;
groups = new Array();
x = 0;
while (x < 8) {
y = 0;
while (y < 8) {
checkShapeInGroup(shapeObjects[x][y]);
y++;
}
x++;
}
}
function checkShapeInGroup(shapeObject) {
var shapeFound;
var instanceName;
var groupNumber = 0;
if ((((shapeObject.topShapeObject != null) || (shapeObject.rightShapeObject != null)) || (shapeObject.bottomShapeObject != null)) || (shapeObject.leftShapeObject != null)) {
shapeFound = false;
groupNumber = 0;
while (groupNumber < groups.length) {
index = 0;
while (index < groups[groupNumber].length) {
instanceName = shapeObject.shapeInstanceName;
if (instanceName == groups[groupNumber][index]) {
shapeFound = true;
}
index++;
}
groupNumber++;
}
if (!shapeFound) {
groups.push(new Array());
groups[groups.length - 1][0] = shapeObject.shapeInstanceName;
addShapeObjectToGroup(shapeObject.topShapeObject);
addShapeObjectToGroup(shapeObject.rightShapeObject);
addShapeObjectToGroup(shapeObject.bottomShapeObject);
addShapeObjectToGroup(shapeObject.leftShapeObject);
}
}
}
function addShapeObjectToGroup(shapeObject) {
if (shapeObject != null) {
var currentGroupNumber = (groups.length - 1);
var shapeFound = false;
var instanceName;
var index;
index = 0;
while (index < groups[currentGroupNumber].length) {
instanceName = shapeObject.shapeInstanceName;
if (instanceName == groups[currentGroupNumber][index]) {
shapeFound = true;
}
index++;
}
if (!shapeFound) {
groups[currentGroupNumber].push(instanceName);
addShapeObjectToGroup(shapeObject.topShapeObject);
addShapeObjectToGroup(shapeObject.rightShapeObject);
addShapeObjectToGroup(shapeObject.bottomShapeObject);
addShapeObjectToGroup(shapeObject.leftShapeObject);
}
}
}
function removeGroups() {
var index1;
var index2;
var obj;
var shapeInstance;
index1 = 0;
while (index1 < groups.length) {
var groupLength = groups[index1].length;
if (groupLength > 2) {
index2 = 0;
while (index2 < groups[index1].length) {
shapeInstance = groups[index1][index2];
shapeCount[getShapeNumber(shapeInstance)]--;
removeShape(shapeInstance);
x = 0;
while (x < 8) {
y = 0;
while (y < 8) {
if (cells[x][y] == shapeInstance) {
cells[x][y] = 0;
break;
}
y++;
}
x++;
}
index2++;
}
}
index1++;
}
if (gameType != 1) {
var oldLevel = currentLevel;
currentLevel = Math.floor(shapesGrouped / levelIncrement) + 1;
levelcounter_mc.levelup_mc.level = currentLevel;
if ((currentLevel > lastClassicLevel) || (cheatEnabled)) {
clearCells();
_root.gotoAndStop("gamecomplete");
} else {
if (gameType == 2) {
if (oldLevel != currentLevel) {
playSound("levelup_fx");
levelcounter_mc.gotoAndPlay("levelup");
}
}
replaceShapesInCells();
}
} else if ((gameType == 1) && (currentLevel >= lastLevel)) {
clearCells();
_root.gotoAndStop("gamecomplete");
} else if ((gameType == 3) && (collections == collectMax)) {
_root.gotoAndStop("timeout");
} else {
clearCells();
gameOn = false;
_root.gotoAndStop("levelcomplete");
}
}
function removeSquareBunches() {
index1 = 0;
while (index1 < bunches.length) {
index2 = 0;
while (index2 < bunches[index1].length) {
removeShape(bunches[index1][index2].instanceName);
index2++;
}
index1++;
}
}
function replaceShapesInCells() {
stop();
var x;
var y;
var shapeNumber;
var instanceName;
var cellscopy = new Array();
x = 0;
while (x < 8) {
cellscopy.push(new Array(8));
y = 0;
while (y < 8) {
cellscopy[x][y] = cells[x][y];
cells[x][y] = getShapeNumber(cells[x][y]);
y++;
}
x++;
}
x = 0;
while (x < 8) {
y = 0;
while (y < 8) {
if (cellscopy[x][y] == 0) {
cells[x][y] = getRandomShapeNumber();
setShapeNotInGroup(x, y);
shapeNumber = cells[x][y];
instanceName = createNewShape(shapeNumber);
cellscopy[x][y] = instanceName;
setProperty(instanceName, _x , getXCellPos(x));
setProperty(instanceName, _y , getYCellPos(y));
eval (instanceName).xCell = x;
eval (instanceName).yCell = y;
} else if (goRottenOnHarvest) {
eval (cellscopy[x][y]).rottenState++;
switch (eval (cellscopy[x][y]).rottenState) {
case 2 :
eval (cellscopy[x][y]).gotoAndStop("rotten1");
break;
case 4 :
eval (cellscopy[x][y]).gotoAndStop("rotten2");
break;
case 6 :
if (rottenPenalty > 0) {
if (rottenPenalty == 2) {
if (playerScore > 100) {
playerScore = playerScore - 100;
} else {
playerScore = 0;
}
}
scorecounter_mc.score = playerScore;
}
rottenFruit++;
shapeCount[getShapeNumber(cellscopy[x][y])]--;
removeShape(cellscopy[x][y]);
cells[x][y] = getRandomShapeNumber();
setShapeNotInGroup(x, y);
shapeNumber = cells[x][y];
instanceName = createNewShape(shapeNumber);
cellscopy[x][y] = instanceName;
setProperty(instanceName, _x , getXCellPos(x));
setProperty(instanceName, _y , getYCellPos(y));
eval (instanceName).xCell = x;
eval (instanceName).yCell = y;
}
}
y++;
}
x++;
}
x = 0;
while (x < 8) {
y = 0;
while (y < 8) {
cells[x][y] = cellscopy[x][y];
y++;
}
x++;
}
initialiseGroups();
timer_mc.scoreMade = harvestScore;
collectpoints_mc.gotoAndStop("collect");
harvestOn = true;
collectionTimeEnd = int(getTimer() / 1000);
collectionTime = collectionTimeEnd - collectionTimeStart;
timer_mc.gotoAndPlay("starttimer");
}
function setShapesInCellsWithNoGroups() {
var x;
var y;
x = 0;
while (x < 8) {
y = 0;
while (y < 8) {
setShapeNotInGroup(x, y);
y++;
}
x++;
}
}
function moveShapesAround() {
x = 0;
while (x < 8) {
y = 0;
while (y < 8) {
xCell = Math.floor(Math.random() * 8);
yCell = Math.floor(Math.random() * 8);
setProperty("_root." + _root.cells[x][y], _x , _root.getXCellPos(xCell));
setProperty("_root." + _root.cells[x][y], _y , _root.getYCellPos(yCell));
setProperty("_root." + _root.cells[xCell][yCell], _x , _root.getXCellPos(x));
setProperty("_root." + _root.cells[xCell][yCell], _y , _root.getYCellPos(y));
temp = _root.cells[x][y];
_root.cells[x][y] = _root.cells[xCell][yCell];
_root.cells[xCell][yCell] = temp;
y++;
}
x++;
}
}
function setShapeNotInGroup(x, y) {
var shapeNumber;
var shapes = 0;
var direction = 0;
shapes = getNumberOfShapesAdjacent(x, y, direction, shapes);
if (shapes > 2) {
do {
shapeNumber = getRandomShapeNumber();
} while (shapeNumber == cells[x][y]);
cells[x][y] = shapeNumber;
setShapeNotInGroup(x, y);
}
}
function setShapeObjectsAdjacent(shapeObject) {
shapeObject.topShapeObject = null;
shapeObject.rightShapeObject = null;
shapeObject.bottomShapeObject = null;
shapeObject.leftShapeObject = null;
x = shapeObject.xCell;
y = shapeObject.yCell;
if (y > 0) {
if (getShapeNumber(shapeObject.shapeInstanceName) == getShapeNumber(shapeObjects[x][y - 1].shapeInstanceName)) {
shapeObject.topShapeObject = shapeObjects[x][y - 1];
}
}
if (y < 7) {
if (getShapeNumber(shapeObject.shapeInstanceName) == getShapeNumber(shapeObjects[x][y + 1].shapeInstanceName)) {
shapeObject.bottomShapeObject = shapeObjects[x][y + 1];
}
}
if (x < 7) {
if (getShapeNumber(shapeObject.shapeInstanceName) == getShapeNumber(shapeObjects[x + 1][y].shapeInstanceName)) {
shapeObject.rightShapeObject = shapeObjects[x + 1][y];
}
}
if (x > 0) {
if (getShapeNumber(shapeObject.shapeInstanceName) == getShapeNumber(shapeObjects[x - 1][y].shapeInstanceName)) {
shapeObject.leftShapeObject = shapeObjects[x - 1][y];
}
}
shapeObjects[x][y] = shapeObject;
}
function getNumberOfShapesAdjacent(x, y, direction, shapes) {
var shapeNumber = cells[x][y];
if (y > 0) {
if (cells[x][y - 1] == shapeNumber) {
shapes++;
direction = 1;
if (shapes < 2) {
shapes = getNumberOfShapesAdjacent(x, y - 1, direction, shapes);
}
}
}
if (y < 7) {
if (getShapeNumber(cells[x][y + 1]) == shapeNumber) {
shapes++;
direction = 2;
if (shapes < 2) {
shapes = getNumberOfShapesAdjacent(x, y + 1, direction, shapes);
}
}
}
if (x < 7) {
if (getShapeNumber(cells[x + 1][y]) == shapeNumber) {
shapes++;
direction = 3;
if (shapes < 2) {
shapes = getNumberOfShapesAdjacent(x + 1, y, direction, shapes);
}
}
}
if (x > 0) {
if (getShapeNumber(cells[x - 1][y]) == shapeNumber) {
shapes++;
direction = 4;
if (shapes < 2) {
shapes = getNumberOfShapesAdjacent(x - 1, y, direction, shapes);
}
}
}
return(shapes);
}
function checkOnDragOut(instanceDragged) {
var instanceToSwap = "";
_root.spaceBarPressedAtleastOnce = true;
var xDiff = Math.abs(_root.mouseCurrentXPos - _root.mouseStartXPos);
var yDiff = Math.abs(_root.mouseCurrentYPos - _root.mouseStartYPos);
var sourceX = eval (instanceDragged).xCell;
var sourceY = eval (instanceDragged).yCell;
if (xDiff >= yDiff) {
if (_root.mouseCurrentXPos < _root.mouseStartXPos) {
if (sourceX > 0) {
instanceToSwap = cells[sourceX - 1][sourceY];
}
} else if (sourceX < 7) {
instanceToSwap = cells[sourceX + 1][sourceY];
}
} else if (_root.mouseCurrentYPos < _root.mouseStartYPos) {
if (sourceY > 0) {
instanceToSwap = cells[sourceX][sourceY - 1];
}
} else if (sourceY < 7) {
instanceToSwap = cells[sourceX][sourceY + 1];
}
if (instanceToSwap != "") {
if (_root.pixelsMoved == 0) {
checkMove(instanceToSwap);
}
}
}
function checkMove(instance_name) {
var isValid = true;
var str1;
var str2;
var tempName;
var index1;
var index2;
harvestOn = false;
selectedshape2_name = instance_name;
if (selectedshape_name == selectedshape2_name) {
return(false);
}
source_x = -1;
source_y = -1;
dest_x = -1;
dest_y = -1;
source_x = eval (selectedshape_name).xCell;
source_y = eval (selectedshape_name).yCell;
dest_x = eval (selectedshape2_name).xCell;
dest_y = eval (selectedshape2_name).yCell;
selected_mc._visible = false;
if (source_x == dest_x) {
if (!(((source_y + 1) == dest_y) || ((source_y - 1) == dest_y))) {
isValid = false;
}
} else if (source_y == dest_y) {
if (!(((source_x + 1) == dest_x) || ((source_x - 1) == dest_x))) {
isValid = false;
}
} else {
isValid = false;
}
if (isValid) {
eval (cells[dest_x][dest_y]).xCell = source_x;
eval (cells[dest_x][dest_y]).yCell = source_y;
eval (cells[source_x][source_y]).xCell = dest_x;
eval (cells[source_x][source_y]).yCell = dest_y;
tempName = cells[dest_x][dest_y];
cells[dest_x][dest_y] = cells[source_x][source_y];
cells[source_x][source_y] = tempName;
if ((!isNextToSameShape(source_x, source_y, cells[source_x][source_y])) && (!isNextToSameShape(dest_x, dest_y, cells[dest_x][dest_y]))) {
isValid = false;
eval (cells[dest_x][dest_y]).xCell = source_x;
eval (cells[dest_x][dest_y]).yCell = source_y;
eval (cells[source_x][source_y]).xCell = dest_x;
eval (cells[source_x][source_y]).yCell = dest_y;
tempName = cells[source_x][source_y];
cells[source_x][source_y] = cells[dest_x][dest_y];
cells[dest_x][dest_y] = tempName;
} else {
shapeObjects[source_x][source_y].shapeInstanceName = cells[source_x][source_y];
shapeObjects[dest_x][dest_y].shapeInstanceName = cells[dest_x][dest_y];
x = 0;
while (x < 8) {
y = 0;
while (y < 8) {
setShapeObjectsAdjacent(shapeObjects[x][y]);
y++;
}
x++;
}
index1 = 0;
while (index1 < groups.length) {
index2 = 0;
while (index2 < groups[index1].length) {
if ((groups[index1][index2] == shapeObjects[dest_x][dest_y].shapeInstanceName) || (groups[index1][index2] == shapeObjects[source_x][source_y].shapeInstanceName)) {
if (groupLength <= 2) {
groups.splice(index1, 1);
index1--;
break;
}
groups[index1].splice(index2, 1);
index2--;
}
index2++;
}
index1++;
}
checkShapeInGroup(shapeObjects[dest_x][dest_y]);
checkShapeInGroup(shapeObjects[source_x][source_y]);
if (pixelsMoved != 0) {
waitforswap_mc.gotoAndPlay("checkswap");
} else {
playmove_sound = false;
gotoAndPlay (13);
}
}
}
if (!isValid) {
selectedshape_name = "";
selectedshape2_name = "";
if (invalidMovePenalty) {
if (playerScore > invalidMovePenalty_score) {
playerScore = playerScore - invalidMovePenalty_score;
} else {
playerScore = 0;
}
scorecounter_mc.score = playerScore;
}
playSound("invalid");
invalidmove_mc._x = getXCellPos(dest_x);
invalidmove_mc._y = getYCellPos(dest_y);
invalidmove_mc._visible = true;
invalidmove_mc.gotoAndPlay("startinvalidmove");
harvestOn = true;
}
return(isValid);
}
function isNextToSameShape(x, y, shapeToCheck) {
var shapeNumber = getShapeNumber(shapeToCheck);
var valid = false;
if (y > 0) {
if (getShapeNumber(cells[x][y - 1]) == shapeNumber) {
valid = true;
}
}
if (y < 7) {
if (getShapeNumber(cells[x][y + 1]) == shapeNumber) {
valid = true;
}
}
if (x < 7) {
if (getShapeNumber(cells[x + 1][y]) == shapeNumber) {
valid = true;
}
}
if (x > 0) {
if (getShapeNumber(cells[x - 1][y]) == shapeNumber) {
valid = true;
}
}
return(valid);
}
function checkHarvest() {
pixelsMoved = 0;
stop();
var groupCount;
var index;
var count;
var groupLength;
var count1 = -1;
var count2 = -1;
if (gameType == 1) {
checkPuzzleLevelComplete();
}
selectedshape_name = "";
selectedshape2_name = "";
harvestOn = true;
}
function checkPuzzleLevelComplete() {
var bunchMatch;
var a1;
var b1;
var xCell;
var yCell;
noMatch = false;
a1 = 0;
while (a1 < bunches.length) {
bunchMatch = true;
b1 = 0;
while (b1 < bunches[a1].length) {
xCell = bunches[a1][b1].xCell;
yCell = bunches[a1][b1].yCell;
if (bunches[a1][b1].number != getShapeNumber(cells[xCell][yCell])) {
bunchMatch = false;
noMatch = true;
}
b1++;
}
b1 = 0;
while (b1 < bunches[a1].length) {
if (bunchMatch) {
eval (bunches[a1][b1].instanceName)._alpha = 100;
} else {
eval (bunches[a1][b1].instanceName)._alpha = 60;
}
b1++;
}
a1++;
}
if ((!collectpoints_mc._visible) && (!noMatch)) {
playSound("puzzlecomplete_fx");
collectpoints_mc.gotoAndStop("collect");
}
collectpoints_mc._visible = !noMatch;
}
function waitForHarvestOn() {
timer_mc.stop();
collectionTimeStart = int(getTimer() / 1000);
_root.waitforharveston_mc.gotoAndPlay("checkharveston");
}
function harvest() {
if (gameType == 1) {
removeSquareBunches();
}
timer_mc.stop();
collections++;
selected_mc._visible = false;
selectedshape_name = "";
selectedshape2_name = "";
allBalls = new Array();
index = 0;
while (index < 8) {
allBalls.push(new Array(8));
index++;
}
lostballsAnimated = false;
bonusScorePlayed = false;
harvestOn = false;
harvestScore = 0;
collectpoints_mc.gotoAndStop("points");
initialiseGroups();
playSound("harvest_start_fx");
shapesRemoved = 0;
totalGroups = groups.length;
currentGroupNumber = 0;
continueHarvest();
gotoAndPlay (8);
}
function continueHarvest() {
var index2;
var groupScore;
var harvestSoundType;
var groupLength = groups[currentGroupNumber].length;
if (groupLength > 2) {
if (shapeCount[getShapeNumber(groups[currentGroupNumber][0])] == groupLength) {
harvestType = "harvest_onetype";
} else if (isGroupInLine(currentGroupNumber)) {
harvestType = "harvest_line";
} else {
harvestType = "harvest";
}
playSound(harvestType + "_fx");
shapesGrouped = shapesGrouped + groupLength;
groupScore = (((groupLength - 3) * 2) + baseScore) * groupLength;
switch (harvestType) {
case "harvest_onetype" :
groupScore = Math.round(groupScore * 3);
break;
case "harvest_line" :
groupScore = Math.round(groupScore * 2);
break;
case "harvest_complete" :
groupScore = groupScore + (groupScore * 2);
}
harvestScore = harvestScore + groupScore;
playerScore = playerScore + groupScore;
scorecounter_mc.score = playerScore;
if (harvestScore > highestScore) {
highestScore = harvestScore;
}
if (groupLength > biggestGroup) {
biggestGroup = groupLength;
}
shapesRemoved = groupLength;
index2 = 0;
while (index2 < groupLength) {
allBalls[eval (groups[currentGroupNumber][index2]).xCell][eval (groups[currentGroupNumber][index2]).yCell] = 1;
eval (groups[currentGroupNumber][index2]).harvestType = harvestType;
eval (groups[currentGroupNumber][index2]).gotoAndPlay("harvest");
index2++;
}
}
}
function isGroupInLine(groupIndex) {
var xArray = new Array();
var yArray = new Array();
var index;
var count;
index = 0;
while (index < groups[groupIndex].length) {
xArray[eval (groups[groupIndex][index]).xCell] = 1;
yArray[eval (groups[groupIndex][index]).yCell] = 1;
index++;
}
isLine = true;
count = 0;
while (count < 8) {
if (xArray[count] != 1) {
isLine = false;
break;
}
count++;
}
if (!isLine) {
isLine = true;
count = 0;
while (count < 8) {
if (yArray[count] != 1) {
isLine = false;
break;
}
count++;
}
}
return(isLine);
}
function isCompleteHarvest() {
var harvestShapeCount = 0;
var index;
var groupLength;
index = 0;
while (index < groups.length) {
groupLength = groups[index].length;
if (groupLength > 2) {
harvestShapeCount = harvestShapeCount + groupLength;
}
index++;
}
return(harvestShapeCount == 64);
}
function getRandomShapeNumber() {
var shapeNumber = (Math.floor(Math.random() * ((maxCell - minCell) + 1)) + minCell);
return(shapeNumber);
}
function getShapeNumber(instanceName) {
var shapeNumber;
var str = new String(instanceName);
if (str.length > 1) {
shapeNumber = str.charAt(6);
} else {
shapeNumber = instanceName;
}
return(shapeNumber);
}
function createNewShape(shapeNumber) {
shapeCount[shapeNumber]++;
totalShapeCount++;
instanceName = (("shape_" + shapeNumber) + "_") + totalShapeCount;
depth++;
switch (shapeNumber) {
case 1 :
duplicateMovieClip (_root.shape1_mc, instanceName, depth);
break;
case 2 :
duplicateMovieClip (_root.shape2_mc, instanceName, depth);
break;
case 3 :
duplicateMovieClip (_root.shape3_mc, instanceName, depth);
break;
case 4 :
duplicateMovieClip (_root.shape4_mc, instanceName, depth);
break;
case 5 :
duplicateMovieClip (_root.shape5_mc, instanceName, depth);
break;
case 6 :
duplicateMovieClip (_root.shape6_mc, instanceName, depth);
break;
case 7 :
duplicateMovieClip (_root.shape7_mc, instanceName, depth);
}
return(instanceName);
}
function removeShape(instanceName) {
removeMovieClip(eval (instanceName));
}
function areYouSure() {
if (pauseOn) {
resumeGame();
}
if (gameOn && (harvestOn)) {
gotoAndStop (19);
} else if (!gameOn) {
clearCells();
if (gameType == 1) {
removeSquareBunches();
}
_root.gotoAndStop("welcome");
}
}
function resumeGame() {
pauseOn = false;
pauseplay_mc.gotoAndStop("pause");
timer_mc.resumeTimer = true;
timer_mc.gotoAndPlay("starttimer");
gotoAndStop (6);
fadeShapes(false);
}
function pauseGame() {
if (_root.harvestOn) {
pauseOn = true;
pauseplay_mc.gotoAndStop("play");
timer_mc.gotoAndPlay("pausetimer");
fadeShapes(true);
gotoAndStop (7);
}
}
function isFirstTimeGameModePlayed() {
if ((gameType == 1) && (firstPuzzlePlayed)) {
return(true);
}
if ((gameType == 2) && (firstClassicPlayed)) {
return(true);
}
if ((gameType == 3) && (firstTimeTrialPlayed)) {
return(true);
}
return(false);
}
function displayInGameHelp() {
_root.showInGameHelp = true;
pauseGame();
}
function fadeShapes(fadestatus) {
var groupIndex;
var elementIndex;
gameOn = !fadestatus;
harvestOn = !fadestatus;
if (fadestatus) {
selected_mcVisibleState = selected_mc._visible;
selected_mc._visible = false;
} else {
selected_mc._visible = selected_mcVisibleState;
}
x = 0;
while (x < 8) {
y = 0;
while (y < 8) {
eval (cells[x][y])._visible = !fadestatus;
y++;
}
x++;
}
if (gameType == 1) {
groupIndex = 0;
while (groupIndex < bunches.length) {
elementIndex = 0;
while (elementIndex < bunches[groupIndex].length) {
eval (bunches[groupIndex][elementIndex].instanceName)._visible = !fadestatus;
elementIndex++;
}
groupIndex++;
}
}
}
function playSound(soundToPlay) {
if (soundOn) {
sound.attachSound(soundToPlay);
sound.start();
}
}
function isNameValid(name) {
return(name.length > 0);
}
function trim(mode, aString) {
if (mode == "left") {
return((((aString.charAt(0) == " ") && (aString.length > 0)) ? (trim("left", aString.slice(1))) : (aString)));
}
if (mode == "right") {
return((((aString.charAt(aString.length - 1) == " ") && (aString.length > 0)) ? (trim("right", aString.slice(0, aString.length - 1))) : (aString)));
}
return(trim("right", trim("left", aString)));
}
function isValidRegKey(regkey) {
if (regkey == "999") {
return(true);
}
return(false);
}
function showPurchasePage() {
getURL ("http://www.devlabs.com", "_blank");
}
function setRegistryValue(field, value) {
registryValue = value;
fscommand ("ARG", "registryValue");
fscommand ("ARG", "HKEY_LOCAL_MACHINE");
fscommand ("ARG", "Software\\DevLabs\\Bunch");
fscommand ("ARG", field);
fscommand ("ARG", value);
fscommand ("REGISTRY.SETSTR");
}
function getRegistryValue(field) {
_root.registryValue = "?";
fscommand ("ARG", "registryValue");
fscommand ("ARG", "HKEY_LOCAL_MACHINE");
fscommand ("ARG", "Software\\DevLabs\\Bunch");
fscommand ("ARG", field);
fscommand ("ARG", "0");
fscommand ("REGISTRY.GETVAL");
}
currentLevel = 1;
playerScore = 0;
shape1back_mc._visible = false;
shape2back_mc._visible = false;
shape3back_mc._visible = false;
shape4back_mc._visible = false;
shape5back_mc._visible = false;
shape6back_mc._visible = false;
shape7back_mc._visible = false;
shape1_mc._visible = false;
shape2_mc._visible = false;
shape3_mc._visible = false;
shape4_mc._visible = false;
shape5_mc._visible = false;
shape6_mc._visible = false;
shape7_mc._visible = false;
target_mc._visible = false;
invalid_mc._visible = false;
stop();
Frame 5
startGame();
Instance of Symbol 330 MovieClip "collectpoints_mc" in Frame 5
onClipEvent (keyDown) {
if ((Key.getCode() == 32) && (_root.gameType != 3)) {
if ((_root.gameType == 2) && (_root.harvestOn)) {
_root.spaceBarPressedAtleastOnce = true;
_root.harvest();
} else if (((_root.gameType == 1) && (this._visible)) && (_root.harvestOn)) {
_root.harvest();
_root.spaceBarPressedAtleastOnce = true;
}
} else if (Key.getCode() == 80) {
if (_root.pauseOn) {
_root.resumeGame();
} else {
_root.pauseGame();
}
}
}
Frame 6
gameOn = true;
harvestOn = true;
areyousureOn = false;
if (gameType == 1) {
_root.collectpoints_mc._visible = !noMatch;
if (_root.isFirstTimeGameModePlayed()) {
_root.displayInGameHelp();
}
}
Frame 8
if (_root.shapesRemoved == 0) {
if (currentGroupNumber >= (totalGroups - 1)) {
fullHarvest = true;
x = 0;
while (x < 8) {
y = 0;
while (y < 8) {
if (allBalls[x][y] != 1) {
fullHarvest = false;
}
y++;
}
x++;
}
if (fullHarvest) {
playerScore = playerScore + harvestScore;
harvestScore = harvestScore + harvestScore;
scorecounter_mc.score = playerScore;
playSound("fullbunch_fx");
fullharvest_mc.gotoAndPlay("begin");
stop();
} else {
removeGroups();
}
} else if ((!lostballsAnimated) && (rottenPenalty == 2)) {
x = 0;
while (x < 8) {
y = 0;
while (y < 8) {
if (eval (cells[x][y]).rottenState == 5) {
eval (cells[x][y]).gotoAndPlay("lostball");
}
y++;
}
x++;
}
lostballsAnimated = true;
} else {
currentGroupNumber++;
continueHarvest();
}
}
Frame 9
gotoAndPlay (8);
Frame 13
var pixelSpeed = 9;
var dx;
var dx2;
var dy;
var dy2;
var moveSound;
if (!playmove_sound) {
playmove_sound = true;
playSound("move");
}
if (source_x == dest_x) {
if (pixelsMoved < cellHeight) {
if (source_y < dest_y) {
dy = getProperty(selectedshape_name, _y) + pixelSpeed;
dy2 = getProperty(selectedshape2_name, _y) - pixelSpeed;
} else {
dy = getProperty(selectedshape_name, _y) - pixelSpeed;
dy2 = getProperty(selectedshape2_name, _y) + pixelSpeed;
}
setProperty(selectedshape_name, _y , dy);
setProperty(selectedshape2_name, _y , dy2);
pixelsMoved = pixelsMoved + pixelSpeed;
} else {
checkHarvest();
}
} else if (pixelsMoved < cellWidth) {
if (source_x < dest_x) {
dx = getProperty(selectedshape_name, _x) + pixelSpeed;
dx2 = getProperty(selectedshape2_name, _x) - pixelSpeed;
} else {
dx = getProperty(selectedshape_name, _x) - pixelSpeed;
dx2 = getProperty(selectedshape2_name, _x) + pixelSpeed;
}
setProperty(selectedshape_name, _x , dx);
setProperty(selectedshape2_name, _x , dx2);
pixelsMoved = pixelsMoved + pixelSpeed;
} else {
checkHarvest();
}
Frame 14
gotoAndPlay (13);
Frame 19
areyousureOn = true;
timer_mc.gotoAndPlay("pausetimer");
fadeShapes(true);
stop();
Frame 20
var instanceName;
harvestOn = false;
if ((gameType == 1) && (shapePlacementIndex == 0)) {
_root.timer_mc._visible = false;
_root.collectpoints_mc._visible = false;
}
if (shapePlacementIndex > 63) {
initialiseGroups();
if ((gameType == 2) || (gameType == 3)) {
timer_mc.gotoAndPlay("begin");
} else if (gameType == 1) {
checkPuzzleLevelComplete();
}
playSound("startgame_fx");
gotoAndStop (6);
}
createShapeInGrid();
Frame 21
gotoAndPlay (20);
Frame 23
gameOn = false;
harvestOn = false;
fadeShapes(true);
stop();
Instance of Symbol 425 MovieClip "gameover_mc" in Frame 23
/* no clip actions */
Symbol 36 MovieClip [loadinglevel] Frame 1
Symbol 36 MovieClip [loadinglevel] Frame 3
_root.gotoAndStop("startgame");
Symbol 50 Button
on (release) {
getURL ("http://www.miniclip.com", "_blank");
}
Symbol 59 Button
on (release) {
getURL ("http://www.devlabs.com/default.asp?game=bunch", "_blank");
}
Symbol 74 MovieClip Frame 110
_root.gotoAndStop("devlabsintro");
stop();
Symbol 80 MovieClip Frame 42
_root.gotoAndStop("welcome");
Symbol 82 MovieClip Frame 1
stop();
Symbol 82 MovieClip Frame 2
var startTime = int(getTimer() / 1000);
var timePlayed;
Symbol 82 MovieClip Frame 3
timePlayed = int(getTimer() / 1000) - startTime;
if (timePlayed >= 60) {
_root.timeUsed = Number(_root.timeUsed) + 1;
_root.setRegistryValue("TU", _root.timeUsed);
startTime = int(getTimer() / 1000);
}
Symbol 82 MovieClip Frame 4
gotoAndPlay (3);
Symbol 88 Button
on (press) {
if (_root.harvestOn) {
if (_root.selectedshape_name == "") {
_root.selectedshape_name = this._name;
_root.selected_mc.gotoAndPlay(1);
_root.selected_mc._visible = true;
_root.selected_mc._x = this._x;
_root.selected_mc._y = this._y;
_root.mouseStartXPos = _root._xmouse;
_root.mouseStartYPos = _root._ymouse;
_root.shapeHeld = true;
} else if ((_root.selectedshape_name == this._name) && (_root.pixelsMoved == 0)) {
_root.selected_mc._visible = false;
_root.selectedshape_name = "";
_root.selectedshape2_name = "";
} else if (_root.pixelsMoved == 0) {
_root.checkMove(this._name);
}
}
}
on (release) {
_root.mouseCurrentXPos = _root._xmouse;
_root.mouseCurrentYPos = _root._ymouse;
_root.shapeHeld = false;
}
on (dragOut) {
if (_root.harvestOn && (_root.selectedshape_name == this._name)) {
_root.mouseCurrentXPos = _root._xmouse;
_root.mouseCurrentYPos = _root._ymouse;
_root.shapeHeld = false;
_root.checkOnDragOut(this._name);
}
}
Symbol 110 MovieClip Frame 1
var harvestType;
var rottenState = 0;
stop();
Symbol 110 MovieClip Frame 8
gotoAndStop (1);
Symbol 110 MovieClip Frame 12
if (harvestType == "harvest") {
_root.shapesRemoved--;
stop();
} else if (harvestType == "harvest_onetype") {
gotoAndPlay (41);
} else if (harvestType == "harvest_complete") {
gotoAndPlay (26);
} else if (harvestType == "harvest_line") {
gotoAndPlay (12);
}
Symbol 110 MovieClip Frame 25
_root.shapesRemoved--;
stop();
Symbol 110 MovieClip Frame 40
_root.shapesRemoved--;
stop();
Symbol 110 MovieClip Frame 54
_root.shapesRemoved--;
stop();
Symbol 110 MovieClip Frame 70
stop();
Symbol 116 MovieClip Frame 1
var rottenState = 0;
stop();
Symbol 116 MovieClip Frame 8
gotoAndStop (1);
Symbol 116 MovieClip Frame 12
if (harvestType == "harvest") {
_root.shapesRemoved--;
stop();
} else if (harvestType == "harvest_onetype") {
gotoAndPlay (41);
} else if (harvestType == "harvest_complete") {
gotoAndPlay (26);
} else if (harvestType == "harvest_line") {
gotoAndPlay (12);
}
Symbol 116 MovieClip Frame 25
_root.shapesRemoved--;
stop();
Symbol 116 MovieClip Frame 40
_root.shapesRemoved--;
stop();
Symbol 116 MovieClip Frame 55
_root.shapesRemoved--;
stop();
Symbol 116 MovieClip Frame 71
stop();
Symbol 122 MovieClip Frame 1
var rottenState = 0;
stop();
Symbol 122 MovieClip Frame 8
gotoAndStop (1);
Symbol 122 MovieClip Frame 12
if (harvestType == "harvest") {
_root.shapesRemoved--;
stop();
} else if (harvestType == "harvest_onetype") {
gotoAndPlay (41);
} else if (harvestType == "harvest_complete") {
gotoAndPlay (26);
} else if (harvestType == "harvest_line") {
gotoAndPlay (12);
}
Symbol 122 MovieClip Frame 25
_root.shapesRemoved--;
stop();
Symbol 122 MovieClip Frame 40
_root.shapesRemoved--;
stop();
Symbol 122 MovieClip Frame 54
_root.shapesRemoved--;
stop();
Symbol 122 MovieClip Frame 70
stop();
Symbol 128 MovieClip Frame 1
var rottenState = 0;
stop();
Symbol 128 MovieClip Frame 8
gotoAndStop (1);
Symbol 128 MovieClip Frame 12
if (harvestType == "harvest") {
_root.shapesRemoved--;
stop();
} else if (harvestType == "harvest_onetype") {
gotoAndPlay (41);
} else if (harvestType == "harvest_complete") {
gotoAndPlay (26);
} else if (harvestType == "harvest_line") {
gotoAndPlay (12);
}
Symbol 128 MovieClip Frame 25
_root.shapesRemoved--;
stop();
Symbol 128 MovieClip Frame 40
_root.shapesRemoved--;
stop();
Symbol 128 MovieClip Frame 54
_root.shapesRemoved--;
stop();
Symbol 128 MovieClip Frame 70
stop();
Symbol 134 MovieClip Frame 1
var rottenState = 0;
stop();
Symbol 134 MovieClip Frame 8
gotoAndStop (1);
Symbol 134 MovieClip Frame 12
if (harvestType == "harvest") {
_root.shapesRemoved--;
stop();
} else if (harvestType == "harvest_onetype") {
gotoAndPlay (41);
} else if (harvestType == "harvest_complete") {
gotoAndPlay (26);
} else if (harvestType == "harvest_line") {
gotoAndPlay (12);
}
Symbol 134 MovieClip Frame 25
_root.shapesRemoved--;
stop();
Symbol 134 MovieClip Frame 40
_root.shapesRemoved--;
stop();
Symbol 134 MovieClip Frame 54
_root.shapesRemoved--;
stop();
Symbol 134 MovieClip Frame 70
stop();
Symbol 140 MovieClip Frame 1
var rottenState = 0;
stop();
Symbol 140 MovieClip Frame 8
gotoAndStop (1);
Symbol 140 MovieClip Frame 12
if (harvestType == "harvest") {
_root.shapesRemoved--;
stop();
} else if (harvestType == "harvest_onetype") {
gotoAndPlay (41);
} else if (harvestType == "harvest_complete") {
gotoAndPlay (26);
} else if (harvestType == "harvest_line") {
gotoAndPlay (12);
}
Symbol 140 MovieClip Frame 25
_root.shapesRemoved--;
stop();
Symbol 140 MovieClip Frame 40
_root.shapesRemoved--;
stop();
Symbol 140 MovieClip Frame 54
_root.shapesRemoved--;
stop();
Symbol 140 MovieClip Frame 70
stop();
Symbol 146 MovieClip Frame 1
var rottenState = 0;
stop();
Symbol 146 MovieClip Frame 8
gotoAndStop (1);
Symbol 146 MovieClip Frame 12
if (harvestType == "harvest") {
_root.shapesRemoved--;
stop();
} else if (harvestType == "harvest_onetype") {
gotoAndPlay (41);
} else if (harvestType == "harvest_complete") {
gotoAndPlay (26);
} else if (harvestType == "harvest_line") {
gotoAndPlay (12);
}
Symbol 146 MovieClip Frame 25
_root.shapesRemoved--;
stop();
Symbol 146 MovieClip Frame 40
_root.shapesRemoved--;
stop();
Symbol 146 MovieClip Frame 54
_root.shapesRemoved--;
stop();
Symbol 146 MovieClip Frame 70
stop();
Symbol 153 MovieClip Frame 1
stop();
Symbol 153 MovieClip Frame 2
if ((_root.playerScore != 0) && (_root.gameType != 1)) {
if ((_root.gameType == 3) || ((_root.gameType == 2) && (_root.gameLevel == 2))) {
gotoAndPlay (27);
} else if ((_root.gameType == 2) && (_root.gameLevel == 3)) {
gotoAndPlay (52);
}
}
Symbol 153 MovieClip Frame 25
stop();
Symbol 153 MovieClip Frame 50
stop();
Symbol 153 MovieClip Frame 75
stop();
Symbol 161 Button
on (release) {
_root.gotoAndStop("startgame");
}
Symbol 164 Button
on (release) {
if (!areyousureOn) {
areYouSure();
}
}
Symbol 170 MovieClip Frame 1
stop();
Symbol 179 Button
on (release) {
_root.playSound("standard_click_fx");
_root.gameType = 2;
_root.gameLevel = 1;
gotoAndStop (2);
}
Symbol 184 Button
on (release) {
if (!_root.disableGameStart) {
_root.playSound("standard_click_fx");
_root.gotoAndStop("tutorial");
}
}
Symbol 190 Button
on (release) {
_root.playSound("standard_click_fx");
_root.isSave = true;
_root.gameType = 1;
_root.currentLevel = 1;
_root.savedLevelToLoad = 0;
_root.isBallDataToLoad = false;
gotoAndStop (3);
}
Symbol 202 Button
on (release) {
getURL (_root.getfull_link, "_blank");
}
Symbol 207 Button
on (press) {
if (!_root.windowmodeOn) {
_root.windowmodeOn = true;
fscommand ("exec", "jcommand_3Anofullscreen");
}
_root.gotoWebsite();
}
Symbol 210 Button
on (press) {
_root.playSound("standard_click_fx");
gotoAndStop (5);
}
Symbol 222 Button
on (release) {
_root.gotoAndStop("startgame");
}
Symbol 225 Button
on (release) {
_root.playSound("mainmenu_click_fx");
_parent.gotoAndStop(1);
}
Symbol 229 Button
on (release) {
_root.startPuzzleGame();
}
Symbol 238 Button
on (release) {
_root.copyright_clicked_count++;
if (_root.copyright_clicked_count > 3) {
flashplayerversion = getVersion();
}
}
Symbol 240 Button
on (press) {
if (!_root.windowmodeOn) {
_root.windowmodeOn = true;
fscommand ("exec", "jcommand_3Anofullscreen");
}
_root.gotoWebsite();
}
Symbol 242 MovieClip Frame 1
stop();
Symbol 248 Button
on (release) {
_root.playSound("standard_click_fx");
_root.showPurchasePage();
}
Symbol 251 Button
on (release) {
_root.playSound("standard_click_fx");
lastframe = "timeleft";
gotoAndStop (4);
}
Symbol 254 Button
on (release) {
_root.playSound("standard_click_fx");
_root.recordTimeUsed = true;
gotoAndStop (1);
}
Symbol 256 Button
on (release) {
_root.playSound("standard_click_fx");
lastframe = "timeexpired";
gotoAndStop (4);
}
Symbol 264 Button
on (release) {
_root.playSound("standard_click_fx");
productkey = _root.trim("", productkey);
if (_root.isNameValid(productkey)) {
if (!_root.isValidRegKey(productkey)) {
invalidkeycaption = "You entered an invalid key!";
productkey = "";
} else {
_root.disableGameStart = false;
_root.validRegKey = true;
_root.setRegistryValue("RegKey", productkey);
fscommand ("Win.SetCaption", "Bunch");
gotoAndStop (1);
}
}
}
Symbol 269 Button
on (release) {
gotoAndStop(lastframe);
}
Symbol 274 Button
on (release) {
_root.playSound("standard_click_fx");
_root.gotoAndStop("tutorial");
}
Symbol 277 Button
on (release) {
_root.playSound("mainmenu_click_fx");
gotoAndStop (1);
}
Symbol 278 MovieClip Frame 1
if (_root.firstTime) {
gotoAndStop (5);
}
stop();
Symbol 278 MovieClip Frame 2
timeleftcaption = ("You currently have " + (_root.timeAllowed - _root.timeUsed)) + " minutes of playing time left.";
fscommand ("Win.SetCaption", "Bunch - trial version");
Symbol 278 MovieClip Frame 3
_root.disableGameStart = true;
Symbol 278 MovieClip Frame 4
invalidkeycaption = "";
productkey = "";
Selection.setFocus("productkey");
Symbol 278 MovieClip Frame 5
_root.firstTime = false;
var userSO = SharedObject.getLocal("bunch_settings", "/");
userSO.data.firsttime = false;
userSO.flush();
Symbol 290 MovieClip Frame 1
var lastTimeRecorded = int(getTimer() / 1000);
stop();
Symbol 290 MovieClip Frame 2
var timeLimit;
var scoreMade;
setProperty("bar", _visible , true);
setProperty("redbar", _visible , false);
var bartype = "bar";
var barset = false;
var input;
var zeero = int(getTimer() / 1000);
var zeeroTimeTrial = int(getTimer() / 1000);
var currentTime;
var weightScoreIncrement = 1000;
var counter = 0;
var secondcounter = 0;
var countMax = 25;
var resumeTimer = false;
var passedTime = 0;
Symbol 290 MovieClip Frame 3
if ((_root.playerScore > 0) || (resumeTimer)) {
switch (_root.gameLevel) {
case 1 :
difficultyWeight = 2 + (_root.currentLevel * 2);
break;
case 2 :
difficultyWeight = 7 + (_root.currentLevel * 3);
break;
case 3 :
difficultyWeight = 15 + (_root.currentLevel * 4);
}
secondcounter = 0;
if (this.resumeTimer) {
zeero = zeero + passedTime;
zeeroTimeTrial = zeeroTimeTrial + passedTime;
} else if (_root.gameType == 2) {
zeero = zeero + Math.round(this.scoreMade / difficultyWeight);
}
currentTime = int(getTimer() / 1000);
if (zeero >= currentTime) {
zeero = currentTime;
}
} else {
input = timeLimit;
output = input;
}
if (_root.gameType == 3) {
if (!resumeTimer) {
zeeroTimeTrial = int(getTimer() / 1000);
zeero = zeero + _root.collectionTime;
}
}
resumeTimer = false;
Symbol 290 MovieClip Frame 4
if (_root.gameType != 1) {
lastTimeRecorded = int(getTimer() / 1000);
if (Number(output) > 0) {
display = lastTimeRecorded - zeero;
output = input - display;
percent = (output / input) * 100;
if (percent <= 7) {
if (!barset) {
setProperty("bar", _visible , false);
setProperty("redbar", _visible , true);
bartype = "redbar";
}
barset = true;
countMax = Math.floor(output) + 1;
if (secondcounter >= countMax) {
secondcounter = 0;
}
if (secondcounter == 0) {
_root.playSound("beep");
}
secondcounter++;
} else {
if (barset) {
setProperty("redbar", _visible , false);
setProperty("bar", _visible , true);
bartype = "bar";
}
barset = false;
}
setProperty(bartype, _xscale , percent);
}
if (_root.gameType == 3) {
_root.collectionTimeRemaining = 30 - (lastTimeRecorded - zeeroTimeTrial);
if (_root.collectionTimeRemaining < 10) {
_root.collectiontimer_mc.timer2 = "0:0";
} else {
_root.collectiontimer_mc.timer2 = "0:";
}
_root.collectiontimer_mc.timer2 = _root.collectiontimer_mc.timer2 + String(_root.collectionTimeRemaining);
if (_root.collectionTimeRemaining == 3) {
if (_root.buzzerCount < 1) {
_root.buzzerCount++;
_root.playSound("timebuzzer_fx");
}
} else if (_root.collectionTimeRemaining == 2) {
if (_root.buzzerCount < 2) {
_root.buzzerCount++;
_root.playSound("timebuzzer_fx");
}
} else if (_root.collectionTimeRemaining == 1) {
if (_root.buzzerCount < 3) {
_root.buzzerCount++;
_root.playSound("timebuzzer_fx");
}
}
if (_root.collectionTimeRemaining <= 0) {
_root.buzzerCount = 0;
_root.waitForHarvestOn();
}
}
if (Number(output) <= 0) {
stop();
if ((_root.gameType == 3) && (_root.collections < _root.collectMax)) {
_root.waitForHarvestOn();
} else {
_root.gotoAndPlay("timeout");
}
}
}
Symbol 290 MovieClip Frame 5
if (_root.isFirstTimeGameModePlayed()) {
_root.displayInGameHelp();
}
gotoAndPlay (4);
Symbol 290 MovieClip Frame 6
passedTime = int(getTimer() / 1000) - lastTimeRecorded;
Symbol 290 MovieClip Frame 7
gotoAndPlay (6);
Symbol 298 Button
on (release) {
if (!areyousureOn) {
_root.playSound("standard_click_fx");
areYouSure();
}
}
on (keyPress "<Tab>") {
if (Selection.getFocus() == "_level0.quit_btn") {
Selection.setFocus("_level0.pause_btn");
} else if (Selection.getFocus() == "_level0.pause_btn") {
Selection.setFocus("_level0.quit_btn");
} else {
Selection.setFocus("_level0.pause_btn");
}
}
on (keyPress "<Left>") {
if (Selection.getFocus() == "_level0.quit_btn") {
Selection.setFocus("_level0.pause_btn");
} else if (Selection.getFocus() == "_level0.pause_btn") {
Selection.setFocus("_level0.quit_btn");
} else {
Selection.setFocus("_level0.pause_btn");
}
}
on (keyPress "<Right>") {
if (Selection.getFocus() == "_level0.quit_btn") {
Selection.setFocus("_level0.pause_btn");
} else if (Selection.getFocus() == "_level0.pause_btn") {
Selection.setFocus("_level0.quit_btn");
} else {
Selection.setFocus("_level0.pause_btn");
}
}
on (keyPress "<Up>") {
if (Selection.getFocus() == "_level0.quit_btn") {
Selection.setFocus("_level0.pause_btn");
} else if (Selection.getFocus() == "_level0.pause_btn") {
Selection.setFocus("_level0.quit_btn");
} else {
Selection.setFocus("_level0.pause_btn");
}
}
on (keyPress "<Down>") {
if (Selection.getFocus() == "_level0.quit_btn") {
Selection.setFocus("_level0.pause_btn");
} else if (Selection.getFocus() == "_level0.pause_btn") {
Selection.setFocus("_level0.quit_btn");
} else {
Selection.setFocus("_level0.pause_btn");
}
}
Symbol 302 MovieClip Frame 1
stop();
Symbol 302 MovieClip Frame 127
gotoAndStop (1);
Symbol 310 MovieClip Frame 1
stop();
Symbol 313 Button
on (release) {
_root.playSound("standard_click_fx");
_root.showInGameHelp = false;
_root.pauseGame();
}
Symbol 317 MovieClip Frame 1
stop();
Symbol 317 MovieClip Frame 38
gotoAndStop (1);
Symbol 324 Button
on (press) {
if (!_root.spaceBarPressedAtleastOnce) {
spacebar_tooltip_mc.gotoAndStop(1);
}
if (_root.harvestOn && (!root.pauseOn)) {
_root.harvest();
}
}
on (rollOver) {
if (!_root.spaceBarPressedAtleastOnce) {
spacebar_tooltip_mc.gotoAndStop(2);
}
}
on (rollOut, dragOut) {
if (!_root.spaceBarPressedAtleastOnce) {
spacebar_tooltip_mc.gotoAndStop(1);
}
}
Symbol 327 MovieClip Frame 1
stop();
Symbol 330 MovieClip Frame 1
stop();
Symbol 331 MovieClip Frame 1
stop();
Symbol 331 MovieClip Frame 2
if (_root.harvestOn) {
_root.harvest();
stop();
}
Symbol 331 MovieClip Frame 3
gotoAndPlay (2);
Symbol 332 MovieClip Frame 1
stop();
Symbol 332 MovieClip Frame 2
_root.moveShapesAround();
Symbol 332 MovieClip Frame 4
_root.moveShapesAround();
Symbol 332 MovieClip Frame 6
_root.moveShapesAround();
Symbol 332 MovieClip Frame 8
_root.moveShapesAround();
Symbol 332 MovieClip Frame 10
_root.moveShapesAround();
Symbol 332 MovieClip Frame 12
_root.moveShapesAround();
Symbol 332 MovieClip Frame 14
_root.moveShapesAround();
Symbol 332 MovieClip Frame 16
_root.moveShapesAround();
Symbol 332 MovieClip Frame 18
_root.moveShapesAround();
Symbol 332 MovieClip Frame 20
_root.moveShapesAround();
Symbol 332 MovieClip Frame 21
_root.removeGroups();
stop();
Symbol 335 Button
on (release) {
_root.playSound("standard_click_fx");
_root.resumeGame();
}
Symbol 338 Button
on (rollOver) {
savegame_tooltip_mc.gotoAndStop(2);
startDrag ("savegame_tooltip_mc", true);
}
on (rollOut, dragOut) {
stopDrag();
savegame_tooltip_mc.gotoAndStop(1);
}
Symbol 341 Button
on (rollOver) {
resetgame_tooltip_mc.gotoAndStop(2);
startDrag ("resetgame_tooltip_mc", true);
}
on (rollOut, dragOut) {
stopDrag();
resetgame_tooltip_mc.gotoAndStop(1);
}
Symbol 344 MovieClip Frame 1
stop();
Symbol 346 MovieClip Frame 1
stop();
Symbol 349 Button
on (release) {
_root.playSound("standard_click_fx");
_root.resumeGame();
}
Symbol 350 Button
on (release) {
_root.playSound("standard_click_fx");
_root.isBallDataToLoad = false;
_root.savedLevelToLoad = _root.currentLevel;
_root.playerScoreToLoad = _root.playerScore;
gotoAndStop (3);
}
Symbol 351 Button
on (rollOver) {
savegame_tooltip_fullonly_mc.gotoAndStop(2);
startDrag ("savegame_tooltip_fullonly_mc", true);
}
on (rollOut, dragOut) {
stopDrag();
savegame_tooltip_fullonly_mc.gotoAndStop(1);
}
Symbol 353 MovieClip Frame 1
stop();
Symbol 354 MovieClip Frame 1
Symbol 354 MovieClip Frame 10
_root.gotoAndStop("startgame");
Symbol 358 Button
on (release) {
_root.playSound("standard_click_fx");
gotoAndStop (2);
}
Symbol 364 Button
on (release) {
_root.playSound("standard_click_fx");
gotoAndStop (3);
}
Symbol 372 Button
on (release) {
_root.playSound("standard_click_fx");
_root.resumeGame();
}
Symbol 377 MovieClip Frame 1
stop();
Symbol 378 Button
on (release) {
_root.playSound("standard_click_fx");
gotoAndStop (2);
}
Symbol 381 Button
on (release) {
_root.playSound("standard_click_fx");
gotoAndStop (3);
}
Symbol 388 MovieClip Frame 1
stop();
Symbol 389 Button
on (release) {
_root.playSound("standard_click_fx");
gotoAndStop (2);
}
Symbol 392 Button
on (release) {
_root.playSound("standard_click_fx");
gotoAndStop (3);
}
Symbol 396 MovieClip Frame 1
stop();
Symbol 396 MovieClip Frame 3
_root.playSound("puzzlecomplete_fx");
Symbol 397 MovieClip Frame 1
if (_root.showInGameHelp) {
var userSO = SharedObject.getLocal("bunch_settings", "/");
switch (_root.gameType) {
case 1 :
_root.firstPuzzlePlayed = false;
userSO.data.firstPuzzlePlayed = false;
gotoAndStop (6);
break;
case 2 :
_root.firstClassicPlayed = false;
userSO.data.firstClassicPlayed = false;
gotoAndStop (4);
break;
case 3 :
_root.firstTimeTrialPlayed = false;
userSO.data.firstTimeTrialPlayed = false;
gotoAndStop (5);
}
userSO.flush(100);
} else if (_root.gameType == 1) {
gotoAndStop (2);
} else {
stop();
}
Symbol 397 MovieClip Frame 4
_root.timer_mc.gotoAndPlay("pausetimer");
Symbol 397 MovieClip Frame 5
_root.timer_mc.gotoAndPlay("pausetimer");
Instance of Symbol 397 MovieClip in Symbol 398 MovieClip Frame 1
onClipEvent (load) {
if (_root.soundOn) {
soundon_mc.gotoAndStop("on");
soundoff_mc.gotoAndStop("off");
} else {
soundon_mc.gotoAndStop("off");
soundoff_mc.gotoAndStop("on");
}
if (_root.windowmodeOn) {
windowmode_mc.gotoAndStop("on");
fullmode_mc.gotoAndStop("off");
} else {
windowmode_mc.gotoAndStop("off");
fullmode_mc.gotoAndStop("on");
}
}
Symbol 403 Button
on (release) {
_root.playSound("mainmenu_click_fx");
_root.gotoAndStop("welcome");
}
Symbol 404 Button
on (release) {
_root.playSound("standard_click_fx");
_root.timer_mc.resumeTimer = true;
_root.timer_mc.gotoAndPlay("starttimer");
_root.fadeShapes(false);
_root.gotoAndStop("gamestarted");
}
Symbol 405 MovieClip Frame 1
stop();
Symbol 412 Button
on (release) {
_root.playSound("standard_click_fx");
_root.restartGame();
}
Symbol 415 Button
on (release) {
getURL (_root.getfull_link, "_blank");
}
Symbol 425 MovieClip Frame 2
_root.timer_mc._visible = false;
_root.collectpoints_mc._visible = false;
if (_root.gameType == 3) {
_root.collectiontimer_mc.timer2 = "0:00";
}
Symbol 425 MovieClip Frame 10
_root.playSound("timeout_fx");
Symbol 425 MovieClip Frame 48
this.highestscoringharvest = _root.highestScore;
Symbol 425 MovieClip Frame 59
this.biggestbunch = _root.biggestGroup;
Symbol 425 MovieClip Frame 70
this.finalscore = _root.playerScore;
stop();
Symbol 431 Button
on (release) {
_root.playSound("standard_click_fx");
_root.levelcounter_mc.levelup_mc.level = _root.currentLevel;
_root.isBallDataToLoad = false;
_root.openLevel();
_root.gotoAndStop("gamestarted");
}
Symbol 440 MovieClip Frame 1
_root.currentLevel = _root.currentLevel + 1;
Symbol 440 MovieClip Frame 5
_root.playSound("levelup_fx");
Symbol 440 MovieClip Frame 27
this.lc_levelscore = _root.harvestScore;
Symbol 440 MovieClip Frame 38
this.lc_totalscore = _root.playerScore;
Symbol 440 MovieClip Frame 49
this.lc_nextlevel = _root.currentLevel;
stop();
Symbol 447 Button
on (release) {
_root.playSound("standard_click_fx");
_root.gotoAndStop("advert");
}
Symbol 452 MovieClip Frame 1
this.gc_levelscore = _root.harvestScore;
this.gc_totalscore = _root.playerScore;
Symbol 452 MovieClip Frame 2
this.highestscoringharvest = _root.highestScore;
this.gc_biggestbunch = _root.biggestGroup;
this.gc_totalscore = _root.playerScore;
Symbol 453 MovieClip Frame 1
if (_root.gameType == 1) {
_root.currentLevel = _root.lastLevel;
} else {
_root.timer_mc._visible = false;
_root.currentLevel = _root.lastClassicLevel;
_root.levelcounter_mc.levelup_mc.level = _root.lastClassicLevel;
}
Symbol 453 MovieClip Frame 2
_root.playSound("gamecomplete_fx");
Symbol 453 MovieClip Frame 16
stop();
if (_root.gameType == 1) {
gc_stats_mc.gotoAndStop("gc_puzzle");
} else {
gc_stats_mc.gotoAndStop("gc_classic");
}
Symbol 460 Button
on (release) {
_root.playSound("standard_click_fx");
nextFrame();
}
Symbol 466 MovieClip Frame 66
_root.playSound("move");
Symbol 466 MovieClip Frame 131
_root.playSound("invalid");
tutorial_invalidmove_mc1.gotoAndPlay("forceinvalidmove");
Symbol 468 Button
on (release) {
_root.playSound("standard_click_fx");
prevFrame();
}
Symbol 471 MovieClip Frame 41
_root.playSound("harvest_start_fx");
Symbol 471 MovieClip Frame 46
_root.playSound("harvest_fx");
Symbol 471 MovieClip Frame 51
_root.playSound("harvest_fx");
Symbol 471 MovieClip Frame 56
_root.playSound("harvest_fx");
Symbol 474 MovieClip Frame 53
_root.playSound("move");
Symbol 474 MovieClip Frame 56
Symbol 474 MovieClip Frame 80
_root.playSound("move");
Symbol 474 MovieClip Frame 83
Symbol 474 MovieClip Frame 106
_root.playSound("move");
Symbol 474 MovieClip Frame 109
Symbol 474 MovieClip Frame 132
_root.playSound("move");
Symbol 474 MovieClip Frame 135
Symbol 477 MovieClip Frame 32
_root.playSound("harvest_start_fx");
Symbol 477 MovieClip Frame 35
_root.playSound("harvest_line_fx");
Symbol 480 MovieClip Frame 32
_root.playSound("harvest_start_fx");
Symbol 480 MovieClip Frame 35
_root.playSound("harvest_onetype_fx");
Symbol 485 MovieClip Frame 1
stop();
Symbol 488 Button
on (release) {
_root.playSound("mainmenu_click_fx");
_root.gotoAndStop("welcome");
}
Symbol 500 Button
on (release) {
_root.playSound("mainmenu_click_fx");
_root.gotoAndStop("welcome");
}