Symbol 141 MovieClip [Target] Frame 1
#initclip 8
Object.registerClass("Target", com.king.countdown.Target);
#endinitclip
Symbol 174 MovieClip [Board] Frame 1
#initclip 7
Object.registerClass("Board", com.king.countdown.Board);
#endinitclip
Symbol 224 Button
on (press) {
board.toggleSound();
}
Symbol 228 Button
on (press) {
board.endGamePressed();
}
Symbol 230 Button
on (press) {
board.toggleSound();
}
Symbol 232 MovieClip [__Packages.com.king.countdown.Board] Frame 0
class com.king.countdown.Board extends MovieClip
{
var dragon, soundOn, hiltTime, hiltDir, lost, score, timeLeft, communicator, currentLevel, gameStarted, face, scorePaper, startLevelScore, inverted, doubles, holes, xAnticheatOffset, yAnticheatOffset, hasTickedDown, markers, timeBonus, random, levelStarted, timeFan, timeFanShadow, targets, attachMovie, levelMeter, nextTargetId, lastClickTime, _xmouse, _ymouse, startTime, roundTypeText, twinkle, hilt;
function Board () {
super();
dragon._visible = false;
soundOn = true;
_root.soundOnButton._visible = !soundOn;
_root.soundOffButton._visible = soundOn;
hiltTime = getTimer() - 60000;
hiltDir = 1;
lost = false;
score = 0;
timeLeft = -1;
communicator = new com.king.countdown.Communicator();
currentLevel = 0;
gameStarted = false;
face.gotoAndStop(1);
_root.introFeather.gotoAndStop(2);
_root.introFeather.intoFeather.half0.gotoAndStop(34);
_root.introFeather.intoFeather.half1.gotoAndStop(34);
_root.introFeather.sourcey = _root.introFeather._y;
scorePaper.xorg = scorePaper._x;
scorePaper.yorg = scorePaper._y;
_root.levelCompleteSign._visible = false;
var _local4 = 0;
while (_local4 < 5) {
this["scoreDigit" + _local4]._alpha = 0;
_local4++;
}
}
function setup(level) {
setScoreText(score);
startLevelScore = score;
inverted = false;
doubles = false;
holes = false;
var _local14 = _global.textMappings.level_type_straight;
xAnticheatOffset = int((Math.random() * 32) - 16) - 16;
yAnticheatOffset = int((Math.random() * 32) - 16) - 16;
hasTickedDown = false;
switch (level) {
case 0 :
markers = 20;
roundTime = 25;
timeBonus = 200;
break;
case 1 :
markers = 25;
roundTime = 30;
timeBonus = 200;
break;
case 2 :
markers = 30;
roundTime = 35;
timeBonus = 300;
var _local17 = random.nextInt(3);
if (_local17 == 0) {
_local14 = _global.textMappings.level_type_inverted;
inverted = true;
} else if (_local17 == 1) {
_local14 = _global.textMappings.level_type_double;
doubles = true;
}
break;
case 3 :
markers = 40;
roundTime = 60;
timeBonus = 400;
_local17 = random.nextInt(4);
if (_local17 == 0) {
_local14 = _global.textMappings.level_type_inverted_holes;
inverted = true;
holes = true;
} else if (_local17 == 1) {
_local14 = _global.textMappings.level_type_inverted_double;
inverted = true;
doubles = true;
} else {
_local14 = _global.textMappings.level_type_holes;
holes = true;
}
break;
case 4 :
dragon._visible = true;
markers = 50;
roundTime = 60;
timeBonus = 500;
_local17 = random.nextInt(3);
if (_local17 == 0) {
_local14 = _global.textMappings.level_type_inverted_holes;
inverted = true;
holes = true;
} else if (_local17 == 1) {
_local14 = _global.textMappings.level_type_holes;
holes = true;
} else {
_local14 = _global.textMappings.level_type_double_holes;
holes = true;
doubles = true;
}
}
_root.newTypeText = _local14;
levelStarted = false;
setTimeText(roundTime);
var _local16 = 35;
timeFan.half0.gotoAndStop(_local16);
timeFan.half1.gotoAndStop(_local16);
timeFanShadow.half0.gotoAndStop(_local16);
timeFanShadow.half1.gotoAndStop(_local16);
targets = new Array();
var _local6 = random.nextInt(2);
var _local15 = random.nextInt(8);
var _local13;
do {
_local13 = random.nextInt(8);
} while (_local13 == _local15);
var _local8 = 0;
var _local12 = new Array();
_local12.push(_local15);
_local12.push(_local13);
var _local9 = 0;
while (_local9 < markers) {
var _local4 = attachMovie("Target", "target" + _local9, _local9);
_local4.cacheAsBitmap = true;
if (random.nextDouble() < 0.9) {
_local6 = 1 - _local6;
}
var _local5 = ((_local9 * 100) / markers) + 50;
var _local7 = _local5;
var _local11 = ((random.nextDouble() * (bounds[2] - (_local7 * 2))) + bounds[0]) + _local7;
var _local10 = ((random.nextDouble() * (bounds[3] - (_local7 * 2))) + bounds[1]) + _local7;
_local4._x = _local11 + xAnticheatOffset;
_local4._y = _local10 + yAnticheatOffset;
_local4.hitMiss.gotoAndStop(7);
_local4.x = _local11;
_local4.y = _local10;
if (_local5 > 100) {
_local4.gotoAndStop(3 + (_local12[_local6] * 3));
_local4.sizeOffs = 2;
_local4._xscale = (_local4._yscale = (_local5 * 100) / 150);
} else if (_local5 > 50) {
_local4.gotoAndStop(2 + (_local12[_local6] * 3));
_local4.sizeOffs = 1;
_local4._xscale = (_local4._yscale = (_local5 * 100) / 100);
} else {
_local4.gotoAndStop(1 + (_local12[_local6] * 3));
_local4.sizeOffs = 0;
_local4._xscale = (_local4._yscale = (_local5 * 100) / 50);
}
if ((!doubles) || ((_local9 & 1) == 0)) {
_local8++;
}
if (doubles) {
if ((holes && (random.nextDouble() < 0.2)) && ((_local9 & 1) == 1)) {
_local8++;
}
} else if (holes && (random.nextDouble() < 0.2)) {
_local8++;
}
_local4.init(this, (markers - _local9) - 1, _local8, _local6, _local5 / 2);
_local4._visible = false;
targets.push(_local4);
_local9++;
}
if (!inverted) {
_local9 = 0;
while (_local9 < markers) {
targets[_local9].inverseNum(_local8 + 1);
_local9++;
}
}
timeLeft = -1;
levelMeter.gotoAndStop(level + 1);
nextTargetId = 0;
_root.loseScreen._visible = false;
lastClickTime = getTimer() - 60000;
}
function onPress() {
if ((quitAt >= 0) && (animationTime < 0)) {
communicator.gameQuit();
return(undefined);
}
clickAt = -1;
if (showMissTime >= 0) {
return(undefined);
}
if (!gameStarted) {
return(undefined);
}
if (lost) {
return(undefined);
}
var _local12 = getTimer();
var _local11 = score;
if (!levelStarted) {
com.king.countdown.Sounds.get("introMusic").stop();
if (animationTime < 0) {
animationTime = getTimer();
_root.introFeather.gotoAndStop(3);
}
return(undefined);
}
var _local10 = int(_xmouse - xAnticheatOffset);
var _local9 = int(_ymouse - yAnticheatOffset);
var _local8 = -1;
var _local7 = 0;
var _local4 = markers - 1;
while (_local4 >= 0) {
var _local6 = targets[_local4];
if (_local6._visible == true) {
var _local5 = _local6.getClickScore(_local10, _local9);
if (_local5 > 0) {
_local8 = _local4;
_local7 = _local5;
break;
}
}
_local4--;
}
if (_local8 >= 0) {
click(targets[_local8], _local7, _local12);
}
var _local13 = score - _local11;
communicator.clickAt(_local10, _local9, _local12, score - _local11, _local7);
_root.debugText.text = score - _local11;
if (hasWon) {
lose(_global.textMappings.game_won, _local11 + _local7, _local13 - _local7, score);
}
}
function setScoreText(score) {
var _local3 = score;
var _local2 = 0;
while (_local2 < 5) {
this["scoreDigit" + _local2]._visible = (_local2 == 0) || (_local3 > 0);
this["scoreDigit" + _local2].gotoAndStop((_local3 % 10) + 1);
_local3 = int(_local3 / 10);
_local2++;
}
}
function setTimeText(time) {
var _local3 = time;
var _local2 = 0;
while (_local2 < 2) {
this["timeDigit" + _local2].gotoAndStop((_local3 % 10) + 1);
_local3 = int(_local3 / 10);
_local2++;
}
}
function click(target, scoreGained, time) {
var _local6 = -1;
var _local4 = markers - 1;
while (_local4 >= 0) {
var _local5 = targets[_local4];
if (_local5._visible == true) {
if (_local5.value > _local6) {
_local6 = _local5.value;
}
}
_local4--;
}
var _local13 = target.value == _local6;
if (_local13) {
com.king.countdown.Sounds.get("removalSound").play();
var _local11 = time - lastClickTime;
var _local8 = 3 - int(_local11 / 500);
if (_local8 < 0) {
_local8 = 0;
}
score = score + (scoreGained + _local8);
setScoreText(score);
target._visible = false;
lastClickTime = time;
nextTargetId++;
if (nextTargetId == markers) {
com.king.countdown.Sounds.get("loopSound").stop();
com.king.countdown.Sounds.get("timewarningSound").stop();
hiltTime = getTimer() + 100;
hiltDir = 1;
_local11 = time - startTime;
var _local12 = roundTime - (_local11 / 1000);
var _local7 = int((timeBonus * _local12) / roundTime);
_root.levelCompleteSign.scoreField.text = score;
_root.levelCompleteSign.timeBonusField.text = _local7;
_root.levelCompleteSign.totalScoreField.text = score + _local7;
currentLevel++;
if ((currentLevel >= 5) || (_global.shortGameMode && (currentLevel >= 2))) {
hasWon = true;
com.king.countdown.Sounds.get("endSound").play();
} else {
com.king.countdown.Sounds.get("finishLevelSound").play();
animationTime = getTimer();
animationNum = 2;
clickAt = getTimer() + 10000;
}
score = score + _local7;
}
} else {
com.king.countdown.Sounds.get("missSound").play();
target.hitMiss.gotoAndStop(1 + target.sizeOffs);
_local4 = 0;
while (_local4 < markers) {
if ((targets[_local4].value == _local6) && (targets[_local4]._visible)) {
targets[_local4].hitMiss.gotoAndStop(4 + targets[_local4].sizeOffs);
}
_local4++;
}
nextTargetId = 0;
showMissTime = getTimer() + 500;
lastClickTime = time - 60000;
score = startLevelScore;
}
}
function hideFeatherAnimation(time, t) {
var _local5 = int(34 - (t / 5));
if (_local5 < 0) {
_local5 = 0;
}
_root.introFeather.intoFeather.half0.gotoAndStop(_local5 + 1);
_root.introFeather.intoFeather.half1.gotoAndStop(_local5 + 1);
var _local4 = (t * 1.5) - 400;
if (_local4 < 0) {
_local4 = 0;
}
_root.introFeather._y = _root.introFeather.sourcey + _local4;
if (_local4 > 400) {
t = _local4 - 400;
var _local7 = -0.1;
scorePaper._x = scorePaper.xorg + (Math.cos(_local7) * t);
scorePaper._y = scorePaper.yorg + (Math.sin(_local7) * t);
}
if (_local4 > 500) {
t = 100;
var _local7 = -0.1;
scorePaper._x = scorePaper.xorg + (Math.cos(_local7) * t);
scorePaper._y = scorePaper.yorg + (Math.sin(_local7) * t);
var _local3 = 0;
while (_local3 < 5) {
this["scoreDigit" + _local3]._alpha = (_local4 - 500) * 0.7;
_local3++;
}
}
if (_local4 > 600) {
var _local3 = 0;
while (_local3 < 5) {
this["scoreDigit" + _local3]._alpha = 70;
_local3++;
}
animationTime = -1;
_root.introFeather._visible = false;
animationNum = 4;
animationTime = getTimer();
roundTypeText.text = _root.newTypeText;
hiltTime = getTimer() + 100;
hiltDir = -1;
com.king.countdown.Sounds.get("swordSound").playOffs(0.5);
}
}
function showFeatherAnimation(time, t) {
t = 1000 - t;
var _local3 = int(34 - (t / 5));
if (_local3 >= 34) {
_local3 = 34;
_root.introFeather.gotoAndStop(1);
animationTime = -1;
}
_root.introFeather._visible = true;
if (_local3 < 0) {
_local3 = 0;
}
_root.introFeather.intoFeather.half0.gotoAndStop(_local3 + 1);
_root.introFeather.intoFeather.half1.gotoAndStop(_local3 + 1);
var _local4 = (t * 1.5) - 400;
if (_local4 < 0) {
_local4 = 0;
}
_root.introFeather._y = _root.introFeather.sourcey + _local4;
}
function showEndTurnAnimation(time, t) {
t = 500 - (t * 2);
if (t < 0) {
t = 0;
animationTime = -1;
animationNum = 3;
setup(currentLevel);
}
_root.levelCompleteSign._y = 22 - (t / 2);
_root.levelCompleteSign._visible = true;
}
function hideEndTurnAnimation(time, t) {
t = t * 2;
if (t >= 500) {
t = 500;
}
_root.levelCompleteSign._y = 22 - (t / 2);
_root.levelCompleteSign._visible = true;
if (t >= 500) {
t = 500;
animationTime = -1;
animationNum = 0;
_root.levelCompleteSign._visible = false;
animationNum = 4;
animationTime = getTimer();
roundTypeText.text = _root.newTypeText;
hiltTime = getTimer() + 100;
hiltDir = -1;
com.king.countdown.Sounds.get("swordSound").playOffs(0.5);
}
}
function startLevelAnimation(time, t) {
var _local3 = (t - 1000) / 250;
if (_local3 > 1) {
_local3 = 1;
animationTime = -1;
levelStarted = true;
startTime = time;
communicator.sendStartLevel(startTime);
levelStarted = true;
var _local2 = 0;
while (_local2 < markers) {
targets[_local2]._visible = true;
_local2++;
}
lastClickTime = time - 60000;
com.king.countdown.Sounds.get("loopSound").playLooping();
com.king.countdown.Sounds.get("loopSound").setVolume(20);
}
var _local2 = 0;
while (_local2 < int(_local3 * markers)) {
targets[_local2]._visible = true;
_local2++;
}
}
function updateHilt() {
var _local2 = (getTimer() - hiltTime) / 250;
if (((hiltDir == -1) && (_local2 > 0.5)) && (_local2 < 2)) {
if (_local2 < 1) {
twinkle._xscale = (twinkle._yscale = (_local2 - 0.5) * 200);
} else {
twinkle._xscale = (twinkle._yscale = (2 - _local2) * 100);
}
} else {
twinkle._xscale = (twinkle._yscale = 0);
}
if (_local2 < 0) {
_local2 = 0;
}
if (_local2 > 1) {
_local2 = 1;
}
if (hiltDir == -1) {
_local2 = 1 - _local2;
}
var _local3 = -151 + (_local2 * 150);
if (hilt._x != _local3) {
hilt._x = _local3;
}
}
function gameDataReceived() {
clickAt = getTimer() + 15000;
_root.hider._visible = false;
gameStarted = true;
communicator.parseGameData(_root.gameData);
communicator.gameStarted();
random = new com.midasplayer.util.Random(communicator.randomSeed);
setup(currentLevel);
onEnterFrame();
_root.instructionsTitleText = _global.textMappings.instructions_title;
_root.instructionsText = _global.textMappings.instructions;
_root.featherClickText = _global.textMappings.click_to_start;
_root.txt_endgame_button = _global.textMappings.exit_game;
_root.txt_sound_button = _global.textMappings.sound_on;
_root.txt_click_to_continue = _global.textMappings.click_to_continue;
_root.txt_score = _global.textMappings.score;
_root.txt_time_bonus = _global.textMappings.time_bonus;
_root.txt_total_score = _global.textMappings.total_score;
_root.txt_level_completed = _global.textMappings.level_completed;
startAnimTime = getTimer();
com.king.countdown.Sounds.get("introMusic").play();
}
function onEnterFrame() {
updateHilt();
if (quitAt >= 0) {
var _local11 = Math.max(int(((quitAt - getTimer()) / 1000) + 0.99), 0);
_root.countdownText = _global.textMappings.game_ends_in.split("{0}").join(_local11);
if (getTimer() > quitAt) {
communicator.gameQuit();
return(undefined);
}
}
if (clickAt >= 0) {
var _local11 = Math.max(int(((clickAt - getTimer()) / 1000) + 0.99), 0);
if (currentLevel == 0) {
_root.countdownText = _global.textMappings.game_starts_in.split("{0}").join(_local11);
} else {
_root.countdownText = _global.textMappings.level_starts_in.split("{0}").join(_local11);
}
if (getTimer() > clickAt) {
onPress();
}
}
if (showMissTime >= 0) {
if (getTimer() > showMissTime) {
showMissTime = -1;
var _local4 = 0;
while (_local4 < markers) {
targets[_local4]._visible = true;
targets[_local4].hitMiss.gotoAndStop(7);
_local4++;
}
setScoreText(score);
nextTargetId = 0;
}
}
if (animationTime >= 0) {
var _local6 = getTimer();
var _local8 = _local6 - animationTime;
if (animationNum == 0) {
hideFeatherAnimation(_local6, _local8);
} else if (animationNum == 1) {
showFeatherAnimation(_local6, _local8);
} else if (animationNum == 2) {
showEndTurnAnimation(_local6, _local8);
} else if (animationNum == 3) {
hideEndTurnAnimation(_local6, _local8);
} else if (animationNum == 4) {
startLevelAnimation(_local6, _local8);
}
return(undefined);
}
if (!gameStarted) {
if (DEBUG_MODE) {
_root.gameData = DEBUG_GAME_DATA;
}
if (_root.gameData != undefined) {
gameDataReceived();
return(undefined);
}
}
if (lost) {
return(undefined);
}
if (!levelStarted) {
var _local8 = int(((getTimer() - startAnimTime) - 1500) / 70);
if (_local8 < 0) {
_local8 = 0;
}
if (startAnimTime < 0) {
_local8 = 0;
}
_root.introFeather.instructionsAnimation.gotoAndStop(_local8 + 1);
_root.introFeather.instructionsAnimation.num.num0.gotoAndStop(11);
_root.introFeather.instructionsAnimation.num.num1.gotoAndStop(11);
return(undefined);
}
var _local10 = getTimer() - startTime;
var _local5 = roundTime - (_local10 / 1000);
if (_local5 < 0) {
_local5 = 0;
}
var _local9 = int((_local5 / roundTime) * 34) + 1;
timeFan.half0.gotoAndStop(_local9);
timeFan.half1.gotoAndStop(_local9);
timeFanShadow.half0.gotoAndStop(_local9);
timeFanShadow.half1.gotoAndStop(_local9);
var _local7 = roundTime - int(_local10 / 1000);
if ((_local7 < 8) && (!hasTickedDown)) {
com.king.countdown.Sounds.get("timewarningSound").playLooping();
hasTickedDown = true;
}
if (_local7 <= 0) {
com.king.countdown.Sounds.get("timewarningSound").stop();
showMissTime = -1;
com.king.countdown.Sounds.get("loopSound").stop();
com.king.countdown.Sounds.get("endSound").play();
lose(_global.textMappings.out_of_time, score, 0, score);
_local7 = 0;
setTimeText(0);
}
if (_local7 != _local5) {
_local5 = _local7;
setTimeText(_local5);
}
}
function lose(reason, score, bonus, totalScore) {
if (!lost) {
_root.featherClickText = _global.textMappings.click_to_exit;
hiltTime = getTimer() + 500;
hiltDir = 1;
_root.endTitleText = reason;
_root.endScoreText = "" + score;
_root.endBonusText = "" + bonus;
_root.endTotalScoreText = "" + totalScore;
animationNum = 1;
animationTime = getTimer();
communicator.gameEnd(totalScore);
quitAt = getTimer() + 10000;
lost = true;
_root.introFeather.gotoAndStop(3);
_root.introFeather._visble = true;
var _local4 = 0;
while (_local4 < markers) {
targets[_local4]._visible = false;
_local4++;
}
}
}
function toggleSound() {
soundOn = !soundOn;
if (soundOn) {
_root.txt_sound_button = _global.textMappings.sound_on;
} else {
_root.txt_sound_button = _global.textMappings.sound_off;
}
_root.soundOnButton._visible = !soundOn;
_root.soundOffButton._visible = soundOn;
com.king.countdown.Sounds.toggleSound();
}
function endGamePressed() {
if (!lost) {
lost = true;
communicator.gameEnd(score);
quitAt = getTimer() + 2000;
_root.hider._visible = true;
}
}
var DEBUG_MODE = false;
var DEBUG_GAME_DATA = ((((((((((((((((((((("<gamedata randomseed=\"1859686622\" timelimit=\"300\"> <text id=\"instructions_title\">Instr\u00C3\u00BCcti\u00C3\u00B6ns</text> <text id=\"instructions\">Th\u00C3\u00ABse \u00C3\u00A4re the instr\u00C3\u00BCctions of the gameship enterprise!</text>" + " <text id=\"game_starts_in\">G\u00C3\u00A4me starts in {0} sec\u00C3\u00B6nds</text>") + " <text id=\"game_ends_in\">G\u00C3\u00A4me ends in {0} sec\u00C3\u00B6nds</text>") + " <text id=\"level_starts_in\">L\u00C3\u00A4vel starts in {0} sec\u00C3\u00B6nds</text>") + " <text id=\"click_to_start\">CLICK T\u00C3\u2013 START</text>") + " <text id=\"click_to_continue\">CLICK T\u00C3\u2013 CONTINUE</text>") + " <text id=\"click_to_exit\">CLICK T\u00C3\u2013 EXIT</text>") + " <text id=\"score\">Sc\u00C3\u00B6re</text>") + " <text id=\"time_bonus\">Tim\u00C3\u00AB b\u00C3\u00B6nus</text>") + " <text id=\"total_score\">T\u00C3\u00B6tal sc\u00C3\u00B6re</text>") + " <text id=\"level_completed\">Level c\u00C3\u00B6mpleted</text>") + " <text id=\"level_type_straight\">Str\u00C3\u00A4ight\nC\u00C3\u00B6untdown</text>") + " <text id=\"level_type_inverted\">Inv\u00C3\u00ABrted\nC\u00C3\u00B6untdown</text>") + " <text id=\"level_type_double\">D\u00C3\u00B6uble\nC\u00C3\u00B6untdown</text>") + " <text id=\"level_type_holes\">H\u00C3\u00B6les\nC\u00C3\u00B6untdown</text>") + " <text id=\"level_type_inverted_holes\">Inverted H\u00C3\u00B6les\nC\u00C3\u00B6untdown</text>") + " <text id=\"level_type_inverted_double\">Inverted D\u00C3\u00B6uble\nC\u00C3\u00B6untdown</text>") + " <text id=\"game_won\">GAME W\u00C3\u2013N</text>") + " <text id=\"out_of_time\">OUT \u00C3\u2013F TIME</text>") + " <text id=\"sound_off\">S\u00C3\u2013UND \u00C3\u2013FF</text>") + " <text id=\"sound_on\">S\u00C3\u2013UND \u00C3\u2013N</text>") + " <text id=\"exit_game\">EXIT G\u00C3\u201EME</text>") + "</gamedata>";
var roundTime = 20;
var bounds = [206, 31, 515, 356];
var animationTime = -1;
var animationNum = 0;
var quitAt = -1;
var clickAt = -1;
var hasWon = false;
var showMissTime = -1;
var startAnimTime = -1;
}
Symbol 233 MovieClip [__Packages.com.king.countdown.Communicator] Frame 0
class com.king.countdown.Communicator
{
var randomSeed;
function Communicator () {
}
function gameStarted() {
fscommand ("gameStart");
}
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(x, y, time, scoreGained, baseScore) {
fscommand ("playData", (((((((((CMD_CLICK_AT + ",") + x) + " ") + y) + " ") + time) + " ") + baseScore) + "=") + 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();
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_START_LEVEL = 272;
static var CMD_CLICK_AT = 885;
static var CMD_END_GAME_PRESSED = 736;
}
Symbol 234 MovieClip [__Packages.com.king.countdown.Sounds] Frame 0
class com.king.countdown.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.countdown.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 235 MovieClip [__Packages.com.midasplayer.util.Random] Frame 0
class com.midasplayer.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 _local5 = getTimer();
lastSeed = s;
mta[0] = s;
var _local2 = s;
var _local3 = new com.midasplayer.util.Integer64();
mti = 1;
while (mti < N) {
_local3.init32((_local2 >>> 30) ^ _local2);
_local3.mulu32(1812433253);
_local2 = (mta[mti] = int(_local3.lsb + mti));
mti++;
}
var _local6 = getTimer();
trace(("Random::init_genrand(): initialization ~" + (_local6 - _local5)) + "ms");
}
function genrand_int32() {
var _local3 = 0;
if (mti >= N) {
if (mti == (N + 1)) {
init_genrand(5489);
}
var _local4 = getTimer();
var _local2 = 0;
_local2 = 0;
while (_local2 < (N - M)) {
_local3 = (mta[_local2] & UPPER_MASK) | (mta[_local2 + 1] & LOWER_MASK);
mta[_local2] = (mta[_local2 + M] ^ (_local3 >>> 1)) ^ mag01[_local3 & 1];
_local2++;
}
while (_local2 < (N - 1)) {
_local3 = (mta[_local2] & UPPER_MASK) | (mta[_local2 + 1] & LOWER_MASK);
mta[_local2] = (mta[_local2 + (M - N)] ^ (_local3 >>> 1)) ^ mag01[_local3 & 1];
_local2++;
}
_local3 = (mta[N - 1] & UPPER_MASK) | (mta[0] & LOWER_MASK);
mta[N - 1] = (mta[M - 1] ^ (_local3 >>> 1)) ^ mag01[_local3 & 1];
mti = 0;
var _local5 = getTimer();
trace(((("Random::genrand_int32(): precalc " + N) + " new numbers ~") + (_local5 - _local4)) + "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 236 MovieClip [__Packages.com.midasplayer.util.Integer64] Frame 0
class com.midasplayer.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 com.midasplayer.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 237 MovieClip [__Packages.com.king.countdown.Target] Frame 0
class com.king.countdown.Target extends MovieClip
{
var mc, board, id, num, value, radius, x, y;
function Target () {
super();
}
function init(board, id, num, col, radius) {
if (mc.num0._xorg == undefined) {
mc.num0._xorg = mc.num0._x;
mc.num1._xorg = mc.num1._x;
mc.num0._widthorg = mc.num0._width;
mc.num1._widthorg = mc.num1._width;
}
this.board = board;
this.id = id;
this.num = num;
value = num;
this.radius = radius;
var _local3 = col;
setNum(num);
}
function inverseNum(highest) {
num = highest - num;
setNum(num);
}
function setNum(num) {
this.num = num;
var _local3 = Math.floor(num / 10);
var _local4 = int(num % 10);
mc.num1.gotoAndStop(_local4 + 1);
mc.num0.gotoAndStop(_local3 + 1);
var _local2 = 0;
if (_local3 == 1) {
_local2 = _local2 - (mc.num0._widthorg * 0.1);
}
if (_local4 == 1) {
_local2 = _local2 + (mc.num1._widthorg * 0.1);
}
mc.num0._x = mc.num0._xorg + _local2;
mc.num1._x = mc.num1._xorg + _local2;
}
function getClickScore(xMouse, yMouse) {
var _local2 = xMouse - x;
var _local3 = yMouse - y;
var _local4 = (_local2 * _local2) + (_local3 * _local3);
if (_local4 < (radius * radius)) {
if (_local4 > (((radius * radius) * 0.7) * 0.7)) {
return(12);
}
return(10);
}
return(0);
}
}