[Tools][Expand/Collapse All]Note that automatic extraction of ActionScript 3 is still pretty much unsupported by swfchan. AS1/AS2 works okay most of the time.Frame 1 (8 B)
stop();
Frame 2 (6.77 KiB) ● ●
function getPlayerVersion() {
var _local1 = getVersion();
myLength = length(_local1);
while (i <= myLength) {
i = i + 1;
temp = substring(_local1, i, 1);
if (temp eq " ") {
platform = substring(_local1, 1, i - 1);
majorVersion = substring(_local1, i + 1, 1);
secondHalf = substring(_local1, i + 1, myLength - i);
minorVersion = substring(secondHalf, 5, 2);
}
}
}
function getUserSettings() {
var _local2 = _root;
var _local1 = SharedObject.getLocal("bunch_settings", "/");
if (_local1.data.firsttime == undefined) {
_local1.data.firsttime = true;
_local1.data.soundOn = true;
_local1.data.firstPuzzlePlayed = true;
_local1.data.firstClassicPlayed = true;
_local1.data.firstTimeTrialPlayed = true;
_local1.flush(100);
} else {
_local2.firsttime = Boolean(_local1.data.firsttime);
_local2.soundOn = Boolean(_local1.data.soundOn);
_local2.firstPuzzlePlayed = Boolean(_local1.data.firstPuzzlePlayed);
_local2.firstClassicPlayed = Boolean(_local1.data.firstClassicPlayed);
_local2.firstTimeTrialPlayed = Boolean(_local1.data.firstTimeTrialPlayed);
}
}
function gotoWebsite() {
getURL ("http://www.puzzlegems.com", "_blank");
}
function loadLevelString() {
var _local1 = _root;
_local1.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>";
_local1.levelfile_toload = _local1.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>";
_local1.levelfile_toload = _local1.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>";
_local1.levelfile_toload = _local1.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>";
_local1.levelfile_toload = _local1.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>";
_local1.levelfile_toload = _local1.levelfile_toload + "</LevelData>";
}
fscommand ("showmenu", "false");
var disableGameStart = false;
var cheatStatus = 0;
var allBalls;
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.puzzlegems.com";
var getfull_link = "http://www.puzzlegems.com";
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;
var scoreSubmissionURL = "http://www.playaholics.com/comp_entry.php?developer=devlabs&game=bunch&score=";
_root.getUserSettings();
_root.loadLevelString();
link_btn.onPress = function () {
getURL ("http://www.puzzlegems.com", "_blank");
};
Frame 3 (41.84 KiB) ● ● ● ●
function startGame() {
var _local1 = _root;
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 :
_local1.timerOn = false;
collectiontimer_mc._visible = false;
gamemode_mc.mode = "PUZZLE";
_local1.invalidMovePenalty = false;
_local1.invalidMovePenalty_score = 0;
_local1.baseScore = 30;
levellabel_mc.gotoAndStop("level");
break;
case 2 :
_local1.timerOn = true;
gamemode_mc.mode = "CLASSIC";
_local1.collectpoints_mc._visible = true;
collectiontimer_mc._visible = false;
levellabel_mc.gotoAndStop("level");
break;
case 3 :
_local1.timerOn = true;
gamemode_mc.mode = "TIME TRIAL";
levellabel_mc._visible = true;
levelcounter_mc._visible = false;
_local1.collectpoints_mc._visible = false;
timer_mc.timeLimit = 300;
_local1.baseScore = 30;
_local1.goRottenOnHarvest = false;
_local1.invalidMovePenalty = true;
_local1.invalidMovePenalty_score = 10;
_local1.rottenPenalty = 2;
levellabel_mc.gotoAndStop("timeleft");
}
if (gameType == 2) {
switch (gameLevel) {
case 1 :
timer_mc.timeLimit = 180;
_local1.baseScore = 5;
_local1.goRottenOnHarvest = false;
_local1.invalidMovePenalty = false;
_local1.invalidMovePenalty_score = 0;
_local1.rottenPenalty = 0;
break;
case 2 :
timer_mc.timeLimit = 150;
_local1.baseScore = 10;
_local1.goRottenOnHarvest = false;
_local1.invalidMovePenalty = true;
_local1.invalidMovePenalty_score = 10;
_local1.rottenPenalty = 0;
break;
case 3 :
timer_mc.timeLimit = 120;
_local1.baseScore = 30;
_local1.goRottenOnHarvest = false;
_local1.invalidMovePenalty = true;
_local1.invalidMovePenalty_score = 50;
_local1.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 ("startgame");
}
function encryptText(input) {
var _local2 = input;
var result = "";
var _local3 = 0;
var _local1;
var result;
var encChar;
_local1 = 0;
while (_local1 < key.length) {
_local3 = _local3 + key.charCodeAt(_local1);
_local1++;
}
_local1 = 0;
while (_local1 < _local2.length) {
encChar = _local2.charCodeAt(_local1) + _local3;
result = result + (encChar + "-");
_local1++;
}
return(result.substr(0, result.length - 2));
}
function decryptText(input) {
var myText = input;
var _local3;
var result = "";
var code = 0;
var _local2;
var _local1;
var result;
myText = input;
_local1 = 0;
while (_local1 < key.length) {
code = code + key.charCodeAt(_local1);
_local1++;
}
_local3 = myText.split("-");
_local2 = 0;
while (_local2 < _local3.length) {
result = result + String.fromCharCode(_local3[_local2] - code);
_local2++;
}
return(result);
}
function isTopTenScore(players_score) {
var _local3 = players_score;
var _local1;
var _local2 = false;
_local1 = 0;
while (_local1 < 10) {
if (_local3 > Number(_root.score_scores[_local1])) {
_local2 = true;
break;
}
_local1++;
}
return(_local2);
}
function saveSlotDataFirstTime(slotSO) {
var _local2 = slotSO;
var _local1;
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);
_local2.data.slotnames = slot_names;
_local2.data.slotlevels = slot_levels;
_local2.data.slotscores = slot_scores;
_local2.data.slotstatus = slot_status;
_local2.data.balldata = slot_balldata;
_local2.data.squaredata = slot_squaredata;
_local1 = 0;
while (_local1 < 10) {
_local2.data.slotnames[_local1] = "Empty Slot";
_local2.data.slotlevels[_local1] = "-";
_local2.data.slotscores[_local1] = "-";
_local2.data.slotstatus[_local1] = "";
_local1++;
}
_local2.data.firsttime = "false";
_local2.flush(5000);
}
function saveScore(nametosave, scoretosave, leveltosave) {
var _local2 = _root;
var _local1;
var _local3 = -1;
_local1 = 0;
while (_local1 < 10) {
if (Number(scoretosave) > Number(_local2.score_scores[_local1])) {
_local3 = _local1;
break;
}
_local1++;
}
if (_local3 >= 0) {
_local1 = 9;
while (_local1 > _local3) {
_local2.score_names[_local1] = _local2.score_names[_local1 - 1];
_local2.score_scores[_local1] = _local2.score_scores[_local1 - 1];
if (gameType != 3) {
_local2.score_levels[_local1] = _local2.score_levels[_local1 - 1];
}
_local1--;
}
_local2.score_names[_local3] = nametosave;
_local2.score_scores[_local3] = 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) {
_local2.score_levels[_local3] = ("Complete (" + diffLetter) + ")";
} else {
_local2.score_levels[_local3] = ((leveltosave + " (") + diffLetter) + ")";
}
} else if (gameType == 1) {
_local2.score_levels[_local3] = leveltosave;
}
saveScoreData();
}
}
function saveScoreData() {
var _local2 = _root;
var _local1 = SharedObject.getLocal("bunch_scores", "/");
if (_local1.data.firsttime == undefined) {
saveScoreDataFirstTime();
}
index = 0;
while (index < 10) {
_local1.data.score[gameType - 1][index] = _local2.score_scores[index];
if (gameType != 3) {
_local1.data.level[gameType - 1][index] = _local2.score_levels[index];
}
_local1.data.name[gameType - 1][index] = _local2.score_names[index];
index++;
}
_local1.flush(1000);
}
function saveScoreDataFirstTime() {
var _local1 = SharedObject.getLocal("bunch_scores", "/");
var _local2 = new Array();
_local2.push(new Array(10));
_local2.push(new Array(10));
_local2.push(new Array(10));
var _local3 = new Array();
_local3.push(new Array(10));
_local3.push(new Array(10));
_local3.push(new Array(10));
var gamelevels = new Array();
gamelevels.push(new Array(10));
gamelevels.push(new Array(10));
gamelevels.push(new Array(10));
_local1.data.score = _local3;
_local1.data.level = gamelevels;
_local1.data.name = _local2;
gameIndex = 0;
while (gameIndex < 3) {
index = 0;
while (index < 10) {
_local1.data.score[gameIndex][index] = "0";
_local1.data.level[gameIndex][index] = "0";
_local1.data.name[gameIndex][index] = "Empty";
index++;
}
gameIndex++;
}
_local1.data.firsttime = "false";
_local1.flush(1000);
}
function resetScores() {
var _local1 = SharedObject.getLocal("bunch_scores", "/");
_local1.data.firsttime = undefined;
_local1.flush(1000);
}
function loadScores(number) {
var _local2 = _root;
_local2.gameTypeToLoad = number;
var _local3 = SharedObject.getLocal("bunch_scores", "/");
if (_local3.data.firsttime == undefined) {
saveScoreDataFirstTime();
}
var _local1;
var name;
var level;
var score;
_local2.score_names = new Array(10);
_local2.score_levels = new Array(10);
_local2.score_scores = new Array(10);
_local1 = 0;
while (_local1 < 10) {
name = "mainmenu_mc.scoretab_mc.localscores_mc.name_" + (_local1 + 1);
level = "mainmenu_mc.scoretab_mc.localscores_mc.level_" + (_local1 + 1);
score = "mainmenu_mc.scoretab_mc.localscores_mc.score_" + (_local1 + 1);
_local2.score_names[_local1] = _local3.data.name[_local2.gameTypeToLoad - 1][_local1];
mainmenu_mc.scoretab_mc.localscores_mc["name_" + (_local1 + 1)] = _local2.score_names[_local1];
if (gameTypeToLoad != 3) {
_local2.score_levels[_local1] = _local3.data.level[_local2.gameTypeToLoad - 1][_local1];
if ((gameTypeToLoad == 1) && (_local2.score_levels[_local1] >= _local2.lastLevel)) {
mainmenu_mc.scoretab_mc.localscores_mc["level_" + (_local1 + 1)] = "Complete";
} else {
mainmenu_mc.scoretab_mc.localscores_mc["level_" + (_local1 + 1)] = _local2.score_levels[_local1];
}
} else {
mainmenu_mc.scoretab_mc.localscores_mc["level_" + (_local1 + 1)] = "NA";
}
_local2.score_scores[_local1] = _local3.data.score[_local2.gameTypeToLoad - 1][_local1];
mainmenu_mc.scoretab_mc.localscores_mc["score_" + (_local1 + 1)] = _local2.score_scores[_local1];
_local1++;
}
}
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 _local2 = _root;
var _local1;
var levelXML = new XML();
levelXML.ignoreWhite = true;
levelXML.parseXML(_local2.levelfile_toload);
var objNode = levelXML.firstChild;
var _local3;
_local2.levelData = new Array();
_local1 = 0;
while (_local1 < lastLevel) {
_local2.levelData.push(new Array());
_local3 = objNode.childNodes[_local1];
ballData = new String(_local3.childNodes[0].firstChild.nodeValue);
squareData = new String(_local3.childNodes[1].firstChild.nodeValue);
_local2.levelData[_local1][0] = ballData;
_local2.levelData[_local1][1] = squareData;
_local1++;
}
if (isBallDataToLoad) {
loadSlotData();
} else {
openLevel();
}
}
function loadSlotData() {
var _local1 = _root;
var _local2 = SharedObject.getLocal("bunch_slots", "/");
_local1.slotData = new Array();
_local1.slotData.push(new Array());
_local1.slotData[0][0] = _local2.data.balldata[_local1.slotselected - 1];
_local1.slotData[0][1] = _local2.data.squaredata[_local1.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 _local1 = SharedObject.getLocal("bunch_slots", "/");
if (saveType == "new") {
saveNewSlotData(_local1);
} else {
saveOldSlotData(_local1);
}
}
function saveNewSlotData(slotSO) {
var _local1 = _root;
var _local2 = slotSO;
var index;
_local2.data.slotnames[_local1.slotselected - 1] = _local1.newSlotName;
_local2.data.slotscores[_local1.slotselected - 1] = playerScore;
_local2.data.slotlevels[_local1.slotselected - 1] = currentLevel;
_local2.data.slotstatus[_local1.slotselected - 1] = "newlevel";
_local2.flush(5000);
if (currentLevel == 1) {
mainmenu_mc.savedslots_mc.gotoAndStop("newslotconfirmed");
} else if (isTopTenScore(playerScore)) {
_local1.saveScore(_local1.newSlotName, playerScore, currentLevel);
}
}
function saveOldSlotData(slotSO) {
var _local1 = _root;
var _local2 = slotSO;
var index;
_local2.data.slotnames[_local1.slotselected - 1] = _local1.newSlotName;
_local2.data.slotscores[_local1.slotselected - 1] = playerScore;
_local2.data.slotlevels[_local1.slotselected - 1] = currentLevel;
_local2.data.slotstatus[_local1.slotselected - 1] = "savedlevel";
getCurrentLevelData();
if (_local1.ballData != "") {
_local2.data.balldata[_local1.slotselected - 1] = balldata;
_local2.data.squaredata[_local1.slotselected - 1] = squaredata;
}
_local2.flush(5000);
}
function getCurrentLevelData() {
var x;
var _local2;
var _local1;
var elementIndex;
var _local3;
ballData = "";
squareData = "";
x = 0;
while (x < 8) {
_local2 = 0;
while (_local2 < 8) {
ballData = ballData + ((("," + String(getShapeNumber(cells[x][_local2]))) + String(x)) + String(_local2));
_local2++;
}
ballData = ballData + " ";
x++;
}
ballData = ballData + ".";
_local1 = 0;
while (_local1 < bunches.length) {
if (bunches[_local1].length > 9) {
squareData = squareData + ("s" + String(bunches[_local1].length));
} else {
squareData = squareData + ("s0" + String(bunches[_local1].length));
}
elementIndex = 0;
while (elementIndex < bunches[_local1].length) {
_local3 = bunches[_local1][elementIndex];
squareData = squareData + ((("," + String(_local3.number)) + String(_local3.xCell)) + String(_local3.yCell));
elementIndex++;
}
squareData = squareData + " ";
_local1++;
}
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 _local3;
var _local2;
var _local1;
initialiseVariables();
_local2 = 0;
while (_local2 < 8) {
_local1 = 0;
while (_local1 < 8) {
_local3 = getRandomShapeNumber();
cells[_local2][_local1] = _local3;
_local1++;
}
_local2++;
}
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 _local2;
var index;
var _local3;
var _local1;
randomNumbers = null;
randomNumbers = new Array(64);
index = 0;
while (index < 64) {
_local3 = false;
do {
if (!_local3) {
_local1 = Math.floor(Math.random() * 64) + 1;
}
_local3 = isRandomNumberExist(_local1);
if (_local3) {
_local1++;
}
if (_local1 > 64) {
_local1 = 1;
}
} while (_local3);
_local2 = new Object();
_local2.number = _local1;
_local2.x = Math.floor(_local1 / 8);
_local2.y = _local1 % 8;
if (_local2.y == 0) {
if (_local2.x != 0) {
_local2.x--;
_local2.y = 7;
}
} else {
_local2.y--;
}
randomNumbers[index] = _local2;
index++;
}
depth = 65;
shapePlacementIndex = 0;
gotoAndPlay ("shapeplacement");
}
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 _local2 = randomNumber;
var _local1 = false;
index = 0;
while (index < 64) {
if (randomNumbers[index].number == _local2) {
_local1 = true;
break;
}
index++;
}
return(_local1);
}
function getXCellPos(x) {
var _local1 = leftStart + (x * cellWidth);
return(_local1);
}
function getYCellPos(y) {
var _local1 = topStart + (y * cellHeight);
return(_local1);
}
function initialiseGroups() {
var _local2;
var _local1;
var _local3;
var index;
shapeObjects = new Array();
index = 0;
while (index < 8) {
shapeObjects.push(new Array(8));
index++;
}
_local2 = 0;
while (_local2 < 8) {
_local1 = 0;
while (_local1 < 8) {
_local3 = new Object();
_local3.shapeInstanceName = cells[_local2][_local1];
_local3.xCell = _local2;
_local3.yCell = _local1;
shapeObjects[_local2][_local1] = _local3;
_local1++;
}
_local2++;
}
_local2 = 0;
while (_local2 < 8) {
_local1 = 0;
while (_local1 < 8) {
setShapeObjectsAdjacent(shapeObjects[_local2][_local1]);
_local1++;
}
_local2++;
}
groups = null;
groups = new Array();
_local2 = 0;
while (_local2 < 8) {
_local1 = 0;
while (_local1 < 8) {
checkShapeInGroup(shapeObjects[_local2][_local1]);
_local1++;
}
_local2++;
}
}
function checkShapeInGroup(shapeObject) {
var _local3 = shapeObject;
var shapeFound;
var _local2;
var _local1 = 0;
if ((((_local3.topShapeObject != null) || (_local3.rightShapeObject != null)) || (_local3.bottomShapeObject != null)) || (_local3.leftShapeObject != null)) {
shapeFound = false;
_local1 = 0;
while (_local1 < groups.length) {
index = 0;
while (index < groups[_local1].length) {
_local2 = _local3.shapeInstanceName;
if (_local2 == groups[_local1][index]) {
shapeFound = true;
}
index++;
}
_local1++;
}
if (!shapeFound) {
groups.push(new Array());
groups[groups.length - 1][0] = _local3.shapeInstanceName;
addShapeObjectToGroup(_local3.topShapeObject);
addShapeObjectToGroup(_local3.rightShapeObject);
addShapeObjectToGroup(_local3.bottomShapeObject);
addShapeObjectToGroup(_local3.leftShapeObject);
}
}
}
function addShapeObjectToGroup(shapeObject) {
if (shapeObject != null) {
var _local2 = groups.length - 1;
var shapeFound = false;
var _local3;
var _local1;
_local1 = 0;
while (_local1 < groups[_local2].length) {
_local3 = shapeObject.shapeInstanceName;
if (_local3 == groups[_local2][_local1]) {
shapeFound = true;
}
_local1++;
}
if (!shapeFound) {
groups[_local2].push(_local3);
addShapeObjectToGroup(shapeObject.topShapeObject);
addShapeObjectToGroup(shapeObject.rightShapeObject);
addShapeObjectToGroup(shapeObject.bottomShapeObject);
addShapeObjectToGroup(shapeObject.leftShapeObject);
}
}
}
function removeGroups() {
var _local3;
var _local2;
var obj;
var _local1;
_local3 = 0;
while (_local3 < groups.length) {
var groupLength = groups[_local3].length;
if (groupLength > 2) {
_local2 = 0;
while (_local2 < groups[_local3].length) {
_local1 = groups[_local3][_local2];
shapeCount[getShapeNumber(_local1)]--;
removeShape(_local1);
x = 0;
while (x < 8) {
y = 0;
while (y < 8) {
if (cells[x][y] == _local1) {
cells[x][y] = 0;
break;
}
y++;
}
x++;
}
_local2++;
}
}
_local3++;
}
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 _local2;
var _local1;
_local2 = 0;
while (_local2 < 8) {
_local1 = 0;
while (_local1 < 8) {
setShapeNotInGroup(_local2, _local1);
_local1++;
}
_local2++;
}
}
function moveShapesAround() {
var _local1 = _root;
x = 0;
while (x < 8) {
y = 0;
while (y < 8) {
xCell = Math.floor(Math.random() * 8);
yCell = Math.floor(Math.random() * 8);
setProperty("_root." + _local1.cells[x][y], _x , _local1.getXCellPos(xCell));
setProperty("_root." + _local1.cells[x][y], _y , _local1.getYCellPos(yCell));
setProperty("_root." + _local1.cells[xCell][yCell], _x , _local1.getXCellPos(x));
setProperty("_root." + _local1.cells[xCell][yCell], _y , _local1.getYCellPos(y));
temp = _local1.cells[x][y];
_local1.cells[x][y] = _local1.cells[xCell][yCell];
_local1.cells[xCell][yCell] = temp;
y++;
}
x++;
}
}
function setShapeNotInGroup(x, y) {
var _local2 = y;
var _local3 = x;
var _local1;
var shapes = 0;
var direction = 0;
shapes = getNumberOfShapesAdjacent(_local3, _local2, direction, shapes);
if (shapes > 2) {
do {
_local1 = getRandomShapeNumber();
} while (_local1 == cells[_local3][_local2]);
cells[_local3][_local2] = _local1;
setShapeNotInGroup(_local3, _local2);
}
}
function setShapeObjectsAdjacent(shapeObject) {
var _local1 = shapeObject;
_local1.topShapeObject = null;
_local1.rightShapeObject = null;
_local1.bottomShapeObject = null;
_local1.leftShapeObject = null;
x = _local1.xCell;
y = _local1.yCell;
if (y > 0) {
if (getShapeNumber(_local1.shapeInstanceName) == getShapeNumber(shapeObjects[x][y - 1].shapeInstanceName)) {
_local1.topShapeObject = shapeObjects[x][y - 1];
}
}
if (y < 7) {
if (getShapeNumber(_local1.shapeInstanceName) == getShapeNumber(shapeObjects[x][y + 1].shapeInstanceName)) {
_local1.bottomShapeObject = shapeObjects[x][y + 1];
}
}
if (x < 7) {
if (getShapeNumber(_local1.shapeInstanceName) == getShapeNumber(shapeObjects[x + 1][y].shapeInstanceName)) {
_local1.rightShapeObject = shapeObjects[x + 1][y];
}
}
if (x > 0) {
if (getShapeNumber(_local1.shapeInstanceName) == getShapeNumber(shapeObjects[x - 1][y].shapeInstanceName)) {
_local1.leftShapeObject = shapeObjects[x - 1][y];
}
}
shapeObjects[x][y] = _local1;
}
function getNumberOfShapesAdjacent(x, y, direction, shapes) {
var _local1 = shapes;
var _local2 = y;
var _local3 = x;
var shapeNumber = cells[_local3][_local2];
if (_local2 > 0) {
if (cells[_local3][_local2 - 1] == shapeNumber) {
_local1++;
direction = 1;
if (_local1 < 2) {
_local1 = getNumberOfShapesAdjacent(_local3, _local2 - 1, direction, _local1);
}
}
}
if (_local2 < 7) {
if (getShapeNumber(cells[_local3][_local2 + 1]) == shapeNumber) {
_local1++;
direction = 2;
if (_local1 < 2) {
_local1 = getNumberOfShapesAdjacent(_local3, _local2 + 1, direction, _local1);
}
}
}
if (_local3 < 7) {
if (getShapeNumber(cells[_local3 + 1][_local2]) == shapeNumber) {
_local1++;
direction = 3;
if (_local1 < 2) {
_local1 = getNumberOfShapesAdjacent(_local3 + 1, _local2, direction, _local1);
}
}
}
if (_local3 > 0) {
if (getShapeNumber(cells[_local3 - 1][_local2]) == shapeNumber) {
_local1++;
direction = 4;
if (_local1 < 2) {
_local1 = getNumberOfShapesAdjacent(_local3 - 1, _local2, direction, _local1);
}
}
}
return(_local1);
}
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 ("swapshapes");
}
}
}
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 _local3 = y;
var _local2 = getShapeNumber(shapeToCheck);
var _local1 = false;
if (_local3 > 0) {
if (getShapeNumber(cells[x][_local3 - 1]) == _local2) {
_local1 = true;
}
}
if (_local3 < 7) {
if (getShapeNumber(cells[x][_local3 + 1]) == _local2) {
_local1 = true;
}
}
if (x < 7) {
if (getShapeNumber(cells[x + 1][_local3]) == _local2) {
_local1 = true;
}
}
if (x > 0) {
if (getShapeNumber(cells[x - 1][_local3]) == _local2) {
_local1 = true;
}
}
return(_local1);
}
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 ("removegroups");
}
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 _local3 = 0;
var _local1;
var _local2;
_local1 = 0;
while (_local1 < groups.length) {
_local2 = groups[_local1].length;
if (_local2 > 2) {
_local3 = _local3 + _local2;
}
_local1++;
}
return(_local3 == 64);
}
function getRandomShapeNumber() {
var _local1 = Math.floor(Math.random() * ((maxCell - minCell) + 1)) + minCell;
return(_local1);
}
function getShapeNumber(instanceName) {
var _local2;
var _local1 = new String(instanceName);
if (_local1.length > 1) {
_local2 = _local1.charAt(6);
} else {
_local2 = instanceName;
}
return(_local2);
}
function createNewShape(shapeNumber) {
var _local1 = _root;
var _local2 = shapeNumber;
shapeCount[_local2]++;
totalShapeCount++;
instanceName = (("shape_" + _local2) + "_") + totalShapeCount;
depth++;
switch (_local2) {
case 1 :
duplicateMovieClip (_local1.shape1_mc, instanceName, depth);
break;
case 2 :
duplicateMovieClip (_local1.shape2_mc, instanceName, depth);
break;
case 3 :
duplicateMovieClip (_local1.shape3_mc, instanceName, depth);
break;
case 4 :
duplicateMovieClip (_local1.shape4_mc, instanceName, depth);
break;
case 5 :
duplicateMovieClip (_local1.shape5_mc, instanceName, depth);
break;
case 6 :
duplicateMovieClip (_local1.shape6_mc, instanceName, depth);
break;
case 7 :
duplicateMovieClip (_local1.shape7_mc, instanceName, depth);
}
return(instanceName);
}
function removeShape(instanceName) {
removeMovieClip(eval (instanceName));
}
function areYouSure() {
if (pauseOn) {
resumeGame();
}
if (gameOn && (harvestOn)) {
gotoAndStop ("areyousure");
} 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 ("gamestarted");
fadeShapes(false);
}
function pauseGame() {
if (_root.harvestOn) {
pauseOn = true;
pauseplay_mc.gotoAndStop("play");
timer_mc.gotoAndPlay("pausetimer");
fadeShapes(true);
gotoAndStop ("gamepaused");
}
}
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) {
var _local1 = aString;
if (mode == "left") {
return((((_local1.charAt(0) == " ") && (_local1.length > 0)) ? (trim("left", _local1.slice(1))) : (_local1)));
}
if (mode == "right") {
return((((_local1.charAt(_local1.length - 1) == " ") && (_local1.length > 0)) ? (trim("right", _local1.slice(0, _local1.length - 1))) : (_local1)));
}
return(trim("right", trim("left", _local1)));
}
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 4 (13 B)
startGame();
Instance of Symbol 383 MovieClip "collectpoints_mc" in Frame 4 (497 B)
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 5 (205 B)
gameOn = true;
harvestOn = true;
areyousureOn = false;
if (gameType == 1) {
_root.collectpoints_mc._visible = !noMatch;
if (_root.isFirstTimeGameModePlayed()) {
_root.displayInGameHelp();
}
}
Frame 7 (911 B)
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 8 (30 B)
gotoAndPlay ("removegroups");
Frame 12 (1.13 KiB) ●
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 13 (28 B)
gotoAndPlay ("swapshapes");
Frame 18 (86 B)
areyousureOn = true;
timer_mc.gotoAndPlay("pausetimer");
fadeShapes(true);
stop();
Frame 19 (467 B)
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 ("gamestarted");
}
createShapeInGrid();
Frame 20 (32 B)
gotoAndPlay ("shapeplacement");
Frame 22 (64 B)
gameOn = false;
harvestOn = false;
fadeShapes(true);
stop();
Instance of Symbol 477 MovieClip "gameover_mc" in Frame 22 (21 B)
/* no clip actions */
Symbol 36 MovieClip [loadinglevel] Frame 1 (1 B)
Symbol 36 MovieClip [loadinglevel] Frame 3 (32 B)
_root.gotoAndStop("startgame");
Symbol 51 MovieClip Frame 2 (374 B)
rootTotal = _root.getBytesTotal();
gameBytesTotal = rootTotal;
gameBytesLoaded = _root.getBytesLoaded();
percent = Math.round((gameBytesLoaded / gameBytesTotal) * 100);
preloader_mc._xscale = percent;
if ((gameBytesLoaded >= gameBytesTotal) && (gameBytesTotal > 0)) {
_root.gotoAndStop("devlabsintro");
stop();
} else {
gotoAndPlay ("preload");
}
Symbol 56 Button (65 B)
on (release) {
getURL ("http://www.puzzlegems.com", "_blank");
}
Symbol 127 MovieClip Frame 1 (21 B)
var loopCounter = 0;
Symbol 127 MovieClip Frame 138 (169 B)
loopCounter++;
if (loopCounter == 1) {
_parent.puzzleGemsText_mc.gotoAndPlay("show");
} else if (loopCounter >= 2) {
_root.gotoAndStop("welcome");
stop();
}
Symbol 127 MovieClip Frame 203 (22 B)
gotoAndPlay ("loop");
Symbol 129 MovieClip Frame 1 (8 B)
stop();
Symbol 129 MovieClip Frame 35 (8 B)
stop();
Symbol 132 MovieClip Frame 1 (8 B)
stop();
Symbol 132 MovieClip Frame 2 (57 B)
var startTime = int(getTimer() / 1000);
var timePlayed;
Symbol 132 MovieClip Frame 3 (213 B)
timePlayed = int(getTimer() / 1000) - startTime;
if (timePlayed >= 60) {
_root.timeUsed = Number(_root.timeUsed) + 1;
_root.setRegistryValue("TU", _root.timeUsed);
startTime = int(getTimer() / 1000);
}
Symbol 132 MovieClip Frame 4 (27 B)
gotoAndPlay ("playtimer");
Symbol 138 Button (1 KiB)
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 160 MovieClip Frame 1 (48 B)
var harvestType;
var rottenState = 0;
stop();
Symbol 160 MovieClip Frame 8 (24 B)
gotoAndStop ("normal");
Symbol 160 MovieClip Frame 12 (315 B)
if (harvestType == "harvest") {
_root.shapesRemoved--;
stop();
} else if (harvestType == "harvest_onetype") {
gotoAndPlay ("harvest_onetype");
} else if (harvestType == "harvest_complete") {
gotoAndPlay ("harvest_complete");
} else if (harvestType == "harvest_line") {
gotoAndPlay ("harvest_line");
}
Symbol 160 MovieClip Frame 25 (32 B)
_root.shapesRemoved--;
stop();
Symbol 160 MovieClip Frame 40 (32 B)
_root.shapesRemoved--;
stop();
Symbol 160 MovieClip Frame 54 (32 B)
_root.shapesRemoved--;
stop();
Symbol 160 MovieClip Frame 70 (8 B)
stop();
Symbol 166 MovieClip Frame 1 (30 B)
var rottenState = 0;
stop();
Symbol 166 MovieClip Frame 8 (24 B)
gotoAndStop ("normal");
Symbol 166 MovieClip Frame 12 (315 B)
if (harvestType == "harvest") {
_root.shapesRemoved--;
stop();
} else if (harvestType == "harvest_onetype") {
gotoAndPlay ("harvest_onetype");
} else if (harvestType == "harvest_complete") {
gotoAndPlay ("harvest_complete");
} else if (harvestType == "harvest_line") {
gotoAndPlay ("harvest_line");
}
Symbol 166 MovieClip Frame 25 (32 B)
_root.shapesRemoved--;
stop();
Symbol 166 MovieClip Frame 40 (32 B)
_root.shapesRemoved--;
stop();
Symbol 166 MovieClip Frame 55 (32 B)
_root.shapesRemoved--;
stop();
Symbol 166 MovieClip Frame 71 (8 B)
stop();
Symbol 172 MovieClip Frame 1 (30 B)
var rottenState = 0;
stop();
Symbol 172 MovieClip Frame 8 (24 B)
gotoAndStop ("normal");
Symbol 172 MovieClip Frame 12 (315 B)
if (harvestType == "harvest") {
_root.shapesRemoved--;
stop();
} else if (harvestType == "harvest_onetype") {
gotoAndPlay ("harvest_onetype");
} else if (harvestType == "harvest_complete") {
gotoAndPlay ("harvest_complete");
} else if (harvestType == "harvest_line") {
gotoAndPlay ("harvest_line");
}
Symbol 172 MovieClip Frame 25 (32 B)
_root.shapesRemoved--;
stop();
Symbol 172 MovieClip Frame 40 (32 B)
_root.shapesRemoved--;
stop();
Symbol 172 MovieClip Frame 54 (32 B)
_root.shapesRemoved--;
stop();
Symbol 172 MovieClip Frame 70 (8 B)
stop();
Symbol 178 MovieClip Frame 1 (30 B)
var rottenState = 0;
stop();
Symbol 178 MovieClip Frame 8 (24 B)
gotoAndStop ("normal");
Symbol 178 MovieClip Frame 12 (315 B)
if (harvestType == "harvest") {
_root.shapesRemoved--;
stop();
} else if (harvestType == "harvest_onetype") {
gotoAndPlay ("harvest_onetype");
} else if (harvestType == "harvest_complete") {
gotoAndPlay ("harvest_complete");
} else if (harvestType == "harvest_line") {
gotoAndPlay ("harvest_line");
}
Symbol 178 MovieClip Frame 25 (32 B)
_root.shapesRemoved--;
stop();
Symbol 178 MovieClip Frame 40 (32 B)
_root.shapesRemoved--;
stop();
Symbol 178 MovieClip Frame 54 (32 B)
_root.shapesRemoved--;
stop();
Symbol 178 MovieClip Frame 70 (8 B)
stop();
Symbol 184 MovieClip Frame 1 (30 B)
var rottenState = 0;
stop();
Symbol 184 MovieClip Frame 8 (24 B)
gotoAndStop ("normal");
Symbol 184 MovieClip Frame 12 (315 B)
if (harvestType == "harvest") {
_root.shapesRemoved--;
stop();
} else if (harvestType == "harvest_onetype") {
gotoAndPlay ("harvest_onetype");
} else if (harvestType == "harvest_complete") {
gotoAndPlay ("harvest_complete");
} else if (harvestType == "harvest_line") {
gotoAndPlay ("harvest_line");
}
Symbol 184 MovieClip Frame 25 (32 B)
_root.shapesRemoved--;
stop();
Symbol 184 MovieClip Frame 40 (32 B)
_root.shapesRemoved--;
stop();
Symbol 184 MovieClip Frame 54 (32 B)
_root.shapesRemoved--;
stop();
Symbol 184 MovieClip Frame 70 (8 B)
stop();
Symbol 190 MovieClip Frame 1 (30 B)
var rottenState = 0;
stop();
Symbol 190 MovieClip Frame 8 (24 B)
gotoAndStop ("normal");
Symbol 190 MovieClip Frame 12 (315 B)
if (harvestType == "harvest") {
_root.shapesRemoved--;
stop();
} else if (harvestType == "harvest_onetype") {
gotoAndPlay ("harvest_onetype");
} else if (harvestType == "harvest_complete") {
gotoAndPlay ("harvest_complete");
} else if (harvestType == "harvest_line") {
gotoAndPlay ("harvest_line");
}
Symbol 190 MovieClip Frame 25 (32 B)
_root.shapesRemoved--;
stop();
Symbol 190 MovieClip Frame 40 (32 B)
_root.shapesRemoved--;
stop();
Symbol 190 MovieClip Frame 54 (32 B)
_root.shapesRemoved--;
stop();
Symbol 190 MovieClip Frame 70 (8 B)
stop();
Symbol 196 MovieClip Frame 1 (30 B)
var rottenState = 0;
stop();
Symbol 196 MovieClip Frame 8 (24 B)
gotoAndStop ("normal");
Symbol 196 MovieClip Frame 12 (315 B)
if (harvestType == "harvest") {
_root.shapesRemoved--;
stop();
} else if (harvestType == "harvest_onetype") {
gotoAndPlay ("harvest_onetype");
} else if (harvestType == "harvest_complete") {
gotoAndPlay ("harvest_complete");
} else if (harvestType == "harvest_line") {
gotoAndPlay ("harvest_line");
}
Symbol 196 MovieClip Frame 25 (32 B)
_root.shapesRemoved--;
stop();
Symbol 196 MovieClip Frame 40 (32 B)
_root.shapesRemoved--;
stop();
Symbol 196 MovieClip Frame 54 (32 B)
_root.shapesRemoved--;
stop();
Symbol 196 MovieClip Frame 70 (8 B)
stop();
Symbol 203 MovieClip Frame 1 (8 B)
stop();
Symbol 203 MovieClip Frame 2 (328 B)
if ((_root.playerScore != 0) && (_root.gameType != 1)) {
if ((_root.gameType == 3) || ((_root.gameType == 2) && (_root.gameLevel == 2))) {
gotoAndPlay ("startinvalidmove_penalty1");
} else if ((_root.gameType == 2) && (_root.gameLevel == 3)) {
gotoAndPlay ("startinvalidmove_penalty2");
}
}
Symbol 203 MovieClip Frame 25 (8 B)
stop();
Symbol 203 MovieClip Frame 50 (8 B)
stop();
Symbol 203 MovieClip Frame 75 (8 B)
stop();
Symbol 211 Button (49 B)
on (release) {
_root.gotoAndStop("startgame");
}
Symbol 214 Button (57 B)
on (release) {
if (!areyousureOn) {
areYouSure();
}
}
Symbol 220 MovieClip Frame 1 (8 B)
stop();
Symbol 229 Button (128 B)
on (release) {
_root.playSound("standard_click_fx");
_root.gameType = 2;
_root.gameLevel = 1;
gotoAndStop ("arcadeintro");
}
Symbol 234 Button (124 B)
on (release) {
if (!_root.disableGameStart) {
_root.playSound("standard_click_fx");
_root.gotoAndStop("tutorial");
}
}
Symbol 240 Button (215 B)
on (release) {
_root.playSound("standard_click_fx");
_root.isSave = true;
_root.gameType = 1;
_root.currentLevel = 1;
_root.savedLevelToLoad = 0;
_root.isBallDataToLoad = false;
gotoAndStop ("puzzleintro");
}
Symbol 251 Button (56 B)
on (release) {
getURL (_root.getfull_link, "_blank");
}
Symbol 263 Button (49 B)
on (release) {
_root.gotoAndStop("startgame");
}
Symbol 266 Button (80 B)
on (release) {
_root.playSound("mainmenu_click_fx");
_parent.gotoAndStop(1);
}
Symbol 270 Button (42 B)
on (release) {
_root.startPuzzleGame();
}
Symbol 284 Button (135 B)
on (release) {
_root.copyright_clicked_count++;
if (_root.copyright_clicked_count > 3) {
flashplayerversion = getVersion();
}
}
Symbol 286 Button (145 B)
on (press) {
if (!_root.windowmodeOn) {
_root.windowmodeOn = true;
fscommand ("exec", "jcommand_3Anofullscreen");
}
_root.gotoWebsite();
}
Symbol 288 MovieClip Frame 1 (97 B)
stop();
link_btn.onPress = function () {
getURL ("http://www.puzzlegems.com", "_blank");
};
Symbol 294 Button (82 B)
on (release) {
_root.playSound("standard_click_fx");
_root.showPurchasePage();
}
Symbol 297 Button (107 B)
on (release) {
_root.playSound("standard_click_fx");
lastframe = "timeleft";
gotoAndStop ("enterkey");
}
Symbol 300 Button (109 B)
on (release) {
_root.playSound("standard_click_fx");
_root.recordTimeUsed = true;
gotoAndStop ("start");
}
Symbol 302 Button (110 B)
on (release) {
_root.playSound("standard_click_fx");
lastframe = "timeexpired";
gotoAndStop ("enterkey");
}
Symbol 310 Button (450 B)
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 ("start");
}
}
}
Symbol 315 Button (41 B)
on (release) {
gotoAndStop(lastframe);
}
Symbol 320 Button (87 B)
on (release) {
_root.playSound("standard_click_fx");
_root.gotoAndStop("tutorial");
}
Symbol 323 Button (79 B)
on (release) {
_root.playSound("mainmenu_click_fx");
gotoAndStop ("start");
}
Symbol 324 MovieClip Frame 1 (68 B)
if (_root.firstTime) {
gotoAndStop ("firsttimeused");
}
stop();
Symbol 324 MovieClip Frame 2 (173 B)
timeleftcaption = ("You currently have " + (_root.timeAllowed - _root.timeUsed)) + " minutes of playing time left.";
fscommand ("Win.SetCaption", "Bunch - trial version");
Symbol 324 MovieClip Frame 3 (31 B)
_root.disableGameStart = true;
Symbol 324 MovieClip Frame 4 (77 B)
invalidkeycaption = "";
productkey = "";
Selection.setFocus("productkey");
Symbol 324 MovieClip Frame 5 (134 B)
_root.firstTime = false;
var userSO = SharedObject.getLocal("bunch_settings", "/");
userSO.data.firsttime = false;
userSO.flush();
Symbol 336 MovieClip Frame 1 (56 B)
var lastTimeRecorded = int(getTimer() / 1000);
stop();
Symbol 336 MovieClip Frame 2 (410 B)
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 336 MovieClip Frame 3 (855 B)
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 336 MovieClip Frame 4 (1.93 KiB) ●
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 336 MovieClip Frame 5 (101 B)
if (_root.isFirstTimeGameModePlayed()) {
_root.displayInGameHelp();
}
gotoAndPlay ("loopbegin");
Symbol 336 MovieClip Frame 6 (56 B)
passedTime = int(getTimer() / 1000) - lastTimeRecorded;
Symbol 336 MovieClip Frame 7 (28 B)
gotoAndPlay ("pausetimer");
Symbol 344 Button (1.48 KiB) ●
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 348 MovieClip Frame 1 (8 B)
stop();
Symbol 348 MovieClip Frame 127 (24 B)
gotoAndStop ("normal");
Symbol 356 MovieClip Frame 1 (8 B)
stop();
Symbol 359 Button (106 B)
on (release) {
_root.playSound("standard_click_fx");
_root.showInGameHelp = false;
_root.pauseGame();
}
Symbol 366 Button (36 B)
on (press) {
_root.gotoWebsite();
}
Symbol 370 MovieClip Frame 1 (8 B)
stop();
Symbol 370 MovieClip Frame 38 (24 B)
gotoAndStop ("normal");
Symbol 377 Button (380 B)
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 380 MovieClip Frame 1 (8 B)
stop();
Symbol 383 MovieClip Frame 1 (8 B)
stop();
Symbol 384 MovieClip Frame 1 (8 B)
stop();
Symbol 384 MovieClip Frame 2 (55 B)
if (_root.harvestOn) {
_root.harvest();
stop();
}
Symbol 384 MovieClip Frame 3 (32 B)
gotoAndPlay ("checkharveston");
Symbol 385 MovieClip Frame 1 (8 B)
stop();
Symbol 385 MovieClip Frame 2 (26 B)
_root.moveShapesAround();
Symbol 385 MovieClip Frame 4 (26 B)
_root.moveShapesAround();
Symbol 385 MovieClip Frame 6 (26 B)
_root.moveShapesAround();
Symbol 385 MovieClip Frame 8 (26 B)
_root.moveShapesAround();
Symbol 385 MovieClip Frame 10 (26 B)
_root.moveShapesAround();
Symbol 385 MovieClip Frame 12 (26 B)
_root.moveShapesAround();
Symbol 385 MovieClip Frame 14 (26 B)
_root.moveShapesAround();
Symbol 385 MovieClip Frame 16 (26 B)
_root.moveShapesAround();
Symbol 385 MovieClip Frame 18 (26 B)
_root.moveShapesAround();
Symbol 385 MovieClip Frame 20 (26 B)
_root.moveShapesAround();
Symbol 385 MovieClip Frame 21 (31 B)
_root.removeGroups();
stop();
Symbol 388 Button (76 B)
on (release) {
_root.playSound("standard_click_fx");
_root.resumeGame();
}
Symbol 391 Button (172 B)
on (rollOver) {
savegame_tooltip_mc.gotoAndStop(2);
startDrag ("savegame_tooltip_mc", true);
}
on (rollOut, dragOut) {
stopDrag();
savegame_tooltip_mc.gotoAndStop(1);
}
Symbol 394 Button (175 B)
on (rollOver) {
resetgame_tooltip_mc.gotoAndStop(2);
startDrag ("resetgame_tooltip_mc", true);
}
on (rollOut, dragOut) {
stopDrag();
resetgame_tooltip_mc.gotoAndStop(1);
}
Symbol 397 MovieClip Frame 1 (8 B)
stop();
Symbol 399 MovieClip Frame 1 (8 B)
stop();
Symbol 402 Button (76 B)
on (release) {
_root.playSound("standard_click_fx");
_root.resumeGame();
}
Symbol 403 Button (206 B)
on (release) {
_root.playSound("standard_click_fx");
_root.isBallDataToLoad = false;
_root.savedLevelToLoad = _root.currentLevel;
_root.playerScoreToLoad = _root.playerScore;
gotoAndStop ("loading");
}
Symbol 404 Button (199 B)
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 406 MovieClip Frame 1 (8 B)
stop();
Symbol 407 MovieClip Frame 1 (1 B)
Symbol 407 MovieClip Frame 10 (32 B)
_root.gotoAndStop("startgame");
Symbol 411 Button (78 B)
on (release) {
_root.playSound("standard_click_fx");
gotoAndStop ("tip2");
}
Symbol 416 Button (78 B)
on (release) {
_root.playSound("standard_click_fx");
gotoAndStop ("tip3");
}
Symbol 424 Button (76 B)
on (release) {
_root.playSound("standard_click_fx");
_root.resumeGame();
}
Symbol 429 MovieClip Frame 1 (8 B)
stop();
Symbol 430 Button (78 B)
on (release) {
_root.playSound("standard_click_fx");
gotoAndStop ("tip2");
}
Symbol 433 Button (78 B)
on (release) {
_root.playSound("standard_click_fx");
gotoAndStop ("tip3");
}
Symbol 440 MovieClip Frame 1 (8 B)
stop();
Symbol 441 Button (78 B)
on (release) {
_root.playSound("standard_click_fx");
gotoAndStop ("tip2");
}
Symbol 444 Button (78 B)
on (release) {
_root.playSound("standard_click_fx");
gotoAndStop ("tip3");
}
Symbol 448 MovieClip Frame 1 (8 B)
stop();
Symbol 448 MovieClip Frame 3 (38 B)
_root.playSound("puzzlecomplete_fx");
Symbol 449 MovieClip Frame 1 (660 B)
if (_root.showInGameHelp) {
var userSO = SharedObject.getLocal("bunch_settings", "/");
switch (_root.gameType) {
case 1 :
_root.firstPuzzlePlayed = false;
userSO.data.firstPuzzlePlayed = false;
gotoAndStop ("puzzle_ingamehelp");
break;
case 2 :
_root.firstClassicPlayed = false;
userSO.data.firstClassicPlayed = false;
gotoAndStop ("classic_ingamehelp");
break;
case 3 :
_root.firstTimeTrialPlayed = false;
userSO.data.firstTimeTrialPlayed = false;
gotoAndStop ("timetrial_ingamehelp");
}
userSO.flush(100);
} else if (_root.gameType == 1) {
gotoAndStop ("puzzlemenu");
} else {
stop();
}
Symbol 449 MovieClip Frame 4 (42 B)
_root.timer_mc.gotoAndPlay("pausetimer");
Symbol 449 MovieClip Frame 5 (42 B)
_root.timer_mc.gotoAndPlay("pausetimer");
Instance of Symbol 449 MovieClip in Symbol 450 MovieClip Frame 1 (367 B)
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 455 Button (86 B)
on (release) {
_root.playSound("mainmenu_click_fx");
_root.gotoAndStop("welcome");
}
Symbol 456 Button (195 B)
on (release) {
_root.playSound("standard_click_fx");
_root.timer_mc.resumeTimer = true;
_root.timer_mc.gotoAndPlay("starttimer");
_root.fadeShapes(false);
_root.gotoAndStop("gamestarted");
}
Symbol 457 MovieClip Frame 1 (8 B)
stop();
Symbol 464 Button (77 B)
on (release) {
_root.playSound("standard_click_fx");
_root.restartGame();
}
Symbol 467 Button (56 B)
on (release) {
getURL (_root.getfull_link, "_blank");
}
Symbol 477 MovieClip Frame 2 (150 B)
_root.timer_mc._visible = false;
_root.collectpoints_mc._visible = false;
if (_root.gameType == 3) {
_root.collectiontimer_mc.timer2 = "0:00";
}
Symbol 477 MovieClip Frame 10 (31 B)
_root.playSound("timeout_fx");
Symbol 477 MovieClip Frame 48 (49 B)
this.highestscoringharvest = _root.highestScore;
Symbol 477 MovieClip Frame 59 (40 B)
this.biggestbunch = _root.biggestGroup;
Symbol 477 MovieClip Frame 70 (46 B)
this.finalscore = _root.playerScore;
stop();
Symbol 483 Button (205 B)
on (release) {
_root.playSound("standard_click_fx");
_root.levelcounter_mc.levelup_mc.level = _root.currentLevel;
_root.isBallDataToLoad = false;
_root.openLevel();
_root.gotoAndStop("gamestarted");
}
Symbol 492 MovieClip Frame 1 (45 B)
_root.currentLevel = _root.currentLevel + 1;
Symbol 492 MovieClip Frame 5 (31 B)
_root.playSound("levelup_fx");
Symbol 492 MovieClip Frame 27 (41 B)
this.lc_levelscore = _root.harvestScore;
Symbol 492 MovieClip Frame 38 (40 B)
this.lc_totalscore = _root.playerScore;
Symbol 492 MovieClip Frame 49 (49 B)
this.lc_nextlevel = _root.currentLevel;
stop();
Symbol 499 Button (85 B)
on (release) {
_root.playSound("standard_click_fx");
_root.gotoAndStop("advert");
}
Symbol 504 MovieClip Frame 1 (82 B)
this.gc_levelscore = _root.harvestScore;
this.gc_totalscore = _root.playerScore;
Symbol 504 MovieClip Frame 2 (134 B)
this.highestscoringharvest = _root.highestScore;
this.gc_biggestbunch = _root.biggestGroup;
this.gc_totalscore = _root.playerScore;
Symbol 505 MovieClip Frame 1 (229 B)
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 505 MovieClip Frame 2 (36 B)
_root.playSound("gamecomplete_fx");
Symbol 505 MovieClip Frame 16 (130 B)
stop();
if (_root.gameType == 1) {
gc_stats_mc.gotoAndStop("gc_puzzle");
} else {
gc_stats_mc.gotoAndStop("gc_classic");
}
Symbol 511 Button (69 B)
on (release) {
_root.playSound("standard_click_fx");
nextFrame();
}
Symbol 517 MovieClip Frame 66 (25 B)
_root.playSound("move");
Symbol 517 MovieClip Frame 131 (87 B)
_root.playSound("invalid");
tutorial_invalidmove_mc1.gotoAndPlay("forceinvalidmove");
Symbol 519 Button (69 B)
on (release) {
_root.playSound("standard_click_fx");
prevFrame();
}
Symbol 522 MovieClip Frame 41 (37 B)
_root.playSound("harvest_start_fx");
Symbol 522 MovieClip Frame 46 (31 B)
_root.playSound("harvest_fx");
Symbol 522 MovieClip Frame 51 (31 B)
_root.playSound("harvest_fx");
Symbol 522 MovieClip Frame 56 (31 B)
_root.playSound("harvest_fx");
Symbol 525 MovieClip Frame 53 (25 B)
_root.playSound("move");
Symbol 525 MovieClip Frame 56 (1 B)
Symbol 525 MovieClip Frame 80 (25 B)
_root.playSound("move");
Symbol 525 MovieClip Frame 83 (1 B)
Symbol 525 MovieClip Frame 106 (25 B)
_root.playSound("move");
Symbol 525 MovieClip Frame 109 (1 B)
Symbol 525 MovieClip Frame 132 (25 B)
_root.playSound("move");
Symbol 525 MovieClip Frame 135 (1 B)
Symbol 528 MovieClip Frame 32 (37 B)
_root.playSound("harvest_start_fx");
Symbol 528 MovieClip Frame 35 (36 B)
_root.playSound("harvest_line_fx");
Symbol 531 MovieClip Frame 32 (37 B)
_root.playSound("harvest_start_fx");
Symbol 531 MovieClip Frame 35 (39 B)
_root.playSound("harvest_onetype_fx");
Symbol 536 MovieClip Frame 1 (8 B)
stop();
Symbol 539 Button (86 B)
on (release) {
_root.playSound("mainmenu_click_fx");
_root.gotoAndStop("welcome");
}
Symbol 550 Button (86 B)
on (release) {
_root.playSound("mainmenu_click_fx");
_root.gotoAndStop("welcome");
}