Frame 1
fscommand ("trapallkeys", true);
fscommand ("showmenu", "false");
Stage.scaleMode = "noScale";
_root.cheat_mode = false;
_root.game_id = "1542";
_root.main_link = "http://www.2DPlay.com/index.php?gameid=" + _root.game_id;
_root.download_link = "http://www.2DPlay.com/downloadgame.php?gameid=" + _root.game_id;
_root.get_game_link = "http://www.2DPlay.com/freecontent.htm";
_root.scores_link = ("http://www.2Dplay.com/highscores.php?gameid=" + _root.game_id) + "&hiscore=";
_root.viewscores_link = "http://www.2dplay.com/showscores.php?gameid=" + _root.game_id;
Frame 2
stop();
Frame 5
function hex_md5(s) {
return(binl2hex(core_md5(str2binl(s), s.length * chrsz)));
}
function b64_md5(s) {
return(binl2b64(core_md5(str2binl(s), s.length * chrsz)));
}
function str_md5(s) {
return(binl2str(core_md5(str2binl(s), s.length * chrsz)));
}
function hex_hmac_md5(key, data) {
return(binl2hex(core_hmac_md5(key, data)));
}
function b64_hmac_md5(key, data) {
return(binl2b64(core_hmac_md5(key, data)));
}
function str_hmac_md5(key, data) {
return(binl2str(core_hmac_md5(key, data)));
}
function md5_vm_test() {
return(hex_md5("abc") == "900150983cd24fb0d6963f7d28e17f72");
}
function core_md5(x, len) {
x[len >> 5] = x[len >> 5] | (128 << (len % 32));
x[(((len + 64) >>> 9) << 4) + 14] = len;
var a = 1732584193;
var _local3 = -271733879;
var _local2 = -1732584194;
var _local1 = 271733878 /* 0x10325476 */;
var i = 0;
while (i < x.length) {
var olda = a;
var oldb = _local3;
var oldc = _local2;
var oldd = _local1;
a = md5_ff(a, _local3, _local2, _local1, x[i + 0], 7, -680876936);
_local1 = md5_ff(_local1, a, _local3, _local2, x[i + 1], 12, -389564586);
_local2 = md5_ff(_local2, _local1, a, _local3, x[i + 2], 17, 606105819);
_local3 = md5_ff(_local3, _local2, _local1, a, x[i + 3], 22, -1044525330);
a = md5_ff(a, _local3, _local2, _local1, x[i + 4], 7, -176418897);
_local1 = md5_ff(_local1, a, _local3, _local2, x[i + 5], 12, 1200080426);
_local2 = md5_ff(_local2, _local1, a, _local3, x[i + 6], 17, -1473231341);
_local3 = md5_ff(_local3, _local2, _local1, a, x[i + 7], 22, -45705983);
a = md5_ff(a, _local3, _local2, _local1, x[i + 8], 7, 1770035416);
_local1 = md5_ff(_local1, a, _local3, _local2, x[i + 9], 12, -1958414417);
_local2 = md5_ff(_local2, _local1, a, _local3, x[i + 10], 17, -42063);
_local3 = md5_ff(_local3, _local2, _local1, a, x[i + 11], 22, -1990404162);
a = md5_ff(a, _local3, _local2, _local1, x[i + 12], 7, 1804603682);
_local1 = md5_ff(_local1, a, _local3, _local2, x[i + 13], 12, -40341101);
_local2 = md5_ff(_local2, _local1, a, _local3, x[i + 14], 17, -1502002290);
_local3 = md5_ff(_local3, _local2, _local1, a, x[i + 15], 22, 1236535329);
a = md5_gg(a, _local3, _local2, _local1, x[i + 1], 5, -165796510);
_local1 = md5_gg(_local1, a, _local3, _local2, x[i + 6], 9, -1069501632);
_local2 = md5_gg(_local2, _local1, a, _local3, x[i + 11], 14, 643717713);
_local3 = md5_gg(_local3, _local2, _local1, a, x[i + 0], 20, -373897302);
a = md5_gg(a, _local3, _local2, _local1, x[i + 5], 5, -701558691);
_local1 = md5_gg(_local1, a, _local3, _local2, x[i + 10], 9, 38016083);
_local2 = md5_gg(_local2, _local1, a, _local3, x[i + 15], 14, -660478335);
_local3 = md5_gg(_local3, _local2, _local1, a, x[i + 4], 20, -405537848);
a = md5_gg(a, _local3, _local2, _local1, x[i + 9], 5, 568446438);
_local1 = md5_gg(_local1, a, _local3, _local2, x[i + 14], 9, -1019803690);
_local2 = md5_gg(_local2, _local1, a, _local3, x[i + 3], 14, -187363961);
_local3 = md5_gg(_local3, _local2, _local1, a, x[i + 8], 20, 1163531501);
a = md5_gg(a, _local3, _local2, _local1, x[i + 13], 5, -1444681467);
_local1 = md5_gg(_local1, a, _local3, _local2, x[i + 2], 9, -51403784);
_local2 = md5_gg(_local2, _local1, a, _local3, x[i + 7], 14, 1735328473);
_local3 = md5_gg(_local3, _local2, _local1, a, x[i + 12], 20, -1926607734);
a = md5_hh(a, _local3, _local2, _local1, x[i + 5], 4, -378558);
_local1 = md5_hh(_local1, a, _local3, _local2, x[i + 8], 11, -2022574463);
_local2 = md5_hh(_local2, _local1, a, _local3, x[i + 11], 16, 1839030562);
_local3 = md5_hh(_local3, _local2, _local1, a, x[i + 14], 23, -35309556);
a = md5_hh(a, _local3, _local2, _local1, x[i + 1], 4, -1530992060);
_local1 = md5_hh(_local1, a, _local3, _local2, x[i + 4], 11, 1272893353);
_local2 = md5_hh(_local2, _local1, a, _local3, x[i + 7], 16, -155497632);
_local3 = md5_hh(_local3, _local2, _local1, a, x[i + 10], 23, -1094730640);
a = md5_hh(a, _local3, _local2, _local1, x[i + 13], 4, 681279174);
_local1 = md5_hh(_local1, a, _local3, _local2, x[i + 0], 11, -358537222);
_local2 = md5_hh(_local2, _local1, a, _local3, x[i + 3], 16, -722521979);
_local3 = md5_hh(_local3, _local2, _local1, a, x[i + 6], 23, 76029189);
a = md5_hh(a, _local3, _local2, _local1, x[i + 9], 4, -640364487);
_local1 = md5_hh(_local1, a, _local3, _local2, x[i + 12], 11, -421815835);
_local2 = md5_hh(_local2, _local1, a, _local3, x[i + 15], 16, 530742520);
_local3 = md5_hh(_local3, _local2, _local1, a, x[i + 2], 23, -995338651);
a = md5_ii(a, _local3, _local2, _local1, x[i + 0], 6, -198630844);
_local1 = md5_ii(_local1, a, _local3, _local2, x[i + 7], 10, 1126891415);
_local2 = md5_ii(_local2, _local1, a, _local3, x[i + 14], 15, -1416354905);
_local3 = md5_ii(_local3, _local2, _local1, a, x[i + 5], 21, -57434055);
a = md5_ii(a, _local3, _local2, _local1, x[i + 12], 6, 1700485571);
_local1 = md5_ii(_local1, a, _local3, _local2, x[i + 3], 10, -1894986606);
_local2 = md5_ii(_local2, _local1, a, _local3, x[i + 10], 15, -1051523);
_local3 = md5_ii(_local3, _local2, _local1, a, x[i + 1], 21, -2054922799);
a = md5_ii(a, _local3, _local2, _local1, x[i + 8], 6, 1873313359);
_local1 = md5_ii(_local1, a, _local3, _local2, x[i + 15], 10, -30611744);
_local2 = md5_ii(_local2, _local1, a, _local3, x[i + 6], 15, -1560198380);
_local3 = md5_ii(_local3, _local2, _local1, a, x[i + 13], 21, 1309151649);
a = md5_ii(a, _local3, _local2, _local1, x[i + 4], 6, -145523070);
_local1 = md5_ii(_local1, a, _local3, _local2, x[i + 11], 10, -1120210379);
_local2 = md5_ii(_local2, _local1, a, _local3, x[i + 2], 15, 718787259);
_local3 = md5_ii(_local3, _local2, _local1, a, x[i + 9], 21, -343485551);
a = safe_add(a, olda);
_local3 = safe_add(_local3, oldb);
_local2 = safe_add(_local2, oldc);
_local1 = safe_add(_local1, oldd);
i = i + 16;
}
return(Array(a, _local3, _local2, _local1));
}
function md5_cmn(q, a, b, x, s, t) {
return(safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s), b));
}
function md5_ff(a, b, c, d, x, s, t) {
var _local1 = b;
return(md5_cmn((_local1 & c) | ((~_local1) & d), a, _local1, x, s, t));
}
function md5_gg(a, b, c, d, x, s, t) {
return(md5_cmn((b & d) | (c & (~d)), a, b, x, s, t));
}
function md5_hh(a, b, c, d, x, s, t) {
return(md5_cmn((b ^ c) ^ d, a, b, x, s, t));
}
function md5_ii(a, b, c, d, x, s, t) {
return(md5_cmn(c ^ (b | (~d)), a, b, x, s, t));
}
function core_hmac_md5(key, data) {
var _local2 = str2binl(key);
if (_local2.length > 16) {
_local2 = core_md5(_local2, key.length * chrsz);
}
var _local3 = Array(16);
var opad = Array(16);
var _local1 = 0;
while (_local1 < 16) {
_local3[_local1] = _local2[_local1] ^ 909522486;
opad[_local1] = _local2[_local1] ^ 1549556828;
_local1++;
}
var hash = core_md5(_local3.concat(str2binl(data)), 512 + (data.length * chrsz));
return(core_md5(opad.concat(hash), 640));
}
function safe_add(x, y) {
var _local1 = (x & 65535) + (y & 65535);
var _local2 = ((x >> 16) + (y >> 16)) + (_local1 >> 16);
return((_local2 << 16) | (_local1 & 65535));
}
function bit_rol(num, cnt) {
return((num << cnt) | (num >>> (32 - cnt)));
}
function str2binl(str) {
var _local2 = str;
var _local3 = Array();
var mask = ((1 << chrsz) - 1);
var _local1 = 0;
while (_local1 < (_local2.length * chrsz)) {
_local3[_local1 >> 5] = _local3[_local1 >> 5] | ((_local2.charCodeAt(_local1 / chrsz) & mask) << (_local1 % 32));
_local1 = _local1 + chrsz;
}
return(_local3);
}
function binl2str(bin) {
var _local2 = bin;
var _local3 = "";
var mask = ((1 << chrsz) - 1);
var _local1 = 0;
while (_local1 < (_local2.length * 32)) {
_local3 = _local3 + String.fromCharCode((_local2[_local1 >> 5] >>> (_local1 % 32)) & mask);
_local1 = _local1 + chrsz;
}
return(_local3);
}
function binl2hex(binarray) {
var _local2 = binarray;
var _local3 = (hexcase ? "0123456789ABCDEF" : "0123456789abcdef");
var str = "";
var _local1 = 0;
while (_local1 < (_local2.length * 4)) {
str = str + (_local3.charAt((_local2[_local1 >> 2] >> (((_local1 % 4) * 8) + 4)) & 15) + _local3.charAt((_local2[_local1 >> 2] >> ((_local1 % 4) * 8)) & 15));
_local1++;
}
return(str);
}
function binl2b64(binarray) {
var _local3 = binarray;
var tab = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
var str = "";
var _local2 = 0;
while (_local2 < (_local3.length * 4)) {
var triplet = (((((_local3[_local2 >> 2] >> (8 * (_local2 % 4))) & 255) << 16) | (((_local3[(_local2 + 1) >> 2] >> (8 * ((_local2 + 1) % 4))) & 255) << 8)) | ((_local3[(_local2 + 2) >> 2] >> (8 * ((_local2 + 2) % 4))) & 255));
var _local1 = 0;
while (_local1 < 4) {
if (((_local2 * 8) + (_local1 * 6)) > (_local3.length * 32)) {
str = str + b64pad;
} else {
str = str + tab.charAt((triplet >> (6 * (3 - _local1))) & 63);
}
_local1++;
}
_local2 = _local2 + 3;
}
return(str);
}
_root.controller = new Classes.GameController();
_root.soundMan = new Classes.SoundManager();
var hexcase = 0;
var b64pad = "";
var chrsz = 8;
Frame 6
_root.soundMan.playMusicTrack("splash_music");
stop();
Frame 7
_root.soundMan.playMusicTrack("in_game_music");
Frame 8
_root.controller.buildGameField();
_root.controller.startLevel();
stop();
Frame 9
delete _root.onEnterFrame;
_root.soundMan.stopMusic();
_root.soundMan.playSFX("game_over");
stop();
Instance of Symbol 174 MovieClip [uni_button] in Frame 9
//component parameters
onClipEvent (initialize) {
labelString = "Main menu";
flashing = false;
colorCode = "0xFFFFFF";
textAlignment = "center";
}
on (release) {
_root.soundMan.playSFX("click");
_root.gotoAndPlay("menu");
}
Instance of Symbol 174 MovieClip [uni_button] in Frame 9
//component parameters
onClipEvent (initialize) {
labelString = "Play more games";
flashing = false;
colorCode = "0xFFFFFF";
textAlignment = "center";
}
on (release) {
_root.soundMan.playSFX("click");
getURL (_root.main_link, "_blank");
}
Instance of Symbol 174 MovieClip [uni_button] in Frame 9
//component parameters
onClipEvent (initialize) {
labelString = "Submit score";
flashing = true;
colorCode = "0xFFFFFF";
textAlignment = "center";
}
on (release) {
_root.soundMan.playSFX("click");
_root.score = _root.controller.score;
var hashkey = _root.hex_md5(((("gameid=" + _root.game_id) + "&hiscore=") + _root.score) + "2DPlay.com/");
getURL (String(((_root.scores_link + _root.score) + "&hash=") + hashkey), "_blank");
}
Instance of Symbol 384 MovieClip in Frame 9
onClipEvent (load) {
gotoAndStop(_root.gainedMedalIndex + 1);
}
Instance of Symbol 174 MovieClip [uni_button] in Frame 9
//component parameters
onClipEvent (initialize) {
labelString = "Download game";
flashing = false;
colorCode = "0xFFFFFF";
textAlignment = "center";
}
on (release) {
_root.soundMan.playSFX("click");
getURL (_root.download_link, "_blank");
}
Instance of Symbol 174 MovieClip [uni_button] in Frame 9
//component parameters
onClipEvent (initialize) {
labelString = "Get game for your site";
flashing = false;
colorCode = "0xFFFFFF";
textAlignment = "center";
}
on (release) {
_root.soundMan.playSFX("click");
getURL (_root.get_game_link, "_blank");
}
Frame 10
delete _root.onEnterFrame;
_root.controller.checkIfMedalAwarded();
stop();
Frame 11
delete _root.onEnterFrame;
stop();
Frame 12
prevFrame();
Frame 13
delete _root.onEnterFrame;
_root.soundMan.stopMusic();
_root.soundMan.playMusicTrack("splash_music");
stop();
Instance of Symbol 174 MovieClip [uni_button] in Frame 13
//component parameters
onClipEvent (initialize) {
labelString = "Main menu";
flashing = false;
colorCode = "0xFFFFFF";
textAlignment = "center";
}
on (release) {
_root.soundMan.playSFX("click");
_root.gotoAndPlay("menu");
}
Instance of Symbol 174 MovieClip [uni_button] in Frame 13
//component parameters
onClipEvent (initialize) {
labelString = "Play more games";
flashing = false;
colorCode = "0xFFFFFF";
textAlignment = "center";
}
on (release) {
_root.soundMan.playSFX("click");
getURL (_root.main_link, "_blank");
}
Instance of Symbol 174 MovieClip [uni_button] in Frame 13
//component parameters
onClipEvent (initialize) {
labelString = "Submit score";
flashing = true;
colorCode = "0xFFFFFF";
textAlignment = "center";
}
on (release) {
_root.soundMan.playSFX("click");
_root.score = _root.controller.score;
var hashkey = _root.hex_md5(((("gameid=" + _root.game_id) + "&hiscore=") + _root.score) + "2DPlay.com/");
getURL (String(((_root.scores_link + _root.score) + "&hash=") + hashkey), "_blank");
}
Frame 14
_root.soundMan.playMusicTrack("in_game_music");
_root.controller.startBonusLevel();
stop();
Symbol 475 MovieClip [__Packages.Classes.HintMC] Frame 0
class Classes.HintMC extends MovieClip
{
var gotoAndStop, _visible;
function HintMC () {
super();
init();
}
function init() {
var _local1 = this;
var _local2 = _root;
_local1.swapDepths(20004);
_local1._visible = false;
_local1.closeButton.onPress = function () {
_root.soundMan.playSFX("click");
_root.controller.closeHint();
};
_local1.disableButton.onPress = function () {
_root.soundMan.playSFX("click");
_root.controller.disableHints();
};
}
function showHint(hintLink) {
(gotoAndStop(hintLink));// not popped
_visible = true;
}
}
Symbol 476 MovieClip [__Packages.Classes.MCButton] Frame 0
class Classes.MCButton extends MovieClip
{
function MCButton () {
super();
Init();
}
function Init() {
var _local1 = this;
var _local2 = new TextFormat();
_local2.align = _local1.textAlignment;
_local1.txtField.setTextFormat(_local2);
_local1.txtField.textColor = Number(_local1.colorCode);
_local1.ColorObject = new Color(_local1);
if (!_local1.flashing) {
_local1.onRollOver = _local1.MouseOver;
_local1.onRollOut = (_local1.onDragOut = _local1.MouseOut);
} else {
_local1.onRollOver = function () {
};
_local1.onEnterFrame = function () {
var _local1 = this;
_local1.color_t = Math.abs(Math.sin(_local1.sinus) * 255);
_local1.sinus = _local1.sinus + 0.1;
var _local2 = {ra:100, rb:_local1.color_t, ga:100, gb:-_local1.color_t, ba:100, bb:-_local1.color_t, aa:100, ab:0};
_local1.ColorObject.setTransform(_local2);
};
}
}
function MouseOver() {
var _local1 = this;
_local1.onEnterFrame = function () {
var _local1 = this;
if (_local1.color_t < 255) {
_local1.color_t = _local1.color_t + 10;
var _local2 = {ra:100, rb:_local1.color_t, ga:100, gb:-_local1.color_t, ba:100, bb:-_local1.color_t, aa:100, ab:0};
_local1.ColorObject.setTransform(_local2);
} else {
delete _local1.onEnterFrame;
}
};
}
function MouseOut() {
var _local1 = this;
_local1.onEnterFrame = function () {
var _local1 = this;
if (_local1.color_t > 0) {
_local1.color_t = _local1.color_t - 30;
var _local2 = {ra:100, rb:_local1.color_t, ga:100, gb:-_local1.color_t, ba:100, bb:-_local1.color_t, aa:100, ab:0};
_local1.ColorObject.setTransform(_local2);
} else {
var _local2 = {ra:100, rb:0, ga:100, gb:0, ba:100, bb:0, aa:100, ab:0};
_local1.ColorObject.setTransform(_local2);
delete _local1.onEnterFrame;
}
};
}
var color_t = 0;
var sinus = 0;
}
Symbol 477 MovieClip [__Packages.Classes.Knight] Frame 0
class Classes.Knight extends MovieClip
{
function Knight () {
super();
init();
}
function init() {
var _local1 = this;
_local1._alpha = (_local1.bonusLevel ? 100 : 0);
_local1.moving = (_local1.currentSteps = 0);
}
function putOnPlace(putRow, putCol) {
var _local1 = this;
_local1._x = ((putCol * _local1.controller.tileWidth) + _local1.controller.gameMCOffsetX) + 25;
_local1._y = ((putRow * _local1.controller.tileHeight) + _local1.controller.gameMCOffsetY) + 22;
_local1.row = putRow;
_local1.col = putCol;
_local1.controller.fieldArray[_local1.row][_local1.col] = _local1;
}
function startMove(moveRow, moveCol, _movingSteps) {
var _local1 = this;
var _local2 = moveCol;
_local1.movingSteps = _movingSteps;
_local1.nextRow = moveRow;
_local1.nextCol = _local2;
_local1.controller.fieldArray[_local1.row][_local1.col] = undefined;
if (Math.abs(_local2 - _local1.col) == 2) {
_local1.horizontalSteps = Math.floor(_local1.movingSteps / 3) * 2;
_local1.verticalSteps = _local1.movingSteps - _local1.horizontalSteps;
} else {
_local1.verticalSteps = Math.floor(_local1.movingSteps / 3) * 2;
_local1.horizontalSteps = _local1.movingSteps - _local1.verticalSteps;
}
_local1.dx = (((_local2 * _local1.controller.tileWidth) + _local1.controller.gameMCOffsetX) - (_local1._x - 25)) / _local1.horizontalSteps;
_local1.dy = (((moveRow * _local1.controller.tileHeight) + _local1.controller.gameMCOffsetY) - (_local1._y - 22)) / _local1.verticalSteps;
_local1.currentSteps = 0;
_local1.moving = 1;
}
function bonusUpdate() {
var _local1 = this;
if (_local1.controller.powerupsMC.hitTest(_local1._x, _local1._y, true)) {
var _local2 = _local1._xscale * 1.1;
_local2 = ((_local2 > 100) ? 150 : (_local2));
_local1._xscale = (_local1._yscale = _local2);
} else {
var _local2 = _local1._xscale * 0.91;
_local2 = ((_local2 < 100) ? 100 : (_local2));
_local1._xscale = (_local1._yscale = _local2);
}
switch (_local1.moving) {
case 1 :
if ((_local1._currentframe == 1) && (_local1.dx > 0)) {
(_local1.gotoAndPlay("lefttoright"));// not popped
} else if ((_local1._currentframe == 6) && (_local1.dx < 0)) {
(_local1.gotoAndPlay("righttoleft"));// not popped
}
_local1._x = _local1._x + _local1.dx;
_local1.currentSteps = _local1.currentSteps + 1;
if (_local1.currentSteps == _local1.horizontalSteps) {
_local1.currentSteps = 0;
_local1.moving = 2;
}
return;
case 2 :
_local1._y = _local1._y + _local1.dy;
_local1.currentSteps = _local1.currentSteps + 1;
if (_local1.currentSteps != _local1.verticalSteps) {
break;
}
_local1.moving = 0;
_local1.row = _local1.nextRow;
_local1.col = _local1.nextCol;
_local1._x = ((_local1.col * _local1.controller.tileWidth) + _local1.controller.gameMCOffsetX) + 25;
_local1._y = ((_local1.row * _local1.controller.tileHeight) + _local1.controller.gameMCOffsetY) + 22;
_local1.controller.gameFieldMC.tileGlow.removeMovieClip();
_local1.controller.collectBonusCoin(_local1.row, _local1.col);
_local1.controller.fieldArray[_local1.row][_local1.col] = _local1;
_local1.controller.showTileState();
}
}
function update(knightPlaced, ghostKnight) {
var _local1 = this;
if (knightPlaced) {
if (ghostKnight) {
_local1._alpha = 50 + (25 * Math.sin(_local1.sinus));
_local1.sinus = _local1.sinus + 0.4;
} else {
_local1._alpha = 100;
_local1.sinus = 0;
}
if (_local1.controller.piecesMC.hitTest(_local1._x, _local1._y, true) || (_local1.controller.powerupsMC.hitTest(_local1._x, _local1._y, true))) {
var newScale = (_local1._xscale * 1.1);
newScale = ((newScale > 100) ? 150 : (newScale));
_local1._xscale = (_local1._yscale = newScale);
} else {
var newScale = (_local1._xscale * 0.91);
newScale = ((newScale < 100) ? 100 : (newScale));
_local1._xscale = (_local1._yscale = newScale);
}
switch (_local1.moving) {
case 1 :
if ((_local1._currentframe == 1) && (_local1.dx > 0)) {
(_local1.gotoAndPlay("lefttoright"));// not popped
} else if ((_local1._currentframe == 6) && (_local1.dx < 0)) {
(_local1.gotoAndPlay("righttoleft"));// not popped
}
_local1._x = _local1._x + _local1.dx;
_local1.currentSteps = _local1.currentSteps + 1;
if (_local1.currentSteps == _local1.horizontalSteps) {
_local1.currentSteps = 0;
_local1.moving = 2;
}
break;
case 2 :
_local1._y = _local1._y + _local1.dy;
_local1.currentSteps = _local1.currentSteps + 1;
if (_local1.currentSteps != _local1.verticalSteps) {
break;
}
_local1.moving = 0;
_local1.row = _local1.nextRow;
_local1.col = _local1.nextCol;
_local1._x = ((_local1.col * _local1.controller.tileWidth) + _local1.controller.gameMCOffsetX) + 25;
_local1._y = ((_local1.row * _local1.controller.tileHeight) + _local1.controller.gameMCOffsetY) + 22;
_local1.controller.gameFieldMC.tileGlow.removeMovieClip();
_local1.controller.knightHit();
_local1.controller.fieldArray[_local1.row][_local1.col] = _local1;
_local1.controller.showTileState();
}
} else {
_local1.controller.showHint("place_knight");
_local1._alpha = _local1._alpha + 10;
_local1._alpha = ((_local1._alpha > 100) ? 100 : (_local1._alpha));
var _local3 = _root._xmouse;
var _local2 = _root._ymouse;
_local3 = ((_local3 < 35) ? 35 : (_local3));
_local3 = ((_local3 > 385) ? 385 : (_local3));
_local2 = ((_local2 < 32) ? 32 : (_local2));
_local2 = ((_local2 > 348) ? 348 : (_local2));
_local1._x = _local3;
_local1._y = _local2;
}
}
var type = 1;
var sinus = 0;
}
Symbol 478 MovieClip [__Packages.Classes.Pawn] Frame 0
class Classes.Pawn extends MovieClip
{
function Pawn () {
super();
init();
}
function init() {
var _local1 = this;
_local1._x = _local1.col * _local1.controller.tileWidth;
_local1._y = _local1.row * _local1.controller.tileHeight;
}
function startCapture(_movingSteps) {
var _local1 = this;
_local1.movingSteps = _movingSteps;
_local1.dx = ((_local1.controller.fieldArray[_local1.row + 1][_local1.col + 1].type == 1) ? (_local1.controller.tileWidth / _local1.movingSteps) : ((-_local1.controller.tileWidth) / _local1.movingSteps));
_local1.dy = _local1.controller.tileHeight / _local1.movingSteps;
var _local3 = {_x:_local1.controller.knightMC._x, _y:_local1.controller.knightMC._y, type:""};
var _local2 = 1;
while (_local2 < 4) {
_local3.type = "knight_" + _local2;
_local1.controller.effectsMC.attachMovie("debrisMC", "deb_" + _local1.controller.piecesCounter, _local1.controller.piecesCounter, _local3);
_local1.controller.piecesCounter = _local1.controller.piecesCounter + 1;
_local2++;
}
_local1.controller.killKnight();
_local1.controller.fieldArray[_local1.row][_local1.col] = undefined;
_local1.currentSteps = 0;
_local1.moving = true;
_local1.controller.showHint("lost_life");
}
function startMove(_movingSteps) {
var _local1 = this;
_local1.movingSteps = _movingSteps;
if (_local1.controller.fieldArray[_local1.row + 1][_local1.col].type != undefined) {
} else {
_local1.controller.fieldArray[_local1.row][_local1.col] = undefined;
_local1.currentSteps = 0;
_local1.dx = 0;
_local1.dy = _local1.controller.tileHeight / _local1.movingSteps;
_local1.moving = true;
}
}
function hitByKnight() {
var _local1 = this;
_local1.controller.killPawn(_local1._x, _local1._y);
_local1.remove();
}
function remove() {
var _local2 = this;
var _local3 = {_x:_local2._x, _y:_local2._y, type:""};
var _local1 = 1;
while (_local1 < 4) {
_local3.type = "pawn_" + _local1;
_root.effectsMC.attachMovie("debrisMC", "deb_" + _local2.controller.piecesCounter, _local2.controller.piecesCounter, _local3);
_local2.controller.piecesCounter = _local2.controller.piecesCounter + 1;
_local1++;
}
_local2.removeMovieClip();
}
function update() {
var _local1 = this;
if (_local1.moving) {
_local1._y = _local1._y + _local1.dy;
_local1._x = _local1._x + _local1.dx;
_local1.currentSteps = _local1.currentSteps + 1;
if (_local1.currentSteps == _local1.movingSteps) {
_local1.moving = false;
switch (_local1.row) {
case 7 :
_local1.controller.hitCastle(_local1._x);
_local1.controller.showHint("castle_attack");
_local1.removeMovieClip();
break;
case 6 :
_root.soundMan.playSFX("pawn_approach");
}
if (_local1.controller.fieldArray[_local1.row + 1][_local1.col].type == 1) {
_local1.hitByKnight();
} else {
if (_local1.dx == 0) {
_local1.row = _local1.row + 1;
_local1.controller.fieldArray[_local1.row][_local1.col] = _local1;
} else {
_local1.row = _local1.row + 1;
_local1.col = _local1.col + ((_local1.dx > 0) ? 1 : -1);
_local1.controller.fieldArray[_local1.row][_local1.col] = _local1;
}
_local1._x = _local1.col * _local1.controller.tileWidth;
_local1._y = _local1.row * _local1.controller.tileHeight;
_local1.controller.showHint("pawns_appear");
}
}
}
}
var type = 2;
}
Symbol 479 MovieClip [__Packages.Classes.Powerup] Frame 0
class Classes.Powerup extends MovieClip
{
function Powerup () {
super();
init();
}
function init() {
var _local1 = this;
_local1.gotoAndStop(_local1.powerupType);
_local1._alpha = 0;
_local1._x = _local1.col * _local1.controller.tileWidth;
_local1._y = _local1.row * _local1.controller.tileHeight;
}
function update() {
var _local1 = this;
_local1.lifeTime = _local1.lifeTime - 1;
if (_local1.lifeTime < 0) {
_local1._alpha = _local1._alpha - 10;
if (_local1._alpha <= 0) {
_local1.controller.totalPowerups = _local1.controller.totalPowerups - 1;
_local1.removeMovieClip();
}
} else if (_local1._alpha < 100) {
_local1._alpha = _local1._alpha + 10;
_local1._alpha = ((_local1._alpha > 100) ? 100 : (_local1._alpha));
} else {
_local1.controller.showHint("powerups");
}
}
var type = 3;
}
Symbol 480 MovieClip [__Packages.Classes.PowerupIcon] Frame 0
class Classes.PowerupIcon extends MovieClip
{
function PowerupIcon () {
super();
init();
}
function init() {
var _local1 = this;
_local1.gotoAndStop(_local1.powerupType);
_local1._alpha = 0;
}
function update() {
var _local1 = this;
_local1.actionTime = _local1.actionTime - 1;
if (_local1.actionTime < 0) {
_local1._alpha = _local1._alpha - 10;
if (_local1._alpha <= 0) {
_local1.controller.stopPowerupAction(_local1.powerupType);
_local1.removeMovieClip();
}
} else if (_local1._alpha < 100) {
_local1._alpha = _local1._alpha + 10;
_local1._alpha = ((_local1._alpha > 100) ? 100 : (_local1._alpha));
}
}
}
Symbol 481 MovieClip [__Packages.Classes.Tile] Frame 0
class Classes.Tile extends MovieClip
{
function Tile () {
super();
init();
}
function init() {
var _local1 = this;
_local1.onRollOver = function () {
this.controller.rollOverTile(this);
};
_local1.onPress = function () {
this.controller.tilePressed(this);
};
}
}
Symbol 482 MovieClip [__Packages.Classes.GoldCoin] Frame 0
class Classes.GoldCoin extends MovieClip
{
function GoldCoin () {
super();
init();
}
function init() {
var _local1 = this;
_local1._alpha = (_local1.bonusLevel ? 100 : 0);
_local1._x = _local1.col * _local1.controller.tileWidth;
_local1._y = _local1.row * _local1.controller.tileHeight;
}
function update() {
var _local1 = this;
_local1.lifeTime = _local1.lifeTime - 1;
if (_local1.lifeTime < 0) {
_local1._alpha = _local1._alpha - 10;
if (_local1._alpha <= 0) {
_local1.removeMovieClip();
}
} else if (_local1._alpha < 100) {
_local1._alpha = _local1._alpha + 10;
_local1._alpha = ((_local1._alpha > 100) ? 100 : (_local1._alpha));
} else {
_local1.controller.showHint("coins");
}
}
var type = 4;
}
Symbol 483 MovieClip [__Packages.Classes.PowerupToBox] Frame 0
class Classes.PowerupToBox extends MovieClip
{
function PowerupToBox () {
super();
init();
}
function init() {
var _local1 = this;
_local1.gotoAndStop(_local1.powerupType);
_local1._x = (_local1.col * _local1.controller.tileWidth) + 10;
_local1._y = (_local1.row * _local1.controller.tileHeight) + 10;
var _local3 = _local1.boxX - _local1._x;
var _local2 = _local1.boxY - _local1._y;
var distance = Math.sqrt((_local3 * _local3) + (_local2 * _local2));
_local1.movingSteps = Math.floor(distance / _local1.stepLength);
_local1.dx = (_local1.boxX - _local1._x) / _local1.movingSteps;
_local1.dy = (_local1.boxY - _local1._y) / _local1.movingSteps;
_local1.onEnterFrame = _local1.update;
}
function update() {
var _local1 = this;
if (_local1.movingSteps > 0) {
_local1._x = _local1._x + _local1.dx;
_local1._y = _local1._y + _local1.dy;
_local1.movingSteps = _local1.movingSteps - 1;
} else {
_local1.removeMovieClip();
}
}
var boxX = 461;
var boxY = 252;
var stepLength = 20;
}
Symbol 484 MovieClip [__Packages.Classes.LevelCompleteScreen] Frame 0
class Classes.LevelCompleteScreen extends MovieClip
{
var score, lastLevel;
function LevelCompleteScreen () {
var _local1 = this;
super();
_local1.tipsArray = [];
_local1.tipsArray.push("Capture the pawns and clear the board to reveal gold coins to collect for bonus points");
_local1.tipsArray.push("Capturing more than one pawn in succession will win you multiple combos");
_local1.tipsArray.push("You don't have to wait for a move to be completed before making another. Moves are queued, so think ahead");
_local1.tipsArray.push("Repair your castle by collecting the 'Repair Castle' power-up. Remember, it only takes 8 pawns to destroy your castle and end the game");
_local1.tipsArray.push("Pawns only capture the knight when they move so you can quickly move onto a square that is being attacked without getting captured");
_local1.tipsArray.push("You can use your Knight to block pawns from advancing");
_local1.tipsArray.push("The 'Ghost Knight' power-up allows you to avoid capture on squares being attacked by pawns");
_local1.tipsArray.push("Make the best use of the 'Bomb' power-up by collecting it once the pawns have filled the board. Don't wait too long or the power-up will disappear");
_local1.init();
}
function init() {
var _local1 = this;
var _local3 = _root;
_local1.lastLevel = _local3.controller.currentLevel - 1;
_local1.score = _local3.controller.score;
_local1.coinsCollected = _local3.controller.coinsCollected;
_local1.castleDamage = (-(8 - _local3.controller.castleEnergy)) * 20;
var _local2 = ((_local1.lastLevel > 21) ? 21 : (_local1.lastLevel));
_local1.progressBar.knightGuide._x = _local1.progressBar["point_" + (_local2 - 1)]._x;
_local1.progressBar.knightGuide._y = _local1.progressBar["point_" + (_local2 - 1)]._y;
if (_local2 == 21) {
_local1.progressBar.knightGuide.gotoAndStop(1);
}
_local1.progressBar["point_" + (_local2 - 1)].gotoAndPlay("glow");
_local1.levelCompleteStr = ("Level " + _local1.lastLevel) + " completed!";
var randomTipIndex = Math.floor(Math.random() * _local1.tipsArray.length);
_local1.tipText = _local1.tipsArray[randomTipIndex];
}
function countCoins() {
var _local1 = this;
if (_local1.coinsCollected != 0) {
_local1.coinsCollected = _local1.coinsCollected - 1;
_local1.score = _local1.score + 100;
_root.soundMan.playSFX("coins_count");
(_local1.gotoAndPlay("coinsCounter"));// not popped
}
}
function countDamage() {
var _local1 = this;
if (_local1.castleDamage != 0) {
_local1.castleDamage = _local1.castleDamage + 10;
_local1.score = _local1.score - 10;
_local1.score = ((_local1.score < 0) ? 0 : (_local1.score));
_root.soundMan.playSFX("castle_count");
(_local1.gotoAndPlay("castleCounter"));// not popped
} else if (_root.controller.checkGrandmasterUnlock()) {
_local1.grandmasterUnlocked._visible = true;
}
}
function startNextLevel() {
var _local1 = _root;
_local1.controller.score = score;
if ((lastLevel % 5) == 0) {
_local1.attachMovie("fadingMC", "fadingMC", 20000, {toFrame:"bonus_level"});
} else {
_local1.attachMovie("fadingMC", "fadingMC", 20000, {toFrame:"start_game"});
}
}
}
Symbol 485 MovieClip [__Packages.Classes.BonusLevelComplete] Frame 0
class Classes.BonusLevelComplete extends MovieClip
{
var score;
function BonusLevelComplete () {
var _local1 = this;
super();
_local1.tipsArray = [];
_local1.tipsArray.push("Capture the pawns and clear the board to reveal gold coins to collect for bonus points");
_local1.tipsArray.push("Capturing more than one pawn in succession will win you multiple combos");
_local1.tipsArray.push("You don't have to wait for a move to be completed before making another. Moves are queued, so think ahead");
_local1.tipsArray.push("Repair your castle by collecting the 'Repair Castle' power-up. Remember, it only takes 8 pawns to destroy your castle and end the game");
_local1.tipsArray.push("Pawns only capture the knight when they move so you can quickly move onto a square that is being attacked without getting captured");
_local1.tipsArray.push("You can use your Knight to block pawns from advancing");
_local1.tipsArray.push("The 'Ghost Knight' power-up allows you to avoid capture on squares being attacked by pawns");
_local1.tipsArray.push("Make the best use of the 'Bomb' power-up by collecting it once the pawns have filled the board. Don't wait too long or the power-up will disappear");
_local1.init();
}
function init() {
var _local1 = this;
var _local3 = _root;
_local1.score = _local3.controller.score;
_local1.coinsCollected = _local3.controller.bonusCoinsCollected;
_local1.specialBonus = ((_local1.coinsCollected == 20) ? true : false);
_local1.timeLeft = _local3.controller.bonusTimer;
var _local2 = Math.floor(Math.random() * _local1.tipsArray.length);
_local1.tipText = _local1.tipsArray[_local2];
}
function countCoins() {
var _local1 = this;
if (_local1.coinsCollected != 0) {
_local1.coinsCollected = _local1.coinsCollected - 1;
_local1.score = _local1.score + 100;
_root.soundMan.playSFX("coins_count");
(_local1.gotoAndPlay("coinsCounter"));// not popped
} else if (_local1.specialBonus) {
_local1.score = _local1.score + 1000;
_root.soundMan.playSFX("chimes");
_local1.specialBonusResult.gotoAndPlay(3);
} else {
_local1.specialBonusResult.gotoAndPlay(2);
}
}
function countTime() {
var _local1 = this;
if (_local1.timeLeft != 0) {
_local1.timeLeft = _local1.timeLeft - 1;
_local1.score = _local1.score + 100;
_root.soundMan.playSFX("coins_count");
(_local1.gotoAndPlay("timeCounter"));// not popped
}
}
function startNextLevel() {
var _local1 = _root;
_local1.controller.score = score;
if (_local1.controller.checkGameFinished()) {
_local1.attachMovie("fadingMC", "fadingMC", 20000, {toFrame:"congratulations"});
} else {
_local1.attachMovie("fadingMC", "fadingMC", 20000, {toFrame:"start_game"});
}
}
}
Symbol 486 MovieClip [__Packages.Classes.Debris] Frame 0
class Classes.Debris extends MovieClip
{
function Debris () {
super();
init();
}
function init() {
var _local1 = this;
_local1.dx = ((Math.random() * 6) - 3) * 2;
_local1.dy = (Math.random() * 2) - 4;
_local1.ddy = (Math.random() * 1) + 1;
_local1.onEnterFrame = function () {
var _local1 = this;
_local1._x = _local1._x + _local1.dx;
_local1._y = _local1._y + _local1.dy;
_local1.dy = _local1.dy + _local1.ddy;
if (_local1._y > 420) {
_local1.removeMovieClip();
}
};
_local1 = _local1.gotoAndStop(_local1.type);
}
}
Symbol 487 MovieClip [__Packages.Classes.SoundManager] Frame 0
class Classes.SoundManager
{
var musicTrackPlaying;
function SoundManager () {
init();
}
function init() {
var _local1 = _root;
_local1.musicTrackSound = new Sound(_local1);
_local1.big_gong = new Sound(_local1);
_local1.big_gong.attachSound("big_gong.wav");
_local1.castle_captured = new Sound(_local1);
_local1.castle_captured.attachSound("castle_captured.wav");
_local1.castle_count = new Sound(_local1);
_local1.castle_count.attachSound("castle_count.wav");
_local1.chimes = new Sound(_local1);
_local1.chimes.attachSound("chimes.wav");
_local1.click = new Sound(_local1);
_local1.click.attachSound("click.wav");
_local1.coins_count = new Sound(_local1);
_local1.coins_count.attachSound("coins_count.wav");
_local1.coin_taken = new Sound(_local1);
_local1.coin_taken.attachSound("coin_taken.wav");
_local1.game_over = new Sound(_local1);
_local1.game_over.attachSound("game_over.wav");
_local1.hit_castle = new Sound(_local1);
_local1.knight_captured = new Sound(_local1);
_local1.pawn_captured = new Sound(_local1);
_local1.horse = new Sound(_local1);
_local1.combo_sfx = new Sound(_local1);
_local1.locked = new Sound(_local1);
_local1.locked.attachSound("locked.wav");
_local1.pawn_approach = new Sound(_local1);
_local1.pawn_approach.attachSound("pawn_approach.wav");
_local1.powerup_bomb = new Sound(_local1);
_local1.powerup_bomb.attachSound("powerup_bomb.wav");
_local1.powerup_capture = new Sound(_local1);
_local1.powerup_capture.attachSound("powerup_capture.wav");
_local1.powerup_freeze = new Sound(_local1);
_local1.powerup_freeze.attachSound("powerup_freeze.wav");
_local1.powerup_ghost = new Sound(_local1);
_local1.powerup_ghost.attachSound("powerup_ghost.wav");
_local1.powerup_life = new Sound(_local1);
_local1.powerup_life.attachSound("powerup_life.wav");
_local1.powerup_speeddown = new Sound(_local1);
_local1.powerup_speeddown.attachSound("powerup_speeddown.wav");
_local1.powerup_speedup = new Sound(_local1);
_local1.powerup_speedup.attachSound("powerup_speedup.wav");
}
function playSFX(sfxLink) {
var _local1 = _root;
switch (sfxLink) {
case "big_gong" :
_local1.big_gong.start(0, 1);
return;
case "castle_captured" :
_local1.castle_captured.start(0, 1);
return;
case "castle_count" :
_local1.castle_count.start(0, 1);
return;
case "chimes" :
_local1.chimes.start(0, 1);
return;
case "click" :
_local1.click.start(0, 1);
return;
case "coin_taken" :
_local1.coin_taken.start(0, 1);
return;
case "coins_count" :
_local1.coins_count.start(0, 1);
return;
case "game_over" :
_local1.game_over.start(0, 1);
return;
case "hit_castle" :
var _local2 = "hit_castle_" + Math.floor(Math.random() * 3);
_local1.hit_castle.attachSound(_local2);
_local1.hit_castle.start(0, 1);
return;
case "knight_captured" :
_local2 = "knight_captured_" + Math.floor(Math.random() * 2);
_local1.knight_captured.attachSound(_local2);
_local1.knight_captured.start(0, 1);
return;
case "horse" :
_local2 = "horse_" + Math.floor(Math.random() * 2);
_local1.horse.attachSound(_local2);
_local1.horse.start(0, 1);
return;
case "locked" :
_local1.locked.start(0, 1);
return;
case "pawn_approach" :
_local1.pawn_approach.start(0, 1);
return;
case "pawn_captured" :
_local2 = "pawn_captured_" + Math.floor(Math.random() * 3);
_local1.pawn_captured.attachSound(_local2);
_local1.pawn_captured.start(0, 1);
return;
case "powerup_bomb" :
_local1.powerup_bomb.start(0, 1);
return;
case "powerup_capture" :
_local1.powerup_capture.start(0, 1);
return;
case "powerup_freeze" :
_local1.powerup_freeze.start(0, 1);
return;
case "powerup_ghost" :
_local1.powerup_ghost.start(0, 1);
return;
case "powerup_life" :
_local1.powerup_life.start(0, 1);
return;
case "powerup_speeddown" :
_local1.powerup_speeddown.start(0, 1);
return;
case "powerup_speedup" :
_local1.powerup_speedup.start(0, 1);
return;
case "time_out" :
_local1.time_out = new Sound(_local1.interfaceMC);
_local1.time_out.attachSound("time_out.wav");
_local1.time_out.start(0, 1);
}
}
function stopMusic() {
_root.musicTrackSound.stop();
}
function playComboSFX(comboNum) {
var _local1 = comboNum;
_local1 = ((_local1 > 4) ? 4 : (_local1));
_root.combo_sfx.attachSound("combo_" + _local1);
_root.combo_sfx.start(0, 1);
}
function playMusicTrack(trackLink) {
var _local1 = trackLink;
var _local2 = _root;
if (musicTrackPlaying != _local1) {
musicTrackPlaying = _local1;
_local2.musicTrackSound.stop();
_local2.musicTrackSound.attachSound(_local1);
_local2.musicTrackSound.start(0, 999999);
}
}
}
Symbol 488 MovieClip [__Packages.Classes.GameController] Frame 0
class Classes.GameController
{
var levelFinished, knightMC, soundState, showHints, gameOver;
function GameController () {
var _local1 = this;
_local1.soundState = true;
_local1.shared = SharedObject.getLocal("CrazyChessSO");
if (_local1.shared.data.played == undefined) {
_local1.shared.data.played = true;
_local1.shared.data.showHints = true;
_local1.shared.data.noviceMedal = 0;
_local1.shared.data.amateurMedal = 0;
_local1.shared.data.proMedal = 0;
_local1.shared.data.grandmasterMedal = 0;
_local1.shared.flush();
}
_local1.showHints = _local1.shared.data.showHints;
_local1.hintsArray = ["place_knight", "move_knight", "pawns_appear", "pawns_hit", "pawns_combo", "powerups", "castle_attack", "lost_life", "coins", "bonus_game"];
}
function showHint(hintLink) {
var _local2 = this;
if (_local2.showHints && (!_local2.gamePaused)) {
if ((hintLink == "pawns_hit") && (_local2.pawnsOnBoard() == 0)) {
} else {
var _local3 = false;
var hintsLeft = _local2.hintsArray.length;
var _local1 = 0;
while (_local1 < hintsLeft) {
if (_local2.hintsArray[_local1] == hintLink) {
_local2.hintsArray.splice(_local1, 1);
_local3 = true;
break;
}
_local1++;
}
if (_local3) {
_local2.gamePaused = true;
_root.hintWindow.showHint(hintLink);
}
}
}
}
function startBonusLevel() {
var _local1 = this;
switch (_local1.gameMode) {
case 0 :
_local1.bonusInitTimer = 45;
break;
case 1 :
_local1.bonusInitTimer = 40;
break;
case 2 :
_local1.bonusInitTimer = 35;
break;
case 3 :
_local1.bonusInitTimer = 30;
}
_local1.bonusTimer = _local1.bonusInitTimer;
_local1.bonusInitTimer = _local1.bonusInitTimer * 1000;
_local1.timerOffset = getTimer();
_local1.timeOutSoundOn = false;
_local1.bonusCoinsCollected = 0;
_local1.levelStarted = false;
_local1.gamePaused = false;
_local1.levelFinished = false;
_root.attachMovie("boardShadow", "boardShadow", 22, {_x:10, _y:8});
_local1.gameFieldMC = _root.createEmptyMovieClip("gameFieldMC", 1);
_local1.powerupsMC = _root.createEmptyMovieClip("powerupsMC", 7);
_local1.powerupsMC._x = (_local1.gameFieldMC._x = _local1.gameMCOffsetX);
_local1.powerupsMC._y = (_local1.gameFieldMC._y = _local1.gameMCOffsetY);
var i = 0;
while (i < 64) {
var row = Math.floor(i / 8);
var col = (i % 8);
var initObject = {row:row, col:col, _x:col * _local1.tileWidth, _y:row * _local1.tileHeight, controller:_local1};
_local1.gameFieldMC.attachMovie("tile", (("tile_" + row) + "_") + col, i + 1, initObject);
i++;
}
_root.attachMovie("fortress", "fortress", 21, {_x:_local1.gameMCOffsetX, _y:(_local1.gameMCOffsetY + (_local1.tileHeight * 7)) + 10});
_local1.interfaceMC = _root.interfaceMC;
_local1.interfaceMC.gotoAndStop(2);
_root.boardMC.gotoAndStop(1);
_local1.updateInterface();
_local1.piecesCounter = 0;
_local1.pressedTilesArray = [];
_local1.fieldArray = [];
var i = 0;
while (i < 8) {
_local1.fieldArray.push([undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined]);
i++;
}
var knightRow = (Math.floor(Math.random() * 2) + 3);
var knightCol = (Math.floor(Math.random() * 2) + 3);
_local1.knightMC = _root.attachMovie("knight", "knight", 19, {controller:_local1, bonusLevel:true});
_local1.knightMC.putOnPlace(knightRow, knightCol);
var bonusCoinsCounter = 20;
do {
var _local2 = Math.floor((bonusCoinsCounter - 1) / 5);
var rowDisp = (((_local2 == 0) || (_local2 == 1)) ? 0 : 4);
var colDisp = (((_local2 == 0) || (_local2 == 2)) ? 0 : 4);
var _local3 = Math.floor(Math.random() * 4) + rowDisp;
var coinCol = (Math.floor(Math.random() * 4) + colDisp);
if (_local1.fieldArray[_local3][coinCol] == undefined) {
var coinMC = _local1.powerupsMC.attachMovie("goldCoinMC", "coin_" + _local1.piecesCounter, _local1.piecesCounter, {row:_local3, col:coinCol, bonusLevel:true, controller:_local1});
_local1.piecesCounter = _local1.piecesCounter + 1;
_local1.fieldArray[_local3][coinCol] = coinMC;
bonusCoinsCounter = bonusCoinsCounter - 1;
}
} while (bonusCoinsCounter != 0);
_root.onEnterFrame = function () {
if ((!_root.controller.gamePaused) && (!this.levelFinished)) {
_root.controller.bonusUpdate();
}
};
}
function collectBonusCoin(row, col) {
var _local1 = this;
if (_local1.fieldArray[row][col].type == 4) {
_root.soundMan.playSFX("coin_taken");
_local1.fieldArray[row][col].removeMovieClip();
_local1.bonusCoinsCollected = _local1.bonusCoinsCollected + 1;
_local1.updateInterface();
if (_local1.bonusCoinsCollected == 20) {
_local1.bonusLevelCompleted();
}
}
}
function bonusUpdate() {
var _local1 = this;
_local1.showHint("bonus_game");
_local1.timerDisplacement = getTimer() - _local1.timerOffset;
_local1.bonusTimer = Math.floor((_local1.bonusInitTimer - (getTimer() - _local1.timerOffset)) / 1000);
if ((!_local1.timeOutSoundOn) && (_local1.bonusTimer == 5)) {
_local1.timeOutSoundOn = true;
_root.soundMan.playSFX("time_out");
}
_local1.updateInterface();
_local1.knightMC.bonusUpdate();
if ((_local1.pressedTilesArray.length > 0) && (_local1.knightMC.moving == 0)) {
var _local2 = _local1.pressedTilesArray.shift();
_local1.startKnightMove(_local2);
}
if (_local1.bonusTimer == 0) {
_local1.bonusLevelCompleted();
}
}
function bonusLevelCompleted() {
var _local1 = _root;
levelFinished = true;
delete _local1.onEnterFrame;
_local1.time_out.stop();
_local1.soundMan.playSFX("big_gong");
_local1.attachMovie("fadingMC", "fadingMC", 20000, {toFrame:"bonus_complete"});
}
function getCoinsHint() {
var _local3 = this;
for (var i in _local3.powerupsMC) {
var _local1 = _local3.powerupsMC[i];
if (_local1.type == 4) {
return({row:_local1.row, col:_local1.col});
}
}
return(undefined);
}
function getPowerupHint() {
var _local3 = this;
for (var i in _local3.powerupsMC) {
var _local1 = _local3.powerupsMC[i];
if (_local1.type == 3) {
return({row:_local1.row, col:_local1.col});
}
}
return(undefined);
}
function getMoveKnightHint() {
var _local2 = 0;
while (_local2 < 8) {
var _local1 = 0;
while (_local1 < 8) {
var dRow = (knightMC.row - _local2);
var _local3 = knightMC.col - _local1;
if (((Math.abs(dRow) == 2) && (Math.abs(_local3) == 1)) || ((Math.abs(dRow) == 1) && (Math.abs(_local3) == 2))) {
return({row:_local2, col:_local1});
}
_local1++;
}
_local2++;
}
return(undefined);
}
function getPawnHitHint() {
var _local3 = this;
for (var i in _local3.piecesMC) {
var _local1 = _local3.piecesMC[i];
if (_local1.row >= 0) {
switch (_local1.col) {
case 7 :
return({row:_local1.row + 1, col:_local1.col - 1});
default :
return({row:_local1.row + 1, col:_local1.col + 1});
// unexpected jump
}
}
}
return(undefined);
}
function closeHint() {
var _local1 = this;
var _local2 = _local1.hintsArray.length;
if (_local2 == 0) {
_local1.showHints = false;
_local1.shared.data.showHints = false;
_local1.shared.flush();
}
_root.hintWindow._visible = false;
_local1.timerOffset = getTimer() - _local1.timerDisplacement;
_local1.gamePaused = false;
}
function disableHints() {
var _local1 = this;
_local1.showHints = false;
_local1.shared.data.showHints = false;
_local1.shared.flush();
_root.hintWindow._visible = false;
_local1.timerOffset = getTimer() - _local1.timerDisplacement;
_local1.gamePaused = false;
}
function getMedalState(mode) {
var _local1 = this;
switch (mode) {
case 0 :
return(_local1.shared.data.noviceMedal);
case 1 :
return(_local1.shared.data.amateurMedal);
case 2 :
return(_local1.shared.data.proMedal);
case 3 :
return(_local1.shared.data.grandmasterMedal);
}
return(undefined);
}
function getSoundState() {
switch (soundState) {
case true :
return("Turn sound OFF");
case false :
return("Turn sound ON");
}
}
function switchSound() {
var _local1 = this;
_local1.soundState = !_local1.soundState;
if (_local1.soundState) {
_root.musicTrackSound.setVolume(100);
} else {
_root.musicTrackSound.setVolume(0);
}
}
function switchHints() {
var _local1 = this;
_local1.showHints = !_local1.showHints;
_local1.shared.data.showHints = _local1.showHints;
_local1.shared.flush();
_local1.hintsArray = ["place_knight", "move_knight", "pawns_appear", "pawns_hit", "pawns_combo", "powerups", "castle_attack", "lost_life", "coins", "bonus_game"];
}
function getHintsState() {
switch (showHints) {
case true :
return("Turn hints OFF");
case false :
return("Turn hints ON");
}
}
function switchQuality() {
switch (_quality) {
case "LOW" :
_quality = "MEDIUM";
return;
case "MEDIUM" :
_quality = "HIGH";
return;
case "HIGH" :
_quality = "LOW";
}
}
function getQualityState() {
switch (_quality) {
case "LOW" :
return("Set quality to MEDIUM");
case "MEDIUM" :
return("Set quality to HIGH");
case "HIGH" :
return("Set quality to LOW");
}
}
function clearLevel() {
var _local1 = _root;
var _local2 = this;
_local1.boardShadow.removeMovieClip();
_local1.fortress.removeMovieClip();
_local1.pauseMenu.removeMovieClip();
_local1.maskMC.removeMovieClip();
_local1.maskMC_2.removeMovieClip();
_local1.maskMC_3.removeMovieClip();
_local1.powerupsIconsMC.removeMovieClip();
_local2.gameFieldMC.removeMovieClip();
_local2.piecesMC.removeMovieClip();
_local2.knightMC.removeMovieClip();
_local2.powerupsMC.removeMovieClip();
_local2.effectsMC.removeMovieClip();
_local1.hintWindow.removeMovieClip();
}
function checkGrandmasterUnlock() {
var _local1 = this;
if (((_local1.gameMode == 2) && (_local1.currentLevel == 11)) && (_local1.shared.data.proMedal < 2)) {
_local1.shared.data.proMedal = 2;
_local1.shared.flush();
return(true);
}
return(false);
}
function checkGameFinished() {
var _local1 = this;
var _local2 = _root;
if (_local1.gameMode == 3) {
return(false);
}
if (_local1.currentLevel == 21) {
_local1.awardMedal(4);
switch (_local1.gameMode) {
case 0 :
_local2.gameEndResult = "You have completed Novice mode.\rTry Amateur now";
break;
case 1 :
_local2.gameEndResult = "You have completed Amateur mode.\rTry Pro now";
break;
case 2 :
_local2.gameEndResult = "You have completed Pro mode.\rTry Grandmaster now";
}
_local2.finalScore = "Final score: " + _local1.score;
return(true);
}
return(false);
}
function startGame(_gameMode) {
var _local1 = this;
var _local2 = _root;
switch (_gameMode) {
case 3 :
if (_local1.shared.data.proMedal < 2) {
_local2.soundMan.playSFX("locked");
_local2.attachMovie("modeLocked", "modeLocked", 2, {message:"To unlock Grandmaster you must get a Silver medal for Pro"});
return;
}
default :
_local1.score = 0;
_local1.lives = (_local2.cheat_mode ? (Number(_local2.cheatInitLives)) : 3);
_local1.currentLevel = (_local2.cheat_mode ? (Number(_local2.cheatInitLevel)) : 1);
_local1.castleEnergy = 8;
_local1.gameMode = _gameMode;
_local1.gameOver = false;
_local2.gotoAndPlay("start_game");
}
}
function pauseGame(state) {
var _local1 = this;
if (((_local1.gamePaused == state) || (_local1.levelFinished)) || (_local1.gameOver)) {
} else {
_local1.gamePaused = state;
if (_local1.gamePaused) {
_root.attachMovie("pauseMenu", "pauseMenu", 25);
} else {
_local1.timerOffset = getTimer() - _local1.timerDisplacement;
_root.pauseMenu.removeMovieClip();
}
}
}
function buildGameField() {
var _local1 = this;
_local1.knightMovingSteps = 13;
_local1.pawnsAppearTimer = 1;
_local1.totalPawnsAppear = (_local1.gameMode + 1) + Math.floor(_local1.currentLevel / 5);
_local1.totalPawnsAppear = ((_local1.totalPawnsAppear > 8) ? 8 : (_local1.totalPawnsAppear));
_local1.appearanceChance = (0.6 + (_local1.gameMode * 0.033)) + ((_local1.currentLevel - 1) * 0.01);
switch (_local1.gameMode) {
case 0 :
_local1.pawnsStepTimer = 90 - (_local1.currentLevel - 1);
break;
case 1 :
_local1.pawnsStepTimer = 70 - (_local1.currentLevel - 1);
break;
case 2 :
_local1.pawnsStepTimer = 55 - (_local1.currentLevel - 1);
break;
case 3 :
_local1.pawnsStepTimer = 50 - (_local1.currentLevel - 1);
}
_local1.pawnsStepTimer = ((_local1.pawnsStepTimer < 40) ? 40 : (_local1.pawnsStepTimer));
switch (_local1.gameMode) {
case 0 :
_local1.pawnsSpeedSteps = 35;
break;
case 1 :
_local1.pawnsSpeedSteps = 23;
break;
case 2 :
_local1.pawnsSpeedSteps = 20;
break;
case 3 :
_local1.pawnsSpeedSteps = 18;
}
switch (_local1.gameMode) {
case 0 :
_local1.powerupAppearChance = 0.2;
break;
case 1 :
_local1.powerupAppearChance = 0.25;
break;
case 2 :
_local1.powerupAppearChance = 0.3;
break;
case 3 :
_local1.powerupAppearChance = 0.35;
}
_local1.powerupActionTime = 400;
_local1.maxPowerups = _local1.gameMode + 1;
_local1.powerupLife = 300;
_local1.pawnsLeft = (_root.cheat_mode ? (Number(_root.cheatInitPawns)) : (20 + ((_local1.currentLevel - 1) * 5)));
_local1.pawnsSpeedMultiplier = 1;
_local1.levelStarted = false;
_local1.pawnsFrozen = false;
_local1.gamePaused = false;
_local1.levelFinished = false;
_local1.totalPowerups = 0;
_local1.pawnsStepCounter = _local1.pawnsStepTimer;
_local1.pawnsAppearCounter = _local1.pawnsAppearTimer;
_root.attachMovie("boardShadow", "boardShadow", 22, {_x:10, _y:8});
_local1.gameFieldMC = _root.createEmptyMovieClip("gameFieldMC", 1);
_local1.piecesMC = _root.createEmptyMovieClip("piecesMC", 5);
var maskMC = _root.attachMovie("mask", "maskMC", 6);
_local1.powerupsMC = _root.createEmptyMovieClip("powerupsMC", 7);
_local1.powerupsIconsMC = _root.createEmptyMovieClip("powerupsIconsMC", 8);
_local1.powerupsIconsMC._x = 461;
_local1.powerupsIconsMC._y = 262;
_local1.powerupsMC._x = (_local1.gameFieldMC._x = (_local1.piecesMC._x = (maskMC._x = _local1.gameMCOffsetX)));
_local1.powerupsMC._y = (_local1.gameFieldMC._y = (_local1.piecesMC._y = (maskMC._y = _local1.gameMCOffsetY)));
_local1.piecesMC.setMask(maskMC);
_local1.effectsMC = _root.createEmptyMovieClip("effectsMC", 9);
var maskMC_2 = _root.attachMovie("mask", "maskMC_2", 10);
_local1.effectsMC._x = (maskMC_2._x = _local1.gameMCOffsetX);
_local1.effectsMC._y = (maskMC_2._y = _local1.gameMCOffsetY);
_local1.effectsMC.setMask(maskMC_2);
var _local2 = 0;
while (_local2 < 64) {
var _local3 = Math.floor(_local2 / 8);
var col = (_local2 % 8);
var initObject = {row:_local3, col:col, _x:col * _local1.tileWidth, _y:_local3 * _local1.tileHeight, controller:_local1};
_local1.gameFieldMC.attachMovie("tile", (("tile_" + _local3) + "_") + col, _local2 + 1, initObject);
_local2++;
}
_root.attachMovie("fortress", "fortress", 21, {_x:_local1.gameMCOffsetX, _y:(_local1.gameMCOffsetY + (_local1.tileHeight * 7)) + 10});
_local1.interfaceMC = _root.interfaceMC;
_root.boardMC.gotoAndStop((_local1.currentLevel % 4) + 1);
_local1.interfaceMC.castleMC.gotoAndStop(1);
}
function initKnight() {
var _local1 = this;
var _local3 = _root;
_local1.comboCounter = 1;
_local1.ghostKnight = false;
_local1.knightSpeedMultiplier = 1;
_local1.knightBlocked = false;
_local1.knightPlaced = false;
_local1.knightMC = _local3.attachMovie("knight", "knight", 19, {controller:_local1, bonusLevel:false, _x:_local3._xmouse, _y:_local3._ymouse});
var _local2 = _local3.attachMovie("mask", "maskMC_3", 20);
_local2._x = _local1.gameMCOffsetX;
_local2._y = _local1.gameMCOffsetY;
_local1.knightMC.setMask(_local2);
}
function showTileState() {
var _local1 = this;
var row = Math.floor(_local1.gameFieldMC._ymouse / _local1.tileHeight);
var col = Math.floor(_local1.gameFieldMC._xmouse / _local1.tileWidth);
if (_local1.pressedTilesArray.length != 0) {
var _local2 = _local1.pressedTilesArray.shift();
_local1.startKnightMove(_local2);
}
}
function capturePawns(row, col) {
var _local1 = this;
var lightningX = _local1.knightMC._x;
lightningX = ((lightningX < 85) ? 85 : (lightningX));
lightningX = ((lightningX > 335) ? 335 : (lightningX));
var captureHitArea = _root.attachMovie("captureHitArea", "captureHitArea", 23, {_x:lightningX, _y:5});
for (var i in _local1.piecesMC) {
var _local2 = _local1.piecesMC[i];
if (_local2.hitTest(captureHitArea)) {
_local1.effectsMC.attachMovie("blastMC", "blast_" + _local1.piecesCounter, _local1.piecesCounter, {_x:_local2._x, _y:_local2._y});
_local1.piecesCounter = _local1.piecesCounter + 1;
_local2.removeMovieClip();
_local1.removePawn();
}
}
}
function bombTaken() {
var _local1 = this;
for (var i in _local1.piecesMC) {
var _local2 = _local1.piecesMC[i];
_local1.effectsMC.attachMovie("blastMC", "blast_" + _local1.piecesCounter, _local1.piecesCounter, {_x:_local2._x, _y:_local2._y});
_local1.piecesCounter = _local1.piecesCounter + 1;
_local2.removeMovieClip();
_local1.removePawn();
}
for (var p in _local1.powerupsIconsMC) {
switch (_local1.powerupsIconsMC[p].powerupType) {
case "HSP" :
case "FRZ" :
_local1.powerupsIconsMC[p].actionTime = -1;
}
}
}
function stopPowerupAction(powerupType) {
var _local1 = this;
switch (powerupType) {
case "SUK" :
_local1.knightSpeedMultiplier = 1;
return;
case "HSP" :
_local1.pawnsSpeedMultiplier = 1;
return;
case "GKT" :
_local1.ghostKnight = false;
return;
case "FRZ" :
_local1.pawnsFrozen = false;
}
}
function powerupTake(takenPowerupMC) {
var _local1 = this;
var _local2 = takenPowerupMC;
var _local3 = _root;
for (var i in _local1.powerupsIconsMC) {
if (_local1.powerupsIconsMC[i] != _local2) {
switch (_local2.powerupType) {
case "SUK" :
case "GKT" :
case "HSP" :
case "FRZ" :
if (_local1.powerupsIconsMC[i].powerupType != _local2.powerupType) {
break;
}
removeMovieClip(_local1.powerupsIconsMC[i]);
}
}
}
switch (_local2.powerupType) {
case "SUK" :
case "GKT" :
case "HSP" :
case "FRZ" :
_local3.attachMovie("powerupBox", "ptb_" + _local1.piecesCounter, _local1.piecesCounter + 100, {row:_local2.row, col:_local2.col, powerupType:_local2.powerupType, controller:_local1});
_local1.piecesCounter = _local1.piecesCounter + 1;
var pupIconMC = _local1.powerupsIconsMC.attachMovie("powerupIcon", "picon_" + _local1.piecesCounter, _local1.piecesCounter, {powerupType:_local2.powerupType, actionTime:_local1.powerupActionTime, controller:_local1});
_local1.piecesCounter = _local1.piecesCounter + 1;
}
switch (_local2.powerupType) {
case "SUK" :
_local3.soundMan.playSFX("powerup_speedup");
_local1.knightSpeedMultiplier = 2;
break;
case "HSP" :
_local3.soundMan.playSFX("powerup_speeddown");
_local1.pawnsSpeedMultiplier = 0.5;
break;
case "GKT" :
_local3.soundMan.playSFX("powerup_ghost");
_local1.ghostKnight = true;
break;
case "CAP" :
_local3.soundMan.playSFX("powerup_capture");
_local1.capturePawns(_local1.knightMC.row, _local1.knightMC.col);
break;
case "BMB" :
_local3.soundMan.playSFX("powerup_bomb");
_local1.bombTaken();
break;
case "FRZ" :
_local3.soundMan.playSFX("powerup_freeze");
_local1.pawnsFrozen = true;
if (_local1.pawnsOnBoard() == 0) {
pupIconMC.actionTime = -1;
}
break;
case "EXR" :
_local3.soundMan.playSFX("powerup_life");
_local1.lives = _local1.lives + 1;
_local1.updateInterface();
break;
case "RPR" :
_local3.soundMan.playSFX("powerup_life");
_local1.castleEnergy = 8;
_local1.interfaceMC.castleMC.gotoAndStop(1);
}
_local1.totalPowerups = _local1.totalPowerups - 1;
removeMovieClip(_local2);
}
function updateInterface() {
var _local1 = this;
_local1.interfaceMC.currentLevel = _local1.currentLevel;
_local1.interfaceMC.pawnsLeft = _local1.pawnsLeft;
_local1.interfaceMC.score = _local1.score;
_local1.interfaceMC.lives = _local1.lives;
_local1.interfaceMC.bonusCoinsCollected = _local1.bonusCoinsCollected;
_local1.interfaceMC.bonusTimer = _local1.bonusTimer;
}
function startLevel() {
var _local2 = this;
var _local3 = _root;
_local2.updateInterface();
switch (_local2.gameMode) {
case 0 :
_local2.powerupsAppearPercents = [24, 49, -1, 69, -1, -1, 77, 100];
break;
case 1 :
_local2.powerupsAppearPercents = [19, 39, 44, 59, 69, 79, 85, 100];
break;
case 2 :
_local2.powerupsAppearPercents = [14, 29, 39, 54, 74, 84, 88, 100];
break;
case 3 :
_local2.powerupsAppearPercents = [14, 24, 49, 64, 84, 89, 92, 100];
}
_local2.pressedTilesArray = [];
_local2.fieldArray = [];
var _local1 = 0;
while (_local1 < 8) {
_local2.fieldArray.push([undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined]);
_local1++;
}
_local2.piecesCounter = 0;
_local2.coinsCollected = 0;
_local2.castleEnergy = 8;
_local2.initKnight();
_local3.onEnterFrame = function () {
var _local1 = _root;
if ((!_local1.controller.gamePaused) && (!_local1.controller.levelFinished)) {
_local1.controller.update();
}
};
}
function checkIfMedalAwarded() {
var _local2 = this;
var _local1 = (((_local2.currentLevel - 1) > 20) ? 4 : (Math.floor((_local2.currentLevel - 1) / 5)));
if (_local1 > 0) {
_local2.awardMedal(_local1);
}
}
function finishGame() {
var _local1 = _root;
var _local2 = this;
var _local3 = ((_local2.currentLevel > 20) ? 4 : (Math.floor(_local2.currentLevel / 5)));
switch (_local3) {
case 0 :
_local1.medalAwarded = "No medal awarded";
break;
case 1 :
_local1.medalAwarded = "Bronze medal awarded";
break;
case 2 :
_local1.medalAwarded = "Silver medal awarded";
break;
case 3 :
_local1.medalAwarded = "Gold medal awarded";
break;
case 4 :
_local1.medalAwarded = "Platinum medal awarded";
}
_local1.finalScore = "Final score: " + _local2.score;
_local1.gainedMedalIndex = _local3;
_local2.gameOver = true;
_local1.attachMovie("gameOverMC", "gameOverMC", 20000);
}
function awardMedal(medalIndex) {
var _local1 = this;
var _local2 = medalIndex;
switch (_local1.gameMode) {
case 0 :
_local1.shared.data.noviceMedal = _local2;
break;
case 1 :
_local1.shared.data.amateurMedal = _local2;
break;
case 2 :
_local1.shared.data.proMedal = _local2;
break;
case 3 :
_local1.shared.data.grandmasterMedal = _local2;
}
_local1.shared.flush();
}
function quitGame() {
delete _root.onEnterFrame;
gameOver = true;
clearLevel();
_root.gotoAndPlay("menu");
}
function removePawn() {
var _local1 = this;
_local1.score = _local1.score + 10;
_local1.pawnsLeft = ((_local1.pawnsLeft > 0) ? (_local1.pawnsLeft - 1) : 0);
_local1.updateInterface();
if ((_local1.pawnsLeft == 0) && (!_local1.levelFinished)) {
_local1.currentLevel = _local1.currentLevel + 1;
_root.attachMovie("fadingMC", "fadingMC", 20000, {toFrame:"level_complete"});
_local1.levelFinished = true;
_root.soundMan.playSFX("big_gong");
}
var _local2 = _local1.pawnsOnBoard();
if (_local2 == 0) {
_local1.placeCoin();
}
}
function pawnsOnBoard() {
var _local2 = this;
var _local3 = 0;
for (var i in _local2.piecesMC) {
var _local1 = _local2.piecesMC[i];
if ((_local1.type == 2) && (_local1._y > -20)) {
_local3 = _local3 + 1;
}
}
return(_local3);
}
function killPawn(x, y) {
var _local1 = this;
_local1.fieldArray[_local1.knightMC.row][_local1.knightMC.col] = _local1.knightMC;
_root.soundMan.playSFX("pawn_captured");
var _local3 = 10 * _local1.comboCounter;
_local1.score = _local1.score + _local3;
var scoreString = ((_local1.comboCounter == 1) ? (String(_local3)) : ((("Combo x " + _local1.comboCounter) + "\r") + _local3));
_root.attachMovie("scoreTip", "score_" + _local1.piecesCounter, _local1.piecesCounter + 100, {_x:x + _local1.gameMCOffsetX, _y:y + _local1.gameMCOffsetY, score:scoreString});
_local1.comboCounter = _local1.comboCounter + 1;
if (_local1.comboCounter > 2) {
_root.soundMan.playComboSFX(_local1.comboCounter - 2);
}
_local1.pawnsLeft = _local1.pawnsLeft - 1;
_local1.updateInterface();
if ((_local1.pawnsLeft == 0) && (!_local1.levelFinished)) {
_local1.currentLevel = _local1.currentLevel + 1;
_root.attachMovie("fadingMC", "fadingMC", 20000, {toFrame:"level_complete"});
_local1.levelFinished = true;
_root.soundMan.playSFX("big_gong");
}
_local1.showHint("pawns_combo");
var totalPawns = (_local1.pawnsOnBoard() - 1);
if (totalPawns == 0) {
_local1.placeCoin();
for (var _local2 in _local1.powerupsIconsMC) {
if (_local1.powerupsIconsMC[_local2].powerupType == "FRZ") {
_local1.powerupsIconsMC[_local2].actionTime = -1;
}
}
}
}
function hitCastle(x) {
var _local1 = this;
var _local2 = _root;
if (_local1.castleEnergy > 1) {
_local2.soundMan.playSFX("hit_castle");
_local1.castleEnergy = _local1.castleEnergy - 1;
_local1.interfaceMC.castleMC.gotoAndStop(9 - _local1.castleEnergy);
_local1.effectsMC.attachMovie("stonesHit", "stones_" + _local1.piecesCounter, _local1.piecesCounter, {_x:x + 25, _y:300, _xscale:25, _yscale:25});
_local1.piecesCounter = _local1.piecesCounter + 1;
} else {
_local2.soundMan.playSFX("castle_captured");
_local2.gameOverReason = "Your Castle was captured";
_local1.finishGame();
}
}
function killKnight() {
var _local1 = this;
_root.soundMan.playSFX("knight_captured");
_local1.knightMC.removeMovieClip();
_local1.knightAppearTimer = 50;
_local1.knightBlocked = true;
_local1.lives = _local1.lives - 1;
_local1.updateInterface();
for (var _local2 in _local1.powerupsIconsMC) {
_local1.powerupsIconsMC[_local2].actionTime = -1;
}
if (_local1.lives == 0) {
_root.gameOverReason = "All your knights were captured";
_local1.finishGame();
}
}
function placePowerup() {
var _local1 = this;
if (_local1.totalPowerups == _local1.maxPowerups) {
} else {
var _local3 = true;
do {
var powerupTypeChance = Math.floor(Math.random() * 100);
var _local2 = 0;
while (_local2 < 8) {
if (powerupTypeChance <= _local1.powerupsAppearPercents[_local2]) {
var powerupType = _local1.powerupsTypesArray[_local2];
break;
}
_local2++;
}
if (_local1.totalPowerups == 0) {
_local3 = false;
} else {
for (var i in _local1.powerupsMC) {
if (_local1.powerupsMC[i].powerupType == powerupType) {
_local3 = true;
break;
}
_local3 = false;
}
}
if ((powerupType == "RPR") && (_local1.castleEnergy == 8)) {
_local3 = true;
}
} while (_local3);
var powerupPlaced = false;
do {
var randomRow = Math.floor(Math.random() * 8);
var randomCol = Math.floor(Math.random() * 8);
if (_local1.fieldArray[randomRow][randomCol].type == undefined) {
powerupPlaced = true;
}
} while (!powerupPlaced);
_local1.totalPowerups = _local1.totalPowerups + 1;
var newPowerMC = _local1.powerupsMC.attachMovie("powerup", "pw_" + _local1.piecesCounter, _local1.piecesCounter, {powerupType:powerupType, lifeTime:_local1.powerupLife, row:randomRow, col:randomCol, controller:_local1});
_local1.fieldArray[randomRow][randomCol] = newPowerMC;
_local1.piecesCounter = _local1.piecesCounter + 1;
}
}
function placeCoin() {
var _local2 = this;
for (var i in _local2.powerupsMC) {
var _local3 = _local2.powerupsMC[i];
if (_local3.type == 4) {
return;
}
}
var _local1 = _local2.previousCoinQuadrant;
do {
_local1 = Math.floor(Math.random() * 4);
} while (_local1 == _local2.previousCoinQuadrant);
var coinPlaced = false;
do {
if (_local1 < 2) {
var row = (Math.floor(Math.random() * 3) + 1);
} else {
var row = (Math.floor(Math.random() * 4) + 4);
}
if ((_local1 == 0) || (_local1 == 2)) {
var col = Math.floor(Math.random() * 4);
} else {
var col = (Math.floor(Math.random() * 4) + 4);
}
if (_local2.fieldArray[row][col].type == undefined) {
coinPlaced = true;
}
} while (!coinPlaced);
var coinMC = _local2.powerupsMC.attachMovie("goldCoinMC", "gc_" + _local2.piecesCounter, _local2.piecesCounter, {bonusLevel:false, lifeTime:_local2.powerupLife, controller:_local2, row:row, col:col});
_local2.piecesCounter = _local2.piecesCounter + 1;
_local2.fieldArray[row][col] = coinMC;
_local2.previousCoinQuadrant = _local1;
}
function coinTake(coinMC) {
var _local1 = this;
_root.soundMan.playSFX("coin_taken");
coinMC.removeMovieClip();
_local1.coinsCollected = _local1.coinsCollected + 1;
if (_local1.advancedModesHint == 0) {
if ((_local1.gameMode == 0) && (_local1.coinsCollected == 10)) {
_local1.advancedModesHint = 1;
_local1.gamePaused = true;
_root.attachMovie("advancedModesWindow", "pauseMenu", 25);
}
}
}
function gotoAdvancedModes() {
delete _root.onEnterFrame;
_root.attachMovie("fadingMC", "fadingMC", 20000, {toFrame:"menu"});
}
function update() {
var _local1 = this;
if (_local1.knightBlocked && (!_local1.gameOver)) {
_local1.knightAppearTimer = _local1.knightAppearTimer - 1;
if (_local1.knightAppearTimer == 0) {
_local1.knightBlocked = false;
_local1.initKnight();
}
}
_local1.knightMC.update(_local1.knightPlaced, _local1.ghostKnight);
if ((_local1.pressedTilesArray.length > 0) && (_local1.knightMC.moving == 0)) {
var tile = _local1.pressedTilesArray.shift();
_local1.startKnightMove(tile);
}
if (_local1.levelStarted && (_local1.knightPlaced)) {
var totalPawns = _local1.pawnsOnBoard();
if (totalPawns == 0) {
_local1.placeCoin();
}
if (_local1.pawnsStepCounter >= Math.floor(_local1.pawnsStepTimer / _local1.pawnsSpeedMultiplier)) {
_local1.pawnsStepCounter = 0;
if (((Math.random() < _local1.powerupAppearChance) && (_local1.knightPlaced)) && (totalPawns > 0)) {
_local1.placePowerup();
}
_local1.showHint("pawns_hit");
if ((!_local1.pawnsFrozen) && (_local1.knightPlaced)) {
var _local3;
for (var i in _local1.piecesMC) {
var _local2 = _local1.piecesMC[i];
if ((((_local1.fieldArray[_local2.row + 1][_local2.col + 1].type == 1) || (_local1.fieldArray[_local2.row + 1][_local2.col - 1].type == 1)) && (_local2.row >= 0)) && (!_local1.ghostKnight)) {
_local3 = _local2;
_local2.startCapture(Math.round(_local1.pawnsSpeedSteps / _local1.pawnsSpeedMultiplier));
break;
}
}
if (_local3 == undefined) {
for (var i in _local1.piecesMC) {
_local1.piecesMC[i].startMove(Math.round(_local1.pawnsSpeedSteps / _local1.pawnsSpeedMultiplier));
}
}
if (_local1.pawnsAppearCounter >= _local1.pawnsAppearTimer) {
_local1.pawnsAppearTimer = ((Math.random() < 0.2) ? 2 : 1);
_local1.pawnsAppearCounter = 0;
if (_local3 == undefined) {
_local1.placePawnsRow();
}
} else {
_local1.pawnsAppearCounter = _local1.pawnsAppearCounter + 1;
}
}
} else {
_local1.pawnsStepCounter = _local1.pawnsStepCounter + 1;
}
for (var i in _local1.piecesMC) {
_local1.piecesMC[i].update();
}
for (var i in _local1.powerupsMC) {
_local1.powerupsMC[i].update();
}
for (var i in _local1.powerupsIconsMC) {
_local1.powerupsIconsMC[i].update();
}
for (var i in _local1.effectsMC) {
_local1.effectsMC[i].update();
}
}
}
function placePawnsRow() {
var _local1 = this;
var _local2 = 0;
var _local3 = 0;
while (_local3 < 8) {
_local2 = ((_local1.fieldArray[0][_local3].type == undefined) ? (_local2 + 1) : (_local2));
_local3++;
}
if (_local2 > 0) {
_local2 = ((_local2 > 7) ? 7 : (_local2));
_local2 = Math.floor(Math.random() * _local2) + 1;
_local2 = ((_local2 > _local1.totalPawnsAppear) ? (_local1.totalPawnsAppear) : (_local2));
} else {
return;
}
var pawnCounter = 0;
var fieldColumns = [0, 1, 2, 3, 4, 5, 6, 7];
do {
var randomIndex = Math.floor(Math.random() * fieldColumns.length);
var randomColumn = fieldColumns[randomIndex];
if (_local1.fieldArray[0][randomColumn].type == undefined) {
fieldColumns.splice(randomIndex, 1);
pawnCounter = pawnCounter + 1;
var initObject = {row:-1, col:randomColumn, controller:_local1};
var newPawnMC = _local1.piecesMC.attachMovie("pawn", "pawn_" + _local1.piecesCounter, _local1.piecesCounter + 1, initObject);
_local1.piecesCounter = _local1.piecesCounter + 1;
}
} while (pawnCounter < _local2);
}
function rollOverTile(tile) {
var _local2 = this;
var _local3 = tile;
if (((_local2.pressedTilesArray.length > 0) || (_local2.knightMC.moving != 0)) || (_local2.gamePaused)) {
} else {
var _local1 = {state:"", _x:_local3._x, _y:_local3._y};
if (_local2.checkWalkableTile(_local3.row, _local3.col)) {
_local1.state = "green";
} else {
_local1.state = "red";
}
_local2.tileRolloverMC = _root.boardMC.attachMovie("tileRolloverMC", "tileRolloverMC", 10, _local1);
}
}
function tilePressed(tile) {
var _local1 = this;
var _local2 = tile;
var _local3 = _root;
if (!_local1.gamePaused) {
var initObject = {_x:_local2._x, _y:_local2._y};
_local1.tileRolloverMC.removeMovieClip();
_local3.boardMC.attachMovie("tileClickedMC", "tc_" + _local1.piecesCounter, 12 + _local1.piecesCounter, initObject);
_local1.piecesCounter = _local1.piecesCounter + 1;
if (!_local1.knightPlaced) {
if (!_local1.checkWalkableTile(_local2.row, _local2.col)) {
_local3.soundMan.playSFX("locked");
return;
}
_local3.soundMan.playSFX("horse");
_local1.knightPlaced = true;
_local1.knightMC.putOnPlace(_local2.row, _local2.col);
_local1.levelStarted = true;
} else if (!_local1.knightBlocked) {
_local3.soundMan.playSFX("click");
_local1.pressedTilesArray.push(_local2);
}
_local1.showHint("move_knight");
}
}
function startKnightMove(tile) {
var _local1 = this;
var _local2 = tile;
var dRow = (_local1.knightMC.row - _local2.row);
var _local3 = _local1.knightMC.col - _local2.col;
if (((Math.abs(dRow) == 2) && (Math.abs(_local3) == 1)) || ((Math.abs(dRow) == 1) && (Math.abs(_local3) == 2))) {
_local1.gameFieldMC.attachMovie("tileGlow", "tileGlow", 100, {_x:_local2._x, _y:_local2._y});
_local1.knightMC.startMove(_local2.row, _local2.col, Math.round(_local1.knightMovingSteps / _local1.knightSpeedMultiplier));
} else {
_root.soundMan.playSFX("locked");
_local1.pressedTilesArray = [];
}
}
function knightHit() {
var _local1 = this;
var _local2 = _local1.fieldArray[_local1.knightMC.row][_local1.knightMC.col];
switch (_local2.type) {
case 4 :
_local1.coinTake(_local2);
_local1.comboCounter = 1;
return;
case 3 :
_local1.powerupTake(_local2);
_local1.comboCounter = 1;
return;
case 2 :
_local2.hitByKnight();
return;
default :
var _local3 = _local1.knightMC._x;
var knightMCy = _local1.knightMC._y;
if (_local1.piecesMC.hitTest(_local3, knightMCy, true) && (_local1.knightMC.moving == 0)) {
for (var i in _local1.piecesMC) {
_local2 = _local1.piecesMC[i];
if (_local2.hitTest(_local3 + _local1.gameMCOffsetX, knightMCy + _local1.gameMCOffsetY, true)) {
_local2.hitByKnight();
break;
}
}
} else {
_local1.comboCounter = 1;
}
}
}
function checkWalkableTile(tileRow, tileCol) {
var _local2 = this;
if (!_local2.knightPlaced) {
if (_local2.fieldArray[tileRow][tileCol].type == undefined) {
return(true);
}
return(false);
}
var _local3 = _local2.knightMC.row - tileRow;
var _local1 = _local2.knightMC.col - tileCol;
if (((Math.abs(_local3) == 2) && (Math.abs(_local1) == 1)) || ((Math.abs(_local3) == 1) && (Math.abs(_local1) == 2))) {
return(true);
}
return(false);
}
var advancedModesHint = 0;
var previousCoinQuadrant = 0;
var tileWidth = 50;
var tileHeight = 45;
var gameMCOffsetX = 10;
var gameMCOffsetY = 10;
var powerupsTypesArray = ["SUK", "HSP", "GKT", "CAP", "BMB", "FRZ", "EXR", "RPR"];
}
Symbol 6 MovieClip Frame 1
var gameBytesTotal = 0;
var gameBytesLoaded = 0;
var percent = 0;
Symbol 6 MovieClip Frame 3
gameBytesTotal = _root.getBytesTotal();
gameBytesLoaded = _root.getBytesLoaded();
percent = Math.round((gameBytesLoaded / gameBytesTotal) * 100);
bar.loadbar._xscale = percent;
if (((gameBytesLoaded >= gameBytesTotal) && (gameBytesTotal > 0)) && (_root.logo._currentframe >= _root.logo._totalframes)) {
_root.gotoAndPlay("init_game");
stop();
} else {
gotoAndPlay ("preload");
}
Symbol 9 Button
on (press) {
getURL (_root.main_link, "_blank");
}
Symbol 79 MovieClip Frame 1
_root.loading._visible = false;
Symbol 79 MovieClip Frame 207
_root.loading._visible = true;
stop();
Symbol 89 MovieClip [blastMC] Frame 16
this.removeMovieClip();
Symbol 97 MovieClip [captureHitArea] Frame 8
this.removeMovieClip();
Symbol 110 MovieClip [debrisMC] Frame 1
#initclip 26
Object.registerClass("debrisMC", Classes.Debris);
#endinitclip
stop();
Symbol 115 MovieClip [scoreTip] Frame 37
this.removeMovieClip();
Symbol 134 MovieClip [stonesHit] Frame 19
this.removeMovieClip();
Instance of Symbol 135 MovieClip in Symbol 138 MovieClip [fadingMC] Frame 1
onClipEvent (load) {
this.useHandCursor = false;
}
on (press) {
this.useHandCursor = false;
}
Symbol 138 MovieClip [fadingMC] Frame 36
_root.controller.clearLevel();
_root.gotoAndPlay(toFrame);
Symbol 138 MovieClip [fadingMC] Frame 50
this.removeMovieClip();
Symbol 139 MovieClip [gameOverMC] Frame 39
delete _root.onEnterFrame;
_root.controller.clearLevel();
_root.boardShadow.removeMovieClip();
_root.fortress.removeMovieClip();
_root.pauseMenu.removeMovieClip();
_root.maskMC.removeMovieClip();
_root.maskMC_2.removeMovieClip();
_root.maskMC_3.removeMovieClip();
_root.powerupsIconsMC.removeMovieClip();
_root.gotoAndPlay("game_over");
Symbol 139 MovieClip [gameOverMC] Frame 59
this.removeMovieClip();
Symbol 153 Button
on (press) {
_root.soundMan.playSFX("click");
_root.controller.disableHints();
}
Symbol 154 Button
on (press) {
_root.soundMan.playSFX("click");
_root.controller.closeHint();
}
Symbol 166 MovieClip [hintMC] Frame 1
#initclip 15
Object.registerClass("hintMC", Classes.HintMC);
#endinitclip
stop();
Symbol 166 MovieClip [hintMC] Frame 2
stop();
Instance of Symbol 151 MovieClip [tileGlow] in Symbol 166 MovieClip [hintMC] Frame 2
onClipEvent (load) {
var tileCoords = _root.controller.getMoveKnightHint();
_x = ((tileCoords.col * 50) + 10);
_y = ((tileCoords.row * 45) + 10);
}
Instance of Symbol 155 MovieClip in Symbol 166 MovieClip [hintMC] Frame 2
onClipEvent (load) {
var tileCoords = _root.controller.getMoveKnightHint();
if (((tileCoords.row * 45) + 10) > 180) {
_y = 16;
} else {
_y = 195;
}
}
Symbol 166 MovieClip [hintMC] Frame 3
stop();
Symbol 166 MovieClip [hintMC] Frame 4
stop();
Instance of Symbol 151 MovieClip [tileGlow] in Symbol 166 MovieClip [hintMC] Frame 4
onClipEvent (load) {
var tileCoords = _root.controller.getPawnHitHint();
_x = ((tileCoords.col * 50) + 10);
_y = ((tileCoords.row * 45) + 10);
}
Symbol 166 MovieClip [hintMC] Frame 5
stop();
Symbol 166 MovieClip [hintMC] Frame 6
stop();
Instance of Symbol 151 MovieClip [tileGlow] in Symbol 166 MovieClip [hintMC] Frame 6
onClipEvent (load) {
var tileCoords = _root.controller.getPowerupHint();
_x = ((tileCoords.col * 50) + 10);
_y = ((tileCoords.row * 45) + 10);
}
Instance of Symbol 160 MovieClip in Symbol 166 MovieClip [hintMC] Frame 6
onClipEvent (load) {
var tileCoords = _root.controller.getPowerupHint();
if (((tileCoords.row * 45) + 10) > 180) {
_y = 16;
} else {
_y = 195;
}
}
Symbol 166 MovieClip [hintMC] Frame 7
stop();
Symbol 166 MovieClip [hintMC] Frame 8
stop();
Symbol 166 MovieClip [hintMC] Frame 9
stop();
Symbol 166 MovieClip [hintMC] Frame 10
stop();
Instance of Symbol 151 MovieClip [tileGlow] in Symbol 166 MovieClip [hintMC] Frame 10
onClipEvent (load) {
var tileCoords = _root.controller.getCoinsHint();
_x = ((tileCoords.col * 50) + 10);
_y = ((tileCoords.row * 45) + 10);
}
Instance of Symbol 165 MovieClip in Symbol 166 MovieClip [hintMC] Frame 10
onClipEvent (load) {
var tileCoords = _root.controller.getCoinsHint();
if (((tileCoords.row * 45) + 10) > 180) {
_y = 16;
} else {
_y = 195;
}
}
Symbol 169 Button
on (press) {
_root.soundMan.playSFX("click");
this.removeMovieClip();
}
Instance of Symbol 135 MovieClip in Symbol 170 MovieClip [modeLocked] Frame 1
onClipEvent (load) {
this.useHandCursor = false;
}
on (press) {
this.useHandCursor = false;
}
Symbol 174 MovieClip [uni_button] Frame 1
#initclip 16
Object.registerClass("uni_button", Classes.MCButton);
#endinitclip
Instance of Symbol 174 MovieClip [uni_button] in Symbol 175 MovieClip [pauseMenu] Frame 1
//component parameters
onClipEvent (initialize) {
labelString = "End game";
flashing = false;
colorCode = "0x000000";
textAlignment = "center";
}
on (release) {
_root.soundMan.playSFX("click");
_root.controller.quitGame();
}
Instance of Symbol 174 MovieClip [uni_button] in Symbol 175 MovieClip [pauseMenu] Frame 1
//component parameters
onClipEvent (initialize) {
labelString = "Play more games";
flashing = false;
colorCode = "0x000000";
textAlignment = "center";
}
on (release) {
_root.soundMan.playSFX("click");
getURL (_root.main_link, "_blank");
}
Instance of Symbol 174 MovieClip [uni_button] in Symbol 175 MovieClip [pauseMenu] Frame 1
//component parameters
onClipEvent (initialize) {
labelString = "High scores";
flashing = false;
colorCode = "0x000000";
textAlignment = "center";
}
on (release) {
_root.soundMan.playSFX("click");
getURL (_root.viewscores_link, "_blank");
}
Instance of Symbol 174 MovieClip [uni_button] in Symbol 175 MovieClip [pauseMenu] Frame 1
//component parameters
onClipEvent (initialize) {
labelString = "Resume game";
flashing = true;
colorCode = "0x000000";
textAlignment = "center";
}
on (release) {
_root.soundMan.playSFX("click");
_root.controller.pauseGame(false);
}
Instance of Symbol 174 MovieClip [uni_button] in Symbol 175 MovieClip [pauseMenu] Frame 1
//component parameters
onClipEvent (initialize) {
labelString = "Get game for your site";
flashing = false;
colorCode = "0x000000";
textAlignment = "center";
}
on (release) {
_root.soundMan.playSFX("click");
getURL (_root.get_game_link, "_blank");
}
Instance of Symbol 174 MovieClip [uni_button] in Symbol 175 MovieClip [pauseMenu] Frame 1
//component parameters
onClipEvent (initialize) {
labelString = "Download game";
flashing = false;
colorCode = "0x000000";
textAlignment = "center";
}
on (release) {
_root.soundMan.playSFX("click");
getURL (_root.download_link, "_blank");
}
Instance of Symbol 174 MovieClip [uni_button] in Symbol 175 MovieClip [pauseMenu] Frame 1
//component parameters
onClipEvent (initialize) {
labelString = "";
flashing = false;
colorCode = "0x000000";
textAlignment = "center";
}
onClipEvent (load) {
labelString = _root.controller.getSoundState();
}
on (release) {
_root.soundMan.playSFX("click");
_root.controller.switchSound();
labelString = _root.controller.getSoundState();
}
Instance of Symbol 174 MovieClip [uni_button] in Symbol 175 MovieClip [pauseMenu] Frame 1
//component parameters
onClipEvent (initialize) {
labelString = "";
flashing = false;
colorCode = "0x000000";
textAlignment = "center";
}
onClipEvent (load) {
labelString = _root.controller.getQualityState();
}
on (press) {
_root.soundMan.playSFX("click");
_root.controller.switchQuality();
labelString = _root.controller.getQualityState();
}
Symbol 187 MovieClip [knight] Frame 1
#initclip 17
Object.registerClass("knight", Classes.Knight);
#endinitclip
stop();
Symbol 187 MovieClip [knight] Frame 6
stop();
Symbol 190 MovieClip [pawn] Frame 1
#initclip 18
Object.registerClass("pawn", Classes.Pawn);
#endinitclip
Symbol 207 MovieClip [powerup] Frame 1
#initclip 19
Object.registerClass("powerup", Classes.Powerup);
#endinitclip
Symbol 226 MovieClip [powerupIcon] Frame 1
#initclip 20
Object.registerClass("powerupIcon", Classes.PowerupIcon);
#endinitclip
Symbol 228 MovieClip [tile] Frame 1
#initclip 21
Object.registerClass("tile", Classes.Tile);
#endinitclip
Symbol 229 MovieClip [tileClickedMC] Frame 6
this.removeMovieClip();
Symbol 232 MovieClip [tileRolloverMC] Frame 1
gotoAndStop(state);
Symbol 238 MovieClip [goldCoinMC] Frame 1
#initclip 22
Object.registerClass("goldCoinMC", Classes.GoldCoin);
#endinitclip
Symbol 240 MovieClip [star] Frame 26
stop();
Symbol 241 MovieClip [powerupBox] Frame 1
#initclip 23
Object.registerClass("powerupBox", Classes.PowerupToBox);
#endinitclip
Symbol 245 MovieClip Frame 1
stop();
Symbol 245 MovieClip Frame 2
play();
Symbol 245 MovieClip Frame 51
stop();
Symbol 253 MovieClip Frame 1
gotoAndPlay(Math.floor(Math.random() * 40));
Symbol 264 MovieClip Frame 35
stop();
Symbol 275 Button
on (press) {
_root.soundMan.playSFX("click");
this._visible = false;
}
Instance of Symbol 135 MovieClip in Symbol 276 MovieClip Frame 1
onClipEvent (load) {
this.useHandCursor = false;
}
on (press) {
this.useHandCursor = false;
}
Symbol 280 MovieClip Frame 10
stop();
Symbol 282 Button
on (press) {
_root.soundMan.playSFX("click");
startNextLevel();
}
Symbol 283 MovieClip [levelCompleteScreen] Frame 1
#initclip 24
Object.registerClass("levelCompleteScreen", Classes.LevelCompleteScreen);
#endinitclip
Instance of Symbol 276 MovieClip "grandmasterUnlocked" in Symbol 283 MovieClip [levelCompleteScreen] Frame 1
onClipEvent (load) {
_visible = false;
}
Symbol 283 MovieClip [levelCompleteScreen] Frame 44
countCoins();
Symbol 283 MovieClip [levelCompleteScreen] Frame 58
countDamage();
Symbol 283 MovieClip [levelCompleteScreen] Frame 59
_root.soundMan.playSFX("pawn_captured");
Symbol 283 MovieClip [levelCompleteScreen] Frame 62
stop();
Symbol 287 Button
on (press) {
_root.soundMan.playSFX("click");
_root.controller.gotoAdvancedModes();
}
Symbol 290 Button
on (press) {
_root.soundMan.playSFX("click");
_root.controller.advancedModesHint = 2;
_root.controller.pauseGame(false);
}
Instance of Symbol 135 MovieClip in Symbol 291 MovieClip [advancedModesWindow] Frame 1
onClipEvent (load) {
this.useHandCursor = false;
}
on (press) {
this.useHandCursor = false;
}
Symbol 301 MovieClip Frame 1
stop();
Symbol 301 MovieClip Frame 2
stop();
Symbol 301 MovieClip Frame 3
stop();
Symbol 302 MovieClip [bonusLevelResult] Frame 1
#initclip 25
Object.registerClass("bonusLevelResult", Classes.BonusLevelComplete);
#endinitclip
Symbol 302 MovieClip [bonusLevelResult] Frame 44
countCoins();
Symbol 302 MovieClip [bonusLevelResult] Frame 62
countTime();
Symbol 302 MovieClip [bonusLevelResult] Frame 63
_root.soundMan.playSFX("pawn_captured");
Symbol 302 MovieClip [bonusLevelResult] Frame 66
stop();
Symbol 303 MovieClip Frame 1
stop();
Instance of Symbol 174 MovieClip [uni_button] in Symbol 303 MovieClip Frame 2
//component parameters
onClipEvent (initialize) {
labelString = "defaultValue";
flashing = false;
colorCode = "0xFFFFFF";
textAlignment = "center";
}
Symbol 339 MovieClip Frame 1
stop();
Symbol 347 Button
on (release) {
_root.soundMan.playSFX("click");
getURL (_root.main_link, "_blank");
}
Symbol 364 Button
on (release) {
getURL (_root.main_link, "_blank");
}
Symbol 370 MovieClip Frame 1
stop();
Instance of Symbol 174 MovieClip [uni_button] in Symbol 370 MovieClip Frame 1
//component parameters
onClipEvent (initialize) {
labelString = "Main menu";
flashing = false;
colorCode = "0x000000";
textAlignment = "center";
}
on (release) {
_root.soundMan.playSFX("click");
_parent._parent.gotoAndPlay("main_menu");
}
Instance of Symbol 174 MovieClip [uni_button] in Symbol 370 MovieClip Frame 1
//component parameters
onClipEvent (initialize) {
labelString = "Powerups section";
flashing = true;
colorCode = "0x000000";
textAlignment = "center";
}
on (release) {
_root.soundMan.playSFX("click");
_parent.gotoAndPlay(2);
}
Symbol 370 MovieClip Frame 2
stop();
Instance of Symbol 174 MovieClip [uni_button] in Symbol 370 MovieClip Frame 2
//component parameters
onClipEvent (initialize) {
labelString = "Objectives section";
flashing = true;
colorCode = "0x000000";
}
on (release) {
_root.soundMan.playSFX("click");
_parent.gotoAndPlay(1);
}
Symbol 378 Button
on (press) {
_root.soundMan.playSFX("click");
_root.controller.startGame(0);
}
Symbol 379 Button
on (press) {
_root.soundMan.playSFX("click");
_root.controller.startGame(1);
}
Symbol 380 Button
on (press) {
_root.soundMan.playSFX("click");
_root.controller.startGame(2);
}
Symbol 381 Button
on (press) {
_root.soundMan.playSFX("click");
_root.controller.startGame(3);
}
Symbol 384 MovieClip Frame 1
stop();
Symbol 384 MovieClip Frame 2
stop();
Symbol 384 MovieClip Frame 3
stop();
Symbol 384 MovieClip Frame 4
stop();
Symbol 384 MovieClip Frame 5
stop();
Symbol 390 MovieClip Frame 1
if (_root.controller.advancedModesHint == 1) {
_root.controller.advancedModesHint = 2;
gotoAndPlay ("select_mode");
}
stop();
Instance of Symbol 174 MovieClip [uni_button] in Symbol 390 MovieClip Frame 1
//component parameters
onClipEvent (initialize) {
labelString = "Play";
flashing = true;
colorCode = "0xFFFFFF";
textAlignment = "right";
}
on (release) {
_root.soundMan.playSFX("click");
_parent.gotoAndPlay("select_mode");
}
Instance of Symbol 174 MovieClip [uni_button] in Symbol 390 MovieClip Frame 1
//component parameters
onClipEvent (initialize) {
labelString = "High scores";
flashing = false;
colorCode = "0xFFFFFF";
textAlignment = "right";
}
on (release) {
_root.soundMan.playSFX("click");
getURL (_root.viewscores_link, "_blank");
}
Instance of Symbol 174 MovieClip [uni_button] in Symbol 390 MovieClip Frame 1
//component parameters
onClipEvent (initialize) {
labelString = "Play more games";
flashing = false;
colorCode = "0xFFFFFF";
textAlignment = "right";
}
on (release) {
_root.soundMan.playSFX("click");
getURL (_root.main_link, "_blank");
}
Instance of Symbol 174 MovieClip [uni_button] in Symbol 390 MovieClip Frame 1
//component parameters
onClipEvent (initialize) {
labelString = "Download game";
flashing = false;
colorCode = "0xFFFFFF";
textAlignment = "right";
}
on (release) {
_root.soundMan.playSFX("click");
getURL (_root.download_link, "_blank");
}
Instance of Symbol 174 MovieClip [uni_button] in Symbol 390 MovieClip Frame 1
//component parameters
onClipEvent (initialize) {
labelString = "Get game for your site";
flashing = false;
colorCode = "0xFFFFFF";
textAlignment = "right";
}
on (release) {
_root.soundMan.playSFX("click");
getURL (_root.get_game_link, "_blank");
}
Instance of Symbol 174 MovieClip [uni_button] in Symbol 390 MovieClip Frame 1
//component parameters
onClipEvent (initialize) {
labelString = "Options";
flashing = false;
colorCode = "0xFFFFFF";
textAlignment = "right";
}
on (release) {
_root.soundMan.playSFX("click");
_parent.gotoAndPlay("options");
}
Instance of Symbol 174 MovieClip [uni_button] in Symbol 390 MovieClip Frame 1
//component parameters
onClipEvent (initialize) {
labelString = "Help";
flashing = false;
colorCode = "0xFFFFFF";
textAlignment = "right";
}
on (release) {
_root.soundMan.playSFX("click");
_parent.gotoAndPlay("help");
}
Instance of Symbol 361 MovieClip in Symbol 390 MovieClip Frame 1
onClipEvent (load) {
_visible = _root.cheat_mode;
}
Symbol 390 MovieClip Frame 2
stop();
Instance of Symbol 174 MovieClip [uni_button] in Symbol 390 MovieClip Frame 2
//component parameters
onClipEvent (initialize) {
labelString = "High scores";
flashing = false;
colorCode = "0x000000";
textAlignment = "center";
shadowOn = false;
}
on (release) {
_root.soundMan.playSFX("click");
getURL (_root.viewscores_link, "_blank");
}
Instance of Symbol 174 MovieClip [uni_button] in Symbol 390 MovieClip Frame 2
//component parameters
onClipEvent (initialize) {
labelString = "Play more games";
flashing = false;
colorCode = "0x000000";
textAlignment = "center";
shadowOn = false;
}
on (release) {
_root.soundMan.playSFX("click");
getURL (_root.main_link, "_blank");
}
Instance of Symbol 174 MovieClip [uni_button] in Symbol 390 MovieClip Frame 2
//component parameters
onClipEvent (initialize) {
labelString = "Main menu";
flashing = true;
colorCode = "0x000000";
textAlignment = "center";
}
on (release) {
_root.soundMan.playSFX("click");
_parent.gotoAndPlay("main_menu");
}
Instance of Symbol 174 MovieClip [uni_button] in Symbol 390 MovieClip Frame 2
//component parameters
onClipEvent (initialize) {
labelString = "Get game for your site";
flashing = false;
colorCode = "0x000000";
textAlignment = "center";
shadowOn = false;
}
on (release) {
_root.soundMan.playSFX("click");
getURL (_root.get_game_link, "_blank");
}
Instance of Symbol 174 MovieClip [uni_button] in Symbol 390 MovieClip Frame 2
//component parameters
onClipEvent (initialize) {
labelString = "";
flashing = false;
colorCode = "0x000000";
textAlignment = "center";
}
onClipEvent (load) {
labelString = _root.controller.getSoundState();
}
on (release) {
_root.soundMan.playSFX("click");
_root.controller.switchSound();
labelString = _root.controller.getSoundState();
}
Instance of Symbol 174 MovieClip [uni_button] in Symbol 390 MovieClip Frame 2
//component parameters
onClipEvent (initialize) {
labelString = "";
flashing = false;
colorCode = "0x000000";
textAlignment = "center";
}
onClipEvent (load) {
labelString = _root.controller.getQualityState();
}
on (press) {
_root.soundMan.playSFX("click");
_root.controller.switchQuality();
labelString = _root.controller.getQualityState();
}
Instance of Symbol 174 MovieClip [uni_button] in Symbol 390 MovieClip Frame 2
//component parameters
onClipEvent (initialize) {
labelString = "";
flashing = false;
colorCode = "0x000000";
textAlignment = "center";
}
onClipEvent (load) {
labelString = _root.controller.getHintsState();
}
on (release) {
_root.soundMan.playSFX("click");
_root.controller.switchHints();
labelString = _root.controller.getHintsState();
}
Instance of Symbol 174 MovieClip [uni_button] in Symbol 390 MovieClip Frame 2
//component parameters
onClipEvent (initialize) {
labelString = "Download game";
flashing = false;
colorCode = "0x000000";
textAlignment = "center";
}
on (release) {
_root.soundMan.playSFX("click");
getURL (_root.download_link, "_blank");
}
Symbol 390 MovieClip Frame 3
stop();
Symbol 390 MovieClip Frame 4
stop();
Instance of Symbol 384 MovieClip in Symbol 390 MovieClip Frame 4
onClipEvent (load) {
gotoAndStop(_root.controller.getMedalState(0) + 1);
}
Instance of Symbol 384 MovieClip in Symbol 390 MovieClip Frame 4
onClipEvent (load) {
gotoAndStop(_root.controller.getMedalState(1) + 1);
}
Instance of Symbol 384 MovieClip in Symbol 390 MovieClip Frame 4
onClipEvent (load) {
gotoAndStop(_root.controller.getMedalState(2) + 1);
}
Instance of Symbol 384 MovieClip in Symbol 390 MovieClip Frame 4
onClipEvent (load) {
gotoAndStop(_root.controller.getMedalState(3) + 1);
}
Instance of Symbol 389 MovieClip in Symbol 390 MovieClip Frame 4
onClipEvent (load) {
if (_root.controller.getMedalState(2) > 1) {
this._visible = false;
}
}
Symbol 401 MovieClip Frame 1
stop();
Symbol 401 MovieClip Frame 2
stop();
Symbol 401 MovieClip Frame 3
stop();
Symbol 401 MovieClip Frame 4
stop();
Symbol 446 MovieClip Frame 1
stop();
Symbol 446 MovieClip Frame 2
stop();
Symbol 446 MovieClip Frame 3
stop();
Symbol 446 MovieClip Frame 4
stop();
Symbol 446 MovieClip Frame 5
stop();
Symbol 446 MovieClip Frame 6
stop();
Symbol 446 MovieClip Frame 7
stop();
Symbol 446 MovieClip Frame 8
stop();
Symbol 450 MovieClip Frame 7
stop();
Symbol 451 Button
on (press) {
_root.soundMan.playSFX("click");
_root.controller.pauseGame(true);
}
Symbol 452 Button
on (press) {
_root.soundMan.playSFX("click");
getURL (_root.main_link, "_blank");
}
Symbol 459 MovieClip Frame 1
stop();
Symbol 459 MovieClip Frame 2
stop();