home *** CD-ROM | disk | FTP | other *** search
- function GetLevelInfo(lvl)
- {
- var levelinfo = new Array();
- levelinfo = blevel[lvl].split("#");
- standcount = levelinfo[0];
- stand_x = levelinfo[1];
- stand_y = levelinfo[2];
- blobcount = levelinfo[3];
- blob_x = levelinfo[4];
- blob_y = levelinfo[5];
- }
- function NextLevel(dir)
- {
- already.gotoAndStop("off");
- level += dir;
- if(levels < level)
- {
- level = 1;
- }
- if(level < 1)
- {
- level = levels;
- }
- ClearLevel();
- if(completed == levels)
- {
- gotoAndPlay(73);
- }
- else
- {
- _parent.controls.levind = level + " of " + levels;
- gotoAndPlay(5);
- }
- }
- function DisplayProgress()
- {
- if(completed == 1)
- {
- s = "";
- }
- else
- {
- s = "S";
- }
- _parent.progress = completed + " LEVEL" + s + " COMPLETED";
- }
- function SaveProgress()
- {
- _parent.progress_string = completedlevels.toString();
- fscommand("save","blobs.dat");
- }
- function LoadProgress(pstring)
- {
- if(1 < pstring.length)
- {
- completedlevels = pstring.split(",");
- j = 1;
- while(completedlevels.length >= j)
- {
- completed += Number(completedlevels[j]);
- j++;
- }
- }
- DisplayProgress();
- }
- function ClearLevel()
- {
- var x;
- var y;
- var stand;
- var i = 0;
- while(i < stand_x.length)
- {
- x = stand_x.charAt(i);
- y = stand_y.charAt(i);
- stand = "s" + x + y;
- if(this[stand].blob != "")
- {
- this[this[stand].blob].removeMovieClip();
- }
- this[stand].removeMovieClip();
- i++;
- }
- }
- function checkDrop()
- {
- var x = Number(this[cb].x);
- var y = Number(this[cb].y);
- var droptarget = this[cb]._droptarget.substr(6,3);
- var dropx = this[droptarget].x;
- var dropy = this[droptarget].y;
- var origstand = "s" + x + y;
- if(droptarget.indexOf("s") == -1 || droptarget == null || droptarget == origstand)
- {
- ReturnBlob(cb,origstand);
- return undefined;
- }
- if(this[droptarget].inhabited == 1)
- {
- ReturnBlob(cb,origstand);
- return undefined;
- }
- var dx = dropx - x;
- var dy = dropy - y;
- if(Math.abs(dx) == 2 || Math.abs(dy) == 2)
- {
- var middlex = x + dx / 2;
- var middley = y + dy / 2;
- var middlestand = "s" + middlex + middley;
- if(this[middlestand].inhabited == 1)
- {
- middleblob = this[middlestand].blob;
- this[middlestand].inhabited = 0;
- this[middlestand].blob = "";
- this[droptarget].blob = cb;
- this[droptarget].inhabited = 1;
- this[origstand].inhabited = 0;
- this[origstand].blob = "";
- this[middleblob].gotoAndPlay("die");
- this[cb].x = dropx;
- this[cb].y = dropy;
- ReturnBlob(cb,droptarget);
- blobcount--;
- if(blobcount == 1)
- {
- winLevel(droptarget);
- }
- else if(checkForMoves() == false)
- {
- ResetLevel();
- }
- }
- else
- {
- ReturnBlob(cb,origstand);
- }
- }
- else
- {
- ReturnBlob(cb,origstand);
- }
- }
- function ResetLevel()
- {
- gotoAndPlay(16);
- }
- function checkForMoves()
- {
- var j;
- var x;
- var y;
- var i;
- var k;
- var cstand;
- j = 0;
- while(j < standcount)
- {
- x = Number(stand_x.charAt(j));
- y = Number(stand_y.charAt(j));
- cstand = "s" + x + y;
- if(this[cstand].blob != "")
- {
- i = -1;
- while(1 >= i)
- {
- k = -1;
- while(1 >= k)
- {
- first = "s" + (x + k) + (y + i);
- second = "s" + (x + k + k) + (y + i + i);
- if(this[first].inhabited == 1 && this[second].inhabited == 0)
- {
- return true;
- }
- k++;
- }
- i++;
- }
- }
- j++;
- }
- return false;
- }
- function winLevel(dt)
- {
- if(completedlevels[level] != 1)
- {
- completedlevels[level] = 1;
- completed++;
- DisplayProgress();
- }
- this[cb].gotoAndPlay("win");
- this[cb].blob.gotoAndPlay("win");
- this[dt].gotoAndPlay("win");
- }
- function ReturnBlob(rb, rs)
- {
- this[rb]._x = this[rb].x * xinc + init_x;
- this[rb]._y = this[rb].y * yinc + init_y;
- this[rs].gotoAndPlay("hover");
- this[rb].gotoAndPlay("hover");
- }
- function SetUpBoard()
- {
- var i;
- var x;
- var y;
- var newname;
- var standname;
- init_x = -254;
- init_y = -180;
- xinc = 50;
- yinc = 30;
- hidepth = 201;
- i = 0;
- while(i < standcount)
- {
- x = stand_x.charAt(i);
- y = stand_y.charAt(i);
- newname = "s" + x + y;
- duplicateMovieClip("stand",newname,16384 + (i + 1));
- this[newname]._x = init_x + x * xinc;
- this[newname]._y = init_y + y * yinc;
- this[newname].inhabited = 0;
- this[newname].blob = "";
- this[newname].x = x;
- this[newname].y = y;
- i++;
- }
- i = 0;
- while(i < blobcount)
- {
- x = blob_x.charAt(i);
- y = blob_y.charAt(i);
- newname = "b" + x + y;
- standname = "s" + x + y;
- duplicateMovieClip("origblob",newname,16384 + hidepth++);
- this[newname].x = x;
- this[newname].y = y;
- this[newname]._x = init_x + x * xinc;
- this[newname]._y = init_y + y * yinc;
- this[standname].inhabited = 1;
- this[standname].blob = newname;
- this[newname].blob.eyes.gotoAndPlay(random(90) + 1);
- if(completedlevels[level])
- {
- grid.gotoAndStop(2);
- already.gotoAndPlay("on");
- }
- else
- {
- grid.gotoAndStop(1);
- }
- i++;
- }
- }
- function toggleBlobs(mode)
- {
- var i;
- var x;
- var y;
- var blobname;
- i = 0;
- while(i < blob_x.length)
- {
- x = blob_x.charAt(i);
- y = blob_y.charAt(i);
- blobname = "b" + x + y;
- if(blobname != cb)
- {
- this[blobname].gotoAndStop(mode);
- }
- i++;
- }
- }
- function EasterEgg()
- {
- blevel[5] = "35#56756756756756723567235672345673456#11122233344455566666777778888889999#0###";
- blevel[6] = "40#3456345673456734673456345673467345673456#1111222223333344445555666667777888889999#0###";
- blevel[7] = "35#34567345674564564564564563456734567#11111222223334445556667778888899999#0###";
- blevel[8] = "37#3456345673456734673463456346734673467#1111222223333344445556666777788889999#0###";
- blevel[9] = "38#34563456734673467346734673467345673456#11112222233334444555566667777888889999#0###";
- }
- blevel = new Array();
- blevel[1] = "13#4645645645646#3344455566677#8#44564564#34445557#";
- blevel[2] = "16#4545674567456767#3344445555666677#10#4557675767#3344556677#";
- blevel[3] = "13#5456345674565#3444555556667#11#54563467465#34445555667#";
- blevel[4] = "32#12893752345673456783456785371289#11112234444445555556666667889999#8#34346767#44555566#";
- blevel[5] = "41#19245684562345678234567823456784562456819#11222223334444444555555566666667778888899#11#45645645646#22233344455#";
- blevel[6] = "33#456456234567823456782345678456456#222333444444455555556666666777888#10#4545344545#3344556677#";
- blevel[7] = "33#456456234567823456782345678456456#222333444444455555556666666777888#12#545634674565#344455556667#";
- blevel[8] = "33#456456234567823456782345678456456#222333444444455555556666666777888#14#54563572357828#23334445555566#";
- blevel[9] = "41#13579134567934567134567934567134567913579#11111333333344444555555566666777777799999#11#34344566767#33445556677#";
- blevel[10] = "33#456456234567823456782345678456456#222333444444455555556666666777888#16#4454564567456454#2334445555666778#";
- blevel[11] = "41#19245684562345678234567823456784562456819#11222223334444444555555566666667778888899#17#43478234567834784#34444555555566667#";
- blevel[12] = "45#128145689456234567823456782345678456124569289#111222222333444444455555556666666777888888999#21#463456723456783456746#334444455555556666677#";
- blevel[13] = "49#1289124568945623456782345678234567845612456891289#1111222222233344444445555555666666677788888889999#24#456456235734673578456456#222333444455556666777888#";
- blevel[14] = "45#128914569456234567823456782345678456145691289#111122222333444444455555556666666777888889999#24#545634567234678345674565#233344444555555666667778#";
- blevel[15] = "46#1934567345672345678234567823456783456783456719#1122222333334444444555555566666667777778888899#18#353562356734567467#223345566677777888#";
- blevel[16] = "45#137924568456234567823456782345678456245681379#111122222333444444455555556666666777888889999#18#523578234678235785#344444555555666667#";
- blevel[17] = "37#9245645623456782345678234567845645681#1222233344444445555555666666677788889#25#4564562378234567823784565#2223334444555555566667778#";
- blevel[18] = "47#12891456934567234567812346789235783467145691289#11112222233333444444455555555666667777888889999#12#651346793575#345555556668#";
- blevel[19] = "45#281245689456234567823456782345678456124568928#112222222333444444455555556666666777888888899#16#4564565475456456#2223334556777888#";
- blevel[20] = "45#128145689456234567823456782345678456124569289#111222222333444444455555556666666777888888999#26#45645623572345672357456456#22233344445555556666777888#";
- blevel[21] = "41#19245684562345678234567823456784562456819#11222223334444444555555566666667778888899#27#456456345678567825678456456#222333444444555566666777888#";
- blevel[22] = "45#128924568456234567823456782345678456245681289#111122222333444444455555556666666777888889999#16#5453782467378455#2334445555666778#";
- blevel[23] = "45#193572345678234567813456792345678234567835719#112223333333444444455555556666666777777788899#18#546734636734567345#233344455566666777#";
- blevel[24] = "41#19245684562345678234567823456784562456819#11222223334444444555555566666667778888899#32#45645623456782346782345678456456#22233344444445555556666666777888#";
- blevel[25] = "28#1233489345678934567893489123#2223333444444455555556666777#14#12495685684912#22334445556677#";
- blevel[26] = "45#281245689456234567823456782345678456124568928#112222222333444444455555556666666777888888899#32#45645623456782345782345678456456#22233344444445555556666666777888#";
- blevel[27] = "49#1289145693456723456782345678234567834567145691289#1111222223333344444445555555666666677777888889999#35#45635672345678234678234567834567456#22233334444444555555666666677777888#";
- blevel[28] = "37#1945645623456782345678234567845645619#1122233344444445555555666666677788899#32#45645623456782345678234567846456#22233344444445555555666666677888#";
- blevel[29] = "49#2345678234567823456782345678234567823456782345678#2222222333333344444445555555666666677777778888888#40#3456234567823456782346723572345678235678#2222333333344444445555566667777777888888#";
- blevel[30] = "41#19145694562345678234567823456784564561289#11222223334444444555555566666667778889999#32#46456234567823456782345678456456#22333444444455555556666666777888#";
- blevel[31] = "45#456456456123456789123456789123456789456456456#111222333444444444555555555666666666777888999#44#45645645612345678912345678912356789456456456#11122233344444444455555555566666666777888999#";
- blevel[32] = "37#1945645623456782345678234567845645619#1122233344444445555555666666677788899#32#45645623457823456782345678456456#22233344444455555556666666777888#";
- blevel[33] = "45#128945634567234567823456782345678345674561289#111122233333444444455555556666666777778889999#35#45634567234567823478234567834567456#22233333444444455555666666677777888#";
- blevel[34] = "49#1289124568945623456782345678234567845612456891289#1111222222233344444445555555666666677788888889999#32#45645623456782345678245678456456#22233344444445555555666666777888#";
- blevel[35] = "48#234678113456781345678345678134567813456781345678#111111233333334444444555555666666677777778888888#35#34567834567834578345678345678345678#33333344444455555666666777777888888#";
- blevel[36] = "45#191245689456234567823456782345678456124568919#112222222333444444455555556666666777888888899#32#45645623456723456782345678456456#22233344444455555556666666777888#";
- blevel[37] = "57#123489135678123456781234568134568356781234589234681234679#111111222222333333334444444555555666667777777888889999999#37#1241357813458123458346835678242348234#1112222233333444444555566666778888999#";
- blevel[38] = "49#1289124568945623456782345678234567845612456891289#1111222222233344444445555555666666677788888889999#31#4564562345678234567823456784545#2223334444444555555566666667788#";
- blevel[39] = "45#191456934567234567823456782345678345671456919#112222233333444444455555556666666777778888899#35#45634567234567823467823456783456745#22233333444444455555566666667777788#";
- blevel[40] = "41#12456894562345678234567823456784561245689#22222223334444444555555566666667778888888#31#4564562345672345672345678456456#2223334444445555556666666777888#";
- levels = blevel.length - 1;
- _parent.controls.levind = level + " of " + levels;
- j = 0;
- while(levels >= j)
- {
- completedlevels[j] = 0;
- j++;
- }
-