Frame 1
function GetVar(N) {
if (_root[N] != undefined) {
return(_root[N]);
}
if (_global[N] != undefined) {
return(_global[N]);
}
return("0");
}
function Loading() {
if (GetVar("bypass") == "true") {
KB._visible = false;
loadbar._visible = false;
l1._x = l1._x + 100;
l2._x = l2._x - 100;
} else {
loadline._visible = true;
clearInterval(SSS);
Load = _root.getBytesLoaded();
Total = _root.getBytesTotal();
KB.text = ("Loading... (" + Math.round((100 * Load) / Total)) + "%)";
}
if (Total <= Load) {
loadline._xscale = (100 * Load) / Total;
seconds = Number(seconds) * 1000;
ID = setInterval(function () {
clearInterval(ID);
gotoAndStop (3);
}, seconds);
} else {
loadline._xscale = (100 * Load) / Total;
SSS = setInterval(Loading, 500);
}
updateAfterEvent();
}
function initoptXML(xml) {
var _local7 = xml.firstChild;
var _local5 = _local7.firstChild;
seconds = _local5.firstChild.firstChild.toString();
nagtime = _local5.firstChild.nextSibling.firstChild.toString();
linklogo1 = _local5.firstChild.nextSibling.nextSibling.firstChild.toString();
linklogo2 = _local5.lastChild.firstChild.toString();
var _local6 = _local5.nextSibling;
var _local4 = _local6.childNodes;
j = 0;
while (j < 7) {
er = _local4[j].firstChild.toString();
_root["menubutton" + j] = er;
j++;
}
var _local8 = _local6.nextSibling;
var _local3 = _local8.childNodes;
j = 0;
while (j < _local3.length) {
er = _local3[j].firstChild.toString();
_root["hint" + j] = er;
j++;
}
var _local2 = _local8.nextSibling;
downloadlink = _local2.firstChild.toString().split("&").join("&");
_local2 = _local2.nextSibling;
morelink = (downloadlink = AddUrl);
if (GetVar("link") != "0") {
downloadlink = GetVar("link");
morelink = GetVar("link");
}
_local2 = _local2.nextSibling;
nolife = _local2.firstChild.toString();
_local2 = _local2.nextSibling;
onelife = _local2.firstChild.toString();
_local2 = _local2.nextSibling;
manylives = _local2.firstChild.toString();
_local2 = _local2.nextSibling;
fast = _local2.firstChild.toString();
_local2 = _local2.nextSibling;
normal = _local2.firstChild.toString();
_local2 = _local2.nextSibling;
slow = _local2.firstChild.toString();
_local2 = _local2.nextSibling;
texttiles = _local2.firstChild.toString();
_local2 = _local2.nextSibling;
textmatches = _local2.firstChild.toString();
_local2 = _local2.nextSibling;
textchain = _local2.firstChild.toString();
_local2 = _local2.nextSibling;
texttime = _local2.firstChild.toString();
_local2 = _local2.nextSibling;
textbonus = _local2.firstChild.toString();
_local2 = _local2.nextSibling;
textscore = _local2.firstChild.toString();
_local2 = _local2.nextSibling;
textseconds = _local2.firstChild.toString();
_local2 = _local2.nextSibling;
nagdownload = _local2.firstChild.toString();
_local2 = _local2.nextSibling;
nagmore = _local2.firstChild.toString();
_local2 = _local2.nextSibling;
nagcontinue = _local2.firstChild.toString();
_local2 = _local2.nextSibling;
nagrestart = _local2.firstChild.toString();
_local2 = _local2.nextSibling;
textcontinue = _local2.firstChild.toString();
_local2 = _local2.nextSibling;
texthelpclick = _local2.firstChild.toString();
_local2 = _local2.nextSibling;
textgameover = _local2.firstChild.toString();
help = _local7.lastChild;
ahelp = help.childNodes;
j = 0;
while (j < ahelp.length) {
er = ahelp[j].firstChild.toString();
_root["helping" + j] = er;
j++;
}
}
function initcountXML(xml) {
var _local3 = xml.firstChild;
if (_local3 != undefined) {
loadbar._visible = true;
map = new Array();
countries = new Array();
sities = new Array();
artdescription = new Array();
var _local2 = _local3.childNodes;
sities = new Array(_local2.length);
sitytime = new Array(_local2.length);
i = 0;
while (i < _local2.length) {
var _local1 = _local2[i].childNodes;
country = new Array();
countryname = _local2[i].attributes.name;
artdesc = _local2[i].attributes.description;
countries.push(countryname);
artdescription.push(artdesc);
asityname = new Array();
atime = new Array();
j = 0;
while (j < _local1.length) {
ast = _local1[j].childNodes;
sity = new Array();
sityname = _local1[j].attributes.name;
timesity = _local1[j].attributes.time;
atime.push(timesity);
asityname.push(sityname);
k = 0;
while (k < ast.length) {
aline = ast[k].firstChild.toString().split(" ");
sity.push(aline);
k++;
}
country.push(sity);
sities[i] = asityname;
sitytime[i] = atime;
j++;
}
map.push(country);
i++;
}
Loading();
} else {
KB.text = "Unable to init game";
}
}
function LoadXML() {
var _local2 = new XML(TEXToptions);
_local2.ignoreWhite = true;
initoptXML(_local2);
var _local1 = new XML(TEXTcountries);
_local1.ignoreWhite = true;
initcountXML(_local1);
}
var AddUrl = "http://www.playrix.com/atlantis-quest.html?utm_campaign=newgrounds&utm_medium=flash&utm_source=atlantis-quest";
TEXTcountries = "<?xml version=\"1.0\" encoding=\"utf-8\"?><countries><country name=\"Greece\" description=\"The amphora of Dyonysus,|the Greek god of wine, who|introduced the peoples of|many lands to the cultivation|of the vine. This unique|amphora is said to be able|to turn water into wine\"><sity name=\"Arta\" time=\"600\"><st>1 1 1 1 1 1 1</st><st>1 1 1 1 1 1 1</st><st>1 1 1 a1 1 1 1</st><st>1 1 1 1 1 1 1</st><st>1 1 1 1 1 1 1</st><st>1 1 1 1 1 1 1</st><st>1 1 1 1 1 1 1</st></sity><sity name=\"Athens\" time=\"500\"><st>1 1 1 1 1 1 1 1 1</st><st>1 1 1 1 1 1 a2 1 1</st><st>1 1 1 1 1 1 1 1 1</st><st>1 1 a3 1 1 1 1 1 1</st><st>1 1 1 1 1 1 1 1 1</st><st>1 1 1 1 1 1 1 1 1</st></sity><sity name=\"Sparta\" time=\"520\"><st>1 1 1 a4 1 1 1</st><st>1 1 1 1 1 1 1</st><st>1 a5 1 1 1 1 1</st><st>1 1 1 1 1 1 1</st><st>1 1 1 1 1 1 1</st><st>1 1 b1 1 1 1 1</st><st>1 1 1 1 1 a6 1</st><st>1 1 1 1 1 1 1</st><st>1 1 1 1 1 1 1</st></sity><sity name=\"Troy\" time=\"500\"><st>0 0 0 1 1 0 0 0</st><st>1 1 0 1 1 0 1 1</st><st>1 1 0 a8 1 0 1 1</st><st>1 1 1 1 1 1 1 1</st><st>1 1 1 1 1 1 a9 1</st><st>1 a7 1 1 1 1 1 1</st><st>1 1 1 1 1 1 1 1</st><st>1 1 1 1 1 1 1 1</st><st>0 1 1 1 1 1 1 0</st></sity><sity name=\"Katerini\" time=\"380\"><st>0 0 1 1 1 1 0 0</st><st>0 1 1 1 1 1 a12 0</st><st>0 a10 1 1 1 1 1 0</st><st>0 1 1 1 a11 1 1 0</st><st>0 1 1 1 1 1 1 0</st><st>0 1 1 1 1 1 1 0</st><st>1 1 1 b2 1 1 1 1</st><st>1 1 1 1 1 1 1 1</st><st>0 0 1 1 1 1 0 0</st></sity><sity name=\"Mytilene\" time=\"340\"><st>0 0 1 1 b3 1 1 0 0</st><st>0 1 1 1 1 a16 1 1 0</st><st>a13 1 1 1 1 1 1 1 a15</st><st>1 1 1 1 1 1 1 1 1</st><st>1 1 1 1 1 1 1 1 1</st><st>1 1 1 1 1 1 1 1 1</st><st>1 1 1 1 1 1 1 1 1</st><st>0 1 1 1 a14 1 1 1 0</st><st>0 0 1 1 1 1 1 0 0</st></sity></country><country name=\"Babylon\" description=\"The Shield of Nebuchadnezzar,|the greatest of all the|Babylonian kings. He conquered|many territories, brought Syria|and Phoenicia under the sway of|Babylon, subdued the whole of|Palestine, and took Jerusalem.\"><sity name=\"Ture\" time=\"600\"><st>0 0 a2 1 1 1 1 0 0</st><st>0 0 1 1 1 1 1 0 0</st><st>1 a1 1 1 1 1 1 1 1</st><st>1 1 1 1 a3 1 1 a4 1</st><st>1 1 1 1 1 1 1 1 1</st><st>1 1 1 1 x1 1 1 1 1</st><st>1 1 1 1 1 1 1 1 1</st><st>0 0 1 1 1 b1 1 0 0</st><st>0 0 1 1 1 1 1 0 0</st></sity><sity name=\"Edom\" time=\"550\"><st>0 0 1 0 0 0 1 0 0</st><st>0 1 1 1 0 1 1 1 0</st><st>1 a5 1 1 1 1 1 a8 1</st><st>b2 1 1 a6 1 a7 1 1 1</st><st>1 1 1 1 1 1 1 1 1</st><st>0 1 1 1 1 1 1 1 0</st><st>0 0 1 1 1 1 1 0 0</st><st>0 0 0 1 1 1 0 0 0</st><st>0 0 0 0 1 0 0 0 0</st></sity><sity name=\"Emar\" time=\"470\"><st>0 0 a13 1 0 1 1 0 0</st><st>0 1 1 a10 0 1 1 1 0</st><st>1 1 1 1 0 b2 1 1 1</st><st>1 a9 1 1 1 1 1 1 1</st><st>1 1 1 1 1 1 a12 1 1</st><st>1 1 1 x5 1 1 1 1 1</st><st>0 1 1 1 1 1 1 1 0</st><st>0 1 a11 1 1 1 x1 1 0</st><st>0 0 1 1 1 1 1 0 0</st></sity><sity name=\"Samaria\" time=\"440\"><st>0 0 0 1 1 1 1 a16 0</st><st>0 0 0 1 x5 1 1 1 1</st><st>1 a18 1 1 a15 1 1 1 1</st><st>1 1 1 1 1 1 1 1 1</st><st>1 1 1 1 1 1 1 1 a17</st><st>1 1 b3 1 1 1 1 1 1</st><st>1 1 1 1 1 a14 1 1 1</st><st>1 1 1 x5 1 1 0 0 0</st><st>0 1 1 1 1 1 0 0 0</st></sity><sity name=\"Kish\" time=\"420\"><st>0 0 0 0 0 0 0 1 1</st><st>0 0 0 0 0 0 a20 1 1</st><st>0 0 0 0 0 1 1 1 1</st><st>0 0 0 0 a22 1 1 1 1</st><st>0 0 0 1 1 1 1 1 1</st><st>0 0 a19 1 1 1 1 1 a21</st><st>0 1 1 1 1 1 1 1 1</st><st>1 a23 1 1 b4 1 1 1 1</st><st>1 1 1 1 1 1 1 1 1</st></sity><sity name=\"Assyria\" time=\"410\"><st>a26 1 1 x1 0 0 0 0</st><st>1 1 1 1 a25 0 0 0</st><st>1 1 1 1 1 1 0 0</st><st>1 1 1 1 1 1 a27 0</st><st>1 1 a24 1 1 1 1 1</st><st>1 1 1 1 1 1 1 1</st><st>1 1 1 1 1 1 1 0</st><st>b1 1 1 1 1 1 0 0</st><st>1 1 1 1 1 0 0 0</st></sity><sity name=\"Babylon\" time=\"430\"><st>1 0 0 a29 a28 0 0 1</st><st>a31 1 0 1 1 0 1 1</st><st>1 1 1 1 x3 1 1 1</st><st>1 1 1 1 1 1 a30 1</st><st>1 1 1 1 1 1 1 1</st><st>1 1 b2 1 1 1 1 a32</st><st>1 1 1 1 1 1 1 1</st><st>1 1 1 1 1 1 1 1</st><st>0 1 0 1 1 0 1 0</st></sity><sity name=\"Susa\" time=\"350\"><st>a33 0 0 0 0 0 0 0 0</st><st>1 1 1 0 0 0 0 0 0</st><st>1 1 1 1 1 0 0 0 0</st><st>1 1 a34 1 1 1 1 0 0</st><st>a37 1 1 1 a35 1 1 1 1</st><st>1 1 1 1 1 1 x5 1 1</st><st>0 1 1 b1 1 1 x1 a36 1</st><st>0 0 0 1 1 1 x2 1 1</st><st>0 0 0 0 0 1 1 1 1</st></sity></country><country name=\"Egypt\" description=\"The Statue of Horus Behudety,|the falcon headed god of midday|sun, venerated as a victorious|warlord who fought a great|battle against Seth and an|army of conspirators.\"><sity name=\"Memphis\" time=\"390\"><st>0 0 0 0 a2 0 0 0 0</st><st>0 0 0 1 1 1 0 0 0</st><st>0 0 1 1 1 1 a3 0 0</st><st>0 1 1 1 1 1 1 1 0</st><st>1 a1 1 1 1 1 1 1 1</st><st>0 1 1 1 1 1 1 1 0</st><st>0 0 1 1 1 1 1 0 0</st><st>0 0 0 1 1 1 0 0 0</st><st>0 0 0 0 x5 0 0 0 0</st></sity><sity name=\"Siwa\" time=\"370\"><st>0 0 0 1 a5 1 0 0 0</st><st>0 0 0 1 1 1 0 0 0</st><st>0 a4 1 1 1 1 1 1 0</st><st>0 1 1 1 1 1 1 a6 0</st><st>0 1 1 1 x5 1 1 1 0</st><st>0 1 1 1 1 b4 1 1 0</st><st>0 1 1 1 1 1 1 1 0</st><st>0 1 x6 1 1 1 1 1 0</st><st>1 1 1 0 0 0 1 1 1</st></sity><sity name=\"Saggara\" time=\"440\"><st>1 a7 1 1 1 1 1 1 1</st><st>1 1 1 1 1 1 1 a9 1</st><st>0 1 1 1 1 1 1 1 0</st><st>0 1 1 1 a8 1 1 1 0</st><st>0 1 x6 1 1 1 x5 1 0</st><st>0 0 1 1 1 1 1 0 0</st><st>0 0 b1 1 1 1 1 0 0</st><st>0 0 1 1 1 1 1 0 0</st><st>0 0 0 1 x6 1 0 0 0</st></sity><sity name=\"Amarna\" time=\"390\"><st>0 0 1 1 a11 1 1 0 0</st><st>0 1 1 1 1 1 1 1 0</st><st>a1 1 1 b3 1 1 1 a12 1</st><st>1 1 1 1 1 1 1 1 b2</st><st>1 1 1 1 1 1 1 1 1</st><st>x6 1 1 1 x5 1 1 1 1</st><st>0 1 1 1 0 1 x1 1 0</st><st>0 0 1 1 0 1 1 0 0</st></sity><sity name=\"Karnak\" time=\"460\"><st>0 1 0 0 0 0 1 0</st><st>0 1 1 0 0 1 1 0</st><st>0 1 1 0 0 1 a15 0</st><st>a13 1 1 a14 1 1 1 1</st><st>1 1 1 1 1 1 1 1</st><st>1 1 1 1 1 1 1 1</st><st>1 1 1 b2 1 1 1 x6</st><st>1 1 1 1 1 1 1 1</st><st>0 x2 1 1 1 1 1 0</st></sity><sity name=\"Sohag\" time=\"460\"><st>a16 1 1 0 0 a18 1 1</st><st>1 1 1 0 0 1 1 1</st><st>1 1 1 0 0 1 1 1</st><st>1 1 a17 0 0 1 1 1</st><st>1 1 1 0 0 1 1 1</st><st>1 1 1 0 0 1 1 b3</st><st>1 1 1 0 0 1 1 1</st><st>1 1 1 1 1 a19 1 1</st><st>1 1 x5 1 1 1 1 x6</st></sity><sity name=\"Suez\" time=\"370\"><st>0 0 0 1 a22 0 0 0</st><st>0 1 1 1 1 1 1 0</st><st>1 a21 1 1 1 1 1 1</st><st>1 1 1 1 1 1 1 a23</st><st>1 1 1 1 1 1 1 1</st><st>a20 x6 1 1 1 1 1 1</st><st>1 1 1 1 1 1 1 1</st><st>0 1 1 1 1 1 1 0</st><st>0 0 0 1 x2 0 0 0</st></sity><sity name=\"Dahab\" time=\"350\"><st>0 1 a25 1 0 a26 1 1 0</st><st>a24 1 1 1 0 1 1 1 a27</st><st>1 1 1 1 b2 1 1 1 1</st><st>1 1 1 1 1 b1 1 1 1</st><st>1 1 1 x2 1 1 1 1 1</st><st>1 1 1 1 0 1 1 x1 1</st><st>1 1 1 1 0 1 1 1 1</st><st>1 1 1 0 0 0 1 1 1</st></sity><sity name=\"Hurghada\" time=\"310\"><st>0 0 1 x5 x6 1 0 0</st><st>1 1 1 1 1 1 1 1</st><st>1 1 1 a28 1 1 1 1</st><st>1 1 1 1 a29 x2 1 1</st><st>1 x5 1 1 1 1 1 1</st><st>1 1 1 1 1 1 1 1</st><st>1 1 1 1 1 a30 1 1</st><st>1 1 x5 1 1 x6 1 1</st><st>0 0 x6 1 1 x5 0 0</st></sity></country></countries>";
TEXToptions = "<?xml version=\"1.0\" encoding=\"utf-8\"?><option><intro><loadsec>5</loadsec><nag>1</nag><logo1>logo1.swf</logo1><logo2>logo2.swf</logo2></intro><menu><button>How to play</button><button>Sound on</button><button>full version</button><button>New game</button><button>Resume</button><button>Sound off</button><button>Exit</button></menu><hints><hint>Form matches of three in-a-row by|swapping adjacent tiles. For example,|these flashing tiles can be swapped</hint><hint>Drive this piece to the bottom of the|game field by getting rid of tiles|under it and you will see it added to|the artifact outline on the left</hint><hint>Tiles can only be swapped if it|results in matching three in-a-row</hint><hint>Finish the level by dropping all|the pieces of the artifact to the|bottom of the game field</hint><hint>Pay attention!|You have not much time left</hint><hint>A hammer bonus. Drive it to the|bottom to be able to use it.|It can destroy a particular|inconvenient tile</hint><hint>A spade bonus. Use it to destroy|the tiles right underneath the|pieces of the artifact</hint><hint>A clock bonus. Use it when time|is almost up to receive some|extra time</hint><hint>A magic lamp bonus. Use it to|change all the tiles around|the piece of the artifact</hint><hint>Click on the Hammer to pick it|up and point to the tile|you want to smash</hint><hint>Click on the Spade to dig under|all the pieces of the artifact|currently on the game field</hint><hint>Click on the Clock to get some|extra time when it begins to|run out</hint><hint>Click on the Magic Lamp to|change all the tiles around|the pieces of the artifact</hint></hints><downloadlink>http://www.playrix.com/atlantis-quest.html?utm_campaign=other&utm_medium=flash&utm_source=atlantisquest</downloadlink><link>http://www.playrix.com/atlantis-quest.html?utm_campaign=other&utm_medium=flash&utm_source=atlantisquest</link><nolife>No extra lifes left</nolife><onelife>One extra life left</onelife><manylives> extra lives left</manylives><fast>excellent</fast><normal>well done</normal><slow>you did it</slow><tiles>tiles</tiles><matches>matches</matches><chain>max chain</chain><time>your time</time><timebonus>time bonus</timebonus><score>score</score><textseconds>s</textseconds><nagdownload>download now</nagdownload><nagmore>tell me more</nagmore><nagcontinue>back to game</nagcontinue><nagrestart>start over</nagrestart><continue>continue</continue><helpclick>click to play</helpclick><gameover>game over</gameover><help><hlp>Use the left mouse|button to swap tiles</hlp><hlp>Move tiles into matches|of 3 or more in a line|horizontally or verticaly</hlp><hlp>Assemble the Artifact|by freeing the pieces|throught the bottom</hlp><hlp>Free the bonuses.|They will help you</hlp></help></option>";
Stage.showMenu = false;
Stage.scaleMode = "noScale";
oKey.onKeyDown = function () {
if (Key.isDown(38) && (Key.getAscii() == String("s").charCodeAt())) {
trace("qq");
}
};
Key.addListener(oKey);
stop();
loadline._visible = false;
loadbar._visible = false;
this._lockroot = true;
LoadXML();
Frame 3
function InitRound() {
lowtime_s = new Sound();
lowtime_s.attachSound("lowtime");
notBlock = false;
stats_s.stop();
Mouse.removeListener(oMouse);
_root.attachMovie("panelleft", "panelleft", _root.getNextHighestDepth());
_root.attachMovie(countries[RoundCountry].substr(0, 1).toLowerCase() + "shad", "shadow", _root.getNextHighestDepth());
_root.attachMovie(countries[RoundCountry], "gamepanel", _root.getNextHighestDepth());
_root.attachMovie("timeline", "TIME", _root.getNextHighestDepth());
_root.attachMovie("Score", "SCORE", _root.getNextHighestDepth());
_root.attachMovie("menubutton", "button", _root.getNextHighestDepth());
_root.attachMovie("smalltext", "country1", _root.getNextHighestDepth());
_root.attachMovie("smalltext", "sity1", _root.getNextHighestDepth());
TextShow(country1, countries[RoundCountry], "l", 0, 0, 1);
TextShow(sity1, sities[RoundCountry][RoundSity], "l", 0, 0, 1);
country1._x = 95;
country1._y = 3;
sity1._x = 95;
sity1._y = 217;
TIME._x = 224;
TIME._y = 327;
gamepanel._x = 194;
SCORE._y = 242;
SCORE._x = 100;
shadow._x = ArtX;
shadow._y = ArtY;
button._x = 40;
button._y = 315;
button.onPress = bRel;
button.onRelease = MenuPress;
button.onReleaseOutside = MenuPress;
TextShow(SCORE, String(score), "sc", 0, 0, 1);
Nomer = 4 + RoundCountry;
delete Matrix;
Matrix = new Array();
generateMatrix(RoundCountry, RoundSity, Matrix);
GlobalX = (270 - ((Size - 29) * 7)) - ((Matrix[0].length - 7) * (Size / 2));
GlobalY = (75 - ((Size - 29) * 7)) - ((Matrix.length - 7) * (Size / 2));
_root.attachMovie("smalltext", "hamn", _root.getNextHighestDepth(), {_x:HamX + 25, _y:HamY + 20});
_root.attachMovie("smalltext", "dign", _root.getNextHighestDepth(), {_x:DigX + 25, _y:DigY + 20});
_root.attachMovie("smalltext", "watn", _root.getNextHighestDepth(), {_x:WatX + 25, _y:WatY + 20});
_root.attachMovie("smalltext", "lamn", _root.getNextHighestDepth(), {_x:LamX + 25, _y:LamY + 20});
if (Hammer) {
_root.attachMovie("hammer", "hammer", _root.getNextHighestDepth());
hammer._x = HamX;
hammer._y = HamY;
hammer.onPress = onHammerClick;
TextShow(hamn, "x" + Hammer, "h", 0, 0, 0);
}
if (Watch) {
_root.attachMovie("watch", "watch", _root.getNextHighestDepth());
watch._x = WatX;
watch._y = WatY;
watch.onPress = onWatchClick;
TextShow(watn, "x" + Watch, "h", 0, 0, 0);
}
if (Digger) {
_root.attachMovie("digger", "digger", _root.getNextHighestDepth());
digger._x = DigX;
digger._y = DigY;
digger.onPress = onDiggerClick;
TextShow(dign, "x" + Digger, "h", 0, 0, 0);
}
if (Lamp) {
_root.attachMovie("lamp", "lamp", _root.getNextHighestDepth());
lamp._x = LamX;
lamp._y = LamY;
lamp.onPress = onLampClick;
TextShow(lamn, "x" + Lamp, "h", 0, 0, 0);
}
ResetTimer();
StopTimer();
Add = (Matches = (Chain = (MaxChain = (Tiles = (EndX = 0)))));
Blink = "no";
Mouse.show();
DrawLife();
DrawArt();
PreDraw();
}
function CallFall() {
clearInterval(ifall);
ifall = setInterval(function () {
clearInterval(ifall);
FallDown(Matrix);
}, 100);
}
function bRel() {
if ((notBlock && (redytoend)) && (!moveart)) {
inMenu = true;
this._y = this._y + 3;
}
}
function ClearRound(Matrix) {
StopHint();
hamn.removeMovieClip();
lamn.removeMovieClip();
dign.removeMovieClip();
watn.removeMovieClip();
country1.removeMovieClip();
sity1.removeMovieClip();
clearInterval(DD);
clearINterval(HHH);
SCORE.removeMovieClip();
TIME.removeMovieClip();
gamepanel.removeMovieClip();
shadow.removeMovieClip();
panelleft.removeMovieClip();
hammer.removeMovieClip();
digger.removeMovieClip();
watch.removeMovieClip();
lamp.removeMovieClip();
ham.removeMovieClip();
button.removeMovieClip();
bl.removeMovieClip();
mainmenu.removeMovieClip();
var i = 0;
while (i < Matrix.length) {
var j = 0;
while (j < Matrix[i].length) {
var temp = FindName(i, j);
eval (temp).removeMovieClip();
eval ("s" + j).removeMovieClip();
eval (temp + "fon").removeMovieClip();
clearInterval(_root["m" + temp]);
clearInterval(_root["b" + temp]);
clearInterval(_root[MATP + Name]);
clearInterval(_root[("m" + i) + j]);
clearInterval(_root["m" + String(eval (("s" + i) + j))]);
j++;
}
i++;
}
i = 1;
while (i < 50) {
var Name = ((countries[RoundCountry].substr(0, 1).toLowerCase() + "slice") + i);
eval (Name).removeMovieClip();
eval ("heart" + Number(i - 1)).removeMovieClip();
eval ("border" + Number(i - 1)).removeMovieClip();
eval ("corner" + Number(i - 1)).removeMovieClip();
i++;
}
}
function InitSound() {
Art_s = new Sound();
Art_s.attachSound("Art.mp3");
art_s = new Sound();
art_s.attachSound("artefact");
bonus_s = new Sound();
bonus_s.attachSound("bonus");
digger_s = new Sound();
digger_s.attachSound("diggers");
endexplode_s = new Sound();
endexplode_s.attachSound("endexplode");
hint_s = new Sound();
hint_s.attachSound("hint_s");
lamp_s = new Sound();
lamp_s.attachSound("lamps");
lowtime_s = new Sound();
lowtime_s.attachSound("lowtime");
match1_s = new Sound();
match1_s.attachSound("match1");
match2_s = new Sound();
match2_s.attachSound("match2");
stats_s = new Sound();
stats_s.attachSound("stats");
time_s = new Sound();
time_s.attachSound("time");
no_s = new Sound();
no_s.attachSound("no");
yes_s = new Sound();
yes_s.attachSound("yes");
click_s = new Sound();
click_s.attachSound("click");
hammer_s = new Sound();
hammer_s.attachSound("hammers");
scores_s = new Sound();
scores_s.attachSound("Scores");
start_s = new Sound();
start_s.attachSound("start");
watch_s = new Sound();
watch_s.attachSound("watchs");
}
function PreDraw() {
_root.attachMovie("black", "bl", _root.getNextHighestDepth());
bl._width = 520;
bl._height = 390;
bl._alpha = 50;
bl.useHandCursor = false;
start_s = new Sound();
start_s.attachSound("start");
bl.onPress = function () {
clearInterval(showing);
clearInterval(showing1);
clearInterval(showing2);
bigtext.removeMovieClip();
var Done = true;
var i = 0;
while (i < Matrix.length) {
if (eval (("s" + i) + "0") != undefined) {
Done = false;
}
i++;
}
delete start_s;
if (Done) {
DrawFon(GlobalX, GlobalY, Matrix);
}
var i = 0;
while (i < Matrix.length) {
clearInterval(_root["Fallb" + i]);
var j = 0;
while (j < Matrix[0].length) {
eval (("s" + i) + j)._x = GlobalX + (Size * j);
eval (("s" + i) + j)._y = GlobalY + (i * Size);
if (Matrix[i][j].substr(1, 3) != "sli") {
eval (("s" + i) + j)._x = eval (("s" + i) + j)._x + ((Size / 2) - (eval (("s" + i) + j)._width / 2));
eval (("s" + i) + j)._y = eval (("s" + i) + j)._y + ((Size / 2) - (eval (("s" + i) + j)._height / 2));
}
eval (("s" + i) + j)._alpha = 100;
j++;
}
i++;
}
ShowBlink();
TIME.time1._x = 0;
bl.removeMovieClip();
};
var str = ((((((countries[RoundCountry] + ", ") + sities[RoundCountry][RoundSity]) + "|Level ") + Number(RoundCountry + 1)) + "-") + Number(RoundSity + 1));
_root.attachMovie("bigtext", "bigtext", _root.getNextHighestDepth(), {_x:360, _y:180, _alpha:0});
if ((countries[RoundCountry].length + sities[RoundCountry][RoundSity].length) > 13) {
var u = ((countries[RoundCountry].length + sities[RoundCountry][RoundSity].length) - 13);
bigtext._x = bigtext._x - (u * 12);
}
TextShow(bigtext, str, "t", 5, 30, 1);
showing = setInterval(ShowBeginText, 10, 1);
showing1 = setInterval(function () {
clearInterval(showing1);
clearInterval(showing);
bigtext._alpha = 0;
if (Life == 0) {
str = nolife;
} else if (Life == 1) {
str = onelife;
} else {
str = Life + manylives;
}
TextShow(bigtext, str, "t", 0, 30, 1);
bigtext._x = 360;
showing = setInterval(ShowBeginText, 10, 1);
}, 2500);
showing2 = setInterval(function () {
clearInterval(showing);
clearInterval(showing2);
bigtext.removeMovieClip();
DrawFon(GlobalX, GlobalY, Matrix);
}, 5000);
}
function ShowBeginText(l) {
if (l == 1) {
if (bigtext._alpha >= 100) {
clearInterval(showing);
showing = setInterval(ShowBeginText, 10, -1);
} else {
bigtext._alpha = bigtext._alpha + 2;
}
} else if (bigtext._alpha <= 3) {
clearInterval(showing);
} else {
bigtext._alpha = bigtext._alpha - 2;
}
}
function TextShow(Inside, Str, l, W, H, C) {
function Attach(STR) {
Inside.TEXT.attachMovie(STR + l, U, Inside.TEXT.getNextHighestDepth(), {_x:X, _y:Y});
wid = eval ((String(Inside) + ".TEXT.") + U)._width;
X = X + (wid + W);
}
var X = 0;
var Y = 0;
var L = 0;
var wid = 0;
Inside.TEXT.removeMovieClip();
Inside.createEmptyMovieClip("TEXT", Inside.getNextHighestDepth());
var i = 0;
while (i < Str.length) {
var j = Str.substr(i, 1).toLowerCase();
if (j == "|") {
if (C == 1) {
X = X / 2;
var k = 0;
while (k < Str.length) {
eval (((String(Inside) + ".TEXT.t") + k) + L)._x = eval (((String(Inside) + ".TEXT.t") + k) + L)._x - X;
k++;
}
} else if (C == 2) {
var k = 0;
while (k < Str.length) {
eval (((String(Inside) + ".TEXT.t") + k) + L)._x = eval (((String(Inside) + ".TEXT.t") + k) + L)._x - X;
k++;
}
}
L++;
X = 0;
Y = Y + H;
} else {
var U = (("t" + i) + L);
if (j == " ") {
X = X + ((eval (String(Inside) + ".TEXT.t00")._width * 3) / 4);
} else if (j == ",") {
Attach("zpt");
} else if (j == ".") {
Attach("dot");
} else if (j == ":") {
Attach("dd");
} else if (j == "-") {
Attach("tire");
} else {
Attach(String(j));
}
}
i++;
}
if (C == 1) {
X = X / 2;
var k = 0;
while (k < Str.length) {
eval (((String(Inside) + ".TEXT.t") + k) + L)._x = eval (((String(Inside) + ".TEXT.t") + k) + L)._x - X;
k++;
}
} else if (C == 2) {
var k = 0;
while (k < Str.length) {
eval (((String(Inside) + ".TEXT.t") + k) + L)._x = eval (((String(Inside) + ".TEXT.t") + k) + L)._x - X;
k++;
}
}
return(L);
}
function ScoreAdd(chk) {
var _local1 = 5;
if (chk == "y") {
_local1 = 20;
}
if (Add > 0) {
score = score + _local1;
Add = Add - _local1;
redytoend = false;
TextShow(SCORE, String(score), "sc", 0, 0, 1);
if (score >= NextLife) {
Life++;
if (SoundOn) {
life_s.start();
}
NextLife = NextLife + 35000;
}
} else {
clearInterval(scoring);
redytoend = true;
}
}
function Score(ADD, chk) {
Add = Add + ADD;
var _local1 = 0;
if (Add < 30) {
_local1 = 200;
} else if (Add < 100) {
_local1 = 20;
}
clearInterval(scoring);
scoring = setInterval(ScoreAdd, _local1, chk);
}
function MenuDownload(i, j, str, b) {
if (b) {
mainmenu["b" + i].onPress = _root[str];
TextShow(mainmenu["txt" + i], _root["menubutton" + j], "b", -2, 15, 1);
mainmenu["b" + i].onRollOver = function () {
TextShow(mainmenu["txt" + i], _root["menubutton" + j], "l", -1, 15, 1);
};
mainmenu["b" + i].onRollOut = function () {
TextShow(mainmenu["txt" + i], _root["menubutton" + j], "b", -2, 15, 1);
};
} else {
mainmenu["b" + i]._visible = false;
}
}
function MenuPress() {
if (inMenu) {
var n = 4;
var a = String(GetVar("alawar_f"));
if ((a == "0") || (a == "false")) {
n++;
}
var c = String(GetVar("close_f"));
if (c != "0") {
n++;
}
var M = ("menu" + n);
inMenu = false;
button._y = button._y - 3;
StopHint();
StopTimer();
notBlock = false;
_root.attachMovie("black", "bl", _root.getNextHighestDepth());
bl._alpha = 50;
bl._width = 520;
bl._height = 390;
_root.attachMovie("mainmenu", "mainmenu", _root.getNextHighestDepth(), {_x:200, _y:50});
mainmenu.mmm.attachMovie(M, "menu", 0);
mainmenu.b1.onPress = FunctionHelp;
mainmenu.b2.onPress = FunctionSound;
if ((a != "true") && (c != "0")) {
MenuDownload(3, 2, "FunctionDownload", true);
MenuDownload(4, 3, "FunctionNew", true);
MenuDownload(6, 4, "FunctionResume", true);
MenuDownload(5, 6, "FunctionExit", true);
} else if ((a != "true") && (c == "0")) {
MenuDownload(3, 2, "FunctionDownload", true);
MenuDownload(4, 3, "FunctionNew", true);
MenuDownload(5, 4, "FunctionResume", true);
MenuDownload(6, 4, "F");
} else if ((a == "true") && (c != "0")) {
MenuDownload(3, 3, "FunctionNew", true);
MenuDownload(5, 4, "FunctionResume", true);
MenuDownload(4, 6, "FunctionExit", true);
MenuDownload(6, 6, "F");
} else {
MenuDownload(3, 3, "FunctionNew", true);
MenuDownload(4, 4, "FunctionResume", true);
MenuDownload(5, 6, "F");
MenuDownload(6, 6, "F");
}
mainmenu.b1.onRollOver = function () {
TextShow(mainmenu.txt1, _root.menubutton0, "l", -1, 15, 1);
};
mainmenu.b1.onRollOut = function () {
TextShow(mainmenu.txt1, _root.menubutton0, "b", -2, 15, 1);
};
TextShow(mainmenu.txt1, _root.menubutton0, "b", -2, 15, 1);
if (SoundOn) {
TextShow(mainmenu.txt2, _root.menubutton1, "b", -2, 15, 1);
mainmenu.b2.onRollOver = function () {
TextShow(mainmenu.txt2, _root.menubutton1, "l", -1, 15, 1);
};
mainmenu.b2.onRollOut = function () {
TextShow(mainmenu.txt2, _root.menubutton1, "b", -2, 15, 1);
};
} else {
TextShow(mainmenu.txt2, _root.menubutton5, "b", -2, 15, 1);
mainmenu.b2.onRollOver = function () {
TextShow(mainmenu.txt2, _root.menubutton5, "l", -1, 15, 1);
};
mainmenu.b2.onRollOut = function () {
TextShow(mainmenu.txt2, _root.menubutton5, "b", -2, 15, 1);
};
}
}
}
function FunctionHelp() {
this._y = this._y + 3;
this._parent.txt1._y = this._parent.txt1._y + 3;
clearInterval(LLL);
LLL = setInterval(function () {
clearInterval(LLL);
_root.attachMovie("helppanel", "help", _root.getNextHighestDepth());
}, 300);
}
function FunctionSound() {
this._y = this._y + 3;
this._parent.txt2._y = this._parent.txt2._y + 3;
SoundOn = !SoundOn;
if (SoundOn) {
TextShow(mainmenu.txt2, _root.menubutton1, "l", -1, 15, 1);
mainmenu.b2.onRollOver = function () {
TextShow(mainmenu.txt2, _root.menubutton1, "l", -1, 15, 1);
};
mainmenu.b2.onRollOut = function () {
TextShow(mainmenu.txt2, _root.menubutton1, "b", -2, 15, 1);
};
} else {
TextShow(mainmenu.txt2, _root.menubutton5, "l", -1, 15, 1);
mainmenu.b2.onRollOver = function () {
TextShow(mainmenu.txt2, _root.menubutton5, "l", -1, 15, 1);
};
mainmenu.b2.onRollOut = function () {
TextShow(mainmenu.txt2, _root.menubutton5, "b", -2, 15, 1);
};
}
}
function FunctionDownload() {
this._y = this._y + 3;
this._parent.txt3._y = this._parent.txt3._y + 3;
LLL = setInterval(function () {
clearInterval(LLL);
if (GetVar("link") == "0") {
getURL (downloadlink, "_blank");
} else {
getURL (GetVar("link"));
}
if (GetVar("dload_f") != "0") {
getURL (("JavaScript:" + GetVar("dload_f")) + "()");
}
}, 300);
}
function FunctionNew() {
this._y = this._y + 3;
this._parent["txt" + this._name.substr(this._name.length - 1, 1)]._y = this._parent["txt" + this._name.substr(this._name.length - 1, 1)]._y + 3;
RoundCountry = (RoundSity = (Hammer = (Lamp = (Digger = (Watch = (Chain = (Matches = (MaxChain = (Tiles = (EndX = (score = 0)))))))))));
delete ArtPos;
ArtPos = new Array();
InitArt(RoundCountry, RoundSity);
clearInterval(LLL);
LLL = setInterval(function () {
clearInterval(LLL);
ClearRound(Matrix);
InitRound();
}, 300);
}
function FunctionResume() {
this._y = this._y + 3;
this._parent["txt" + this._name.substr(this._name.length - 1, 1)]._y = this._parent["txt" + this._name.substr(this._name.length - 1, 1)]._y + 3;
clearInterval(LLL);
LLL = setInterval(function () {
clearInterval(LLL);
notBlock = true;
StartTimer();
bl.removeMovieClip();
mainmenu.removeMovieClip();
nag.removeMovieClip();
RedyToPlay = true;
StartHint();
}, 300);
}
function FunctionExit() {
this._y = this._y + 3;
this._parent["txt" + this._name.substr(this._name.length - 1, 1)]._y = this._parent["txt" + this._name.substr(this._name.length - 1, 1)]._y + 3;
clearInterval(LLL);
LLL = setInterval(function () {
clearInterval(LLL);
var _local1 = GetVar("close_f");
getURL (("JavaScript:" + _local1) + "()");
}, 500);
}
function DrawArt() {
var i = 1;
while (i <= ArtPos.length) {
if (ArtPos[i].is == true) {
var Name = ((countries[RoundCountry].substr(0, 1).toLowerCase() + "slice") + i);
var X = ArtPos[Number(Name.substr(6, 2))].x;
var Y = ArtPos[Number(Name.substr(6, 2))].y;
_root.attachMovie(Name, Name, _root.getNextHighestDepth());
}
eval (Name)._x = X;
eval (Name)._y = Y;
i++;
}
}
function FGameOver() {
Life = 3;
RoundCountry = (RoundSity = (Hammer = (Lamp = (Digger = (Watch = (Chain = (Matches = (MaxChain = (Tiles = (EndX = (score = 0)))))))))));
delete ArtPos;
ArtPos = new Array();
InitArt(RoundCountry, RoundSity);
ClearRound(Matrix);
InitRound();
}
function GameOver() {
Life--;
StopTimer();
bl.removeMovieClip();
_root.attachMovie("black", "bl", _root.getNextHighestDepth(), {_width:520, _height:390, _alpha:0});
bl.onPress = AAA;
bl.useHandCursor = false;
if (Life == -1) {
clearInterval(ER);
RoundCountry = MaxC + 1;
RoundSity = 99;
ER = setInterval(EndRound, 20, Matrix);
} else {
clearing = setInterval(function () {
if (!Fall) {
clearInterval(clearing);
ClearRound(Matrix);
InitRound();
}
}, 20);
}
}
function Timing() {
var temp = ((100 * (EndTime - getTimer())) / totaltime);
TIME.time1._x = ((temp - 100) * 270) / 100;
if (temp < 1) {
GameOver();
} else if (temp < 20) {
if (SoundOn && (lowtime_s.position == 0)) {
lowtime_s.start();
}
if (warningtime) {
warningtime = false;
_root.attachMovie("timewarn", "warn", _root.getNextHighestDepth());
warn._xscale = temp;
warn._x = 224;
warn._y = 327;
} else {
warn.removeMovieClip();
warningtime = true;
}
if (htime) {
htime = false;
clearInterval(HHH);
HHH = setInterval(Hints, 50, "time");
}
}
updateAfterEvent();
}
function DrawLife() {
var i = 0;
while (i < 3) {
eval ("heart" + i).removeMovieClip;
i++;
}
var i = 0;
while ((i < Life) && (i < 3)) {
var X = 76;
var Y = 277;
_root.attachMovie("heart", "heart" + i, _root.getNextHighestDepth());
eval ("heart" + i)._x = X + (i * 15);
eval ("heart" + i)._y = Y;
i++;
}
}
function ResetTimer() {
clearInterval(TI);
totaltime = Number(sitytime[RoundCountry][RoundSity]) * 1000;
EndTime = Number(getTimer()) + totaltime;
stopped = 0;
StartTimer();
}
function StartTimer() {
if (stopped) {
EndTime = EndTime + (getTimer() - stopped);
BeginTime = BeginTime + (getTimer() - stopped);
stopped = 0;
}
clearInterval(TI);
TI = setInterval(Timing, 100);
}
function StopTimer() {
StopHint();
stopped = getTimer();
clearInterval(TI);
}
function gen(Matrix) {
Line = new Array("slide2", "slide2", "slide3", "slide4");
Matrix[0] = Line;
Line = new Array("slide1", "hammer", "digger", "slide2");
Matrix[1] = Line;
Line = new Array("slide3", "slide2", "slide2", "slide1");
Matrix[2] = Line;
}
function InitArt(Country, Sity) {
function PUSH(x, y) {
Line = new Array("x", "y", "is");
Line.x = x + ArtX;
Line.y = y + ArtY;
ArtPos.push(Line);
}
var Line = new Array();
if (Country == 0) {
PUSH(0, 0);
PUSH(56, 26);
PUSH(78, 26);
PUSH(42, 39);
PUSH(54, 37);
PUSH(77, 37);
PUSH(104, 37);
PUSH(34, 63);
PUSH(53, 63);
PUSH(77, 63);
PUSH(101, 63);
PUSH(35, 87);
PUSH(52, 86);
PUSH(77, 87);
PUSH(103, 87);
PUSH(54, 112);
PUSH(77, 112);
} else if (Country == 1) {
PUSH(0, 0);
PUSH(93, 130);
PUSH(54, 93);
PUSH(56, 56);
PUSH(13, 57);
PUSH(30, 53);
PUSH(31, 81);
PUSH(81, 4);
PUSH(39, 61);
PUSH(95, 81);
PUSH(74, 127);
PUSH(63, 134);
PUSH(77, 134);
PUSH(42, 16);
PUSH(67, 41);
PUSH(61, 3);
PUSH(97, 55);
PUSH(57, 30);
PUSH(126, 51);
PUSH(79, 31);
PUSH(109, 51);
PUSH(75, 76);
PUSH(17, 82);
PUSH(31, 29);
PUSH(124, 97);
PUSH(27, 108);
PUSH(12, 35);
PUSH(83, 54);
PUSH(129, 82);
PUSH(94, 104);
PUSH(42, 104);
PUSH(62, 116);
PUSH(53, 81);
PUSH(111, 78);
PUSH(109, 105);
PUSH(43, 125);
PUSH(75, 101);
PUSH(83, 118);
} else {
PUSH(0, 0);
PUSH(62, 46);
PUSH(30, 98);
PUSH(57, 135);
PUSH(104, 139);
PUSH(53, 90);
PUSH(79, 87);
PUSH(111, 46);
PUSH(20, 7);
PUSH(85, 53);
PUSH(78, 64);
PUSH(83, 112);
PUSH(36, 113);
PUSH(62, 66);
PUSH(49, 118);
PUSH(23, 60);
PUSH(46, 72);
PUSH(24, 81);
PUSH(59, 108);
PUSH(108, 114);
PUSH(103, 69);
PUSH(85, 128);
PUSH(33, 1);
PUSH(127, 136);
PUSH(79, 137);
PUSH(37, 139);
PUSH(38, 42);
PUSH(94, 60);
PUSH(103, 92);
PUSH(31, 24);
PUSH(13, 34);
}
}
function Blow(i, j) {
var temp = Matrix[i][j];
var slide = eval (FindName(i, j));
if (temp.substr(0, 5) == "lock1") {
Matrix[i][j] = temp.substr(5, 10);
slide.l.removeMovieClip();
InitSlide(slide);
} else if (temp.substr(0, 5) == "lock2") {
Matrix[i][j] = "lock1" + temp.substr(5, 10);
slide.l.removeMovieClip();
slide.attachMovie("lock1", "l", _root.getNextHighestDepth(), {_width:Size, _height:Size});
} else {
Tiles++;
Score(5 * (Chain + 1));
var Depth = slide.getDepth();
slide.removeMovieClip();
var Name = FindName(i, j);
eval (Name + "b").removeMovieClip();
_root.attachMovie("blow", Name + "b", Depth);
eval (Name + "b").txt.txt.text = 5 * (Chain + 1);
eval (Name + "b")._x = GlobalX + (j * Size);
eval (Name + "b")._y = GlobalY + (i * Size);
Matrix[i][j] = Matrix[i][j] + "b";
_root["b" + Name] = setInterval(function () {
Matrix[i][j] = "no";
clearInterval(_root["b" + FindName(i, j)]);
}, 0);
}
}
function FindChain(Matrix) {
var _local5 = false;
var _local2 = 0;
while (_local2 < Matrix.length) {
var _local1 = 0;
while (_local1 < Matrix[_local2].length) {
var _local4 = Matrix[_local2][_local1];
if (_local4.substr(0, 4) == "lock") {
_local4 = _local4.substr(5, 10);
} else {
_local4 = Matrix[_local2][_local1].substr(0, 6);
}
if (_local4.substr(0, 1) == "s") {
if (((Matrix[_local2 - 1][_local1].substr(0, 6) == _local4) || (Matrix[_local2 - 1][_local1].substr(5, 10) == _local4)) && ((Matrix[_local2 + 1][_local1].substr(0, 6) == _local4) || (Matrix[_local2 + 1][_local1].substr(5, 10) == _local4))) {
if (Matrix[_local2 - 1][_local1].substr(6, 1) != "b") {
Blow(_local2 - 1, _local1);
}
if (Matrix[_local2][_local1].substr(6, 1) != "b") {
Blow(_local2, _local1);
}
if (Matrix[_local2 + 1][_local1].substr(6, 1) != "b") {
Blow(_local2 + 1, _local1);
}
_local5 = true;
}
if (((Matrix[_local2][_local1 - 1].substr(0, 6) == _local4) || (Matrix[_local2][_local1 - 1].substr(5, 10) == _local4)) && ((Matrix[_local2][_local1 + 1].substr(0, 6) == _local4) || (Matrix[_local2][_local1 + 1].substr(5, 10) == _local4))) {
if (Matrix[_local2][_local1 - 1].substr(6, 1) != "b") {
Blow(_local2, _local1 - 1);
}
if (Matrix[_local2][_local1].substr(6, 1) != "b") {
Blow(_local2, _local1);
}
if (Matrix[_local2][_local1 + 1].substr(6, 1) != "b") {
Blow(_local2, _local1 + 1);
}
_local5 = true;
}
}
_local1++;
}
_local2++;
}
return(_local5);
}
function FallBegin(x, j, Matrix) {
var l = 5;
var k = 0;
mmm = mmm + ((270 * l) / (Matrix[0].length * 100));
while (eval (FindName(k, j)) == undefined) {
k++;
}
if (eval (FindName(k, j))._y >= (GlobalY + (k * Size))) {
clearInterval(_root["Flallb" + j]);
AdjustSlides(j);
j++;
mmm = ((270 * j) / Matrix[0].length) - 270;
if (j != Matrix[0].length) {
if (SoundOn && (x != GlobalY)) {
start_s.start();
}
_root["Flallb" + j] = setInterval(FallBegin, Speed, x, j, Matrix);
} else {
bl.removeMovieClip();
BeginTime = getTimer();
notStop = (redytoend = true);
ShowBlink();
if (((RoundSity == 0) && (RoundCountry == 0)) && (hbegin)) {
hbegin = false;
clearInterval(HHH);
HHH = setInterval(Hints, 50, "begin");
}
Fall = (moveart = (hammeruse = false));
}
} else {
var i = 0;
while (i < Matrix.length) {
if (mmm < 270) {
TIME.time1._x = mmm;
}
eval (FindName(i, j))._y = eval (FindName(i, j))._y + l;
eval (FindName(i, j))._alpha = 100 - ((GlobalY + (k * Size)) - eval (FindName(k, j))._y);
i++;
}
}
updateAfterEvent();
}
function AdjustSlides(j) {
var i = 0;
while (i <= Matrix.length) {
if (Matrix[i][j].substr(1, 3) != "sli") {
eval (("s" + i) + j)._x = ((GlobalX + (Size * j)) + (Size / 2)) - (eval (("s" + i) + j)._width / 2);
eval (("s" + i) + j)._y = ((GlobalY + (Size * i)) + (Size / 2)) - (eval (("s" + i) + j)._height / 2);
}
i++;
}
}
function ShowBlink() {
var k = 0;
clearInterval(delays);
delays = setInterval(function () {
var i = 0;
while (i <= k) {
var j = 0;
while (j <= k) {
if ((((i + j) == k) && (Matrix[i][j] != "0")) && (Matrix[i][j] != undefined)) {
_root.attachMovie("shine1", ("si" + i) + j, _root.getNextHighestDepth(), {_x:GlobalX + (j * Size), _y:GlobalY + (i * Size)});
if (eval (("s" + i) + j).hitTest(hints)) {
eval (("si" + i) + j).removeMovieClip();
}
}
j++;
}
i++;
}
if (k == ((Matrix.length + Matrix[0].length) - 2)) {
clearInterval(delays);
notBlock = true;
} else {
k++;
}
}, 60);
}
function DrawArt1(i, j) {
_root.createEmptyMovieClip(("s" + i) + j, _root.getNextHighestDepth(), {_x:(Size * j) + GlobalX, _y:(Size * i) + GlobalY});
eval (("s" + i) + j).attachMovie(Matrix[i][j], "mask", eval (("s" + i) + j).getNextHighestDepth());
eval (("s" + i) + j).attachMovie("art", "art", eval (("s" + i) + j).getNextHighestDepth());
eval (("s" + i) + j).art._width = eval (("s" + i) + j).mask._width;
if (eval (("s" + i) + j).art._width < (Size / 2)) {
eval (("s" + i) + j).art._width = (Size * 2) / 3;
}
eval (("s" + i) + j).art._height = eval (("s" + i) + j).mask._height;
eval (("s" + i) + j).art._x = (eval (("s" + i) + j).mask._x = (Size / 2) - (eval (("s" + i) + j).art._width / 2));
eval (("s" + i) + j).art._y = (eval (("s" + i) + j).mask._y = (Size / 2) - (eval (("s" + i) + j).art._height / 2));
}
function DrawMatrix(x, y, Matrix) {
i = 0;
while (i < Matrix.length) {
j = 0;
while (j < Matrix[i].length) {
if (Matrix[i][j].substr(0, 4) != "lock") {
if (Matrix[i][j].substr(1, 5) == "slice") {
eval (Matrix[i][j]).removeMovieClip();
DrawArt1(i, j);
} else if (Matrix[i][j].substr(0, 5) != "slide") {
_root.attachMovie(Matrix[i][j], ("s" + i) + j, _root.getNextHighestDepth());
} else {
_root.attachMovie(Matrix[i][j], ("s" + i) + j, _root.getNextHighestDepth(), {_width:Size1, _height:Size1});
}
eval (("s" + i) + j)._x = x + (j * Size);
eval (("s" + i) + j)._y = y + (i * Size);
if (Matrix[i][j].substr(1, 3) != "sli") {
eval (("s" + i) + j)._x = eval (("s" + i) + j)._x + ((Size / 2) - (eval (("s" + i) + j)._width / 2));
}
eval (("s" + i) + j)._alpha = 0;
InitSlide(("s" + i) + j);
if ((Matrix[i][j] == "hammer") && (hhammer)) {
hhammer = false;
clearInterval(HHH);
HHH = setInterval(Hints, 50, "hammer");
} else if ((Matrix[i][j] == "digger") && (hdigger)) {
hdigger = false;
clearInterval(HHH);
HHH = setInterval(Hints, 50, "digger");
} else if ((Matrix[i][j] == "watch") && (hwatch)) {
hwatch = false;
clearInterval(HHH);
HHH = setInterval(Hints, 50, "watch");
} else if ((Matrix[i][j] == "lamp") && (hlamp)) {
hlamp = false;
clearInterval(HHH);
HHH = setInterval(Hints, 50, "lamp");
}
} else {
var Lock = Matrix[i][j].substr(0, 5);
var slide = Matrix[i][j].substr(5, 10);
_root.attachMovie(slide, ("s" + i) + j, _root.getNextHighestDepth(), {_width:Size1, _height:Size1});
eval (("s" + i) + j).attachMovie(Lock, "l", _root.getNextHighestDepth(), {_width:Size1, _height:Size1});
eval (("s" + i) + j)._alpha = 0;
eval (("s" + i) + j)._x = x + (j * Size);
eval (("s" + i) + j)._y = y + (i * Size);
}
j++;
}
i++;
}
mmm = -270;
if (SoundOn && (y != GlobalY)) {
start_s.start();
}
Flallb0 = setInterval(FallBegin, Speed, y, 0, Matrix);
}
function InitSlide(slide) {
eval (slide).onPress = Press;
eval (slide).onRelease = Release;
eval (slide).onReleaseOutside = Release;
eval (slide).onRollOver = OverMove;
eval (slide).onRollOut = OutMove;
eval (slide).useHandCursor = false;
eval (slide).tabEnabled = false;
}
function DrawFon(x, y, Matrix) {
var l = 0;
var k = 0;
i = 0;
while (i < Matrix.length) {
j = 0;
while (j < Matrix[i].length) {
if (Matrix[i][j] != "0") {
_root.attachMovie("fon", (("s" + i) + j) + "fon", _root.getNextHighestDepth(), {_width:Size, _height:Size});
eval ((("s" + i) + j) + "fon")._x = (j * Size) + x;
eval ((("s" + i) + j) + "fon")._y = (i * Size) + y;
eval ((("s" + i) + j) + "fon").gotoAndStop(1);
eval ((("s" + i) + j) + "fon")._width = Size + 1;
eval ((("s" + i) + j) + "fon")._height = Size + 1;
if ((Matrix[i - 1][j] == "0") || (Matrix[i - 1][j] == undefined)) {
_root.attachMovie("border", "border" + l, _root.getNextHighestDepth(), {_height:Size});
eval ("border" + l)._rotation = -90;
eval ("border" + l)._x = (j * Size) + x;
eval ("border" + l)._y = ((i * Size) + y) - 2;
l++;
if ((Matrix[i][j - 1] == "0") || (Matrix[i][j - 1] == undefined)) {
_root.attachMovie("corner", "corner" + k, _root.getNextHighestDepth(), {_x:((j * Size) + x) - 5, _y:((i * Size) + y) - 5});
k++;
}
if ((Matrix[i][j + 1] == "0") || (Matrix[i][j + 1] == undefined)) {
_root.attachMovie("corner", "corner" + k, _root.getNextHighestDepth(), {_x:(((j + 1) * Size) + x) + 5.5, _y:((i * Size) + y) - 5, _rotation:90});
k++;
}
}
if ((Matrix[i + 1][j] == "0") || (Matrix[i + 1][j] == undefined)) {
_root.attachMovie("border", "border" + l, _root.getNextHighestDepth(), {_height:Size});
eval ("border" + l)._rotation = -90;
eval ("border" + l)._x = (j * Size) + x;
eval ("border" + l)._y = (((i + 1) * Size) + y) + 3;
l++;
if ((Matrix[i][j - 1] == "0") || (Matrix[i][j - 1] == undefined)) {
_root.attachMovie("corner", "corner" + k, _root.getNextHighestDepth(), {_x:((j * Size) + x) + 0, _y:((i + 1) * Size) + y, _rotation:90});
k++;
}
if ((Matrix[i][j + 1] == "0") || (Matrix[i][j + 1] == undefined)) {
_root.attachMovie("corner", "corner" + k, _root.getNextHighestDepth(), {_x:(((j + 1) * Size) + x) + 0.5, _y:((i + 1) * Size) + y});
k++;
}
}
if ((Matrix[i][j - 1] == "0") || (Matrix[i][j - 1] == undefined)) {
_root.attachMovie("border", "border" + l, _root.getNextHighestDepth(), {_height:Size});
eval ("border" + l)._x = ((j * Size) + x) - 2;
eval ("border" + l)._y = (i * Size) + y;
l++;
}
if ((Matrix[i][j + 1] == "0") || (Matrix[i][j + 1] == undefined)) {
_root.attachMovie("border", "border" + l, _root.getNextHighestDepth(), {_height:Size});
eval ("border" + l)._x = (((j + 1) * Size) + x) + 3;
eval ("border" + l)._y = (i * Size) + y;
l++;
}
}
j++;
}
i++;
}
bl._alpha = 0;
DrawMatrix(GlobalX, GlobalY - 100, Matrix);
}
function generateMatrix(country, sity, Matrix) {
Line = new Array();
agame = map[country][sity];
i = 0;
while (i < agame.length) {
j = 0;
while (j < agame[i].length) {
if (agame[i][j] == 1) {
do {
done = true;
var temp1 = (Math.round(Math.random() * (Nomer - 1)) + 1);
var temp = ("slide" + temp1);
if (((i > 1) && ((Matrix[i - 1][j] == temp) || (Matrix[i - 1][j].substr(5, 10) == temp))) && ((Matrix[i - 2][j] == temp) || (Matrix[i - 2][j].substr(5, 10) == temp))) {
done = false;
}
if (((j > 1) && ((Line[j - 1] == temp) || (Line[j - 1].substr(5, 10) == temp))) && ((Line[j - 2] == temp) || (Line[j - 2].substr(5, 10) == temp))) {
done = false;
}
if ((agame[i][j + 1].substr(1, 1) == temp1) || (agame[i + 1][j].substr(1, 1) == temp1)) {
done = false;
}
} while (!done);
Line[j] = temp;
} else {
switch (agame[i][j].substr(0, 1)) {
case "x" :
temp = "lock1slide" + agame[i][j].substr(1, 1);
break;
case "X" :
temp = "lock2slide" + agame[i][j].substr(1, 1);
break;
case "b" :
lala = agame[i][j].substr(1, 1);
if (lala == "1") {
temp = "hammer";
} else if (lala == "2") {
temp = "digger";
} else if (lala == "3") {
temp = "watch";
} else if (lala == "4") {
temp = "lamp";
}
break;
case "a" :
temp = (countries[country].toLowerCase().substr(0, 1) + "slice") + agame[i][j].substr(1, 2);
eval (temp).removeMovieClip();
break;
default :
temp = "0";
}
Line[j] = temp;
}
j++;
}
Matrix[i] = Line;
Line = new Array();
i++;
}
}
function FindIndexX(name) {
var _local1 = substring(name, name.indexOf("s") + 2, 1);
return(_local1);
}
function FindIndexY(name) {
var _local1 = substring(name, name.indexOf("s") + 3, 2);
return(_local1);
}
function FindName(x, y) {
return(("s" + x) + y);
}
function CheckClick(name) {
Release();
if (Blink == "no") {
return(true);
}
notBlock = false;
i = FindIndexX(String(name));
j = FindIndexY(String(name));
var _local1 = String(Blink);
ind1 = FindIndexX(_local1);
ind2 = FindIndexY(_local1);
if (((i - ind1) == 1) && ((j - ind2) == 0)) {
CheckSuccess(i, j, ind1, ind2);
MoveDown(_local1);
} else if (((i - ind1) == -1) && ((j - ind2) == 0)) {
CheckSuccess(i, j, ind1, ind2);
MoveUp(_local1);
} else if (((i - ind1) == 0) && ((j - ind2) == -1)) {
CheckSuccess(i, j, ind1, ind2);
MoveLeft(_local1);
} else if (((i - ind1) == 0) && ((j - ind2) == 1)) {
CheckSuccess(i, j, ind1, ind2);
MoveRight(_local1);
} else {
if (((i - ind1) == 0) && ((j - ind2) == 0)) {
notBlock = true;
return(true);
}
notBlock = true;
Blink.gotoAndStop(1);
return(true);
}
}
function MovingDown(slide, y, chk) {
var _local6 = y + Size;
if (slide._y < (_local6 - N)) {
if (chk == "fall") {
Fall = true;
}
slide._y = slide._y + N;
} else {
if (chk == "0") {
notBlock = true;
}
Fall = false;
var _local3 = FindIndexX(String(slide));
var _local2 = FindIndexY(String(slide));
var _local4 = FindName(_local3++, _local2);
var _local7 = FindName(_local3, _local2);
RemoveSlides(_local4, _local7, chk);
}
updateAfterEvent();
}
function MovingRight(slide, x, chk) {
var _local5 = x + Size;
if (slide._x < (_local5 - N)) {
slide._x = slide._x + N;
} else {
if (chk == "0") {
notBlock = true;
}
var _local3 = FindIndexX(String(slide));
var _local2 = FindIndexY(String(slide));
var _local4 = FindName(_local3, _local2++);
var _local6 = FindName(_local3, _local2);
RemoveSlides(_local4, _local6, chk);
}
updateAfterEvent();
}
function MovingLeft(slide, x, chk) {
var _local5 = x - Size;
if (slide._x > (_local5 + N)) {
slide._x = slide._x - N;
} else {
if (chk == "0") {
notBlock = true;
}
var _local3 = FindIndexX(String(slide));
var _local2 = FindIndexY(String(slide));
var _local4 = FindName(_local3, _local2--);
var _local6 = FindName(_local3, _local2);
RemoveSlides(_local4, _local6, chk);
}
updateAfterEvent();
}
function MovingUp(slide, y, chk) {
var End = (y - Size);
if (eval (slide)._y > (End + N)) {
eval (slide)._y = eval (slide)._y - N;
} else {
if (chk == "0") {
notBlock = true;
}
var i = FindIndexX(String(slide));
var j = FindIndexY(String(slide));
var temp = FindName(i--, j);
var temp1 = FindName(i, j);
RemoveSlides(temp, temp1, chk);
}
updateAfterEvent();
}
function RemoveSlides(slide, slide1, chk) {
StopHint();
redytoend = false;
eval (slide + "fon").gotoAndStop(1);
eval (slide1 + "fon").gotoAndStop(1);
Blink = "no";
clearInterval(_root["m" + String(eval (slide))]);
clearInterval(_root["m" + String(eval (slide1))]);
removeMovieClip(eval (slide));
removeMovieClip(eval (slide1));
var i = FindIndexX(String(slide));
var j = FindIndexY(String(slide));
var i1 = FindIndexX(String(slide1));
var j1 = FindIndexY(String(slide1));
if (chk == "fall") {
i++;
var slide = FindName(i, j);
if (Matrix[i][j].substr(0, 4) != "lock") {
if (Matrix[i][j].substr(1, 5) == "slice") {
DrawArt1(i, j);
} else if (Matrix[i][j].substr(0, 5) != "slide") {
_root.attachMovie(Matrix[i][j], slide, _root.getNextHighestDepth());
slide._x = slide._x + ((Size / 2) - (slide._width / 2));
slide._y = slide._y + ((Size / 2) - (slide._height / 2));
} else {
_root.attachMovie(Matrix[i][j], slide, _root.getNextHighestDepth(), {_width:Size1, _height:Size1});
}
InitSlide(slide);
} else {
var Lock = Matrix[i][j].substr(0, 5);
var slid = Matrix[i][j].substr(5, 10);
_root.attachMovie(slid, slide, _root.getNextHighestDepth(), {_width:Size1, _height:Size1});
eval (slide).attachMovie(Lock, "l", _root.getNextHighestDepth());
}
eval (slide)._x = GlobalX + (j * Size);
eval (slide)._y = GlobalY + (i * Size);
if (Matrix[i][j].substr(0, 5) != "slide") {
slide._x = slide._x + ((Size / 2) - (slide._width / 2));
slide._y = slide._y + ((Size / 2) - (slide._height / 2));
}
} else {
var newname = Matrix[i1][j1];
Matrix[i1][j1] = Matrix[i][j];
Matrix[i][j] = newname;
if (Matrix[i][j].substr(1, 5) == "slice") {
DrawArt1(i, j);
} else if (Matrix[i][j].substr(0, 5) != "slide") {
_root.attachMovie(Matrix[i][j], slide, _root.getNextHighestDepth());
} else {
_root.attachMovie(Matrix[i][j], slide, _root.getNextHighestDepth(), {_width:Size1, _height:Size1});
}
InitSlide(slide);
if (Matrix[i1][j1].substr(1, 5) == "slice") {
DrawArt1(i1, j1);
} else if (Matrix[i1][j1].substr(0, 5) != "slide") {
_root.attachMovie(Matrix[i1][j1], slide1, _root.getNextHighestDepth());
} else {
_root.attachMovie(Matrix[i1][j1], slide1, _root.getNextHighestDepth(), {_width:Size1, _height:Size1});
}
InitSlide(slide1);
eval (slide)._x = GlobalX + (j * Size);
eval (slide)._y = GlobalY + (i * Size);
eval (slide1)._x = GlobalX + (j1 * Size);
eval (slide1)._y = GlobalY + (i1 * Size);
if (Matrix[i][j].substr(1, 3) != "sli") {
eval (slide)._x = eval (slide)._x + ((Size / 2) - (eval (slide)._width / 2));
eval (slide)._y = eval (slide)._y + ((Size / 2) - (eval (slide)._height / 2));
}
if (Matrix[i1][j1].substr(1, 3) != "sli") {
eval (slide1)._x = eval (slide1)._x + ((Size / 2) - (eval (slide1)._width / 2));
eval (slide1)._y = eval (slide1)._y + ((Size / 2) - (eval (slide1)._height / 2));
}
if (chk != "0") {
var done = FindChain(Matrix);
if (!done) {
if (hswap) {
hswap = false;
clearInterval(HHH);
HHH = setInterval(Hints, 50, "swap");
}
if (i > i1) {
MoveUp(slide, 0);
} else if (i1 > i) {
MoveUp(slide1, 0);
} else if (j1 > j) {
MoveLeft(slide1, 0);
} else {
MoveLeft(slide, 0);
}
} else {
if (SoundOn) {
match1_s.start();
}
Matches++;
fallnext = setInterval(function () {
clearInterval(fallnext);
fall = setInterval(FallDown, Speed, Matrix);
}, 100);
if (hart) {
hart = false;
clearInterval(HHH);
HHH = setInterval(Hints, 50, "art");
}
}
} else {
redytoend = true;
}
}
StartHint();
}
function StopHint() {
clearInterval(stopping);
sh1.removeMovieClip();
sh2.removeMovieClip();
}
function GoHint(i1, j1, i2, j2) {
StopHint();
_root.attachMovie("shine", "sh1", _root.getNextHighestDepth());
_root.attachMovie("shine", "sh2", _root.getNextHighestDepth());
sh1._x = (GlobalX + (j1 * Size)) - 2;
sh1._y = (GlobalY + (i1 * Size)) - 2;
sh2._x = (GlobalX + (j2 * Size)) - 2;
sh2._y = (GlobalY + (i2 * Size)) - 2;
}
function CHECK(i, j, i0, j0, i1, j1, i2, j2, chk) {
var _local4 = false;
var _local1 = Matrix[i][j];
if ((((((Matrix[i][j] != "0") && (Matrix[i0][j0] != "0")) && (Matrix[i0][j0] != undefined)) && (Matrix[i0][j0].substr(0, 1) != "l")) && ((Matrix[i1][j1] == _local1) || (Matrix[i1][j1].substr(5, 10) == _local1))) && ((Matrix[i2][j2] == _local1) || (Matrix[i2][j2].substr(5, 10) == _local1))) {
_local4 = true;
if (chk == undefined) {
GoHint(i, j, i0, j0);
}
}
return(_local4);
}
function Finding(i, j, i1, j1) {
var _local3 = false;
if ((!_local3) && (((i1 == i) && (j1 == (Number(j) + 1))) || (i1 == undefined))) {
_local3 = CHECK(Number(i), j, Number(i), Number(j) + 1, Number(i) + 1, Number(j) + 1, Number(i) + 2, Number(j) + 1);
}
if ((!_local3) && (((i1 == i) && (j1 == (j - 1))) || (i1 == undefined))) {
_local3 = CHECK(i, Number(j), i, Number(j) - 1, Number(i) + 1, Number(j) - 1, Number(i) + 2, Number(j) - 1);
}
if ((!_local3) && (((i1 == i) && (j1 == (Number(j) + 1))) || (i1 == undefined))) {
_local3 = CHECK(i, Number(j), i, Number(j) + 1, i - 1, Number(j) + 1, i - 2, Number(j) + 1);
}
if ((!_local3) && (((i1 == i) && (j1 == (j - 1))) || (i1 == undefined))) {
_local3 = CHECK(i, Number(j), i, Number(j) - 1, i - 1, Number(j) - 1, i - 2, Number(j) - 1);
}
if ((!_local3) && (((i1 == (Number(i) + 1)) && (j1 == j)) || (i1 == undefined))) {
_local3 = CHECK(i, Number(j), Number(i) + 1, Number(j), Number(i) + 1, Number(j) + 1, Number(i) + 1, Number(j) + 2);
}
if ((!_local3) && (((i1 == (Number(i) + 1)) && (j1 == j)) || (i1 == undefined))) {
_local3 = CHECK(i, Number(j), Number(i) + 1, Number(j), Number(i) + 1, Number(j) - 1, Number(i) + 1, Number(j) - 2);
}
if ((!_local3) && (((i1 == (i - 1)) && (j1 == j)) || (i1 == undefined))) {
_local3 = CHECK(i, Number(j), i - 1, Number(j), i - 1, Number(j) + 1, i - 1, Number(j) + 2);
}
if ((!_local3) && (((i1 == (i - 1)) && (j1 == j)) || (i1 == undefined))) {
_local3 = CHECK(i, Number(j), i - 1, Number(j), i - 1, Number(j) - 1, i - 1, Number(j) - 2);
}
if ((!_local3) && (((i1 == i) && (j1 == (Number(j) + 1))) || (i1 == undefined))) {
_local3 = CHECK(i, Number(j), i, Number(j) + 1, i - 1, Number(j) + 1, Number(i) + 1, Number(j) + 1);
}
if ((!_local3) && (((i1 == i) && (j1 == (j - 1))) || (i1 == undefined))) {
_local3 = CHECK(i, Number(j), i, Number(j) - 1, i - 1, Number(j) - 1, Number(i) + 1, Number(j) - 1);
}
if ((!_local3) && (((i1 == (Number(i) + 1)) && (j1 == j)) || (i1 == undefined))) {
_local3 = CHECK(i, Number(j), Number(i) + 1, Number(j), Number(i) + 1, Number(j) + 1, Number(i) + 1, Number(j) - 1);
}
if ((!_local3) && (((i1 == (i - 1)) && (j1 == j)) || (i1 == undefined))) {
_local3 = CHECK(i, Number(j), i - 1, Number(j), i - 1, Number(j) + 1, i - 1, Number(j) - 1);
}
if ((!_local3) && (((i1 == (i - 1)) && (j1 == j)) || (i1 == undefined))) {
_local3 = CHECK(i, Number(j), i - 1, Number(j), i - 2, Number(j), i - 3, Number(j));
}
if ((!_local3) && (((i1 == (Number(i) + 1)) && (j1 == j)) || (i1 == undefined))) {
_local3 = CHECK(i, Number(j), Number(i) + 1, Number(j), Number(i) + 2, Number(j), Number(i) + 3, Number(j));
}
if ((!_local3) && (((i1 == i) && (j1 == (j - 1))) || (i1 == undefined))) {
_local3 = CHECK(i, Number(j), i, Number(j) - 1, i, Number(j) - 2, i, Number(j) - 3);
}
if ((!_local3) && (((i1 == i) && (j1 == (Number(j) + 1))) || (i1 == undefined))) {
_local3 = CHECK(i, Number(j), i, Number(j) + 1, i, Number(j) + 2, i, Number(j) + 3);
}
return(_local3);
}
function StartHint() {
clearInterval(stopping);
stopping = setInterval(FindStop, 7000, Matrix);
}
function FindStop(Matrix, chk) {
if (notBlock) {
clearInterval(stopping);
var _local7 = 0;
var _local6 = 0;
notStop = false;
_local7 = Math.round(Math.random() * (Matrix.length - 1));
_local6 = Math.round(Math.random() * (Matrix[0].length - 1));
var _local5 = 0;
while (_local5 < Matrix.length) {
var _local2 = (_local7 + _local5) % Matrix.length;
var _local1 = 0;
while (_local1 < Matrix[_local2].length) {
var _local4 = (_local6 + _local1) % Matrix[0].length;
notStop = Finding(_local2, _local4);
if (notStop) {
return(_local2);
}
_local1++;
}
_local5++;
}
if (!notStop) {
GameOver();
}
}
}
function FALL(Name, y0, Y, t0) {
var time = getTimer();
var T = GameSpeed;
Name._y = y0 - (((time - t0) * (y0 - Y)) / T);
if (Name._alpha < 100) {
Name._alpha = ((time - t0) * 100) / T;
}
if (time > (t0 + T)) {
Name._y = Y;
Name._alpha = 100;
clearInterval(_root["m" + String(eval (Name))]);
}
}
function CheckFall() {
clearInterval(fall);
clearInterval(refreshing);
Chain++;
if (FindChain(Matrix)) {
if (SoundOn) {
match2_s.start();
}
fall = setInterval(FallDown, 200, Matrix);
} else if (LastArt()) {
fall = setInterval(FallDown, 200, Matrix);
} else {
Fall = false;
if (Chain > MaxChain) {
MaxChain = Chain;
}
Chain = 0;
notBlock = true;
redytoend = true;
StartHint();
}
}
function LastArt() {
var _local2 = false;
j = 0;
while (j < Matrix[0].length) {
var _local1 = Matrix.length - 1;
temp = Matrix[_local1][j];
while (temp == "0") {
_local1--;
temp = Matrix[_local1][j];
}
if (((((temp.substr(1, 5) == "slice") || (temp == "lamp")) || (temp == "hammer")) || (temp == "watch")) || (temp == "digger")) {
_local2 = true;
}
j++;
}
return(_local2);
}
function FallDown(Matrix) {
function FallColomn(j) {
var N = 0;
var i = (Matrix.length - 1);
while (i >= 0) {
if (Matrix[i][j] == "0") {
} else if (Matrix[i][j] == "no") {
N++;
} else if ((((((Matrix[i][j].substr(1, 5) == "slice") || (Matrix[i][j] == "hammer")) || (Matrix[i][j] == "digger")) || (Matrix[i][j] == "watch")) || (Matrix[i][j] == "lamp")) && ((Matrix[i + 1][j] == undefined) || (Matrix[i + 1][j] == "0"))) {
Falling = true;
N++;
var temp = Matrix[i][j];
MoveArt(i, j, temp);
Matrix[i][j] = "no";
} else if (N) {
var slide = FindName(i, j);
var X = eval (slide)._x;
var Y = eval (slide)._y;
var Name = Matrix[i][j];
eval (slide).removeMovieClip();
var k = (i + N);
slide = ("s" + k) + j;
if (Name.substr(0, 4) != "lock") {
if (Name.substr(1, 5) == "slice") {
_root.createEmptyMovieClip(slide, _root.getNextHighestDepth());
eval (slide).attachMovie(Name, "mask", eval (slide).getNextHighestDepth());
eval (slide).attachMovie("art", "art", eval (slide).getNextHighestDepth());
eval (slide).art._width = eval (slide).mask._width;
eval (slide).art._height = eval (slide).mask._height;
if (eval (slide).art._width < (Size / 2)) {
eval (slide).art._width = (Size * 2) / 3;
}
eval (slide).art._x = (eval (slide).mask._x = (Size / 2) - (eval (slide).art._width / 2));
eval (slide).art._y = (eval (slide).mask._y = (Size / 2) - (eval (slide).art._height / 2));
eval (slide)._x = X;
eval (slide)._y = Y;
} else if (Name.substr(0, 5) != "slide") {
_root.attachMovie(Name, slide, _root.getNextHighestDepth(), {_x:X, _y:Y});
} else {
_root.attachMovie(Name, slide, _root.getNextHighestDepth(), {_x:X, _y:Y, _width:Size1, _height:Size1});
}
InitSlide(slide);
} else {
var Lock = Name.substr(0, 5);
var slid = Name.substr(5, 10);
_root.attachMovie(slid, slide, _root.getNextHighestDepth(), {_x:X, _y:Y, _width:Size1, _height:Size1});
eval (slide).attachMovie(Lock, "l", _root.getNextHighestDepth(), {_width:Size1, _height:Size1});
}
Matrix[k][j] = Matrix[i][j];
Matrix[i][j] = "no";
clearInterval(_root["m" + String(eval (slide))]);
_root["m" + String(eval (slide))] = setInterval(FALL, 0, eval (slide), Y, Y + (N * Size), getTimer());
}
i--;
}
var l = 0;
while (Matrix[l][j] == "0") {
l++;
}
i = 0;
while (i < N) {
k = i + l;
var Name = ("slide" + Math.round((Math.random() * (Nomer - 1)) + 1));
Matrix[k][j] = Name;
var X = (GlobalX + (j * Size));
var Y = (GlobalY - ((N - k) * Size));
_root.attachMovie(Name, ("s" + k) + j, _root.getNextHighestDepth(), {_x:X, _y:Y, _alpha:0, _width:Size1, _height:Size1});
eval (("s" + k) + j)._x = eval (("s" + k) + j)._x + ((Size / 2) - (eval (("s" + k) + j)._width / 2));
Name = ("s" + k) + j;
clearInterval(_root["m" + String(eval (Name))]);
InitSlide(Name);
_root["m" + String(eval (Name))] = setInterval(FALL, 0, eval (Name), Y, ((Y + (N * Size)) + (Size / 2)) - (eval (Name)._height / 2), getTimer());
i++;
}
}
clearInterval(fall);
notBlock = false;
clearInterval(refreshing);
refreshing = setInterval(function () {
updateAfterEvent();
}, 0);
Fall = true;
StopHint();
var j = 0;
while (j < Matrix[0].length) {
FallColomn(j);
j++;
}
fall = setInterval(CheckFall, GameSpeed + 50);
}
function MoveArt(i, j, Name) {
var temp = Name;
if ((Name == "hammer") && (Hammer)) {
Name = "a" + Name;
} else if ((Name == "digger") && (Digger)) {
Name = "a" + Name;
} else if ((Name == "watch") && (Watch)) {
Name = "a" + Name;
} else if ((Name == "lamp") && (Lamp)) {
Name = "a" + Name;
}
moveart = true;
var End = (GlobalY + ((i + 2.5) * Size));
var slide = FindName(i, j);
_root.attachMovie(temp, Name, _root.getNextHighestDepth());
eval (Name)._x = (eval (slide)._x + 15) - (eval (slide)._width / 2);
eval (Name)._y = (eval (slide)._y + 15) - (eval (slide)._height / 2);
eval (slide).removeMovieClip();
if (Name.substr(1, 5) == "slice") {
var EndX = ArtPos[Number(Name.substr(6, 2))].x;
var EndY = ArtPos[Number(Name.substr(6, 2))].y;
} else if (temp == "hammer") {
var EndX = HamX;
var EndY = HamY;
Hammer++;
hmove = setInterval(function () {
clearInterval(hmove);
TextShow(hamn, "x" + Hammer, "h", 0, 0, 0);
eval (Name).onPress = onHammerClick;
}, bonus_s.duration - 1100);
} else if (temp == "digger") {
Digger++;
var EndX = DigX;
var EndY = DigY;
dmove = setInterval(function () {
clearInterval(dmove);
TextShow(dign, "x" + Digger, "h", 0, 0, 0);
eval (Name).onPress = onDiggerClick;
}, bonus_s.duration - 1100);
} else if (temp == "watch") {
Watch++;
var EndX = WatX;
var EndY = WatY;
wmove = setInterval(function () {
clearInterval(wmove);
TextShow(watn, "x" + Watch, "h", 0, 0, 0);
eval (Name).onPress = onWatchClick;
}, bonus_s.duration - 1100);
} else if (temp == "lamp") {
Lamp++;
var EndX = LamX;
var EndY = LamY;
lmove = setInterval(function () {
clearInterval(lmove);
TextShow(lamn, "x" + Lamp, "h", 0, 0, 0);
eval (Name).onPress = onLampClick;
}, bonus_s.duration - 1100);
}
var a;
var b;
var c;
var x1;
var x2;
var x3;
var y1;
var y2;
var y3 = 0;
x3 = EndX - 3;
y3 = EndY - 3;
x2 = eval (Name)._x;
y2 = eval (Name)._y;
if (x2 < 400) {
x1 = 200;
} else {
x1 = 270;
}
y1 = 300;
a = (((y2 - y1) / (x2 - x1)) - ((y3 - y1) / (x3 - x1))) / (x2 - x3);
b = ((y2 - y1) / (x2 - x1)) - (a * (x2 + x1));
c = (y1 - ((a * x1) * x1)) - (b * x1);
if (temp.substr(1, 5) == "slice") {
if (SoundOn) {
art_s.start();
watch_s.start();
}
snd = 2900;
} else {
snd = bonus_s.duration - 1100;
if (SoundOn) {
bonus_s.start();
}
}
var i = 10;
_root["TAIL" + Name] = setInterval(function () {
if (i < NumTail) {
_root.attachMovie("tail", ("tail" + i) + Name, _root.getNextHighestDepth(), {_x:eval (Name)._x + (Math.random() * 20), _y:eval (Name)._y + (Math.random() * 20)});
i++;
} else {
clearInterval(_root["TAIL" + Name]);
}
}, TailPeriod);
AddingTime = 0;
clearInterval(AddT);
AddT = setInterval(AddTime, 50, snd / 20);
_root[MATP + Name] = setInterval(MoveArtToPosition, Speed, Name, temp, x3, y3, a, b, c, getTimer(), x2, snd);
}
function MoveArtToPosition(Name, temp, EndX, EndY, a, b, c, Time, x2, snd) {
moveart = true;
var Done = false;
var Time1 = getTimer();
if ((Time1 - Time) >= snd) {
Done = true;
} else {
var l = (x2 - (((Time1 - Time) * (x2 - EndX)) / snd));
var m = l;
eval (Name)._x = l;
eval (Name)._y = (((a * l) * l) + (b * l)) + c;
}
if (Done) {
clearInterval(_root[MATP + Name]);
clearInterval(_root["aaa" + Name]);
_root["aaa" + Name] = setInterval(function () {
var i = 10;
while (i < NumTail) {
eval (("tail" + i) + Name).removeMovieClip();
i++;
}
clearInterval(_root["aaa" + Name]);
clearInterval(TAIL);
eval (Name)._x = EndX + 3;
eval (Name)._y = EndY + 3;
moveart = false;
eval ("a" + temp).removeMovieClip();
eval (Name).fon.removeMovieClip();
ArtPos[Number(Name.substr(6, 2))].is = true;
CheckEnd(Matrix);
if (_root[("h" + temp) + "2"]) {
_root[("h" + temp) + "2"] = false;
clearInterval(HHH);
HHH = setInterval(Hints, 50, temp + "2");
}
}, 300);
}
updateAfterEvent();
}
function CheckEnd(Matrix) {
var _local4 = true;
var _local2 = 0;
while (_local2 < Matrix.length) {
var _local1 = 0;
while (_local1 < Matrix[_local2].length) {
if (Matrix[_local2][_local1].substr(1, 5) == "slice") {
_local4 = false;
break;
}
_local1++;
}
_local2++;
}
if (_local4) {
clearInterval(ER);
ER = setInterval(EndRound, 20, Matrix);
} else if (hart2) {
hart2 = false;
clearInterval(HHH);
HHH = setInterval(Hints, 50, "art2");
}
}
function EndRound(Matrix) {
if (moveart && (!notBlock)) {
clearInterval(ER);
} else if ((redytoend && (notBlock)) && (!moveart)) {
notBlock = false;
clearInterval(ER);
RoundSity++;
if (((RoundSity == 9) || ((RoundCountry == 1) && (RoundSity == 8))) || ((RoundCountry == 0) && (RoundSity == 6))) {
RoundSity = 0;
}
FromHint();
StopTimer();
bl.removeMovieClip();
inMenu = false;
mainmenu.removeMovieClip();
EEE = getTimer();
EndTime = Math.abs(Math.round((EndTime - EEE) / 1000));
TimeBonus = 0;
endstring = Matrix.length;
bl.removeMovieClip();
_root.attachMovie("black", "bl", _root.getNextHighestDepth());
bl._width = 520;
bl._height = 390;
bl._alpha = 0;
bl.useHandCursor = false;
bl.onPress = function () {
clearInterval(endinground);
endinground = setInterval(function () {
clearInterval(endinground);
var i = 0;
while (i < Matrix.length) {
var j = 0;
while (j < Matrix[0].length) {
eval (("s" + i) + j).removeMovieClip();
j++;
}
i++;
}
clearInterval(ending);
bigtext.removeMovieClip();
endstring = 0;
TIME.time1._x = -270;
score = score + ((EndTime * 10) + Add);
TextShow(SCORE, String(score), "sc", 0, 0, 1);
if (score >= NextLife) {
Life++;
if (SoundOn) {
life_s.start();
}
NextLife = NextLife + 35000;
}
TimeBonus = TimeBonus + (Add + (EndTime * 10));
Add = 0;
ShowStats();
}, 800);
};
clearInterval(ending);
var str = normal;
if (EndTime >= ((4 * totaltime) / 5000)) {
str = fast;
} else if (EndTime <= (totaltime / 5000)) {
str = slow;
}
if (RoundSity == 100) {
str = textgameover;
}
bigtext.removeMovieClip();
_root.attachMovie("bigtext", "bigtext", _root.getNextHighestDepth(), {_x:360, _y:180});
TextShow(bigtext, str, "t", 5, 20, 1);
ending = setInterval(Ending, 200, "r");
}
}
function Ending(chk) {
notBlock = false;
if (chk == "r") {
endstring--;
if (endstring == -1) {
clearInterval(ending);
if (SoundOn) {
time_s.start();
}
ending = setInterval(Ending, 0);
} else {
if (SoundOn && (endstring > 0)) {
endexplode_s.start();
}
var j = 0;
while (j < Matrix[0].length) {
if (eval (("s" + endstring) + j) != undefined) {
_root.attachMovie("blow", ("s" + endstring) + j, _root.getNextHighestDepth(), {_x:(GlobalX + (Size * j)) - 2, _y:(GlobalY + (Size * endstring)) - 2});
}
eval (("s" + endstring) + j).removeMovieClip();
eval ((("s" + endstring) + j) + "fon").gotoAndStop(1);
j++;
}
}
} else if (EndTime <= 0) {
clearInterval(ending);
bigtext.removeMovieClip();
time_s.stop();
clearInterval(endinground);
stats1 = setInterval(ShowStats, 100);
} else {
EndTime = EndTime - 2;
var temp = ((100 * (EndTime * 1000)) / totaltime);
TIME.time1._x = ((temp - 100) * 270) / 100;
TimeBonus = TimeBonus + 20;
if (SoundOn) {
scores_s.start();
}
Score(20, "y");
}
updateAfterEvent();
}
function ShowStats() {
if (Add == 0) {
if (SoundOn) {
stats_s.start();
}
bl.removeMovieClip();
clearInterval(stats1);
stats.removeMovieClip();
_root.attachMovie("black", "bl", _root.getNextHighestDepth());
_root.attachMovie("statspanel", "stats", _root.getNextHighestDepth());
bl._alpha = 50;
bl._width = 520;
bl._height = 390;
stats._x = 200;
stats._y = 100;
bl.onPress = AAA;
bl.useHandCursor = false;
TextShow(stats.txt01, texttiles, "h", 0, 0, 0);
TextShow(stats.txt02, textmatches, "h", 0, 0, 0);
TextShow(stats.txt03, textchain, "h", 0, 0, 0);
TextShow(stats.txt04, texttime, "h", 0, 0, 0);
TextShow(stats.txt05, textbonus, "h", 0, 0, 0);
TextShow(stats.txt06, textscore, "h", 0, 0, 0);
TextShow(stats.txt1, String(Tiles), "h", -1, 0, 2);
TextShow(stats.txt2, String(Matches), "h", -1, 0, 2);
TextShow(stats.txt3, String(MaxChain), "h", -1, 0, 2);
TextShow(stats.txt4, String(Math.round((EEE - BeginTime) / 1000) + textseconds), "h", -1, 0, 2);
TextShow(stats.txt5, String(TimeBonus), "h", -1, 0, 2);
TextShow(stats.txt6, String(score), "h", -1, 0, 2);
}
}
function ShowNag() {
ClearRound(Matrix);
if (RoundSity == 100) {
_root.attachMovie("nag", "nag", _root.getNextHighestDepth());
} else if ((nagtime == 0) && (RoundSity == 0)) {
_root.attachMovie("endscreen", "screen", _root.getNextHighestDepth());
} else if (nagtime && ((RoundSity % nagtime) == 0)) {
RedyToPlay = false;
_root.attachMovie("nag", "nag", _root.getNextHighestDepth());
Start = setInterval(function () {
if (RedyToPlay) {
clearInterval(Start);
if (RoundSity != 0) {
InitRound();
} else {
_root.attachMovie("endscreen", "screen", _root.getNextHighestDepth());
}
}
}, 50);
} else {
InitRound();
}
}
function MoveUp(slide, chk) {
var i = FindIndexX(String(slide));
var j = FindIndexY(String(slide));
i--;
if (((Matrix[i][j] != "0") && (Matrix[i][j] != undefined)) && (Matrix[i][j].substr(0, 4) != "lock")) {
slide1 = FindName(i, j);
_root["m" + String(eval (slide))] = setInterval(MovingUp, Speed, eval (slide), eval (slide)._y, chk);
_root["m" + String(eval (slide1))] = setInterval(MovingDown, Speed, eval (slide1), eval (slide1)._y, chk);
} else {
notBlock = true;
}
}
function MoveDown(slide, chk) {
var i = FindIndexX(String(slide));
var j = FindIndexY(String(slide));
i++;
if (((Matrix[i][j] != "0") && (Matrix[i][j] != undefined)) && (Matrix[i][j].substr(0, 4) != "lock")) {
slide1 = FindName(i, j);
_root["m" + String(eval (slide))] = setInterval(MovingDown, Speed, eval (slide), eval (slide)._y, chk);
_root["m" + String(eval (slide1))] = setInterval(MovingUp, Speed, eval (slide1), eval (slide1)._y, chk);
} else {
notBlock = true;
}
}
function MoveLeft(slide, chk) {
var i = FindIndexX(String(slide));
var j = FindIndexY(String(slide));
j--;
if (((Matrix[i][j] != "0") && (Matrix[i][j] != undefined)) && (Matrix[i][j].substr(0, 4) != "lock")) {
slide1 = FindName(i, j);
_root["m" + String(eval (slide))] = setInterval(MovingLeft, Speed, eval (slide), eval (slide)._x, chk);
_root["m" + String(eval (slide1))] = setInterval(MovingRight, Speed, eval (slide1), eval (slide1)._x, chk);
} else {
notBlock = true;
}
}
function MoveRight(slide, chk) {
var i = FindIndexX(String(slide));
var j = FindIndexY(String(slide));
j++;
if (((Matrix[i][j] != "0") && (Matrix[i][j] != undefined)) && (Matrix[i][j].substr(0, 4) != "lock")) {
slide1 = FindName(i, j);
_root["m" + String(eval (slide))] = setInterval(MovingRight, Speed, eval (slide), eval (slide)._x, chk);
_root["m" + String(eval (slide1))] = setInterval(MovingLeft, Speed, eval (slide1), eval (slide1)._x, chk);
} else {
notBlock = true;
}
}
function Follow() {
this._x = _root._xmouse - 20;
this._y = _root._ymouse - 5;
Mouse.hide();
updateAfterEvent();
}
function onHammerClick() {
if ((!moveart) && (notBlock)) {
if (!hammeruse) {
hammeruse = true;
Hammer--;
hammer._alpha = 50;
notBlock = false;
Mouse.hide();
_root.attachMovie("hammer", "ham", _root.getNextHighestDepth());
ham._x = HamX;
ham._y = HamY;
ham.onMouseMove = Follow;
}
} else if (hammeruse) {
hammer._alpha = 100;
ham.removeMovieClip();
Hammer++;
hammeruse = false;
Mouse.show();
notBlock = true;
}
}
function onDiggerClick() {
if (notBlock && (!moveart)) {
notBlock = false;
if (SoundOn) {
digger_s.start();
}
Digger--;
TextShow(dign, "x" + Digger, "h", 0, 0, 0);
if (!Digger) {
digger.removeMovieClip();
dign.TEXT.removeMovieClip();
}
var i = 0;
while (i < Matrix.length) {
var j = 0;
while (j < Matrix[i].length) {
if ((Matrix[i][j].substr(1, 5) == "slice") && ((Matrix[i + 1][j].substr(0, 1) == "s") || (Matrix[i + 1][j].substr(5, 1) == "s"))) {
var Name = FindName(i + 1, j);
_root.attachMovie("lopata", "l" + Name, _root.getNextHighestDepth(), {_x:GlobalX + (j * Size), _y:GlobalY + ((i + 1) * Size)});
eval (Name).setMask("l" + Name);
Matrix[i + 1][j] = "no";
}
j++;
}
i++;
}
}
}
function onWatchClick() {
if (notBlock && (!moveart)) {
if (SoundOn) {
watch_s.start();
}
Watch--;
TextShow(watn, "x" + Watch, "h", 0, 0, 0);
if (!Watch) {
watch.removeMovieClip();
watn.TEXT.removeMovieClip();
}
var eend = EndTime;
AddingTime = 0;
eend = eend + (totaltime / 5);
if (eend > (totaltime + getTimer())) {
eend = totaltime + getTimer();
}
clearInterval(AddT);
AddT = setInterval(AddTime, 50, (eend - EndTime) / 20);
}
}
function AddTime(times) {
AddingTime++;
EndTime = EndTime + times;
Timing();
if (AddingTime == 20) {
clearInterval(AddT);
}
updateAfterEvent();
}
function onLampClick() {
function ATTACH(i, j) {
if (Matrix[i][j].substr(0, 5) == "slide") {
var temp1 = (Math.round(Math.random() * (Nomer - 1)) + 1);
var temp = ("slide" + temp1);
Matrix[i][j] = temp;
var temp3 = FindName(i, j);
eval (temp3).removeMovieClip();
_root.attachMovie(temp, temp3, _root.getNextHighestDepth(), {_width:Size, _height:Size});
var ttt = Math.round(Math.random() * 1000);
_root.attachMovie("lampb", "l" + ttt, _root.getNextHighestDepth(), {_width:Size, _height:Size});
eval (temp3)._x = GlobalX + (j * Size);
eval (temp3)._y = GlobalY + (i * Size);
InitSlide(temp3);
eval ("l" + ttt)._x = (GlobalX + (j * Size)) - 2;
eval ("l" + ttt)._y = (GlobalY + (i * Size)) - 2;
}
}
if (notBlock && (!moveart)) {
if (SoundOn) {
lamp_s.start();
}
notBlock = false;
Lamp--;
TextShow(lamn, "x" + Lamp, "h", 0, 0, 0);
if (!Lamp) {
lamp.removeMovieClip();
lamn.TEXT.removeMovieClip();
}
var i = 0;
while (i < Matrix.length) {
var j = 0;
while (j < Matrix[i].length) {
if (Matrix[i][j].substr(1, 5) == "slice") {
ATTACH(i - 1, j - 1);
ATTACH(i - 1, j + 1);
ATTACH(i + 1, j - 1);
ATTACH(i + 1, j + 1);
ATTACH(i - 1, j);
ATTACH(i, j - 1);
ATTACH(i + 1, j);
ATTACH(i, j + 1);
}
j++;
}
i++;
}
}
}
function DragSlide(x, x1, y, y1, slide) {
notBlock = false;
var _local1 = String(slide);
if ((x > (x1 + Step)) && (Math.abs(x - x1) >= Math.abs(y - y1))) {
CheckSuccess(FindIndexX(_local1), FindIndexY(_local1), FindIndexX(_local1), FindIndexY(_local1) - 1);
MoveLeft(slide);
} else if (((x + Step) < x1) && (Math.abs(x - x1) >= Math.abs(y - y1))) {
CheckSuccess(FindIndexX(_local1), FindIndexY(_local1), FindIndexX(_local1), Number(FindIndexY(_local1)) + 1);
MoveRight(slide);
} else if (((y + Step) < y1) && (Math.abs(x - x1) < Math.abs(y - y1))) {
CheckSuccess(FindIndexX(_local1), FindIndexY(_local1), Number(FindIndexX(_local1)) + 1, FindIndexY(_local1));
MoveDown(slide);
} else if ((y > (y1 + Step)) && (Math.abs(x - x1) < Math.abs(y - y1))) {
CheckSuccess(FindIndexX(_local1), FindIndexY(_local1), FindIndexX(_local1) - 1, FindIndexY(_local1));
MoveUp(slide);
} else {
notBlock = true;
}
}
function OverMove() {
if (notBlock || (hammeruse)) {
if (Blink != this) {
eval (this + "fon").gotoAndStop(2);
}
}
}
function OutMove() {
if (notBlock || (hammeruse)) {
if (Blink != this) {
eval (this + "fon").gotoAndStop(1);
}
}
}
function Press() {
if (notBlock) {
StartTimer();
if (SoundOn) {
click_s.start();
}
if (CheckClick(this)) {
eval (Blink + "fon").gotoAndStop(1);
eval (this + "fon").gotoAndStop(3);
Blink = this;
}
x = _root._xmouse;
y = _root._ymouse;
var temp = String(this);
oMouse = {};
oMouse.onMouseMove = function () {
Dragging(temp);
};
Mouse.addListener(oMouse);
value = this;
}
if (hammeruse) {
var i = FindIndexX(String(this));
var j = FindIndexY(String(this));
if ((Matrix[i][j].substr(0, 5) == "slide") || (Matrix[i][j].substr(5, 5) == "slide")) {
if (SoundOn) {
hammer_s.start();
}
Blow(i, j);
ham.removeMovieClip();
if (!Hammer) {
hammer.removeMovieClip();
hamn.TEXT.removeMovieClip();
} else {
hammer._alpha = 100;
TextShow(hamn, "x" + Hammer, "h", 0, 0, 0);
}
fall = setInterval(function () {
hammeruse = false;
Mouse.show();
var i = 0;
while (i < Matrix.length) {
var j = 0;
while (j < Matrix[0].length) {
eval ((("s" + i) + j) + "fon").gotoAndStop(1);
j++;
}
i++;
}
FallDown(Matrix);
}, 500);
}
}
}
function Dragging(str) {
var x1 = _root._xmouse;
var y1 = _root._ymouse;
if ((Math.abs(x - x1) > 10) || (Math.abs(y - y1) > 10)) {
Mouse.removeListener(oMouse);
if (notBlock) {
DragSlide(x, x1, y, y1, eval (str));
}
}
}
function Release() {
Mouse.removeListener(oMouse);
}
function FromHint() {
hints.removeMovieClip();
HH.removeMovieClip();
buttonhelp.removeMovieClip();
hints.removeMovieClip();
Mouse.removeListener(ooMouse);
StartHint();
StartTimer();
}
function GoHints(x, y) {
_root.attachMovie("hints", "hints", _root.getNextHighestDepth(), {_x:x, _y:y});
}
function Hints(hint) {
function FindSlide(slide) {
var _local2 = 0;
while (_local2 < Matrix.length) {
var _local1 = 0;
while (_local1 < Matrix[_local2].length) {
if (Matrix[_local2][_local1] == slide) {
GoHints((GlobalX + (_local1 * Size)) + 7, GlobalY + (Size * (_local2 - 1)));
break;
}
_local1++;
}
_local2++;
}
}
function ConvertText(hint) {
var _local4 = "";
var _local2 = 0;
var _local1 = 0;
while (_local1 < hint.length) {
var _local3 = hint.substr(_local1, 1);
if (_local3 == "|") {
if (_local2 > Letter) {
Letter = _local2;
}
_local2 = 0;
_local4 = _local4 + newline;
Lines++;
} else {
_local4 = _local4 + _local3;
_local2++;
}
_local1++;
}
if (_local2 > Letter) {
Letter = _local2;
}
return(_local4);
}
if (notBlock && (!moveart)) {
if (SoundOn) {
hint_s.start();
}
FromHint();
StopHint();
ooMouse = {};
ooMouse.onMouseDown = FromHint;
Mouse.addListener(ooMouse);
clearInterval(HHH);
hints.removeMovieClip();
HH.removeMovieClip();
buttonhelp.removeMovieClip();
bla.removeMovieClip();
var X = 190;
var Y = 280;
var Lines = 1;
var Letter = 1;
delete hints;
StopTimer();
_root.attachMovie("help", "hints", _root.getNextHighestDepth());
_root.createEmptyMovieClip("HH", _root.getNextHighestDepth());
HH.createTextField("hinttext", _root.getNextHighestDepth(), 0, 0, 0, 0);
_root.attachMovie("buttonhelp", "buttonhelp", _root.getNextHighestDepth());
hints._width = 330;
HH.hinttext.multiline = true;
HH.hinttext.autoSize = "left";
HH.hinttext.selectable = false;
buttonhelp.onPress = FromHint;
format = new TextFormat();
format.font = "Arial";
format.size = "12";
format.bold = true;
format.color = 12303155 /* 0xBBBB33 */;
format.align = "center";
switch (hint) {
case "begin" :
Y = (FindStop(Matrix) * Size) + GlobalY;
X = 0;
HH.hinttext.text = ConvertText(hint0);
break;
case "art" :
FindSlide("gslice1");
HH.hinttext.text = ConvertText(hint1);
break;
case "swap" :
Y = (FindStop(Matrix) * Size) + GlobalY;
X = 0;
HH.hinttext.text = ConvertText(hint2);
break;
case "art2" :
FindSlide("gslice2");
FindSlide("gslice3");
HH.hinttext.text = ConvertText(hint3);
break;
case "time" :
GoHints(240, 300);
Y = 200;
HH.hinttext.text = ConvertText(hint4);
break;
case "hammer" :
FindSlide("hammer");
HH.hinttext.text = ConvertText(hint5);
break;
case "digger" :
FindSlide("digger");
HH.hinttext.text = ConvertText(hint6);
break;
case "watch" :
FindSlide("watch");
HH.hinttext.text = ConvertText(hint7);
break;
case "lamp" :
FindSlide("lamp");
HH.hinttext.text = ConvertText(hint8);
break;
case "hammer2" :
Y = 200;
GoHints(250, 320);
HH.hinttext.text = ConvertText(hint9);
break;
case "digger2" :
Y = 200;
GoHints(320, 320);
HH.hinttext.text = ConvertText(hint10);
break;
case "watch2" :
Y = 200;
GoHints(395, 320);
HH.hinttext.text = ConvertText(hint11);
break;
case "lamp2" :
Y = 200;
GoHints(455, 320);
HH.hinttext.text = ConvertText(hint12);
}
HH.hinttext.setTextFormat(format);
hints._height = 25 + ((Lines + 1) * 15);
hints._width = 20 + ((Letter + 1) * 6);
buttonhelp._y = (Y + ((Lines + 1) * 15)) + 3;
hints._x = X;
hints._y = Y;
HH._x = X + 15;
HH._y = Y + 10;
buttonhelp._x = (X + (hints._width / 2)) - 10;
}
}
function CheckSuccess(i1, j1, i2, j2) {
if (((((Matrix[i1][j1] != undefined) && (Matrix[i1][j1] != "0")) && (Matrix[i2][j2] != "0")) && (Matrix[i2][j2] != undefined)) && (Matrix[i2][j2].substr(0.1) != "l")) {
if (SoundOn) {
var _local1 = false;
_local1 = Finding(i1, j1, i2, j2);
if (!_local1) {
_local1 = Finding(i2, j2, i1, j1);
}
if (_local1) {
yes_s.start();
} else {
no_s.start();
}
}
}
}
stop();
RedyToPlay = (redytoend = false);
fromhint = true;
MaxC = countries.length - 1;
N = 3;
Life = 3;
NextLife = 35000;
NumTail = 20;
TailPeriod = 100;
RoundSity = 0;
mmm = (Add = (RoundCountry = (score = 0)));
Hammer = (Lamp = (Digger = (Watch = 0)));
SoundOn = (hbegin = (hart = (hart2 = (htime = (hswap = (hhammer = (hhammer2 = (hwatch = (hwatch2 = (hlamp = (hlamp2 = (hdigger = (hdigger2 = true)))))))))))));
ArtX = 15;
ArtY = 30;
var Speed = 0;
Step = 5;
Size = 32;
Size1 = 29;
HamX = 249;
HamY = 349;
LamX = 448;
LamY = 348;
DigX = 320;
DigY = 348;
WatX = 390;
WatY = 348;
GameSpeed = 400;
oKey = {};
oKey.onKeyDown = function () {
if (Key.getAscii() == String("c").charCodeAt()) {
delete ArtPos;
ArtPos = new Array();
if (Key.isDown(38)) {
RoundSity = 5;
RoundCountry = 0;
EndRound();
}
if (Key.isDown(40)) {
GameOver();
}
if (Key.isDown(37)) {
Life = 0;
GameOver();
}
if (Key.isDown(39)) {
RoundSity = 8;
RoundCountry = 2;
EndRound();
}
InitArt(RoundCountry, RoundSity);
}
};
Key.addListener(oKey);
dig.useHandCursor = false;
this.attachMovie("helppanel", "help", this.getNextHighestDepth());
delete ArtPos;
ArtPos = new Array();
InitArt(RoundCountry, RoundSity);
Symbol 814 MovieClip [blow] Frame 7
stop();
this.removeMovieClip();
Symbol 835 MovieClip [endscreen] Frame 1
function ConvertText(hint) {
var _local3 = "";
var _local1 = 0;
while (_local1 < hint.length) {
var _local2 = hint.substr(_local1, 1);
if (_local2 == "|") {
_local3 = _local3 + newline;
} else {
_local3 = _local3 + _local2;
}
_local1++;
}
return(_local3);
}
function DrawArt() {
var i = 1;
while (i <= ArtPos.length) {
var Name = ((letter + "slice") + i);
var X = ArtPos[Number(Name.substr(6, 2))].x;
var Y = ArtPos[Number(Name.substr(6, 2))].y;
this.attachMovie(Name, Name, this.getNextHighestDepth());
eval (Name)._x = X + 30;
eval (Name)._y = Y + 80;
i++;
}
this.attachMovie(letter + "normal", "normal", this.getNextHighestDepth(), {_x:45, _y:110, _alpha:0});
}
function movestars() {
i = 0;
while (i < N) {
eval ("b" + i)._x = eval ("b" + i)._x + ((Math.random() * 1) - 0.5);
eval ("b" + i)._y = eval ("b" + i)._y + ((Math.random() * 1) - 0.5);
i++;
}
updateAfterEvent();
}
stop();
if (_root.SoundOn) {
_root.Art_s.start();
}
letter = "g";
if (_root.RoundCountry == 1) {
letter = "b";
} else if (_root.RoundCountry == 2) {
letter = "e";
}
N = 50;
ArtPos = _root.ArtPos;
DrawArt();
i = 0;
while (i < N) {
r = ((Math.random() * 30) + (normal._height / 2)) - 20;
w = (Math.random() * Math.PI) * 2;
x = ((r * Math.cos(w)) + 45) + (normal._width / 2);
y = ((r * Math.sin(w)) + 110) + (normal._height / 2);
this.attachMovie("movingstar", "b" + i, this.getNextHighestDepth(), {_x:x, _y:y, _alpha:100});
eval ("b" + i).gotoAndPlay(Math.round((Math.random() * 40) + 1));
i++;
}
_root.TextShow(txtt, _root.countries[_root.RoundCountry], "t", 0, 0, 0);
_root.TextShow(txt, _root.textcontinue, "b", 0, 0, 1);
format = new TextFormat();
format.font = "Arial";
format.size = "16";
format.bold = true;
format.color = 12303155 /* 0xBBBB33 */;
this.createEmptyMovieClip("H1", this.getNextHighestDepth());
H1._x = 200;
H1._y = 150;
_root.TextShow(H1, _root.artdescription[_root.RoundCountry], "b", -2, 20, 0);
clearInterval(ms);
clearInterval(ap);
clearInterval(dp);
clearInterval(aap);
clearInterval(aaap);
ap = setInterval(function () {
normal._alpha = 100;
dp = setInterval(function () {
clearInterval(dp);
normal._alpha = 0;
}, 500);
}, 1000);
aap = setInterval(function () {
clearInterval(ap);
clearInterval(aap);
normal._alpha = 0;
aaap = setInterval(function () {
normal._alpha = normal._alpha + 1;
i = 0;
while (i < N) {
eval ("b" + i)._alpha = eval ("b" + i)._alpha - 1;
i++;
}
if (normal._alpha >= 100) {
clearInterval(aaap);
}
}, 0);
}, 5000);
Instance of Symbol 833 MovieClip "button" in Symbol 835 MovieClip [endscreen] Frame 1
on (release, releaseOutside) {
this._y = this._y - 3;
_parent.txt._y = _parent.txt._y - 3;
clearInterval(_root.endscreen.ap);
clearInterval(_root.endscreen.dp);
clearInterval(_root.endscreen.aaap);
clearInterval(_root.endscreen.aap);
clearInterval(_root.endscreen.ms);
clearInterval(_parent.ap);
clearInterval(_parent.dp);
clearInterval(_parent.aaap);
clearInterval(_parent.aap);
clearInterval(_parent.ms);
_root.RoundCountry++;
delete _root.ArtPos;
_root.ArtPos = new Array();
_root.InitArt(_root.RoundCountry, _root.RoundSity);
if (_root.RoundCountry <= _root.MaxC) {
_root.InitRound();
} else {
_root.attachMovie("nag", "nag", _root.getNextHighestDepth());
}
_root.screen.removeMovieClip();
}
on (press) {
this._y = this._y + 3;
_parent.txt._y = _parent.txt._y + 3;
}
Symbol 853 MovieClip [helppanel] Frame 1
function MoveStar(i, Name) {
if (Name == "a") {
this[("tail" + i) + "slicehelp"]._x = -3000;
this[("tail" + i) + "slicehelp"].gotoAndStop(1);
} else {
this[("tail" + i) + "slicehelp"]._x = (eval (Name)._x + 10) + (Math.random() * 10);
this[("tail" + i) + "slicehelp"]._y = (eval (Name)._y + 10) + (Math.random() * 10);
this[("tail" + i) + "slicehelp"].gotoAndPlay(1);
}
}
function Init(l) {
Matrix = this["Matrix" + l];
var alpha = 0;
var i = 0;
while (i < Matrix.length) {
var j = 0;
while (j < Matrix[i].length) {
eval ((("s" + l) + i) + j)._alpha = eval ((("s" + l) + i) + j)._alpha - 1;
j++;
}
i++;
}
alpha = eval ((("s" + l) + 0) + 0)._alpha;
if (alpha <= 0) {
clearInterval(_root["doh" + l]);
var aaa = this["Init" + l];
aaa();
}
}
function Init4() {
this.attachMovie("hammer", "hammer", this.getNextHighestDepth(), {_x:320, _y:250});
this.attachMovie("digger", "digger", this.getNextHighestDepth(), {_x:360, _y:250});
this.attachMovie("watch", "watch", this.getNextHighestDepth(), {_x:400, _y:250});
this.attachMovie("lamp", "lamp", this.getNextHighestDepth(), {_x:440, _y:250});
var _local3 = 2000;
if (_root.doh4 == 0) {
_local3 = 14000;
}
if (_root.notexit) {
clearInterval(_root.doh4);
_root.doh4 = setInterval(function () {
clearInterval(_root.doh4);
b4.removeMovieClip();
}, _local3);
}
}
function MoveCursor(a, b, c, l, endx) {
if (!_root.notexit) {
clearInterval(_root["c" + l]);
}
if (eval ("cur" + l)._x == endx) {
clearInterval(_root["c" + l]);
_root["c" + l] = setInterval(MovingLeft, 0, "cur" + l, eval ("cur" + l)._x, l, "cur");
if (l == 1) {
Action1();
}
if (l == 2) {
Action2();
}
if (l == 3) {
Action3();
}
} else {
eval ("cur" + l)._x = eval ("cur" + l)._x - 1;
var x = eval ("cur" + l)._x;
eval ("cur" + l)._y = (((x * x) * a) + (b * x)) + c;
}
updateAfterEvent();
}
function Init1() {
h1 = 1;
delete Matrix1;
Matrix1 = new Array(3);
var _local4 = new Array("slide5", "slide4", "slide2", "slide3", "slide1");
Matrix1[0] = _local4;
_local4 = new Array("slide3", "slide2", "slide1", "slide5", "slide4");
Matrix1[1] = _local4;
_local4 = new Array("slide1", "slide2", "slide2", "slide4", "slide5");
Matrix1[2] = _local4;
DrawMatrix(Matrix1, X1, Y1, 1);
var _local11 = 2000;
if (_root.notexit) {
clearInterval(_root.doh1);
_root.doh1 = setInterval(function () {
clearInterval(_root.doh1);
CURSOR(1);
var _local6;
var _local9;
var _local10;
var _local2;
var _local3;
var _local4;
var _local5;
var _local8;
var _local7 = 0;
_local4 = 130;
_local7 = 75;
_local3 = 220;
_local8 = 150;
_local2 = _local3 - _local4;
_local5 = _local7;
_local6 = (((_local8 - _local5) / (_local3 - _local2)) - ((_local7 - _local5) / (_local4 - _local2))) / (_local3 - _local4);
_local9 = ((_local8 - _local5) / (_local3 - _local2)) - (_local6 * (_local3 + _local2));
_local10 = (_local5 - ((_local6 * _local2) * _local2)) - (_local9 * _local2);
_root.c1 = setInterval(MoveCursor, 0, _local6, _local9, _local10, 1, _local4);
b1.removeMovieClip();
}, _local11);
}
}
function Action1() {
if (_root.notexit) {
this["m" + FindName(0, 2, 1)] = setInterval(MovingLeft, 0, FindName(0, 2, 1), eval (FindName(0, 2, 1))._x, 1);
}
if (_root.notexit) {
this["m" + FindName(0, 1, 1)] = setInterval(MovingRight, 0, FindName(0, 1, 1), eval (FindName(0, 1, 1))._x, 1);
}
}
function Action2() {
if (_root.notexit) {
this["m" + FindName(2, 2, 2)] = setInterval(MovingRight, 0, FindName(2, 2, 2), eval (FindName(2, 2, 2))._x, 2);
}
if (_root.notexit) {
this["m" + FindName(2, 3, 2)] = setInterval(MovingLeft, 0, FindName(2, 3, 2), eval (FindName(2, 3, 2))._x, 2);
}
}
function Action3() {
if (_root.notexit) {
this["m" + FindName(2, 2, 3)] = setInterval(MovingRight, 0, FindName(2, 2, 3), eval (FindName(2, 2, 3))._x, 3);
}
if (_root.notexit) {
this["m" + FindName(2, 3, 3)] = setInterval(MovingLeft, 0, FindName(2, 3, 3), eval (FindName(2, 3, 3))._x, 3);
}
}
function Init2() {
h2 = 1;
delete Matrix2;
Matrix2 = new Array(3);
Line = new Array("slide4", "slide1", "slide4", "slide2", "slide3");
Matrix2[0] = Line;
Line = new Array("slide3", "slide3", "slide4", "slide5", "slide1");
Matrix2[1] = Line;
Line = new Array("slide4", "slide4", "slide2", "slide4", "slide1");
Matrix2[2] = Line;
DrawMatrix(Matrix2, X2, Y2, 2);
var _local9 = 2000;
if (_root.doh2 == 0) {
_local9 = 6000;
}
if (_root.notexit) {
clearInterval(_root.doh2);
_root.doh2 = setInterval(function () {
clearInterval(_root.doh2);
CURSOR(2);
var _local6;
var _local9;
var _local10;
var _local2;
var _local3;
var _local4;
var _local5;
var _local8;
var _local7 = 0;
_local4 = 415;
_local7 = 130;
_local3 = 490;
_local8 = 60;
_local2 = _local3 - _local4;
_local5 = _local7;
_local6 = (((_local8 - _local5) / (_local3 - _local2)) - ((_local7 - _local5) / (_local4 - _local2))) / (_local3 - _local4);
_local9 = ((_local8 - _local5) / (_local3 - _local2)) - (_local6 * (_local3 + _local2));
_local10 = (_local5 - ((_local6 * _local2) * _local2)) - (_local9 * _local2);
_root.c2 = setInterval(MoveCursor, 0, _local6, _local9, _local10, 2, _local4);
b2.removeMovieClip();
}, _local9);
}
}
function Init3() {
h3 = 1;
delete Matrix3;
Matrix3 = new Array(4);
Line = new Array("slide1", "slide4", "slide2", "slide4");
Matrix3[0] = Line;
Line = new Array("slide3", "slicehelp", "slide5", "slide5");
Matrix3[1] = Line;
Line = new Array("slide3", "slide3", "slide2", "slide3");
Matrix3[2] = Line;
Line = new Array("", "", "", "");
Matrix3[3] = Line;
DrawMatrix(Matrix3, X3, Y3, 3);
var _local9 = 2000;
if (_root.doh3 == 0) {
_local9 = 10000;
}
if (_root.notexit) {
clearInterval(_root.doh3);
_root.doh3 = setInterval(function () {
clearInterval(_root.doh3);
CURSOR(3);
var _local6;
var _local9;
var _local10;
var _local2;
var _local3;
var _local4;
var _local5;
var _local8;
var _local7 = 0;
_local4 = 205;
_local7 = 285;
_local3 = 240;
_local8 = 210;
_local2 = _local3 - _local4;
_local5 = _local7;
_local6 = (((_local8 - _local5) / (_local3 - _local2)) - ((_local7 - _local5) / (_local4 - _local2))) / (_local3 - _local4);
_local9 = ((_local8 - _local5) / (_local3 - _local2)) - (_local6 * (_local3 + _local2));
_local10 = (_local5 - ((_local6 * _local2) * _local2)) - (_local9 * _local2);
_root.c3 = setInterval(MoveCursor, 0, _local6, _local9, _local10, 3, _local4);
b3.removeMovieClip();
}, _local9);
}
}
function DrawMatrix(Matrix, x, y, l) {
var i = 0;
while (i < Matrix.length) {
var j = 0;
while (j < Matrix[i].length) {
eval ((("s" + l) + i) + j).removeMovieClip();
this.attachMovie(Matrix[i][j], (("s" + l) + i) + j, this.getNextHighestDepth());
eval ((("s" + l) + i) + j)._x = x + (j * Size1);
eval ((("s" + l) + i) + j)._y = y + (i * Size1);
j++;
}
i++;
}
}
function CURSOR(l) {
if (l == 1) {
this.attachMovie("cursor", "cur1", this.getNextHighestDepth(), {_x:220, _y:150});
}
if (l == 2) {
this.attachMovie("cursor", "cur2", this.getNextHighestDepth(), {_x:490, _y:60});
}
if (l == 3) {
this.attachMovie("cursor", "cur3", this.getNextHighestDepth(), {_x:240, _y:210});
}
}
function MovingLeft(slide, x, l, chk) {
var End = (x - Size);
if (eval (slide)._x > (End + 2)) {
eval (slide)._x = eval (slide)._x - 0.5;
} else {
var i = FindIndexX(slide);
var j = FindIndexY(slide);
var temp = FindName(i, j, l);
j--;
var temp1 = FindName(i, j, l);
if (chk != "cur") {
RemoveSlides(temp, temp1, l);
} else {
clearInterval(_root["c" + l]);
eval ("cur" + l).removeMovieClip();
}
}
updateAfterEvent();
}
function MovingRight(slide, x, l) {
var End = (x + Size);
if (eval (slide)._x < (End - 2)) {
eval (slide)._x = eval (slide)._x + 0.5;
} else {
var i = FindIndexX(slide);
var j = FindIndexY(slide);
var temp = FindName(i, j++, l);
var temp1 = FindName(i, j, l);
RemoveSlides(temp, temp1, l, chk);
}
updateAfterEvent();
}
function MovingDown(slide, y, l, chk) {
var End = (y + Size);
if (eval (slide)._y < (End - 2)) {
eval (slide)._y = eval (slide)._y + 1;
} else {
if (chk != "apear") {
var i = FindIndexX(slide);
var j = FindIndexY(slide);
var temp = FindName(i++, j, l);
var temp1 = FindName(i, j, l);
} else {
var temp = slide;
}
RemoveSlides(temp, temp1, l, chk);
}
updateAfterEvent();
}
function FindIndexX(name) {
var _local1 = substring(name, name.indexOf("s") + 3, 1);
return(_local1);
}
function FindIndexY(name) {
var _local1 = substring(name, name.indexOf("s") + 4, 1);
return(_local1);
}
function RemoveSlides(slide, slide1, l, chk) {
Matrix = this["Matrix" + l];
clearInterval(this["m" + slide]);
clearInterval(this["m" + slide1]);
removeMovieClip(eval (slide));
removeMovieClip(eval (slide1));
var i = FindIndexX(String(slide));
var j = FindIndexY(String(slide));
var i1 = FindIndexX(String(slide1));
var j1 = FindIndexY(String(slide1));
if (chk == "fall") {
i++;
var slide = FindName(i, j, l);
this.attachMovie(Matrix[i][j], slide, this.getNextHighestDepth());
eval (slide)._x = this["X" + l] + (j * Size);
eval (slide)._y = this["Y" + l] + (i * Size);
} else if (chk == "apear") {
i = 0;
j = slide.substr(3, 1);
var slide = FindName(i, j, l);
this.attachMovie(Matrix[i][j], slide, this.getNextHighestDepth());
eval (slide)._x = this["X" + l] + (j * Size);
eval (slide)._y = this["Y" + l] + (i * Size);
if ((l == 1) && (h1 == 2)) {
h1 = 3;
Matrix[1][1] = Matrix[0][1];
Matrix[0][1] = "slide1";
this.attachMovie(Matrix[0][1], ("sm" + l) + 1, this.getNextHighestDepth());
eval (("sm" + l) + 1)._y = Y1 - Size;
eval (("sm" + l) + 1)._x = X1 + Size;
if (_root.notexit) {
this["m" + FindName(0, 1, 1)] = setInterval(MovingDown, 0, FindName(0, 1, 1), eval (FindName(0, 1, 1))._y, 1, "fall");
}
if (_root.notexit) {
this[("msm" + l) + 1] = setInterval(MovingDown, 0, ("sm" + l) + 1, eval (("sm" + l) + 1)._y, 1, "apear");
}
} else if ((l == 1) && (h1 == 3)) {
h1 = 4;
Matrix[2][1] = Matrix[1][1];
Matrix[1][1] = Matrix[0][1];
Matrix[0][1] = "slide2";
this.attachMovie(Matrix[0][1], ("sm" + l) + 1, this.getNextHighestDepth());
eval (("sm" + l) + 1)._y = Y1 - Size;
eval (("sm" + l) + 1)._x = X1 + Size;
if (_root.notexit) {
this["m" + FindName(1, 1, 1)] = setInterval(MovingDown, 0, FindName(1, 1, 1), eval (FindName(1, 1, 1))._y, 1, "fall");
}
if (_root.notexit) {
this["m" + FindName(0, 1, 1)] = setInterval(MovingDown, 0, FindName(0, 1, 1), eval (FindName(0, 1, 1))._y, 1, "fall");
}
if (_root.notexit) {
this[("msm" + l) + 1] = setInterval(MovingDown, 0, ("sm" + l) + 1, eval (("sm" + l) + 1)._y, 1, "apear");
}
} else if ((l == 1) && (h1 == 4)) {
clearInterval(_root.doh1);
if (_root.notexit) {
_root.doh1 = setInterval(function () {
Init(1);
}, 10);
}
} else if (((l == 2) && (h2 == 2)) && (j == 2)) {
h2 = 3;
Matrix[1][j] = Matrix[0][j];
Matrix[0][j] = "slide3";
if (_root.notexit) {
this["m" + FindName(0, j, l)] = setInterval(MovingDown, 0, FindName(0, j, l), eval (FindName(0, j, l))._y, l, "fall");
}
this.attachMovie(Matrix[0][j], ("sm" + l) + j, this.getNextHighestDepth());
eval (("sm" + l) + j)._y = Y2 - Size;
eval (("sm" + l) + j)._x = X2 + (j * Size);
if (_root.notexit) {
this[("msm" + l) + j] = setInterval(MovingDown, 0, ("sm" + l) + j, eval (("sm" + l) + j)._y, l, "apear");
}
} else if (((l == 2) && (h2 == 3)) && (j == 2)) {
h2 = 4;
Matrix[2][j] = Matrix[1][j];
Matrix[1][j] = Matrix[0][j];
Matrix[0][j] = "slide1";
if (_root.notexit) {
this["m" + FindName(1, j, l)] = setInterval(MovingDown, 0, FindName(1, j, l), eval (FindName(1, j, l))._y, l, "fall");
}
if (_root.notexit) {
this["m" + FindName(0, j, l)] = setInterval(MovingDown, 0, FindName(0, j, l), eval (FindName(0, j, l))._y, l, "fall");
}
this.attachMovie(Matrix[0][j], ("sm" + l) + j, this.getNextHighestDepth());
eval (("sm" + l) + j)._y = Y2 - Size;
eval (("sm" + l) + j)._x = X2 + (j * Size);
if (_root.notexit) {
this[("msm" + l) + j] = setInterval(MovingDown, 0, ("sm" + l) + j, eval (("sm" + l) + j)._y, l, "apear");
}
} else if ((l == 2) && (h2 == 4)) {
clearInterval(_root.doh2);
if (_root.notexit) {
_root.doh2 = setInterval(function () {
Init(2);
}, 10);
}
} else if (((l == 3) && (h3 == 2)) && (j == 1)) {
h3 = 3;
Matrix[3][j] = Matrix[2][j];
Matrix[2][j] = Matrix[1][j];
Matrix[1][j] = Matrix[0][j];
Matrix[0][j] = "slide2";
if (_root.notexit) {
this["m" + FindName(2, j, l)] = setInterval(MovingDown, 0, FindName(2, j, l), eval (FindName(2, j, l))._y, l, "fall");
}
if (_root.notexit) {
this["m" + FindName(1, j, l)] = setInterval(MovingDown, 0, FindName(1, j, l), eval (FindName(1, j, l))._y, l, "fall");
}
if (_root.notexit) {
this["m" + FindName(0, j, l)] = setInterval(MovingDown, 0, FindName(0, j, l), eval (FindName(0, j, l))._y, l, "fall");
}
this.attachMovie(Matrix[0][j], ("sm" + l) + j, this.getNextHighestDepth());
eval (("sm" + l) + j)._y = Y3 - Size;
eval (("sm" + l) + j)._x = X3 + (j * Size);
if (_root.notexit) {
this[("msm" + l) + j] = setInterval(MovingDown, 0, ("sm" + l) + j, eval (("sm" + l) + j)._y, l, "apear");
}
} else if (((l == 3) && (h3 == 3)) && (j == 1)) {
h3 = 4;
var a;
var b;
var c;
var x1;
var x2;
var x3;
var y1;
var y2;
var y3 = 0;
x3 = EndX;
y3 = EndY;
x2 = eval (FindName(3, 1, 3))._x;
y2 = eval (FindName(3, 1, 3))._y;
x1 = x2 + (((50 + (Math.random() * 50)) * (x2 - x3)) / Math.abs(x3 - x2));
y1 = y2 - (((50 + (Math.random() * 50)) * (y2 - y3)) / Math.abs(y3 - y2));
a = (((y2 - y1) / (x2 - x1)) - ((y3 - y1) / (x3 - x1))) / (x2 - x3);
b = ((y2 - y1) / (x2 - x1)) - (a * (x2 + x1));
c = (y1 - ((a * x1) * x1)) - (b * x1);
if (_root.notexit) {
var i = 10;
_root.TAIL = setInterval(function () {
if ((i < 30) && _root.notexit) {
MoveStar(i, FindName(3, 1, 3));
i++;
} else {
clearInterval(_root.TAIL);
}
}, 150);
_root.doh3 = setInterval(MoveArtToPosition, 0, FindName(3, 1, 3), a, b, c);
}
}
} else {
this.attachMovie(Matrix[i1][j1], slide, this.getNextHighestDepth());
this.attachMovie(Matrix[i][j], slide1, this.getNextHighestDepth());
eval (slide)._x = this["X" + l] + (j * Size);
eval (slide)._y = this["Y" + l] + (i * Size);
eval (slide1)._x = this["X" + l] + (j1 * Size);
eval (slide1)._y = this["Y" + l] + (i1 * Size);
var newname = Matrix[i1][j1];
Matrix[i1][j1] = Matrix[i][j];
Matrix[i][j] = newname;
if ((l == 1) && (h1 == 1)) {
h1 = 2;
Blow(0, 1, 1);
Blow(1, 1, 1);
Blow(2, 1, 1);
Matrix[0][1] = "slide1";
this.attachMovie(Matrix[0][1], ("sm" + l) + 1, this.getNextHighestDepth());
eval (("sm" + l) + 1)._y = Y1 - Size;
eval (("sm" + l) + 1)._x = X1 + Size;
if (_root.notexit) {
this[("msm" + l) + 1] = setInterval(MovingDown, 0, ("sm" + l) + 1, eval (("sm" + l) + 1)._y, 1, "apear");
}
} else if ((l == 2) && (h2 == 1)) {
h2 = 2;
Blow(2, 0, 2);
Blow(2, 1, 2);
Blow(2, 2, 2);
Blow(0, 2, 2);
Blow(1, 2, 2);
j = 0;
Matrix[2][j] = Matrix[1][j];
Matrix[1][j] = Matrix[0][j];
Matrix[0][j] = "slide2";
this.attachMovie(Matrix[0][j], ("sm" + l) + j, this.getNextHighestDepth());
eval (("sm" + l) + j)._y = Y2 - Size;
eval (("sm" + l) + j)._x = X2 + (j * Size);
if (_root.notexit) {
this["m" + FindName(1, j, l)] = setInterval(MovingDown, 0, FindName(1, j, l), eval (FindName(1, j, l))._y, l, "fall");
}
if (_root.notexit) {
this["m" + FindName(0, j, l)] = setInterval(MovingDown, 0, FindName(0, j, l), eval (FindName(0, j, l))._y, l, "fall");
}
j = 1;
Matrix[2][j] = Matrix[1][j];
Matrix[1][j] = Matrix[0][j];
Matrix[0][j] = "slide3";
this.attachMovie(Matrix[0][j], ("sm" + l) + j, this.getNextHighestDepth());
eval (("sm" + l) + j)._y = Y2 - Size;
eval (("sm" + l) + j)._x = X2 + (j * Size);
if (_root.notexit) {
this["m" + FindName(1, j, l)] = setInterval(MovingDown, 0, FindName(1, j, l), eval (FindName(1, j, l))._y, l, "fall");
}
if (_root.notexit) {
this["m" + FindName(0, j, l)] = setInterval(MovingDown, 0, FindName(0, j, l), eval (FindName(0, j, l))._y, l, "fall");
}
j = 2;
Matrix[0][j] = "slide1";
this.attachMovie(Matrix[0][j], ("sm" + l) + j, this.getNextHighestDepth());
eval (("sm" + l) + j)._y = Y2 - Size;
eval (("sm" + l) + j)._x = X2 + (j * Size);
if (_root.notexit) {
this[("msm" + l) + j] = setInterval(MovingDown, 0, ("sm" + l) + j, eval (("sm" + l) + j)._y, l, "apear");
}
j--;
if (_root.notexit) {
this[("msm" + l) + j] = setInterval(MovingDown, 0, ("sm" + l) + j, eval (("sm" + l) + j)._y, l, "apear");
}
j--;
if (_root.notexit) {
this[("msm" + l) + j] = setInterval(MovingDown, 0, ("sm" + l) + j, eval (("sm" + l) + j)._y, l, "apear");
}
} else if ((l == 3) && (h3 == 1)) {
h3 = 2;
Blow(2, 0, 3);
Blow(2, 1, 3);
Blow(2, 2, 3);
j = 0;
Matrix[2][j] = Matrix[1][j];
Matrix[1][j] = Matrix[0][j];
Matrix[0][j] = "slide2";
this.attachMovie(Matrix[0][j], ("sm" + l) + j, this.getNextHighestDepth());
eval (("sm" + l) + j)._y = Y3 - Size;
eval (("sm" + l) + j)._x = X3 + (j * Size);
if (_root.notexit) {
this["m" + FindName(1, j, l)] = setInterval(MovingDown, 0, FindName(1, j, l), eval (FindName(1, j, l))._y, l, "fall");
}
if (_root.notexit) {
this["m" + FindName(0, j, l)] = setInterval(MovingDown, 0, FindName(0, j, l), eval (FindName(0, j, l))._y, l, "fall");
}
if (_root.notexit) {
this[("msm" + l) + j] = setInterval(MovingDown, 0, ("sm" + l) + j, eval (("sm" + l) + j)._y, l, "apear");
}
j = 1;
Matrix[2][j] = Matrix[1][j];
Matrix[1][j] = Matrix[0][j];
Matrix[0][j] = "slide3";
this.attachMovie(Matrix[0][j], ("sm" + l) + j, this.getNextHighestDepth());
eval (("sm" + l) + j)._y = Y3 - Size;
eval (("sm" + l) + j)._x = X3 + (j * Size);
if (_root.notexit) {
this["m" + FindName(1, j, l)] = setInterval(MovingDown, 0, FindName(1, j, l), eval (FindName(1, j, l))._y, l, "fall");
}
if (_root.notexit) {
this["m" + FindName(0, j, l)] = setInterval(MovingDown, 0, FindName(0, j, l), eval (FindName(0, j, l))._y, l, "fall");
}
if (_root.notexit) {
this[("msm" + l) + j] = setInterval(MovingDown, 0, ("sm" + l) + j, eval (("sm" + l) + j)._y, l, "apear");
}
j = 2;
Matrix[2][j] = Matrix[1][j];
Matrix[1][j] = Matrix[0][j];
Matrix[0][j] = "slide1";
this.attachMovie(Matrix[0][j], ("sm" + l) + j, this.getNextHighestDepth());
eval (("sm" + l) + j)._y = Y3 - Size;
eval (("sm" + l) + j)._x = X3 + (j * Size);
if (_root.notexit) {
this["m" + FindName(1, j, l)] = setInterval(MovingDown, 0, FindName(1, j, l), eval (FindName(1, j, l))._y, l, "fall");
}
if (_root.notexit) {
this["m" + FindName(0, j, l)] = setInterval(MovingDown, 0, FindName(0, j, l), eval (FindName(0, j, l))._y, l, "fall");
}
if (_root.notexit) {
this[("msm" + l) + j] = setInterval(MovingDown, 0, ("sm" + l) + j, eval (("sm" + l) + j)._y, l, "apear");
}
}
}
this["Matrix" + l] = Matrix;
}
function MoveArtToPosition(Name, a, b, c) {
if (!_root.notexit) {
clearInterval(_root.doh3);
}
var Done = false;
var x = eval (Name)._x;
var y = eval (Name)._y;
var l = ((x - EndX) / Math.abs(x - EndX));
eval (Name)._x = eval (Name)._x - l;
x = eval (Name)._x;
eval (Name)._y = (((a * x) * x) + (b * x)) + c;
if (x == EndX) {
Done = true;
}
if (Done) {
clearInterval(_root.TAIL);
var i = 10;
while (i < 30) {
MoveStar(i, "a");
i++;
}
clearInterval(_root.doh3);
if (_root.notexit) {
_root.doh3 = setInterval(function () {
Init(3);
}, 10);
}
}
updateAfterEvent();
}
function Blow(i, j, l) {
Matrix = this["Matrix" + l];
var Name = FindName(i, j, l);
var slide = eval (Name);
var Depth = slide.getDepth();
slide.removeMovieClip();
this.attachMovie("blow", Name + "b", Depth);
eval (Name + "b")._x = this["X" + l] + (j * Size);
eval (Name + "b")._y = this["Y" + l] + (i * Size);
Matrix[i][j] = "no";
this["Matrix" + l] = Matrix;
}
function FindName(x, y, l) {
return((("s" + l) + x) + y);
}
stop();
ok.useHandCursor = false;
var i = 10;
while (i < 30) {
this.attachMovie("tail", ("tail" + i) + "slicehelp", this.getNextHighestDepth(), {_x:-3000});
this[("tail" + i) + "slicehelp"].gotoAndStop(1);
i++;
}
_root.TextShow(txt, _root.texthelpclick, "b", -2, 0, 1);
_root.notexit = true;
EndX = 21;
EndY = 233;
X1 = (Y1 = (Y2 = 55));
X2 = 315;
Y3 = 205;
X3 = 105;
Size = 32;
Size1 = 32;
_root.TextShow(help1, _root.helping0, "h", -1, 12, 1);
_root.TextShow(help2, _root.helping1, "h", -1, 12, 1);
_root.TextShow(help3, _root.helping2, "h", -1, 12, 1);
_root.TextShow(help4, _root.helping3, "h", -1, 12, 1);
clearInterval(_root.doh1);
clearInterval(_root.doh2);
clearInterval(_root.doh3);
clearInterval(_root.doh4);
_root.doh1 = (_root.doh2 = (_root.doh3 = (_root.doh4 = 0)));
Init1();
Init2();
Init3();
Init4();
this.attachMovie("black", "b1", this.getNextHighestDepth(), {_x:10, _y:45, _width:247, _height:145, _alpha:50});
this.attachMovie("black", "b2", this.getNextHighestDepth(), {_x:265, _y:45, _width:247, _height:145, _alpha:50});
this.attachMovie("black", "b3", this.getNextHighestDepth(), {_x:10, _y:200, _width:247, _height:145, _alpha:50});
this.attachMovie("black", "b4", this.getNextHighestDepth(), {_x:265, _y:200, _width:247, _height:145, _alpha:50});
Instance of Symbol 808 MovieClip [black] in Symbol 853 MovieClip [helppanel] Frame 1
on (rollOver) {
this.useHandCursor = false;
}
Instance of Symbol 833 MovieClip in Symbol 853 MovieClip [helppanel] Frame 1
on (press) {
this._parent.txt._y = this._parent.txt._y + 3;
this._y = this._y + 3;
_root.notexit = false;
_root.help.notexit = false;
clearInterval(LLL);
LLL = setInterval(function () {
clearInterval(LLL);
_root.help.H1.removeMovieClip();
if (_root.fromhint) {
_root.fromhint = false;
_root.InitSound();
_root.InitRound();
}
_parent.removeMovieClip();
}, 1000);
}
on (release, releaseOutside) {
this._parent.txt._y = this._parent.txt._y - 3;
this._y = this._y - 3;
}
Symbol 860 MovieClip [lampb] Frame 22
stop();
_root.notBlock = true;
if (_root.FindChain(_root.Matrix) && (_root.Matrix[0][0] != undefined)) {
_root.CallFall();
}
this.removeMovieClip();
Symbol 864 MovieClip [lopata] Frame 21
stop();
Name = String(this).substr(String(this).indexOf("ls") + 1, 5);
_root[Name].removeMovieClip();
if (_root.Matrix[0][0] != undefined) {
_root.CallFall();
}
_root.notBlock = true;
this.removeMovieClip();
Instance of Symbol 833 MovieClip "b1" in Symbol 865 MovieClip [mainmenu] Frame 1
on (release, releaseOutside) {
this._y = this._y - 3;
this._parent.txt1._y = this._parent.txt1._y - 3;
}
Instance of Symbol 833 MovieClip "b2" in Symbol 865 MovieClip [mainmenu] Frame 1
on (release, releaseOutside) {
this._y = this._y - 3;
this._parent.txt2._y = this._parent.txt2._y - 3;
}
Instance of Symbol 833 MovieClip "b3" in Symbol 865 MovieClip [mainmenu] Frame 1
on (release, releaseOutside) {
this._y = this._y - 3;
this._parent.txt3._y = this._parent.txt3._y - 3;
}
Instance of Symbol 833 MovieClip "b4" in Symbol 865 MovieClip [mainmenu] Frame 1
on (release, releaseOutside) {
this._y = this._y - 3;
this._parent.txt4._y = this._parent.txt4._y - 3;
}
Instance of Symbol 833 MovieClip "b5" in Symbol 865 MovieClip [mainmenu] Frame 1
on (release, releaseOutside) {
this._y = this._y - 3;
this._parent.txt5._y = this._parent.txt5._y - 3;
}
Instance of Symbol 833 MovieClip "b6" in Symbol 865 MovieClip [mainmenu] Frame 1
on (release, releaseOutside) {
this._y = this._y - 3;
this._parent.txt6._y = this._parent.txt6._y - 3;
}
Symbol 883 MovieClip [shine1] Frame 5
this.removeMovieClip();
Instance of Symbol 833 MovieClip in Symbol 895 MovieClip [statspanel] Frame 1
on (press) {
this._y = this._y + 3;
_parent.OK._y = _parent.OK._y + 3;
clearInterval(LLL);
LLL = setInterval(function () {
clearInterval(LLL);
_root.RedyToPlay = true;
_root.bl.removeMovieClip();
_root.ShowNag();
_root.stats.removeMovieClip();
}, 300);
}
on (release, releaseOutside) {
_parent.OK._y = _parent.OK._y - 3;
this._y = this._y - 3;
}
Symbol 896 MovieClip [tail] Frame 8
var Name = String(this).substr(String(this).indexOf("il") + 4, 50);
this._x = -300;
this._x = _parent[Name]._x + (Math.random() * 20);
this._y = _parent[Name]._y + (Math.random() * 20);
Symbol 910 MovieClip [Nag] Frame 1
_root.TextShow(txt1, _root.nagdownload, "t", -3, 0, 1);
_root.TextShow(txt2, _root.nagmore, "t", -4, 0, 1);
if (_root.RoundCountry <= _root.MaxC) {
texting.attachMovie("nagtext", "text", texting.getNextHighestDepth());
_root.TextShow(txt3, _root.nagcontinue, "t", -3, 0, 1);
} else if (_root.RoundSity == 100) {
texting.attachMovie("naggameover", "text", texting.getNextHighestDepth());
_root.TextShow(txt3, _root.nagrestart, "t", -3, 0, 1);
} else {
texting.attachMovie("endtext", "text", texting.getNextHighestDepth());
_root.TextShow(txt3, _root.nagrestart, "t", -3, 0, 1);
}
Instance of Symbol 909 MovieClip "b1" in Symbol 910 MovieClip [Nag] Frame 1
on (release, releaseOutside) {
this._y = this._y - 3;
this._parent.txt1._y = this._parent.txt1._y - 3;
_root.LLL = setInterval(function () {
clearInterval(_root.LLL);
if (_root.GetVar("dload_f") == "0") {
getURL (_root.downloadlink, "_blank");
} else {
fscommand (_root.GetVar("dload_f"));
}
}, 300);
}
on (press) {
this._y = this._y + 3;
this._parent.txt1._y = this._parent.txt1._y + 3;
}
Instance of Symbol 909 MovieClip "b2" in Symbol 910 MovieClip [Nag] Frame 1
on (release, releaseOutside) {
this._y = this._y - 3;
this._parent.txt2._y = this._parent.txt2._y - 3;
_root.LLL = setInterval(function () {
clearInterval(_root.LLL);
if (_root.GetVar("dload_f") == "0") {
getURL (_root.morelink, "_blank");
} else {
fscommand (_root.GetVar("dload_f"));
}
}, 300);
}
on (press) {
this._y = this._y + 3;
this._parent.txt2._y = this._parent.txt2._y + 3;
}
Instance of Symbol 909 MovieClip "b3" in Symbol 910 MovieClip [Nag] Frame 1
on (release, releaseOutside) {
this._y = this._y - 3;
this._parent.txt3._y = this._parent.txt3._y - 3;
_root.RedyToPlay = true;
if (_root.RoundCountry == (_root.MaxC + 1)) {
_root.RoundCountry = (_root.RoundSity = 0);
_root.Life = 0;
_root.FGameOver();
}
_root.nag.removeMovieClip();
}
on (press) {
this._y = this._y + 3;
this._parent.txt3._y = this._parent.txt3._y + 3;
}
Symbol 912 MovieClip Frame 1
stop();
Symbol 914 MovieClip Frame 1
stop();
Symbol 916 MovieClip Frame 1
stop();
Symbol 918 MovieClip Frame 1
stop();
Symbol 920 MovieClip Frame 1
stop();
Symbol 922 MovieClip Frame 1
stop();
Symbol 924 MovieClip Frame 1
stop();
Symbol 926 MovieClip Frame 1
stop();
Symbol 928 MovieClip Frame 1
stop();
Symbol 930 MovieClip Frame 1
stop();
Symbol 932 MovieClip Frame 1
stop();
Symbol 934 MovieClip Frame 1
stop();
Symbol 936 MovieClip Frame 1
stop();
Symbol 938 MovieClip Frame 1
stop();
Symbol 940 MovieClip Frame 1
stop();
Symbol 942 MovieClip Frame 1
stop();
Symbol 944 MovieClip Frame 1
stop();
Symbol 946 MovieClip Frame 1
stop();
Symbol 948 MovieClip Frame 1
stop();
Symbol 951 MovieClip [movingstar] Frame 21
this._x = this._x + ((Math.random() * 40) - 20);
this._y = this._y + ((Math.random() * 40) - 20);