Symbol 19 MovieClip [Tear] Frame 1
#initclip 24
Object.registerClass("Tear", com.king.farmmatch.Tear);
#endinitclip
Symbol 115 MovieClip [Poof] Frame 1
#initclip 17
Object.registerClass("Poof", com.king.farmmatch.Poof);
#endinitclip
Symbol 125 MovieClip [Chippie] Frame 1
#initclip 18
Object.registerClass("Chippie", com.king.farmmatch.Chippie);
#endinitclip
Symbol 143 MovieClip [Instructions] Frame 1
#initclip 19
Object.registerClass("Instructions", com.king.farmmatch.Instructions);
#endinitclip
Symbol 144 MovieClip [TearSpawner] Frame 1
#initclip 20
Object.registerClass("TearSpawner", com.king.farmmatch.TearSpawner);
#endinitclip
Symbol 148 MovieClip [TilePlaceholder] Frame 1
#initclip 21
Object.registerClass("TilePlaceholder", com.king.farmmatch.TilePlaceholder);
#endinitclip
Symbol 152 MovieClip [GameArea] Frame 1
#initclip 22
Object.registerClass("GameArea", com.king.farmmatch.GameArea);
#endinitclip
Symbol 167 MovieClip [Timer] Frame 1
#initclip 23
Object.registerClass("Timer", com.king.farmmatch.LevelTimer);
#endinitclip
Symbol 203 MovieClip Frame 1
function onEnterFrame() {
var _local1 = (int(getTimer() / 83.3333333333333) % 4) + 1;
pig0.gotoAndStop(_local1);
pig1.gotoAndStop(_local1);
cow0.gotoAndStop(_local1);
cow1.gotoAndStop(_local1);
}
Symbol 250 MovieClip Frame 1
function setScore(score, won) {
this.won = won;
var _local2 = 0;
while (_local2 < 5) {
this["n" + _local2].gotoAndStop(1 + (won ? 0 : 10));
var _local3 = score % 10;
targetDigits[_local2] = _local3;
score = int(score / 10);
digits[_local2] = -9;
_local2++;
}
lastShowTime = getTimer();
}
function onEnterFrame() {
var _local4 = getTimer();
while ((_local4 - lastShowTime) > tickTime) {
lastShowTime = _local4;
var _local2 = 0;
while (_local2 < 5) {
if (digits[_local2] < targetDigits[_local2]) {
digits[_local2]++;
}
var _local3 = digits[_local2];
if (_local3 < 0) {
_local3 = 0;
}
this["n" + _local2].gotoAndStop((_local3 + 1) + (won ? 0 : 10));
_local2++;
}
}
}
var targetScore = 31337;
var currentScore = 0;
var digits = new Array(5);
var targetDigits = new Array(5);
var won = false;
var i = 0;
while (i < 5) {
digits[i] = -9;
targetDigits[i] = -9;
i++;
}
var lastShowTime = getTimer();
var tickTime = 166.666666666667;
Symbol 258 Button
on (press) {
_root.tileLayer.exitButtonPressed();
}
Symbol 265 Button
on (press) {
_root.tileLayer.soundButtonPressed();
}
Symbol 267 MovieClip [__Packages.com.king.farmmatch.Poof] Frame 0
class com.king.farmmatch.Poof extends MovieClip
{
var ts, ss, _rotation, xd, yd, _x, xStart, _y, yStart, startTime, pic, gotoAndStop, _xscale, _yscale, _alpha, removeMovieClip;
function Poof () {
super();
}
function init(x, y, d) {
var _local3 = d + (((Math.random() * Math.PI) * 2) / 20);
var _local2 = (Math.random() * 0.5) + 0.5;
ts = (Math.random() * 0.2) + 0.9;
ss = (Math.random() * 0.5) + 0.5;
_rotation = Math.random() * 360;
xd = Math.sin(_local3) * _local2;
yd = Math.cos(_local3) * _local2;
_x = (xStart = x + ((xd * 32) * _local2));
_y = (yStart = y + ((yd * 32) * _local2));
startTime = getTimer();
pic = int(Math.random() * 6);
gotoAndStop(pic + 1);
onEnterFrame();
}
function onEnterFrame() {
var _local3 = ((getTimer() - startTime) / 100) * ts;
var _local2 = Math.sqrt(_local3);
_local2 = _local2 * _local2;
_x = xStart + ((xd * _local2) * 5);
_y = (yStart + ((yd * _local2) * 5)) + _local2;
_xscale = (_yscale = (100 - (_local3 * 12)) * ss);
_alpha = 100 - (_local3 * 12);
if ((_alpha <= 0) || (_xscale <= 0)) {
removeMovieClip();
}
}
}
Symbol 268 MovieClip [__Packages.com.king.farmmatch.Chippie] Frame 0
class com.king.farmmatch.Chippie extends MovieClip
{
static var allChippies;
var sign, chip, live, _y, _xscale, _yscale;
function Chippie () {
super();
}
static function triggerRandom(value) {
allChippies[int(Math.random() * allChippies.length)].trigger(value);
}
function trigger(value) {
sign.text = value;
startTime = getTimer();
chip._rotation = (Math.random() * 20) - 10;
onEnterFrame = animate;
chip._visible = true;
live = true;
}
function onEnterFrame() {
sign = chip.c.sign;
chip._visible = false;
live = false;
chip._visible = false;
onEnterFrame = undefined;
if (allChippies == undefined) {
allChippies = new Array();
}
var _local2 = _y / 450;
_xscale = (_yscale = 50 + (_local2 * 50));
allChippies.push(this);
}
function animate() {
var _local2 = (getTimer() - startTime) / 1200;
if (_local2 > 0) {
if (_local2 > 1) {
startTime = -1;
onEnterFrame = undefined;
chip._visible = false;
live = false;
}
var _local3 = Math.sin(_local2 * Math.PI) * 110;
if (_local3 > 62) {
_local3 = 62;
}
chip.c._y = -_local3;
}
}
var startTime = -1;
}
Symbol 269 MovieClip [__Packages.com.king.farmmatch.Instructions] Frame 0
class com.king.farmmatch.Instructions extends MovieClip
{
var startTime, arrow0, arrow1, arrow2;
function Instructions () {
super();
startTime = getTimer();
}
function onEnterFrame() {
var _local2 = getTimer() - startTime;
arrow0._visible = ((int(_local2 / 672) & 1) == 0) && ((int(_local2 / 2688) % 3) == 0);
arrow1._visible = ((int(_local2 / 672) & 1) == 0) && ((int(_local2 / 2688) % 3) == 1);
arrow2._visible = ((int(_local2 / 672) & 1) == 0) && ((int(_local2 / 2688) % 3) == 2);
}
}
Symbol 270 MovieClip [__Packages.com.king.farmmatch.TearSpawner] Frame 0
class com.king.farmmatch.TearSpawner extends MovieClip
{
var lastTime, unprocessed, tearTick, attachMovie;
function TearSpawner () {
super();
lastTime = getTimer();
unprocessed = 0;
tearTick = 0;
}
function onEnterFrame() {
var _local4 = getTimer();
unprocessed = unprocessed + (_local4 - lastTime);
lastTime = _local4;
while (unprocessed > 100) {
unprocessed = unprocessed - 100;
if ((int(tearTick / 10) % 2) == 1) {
var _local2 = 0;
while (_local2 < 2) {
var _local3 = attachMovie("Tear", "tear" + td, td);
_local3.init((_local2 * Math.PI) - 1.3);
td = (td + 1) & 255;
_local2++;
}
}
tearTick++;
}
}
var td = 0;
}
Symbol 271 MovieClip [__Packages.com.king.farmmatch.TilePlaceholder] Frame 0
class com.king.farmmatch.TilePlaceholder extends MovieClip
{
var outline, pressListener, id;
function TilePlaceholder () {
super();
}
function init(pressListener, id) {
outline._visible = false;
this.pressListener = pressListener;
this.id = id;
}
function onPress() {
pressListener.tileClicked(id);
}
}
Symbol 272 MovieClip [__Packages.com.king.farmmatch.GameArea] Frame 0
class com.king.farmmatch.GameArea extends MovieClip
{
var currentChainVal, currentChain, clickQueue, hasPlayedTimeWarning, state, stateStartTime, communicator, unhappyMeters, remainingCards, level, score, tileHolders, thPile, nextStateTime, random, lastPairTime, levelStartTime, scorePerPair, timelimit, timeBonus, deck, tiles, tileLayer, tilePointer, revealedCards, selected;
function GameArea () {
super();
currentChainVal = -1;
currentChain = 0;
clickQueue = new Array();
_global.animUntil = getTimer();
hasPlayedTimeWarning = false;
state = STATE_INIT;
stateStartTime = getTimer();
communicator = new com.king.farmmatch.Communicator();
_root.infoPanel.onPress = mx.utils.Delegate.create(this, infoPanelPressed);
_root.infoPanel.bg.gotoAndStop(1);
_root.infoPanel.result._visible = false;
_root.infoPanel.scoreMeter._visible = false;
unhappyMeters = new Array(8);
_root.infoPanel.danceAnimation._visible = false;
_root.levelIndicator._visible = false;
remainingCards.text = "";
}
function init() {
level = 0;
score = 0;
tileHolders = new Array(20);
var _local4 = 0;
while (_local4 < 20) {
tileHolders[_local4] = this["th" + _local4];
tileHolders[_local4].init(this, _local4);
_local4++;
}
thPile._visible = false;
communicator.parseGameData(_root.gameData);
if (communicator.relaxMode) {
level = 2;
}
communicator.gameStarted();
state = STATE_SHOW_INSTRUCTIONS;
stateStartTime = getTimer();
nextStateTime = getTimer() + 15000;
_root.infoPanel._visible = true;
random = new src.util.Random(communicator.randomSeed);
com.king.farmmatch.Sounds.get("introSound").play();
_root.soundButtonText = _global.textMappings.sound_on;
_root.exitButtonText = _global.textMappings.exit_game;
_root.scoreText = _global.textMappings.score;
_root.infoPanel.title.text = _global.textMappings.instructions_title;
_root.infoPanel.text.text = _global.textMappings.instructions;
}
function nextLevel(time) {
currentChainVal = -1;
currentChain = 0;
lastPairTime = 0;
levelStartTime = time;
communicator.sendStartLevel(levelStartTime);
scorePerPair = PAIR_SCORES[level];
timelimit = LEVEL_TIMES[level];
timeBonus = 500;
var _local2 = 0;
while (_local2 < 8) {
unhappyMeters[_local2] = 0;
_local2++;
}
deck = new com.king.farmmatch.Deck(level, random);
tiles = new Array(deck.size);
var _local3 = 0;
while (_local3 < deck.size) {
tiles[_local3] = new com.king.farmmatch.Tile(this, tileLayer, thPile._x + 11, thPile._y + 11, _local3, deck.pop());
_local3++;
}
tilePointer = 0;
_local3 = 0;
while (_local3 < 20) {
tiles[_local3].firstFlyTo(tileHolders[_local3]._x + 37, tileHolders[_local3]._y + 37, _local3 * 100, false);
tileHolders[_local3].tile = tiles[_local3];
tilePointer++;
_local3++;
}
_local3 = 0;
while (_local3 < 20) {
updateMood(_local3);
_local3++;
}
if (!communicator.relaxMode) {
level++;
}
revealedCards = 0;
remainingCards.text = "" + deck.size;
clickQueue = new Array();
}
function infoPanelPressed() {
if (getTimer() > (stateStartTime + 250)) {
nextStateTime = getTimer();
}
}
function updateMood(id) {
if (this["th" + id].tile != undefined) {
if (unhappyMeters[this["th" + id].tile.value] > 12) {
this["th" + id].tile.setMood(com.king.farmmatch.Tile.MOOD_SAD);
} else {
var _local4 = id % 5;
var _local3 = false;
if (((_local4 > 0) && (this["th" + (id - 1)].tile != undefined)) && (this["th" + (id - 1)].tile.matches(this["th" + id].tile))) {
_local3 = true;
}
if (((_local4 < 4) && (this["th" + (id + 1)].tile != undefined)) && (this["th" + (id + 1)].tile.matches(this["th" + id].tile))) {
_local3 = true;
}
this["th" + id].tile.setMood((_local3 ? (com.king.farmmatch.Tile.MOOD_HAPPY) : (com.king.farmmatch.Tile.MOOD_IDLE)));
}
}
}
function tileClicked(id) {
if (getTimer() < _global.animUntil) {
clickQueue.push(id);
return(undefined);
}
var _local5 = getTimer();
var _local8 = score;
if (state != STATE_PLAY) {
return(undefined);
}
if (selected != undefined) {
this["th" + selected].outline._visible = false;
updateMood(selected);
}
if (selected == id) {
selected = undefined;
} else {
var _local6 = (id % 5) - (selected % 5);
var _local7 = int(id / 5) - int(selected / 5);
if (tileHolders[id].tile == undefined) {
selected = undefined;
} else if (((((selected != undefined) && (_local6 >= -1)) && (_local7 >= -1)) && (_local6 <= 1)) && (_local7 <= 1)) {
clickPair(_local5, selected, id);
} else {
selected = id;
}
}
if (selected != undefined) {
this["th" + selected].outline._visible = true;
this["th" + selected].tile.setMood(com.king.farmmatch.Tile.MOOD_SELECTED);
}
checkStatus(_local5);
communicator.clickAt(id, _local5, score - _local8);
if (hasWon()) {
com.king.farmmatch.Sounds.get("music0").stop();
com.king.farmmatch.Sounds.get("music1").stop();
com.king.farmmatch.Sounds.get("music2").stop();
com.king.farmmatch.Sounds.get("timeRunningOutSound").stop();
hasPlayedTimeWarning = false;
remainingCards.text = "";
if ((!_global.shortGameMode) && (level < 3)) {
if (!communicator.relaxMode) {
com.king.farmmatch.Sounds.get("levelCompleted").play();
}
_root.levelIndicator.gotoAndStop(level + 1);
state = STATE_SHOW_LEVEL_SPLASH;
stateStartTime = getTimer();
nextStateTime = getTimer() + 3500;
} else {
win();
}
} else if (!hasPair()) {
com.king.farmmatch.Sounds.get("music0").stop();
com.king.farmmatch.Sounds.get("music1").stop();
com.king.farmmatch.Sounds.get("music2").stop();
noMorePairs();
}
}
function clickPair(time, from, to) {
if (((tileHolders[from].tile != undefined) && (tileHolders[to].tile != undefined)) && (tileHolders[from].tile.matches(tileHolders[to].tile))) {
if (currentChainVal == tileHolders[from].tile.value) {
currentChain++;
} else {
currentChainVal = tileHolders[from].tile.value;
currentChain = 0;
}
unhappyMeters[tileHolders[from].tile.value] = 0;
com.king.farmmatch.Sounds.get("Animal" + tileHolders[to].tile.value).play();
var _local6 = ((tileHolders[from]._x + 37) + (tileHolders[to]._x + 37)) / 2;
var _local7 = ((tileHolders[from]._y + 37) + (tileHolders[to]._y + 37)) / 2;
tileHolders[from].tile.dieTo(_local6, _local7);
tileHolders[to].tile.dieTo(_local6, _local7);
tileHolders[from].tile = undefined;
tileHolders[to].tile = undefined;
selected = undefined;
var _local5 = 0;
_local5 = _local5 + scorePerPair;
_local5 = _local5 + (25 * currentChain);
var _local9 = time - lastPairTime;
var _local8 = 5 - int(_local9 / 500);
if (_local8 > 0) {
_local5 = _local5 + _local8;
}
lastPairTime = time;
score = score + _local5;
scoreGained = scoreGained + _local5;
_root.scoreMeter.text = score;
com.king.farmmatch.Chippie.triggerRandom(scorePerPair);
pack();
} else {
selected = to;
}
}
function checkStatus(time) {
if (hasWon()) {
var _local3 = ((time - levelStartTime) - 999) / 1000;
var _local5 = 1 - (_local3 / timelimit);
var _local4 = int(_local5 * timeBonus);
timeBonusGained = timeBonusGained + _local4;
score = score + _local4;
_root.debugText.text = (((("Time bonus: " + _local3) + "/ ") + timelimit) + " -> ") + int(_local5 * timeBonus);
_root.scoreMeter.text = score;
}
}
function hasWon() {
var _local2 = 0;
while (_local2 < 20) {
if (tileHolders[_local2].tile != undefined) {
return(false);
}
_local2++;
}
return(true);
}
function hasPair() {
var _local5 = 0;
while (_local5 < 5) {
var _local4 = 0;
while (_local4 < 4) {
var _local7 = (_local4 * 5) + _local5;
if (tileHolders[_local7].tile != undefined) {
var _local3 = _local5 - 1;
while (_local3 <= (_local5 + 1)) {
var _local2 = _local4 - 1;
while (_local2 <= (_local4 + 1)) {
var _local6 = (_local2 * 5) + _local3;
if (((((((_local3 >= 0) && (_local2 >= 0)) && (_local3 < 5)) && (_local2 < 4)) && ((_local3 != _local5) || (_local2 != _local4))) && (tileHolders[_local6].tile != undefined)) && (tileHolders[_local6].tile.matches(tileHolders[_local7].tile))) {
return(true);
}
_local2++;
}
_local3++;
}
}
_local4++;
}
_local5++;
}
return(false);
}
function pack() {
var _local2 = 0;
var _local5 = 0;
var _local4 = 0;
while (_local4 < 20) {
if (tileHolders[_local4].tile == undefined) {
_local2++;
} else if (_local2 > 0) {
_local5++;
tileHolders[_local4 - _local2].tile = tileHolders[_local4].tile;
tileHolders[_local4].tile = undefined;
tileHolders[_local4 - _local2].tile.flyTo(tileHolders[_local4 - _local2]._x + 37, tileHolders[_local4 - _local2]._y + 37, _local5 * 50);
}
_local4++;
}
_local4 = 20 - _local2;
while (_local4 < 20) {
if (tilePointer < deck.size) {
_local5++;
tiles[tilePointer].firstFlyTo(tileHolders[_local4]._x + 37, tileHolders[_local4]._y + 37, _local5 * 50, true);
tileHolders[_local4].tile = tiles[tilePointer];
tilePointer++;
}
_local4++;
}
var _local3 = 0;
while (_local3 < 8) {
unhappyMeters[_local3]++;
_local3++;
}
_local4 = 0;
while (_local4 < 20) {
updateMood(_local4);
_local4++;
}
}
function onEnterFrame() {
switch (state) {
case STATE_INIT :
_root.timer._visible = false;
if (DEBUG_MODE) {
_root.gameData = DEBUG_GAME_DATA;
}
if (_root.gameData != undefined) {
init();
return(undefined);
}
break;
case STATE_SHOW_INSTRUCTIONS :
_root.hider._visible = false;
_root.timer._visible = false;
var _local6 = int(((nextStateTime - getTimer()) + 999) / 1000);
if (_local6 <= 0) {
com.king.farmmatch.Sounds.get("introSound").stop();
_root.infoPanel._visible = false;
_root.levelIndicator.gotoAndStop(level + 1);
if (!communicator.relaxMode) {
com.king.farmmatch.Sounds.get("levelCompleted").play();
}
state = STATE_SHOW_LEVEL_SPLASH;
stateStartTime = getTimer();
nextStateTime = getTimer() + 3500;
_local6 = 0;
}
_root.infoPanel.timer.text = _global.textMappings.game_starts_in.split("[0]").join(_local6);
break;
case STATE_SHOW_LEVEL_SPLASH :
var _local5 = (getTimer() - stateStartTime) / 6;
if (_local5 > 100) {
_local5 = 100;
}
_root.levelIndicator._visible = true;
_root.levelIndicator._xscale = (_root.levelIndicator._yscale = (_local5 * _local5) / 100);
_root.levelIndicator._rotation = (100 - _local5) * 6;
if (((nextStateTime - getTimer()) <= 0) || (communicator.relaxMode)) {
_root.levelIndicator._visible = false;
state = STATE_PLAY;
com.king.farmmatch.Sounds.get("music" + level).playLooping();
com.king.farmmatch.Sounds.get("music" + level).setVolume(50);
stateStartTime = getTimer();
nextLevel(stateStartTime);
_local6 = 0;
}
_root.infoPanel.timer.text = _global.textMappings.game_starts_in.split("[0]").join(_local6);
break;
case STATE_PLAY :
if ((clickQueue.length > 0) && (getTimer() > _global.animUntil)) {
var _local4 = 0;
while (_local4 < clickQueue.length) {
tileClicked(clickQueue[_local4]);
_local4++;
}
clickQueue = new Array();
return(undefined);
}
if (!communicator.relaxMode) {
var _local9 = ((getTimer() - levelStartTime) - 999) / 1000;
var _local7 = int(timelimit - _local9);
var _local8 = ((getTimer() - levelStartTime) / 1000) / timelimit;
_root.timer._visible = true;
_root.timer.setProgress(_local8);
src.util.TimeVerifier.checkTime();
if ((_local7 <= 5) && (!hasPlayedTimeWarning)) {
hasPlayedTimeWarning = true;
com.king.farmmatch.Sounds.get("timeRunningOutSound").play();
}
if (_local7 <= 0) {
com.king.farmmatch.Sounds.get("music0").stop();
com.king.farmmatch.Sounds.get("music1").stop();
com.king.farmmatch.Sounds.get("music2").stop();
_local7 = 0;
com.king.farmmatch.Sounds.get("timeRunningOutSound").stop();
outOfTime();
}
}
break;
case STATE_GAME_OVER :
if (getTimer() > (stateStartTime + 1000)) {
_root.infoPanel._visible = true;
}
_local6 = int(((nextStateTime - getTimer()) + 999) / 1000);
if (_local6 <= 0) {
communicator.gameQuit();
state = STATE_GAME_QUIT;
stateStartTime = getTimer();
_local6 = 0;
}
_root.infoPanel.timer.text = _global.textMappings.game_ends_in.split("[0]").join(_local6);
}
}
function cardFlipped() {
revealedCards++;
if (deck.size == revealedCards) {
remainingCards.text = "";
} else {
remainingCards.text = "" + (deck.size - revealedCards);
}
}
function win() {
com.king.farmmatch.Sounds.get("winSound").play();
_root.infoPanel.title.text = _global.textMappings.win_title;
_root.infoPanel.text.text = "";
_root.infoPanel.danceAnimation._visible = true;
_root.infoPanel.instructions._visible = false;
communicator.gameEnd(score);
state = STATE_GAME_OVER;
stateStartTime = getTimer();
nextStateTime = getTimer() + 5000;
showFinalScores(true);
}
function noMorePairs() {
_root.infoPanel.bg.gotoAndStop(2);
com.king.farmmatch.Sounds.get("loseSound").play();
_root.infoPanel.title.text = _global.textMappings.out_of_moves_title;
_root.infoPanel.text.text = _global.textMappings.out_of_moves_text;
_root.infoPanel.instructions._visible = false;
_root.infoPanel.result._y = _root.infoPanel.result._y + 50;
communicator.gameEnd(score);
state = STATE_GAME_OVER;
stateStartTime = getTimer();
nextStateTime = getTimer() + 5000;
showFinalScores(false);
}
function outOfTime() {
_root.infoPanel.bg.gotoAndStop(2);
com.king.farmmatch.Sounds.get("loseSound").play();
remainingCards.text = "";
_root.infoPanel._visible = true;
_root.infoPanel.title.text = _global.textMappings.out_of_time_title;
_root.infoPanel.text.text = _global.textMappings.out_of_time_text;
_root.infoPanel.instructions._visible = false;
_root.infoPanel.result._y = _root.infoPanel.result._y + 50;
communicator.gameEnd(score);
state = STATE_GAME_OVER;
stateStartTime = getTimer();
nextStateTime = getTimer() + 5000;
showFinalScores(false);
}
function showFinalScores(won) {
_root.endScoreText = (_global.textMappings.score_label + "\r") + _global.textMappings.time_bonus_label;
_root.finalScoreText = _global.textMappings.total_score_label;
_root.infoPanel.scoreMeter._visible = true;
_root.infoPanel.scoreMeter.setScore(scoreGained + timeBonusGained, won);
_root.scoreValueText = (scoreGained + "\r") + timeBonusGained;
_root.finalScoreValueText = "" + (scoreGained + timeBonusGained);
_root.infoPanel.result._visible = true;
}
function soundButtonPressed() {
com.king.farmmatch.Sounds.toggleSound();
soundOn = !soundOn;
_root.soundButtonText = (soundOn ? (_global.textMappings.sound_on) : (_global.textMappings.sound_off));
}
function exitButtonPressed() {
if (state != STATE_GAME_OVER) {
com.king.farmmatch.Sounds.get("music0").stop();
com.king.farmmatch.Sounds.get("music1").stop();
com.king.farmmatch.Sounds.get("music2").stop();
com.king.farmmatch.Sounds.get("timeRunningOutSound").stop();
_root.infoPanel.bg.gotoAndStop(2);
com.king.farmmatch.Sounds.get("loseSound").play();
_root.infoPanel.title.text = _global.textMappings.game_exited_title;
_root.infoPanel.text.text = _global.textMappings.game_exited_text;
_root.infoPanel.instructions._visible = false;
_root.infoPanel.result._y = _root.infoPanel.result._y + 50;
communicator.gameEnd(score);
state = STATE_GAME_OVER;
stateStartTime = getTimer();
nextStateTime = getTimer() + 5000;
showFinalScores(false);
}
}
var DEBUG_MODE = false;
static var PAIR_SCORES = [100, 110, 120];
static var LEVEL_TIMES = [60, 120, 180];
static var STATE_INIT = 0;
static var STATE_SHOW_INSTRUCTIONS = 1;
static var STATE_SHOW_LEVEL_SPLASH = 2;
static var STATE_PLAY = 3;
static var STATE_GAME_OVER = 4;
static var STATE_GAME_QUIT = 5;
var DEBUG_GAME_DATA = "<gamedata randomseed=\"1859686622\" timelimit=\"300\" relaxMode=\"true\"> <text id=\"sound_off\">Sound off</text> <text id=\"sound_on\">Sound on</text> <text id=\"exit_game\">Exit game</text> <text id=\"instructions_title\">GAME INSTRUCTIONS</text> <text id=\"instructions\">Match the pairs to remove them. The cards have to be touching horisontally, vertically or diagonally to be removeable. Your challenge is to clear all cards in the deck and on the table without ending up in a locked position.</text> <text id=\"score\">SCORE</text> <text id=\"game_starts_in\">The game will start in [0] seconds</text> <text id=\"game_ends_in\">The game will end in [0] seconds</text> <text id=\"win_title\">YOU WIN</text> <text id=\"win_text\">You won! Yay!</text> <text id=\"out_of_moves_title\">OUT OF MOVES</text> <text id=\"out_of_moves_text\">There are no more possible moves!</text> <text id=\"out_of_time_title\">OUT OF TIME</text> <text id=\"out_of_time_text\">You ran out of time!</text> <text id=\"score_label\">Score:</text> <text id=\"time_bonus_label\">Time Bonus:</text> <text id=\"total_score_label\">Total Score:</text> <text id=\"game_exited_title\">Game exited</text> <text id=\"game_exited_text\">You quit the game</text></gamedata>";
var scoreGained = 0;
var timeBonusGained = 0;
var soundOn = true;
}
Symbol 273 MovieClip [__Packages.com.king.farmmatch.Communicator] Frame 0
class com.king.farmmatch.Communicator
{
var randomSeed, relaxMode;
function Communicator () {
}
function gameStarted() {
fscommand ("gameStart");
fscommand ("playData", ((CMD_INIT + ",") + VERSION_NUM) + "=0");
}
function gameEnd(score) {
if (!hasSentGameEnd) {
hasSentGameEnd = true;
fscommand ("gameEnd", score);
}
}
function gameQuit() {
if (!hasSentGameOver) {
hasSentGameOver = true;
fscommand ("gameQuit");
}
}
function sendEndGamePressed() {
fscommand ("playData", CMD_END_GAME_PRESSED + "=0");
}
function sendStartLevel(startTime) {
fscommand ("playData", ((CMD_START_LEVEL + ",") + startTime) + "=0");
}
function clickAt(id, time, scoreGained) {
fscommand ("playData", (((((((CMD_CLICK_AT + ",") + id) + " ") + time) + " ") + (clickCounter++)) + "=") + scoreGained);
}
function parseGameData(gameData) {
var _local6 = new XML(_root.gameData);
_global.shortGameMode = new String(_local6.childNodes[0].attributes.mode) == "short";
_global.textMappings = new Object();
var _local5 = _local6.childNodes[0].childNodes;
randomSeed = new Number(_local6.childNodes[0].attributes.randomseed).valueOf();
relaxMode = new String(_local6.firstChild.attributes.relaxMode) == "true";
var _local4 = 0;
while (_local4 < _local5.length) {
if (_local5[_local4].nodeName == "text") {
_global.textMappings[_local5[_local4].attributes.id] = new String(_local5[_local4].firstChild.nodeValue);
_root.debugText.text = _root.debugText.text + ((("_global.textMappings[\"" + _local5[_local4].attributes.id) + "\"] = ") + new String(_local5[_local4].firstChild.nodeValue + "\r"));
}
_local4++;
}
}
var hasSentGameEnd = false;
var hasSentGameOver = false;
static var VERSION_NUM = 0;
static var CMD_INIT = 442;
static var CMD_START_LEVEL = 787;
static var CMD_CLICK_AT = 271;
static var CMD_END_GAME_PRESSED = 602;
var clickCounter = 0;
}
Symbol 274 MovieClip [__Packages.mx.utils.Delegate] Frame 0
class mx.utils.Delegate extends Object
{
var func;
function Delegate (f) {
super();
func = f;
}
static function create(obj, func) {
var _local2 = function () {
var _local2 = arguments.callee.target;
var _local3 = arguments.callee.func;
return(_local3.apply(_local2, arguments));
};
_local2.target = obj;
_local2.func = func;
return(_local2);
}
function createDelegate(obj) {
return(create(obj, func));
}
}
Symbol 275 MovieClip [__Packages.src.util.Random] Frame 0
class src.util.Random
{
var mta, mti, lastSeed;
function Random (aSeed) {
mta = new Array(N);
mti = N + 1;
if (aSeed != undefined) {
init_genrand(aSeed);
}
}
function set seed(s) {
init_genrand(s);
//return(seed);
}
function get seed() {
return(lastSeed);
}
function nextInt(n) {
return((genrand_int32() & 2147483647) % n);
}
function nextFloat() {
return(next(24) / 16777216);
}
function nextDouble() {
return(next(24) / 16777216);
}
function next(bits) {
if (bits < 32) {
return(genrand_int32() & ((1 << bits) - 1));
}
return(genrand_int32());
}
function init_genrand(s) {
s = int(s);
trace("Random::init_genrand(): seed=" + s);
var _local6 = getTimer();
lastSeed = s;
mta[0] = s;
var _local2 = s;
var _local3 = new src.util.Integer64();
var _local4 = N;
mti = 1;
while (mti < _local4) {
_local3.init32((_local2 >>> 30) ^ _local2);
_local3.mulu32(1812433253);
_local2 = (mta[mti] = int(_local3.lsb + mti));
mti++;
}
var _local7 = getTimer();
trace(("Random::init_genrand(): initialization ~" + (_local7 - _local6)) + "ms");
}
function genrand_int32() {
var _local9 = N;
var _local3 = 0;
if (mti >= _local9) {
if (mti == (_local9 + 1)) {
init_genrand(5489);
}
var _local8 = M;
var _local6 = UPPER_MASK;
var _local4 = LOWER_MASK;
var _local5 = mag01;
var _local11 = getTimer();
var _local2 = 0;
var _local7 = _local9 - _local8;
var _local10 = _local8 - _local9;
_local2 = 0;
while (_local2 < _local7) {
_local3 = (mta[_local2] & _local6) | (mta[_local2 + 1] & _local4);
mta[_local2] = (mta[_local2 + _local8] ^ (_local3 >>> 1)) ^ _local5[_local3 & 1];
_local2++;
}
_local7 = _local9 - 1;
while (_local2 < _local7) {
_local3 = (mta[_local2] & _local6) | (mta[_local2 + 1] & _local4);
mta[_local2] = (mta[_local2 + _local10] ^ (_local3 >>> 1)) ^ _local5[_local3 & 1];
_local2++;
}
_local3 = (mta[_local9 - 1] & _local6) | (mta[0] & _local4);
mta[_local9 - 1] = (mta[_local8 - 1] ^ (_local3 >>> 1)) ^ _local5[_local3 & 1];
mti = 0;
var _local12 = getTimer();
trace(((("Random::genrand_int32(): precalc " + _local9) + " new numbers ~") + (_local12 - _local11)) + "ms");
}
_local3 = mta[mti++];
_local3 = _local3 ^ (_local3 >>> 11);
_local3 = _local3 ^ ((_local3 << 7) & 2636928640);
_local3 = _local3 ^ ((_local3 << 15) & 4022730752);
_local3 = _local3 ^ (_local3 >>> 18);
return(_local3);
}
static var N = 624;
static var M = 397;
static var MATRIX_A = 2567483615;
static var UPPER_MASK = 2147483648;
static var LOWER_MASK = 2147483647;
static var mag01 = [0, 2567483615];
}
Symbol 276 MovieClip [__Packages.src.util.Integer64] Frame 0
class src.util.Integer64
{
var r, p, s;
function Integer64 (lowInt) {
r = [[0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0]];
p = [0, 0, 0, 0, 0];
s = [0, 0, 0];
if (lowInt != undefined) {
merge(lowInt);
}
}
function init(v) {
var _local2 = 0;
while (_local2 < p.length) {
p[_local2] = v.p[_local2];
_local2++;
}
}
function init32(n) {
p[0] = n & 32767;
n = n >>> 15;
p[1] = n & 32767;
n = n >>> 15;
p[2] = n & 3;
p[3] = 0;
p[4] = 0;
}
function get lsb() {
return((p[0] | (p[1] << SH)) | ((p[2] & 3) << 30));
}
function get msb() {
return((((p[2] >> 2) | ((p[3] << SH) >> 2)) | ((p[4] << (SH * 2)) >> 2)) & 2147483647);
}
function binaryShiftLeft(step) {
var _local2 = 0;
while (_local2 < step) {
shl();
_local2++;
}
}
function binaryShiftRight(step) {
var _local4 = (step / SH) >> 0;
var _local5 = step - (_local4 * SH);
var _local2 = p.length - 1;
while (_local2 > 0) {
var _local3 = 0;
while (_local3 < _local4) {
p[_local3] = p[_local3 + 1];
_local3++;
}
p[_local2--] = 0;
}
if (_local5 > 0) {
var _local3 = 0;
while (_local3 < _local5) {
shr();
_local3++;
}
}
}
function binaryNot(o) {
p[0] = p[0] ^ o.p[0];
p[1] = p[1] ^ o.p[1];
p[2] = p[2] ^ o.p[2];
p[3] = p[3] ^ o.p[3];
p[4] = p[4] ^ o.p[4];
}
function add64(o) {
var _local4 = 0;
var _local3 = 1;
var _local2 = 0;
while ((_local3 < p.length) && (o.p[_local2] != 0)) {
_local3++;
}
_local2 = 0;
while (_local2 < _local3) {
_local4 = _local4 + (p[_local2] + o.p[_local2]);
p[_local2] = _local4 & MASK;
_local4 = _local4 >> SH;
_local2++;
}
}
function add32(num) {
var _local2 = 0;
var _local5 = num & MASK;
num = num >> SH;
var _local6 = num & MASK;
num = num >> SH;
var _local4 = num & 3;
_local2 = _local2 + (p[0] + _local5);
p[0] = _local2 & MASK;
_local2 = _local2 >> SH;
_local2 = _local2 + (p[1] + _local6);
p[1] = _local2 & MASK;
_local2 = _local2 >> SH;
_local2 = _local2 + (p[2] + _local4);
p[2] = _local2 & MASK;
}
function mulu32(num) {
var _local3 = 0;
s[0] = num & MASK;
num = num >>> 15;
s[1] = num & MASK;
num = num >>> 15;
s[2] = num & 3;
var _local2 = 0;
while (_local2 < 3) {
var _local4 = s[_local2];
_local3 = _local4 * p[0];
r[_local2][0] = _local3 & MASK;
_local3 = _local3 >> SH;
_local3 = _local3 + (_local4 * p[1]);
r[_local2][1] = _local3 & MASK;
_local3 = _local3 >> SH;
_local3 = _local3 + (_local4 * p[2]);
r[_local2][2] = _local3 & 3;
_local2++;
}
_local3 = r[0][0];
p[0] = _local3 & MASK;
_local3 = _local3 >> SH;
_local3 = _local3 + (r[0][1] + r[1][0]);
p[1] = _local3 & MASK;
_local3 = _local3 >> SH;
_local3 = _local3 + ((r[0][2] + r[1][1]) + r[2][0]);
p[2] = _local3 & 3;
p[3] = 0;
p[4] = 0;
}
function mul64(o) {
var _local2 = 0;
var _local3 = 0;
while (_local3 < 5) {
var _local4 = o.p[_local3];
_local2 = _local4 * p[0];
r[_local3][0] = _local2 & MASK;
_local2 = _local2 >> SH;
_local2 = _local2 + (_local4 * p[1]);
r[_local3][1] = _local2 & MASK;
_local2 = _local2 >> SH;
_local2 = _local2 + (_local4 * p[2]);
r[_local3][2] = _local2 & MASK;
_local2 = _local2 >> SH;
_local2 = _local2 + (_local4 * p[3]);
r[_local3][3] = _local2 & MASK;
_local2 = _local2 >> SH;
_local2 = _local2 + (_local4 * p[4]);
r[_local3][4] = _local2 & MASK;
_local3++;
}
_local2 = r[0][0];
p[0] = _local2 & MASK;
_local2 = _local2 >> SH;
_local2 = _local2 + (r[0][1] + r[1][0]);
p[1] = _local2 & MASK;
_local2 = _local2 >> SH;
_local2 = _local2 + ((r[0][2] + r[1][1]) + r[2][0]);
p[2] = _local2 & MASK;
_local2 = _local2 >> SH;
_local2 = _local2 + (((r[0][3] + r[1][2]) + r[2][1]) + r[3][0]);
p[3] = _local2 & MASK;
_local2 = _local2 >> SH;
_local2 = _local2 + ((((r[0][4] + r[1][3]) + r[2][2]) + r[3][1]) + r[4][0]);
p[4] = _local2 & 7;
}
function mul32(value) {
mul64(new src.util.Integer64(value));
}
function merge(a) {
var _local2 = 0;
while (_local2 < 3) {
p[_local2] = p[_local2] + (a & 32767);
a = a >>> 15;
_local2++;
}
return(a);
}
function shl() {
var _local5 = 0;
var _local4 = 0;
var _local2 = 0;
var _local3 = p.length;
while (_local2 < _local3) {
_local5 = (p[_local2] & 16384) >> 14;
p[_local2] = p[_local2] << 1;
p[_local2] = (p[_local2] | _local4) & 32767;
_local2++;
_local4 = _local5;
}
}
function shr() {
var _local4 = 0;
var _local3 = 0;
var _local2 = p.length - 1;
while (_local2 >= 0) {
_local4 = (p[_local2] & 1) << 14;
p[_local2] = p[_local2] >> 1;
p[_local2] = (p[_local2] | _local3) & 32767;
_local2--;
_local3 = _local4;
}
}
static var MASK = 32767;
static var SH = 15;
}
Symbol 277 MovieClip [__Packages.com.king.farmmatch.Sounds] Frame 0
class com.king.farmmatch.Sounds
{
static var globalSound;
var soundMc, sound;
function Sounds (ownerMc, soundName) {
var _local2 = ownerMc.getNextHighestDepth();
soundMc = ownerMc.createEmptyMovieClip("soundMcc" + _local2, _local2);
sound = new Sound(soundMc);
sound.attachSound(soundName);
}
static function get(resourceName) {
var _local2 = soundMap[resourceName];
if ((_local2 == undefined) || (_local2 == null)) {
_local2 = new com.king.farmmatch.Sounds(_root, resourceName);
soundMap[resourceName] = _local2;
}
return(_local2);
}
static function toggleSound() {
if (globalSound == undefined) {
globalSound = new Sound(_root);
}
soundOn = !soundOn;
globalSound.setVolume((soundOn ? 100 : 0));
}
function setVolume(volume) {
sound.setVolume(volume);
}
function playLooping() {
sound.start(0, 9999999);
}
function stopAndPlayOffs(offs) {
sound.stop();
sound.start(offs, 0);
}
function stopAndPlay() {
sound.stop();
sound.start(0);
}
function playOffs(offs) {
sound.start(offs, 0);
}
function playOffsVolPan(offs, vol, pan) {
sound.start(offs, 0);
sound.setVolume(vol);
sound.setPan(pan);
}
function play() {
sound.start(0);
}
function stop() {
sound.stop();
}
static var soundMap = new Object();
static var soundOn = true;
}
Symbol 278 MovieClip [__Packages.com.king.farmmatch.Deck] Frame 0
class com.king.farmmatch.Deck
{
var random, size, deck;
function Deck (level, random) {
this.random = random;
var _local5 = TYPES[level];
var _local4 = COUNTS[level];
size = _local5 * _local4;
deck = new Array();
var _local3 = 0;
while (_local3 < _local5) {
var _local2 = 0;
while (_local2 < _local4) {
deck.push(_local3);
_local2++;
}
_local3++;
}
shuffle();
}
function shuffle() {
var _local2 = 0;
while (_local2 < deck.length) {
var _local3 = random.nextInt(deck.length - _local2) + _local2;
var _local4 = deck[_local2];
deck[_local2] = deck[_local3];
deck[_local3] = _local4;
_local2++;
}
}
function pop() {
return(deck.pop());
}
static var TYPES = [6, 7, 8];
static var COUNTS = [6, 8, 10];
}
Symbol 279 MovieClip [__Packages.com.king.farmmatch.Tile] Frame 0
class com.king.farmmatch.Tile
{
var gameArea, dieOnLand, x, y, xTarget, yTarget, scale, scaleTarget, depth, value, tileMc, shadowMc, flips, flipDuration, flipOffset, z, landed, hasShadows, flipTime, rotDir;
function Tile (gameArea, holderMc, x, y, depth, value) {
this.gameArea = gameArea;
dieOnLand = false;
this.x = x;
this.y = y;
xTarget = x;
yTarget = y;
scale = 29.3333333333333;
scaleTarget = 29.3333333333333;
this.depth = depth;
this.value = value;
tileMc = holderMc.attachMovie("TileHolder", "tile" + depth, depth);
showFace();
tileMc.tile.highlight._visible = false;
tileMc.tile.darkness._visible = false;
shadowMc = holderMc.attachMovie("TileShadow", "tileShadow" + depth, 1000 + depth);
shadowMc._alpha = 40;
var _local4 = new flash.filters.BlurFilter(8, 8, 2);
var _local3 = shadowMc.filters;
_local3.push(_local4);
shadowMc.filters = _local3;
land();
tileMc.tile.gotoAndStop(1);
}
function matches(tile) {
return(value == tile.value);
}
function firstFlyTo(xt, yt, delay, fast) {
xTarget = xt;
yTarget = yt;
tileMc.tile.gotoAndStop(1);
if (!fast) {
flips = 1.5;
flipDuration = 800;
flipOffset = 0.5;
} else {
flips = 0.5;
flipDuration = 400;
flipOffset = 0.5;
}
flip(delay);
}
function flyTo(xt, yt, delay) {
xTarget = xt;
yTarget = yt;
if (yt == y) {
flips = 0;
flipOffset = 0;
flipDuration = 300;
slide(delay);
} else {
flips = 1;
flipOffset = 0;
flipDuration = 400;
flip(delay);
}
}
function dieTo(xt, yt) {
dieOnLand = true;
xTarget = xt;
yTarget = yt;
flips = 0;
flipOffset = 0;
flipDuration = 150;
slide(0);
scaleTarget = 10;
tileMc.swapDepths(2000 + depth);
}
function land() {
x = xTarget;
y = yTarget;
z = 0;
scale = scaleTarget;
shadowMc._visible = false;
tileMc._x = x;
tileMc._y = y - z;
tileMc.tile.highlight._visible = false;
tileMc.tile.darkness._visible = false;
landed = true;
hasShadows = false;
tileMc.swapDepths(depth);
tileMc.tile._rotation = 0;
tileMc._rotation = 0;
tileMc._xscale = scale;
tileMc._yscale = scale;
showFace();
tileMc.onEnterFrame = undefined;
if (dieOnLand) {
var _local2 = 0;
while (_local2 < 5) {
var _local3 = tileMc._parent.attachMovie("Poof", "poof" + pp, 5000 + pp);
_local3.init(tileMc._x, tileMc._y, ((_local2 * Math.PI) * 2) / 5);
pp++;
_local2++;
}
remove();
}
}
function slide(delay) {
if (!landed) {
return(undefined);
}
_global.animUntil = Math.max(_global.animUntil, getTimer() + delay);
flipTime = getTimer() + delay;
slideAnimate();
scaleTarget = 100;
landed = false;
tileMc.onEnterFrame = mx.utils.Delegate.create(this, slideAnimate);
}
function flip(delay) {
if (!landed) {
return(undefined);
}
_global.animUntil = Math.max(_global.animUntil, getTimer() + delay);
tileMc.swapDepths(2000 + depth);
rotDir = Math.atan2(yTarget - y, xTarget - x);
flipTime = getTimer() + delay;
flipAnimate();
scaleTarget = 100;
landed = false;
tileMc.onEnterFrame = mx.utils.Delegate.create(this, flipAnimate);
}
function showShadows() {
shadowMc._visible = true;
tileMc.tile.highlight._visible = true;
tileMc.tile.darkness._visible = true;
hasShadows = true;
}
function remove() {
tileMc.onEnterFrame = undefined;
tileMc.removeMovieClip();
shadowMc.removeMovieClip();
}
function flipAnimate() {
if (landed) {
return(undefined);
}
if (getTimer() < flipTime) {
return(undefined);
}
if (!hasMadeSound) {
gameArea.cardFlipped();
hasMadeSound = true;
}
if (!hasShadows) {
showShadows();
}
var _local2 = (getTimer() - flipTime) / flipDuration;
if (_local2 > 1) {
_local2 = 1;
land();
return(undefined);
}
var _local4 = (((_local2 * flips) + flipOffset) * Math.PI) * 2;
var _local7 = Math.abs(Math.sin(_local2 * Math.PI) * 32);
var _local3 = rotDir;
var _local11 = Math.cos(_local3) * Math.sin(_local4);
var _local10 = Math.sin(_local3) * Math.sin(_local4);
var _local12 = Math.cos(_local4);
var _local14 = 0.7071;
var _local15 = -0.7071;
var _local13 = 0;
var _local6 = ((_local11 * _local14) + (_local10 * _local15)) + (_local12 * _local13);
var _local9 = x + ((xTarget - x) * _local2);
var _local8 = y + ((yTarget - y) * _local2);
var _local5 = (scale + ((scaleTarget - scale) * _local2)) + (_local7 / 10);
shadowMc._x = _local9 - _local7;
shadowMc._y = _local8;
shadowMc.tile._rotation = ((-_local3) * 180) / Math.PI;
shadowMc._rotation = (_local3 * 180) / Math.PI;
shadowMc._xscale = Math.cos(_local4) * _local5;
shadowMc._yscale = _local5;
tileMc._x = _local9;
tileMc._y = _local8 - _local7;
tileMc.tile._rotation = ((-_local3) * 180) / Math.PI;
tileMc._rotation = (_local3 * 180) / Math.PI;
tileMc._xscale = Math.cos(_local4) * _local5;
tileMc._yscale = _local5;
if (tileMc._xscale < 0) {
tileMc.tile.highlight._alpha = (-_local6) * 80;
tileMc.tile.darkness._alpha = _local6 * 100;
tileMc.tile.gotoAndStop(1);
} else {
tileMc.tile.highlight._alpha = _local6 * 80;
tileMc.tile.darkness._alpha = (-_local6) * 100;
showFace();
}
}
function slideAnimate() {
if (landed) {
return(undefined);
}
if (getTimer() < flipTime) {
return(undefined);
}
var _local2 = (getTimer() - flipTime) / flipDuration;
if (_local2 > 1) {
_local2 = 1;
land();
return(undefined);
}
_local2 = 1 - ((Math.cos(_local2 * Math.PI) * 0.5) + 0.5);
var _local3 = scale + ((scaleTarget - scale) * _local2);
var _local5 = x + ((xTarget - x) * _local2);
var _local4 = y + ((yTarget - y) * _local2);
tileMc._xscale = _local3;
tileMc._yscale = _local3;
tileMc._x = _local5;
tileMc._y = _local4;
}
function setMood(mood) {
this.mood = mood;
tileMc.tile.face.gotoAndStop(mood);
}
function showFace() {
tileMc.tile.gotoAndStop(value + 2);
tileMc.tile.face.gotoAndStop(mood);
}
static var MOOD_HAPPY = 1;
static var MOOD_IDLE = 2;
static var MOOD_SAD = 3;
static var MOOD_SELECTED = 4;
var mood = MOOD_IDLE;
var hasMadeSound = false;
static var pp = 0;
}
Symbol 280 MovieClip [__Packages.src.util.TimeVerifier] Frame 0
class src.util.TimeVerifier
{
static var startClientTime, startGetTimer;
function TimeVerifier () {
}
static function checkTime() {
var _local2 = _root.clientTime;
if (_local2 == undefined) {
_local2 = 0;
}
var _local3 = getTimer();
if (!hasStarted) {
startClientTime = _local2;
startGetTimer = _local3;
hasStarted = true;
}
var _local4 = Math.abs(_local2 - startClientTime) - (_local3 - startGetTimer);
if ((_root.clientTime != undefined) && (_local4 > 10000)) {
if (hasWarned) {
fscommand ("playData", ("007 " + int(_local4)) + "=0");
hasWarned = true;
}
}
}
static var hasStarted = false;
static var hasWarned = false;
}
Symbol 281 MovieClip [__Packages.com.king.farmmatch.LevelTimer] Frame 0
class com.king.farmmatch.LevelTimer extends MovieClip
{
var pig, shade;
function LevelTimer () {
super();
}
function setProgress(t) {
pig._y = ((1 - t) * 325) - 5;
shade._y = (((1 - t) * 325) - 5) + 2;
var _local2 = int((getTimer() / 1000) * 6) % 4;
pig.gotoAndStop(_local2 + 1);
shade.gotoAndStop(_local2 + 1);
}
}
Symbol 282 MovieClip [__Packages.com.king.farmmatch.Tear] Frame 0
class com.king.farmmatch.Tear extends MovieClip
{
var startTime, startX, startY, xa, ya, _rotation, _x, _y, _alpha, _xscale, removeMovieClip;
function Tear () {
super();
}
function init(d) {
var _local2 = Math.sin(d);
var _local3 = Math.cos(d);
startTime = getTimer();
startX = (_local2 * 10) + (((Math.random() * 2) - 1) * 4);
startY = (_local3 * 10) + (((Math.random() * 2) - 1) * 4);
xa = _local2 + (((Math.random() * 2) - 1) * 0.5);
ya = _local3 + (((Math.random() * 2) - 1) * 0.5);
_rotation = ((Math.atan2(ya, xa) * 180) / Math.PI) - 90;
onEnterFrame();
}
function onEnterFrame() {
var _local2 = (getTimer() - startTime) / 500;
_x = startX + ((xa * _local2) * 30);
_y = (startY + ((ya * _local2) * 30)) + ((_local2 * _local2) * 10);
_alpha = 100 - (_local2 * 100);
if ((_alpha <= 0) || (_xscale <= 0)) {
removeMovieClip();
}
}
}