Frame 1
function addLevel(where, lev) {
where.push(lev);
where[where.length - 1].num = where.length - 1;
if (where.length > 1) {
where[where.length - 2].nextLevel = where[where.length - 1];
}
where[where.length - 1].nextLevel = -1;
}
stop();
online = true;
var countOfBriksInTower = 10;
var aiThinkWaitTimeMin = 500;
var aiThinkWaitTimeMax = 1500;
var bonusPointsKoefficient = 10;
var betweenLevelPointsKoefficient = 200;
var bonusWinLevPlus = 500;
var b_h = 38;
var t_y = 506;
var b_w_min = 15;
var b_w_one = 1.6;
var game = new Object();
game.online = new Object();
game.online.practice = new Array();
game.online.quest = new Array();
game.offline = new Object();
game.offline.practice = new Array();
game.offline.quest = new Array();
lev = new Object();
lev.countOfBriks = 50;
lev.towers = 1;
lev.closedEnemy = false;
lev.playerColors = [2, 1];
addLevel(game.online.quest, lev);
lev = new Object();
lev.countOfBriks = 60;
lev.towers = 1;
lev.closedEnemy = false;
lev.playerColors = [3, 1];
addLevel(game.online.quest, lev);
lev = new Object();
lev.countOfBriks = 70;
lev.towers = 1;
lev.closedEnemy = false;
lev.playerColors = [4, 1];
addLevel(game.online.quest, lev);
lev = new Object();
lev.countOfBriks = 50;
lev.towers = 1;
lev.closedEnemy = true;
lev.playerColors = [5, 1];
addLevel(game.online.quest, lev);
lev = new Object();
lev.countOfBriks = 60;
lev.towers = 1;
lev.closedEnemy = true;
lev.playerColors = [6, 1];
addLevel(game.online.quest, lev);
game.online.practice = game.online.quest;
game.offline = game.online;
if (online) {
curGameLine = game.online;
gameLink = "http://www.doublegames.com/?fr=towerconstructoron";
gameLinkBuy = "http://www.doublegames.com/towerconstructor.html?fr=towerconstructoron";
gameLinkDownloadFullVersion = "http://www.doublegames.com/towerconstructor.html?fr=towerconstructoron";
moreGames = "http://www.doublegames.com/?fr=towerconstructoron";
} else {
curGameLine = game.offline;
gameLink = "http://www.doublegames.com/?fr=towerconstructorof";
moreGames = "http://www.doublegames.com/?fr=towerconstructorof";
}
Instance of Symbol 101 MovieClip in Frame 1
onClipEvent (load) {
b = _root.getBytesTotal();
}
onClipEvent (enterFrame) {
l = _root.getBytesLoaded();
p = (l / b) * 100;
text = Math.floor(p);
text = text + "%";
_root.progressbar.gotoAndStop(Math.round(Number(p) + 1));
if (l >= b) {
_root.gotoAndStop("init");
}
}
Frame 2
stop();
Frame 3
gotoAndStop(_currentframe - 1);
Frame 4
function initGame(level) {
clip_zanaves._visible = false;
currentLevel = level;
_root.onEnterFrame = everyFrame;
countOfBriks = level.countOfBriks;
reInitVariables();
showZanaves(level.closedEnemy);
players.push(new c_player(level.towers, 135, 370, level.playerColors[0], plBotLoh));
players.push(new c_player(level.towers, 640, 370, level.playerColors[1], plHuman));
playersAutoTabOrder();
players[1].move();
}
function reInitVariables() {
curLev++;
updateScores();
bonusMulti = 0;
_root.win1.visible = true;
moving._visible = true;
heap = new c_heap(countOfBriks);
active = -1;
players = new Array();
}
function playersAutoTabOrder() {
if (players.length > 0) {
if (players.length > 1) {
var _local1 = 0;
while (_local1 < (players.length - 1)) {
players[_local1].nextPlayer = players[_local1 + 1];
_local1++;
}
}
players[players.length - 1].nextPlayer = players[0];
}
}
function betweenMoves(nextPlayer) {
if (!currentPlayer.isWin()) {
nextPlayer.move();
} else {
levelEnds();
}
}
function levelEnds() {
getBonus4Tower();
if (currentPlayer.idd != 1) {
loose();
killGame();
} else {
killGame();
if (gameType == 0) {
win();
} else if (currentLevel.nextLevel == -1) {
_root.gotoAndStop("chooseLevQuest");
} else {
wonLevel();
}
}
}
function killGame() {
var _local2 = 0;
while (_local2 < players.length) {
players[_local2].destructor();
_local2++;
}
_root.onEnterFrame = undefined;
moving._visible = false;
_root.win1.visible = false;
delete heap;
hideZanaves();
}
function wonLevel() {
_root.playSound("clup1");
_root.gotoAndStop("WonLev");
}
function wonLevelOk() {
_root.gotoAndStop("chooseLevQuest");
}
function win() {
trace("WonGame");
_root.playSound("clup2");
_root.gotoAndStop("WonGame");
}
function winOk() {
trace("winOk");
if (isHiScore(scores) && (!online)) {
gotoAndStop ("enterName");
} else {
gotoMenu();
}
}
function loose() {
trace("Looze");
_root.playSound("lose");
_root.gotoAndStop("Looze");
}
function loozeOk() {
trace("loozeOk");
if (isHiScore(scores) && (!online)) {
gotoAndStop ("enterName");
} else {
gotoMenu();
}
}
function getBrikDepth() {
if ((brikDepth == "undefined") || (brikDepth >= 1000)) {
brikDepth = 500;
} else {
brikDepth++;
}
return(brikDepth);
}
function getTowerId() {
if ((tId == "undefined") || (tId >= 1000)) {
tId = 0;
} else {
tId++;
}
return(tId);
}
function error(t) {
trace("error! : " add t);
}
function everyFrame() {
if (state == stAi) {
aiWait(getThinkTime());
} else if (state == stAiWait) {
if ((getTimer() - aiWaitStartTime) >= aiWaitTime) {
state = stAi;
if (currentPlayer.playerType == plBotLoh) {
aiMove();
} else {
aiGosuMove();
}
}
}
}
function getBonusPoints() {
bonusMulti++;
return(bonusMulti * bonusPointsKoefficient);
}
function updateScores() {
txtScores = scores;
}
function setUpButtons(b) {
_root.upBtns.gotoAndStop(Number(b) + 1);
}
function gotoMenu() {
if (online) {
gotoAndStop ("menuOnline");
} else {
gotoAndStop ("menuOffline");
}
}
function hideZanaves() {
_root.zanaves._visible = false;
}
function showZanaves(a) {
if (_root.zanaves == undefined) {
clip_zanaves.duplicateMovieClip("zanaves", 100000);
}
if (!a) {
hideZanaves();
return(undefined);
}
_root.zanaves._visible = true;
_root.zanaves.gotoAndPlay(1);
}
function gtPractice() {
curGameLineGt = curGameLine.practice;
gameType = 0;
defGt = 1;
gotoAndStop ("chooseLevPractice");
}
function gtQuest() {
gameType = 1;
defGt = 2;
curGameLineGt = curGameLine.quest;
questStarted = false;
gotoAndStop ("chooseLevQuest");
}
function getBonus4Tower() {
var _local5 = 0;
var _local4 = 0;
while (_local4 < players[1].towers.length) {
var _local3 = players[1].towers[_local4].getWeight();
var _local2 = 0;
while (_local2 < _local3.length) {
_local5 = _local5 + _local3[_local2];
_local2++;
}
_local4++;
}
_root.bonus4tower = _local5;
}
function aiWait(t) {
state = stAiWait;
aiWaitStartTime = getTimer();
aiWaitTime = t;
}
function aiMove() {
var _local2;
if (_root.win1._currentframe == 2) {
ch = whatChange([Number(_root.win1.txt_l), -1], currentPlayer.towers);
if (ch == 0) {
_root.win1.b_left();
}
if (ch == 1) {
_root.win1.b_right();
}
} else if (_root.win1._currentframe == 4) {
ch = whatChange([Number(_root.win1.txt_r), -2], currentPlayer.towers);
if (ch == 0) {
_root.win1.b_yes();
}
if (ch == 1) {
_root.win1.b_skip();
}
} else if (_root.win1._currentframe == 6) {
ch = whatChange([Number(_root.win1.txt_l), -2], currentPlayer.towers);
if (ch == 0) {
_root.win1.b1_left();
}
if (ch == 1) {
_root.win1.b1_skip();
}
} else if (_root.win1._currentframe == 8) {
ch = whatChange([Number(_root.win1.txt_l), Number(_root.win1.txt_r)], currentPlayer.towers);
if (ch == 0) {
_root.win1.b2_left();
}
if (ch == 1) {
_root.win1.b2_right();
}
} else if (((((_root.win1._currentframe == 3) || (_root.win1._currentframe == 5)) || (_root.win1._currentframe == 7)) || (3(_root.win1._currentframe == 9))) || (_root.win1._currentframe == 10)) {
_local2 = onWhatChange(ch_n, _root.currentPlayer.towers);
_root[(("brik_" add _root.currentPlayer.towers[_local2.tower].id) add "_") add _local2.brik].pressed();
} else if (_root.win1._currentframe == 1) {
} else if (_root.win1._currentframe == 11) {
}
}
function whatChange(possible, towers) {
var _local4;
if (possible[1] == -1) {
var _local12 = false;
var _local3 = 0;
while (_local3 < towers.length) {
var _local6 = getBrikP(possible[0], towers[_local3].briks.length);
var _local9 = towers[_local3].briks[_local6];
var _local11 = getBrikP(_local9, towers[_local3].briks.length);
if (_local6 != _local11) {
_local4 = 0;
_root.choosedTower = _local3;
_local12 = true;
break;
}
_local3++;
}
if (!_local12) {
_local4 = 1;
}
} else if (possible[1] == -2) {
var _local12 = false;
var _local3 = 0;
while (_local3 < towers.length) {
var _local6 = getBrikP(possible[0], towers[_local3].briks.length);
var _local9 = towers[_local3].briks[_local6];
var _local11 = getBrikP(_local9, towers[_local3].briks.length);
if (_local6 != _local11) {
_local4 = 0;
_root.choosedTower = _local3;
_local12 = true;
break;
}
_local3++;
}
if (!_local12) {
_local4 = possibleAlterChoose();
}
} else {
var _local12 = false;
var _local3 = 0;
while (_local3 < towers.length) {
var _local6 = getBrikP(possible[0], towers[_local3].briks.length);
var _local9 = towers[_local3].briks[_local6];
var _local11 = getBrikP(_local9, towers[_local3].briks.length);
if (_local6 != _local11) {
_local4 = 0;
_root.choosedTower = _local3;
_local12 = true;
break;
}
_local3++;
}
if (!_local12) {
_local3 = 0;
while (_local3 < towers.length) {
var _local7 = getBrikP(possible[1], towers[_local3].briks.length);
var _local8 = towers[_local3].briks[_local7];
var _local10 = getBrikP(_local8, towers[_local3].briks.length);
if (_local7 != _local10) {
_local4 = 1;
_root.choosedTower = _local3;
_local12 = true;
break;
}
_local3++;
}
}
if (!_local12) {
trace("rnd");
_local4 = random(2);
}
}
_root.ch_n = possible[_local4];
return(_local4);
}
function possibleAlterChoose() {
return(1);
}
function onWhatChange(what, towers) {
var _local3 = getBrikP(what, towers[_root.choosedTower].briks.length);
var _local2 = new Object();
_local2.tower = choosedTower;
_local2.brik = _local3;
return(_local2);
}
function getBrikP(b, towerLen) {
return((towerLen - Math.floor(((b - 0.5) / _root.countOfBriks) * towerLen)) - 1);
}
function getThinkTime() {
return(aiThinkWaitTimeMin + random(aiThinkWaitTimeMax - aiThinkWaitTimeMin));
}
function aiGosuMove() {
var _local2;
if (_root.win1._currentframe == 2) {
ch = whatGosuChange([Number(_root.win1.txt_l), -1], currentPlayer.towers);
if (ch == 0) {
_root.win1.b_left();
}
if (ch == 1) {
_root.win1.b_right();
}
} else if (_root.win1._currentframe == 4) {
ch = whatGosuChange([Number(_root.win1.txt_r), -2], currentPlayer.towers);
if (ch == 0) {
_root.win1.b_yes();
}
if (ch == 1) {
_root.win1.b_skip();
}
} else if (_root.win1._currentframe == 6) {
ch = whatGosuChange([Number(_root.win1.txt_l), -2], currentPlayer.towers);
if (ch == 0) {
_root.win1.b1_left();
}
if (ch == 1) {
_root.win1.b1_skip();
}
} else if (_root.win1._currentframe == 8) {
ch = whatGosuChange([Number(_root.win1.txt_l), Number(_root.win1.txt_r)], currentPlayer.towers);
if (ch == 0) {
_root.win1.b2_left();
}
if (ch == 1) {
_root.win1.b2_right();
}
} else if (((((_root.win1._currentframe == 3) || (_root.win1._currentframe == 5)) || (_root.win1._currentframe == 7)) || (_root.win1._currentframe == 9)) || (_root.win1._currentframe == 10)) {
_local2 = onWhatGosuChange(ch_n, _root.currentPlayer.towers);
_root[(("brik_" add _root.currentPlayer.towers[_local2.tower].id) add "_") add _local2.brik].pressed();
} else if (_root.win1._currentframe == 1) {
} else if (_root.win1._currentframe == 11) {
}
}
function whatGosuChange(c, towers) {
var _local3 = c[0];
var _local2 = 0;
var _local1 = getBrikP(_local3, towers[_local2].briks.length);
if (!(((_local1 + 0) < getBrikP(towers[_local2].briks[_local1], towers[_local2].briks.length)) || ((_local1 - 0) > getBrikP(towers[_local2].briks[_local1], towers[_local2].briks.length)))) {
return(1);
}
changeTower = _local2;
changeBrik = _local1;
return(0);
}
function onWhatGosuChange(what, towers) {
var _local1 = new Object();
_local1.tower = changeTower;
_local1.brik = changeBrik;
return(_local1);
}
function btn_music_pressed() {
musicon = !musicon;
setPanelStates();
saveSettings();
if (musicon) {
playMusic();
} else {
stopMusic();
}
}
function btn_sound_pressed() {
soundon = !soundon;
setPanelStates();
saveSettings();
}
function playSound(snd) {
if (soundon) {
so = new Sound();
so.attachSound(snd);
so.start(0, 1);
}
}
function btn_fullscreen_pressed() {
fullscreen = !fullscreen;
setPanelStates();
saveSettings();
_root.getURL("FSCommand:fullscreen", fullscreen);
}
function btn_ques_pressed() {
if ((_root._currentframe < 13) || (_root._currentframe > 15)) {
_root.attachMovie("help_win", "ehelp_win", 98454446, {_x:0, _y:0});
}
}
function btn_close_pressed() {
_root.attachMovie("quit_win", "quit_win", 98454446, {_x:0, _y:0});
}
function playMusic() {
trace("playMusic()");
_root.m_s = new Sound();
_root.m_s.attachSound("m_begin");
_root.m_l = new Sound();
_root.m_l.attachSound("m_loop");
_root.m_s.start(0, 1);
_root.t_m_s = getTimer();
trace("_root.checkEndOfBeginMusic = " add _root.checkEndOfBeginMusic);
trace("_root.music_clip = " add _root.music_clip);
_root.music_clip.onEnterFrame = _root.checkEndOfBeginMusic;
}
function stopMusic() {
trace("stopMusic()");
delete _root.music_clip.onEnterFrame;
_root.m_s.stop();
_root.m_l.stop();
}
function checkEndOfBeginMusic() {
if ((getTimer() - _root.t_m_s) > 2700) {
_root.m_s.stop();
_root.m_l.start(0, 9999999999);
delete _root.music_clip.onEnterFrame;
}
}
function openHiScores() {
choseGThs.gotoAndStop(defGt);
var _local2 = 0;
while (_local2 < 10) {
_root.clip_str.duplicateMovieClip("str_" add _local2, _local2);
_root["str_" add _local2]._y = 167 + (30 * _local2);
_root["str_" add _local2].n = _local2 + 1;
_root["str_" add _local2].name = settings.data.names[defGt][_local2];
_root["str_" add _local2].score = settings.data.scores[defGt][_local2];
_local2++;
}
setHiScoreText();
}
function setHiScoreText() {
if (defGt == 1) {
hiscoreTxt = "Practice HiScores";
} else {
hiscoreTxt = "Quest HiScores";
}
}
function closeHiScores() {
var _local2 = 0;
while (_local2 < 10) {
removeMovieClip(_root["str_" add _local2]);
_local2++;
}
gotoMenu();
}
function redefHiScores() {
settings.data.names = new Array();
settings.data.scores = new Array();
settings.data.names[0] = 0;
settings.data.scores[0] = 0;
var _local1 = new Array();
_local1[0] = "Victor";
_local1[1] = "Bill";
_local1[2] = "John";
_local1[3] = "Adrian";
_local1[4] = "Kevin";
_local1[5] = "Tim";
_local1[6] = "Ralf";
_local1[7] = "Frank";
_local1[8] = "Jens";
_local1[9] = "Daniel";
settings.data.names[1] = _local1;
_local1 = new Array();
_local1[0] = 1192;
_local1[1] = 1112;
_local1[2] = 1096;
_local1[3] = 961;
_local1[4] = 845;
_local1[5] = 505;
_local1[6] = 468;
_local1[7] = 224;
_local1[8] = 103;
_local1[9] = 31;
settings.data.scores[1] = _local1;
_local1 = new Array();
_local1[0] = "Victor";
_local1[1] = "Tim";
_local1[2] = "Jens";
_local1[3] = "Daniel";
_local1[4] = "Bill";
_local1[5] = "Adrian";
_local1[6] = "Kevin";
_local1[7] = "John";
_local1[8] = "Ralf";
_local1[9] = "Frank";
settings.data.names[2] = _local1;
_local1 = new Array();
_local1[0] = 7862;
_local1[1] = 5423;
_local1[2] = 4654;
_local1[3] = 3894;
_local1[4] = 3235;
_local1[5] = 2463;
_local1[6] = 1785;
_local1[7] = 1344;
_local1[8] = 512;
_local1[9] = 134;
settings.data.scores[2] = _local1;
}
function enterName() {
setHiScoreText();
var _local2 = 0;
while (_local2 < 10) {
_root.clip_str.duplicateMovieClip("str_" add _local2, _local2);
if (settings.data.scores[defGt][_local2] >= scores) {
_root["str_" add _local2]._y = 167 + (30 * _local2);
_root["str_" add _local2].n = _local2 + 1;
} else {
p = _local2;
break;
}
_root["str_" add _local2].name = settings.data.names[defGt][_local2];
_root["str_" add _local2].score = settings.data.scores[defGt][_local2];
_local2++;
}
_root["str_" add p]._y = 167 + (30 * p);
_root["str_" add p].n = p + 1;
_root["str_" add p].name = "";
_root["str_" add p].score = scores;
t._y = (167 + (30 * p)) - 16;
name = "";
Selection.setFocus("name");
if (p < 9) {
_local2 = p + 1;
while (_local2 < 10) {
_root.clip_str.duplicateMovieClip("str_" add _local2, _local2);
_root["str_" add _local2]._y = 167 + (30 * _local2);
_root["str_" add _local2].n = _local2 + 1;
_root["str_" add _local2].name = settings.data.names[defGt][_local2 - 1];
_root["str_" add _local2].score = settings.data.scores[defGt][_local2 - 1];
_local2++;
}
}
}
function enterNameOk() {
_root.playSound("std");
if (name == "") {
return(undefined);
}
addScore(name, scores);
gotoAndStop ("hiScores");
}
function addScore(name, score) {
i = 0;
while (i < 10) {
if (score > settings.data.scores[defGt][i]) {
settings.data.scores[defGt].splice(i, 0, score);
settings.data.names[defGt].splice(i, 0, name);
break;
}
i++;
}
}
function isHiScore(n) {
return(n > settings.data.scores[defGt][9]);
}
function loadSettings() {
soundon = settings.data.soundon;
musicon = settings.data.musicon;
fullscreen = settings.data.fullscreen;
setPanelStates();
}
function saveSettings() {
settings.data.soundon = soundon;
settings.data.musicon = musicon;
settings.data.fullscreen = fullscreen;
}
function redefSettings() {
soundon = true;
musicon = true;
fullscreen = false;
saveSettings();
}
function setPanelStates() {
if (soundon) {
upBtns.clip_sound.gotoAndStop(1);
} else {
upBtns.clip_sound.gotoAndStop(2);
}
if (musicon) {
upBtns.clip_music.gotoAndStop(1);
} else {
upBtns.clip_music.gotoAndStop(2);
}
if (fullscreen) {
upBtns.clip_fullscreen.gotoAndStop(1);
} else {
upBtns.clip_fullscreen.gotoAndStop(2);
}
}
function setPanelMotions() {
_root.getURL("FSCommand:fullscreen", fullscreen);
if (musicon) {
startMusic();
}
}
var gtOpen = 1;
var gtClose = 2;
var gtTwoTowers = 3;
var countOfBriks;
var currentPlayer;
var players;
var heap;
var active = -1;
var stNone = 0;
var stHuman = 1;
var stAi = 2;
var stAiWait = 3;
var plHuman = 0;
var plBotLoh = 1;
var plBotGosu = 2;
var ch;
var ch_n = -100;
var win_mass = Array(0, 0, 0, 0, 0, 0);
var scores = 0;
var brikDepth;
var tId;
settings = SharedObject.getLocal("tower_constructor_v_0.26");
var defGt = 1;
if (!_root.online) {
if (settings.data.notFirstStart != true) {
settings.data.notFirstStart = true;
redefHiScores();
redefSettings();
} else {
loadSettings();
}
setPanelStates();
setPanelMotions();
if (musicon) {
playMusic();
}
}
trace("online=" add online);
gotoMenu();
setUpButtons(online);
Frame 5
stop();
Frame 6
gotoAndStop(_currentframe - 1);
Frame 7
stop();
Frame 8
stop();
Frame 9
gotoAndStop(_currentframe - 1);
Frame 10
stop();
Frame 11
stop();
Frame 12
gotoAndStop(_currentframe - 1);
Frame 13
stop();
Frame 14
stop();
Frame 15
gotoAndStop(_currentframe - 1);
Frame 16
stop();
openHiScores();
Frame 17
stop();
Frame 18
gotoAndStop(_currentframe - 1);
Frame 19
stop();
Frame 20
stop();
Frame 21
gotoAndStop(_currentframe - 1);
Frame 22
stop();
enterName();
Instance of Symbol 236 MovieClip in Frame 22
onClipEvent (enterFrame) {
if (Key.isDown(13)) {
_root.enterNameOk();
}
}
Frame 23
stop();
Frame 24
gotoAndStop(_currentframe - 1);
Frame 25
_root.chooseGT.gotoAndStop(Number(online) + 1);
stop();
Frame 26
stop();
Frame 27
gotoAndStop(_currentframe - 1);
Frame 28
scores = 0;
curLev = 0;
play();
Frame 29
initGame(firstLevel);
stop();
Frame 30
stop();
Frame 31
gotoAndStop(_currentframe - 1);
Frame 32
so.stop();
stop();
Frame 33
stop();
Frame 34
gotoAndStop(_currentframe - 1);
Frame 35
trace("currentLevel.num = " add currentLevel.num);
trace("currentLevel.nextLevel.num = " add currentLevel.nextLevel.num);
initGame(currentLevel.nextLevel);
Frame 36
stop();
Frame 37
gotoAndStop(_currentframe - 1);
Frame 38
s = scores;
stop();
Frame 39
stop();
Frame 40
gotoAndStop(_currentframe - 1);
Frame 41
b = ((curLev * betweenLevelPointsKoefficient) + bonusWinLevPlus) + (bonus4tower * curLev);
scores = scores + Number(b);
s = scores;
stop();
Frame 42
stop();
Frame 43
gotoAndStop(_currentframe - 1);
Frame 44
b = ((curLev * betweenLevelPointsKoefficient) + bonusWinLevPlus) + (bonus4tower * curLev);
scores = scores + Number(b);
s = scores;
stop();
Frame 45
stop();
Frame 46
gotoAndStop(_currentframe - 1);
Frame 47
stop();
if (online) {
map.gotoAndStop(2);
} else {
map.gotoAndStop(1);
}
Frame 48
stop();
Frame 49
gotoAndStop(_currentframe - 1);
Frame 50
stop();
if (!questStarted) {
map.gotoAndPlay("l0");
} else {
map.gotoAndPlay("l" add Number(currentLevel.num + 1));
}
Frame 51
stop();
Frame 52
gotoAndStop(_currentframe - 1);
Symbol 20 Button
on (release) {
cont();
}
Symbol 26 Button
on (release) {
exit();
}
Symbol 33 Button
on (release) {
finish();
}
Symbol 34 Button
on (rollOver) {
_root.attachMovie("chint", "hnt", 98454456);
}
on (rollOut, press, releaseOutside) {
_root.hnt.free();
}
Symbol 35 MovieClip [quit_win] Frame 1
#initclip 9
Object.registerClass("quit_win", cquit_win);
#endinitclip
stop();
Instance of Symbol 12 MovieClip in Symbol 35 MovieClip [quit_win] Frame 1
onClipEvent (load) {
bg_btn.useHandCursor = false;
}
Symbol 35 MovieClip [quit_win] Frame 2
stop();
Symbol 35 MovieClip [quit_win] Frame 3
stop();
Symbol 35 MovieClip [quit_win] Frame 4
stop();
Symbol 39 MovieClip [chint] Frame 1
#initclip 7
Object.registerClass("chint", chint);
#endinitclip
Symbol 49 Button
on (release) {
_root.playSound("std");
goback();
}
Symbol 61 Button
on (release) {
gotoAndStop(_currentframe + 1);
_root.playSound("std");
}
Symbol 70 Button
on (release) {
gotoAndStop(_currentframe - 1);
_root.playSound("std");
}
Symbol 79 MovieClip Frame 1
stop();
Symbol 79 MovieClip Frame 2
stop();
Symbol 79 MovieClip Frame 3
stop();
Symbol 79 MovieClip Frame 4
stop();
Symbol 86 Button
on (press) {
getURL (_root.gameLink, "_blank");
}
Symbol 91 Button
on (press) {
getURL (_root.gameLink, "_blank");
}
Symbol 92 MovieClip [help_win] Frame 1
#initclip 8
Object.registerClass("help_win", chelp_win);
#endinitclip
stop();
Symbol 98 MovieClip Frame 1
stop();
Symbol 445 MovieClip [__Packages.chint] Frame 0
class chint extends MovieClip
{
var _x, _y, _height, _width, unloadMovie;
function chint () {
super();
_x = _root._xmouse;
_y = _root._ymouse;
if (_x < 0) {
_x = 0;
}
if (_y < _height) {
_y = _height;
}
if (_x > (800 - _width)) {
_x = 800 - _width;
}
if (_y > 600) {
_y = 600;
}
}
function free() {
unloadMovie();
}
}
Symbol 446 MovieClip [__Packages.chelp_win] Frame 0
class chelp_win extends MovieClip
{
var unloadMovie;
function chelp_win () {
super();
}
function goback() {
unloadMovie();
}
}
Symbol 447 MovieClip [__Packages.cquit_win] Frame 0
class cquit_win extends MovieClip
{
var gotoAndStop, getURL, unloadMovie;
function cquit_win () {
super();
if (notPlayingGame()) {
if (_root.online) {
(gotoAndStop(3));// not popped
} else {
(gotoAndStop(1));// not popped
}
} else if (_root.online) {
(gotoAndStop(4));// not popped
} else {
(gotoAndStop(2));// not popped
}
}
function notPlayingGame() {
return((_root._currentFrame < 28) || (_root._currentFrame > 37));
}
function finish() {
_root.playSound("toMenu");
_root.killGame();
_root.loose();
free();
}
function cont() {
free();
}
function exit() {
(getURL("FSCommand:quit", ""));// not popped
free();
}
function free() {
unloadMovie();
}
}
Symbol 448 MovieClip [__Packages.c_player] Frame 0
class c_player
{
var playerType, x, y, towersCount, towers, idd, choose1, nextPlayer;
function c_player (itowersCount, ix, iy, brikSkinType, iPlayerType) {
playerType = iPlayerType;
x = ix;
y = iy;
towersCount = itowersCount;
towers = new Array();
idd = brikSkinType;
var _local3 = 0;
while (_local3 < towersCount) {
towers[_local3] = new c_tower((x + (_local3 * 130)) - (50 * (towersCount - 1)), _root.t_y, brikSkinType, _root.heap.popTowerHeap());
towers[_local3].player = this;
_local3++;
}
}
function move() {
_root.moving._x = x;
_root.moving._y = y + _root.b_x;
_root.currentPlayer = this;
_root.win1.init();
if (playerType == _root.plHuman) {
_root.state = _root.stHuman;
} else {
_root.state = _root.stAi;
}
}
function choose_brikFromTower() {
var _local3 = 0;
while (_local3 < towersCount) {
towers[_local3].showButtons();
_local3++;
}
if (playerType != _root.plHuman) {
_root.ai.move10(towers[0]);
}
}
function brikPressed(id, towerId) {
choose2 = id;
brik_choosed(towerId);
}
function brik_choosed(towerId) {
_root.win1.closeWin();
var _local3 = 0;
while (_local3 < towersCount) {
towers[_local3].hideButtons();
_local3++;
}
_local3 = 0;
while (_local3 < towersCount) {
if (towers[_local3].id == towerId) {
towers[_local3].changeBrik(choose1, choose2);
}
_local3++;
}
moveEnds();
}
function destructor() {
var _local2 = 0;
while (_local2 < towers.length) {
towers[_local2].destructor();
_local2++;
}
}
function moveEnds() {
_root.state = _root.stNone;
_root.betweenMoves(nextPlayer);
}
function isWin() {
var _local2 = 0;
while (_local2 < towers.length) {
if (!towers[_local2].isOrdered()) {
return(false);
}
_local2++;
}
return(true);
}
var choose2 = -1;
var gosuInited = false;
}
Symbol 449 MovieClip [__Packages.c_tower] Frame 0
class c_tower
{
var id, player;
function c_tower (x, y, brikSkinType, briksNumbers) {
id = _root.getTowerId();
brikCount = _root.countOfBriksInTower;
briks = briksNumbers;
briksSkinType = brikSkinType;
createTower(x, y);
hideButtons();
}
function createTower(x, y) {
var _local3 = 0;
while (_local3 < brikCount) {
_root.brik.duplicateMovieClip((("brik_" add id) add "_") add _local3, _root.getBrikDepth());
var _local4 = _root[(("brik_" add id) add "_") add _local3];
_local4._x = x;
_local4._y = y - (_local3 * _root.b_h);
_local4.skinType = briksSkinType;
_local4.numOfBrik = briks[_local3];
_local4.tower = this;
_local4.id = _local3;
_local3++;
}
}
function changeBrik(ch1, ch2) {
var _local4 = ch1;
ch1 = _root[(("brik_" add id) add "_") add ch2].numOfBrik;
_root[(("brik_" add id) add "_") add ch2].numOfBrik = _local4;
briks[ch2] = _local4;
_root[(("brik_" add id) add "_") add ch2].redraw();
_root.active = ch1;
if (player.playerType == _root.plHuman) {
checkBonus(_root[(("brik_" add id) add "_") add ch2].id);
}
}
function checkBonus(chid) {
var _local6 = false;
var _local5 = -1;
if (chid > 0) {
var _local3 = chid - 1;
while (_local3 >= 0) {
if (_root[(("brik_" add id) add "_") add chid].num == (_root[(("brik_" add id) add "_") add _local3].num + (_local3 - chid))) {
if (_local5 < 0) {
_local5 = _root.getBonusPoints();
}
_root[(("brik_" add id) add "_") add _local3].bonusPts(_root[(("brik_" add id) add "_") add _local3].num * _root.curLev);
_local6 = true;
} else {
break;
}
_local3--;
}
}
if (chid < (brikCount - 1)) {
var _local3 = chid + 1;
while (_local3 < brikCount) {
if (_root[(("brik_" add id) add "_") add chid].num == (_root[(("brik_" add id) add "_") add _local3].num + (_local3 - chid))) {
if (_local5 < 0) {
_local5 = _root.getBonusPoints();
}
_root[(("brik_" add id) add "_") add _local3].bonusPts(_root[(("brik_" add id) add "_") add _local3].num * _root.curLev);
_local6 = true;
} else {
break;
}
_local3++;
}
}
if (_local6) {
_root[(("brik_" add id) add "_") add chid].bonusPts(_root[(("brik_" add id) add "_") add chid].num * _root.curLev);
_root.playSound("bonus");
}
}
function getBrikNum(n) {
var _local2 = 0;
while (_local2 < briks.length) {
if (briks[_local2] == n) {
return(n);
}
_local2++;
}
return(-1);
}
function removeAllBriks() {
}
function showButtons() {
var _local3 = 0;
while (_local3 < brikCount) {
var _local4 = _root[(("brik_" add id) add "_") add _local3];
if (player.playerType == _root.plHuman) {
_local4.clip_btn.gotoAndStop(1);
} else {
_local4.clip_btn.gotoAndStop(2);
}
_local3++;
}
}
function hideButtons() {
var _local3 = 0;
while (_local3 < brikCount) {
var _local4 = _root[(("brik_" add id) add "_") add _local3];
_local4.clip_btn.gotoAndStop(3);
_local3++;
}
}
function isOrdered() {
var _local2 = 0;
while (_local2 < (brikCount - 1)) {
if (briks[_local2] < briks[_local2 + 1]) {
return(false);
}
_local2++;
}
return(true);
}
function destructor() {
var _local3 = 0;
while (_local3 < briks.length) {
_root[(("brik_" add id) add "_") add _local3].removeMovieClip();
_local3++;
}
}
function getWeight() {
return(briks);
}
var brikCount = 0;
var briks = new Array();
var briksSkinType = 0;
}
Symbol 450 MovieClip [__Packages.c_heap] Frame 0
class c_heap
{
var size, mass;
function c_heap (heapSize) {
size = heapSize;
createNewMass();
randomize();
}
function randomize() {
var _local4;
var _local3;
var _local2 = 0;
while (_local2 < mass.length) {
_local3 = random(mass.length);
_local4 = mass[_local2];
mass[_local2] = mass[_local3];
mass[_local3] = _local4;
_local2++;
}
}
function popBrik() {
return(Number(mass.pop()));
}
function pushBrik(brik) {
mass.push(brik);
}
function shiftPushBrik(brik) {
mass.unshift(brik);
}
function createNewMass() {
mass = new Array();
var _local2 = 0;
while (_local2 < (size - 0)) {
mass[_local2] = _local2 + 1;
_local2++;
}
}
function popTowerHeap() {
var _local4 = new Array();
var _local3 = 0;
while (_local3 < _root.countOfBriksInTower) {
_local4[_local3] = popBrik();
_local3++;
}
return(_local4);
}
function destructor() {
}
}
Symbol 108 Button
on (release) {
_root.playSound("std");
_root.btn_music_pressed();
}
Symbol 112 Button
on (release) {
_root.playSound("std");
_root.btn_music_pressed();
}
Symbol 113 MovieClip Frame 1
stop();
Symbol 113 MovieClip Frame 2
stop();
Symbol 117 Button
on (release) {
_root.playSound("std");
_root.btn_fullscreen_pressed();
}
Symbol 119 Button
on (release) {
_root.playSound("std");
_root.btn_fullscreen_pressed();
}
Symbol 120 MovieClip Frame 1
stop();
Symbol 120 MovieClip Frame 2
stop();
Symbol 126 Button
on (release) {
_root.playSound("std");
_root.btn_ques_pressed();
}
Symbol 130 Button
on (release) {
_root.btn_sound_pressed();
_root.playSound("std");
}
Symbol 132 Button
on (release) {
_root.btn_sound_pressed();
_root.playSound("std");
}
Symbol 133 MovieClip Frame 1
stop();
Symbol 133 MovieClip Frame 2
stop();
Symbol 137 Button
on (release) {
_root.playSound("std");
_root.btn_close_pressed();
}
Symbol 138 Button
on (rollOver) {
_root.attachMovie("chint", "hnt", 98454456);
}
on (rollOut, press, releaseOutside) {
_root.hnt.free();
}
Symbol 139 Button
on (rollOver) {
_root.attachMovie("chint", "hnt", 98454456);
}
on (rollOut, press, releaseOutside) {
_root.hnt.free();
}
Symbol 140 MovieClip Frame 1
stop();
Symbol 140 MovieClip Frame 2
stop();
Symbol 150 Button
on (rollOver) {
_root.attachMovie("chint", "hnt", 98454456);
}
on (rollOut, press, releaseOutside) {
_root.hnt.free();
}
Symbol 157 Button
on (release) {
_root.playSound("std");
getURL (_root.gameLinkBuy, "_blank");
}
Symbol 162 Button
on (release) {
_root.playSound("std");
getURL (_root.gameLinkDownloadFullVersion, "_blank");
}
Symbol 166 Button
on (release) {
_root.playSound("std");
gotoAndStop ("gameType");
}
Symbol 174 Button
on (release) {
_root.playSound("std");
gotoAndStop ("help");
}
Symbol 175 Button
on (release) {
getURL (_root.moreGames, "_blank");
}
Symbol 182 Button
on (release) {
_root.playSound("std");
gotoAndStop ("hiscores");
}
Symbol 186 Button
on (press) {
_root.playSound("std");
_root.btn_close_pressed();
}
Symbol 187 Button
on (release) {
_root.playSound("std");
gotoMenu();
}
Symbol 194 Button
on (release) {
_root.playSound("std");
closeHiScores();
}
Symbol 209 Button
on (press) {
closeHiScores();
gotoAndStop ("askClear");
}
Symbol 214 Button
on (release) {
_root.defGt = 2;
_root.openHiScores();
}
Symbol 220 Button
on (release) {
_root.defGt = 1;
_root.openHiScores();
}
Symbol 222 MovieClip Frame 1
stop();
Symbol 222 MovieClip Frame 2
stop();
Symbol 229 Button
on (press) {
_root.redefHiScores();
_root.openHiScores();
_root.gotoAndStop("hiscores");
}
Symbol 232 Button
on (press) {
_root.openHiScores();
_root.gotoAndStop("hiscores");
}
Symbol 237 Button
on (release) {
_root.enterNameOk();
}
Symbol 262 Button
on (release) {
_root.playSound("std");
_root.gtPractice();
}
Symbol 263 Button
on (release) {
_root.gotoMenu();
}
Symbol 269 Button
on (release) {
_root.playSound("std");
_root.gtQuest();
}
Symbol 270 Button
on (rollOver) {
_root.attachMovie("chint", "hnt", 98454456);
}
on (rollOut, press, releaseOutside) {
_root.hnt.free();
}
on (release) {
_root.playSound("std");
}
Symbol 271 MovieClip Frame 1
stop();
Symbol 271 MovieClip Frame 2
stop();
Symbol 292 MovieClip Frame 93
stop();
Symbol 297 Button
on (press) {
_root.playSound("boot");
b_left();
}
Symbol 298 Button
on (press) {
_root.playSound("boot");
b_right();
}
Symbol 311 Button
on (release) {
_root.playSound("boot");
b_yes();
}
Symbol 318 Button
on (release) {
_root.playSound("boot");
b_skip();
}
Symbol 328 MovieClip Frame 1
function init() {
checkButtonsVisibility();
if ((_root.active == -1) && (_root.heap.mass.length > 0)) {
_root.active = _root.heap.popBrik();
}
_visible = true;
if ((_root.heap.mass.length == 0) && (_root.active == -1)) {
_root.error("no briks remain");
gotoAndStop ("briks0");
} else if ((_root.heap.mass.length + 1) == 1) {
gotoAndStop ("briks1");
} else if ((_root.heap.mass.length + 1) == 2) {
gotoAndStop ("briks2");
} else {
gotoAndStop ("briksMore");
}
}
function initMoreBriks() {
checkButtonsVisibility();
txt_l = _root.active;
stop();
if (_root.currentPlayer.playerType != _root.plHuman) {
_root.ai.move0([_root.active, -1], [b_left, b_right]);
}
}
function b_left() {
gotoAndStop (3);
_root.currentPlayer.choose1 = _root.active;
_root.currentPlayer.choose_brikFromTower();
}
function b_right() {
gotoAndStop (4);
}
function moreBriksSequel() {
checkButtonsVisibility();
active2 = _root.heap.popBrik();
txt_r = active2;
stop();
}
function b_yes() {
_root.heap.pushBrik(_root.active);
_root.active = active2;
gotoAndStop (5);
_root.currentPlayer.choose1 = _root.active;
_root.currentPlayer.choose_brikFromTower();
}
function b_skip() {
_root.heap.shiftPushBrik(_root.active);
_root.active = active2;
active2 = undefine;
closeWin();
_root.currentPlayer.moveEnds();
}
function init1briks() {
checkButtonsVisibility();
txt_l = _root.active;
stop();
}
function b1_left() {
gotoAndStop (7);
_root.currentPlayer.choose1 = _root.active;
_root.currentPlayer.choose_brikFromTower();
}
function b1_skip() {
closeWin();
_root.currentPlayer.moveEnds();
}
function init2briks() {
checkButtonsVisibility();
txt_l = _root.active;
active2 = _root.heap.popBrik();
txt_r = active2;
stop();
}
function b2_left() {
_root.heap.pushBrik(active2);
gotoAndStop (9);
_root.currentPlayer.choose1 = _root.active;
_root.currentPlayer.choose_brikFromTower();
}
function b2_right() {
_root.heap.pushBrik(_root.active);
_root.active = active2;
gotoAndStop (10);
_root.currentPlayer.choose1 = _root.active;
_root.currentPlayer.choose_brikFromTower();
}
function checkButtonsVisibility() {
if (_root.currentPlayer.playerType == _root.plHuman) {
show_btns();
} else {
hide_btns();
}
}
function hide_btns() {
b1._visible = false;
b2._visible = false;
}
function show_btns() {
b1._visible = true;
b2._visible = true;
}
function closeWin() {
_visible = false;
}
_visible = false;
stop();
Symbol 328 MovieClip Frame 2
initMoreBriks();
friz.gotoAndPlay(1);
Symbol 328 MovieClip Frame 3
stop();
friz.gotoAndPlay(1);
Symbol 328 MovieClip Frame 4
moreBriksSequel();
friz.gotoAndPlay(1);
Symbol 328 MovieClip Frame 5
stop();
friz.gotoAndPlay(1);
Symbol 328 MovieClip Frame 6
init1briks();
friz.gotoAndPlay(1);
Symbol 328 MovieClip Frame 7
stop();
friz.gotoAndPlay(1);
Symbol 328 MovieClip Frame 8
init2briks();
friz.gotoAndPlay(1);
Symbol 328 MovieClip Frame 9
stop();
friz.gotoAndPlay(1);
Symbol 328 MovieClip Frame 10
friz.gotoAndPlay(1);
Symbol 328 MovieClip Frame 11
stop();
friz.gotoAndPlay(1);
Symbol 353 MovieClip Frame 1
_parent.redraw();
stop();
Symbol 353 MovieClip Frame 2
_parent.redraw();
stop();
Symbol 353 MovieClip Frame 3
_parent.redraw();
stop();
Symbol 353 MovieClip Frame 4
_parent.redraw();
stop();
Symbol 353 MovieClip Frame 5
_parent.redraw();
stop();
Symbol 353 MovieClip Frame 6
_parent.redraw();
stop();
Symbol 358 Button
on (press) {
_root.playSound("footbrik");
_parent.pressed();
}
Symbol 360 MovieClip Frame 10
_parent._parent.endPressedAnim();
Symbol 363 MovieClip Frame 13
stop();
Symbol 366 MovieClip Frame 1
stop();
Symbol 366 MovieClip Frame 2
p.pts = pts;
s0.gotoAndPlay(1);
s1.gotoAndPlay(1);
s2.gotoAndPlay(1);
s3.gotoAndPlay(1);
s4.gotoAndPlay(1);
Symbol 366 MovieClip Frame 34
stop();
Symbol 367 MovieClip Frame 1
function redraw() {
num = numOfBrik;
skin.skin._width = _root.b_w_min + (num * _root.b_w_one);
var _local2 = Math.ceil((skin.skin._width - 26) / 20);
if (_local2 < 1) {
_local2 = 1;
}
skin.pipki.gotoAndStop(_local2);
num.textColor = numColor;
}
function pressed() {
clip_btn.gotoAndStop(4);
}
function endPressedAnim() {
_root.currentPlayer.brikPressed(id, tower.id);
}
function bonusPts(n) {
_root.scores = _root.scores + n;
bonus.pts = n;
bonus.gotoAndPlay(2);
_root.updateScores();
}
skin.gotoAndStop(skinType);
redraw();
pipki.gotoAndStop(Math.ceil((mask._width - 25) / 20));
Symbol 375 MovieClip Frame 9
stop();
Symbol 376 Button
on (press) {
levelEnds();
}
Symbol 380 Button
on (release) {
_root.playSound("std");
_root.loozeOk();
}
Symbol 382 Button
on (release) {
_root.playSound("std");
_root.wonLevelOk();
}
Symbol 388 Button
on (release) {
_root.playSound("std");
_root.winOk();
}
Symbol 405 Button
on (release) {
_root.playSound("std");
_root.firstLevel = _root.curGameLine.practice[0];
_root.gotoAndStop("gameInit");
}
on (rollOver) {
_root.playSound("Sound1");
}
Symbol 406 Button
on (release) {
_root.playSound("std");
_root.firstLevel = _root.curGameLine.practice[1];
_root.gotoAndStop("gameInit");
}
on (rollOver) {
_root.playSound("Sound1");
}
Symbol 407 Button
on (release) {
_root.playSound("std");
_root.firstLevel = _root.curGameLine.practice[2];
_root.gotoAndStop("gameInit");
}
on (rollOver) {
_root.playSound("Sound1");
}
Symbol 408 Button
on (release) {
_root.playSound("std");
_root.firstLevel = _root.curGameLine.practice[3];
_root.gotoAndStop("gameInit");
}
on (rollOver) {
_root.playSound("Sound1");
}
Symbol 409 Button
on (release) {
_root.playSound("std");
_root.firstLevel = _root.curGameLine.practice[4];
_root.gotoAndStop("gameInit");
}
on (rollOver) {
_root.playSound("Sound1");
}
Symbol 412 Button
on (release) {
_root.firstLevel = _root.curGameLine.practice[0];
_root.gotoAndStop("gameInit");
}
Symbol 413 Button
on (release) {
_root.firstLevel = _root.curGameLine.practice[1];
_root.gotoAndStop("gameInit");
}
Symbol 414 MovieClip Frame 1
stop();
Symbol 414 MovieClip Frame 2
stop();
Symbol 433 Button
on (press) {
gotoAndStop ("gameType");
}
Symbol 436 Button
on (release) {
_root.questStarted = true;
_root.firstLevel = _root.curGameLine.quest[0];
_root.gotoAndStop("gameinit");
}
Symbol 438 Button
on (release) {
_root.gotoAndStop("nextLevel");
}
Symbol 443 Button
on (release) {
trace("winnnnnnnn!");
_root.win();
}
Symbol 444 MovieClip Frame 16
stop();
Symbol 444 MovieClip Frame 36
stop();
Symbol 444 MovieClip Frame 55
stop();
Symbol 444 MovieClip Frame 74
stop();
Symbol 444 MovieClip Frame 93
stop();
Symbol 444 MovieClip Frame 112
stop();