Frame 1
function LoadingFunction() {
kBytesLoaded = this._parent.siteLoader.getBytesLoaded();
kBytesTotal = this._parent.siteLoader.getBytesTotal();
if (kBytesLoaded >= kBytesTotal) {
if (WallTime <= 0) {
attachMovie("Play", "Play", 1);
_root.Play._x = 213;
_root.Play._y = 155;
LoadingText = "";
_root.Play.onPress = function () {
WallTime = 3;
attachMovie("Wall", "LowerWall", 11001);
_root.LowerWall.gotoAndStop(1);
_root.LowerWall._x = 0;
_root.LowerWall._y = 363;
attachMovie("Wall", "UpperWall", 11000);
_root.UpperWall._rotation = 180;
_root.UpperWall.gotoAndStop(1);
_root.UpperWall._x = 499;
_root.UpperWall._y = 0;
this._x = -50;
removeMovieClip("Play");
PieceClick = new Sound();
PieceClick.setVolume(200);
PieceClick.attachSound("PieceClick");
mySound = new Sound();
mySound.setVolume(200);
mySound.attachSound("Music");
mySound.start(0, 999);
};
}
if (WallTime > 0) {
if (WallTime < 14) {
_root.UpperWall._y = _root.UpperWall._y + WallTime;
_root.LowerWall._y = _root.LowerWall._y - WallTime;
WallTime = WallTime + 0.5;
} else {
NewGame = false;
Opening = true;
gotoAndStop (2);
}
}
}
}
stop();
Instance of Symbol 94 MovieClip in Frame 1
onClipEvent (enterFrame) {
_root.LoadingFunction();
}
Frame 2
function initMenu() {
WallTime = 0;
}
function OpenWall() {
if ((WallTime < 14) & (Opening == true)) {
_root.UpperWall._y = _root.UpperWall._y - WallTime;
_root.LowerWall._y = _root.LowerWall._y + WallTime;
WallTime = WallTime + 0.5;
} else {
Opening = false;
if (WallTime < 14) {
_root.UpperWall._y = _root.UpperWall._y + WallTime;
_root.LowerWall._y = _root.LowerWall._y - WallTime;
WallTime = WallTime + 0.5;
} else if (NewGame == true) {
gotoAndStop (3);
}
}
}
stop();
Instance of Symbol 94 MovieClip in Frame 2
onClipEvent (enterFrame) {
_root.OpenWall();
}
onClipEvent (load) {
_root.initMenu();
}
Frame 3
function initGame() {
Level = 1;
FirstGame = true;
GameMade = false;
Score = 0;
}
function UpdateGame() {
if (GameMade == false) {
I = 0;
if (FirstGame == true) {
xp = 0;
while (xp < 7) {
I = I + 1;
attachMovie("Pipes", "StartingPipesx" + xp, 500 - I);
if (xp == 0) {
_root["StartingPipesx" + xp].gotoAndStop(15);
} else {
_root["StartingPipesx" + xp].gotoAndStop(13);
}
_root["StartingPipesx" + xp]._x = 127 + (xp * 51);
_root["StartingPipesx" + xp]._y = 4;
xp++;
}
attachMovie("Storage", "StorageLower", 500 - I);
_root.StorageLower.gotoAndStop(1);
_root.StorageLower._x = 432;
_root.StorageLower._y = 4;
attachMovie("Storage", "StorageUpper", 6000);
_root.StorageUpper.gotoAndStop(2);
_root.StorageUpper._x = 432;
_root.StorageUpper._y = 4;
FirstGame = false;
SlimeBalls = new Array(64);
NextSlimeBall = 0;
i = 0;
while (i < 64) {
attachMovie("Slime Ball", "SlimeBall" + i, 3000 + i);
_root["SlimeBall" + i].gotoAndStop(1);
_root["SlimeBall" + i]._alpha = 0;
SlimeBalls[i] = new Array(2);
SlimeBalls[i][0] = 0;
SlimeBalls[i][1] = 0;
i++;
}
attachMovie("Storage Slime", "AnimatedSlime", 4000);
_root.AnimatedSlime.gotoAndPlay(1);
_root.AnimatedSlime._alpha = 0;
_root.AnimatedSlime._x = 449;
_root.AnimatedSlime._y = 282;
attachMovie("Storage Flat Slime", "LowerFlatSlime", 4001);
_root.LowerFlatSlime.gotoAndStop(2);
_root.LowerFlatSlime._alpha = 0;
_root.LowerFlatSlime._x = 449;
_root.LowerFlatSlime._y = 290;
_root.LowerFlatSlime._yscale = 0;
attachMovie("Storage Flat Slime", "UpperFlatSlime", 4002);
_root.UpperFlatSlime.gotoAndStop(1);
_root.UpperFlatSlime._alpha = 80;
_root.UpperFlatSlime._x = 449;
_root.UpperFlatSlime._y = 73;
_root.UpperFlatSlime._yscale = 100;
attachMovie("Storage Block", "StorageBlock", 4003);
_root.StorageBlock.gotoAndStop(1);
_root.StorageBlock._x = 448;
_root.StorageBlock._y = 282;
attachMovie("RedStripe", "RedStripe", 4004);
_root.RedStripe.gotoAndStop(1);
_root.RedStripe._x = 449;
attachMovie("PartStorage", "PartStorage", 3500);
_root.PartStorage.gotoAndStop(1);
_root.PartStorage._alpha = 70;
_root.PartStorage._x = 6;
_root.PartStorage._y = 6;
attachMovie("Background", "Background", 1);
_root.Background._alpha = 100;
_root.Background.gotoAndStop(1);
attachMovie("Timer", "Timer", 10500);
_root.Timer._alpha = 70;
_root.Timer.gotoAndStop(1);
_root.Timer._x = 379;
_root.Timer._y = 4;
_root.Timer.onPress = function () {
TimeUntilStart = 0;
};
Format = new TextFormat();
Format.font = "Tahoma";
Format.bullet = false;
Format.bold = true;
Format.align = "center";
_root.createTextField("Level1", 10503, 5, 5, 120, 50);
Level1.border = false;
Level1._alpha = 70;
Level1.setTextFormat(Format);
Level1.selectable = false;
_root.createTextField("Level2", 10504, 6, 6, 120, 50);
Level2.border = false;
Level2._alpha = 70;
Level2.setTextFormat(Format);
Level2.selectable = false;
_root.createTextField("TimeUntilStart1", 10501, 377, 0, 120, 50);
TimeUntilStart1.border = false;
TimeUntilStart1.setTextFormat(Format);
TimeUntilStart1.selectable = false;
_root.createTextField("TimeUntilStart2", 10502, 378, 1, 120, 50);
TimeUntilStart2.border = false;
TimeUntilStart2.setTextFormat(Format);
TimeUntilStart2.selectable = false;
_root.createTextField("Status1", 11004, 0, 150, 499, 50);
Status1.border = false;
Status1.setTextFormat(Format);
Status1.selectable = false;
_root.createTextField("Status2", 11005, 0, 150, 499, 50);
Status2.border = false;
Status2.setTextFormat(Format);
Status2.selectable = false;
}
if (Level == 1) {
TimeUntilStart = 150;
FluidInTank = 100;
NeededForVictory = 25;
FirstPieceX = 0;
FirstPieceY = 2;
LastPieceX = 3;
LastPieceY = 5;
Buildup = new Array(6);
Buildup[0] = "O _ _ _ _ _";
Buildup[1] = "O _ _ _ _ _";
Buildup[2] = "O _ _ _ _ _";
Buildup[3] = "J D L _ _ _";
Buildup[4] = "K A M _ _ _";
Buildup[5] = "J D D N N N";
Pieces = new Array(1);
Pieces[0] = "D";
}
if (Level == 2) {
TimeUntilStart = 200;
FluidInTank = 100;
NeededForVictory = 25;
FirstPieceX = 0;
FirstPieceY = 2;
LastPieceX = 3;
LastPieceY = 5;
Buildup = new Array(6);
Buildup[0] = "O _ _ _ _ _";
Buildup[1] = "O _ _ _ _ _";
Buildup[2] = "O _ _ _ _ _";
Buildup[3] = "E A L _ _ _";
Buildup[4] = "C A C _ _ _";
Buildup[5] = "J A H N N N";
Pieces = new Array(4);
Pieces[0] = "H";
Pieces[1] = "F";
Pieces[2] = "P";
Pieces[3] = "I";
}
if (Level == 3) {
TimeUntilStart = 250;
FluidInTank = 100;
NeededForVictory = 25;
FirstPieceX = 0;
FirstPieceY = 2;
LastPieceX = 3;
LastPieceY = 5;
Buildup = new Array(6);
Buildup[0] = "O _ _ _ _ _";
Buildup[1] = "O _ _ _ _ _";
Buildup[2] = "O _ _ _ _ _";
Buildup[3] = "C A A _ _ _";
Buildup[4] = "C C C _ _ _";
Buildup[5] = "A A J N N N";
Pieces = new Array(6);
Pieces[0] = "J";
Pieces[1] = "K";
Pieces[2] = "L";
Pieces[3] = "M";
Pieces[4] = "C";
Pieces[5] = "D";
}
if (Level == 4) {
TimeUntilStart = 350;
FluidInTank = 100;
NeededForVictory = 25;
FirstPieceX = 0;
FirstPieceY = 2;
LastPieceX = 3;
LastPieceY = 5;
Buildup = new Array(6);
Buildup[0] = "O _ _ _ _ _";
Buildup[1] = "O _ _ _ _ _";
Buildup[2] = "O _ _ _ _ _";
Buildup[3] = "E A L _ _ _";
Buildup[4] = "A A A _ _ _";
Buildup[5] = "J A D N N N";
Pieces = new Array(8);
Pieces[0] = "C";
Pieces[1] = "H";
Pieces[2] = "M";
Pieces[3] = "K";
Pieces[4] = "D";
Pieces[5] = "I";
Pieces[6] = "P";
Pieces[7] = "C";
}
if (Level == 5) {
TimeUntilStart = 400;
FluidInTank = 100;
NeededForVictory = 25;
FirstPieceX = 0;
FirstPieceY = 2;
LastPieceX = 3;
LastPieceY = 5;
Buildup = new Array(6);
Buildup[0] = "O _ _ _ _ _";
Buildup[1] = "O _ _ _ _ _";
Buildup[2] = "O _ _ _ _ _";
Buildup[3] = "C A A _ _ _";
Buildup[4] = "E A A _ _ _";
Buildup[5] = "A A J N N N";
Pieces = new Array(10);
Pieces[0] = "J";
Pieces[1] = "K";
Pieces[2] = "L";
Pieces[3] = "I";
Pieces[4] = "M";
Pieces[5] = "G";
Pieces[6] = "E";
Pieces[7] = "F";
Pieces[8] = "C";
Pieces[9] = "P";
}
if (Level == 6) {
TimeUntilStart = 450;
FluidInTank = 200;
NeededForVictory = 75;
FirstPieceX = 0;
FirstPieceY = 1;
LastPieceX = 4;
LastPieceY = 5;
Buildup = new Array(6);
Buildup[0] = "O _ _ _ _ _";
Buildup[1] = "O _ _ _ _ _";
Buildup[2] = "E L A A _ _";
Buildup[3] = "A I A A _ _";
Buildup[4] = "A A I A _ _";
Buildup[5] = "A A J H N N";
Pieces = new Array(11);
Pieces[0] = "L";
Pieces[1] = "J";
Pieces[2] = "F";
Pieces[3] = "I";
Pieces[4] = "P";
Pieces[5] = "P";
Pieces[6] = "P";
Pieces[7] = "C";
Pieces[8] = "D";
Pieces[9] = "K";
Pieces[10] = "M";
}
if (Level == 7) {
TimeUntilStart = 700;
FluidInTank = 200;
NeededForVictory = 75;
FirstPieceX = 0;
FirstPieceY = 1;
LastPieceX = 4;
LastPieceY = 5;
Buildup = new Array(6);
Buildup[0] = "O _ _ _ _ _";
Buildup[1] = "O _ _ _ _ _";
Buildup[2] = "E A A B _ _";
Buildup[3] = "E A A L _ _";
Buildup[4] = "C A A C _ _";
Buildup[5] = "J A A H N N";
Pieces = new Array(10);
Pieces[0] = "I";
Pieces[1] = "C";
Pieces[2] = "H";
Pieces[3] = "F";
Pieces[4] = "L";
Pieces[5] = "H";
Pieces[6] = "D";
Pieces[7] = "I";
Pieces[8] = "P";
Pieces[9] = "F";
}
if (Level == 8) {
TimeUntilStart = 700;
FluidInTank = 200;
NeededForVictory = 75;
FirstPieceX = 0;
FirstPieceY = 1;
LastPieceX = 4;
LastPieceY = 5;
Buildup = new Array(6);
Buildup[0] = "O _ _ _ _ _";
Buildup[1] = "O _ _ _ _ _";
Buildup[2] = "J D D A _ _";
Buildup[3] = "A A A A _ _";
Buildup[4] = "A A A A _ _";
Buildup[5] = "A D D D N N";
Pieces = new Array(12);
Pieces[0] = "F";
Pieces[1] = "H";
Pieces[2] = "J";
Pieces[3] = "M";
Pieces[4] = "M";
Pieces[5] = "L";
Pieces[6] = "K";
Pieces[7] = "N";
Pieces[8] = "J";
Pieces[9] = "M";
Pieces[10] = "P";
Pieces[11] = "K";
}
if (Level == 9) {
TimeUntilStart = 800;
FluidInTank = 200;
NeededForVictory = 75;
FirstPieceX = 0;
FirstPieceY = 1;
LastPieceX = 4;
LastPieceY = 5;
Buildup = new Array(6);
Buildup[0] = "O _ _ _ _ _";
Buildup[1] = "O _ _ _ _ _";
Buildup[2] = "C A A A _ _";
Buildup[3] = "J A A A _ _";
Buildup[4] = "A A A A _ _";
Buildup[5] = "A A J D N N";
Pieces = new Array(10);
Pieces[0] = "M";
Pieces[1] = "K";
Pieces[2] = "K";
Pieces[3] = "M";
Pieces[4] = "C";
Pieces[5] = "D";
Pieces[6] = "L";
Pieces[7] = "P";
Pieces[8] = "C";
Pieces[9] = "D";
}
if (Level == 10) {
TimeUntilStart = 800;
FluidInTank = 200;
NeededForVictory = 75;
FirstPieceX = 0;
FirstPieceY = 1;
LastPieceX = 4;
LastPieceY = 5;
Buildup = new Array(6);
Buildup[0] = "O _ _ _ _ _";
Buildup[1] = "O _ _ _ _ _";
Buildup[2] = "C A A P _ _";
Buildup[3] = "A A A A _ _";
Buildup[4] = "A A A A _ _";
Buildup[5] = "P A A D N N";
Pieces = new Array(14);
Pieces[0] = "F";
Pieces[1] = "G";
Pieces[2] = "J";
Pieces[3] = "K";
Pieces[4] = "K";
Pieces[5] = "M";
Pieces[6] = "J";
Pieces[7] = "C";
Pieces[8] = "I";
Pieces[9] = "M";
Pieces[10] = "P";
Pieces[11] = "J";
Pieces[12] = "I";
Pieces[13] = "H";
}
if (Level == 11) {
TimeUntilStart = 700;
FluidInTank = 300;
NeededForVictory = 150;
FirstPieceX = 0;
FirstPieceY = 0;
LastPieceX = 5;
LastPieceY = 5;
Buildup = new Array(6);
Buildup[0] = "O _ _ _ _ _";
Buildup[1] = "C A A B B _";
Buildup[2] = "A A C B B _";
Buildup[3] = "A D I D A _";
Buildup[4] = "B B C A A _";
Buildup[5] = "B B A A J N";
Pieces = new Array(14);
Pieces[0] = "E";
Pieces[1] = "G";
Pieces[2] = "J";
Pieces[3] = "K";
Pieces[4] = "L";
Pieces[5] = "M";
Pieces[6] = "J";
Pieces[7] = "K";
Pieces[8] = "L";
Pieces[9] = "M";
Pieces[10] = "I";
Pieces[11] = "P";
Pieces[12] = "H";
Pieces[13] = "D";
}
if (Level == 12) {
TimeUntilStart = 1000;
FluidInTank = 300;
NeededForVictory = 150;
FirstPieceX = 0;
FirstPieceY = 0;
LastPieceX = 5;
LastPieceY = 5;
Buildup = new Array(6);
Buildup[0] = "O _ _ _ _ _";
Buildup[1] = "C A A D A _";
Buildup[2] = "A B A B A _";
Buildup[3] = "A A A A A _";
Buildup[4] = "A B A B A _";
Buildup[5] = "A D A A J N";
Pieces = new Array(20);
Pieces[0] = "I";
Pieces[1] = "E";
Pieces[2] = "G";
Pieces[3] = "C";
Pieces[4] = "C";
Pieces[5] = "C";
Pieces[6] = "P";
Pieces[7] = "P";
Pieces[8] = "J";
Pieces[9] = "K";
Pieces[10] = "L";
Pieces[11] = "M";
Pieces[12] = "C";
Pieces[13] = "C";
Pieces[14] = "C";
Pieces[15] = "C";
Pieces[16] = "K";
Pieces[17] = "L";
Pieces[18] = "H";
Pieces[19] = "F";
}
if (Level == 13) {
TimeUntilStart = 1000;
FluidInTank = 300;
NeededForVictory = 150;
FirstPieceX = 0;
FirstPieceY = 0;
LastPieceX = 5;
LastPieceY = 5;
Buildup = new Array(6);
Buildup[0] = "O _ _ _ _ _";
Buildup[1] = "C B P B B _";
Buildup[2] = "J A A A A _";
Buildup[3] = "A A A A A _";
Buildup[4] = "A A A A L _";
Buildup[5] = "B B P B J N";
Pieces = new Array(15);
Pieces[0] = "D";
Pieces[1] = "D";
Pieces[2] = "M";
Pieces[3] = "F";
Pieces[4] = "H";
Pieces[5] = "J";
Pieces[6] = "L";
Pieces[7] = "F";
Pieces[8] = "H";
Pieces[9] = "P";
Pieces[10] = "P";
Pieces[11] = "J";
Pieces[12] = "D";
Pieces[13] = "P";
Pieces[14] = "D";
}
if (Level == 14) {
TimeUntilStart = 1000;
FluidInTank = 300;
NeededForVictory = 150;
FirstPieceX = 0;
FirstPieceY = 0;
LastPieceX = 5;
LastPieceY = 5;
Buildup = new Array(6);
Buildup[0] = "O _ _ _ _ _";
Buildup[1] = "E D F D L _";
Buildup[2] = "A A A A A _";
Buildup[3] = "A A A A A _";
Buildup[4] = "A A A A A _";
Buildup[5] = "J D H D H N";
Pieces = new Array(18);
Pieces[0] = "C";
Pieces[1] = "C";
Pieces[2] = "C";
Pieces[3] = "K";
Pieces[4] = "M";
Pieces[5] = "K";
Pieces[6] = "M";
Pieces[7] = "I";
Pieces[8] = "E";
Pieces[9] = "G";
Pieces[10] = "C";
Pieces[11] = "C";
Pieces[12] = "C";
Pieces[13] = "H";
Pieces[14] = "J";
Pieces[15] = "M";
Pieces[16] = "D";
Pieces[17] = "I";
}
if (Level == 15) {
TimeUntilStart = 1000;
FluidInTank = 300;
NeededForVictory = 150;
FirstPieceX = 0;
FirstPieceY = 0;
LastPieceX = 5;
LastPieceY = 5;
Buildup = new Array(6);
Buildup[0] = "O _ _ _ _ _";
Buildup[1] = "C A A A A _";
Buildup[2] = "A I A I A _";
Buildup[3] = "A A I A A _";
Buildup[4] = "A I A I A _";
Buildup[5] = "A A A A J N";
Pieces = new Array(13);
Pieces[0] = "I";
Pieces[1] = "E";
Pieces[2] = "L";
Pieces[3] = "L";
Pieces[4] = "H";
Pieces[5] = "P";
Pieces[6] = "P";
Pieces[7] = "P";
Pieces[8] = "P";
Pieces[9] = "H";
Pieces[10] = "F";
Pieces[11] = "J";
Pieces[12] = "P";
}
if (Level == 16) {
TimeUntilStart = 900;
FluidInTank = 400;
NeededForVictory = 250;
FirstPieceX = 0;
FirstPieceY = -1;
LastPieceX = 6;
LastPieceY = 5;
Buildup = new Array(6);
Buildup[0] = "J D A L A A";
Buildup[1] = "K L B C A A";
Buildup[2] = "C C A C C C";
Buildup[3] = "A J A M A C";
Buildup[4] = "C B A B C C";
Buildup[5] = "J D A A M J";
Pieces = new Array(16);
Pieces[0] = "P";
Pieces[1] = "I";
Pieces[2] = "P";
Pieces[3] = "H";
Pieces[4] = "P";
Pieces[5] = "P";
Pieces[6] = "E";
Pieces[7] = "G";
Pieces[8] = "C";
Pieces[9] = "C";
Pieces[10] = "D";
Pieces[11] = "D";
Pieces[12] = "I";
Pieces[13] = "E";
Pieces[14] = "J";
Pieces[15] = "P";
}
if (Level == 17) {
TimeUntilStart = 1200;
FluidInTank = 400;
NeededForVictory = 250;
FirstPieceX = 0;
FirstPieceY = -1;
LastPieceX = 6;
LastPieceY = 5;
Buildup = new Array(6);
Buildup[0] = "E D D D D L";
Buildup[1] = "A A L K A A";
Buildup[2] = "A A C C A A";
Buildup[3] = "A A C C A A";
Buildup[4] = "A A M J A A";
Buildup[5] = "J D D D D H";
Pieces = new Array(17);
Pieces[0] = "J";
Pieces[1] = "K";
Pieces[2] = "L";
Pieces[3] = "M";
Pieces[4] = "F";
Pieces[5] = "F";
Pieces[6] = "C";
Pieces[7] = "C";
Pieces[8] = "H";
Pieces[9] = "H";
Pieces[10] = "P";
Pieces[11] = "P";
Pieces[12] = "J";
Pieces[13] = "K";
Pieces[14] = "M";
Pieces[15] = "H";
Pieces[16] = "C";
}
if (Level == 18) {
TimeUntilStart = 1800;
FluidInTank = 400;
NeededForVictory = 250;
FirstPieceX = 0;
FirstPieceY = -1;
LastPieceX = 6;
LastPieceY = 5;
Buildup = new Array(6);
Buildup[0] = "J A K D A A";
Buildup[1] = "A A C B A A";
Buildup[2] = "C J A A B C";
Buildup[3] = "C B A A L C";
Buildup[4] = "A A B C A A";
Buildup[5] = "A A D M A D";
Pieces = new Array(22);
Pieces[0] = "E";
Pieces[1] = "E";
Pieces[2] = "L";
Pieces[3] = "J";
Pieces[4] = "G";
Pieces[5] = "D";
Pieces[6] = "P";
Pieces[7] = "L";
Pieces[8] = "J";
Pieces[9] = "C";
Pieces[10] = "F";
Pieces[11] = "P";
Pieces[12] = "M";
Pieces[13] = "K";
Pieces[14] = "J";
Pieces[15] = "F";
Pieces[16] = "G";
Pieces[17] = "E";
Pieces[18] = "F";
Pieces[19] = "C";
Pieces[20] = "L";
Pieces[21] = "P";
}
if (Level == 19) {
TimeUntilStart = 1400;
FluidInTank = 400;
NeededForVictory = 250;
FirstPieceX = 0;
FirstPieceY = -1;
LastPieceX = 6;
LastPieceY = 5;
Buildup = new Array(6);
Buildup[0] = "C A A A A A";
Buildup[1] = "A A A A A A";
Buildup[2] = "A A A A A A";
Buildup[3] = "A A A A A A";
Buildup[4] = "A A A A A A";
Buildup[5] = "A A A A A D";
Pieces = new Array(24);
Pieces[0] = "J";
Pieces[1] = "K";
Pieces[2] = "L";
Pieces[3] = "M";
Pieces[4] = "J";
Pieces[5] = "K";
Pieces[6] = "L";
Pieces[7] = "M";
Pieces[8] = "I";
Pieces[9] = "I";
Pieces[10] = "E";
Pieces[11] = "F";
Pieces[12] = "G";
Pieces[13] = "H";
Pieces[14] = "E";
Pieces[15] = "F";
Pieces[16] = "G";
Pieces[17] = "H";
Pieces[18] = "P";
Pieces[19] = "P";
Pieces[20] = "D";
Pieces[21] = "P";
Pieces[22] = "P";
Pieces[23] = "P";
}
if (Level == 20) {
TimeUntilStart = 2000;
FluidInTank = 400;
NeededForVictory = 250;
FirstPieceX = 0;
FirstPieceY = -1;
LastPieceX = 6;
LastPieceY = 5;
Buildup = new Array(6);
Buildup[0] = "C A A D L A";
Buildup[1] = "C C A A A L";
Buildup[2] = "A A A C A A";
Buildup[3] = "A C A A A M";
Buildup[4] = "A A L A A A";
Buildup[5] = "A D H A D D";
Pieces = new Array(16);
Pieces[0] = "J";
Pieces[1] = "K";
Pieces[2] = "J";
Pieces[3] = "G";
Pieces[4] = "K";
Pieces[5] = "I";
Pieces[6] = "J";
Pieces[7] = "K";
Pieces[8] = "I";
Pieces[9] = "M";
Pieces[10] = "C";
Pieces[11] = "D";
Pieces[12] = "K";
Pieces[13] = "C";
Pieces[14] = "H";
Pieces[15] = "H";
}
Level1.text = "Level " + Level;
Format.size = 24;
Format.color = 16724787 /* 0xFF3333 */;
Level1.setTextFormat(Format);
Level2.text = "Level " + Level;
Format.size = 25;
Format.color = 13373713 /* 0xCC1111 */;
Level2.setTextFormat(Format);
_root.Timer._alpha = 70;
BuildupSplitted = new Array(6);
WallTime = 0;
TimeUntilNextLevel = 0;
WallClosing = false;
MissionComplete = false;
MissionFailed = false;
SelectedPiece = -1;
RemovePiece = false;
OverX = 0;
OverY = 0;
Forces = new Array();
TotalFluid = FluidInTank;
Slimes = 0;
UpdatePieces = true;
FluidInEnd = 0;
xp = 0;
while (xp < 6) {
Buildup[xp].reverse(Buildup[xp]);
BuildupSplitted[xp] = Buildup[xp].split(" ");
xp++;
}
_root.UpperFlatSlime._yscale = (FluidInTank / TotalFluid) * 100;
_root.UpperFlatSlime._alpha = 80;
_root.StorageBlock._y = 64 + ((FluidInTank / TotalFluid) * 218);
_root.StorageBlock._alpha = 100;
_root.LowerFlatSlime._alpha = 0;
_root.AnimatedSlime._alpha = 0;
_root.RedStripe._y = 289 - ((NeededForVictory / TotalFluid) * 218);
Pipes = new Array(6);
xp = 0;
while (xp < 6) {
Pipes[xp] = new Array(6);
yp = 0;
while (yp < 6) {
Pipes[xp][yp] = new Array(3);
Pipes[xp][yp][2] = new Array(4);
i = 0;
while (i < 4) {
Pipes[xp][yp][2][i] = new Array(4);
n = 0;
while (n < 4) {
Pipes[xp][yp][2][i][n] = new Array(5);
Pipes[xp][yp][2][i][n][2] = 0;
Pipes[xp][yp][2][i][n][3] = false;
Pipes[xp][yp][2][i][n][4] = 1;
removeMovieClip((((((("Slimesx" + xp) + "y") + yp) + "i") + i) + "n") + n);
n++;
}
i++;
}
if (BuildupSplitted[yp][xp] == "A") {
Pipes[xp][yp][0] = 2;
Pipes[xp][yp][1] = 1;
} else if (BuildupSplitted[yp][xp] == "B") {
Pipes[xp][yp][0] = 3;
Pipes[xp][yp][1] = 1;
} else if (BuildupSplitted[yp][xp] == "C") {
Pipes[xp][yp][0] = 3;
Pipes[xp][yp][1] = 2;
} else if (BuildupSplitted[yp][xp] == "D") {
Pipes[xp][yp][0] = 3;
Pipes[xp][yp][1] = 3;
} else if (BuildupSplitted[yp][xp] == "E") {
Pipes[xp][yp][0] = 3;
Pipes[xp][yp][1] = 4;
} else if (BuildupSplitted[yp][xp] == "F") {
Pipes[xp][yp][0] = 3;
Pipes[xp][yp][1] = 5;
} else if (BuildupSplitted[yp][xp] == "G") {
Pipes[xp][yp][0] = 3;
Pipes[xp][yp][1] = 6;
} else if (BuildupSplitted[yp][xp] == "H") {
Pipes[xp][yp][0] = 3;
Pipes[xp][yp][1] = 7;
} else if (BuildupSplitted[yp][xp] == "I") {
Pipes[xp][yp][0] = 3;
Pipes[xp][yp][1] = 8;
} else if (BuildupSplitted[yp][xp] == "J") {
Pipes[xp][yp][0] = 3;
Pipes[xp][yp][1] = 9;
} else if (BuildupSplitted[yp][xp] == "K") {
Pipes[xp][yp][0] = 3;
Pipes[xp][yp][1] = 10;
} else if (BuildupSplitted[yp][xp] == "L") {
Pipes[xp][yp][0] = 3;
Pipes[xp][yp][1] = 11;
} else if (BuildupSplitted[yp][xp] == "M") {
Pipes[xp][yp][0] = 3;
Pipes[xp][yp][1] = 12;
} else if (BuildupSplitted[yp][xp] == "N") {
Pipes[xp][yp][0] = 1;
Pipes[xp][yp][1] = 13;
} else if (BuildupSplitted[yp][xp] == "O") {
Pipes[xp][yp][0] = 1;
Pipes[xp][yp][1] = 14;
} else if (BuildupSplitted[yp][xp] == "P") {
Pipes[xp][yp][0] = 3;
Pipes[xp][yp][1] = 16;
} else if (BuildupSplitted[yp][xp] == "_") {
Pipes[xp][yp][0] = 1;
Pipes[xp][yp][1] = 1;
}
I = I + 1;
removeMovieClip((("Platex" + xp) + "y") + yp);
attachMovie("Plates", (("Platex" + xp) + "y") + yp, 1000 - I);
_root[(("Platex" + xp) + "y") + yp].gotoAndStop(Pipes[xp][yp][0]);
removeMovieClip((("Pipesx" + xp) + "y") + yp);
attachMovie("Pipes", (("Pipesx" + xp) + "y") + yp, 2000 - I);
_root[(("Pipesx" + xp) + "y") + yp].gotoAndStop(Pipes[xp][yp][1]);
_root[(("Platex" + xp) + "y") + yp]._x = 127 + (xp * 51);
_root[(("Platex" + xp) + "y") + yp]._y = 55 + (yp * 51);
_root[(("Pipesx" + xp) + "y") + yp]._x = 127 + (xp * 51);
_root[(("Pipesx" + xp) + "y") + yp]._y = 55 + (yp * 51);
yp++;
}
xp++;
}
p = 0;
while (p < Pieces.length) {
if (Pieces[p] == "C") {
Pipe = 2;
} else if (Pieces[p] == "D") {
Pipe = 3;
} else if (Pieces[p] == "E") {
Pipe = 4;
} else if (Pieces[p] == "F") {
Pipe = 5;
} else if (Pieces[p] == "G") {
Pipe = 6;
} else if (Pieces[p] == "H") {
Pipe = 7;
} else if (Pieces[p] == "I") {
Pipe = 8;
} else if (Pieces[p] == "J") {
Pipe = 9;
} else if (Pieces[p] == "K") {
Pipe = 10;
} else if (Pieces[p] == "L") {
Pipe = 11;
} else if (Pieces[p] == "M") {
Pipe = 12;
} else if (Pieces[p] == "P") {
Pipe = 16;
}
I = I + 1;
removeMovieClip("Button" + p);
attachMovie("Pipes", "Button" + p, 10000 - I);
_root["Button" + p].gotoAndStop(Pipe);
_root["Button" + p]._x = 10 + random(50);
_root["Button" + p]._y = 10 + random(290);
_root["Button" + p]._alpha = 100 + p;
_root["Button" + p].onPress = function () {
startDrag (this);
if (((_root._xmouse - 127) > 0) & ((_root._ymouse - 55) > 0)) {
xp = Math.round(((_root._xmouse - 127) - 25) / 51);
yp = Math.round(((_root._ymouse - 55) - 25) / 51);
if (((xp < 6) & (yp < 6)) & (SelectedPiece == -1)) {
RemovePiece = true;
OverX = xp;
OverY = yp;
if (this._alpha < 1) {
SelectedPiece = Math.round(-1 * this._alpha);
}
}
}
};
_root["Button" + p].onRollOut = function () {
stopDrag();
if (((_root._xmouse - 127) > 0) & ((_root._ymouse - 55) > 0)) {
xp = Math.round(((_root._xmouse - 127) - 25) / 51);
yp = Math.round(((_root._ymouse - 55) - 25) / 51);
if (((xp < 6) & (yp < 6)) & (SelectedPiece == -1)) {
RemovePiece = false;
OverX = xp;
OverY = yp;
if (this._alpha > 99) {
SelectedPiece = Math.round(this._alpha - 100);
}
}
}
};
_root["Button" + p].onRelease = function () {
stopDrag();
if (((_root._xmouse - 127) > 0) & ((_root._ymouse - 55) > 0)) {
xp = Math.round(((_root._xmouse - 127) - 25) / 51);
yp = Math.round(((_root._ymouse - 55) - 25) / 51);
if (((xp < 6) & (yp < 6)) & (SelectedPiece == -1)) {
RemovePiece = false;
OverX = xp;
OverY = yp;
if (this._alpha > 99) {
SelectedPiece = Math.round(this._alpha - 100);
}
}
}
};
p++;
}
GameMade = true;
}
if (WallTime < 14) {
if (WallTime > 0) {
if (WallClosing == false) {
_root.UpperWall._y = _root.UpperWall._y - WallTime;
_root.LowerWall._y = _root.LowerWall._y + WallTime;
Status1._y = _root.UpperWall._y - 48;
Status2._y = _root.UpperWall._y - 46;
} else {
_root.UpperWall._y = _root.UpperWall._y + WallTime;
_root.LowerWall._y = _root.LowerWall._y - WallTime;
Status1._y = _root.UpperWall._y - 48;
Status2._y = _root.UpperWall._y - 46;
}
}
WallTime = WallTime + 0.5;
}
if (SelectedPiece > -1) {
if (((Pipes[OverX][OverY][0] == 2) & (Pipes[OverX][OverY][1] == 1)) & (RemovePiece == false)) {
_root["Button" + SelectedPiece]._x = 127 + (OverX * 51);
_root["Button" + SelectedPiece]._y = 55 + (OverY * 51);
_root["Button" + SelectedPiece]._alpha = -SelectedPiece;
_root[(("Pipesx" + OverX) + "y") + OverY].gotoAndStop(_root["Button" + SelectedPiece]._currentframe);
Pipes[OverX][OverY][1] = _root["Button" + SelectedPiece]._currentframe;
UpdatePieces = true;
PieceClick.start(0, 1);
} else if (((Pipes[OverX][OverY][0] == 2) & (Pipes[OverX][OverY][1] > 1)) & (RemovePiece == true)) {
_root["Button" + SelectedPiece]._alpha = 100 + SelectedPiece;
_root[(("Pipesx" + OverX) + "y") + OverY].gotoAndStop(1);
Pipes[OverX][OverY][1] = 1;
UpdatePieces = true;
}
SelectedPiece = -1;
}
if (UpdatePieces == true) {
UpdatePieces = false;
Routes = new Array();
xp = 0;
while (xp < 6) {
yp = 0;
while (yp < 6) {
i = 0;
while (i < 4) {
n = 0;
while (n < 4) {
Pipes[xp][yp][2][i][n][0] = new Array();
Pipes[xp][yp][2][i][n][1] = false;
n++;
}
i++;
}
yp++;
}
xp++;
}
Routes[0] = new Array();
Routes[0][0] = FirstPieceX;
Routes[0][1] = FirstPieceY;
Routes[0][2] = 2;
Routes[0][3] = 0;
Routes[0][4] = 0;
Routes[0][5] = true;
EndUpdate = false;
while (EndUpdate == false) {
Finished = 0;
Length = Routes.length;
r = 0;
while (r < Length) {
CreateRoute = false;
if (Routes[r][5] == true) {
Direction = Routes[r][2];
NumberOfParents = Routes[r][3];
ParentRoute = Routes[r][4];
if (Direction == 0) {
Routes[r][1] = Routes[r][1] - 1;
RevDirection = 2;
} else if (Direction == 1) {
Routes[r][0] = Routes[r][0] + 1;
RevDirection = 3;
} else if (Direction == 2) {
Routes[r][1] = Routes[r][1] + 1;
RevDirection = 0;
} else if (Direction == 3) {
Routes[r][0] = Routes[r][0] - 1;
RevDirection = 1;
}
PositionX = Routes[r][0];
PositionY = Routes[r][1];
if (PositionY < 0) {
CreateRoute = true;
Routes[r][5] = false;
} else if (PositionX > 6) {
CreateRoute = true;
Routes[r][5] = false;
} else if (PositionY > 6) {
CreateRoute = true;
Routes[r][5] = false;
} else if (PositionX < 0) {
CreateRoute = true;
Routes[r][5] = false;
} else {
Pipe = Pipes[PositionX][PositionY][1];
Left = false;
Right = false;
Up = false;
Down = false;
switch (Pipe) {
case 1 :
CreateRoute = true;
Routes[r][5] = false;
break;
case 2 :
Up = true;
Down = true;
break;
case 3 :
Left = true;
Right = true;
break;
case 4 :
Up = true;
Right = true;
Down = true;
break;
case 5 :
Right = true;
Left = true;
Down = true;
break;
case 6 :
Up = true;
Down = true;
Left = true;
break;
case 7 :
Right = true;
Up = true;
Left = true;
break;
case 8 :
Up = true;
Down = true;
Left = true;
Right = true;
break;
case 9 :
Up = true;
Right = true;
break;
case 10 :
Right = true;
Down = true;
break;
case 11 :
Down = true;
Left = true;
break;
case 12 :
Left = true;
Up = true;
break;
case 16 :
Routes[r][5] = false;
}
if (Routes[r][5] == true) {
if (Direction == 0) {
if (Down == false) {
CreateRoute = true;
Routes[r][5] = false;
Left = false;
Right = false;
}
Down = false;
} else if (Direction == 1) {
if (Left == false) {
CreateRoute = true;
Routes[r][5] = false;
Down = false;
Up = false;
}
Left = false;
} else if (Direction == 2) {
if (Up == false) {
CreateRoute = true;
Routes[r][5] = false;
Left = false;
Right = false;
}
Up = false;
} else if (Direction == 3) {
if (Right == false) {
CreateRoute = true;
Routes[r][5] = false;
Down = false;
Up = false;
}
Right = false;
}
if (Direction == 0) {
n = 0;
while (n < 4) {
if (Pipes[PositionX][PositionY][2][n][2][0].length > 0) {
l = 0;
while (l < Pipes[PositionX][PositionY][2][n][2][0].length) {
if ((Routes[Pipes[PositionX][PositionY][2][n][2][0][l]][3] < NumberOfParents) or (Pipes[PositionX][PositionY][2][n][2][1] == true)) {
Routes[r][5] = false;
Up = false;
Down = false;
Left = false;
Right = false;
} else {
Routes[Pipes[PositionX][PositionY][2][n][2][0][l]][5] = false;
}
l++;
}
}
n++;
}
}
if (Direction == 1) {
n = 0;
while (n < 4) {
if (Pipes[PositionX][PositionY][2][n][3][0].length > 0) {
l = 0;
while (l < Pipes[PositionX][PositionY][2][n][3][0].length) {
if ((Routes[Pipes[PositionX][PositionY][2][n][3][0][l]][3] < NumberOfParents) or (Pipes[PositionX][PositionY][2][n][3][1] == true)) {
Routes[r][5] = false;
Up = false;
Down = false;
Left = false;
Right = false;
} else {
Routes[Pipes[PositionX][PositionY][2][n][3][0][l]][5] = false;
}
l++;
}
}
n++;
}
}
if (Direction == 2) {
n = 0;
while (n < 4) {
if (Pipes[PositionX][PositionY][2][n][0][0].length > 0) {
l = 0;
while (l < Pipes[PositionX][PositionY][2][n][0][0].length) {
if ((Routes[Pipes[PositionX][PositionY][2][n][0][0][l]][3] < NumberOfParents) or (Pipes[PositionX][PositionY][2][n][0][1] == true)) {
Routes[r][5] = false;
Up = false;
Down = false;
Left = false;
Right = false;
} else {
Routes[Pipes[PositionX][PositionY][2][n][0][0][l]][5] = false;
}
l++;
}
}
n++;
}
}
if (Direction == 3) {
n = 0;
while (n < 4) {
if (Pipes[PositionX][PositionY][2][n][1][0].length > 0) {
l = 0;
while (l < Pipes[PositionX][PositionY][2][n][1][0].length) {
if ((Routes[Pipes[PositionX][PositionY][2][n][1][0][l]][3] < NumberOfParents) or (Pipes[PositionX][PositionY][2][n][1][1] == true)) {
Routes[r][5] = false;
Up = false;
Down = false;
Left = false;
Right = false;
} else {
Routes[Pipes[PositionX][PositionY][2][n][1][0][l]][5] = false;
}
l++;
}
}
n++;
}
}
NumberOfCurrents = 0;
if (Up == true) {
NumberOfCurrents = NumberOfCurrents + 1;
}
if (Left == true) {
NumberOfCurrents = NumberOfCurrents + 1;
}
if (Down == true) {
NumberOfCurrents = NumberOfCurrents + 1;
}
if (Right == true) {
NumberOfCurrents = NumberOfCurrents + 1;
}
if (NumberOfCurrents == 1) {
if (Up == true) {
Routes[r][2] = 0;
Pipes[PositionX][PositionY][2][RevDirection][0][0][Pipes[PositionX][PositionY][2][RevDirection][0][0].length] = r;
}
if (Right == true) {
Routes[r][2] = 1;
Pipes[PositionX][PositionY][2][RevDirection][1][0][Pipes[PositionX][PositionY][2][RevDirection][1][0].length] = r;
}
if (Down == true) {
Routes[r][2] = 2;
Pipes[PositionX][PositionY][2][RevDirection][2][0][Pipes[PositionX][PositionY][2][RevDirection][2][0].length] = r;
}
if (Left == true) {
Routes[r][2] = 3;
Pipes[PositionX][PositionY][2][RevDirection][3][0][Pipes[PositionX][PositionY][2][RevDirection][3][0].length] = r;
}
} else if (NumberOfCurrents > 1) {
NewRoutes = Routes.length - 1;
if (Up == true) {
NewRoutes = NewRoutes + 1;
Routes[NewRoutes] = new Array();
Routes[NewRoutes][0] = Routes[r][0];
Routes[NewRoutes][1] = Routes[r][1];
Routes[NewRoutes][2] = 0;
Routes[NewRoutes][3] = Routes[r][3] + 1;
Routes[NewRoutes][4] = r;
Routes[NewRoutes][5] = true;
Pipes[PositionX][PositionY][2][RevDirection][0][0][Pipes[PositionX][PositionY][2][RevDirection][0][0].length] = NewRoutes;
}
if (Right == true) {
NewRoutes = NewRoutes + 1;
Routes[NewRoutes] = new Array();
Routes[NewRoutes][0] = Routes[r][0];
Routes[NewRoutes][1] = Routes[r][1];
Routes[NewRoutes][2] = 1;
Routes[NewRoutes][3] = Routes[r][3] + 1;
Routes[NewRoutes][4] = r;
Routes[NewRoutes][5] = true;
Pipes[PositionX][PositionY][2][RevDirection][1][0][Pipes[PositionX][PositionY][2][RevDirection][1][0].length] = NewRoutes;
}
if (Down == true) {
NewRoutes = NewRoutes + 1;
Routes[NewRoutes] = new Array();
Routes[NewRoutes][0] = Routes[r][0];
Routes[NewRoutes][1] = Routes[r][1];
Routes[NewRoutes][2] = 2;
Routes[NewRoutes][3] = Routes[r][3] + 1;
Routes[NewRoutes][4] = r;
Routes[NewRoutes][5] = true;
Pipes[PositionX][PositionY][2][RevDirection][2][0][Pipes[PositionX][PositionY][2][RevDirection][2][0].length] = NewRoutes;
}
if (Left == true) {
NewRoutes = NewRoutes + 1;
Routes[NewRoutes] = new Array();
Routes[NewRoutes][0] = Routes[r][0];
Routes[NewRoutes][1] = Routes[r][1];
Routes[NewRoutes][2] = 3;
Routes[NewRoutes][3] = Routes[r][3] + 1;
Routes[NewRoutes][4] = r;
Routes[NewRoutes][5] = true;
Pipes[PositionX][PositionY][2][RevDirection][3][0][Pipes[PositionX][PositionY][2][RevDirection][3][0].length] = NewRoutes;
}
Routes[r][5] = false;
}
}
}
} else {
Finished = Finished + 1;
}
if (CreateRoute == true) {
Continue = true;
AddingRoute = r;
while (Continue == true) {
xp = 0;
while (xp < 6) {
yp = 0;
while (yp < 6) {
i = 0;
while (i < 4) {
n = 0;
while (n < 4) {
if (Pipes[xp][yp][2][i][n][0].length > 0) {
l = 0;
while (l < Pipes[xp][yp][2][i][n][0].length) {
if (Pipes[xp][yp][2][i][n][0][l] == AddingRoute) {
Pipes[xp][yp][2][i][n][1] = true;
}
l++;
}
}
n++;
}
i++;
}
yp++;
}
xp++;
}
if (Routes[AddingRoute][3] > 0) {
AddingRoute = Routes[AddingRoute][4];
} else {
Continue = false;
}
}
}
r++;
}
if (Finished == Routes.length) {
EndUpdate = true;
}
xp = 0;
while (xp < 6) {
yp = 0;
while (yp < 6) {
i = 0;
while (i < 4) {
n = 0;
while (n < 4) {
if (Pipes[xp][yp][2][i][n][1] == true) {
Exists = false;
if (Forces.length > 0) {
f = 0;
while (f < Forces.length) {
if ((((Forces[f][0] == xp) & (Forces[f][1] == yp)) & (Forces[f][2] == i)) & (Forces[f][3] == n)) {
Exists = true;
}
f++;
}
}
if (Exists == false) {
Forces[Forces.length] = new Array(4);
Forces[Forces.length - 1][0] = xp;
Forces[Forces.length - 1][1] = yp;
Forces[Forces.length - 1][2] = i;
Forces[Forces.length - 1][3] = n;
Slimes = Slimes + 1;
PositionX = 127 + (xp * 51);
PositionY = 55 + (yp * 51);
if (((((i == 0) & (n == 2)) or ((i == 1) & (n == 3))) or ((i == 2) & (n == 0))) or ((i == 3) & (n == 1))) {
attachMovie("StraightSlime", (((((("Slimesx" + xp) + "y") + yp) + "i") + i) + "n") + n, 3000 - Slimes);
if ((i == 0) & (n == 2)) {
_root[(((((("Slimesx" + xp) + "y") + yp) + "i") + i) + "n") + n]._rotation = 0;
PositionX = PositionX - 1;
} else if ((i == 1) & (n == 3)) {
_root[(((((("Slimesx" + xp) + "y") + yp) + "i") + i) + "n") + n]._rotation = 90;
PositionX = PositionX + 51;
PositionY = PositionY - 1;
} else if ((i == 2) & (n == 0)) {
_root[(((((("Slimesx" + xp) + "y") + yp) + "i") + i) + "n") + n]._rotation = 180;
PositionX = PositionX + 51;
PositionY = PositionY + 51;
PositionX = PositionX + 1;
} else if ((i == 3) & (n == 1)) {
_root[(((((("Slimesx" + xp) + "y") + yp) + "i") + i) + "n") + n]._rotation = 270;
PositionY = PositionY + 51;
PositionY = PositionY + 1;
}
} else {
attachMovie("CurveSlime", (((((("Slimesx" + xp) + "y") + yp) + "i") + i) + "n") + n, 3000 - Slimes);
if ((i == 0) & (n == 1)) {
_root[(((((("Slimesx" + xp) + "y") + yp) + "i") + i) + "n") + n]._rotation = 0;
} else if ((i == 1) & (n == 2)) {
_root[(((((("Slimesx" + xp) + "y") + yp) + "i") + i) + "n") + n]._rotation = 90;
PositionX = PositionX + 51;
} else if ((i == 2) & (n == 3)) {
_root[(((((("Slimesx" + xp) + "y") + yp) + "i") + i) + "n") + n]._rotation = 180;
PositionX = PositionX + 51;
PositionY = PositionY + 51;
} else if ((i == 3) & (n == 0)) {
_root[(((((("Slimesx" + xp) + "y") + yp) + "i") + i) + "n") + n]._rotation = 270;
PositionY = PositionY + 51;
} else if ((i == 0) & (n == 3)) {
_root[(((((("Slimesx" + xp) + "y") + yp) + "i") + i) + "n") + n]._rotation = 0;
_root[(((((("Slimesx" + xp) + "y") + yp) + "i") + i) + "n") + n]._xscale = -100;
PositionX = PositionX + 51;
} else if ((i == 3) & (n == 2)) {
_root[(((((("Slimesx" + xp) + "y") + yp) + "i") + i) + "n") + n]._rotation = 270;
_root[(((((("Slimesx" + xp) + "y") + yp) + "i") + i) + "n") + n]._xscale = -100;
} else if ((i == 2) & (n == 1)) {
_root[(((((("Slimesx" + xp) + "y") + yp) + "i") + i) + "n") + n]._rotation = 180;
_root[(((((("Slimesx" + xp) + "y") + yp) + "i") + i) + "n") + n]._xscale = -100;
PositionY = PositionY + 51;
} else if ((i == 1) & (n == 0)) {
_root[(((((("Slimesx" + xp) + "y") + yp) + "i") + i) + "n") + n]._rotation = 90;
_root[(((((("Slimesx" + xp) + "y") + yp) + "i") + i) + "n") + n]._xscale = -100;
PositionY = PositionY + 51;
PositionX = PositionX + 51;
}
}
_root[(((((("Slimesx" + xp) + "y") + yp) + "i") + i) + "n") + n].gotoAndStop(1);
_root[(((((("Slimesx" + xp) + "y") + yp) + "i") + i) + "n") + n]._alpha = 80;
_root[(((((("Slimesx" + xp) + "y") + yp) + "i") + i) + "n") + n]._x = PositionX;
_root[(((((("Slimesx" + xp) + "y") + yp) + "i") + i) + "n") + n]._y = PositionY;
}
}
n++;
}
i++;
}
yp++;
}
xp++;
}
}
}
if (TimeUntilStart > 0) {
TimeUntilStart = TimeUntilStart - 1;
if ((MissionComplete == false) & (MissionFailed == false)) {
Minutes = (TimeUntilStart / 20) / 60;
Seconds = (TimeUntilStart / 20) - (Math.floor(Minutes) * 60);
TimeUntilStart1.text = (Math.floor(Minutes) + ":") + Math.floor(Seconds);
TimeUntilStart2.text = (Math.floor(Minutes) + ":") + Math.floor(Seconds);
Format.size = 23;
Format.color = 4521796 /* 0x44FF44 */;
TimeUntilStart1.setTextFormat(Format);
Format.size = 24;
Format.color = 2258722 /* 0x227722 */;
TimeUntilStart2.setTextFormat(Format);
}
} else {
TimeUntilStart1.text = "";
TimeUntilStart2.text = "";
_root.Timer._alpha = _root.Timer._alpha - 2;
if (TimeUntilNextLevel > 0) {
TimeUntilNextLevel = TimeUntilNextLevel - 1;
if (TimeUntilNextLevel == 0) {
if (MissionComplete == true) {
if (Level == 21) {
Opening = true;
NewGame = false;
Level1.removeTextField();
Level2.removeTextField();
TimeUntilStart1.removeTextField();
TimeUntilStart2.removeTextField();
Status1.removeTextField();
Status2.removeTextField();
removeMovieClip("Timer");
xp = 0;
while (xp < 7) {
removeMovieClip("StartingPipesx" + xp);
xp++;
}
removeMovieClip("StorageLower");
removeMovieClip("StorageUpper");
i = 0;
while (i < 64) {
removeMovieClip("SlimeBall" + i);
i++;
}
removeMovieClip("AnimatedSlime");
removeMovieClip("LowerFlatSlime");
removeMovieClip("UpperFlatSlime");
removeMovieClip("StorageBlock");
removeMovieClip("RedStripe");
removeMovieClip("PartStorage");
removeMovieClip("Background");
removeMovieClip("RedStripe");
xp = 0;
while (xp < 6) {
yp = 0;
while (yp < 6) {
removeMovieClip((("Platex" + xp) + "y") + yp);
removeMovieClip((("Pipesx" + xp) + "y") + yp);
i = 0;
while (i < 4) {
n = 0;
while (n < 4) {
removeMovieClip((((((("Slimesx" + xp) + "y") + yp) + "i") + i) + "n") + n);
n++;
}
i++;
}
yp++;
}
xp++;
}
p = 0;
while (p < 50) {
removeMovieClip("Button" + p);
p++;
}
WallTime = 0;
gotoAndStop (4);
} else {
GameMade = false;
}
} else if (MissionFailed == true) {
Level1.removeTextField();
Level2.removeTextField();
TimeUntilStart1.removeTextField();
TimeUntilStart2.removeTextField();
Status1.removeTextField();
Status2.removeTextField();
removeMovieClip("Timer");
xp = 0;
while (xp < 7) {
removeMovieClip("StartingPipesx" + xp);
xp++;
}
removeMovieClip("StorageLower");
removeMovieClip("StorageUpper");
i = 0;
while (i < 64) {
removeMovieClip("SlimeBall" + i);
i++;
}
removeMovieClip("AnimatedSlime");
removeMovieClip("LowerFlatSlime");
removeMovieClip("UpperFlatSlime");
removeMovieClip("StorageBlock");
removeMovieClip("RedStripe");
removeMovieClip("PartStorage");
removeMovieClip("Background");
removeMovieClip("RedStripe");
xp = 0;
while (xp < 6) {
yp = 0;
while (yp < 6) {
removeMovieClip((("Platex" + xp) + "y") + yp);
removeMovieClip((("Pipesx" + xp) + "y") + yp);
i = 0;
while (i < 4) {
n = 0;
while (n < 4) {
removeMovieClip((((((("Slimesx" + xp) + "y") + yp) + "i") + i) + "n") + n);
n++;
}
i++;
}
yp++;
}
xp++;
}
p = 0;
while (p < 50) {
removeMovieClip("Button" + p);
p++;
}
WallTime = 0;
gotoAndStop (2);
}
}
} else if (MissionComplete == true) {
Level = Level + 1;
WallClosing = true;
WallTime = 0;
TimeUntilNextLevel = 50;
} else if (MissionFailed == true) {
NewGame = false;
Opening = true;
WallClosing = true;
WallTime = 0;
TimeUntilNextLevel = 50;
}
n = 0;
while (n < 4) {
if ((Pipes[FirstPieceX][FirstPieceY + 1][2][0][n][1] == true) & (FluidInTank > 0)) {
Pipes[FirstPieceX][FirstPieceY + 1][2][0][n][2] = Pipes[FirstPieceX][FirstPieceY + 1][2][0][n][2] + 1;
Pipes[FirstPieceX][FirstPieceY + 1][2][0][n][4] = 1;
FluidInTank = FluidInTank - 1;
_root.UpperFlatSlime._yscale = (FluidInTank / TotalFluid) * 100;
_root.StorageBlock._y = 64 + ((FluidInTank / TotalFluid) * 218);
}
if (FluidInTank == 0) {
Pipes[FirstPieceX][FirstPieceY + 1][2][0][n][3] = true;
_root.UpperFlatSlime._alpha = 0;
_root.StorageBlock._alpha = 0;
} else {
Pipes[FirstPieceX][FirstPieceY + 1][2][0][n][3] = false;
}
n++;
}
FluidInSystem = false;
if (Forces.length > 0) {
f = Forces.length - 1;
while (f > -1) {
xp = Forces[f][0];
yp = Forces[f][1];
i = Forces[f][2];
n = Forces[f][3];
if (Pipes[xp][yp][2][i][n][1] == true) {
s = 0;
while (s < 4) {
if (Pipes[xp][yp][2][s][i][2] > 0) {
Pipes[xp][yp][2][i][n][4] = (Pipes[xp][yp][2][i][n][2] * Pipes[xp][yp][2][i][n][4]) + ((Pipes[xp][yp][2][s][i][2] * Pipes[xp][yp][2][s][i][4]) / (Pipes[xp][yp][2][s][i][2] + Pipes[xp][yp][2][i][n][2]));
Pipes[xp][yp][2][i][n][2] = Pipes[xp][yp][2][i][n][2] + Pipes[xp][yp][2][s][i][2];
Pipes[xp][yp][2][s][i][2] = 0;
}
s++;
}
if (Pipes[xp][yp][2][i][n][2] > 0) {
FluidInSystem = true;
}
if (Pipes[xp][yp][2][i][n][1] == true) {
if (((Pipes[xp][yp][2][i][n][2] > 9) & (Pipes[xp][yp][2][i][n][3] == false)) or ((Pipes[xp][yp][2][i][n][2] > 0) & (Pipes[xp][yp][2][i][n][3] == true))) {
if (n == 0) {
if ((((((((yp == 0) or (Pipes[xp][yp - 1][1] == 1)) or (Pipes[xp][yp - 1][1] == 3)) or (Pipes[xp][yp - 1][1] == 7)) or (Pipes[xp][yp - 1][1] == 9)) or (Pipes[xp][yp - 1][1] == 12)) or (Pipes[xp][yp - 1][1] == 14)) or (Pipes[xp][yp - 1][1] == 13)) {
NumberToShare = 1;
SlimeBalls[NextSlimeBall][0] = random(3) - random(3);
SlimeBalls[NextSlimeBall][1] = -(3 + random(5));
_root["SlimeBall" + NextSlimeBall]._x = ((127 + (xp * 51)) + 18) + random(20);
_root["SlimeBall" + NextSlimeBall]._y = 55 + (yp * 51);
_root["SlimeBall" + NextSlimeBall]._alpha = 80;
if (NextSlimeBall > 63) {
NextSlimeBall = 0;
} else {
NextSlimeBall = NextSlimeBall + 1;
}
} else {
NumberToShare = 0;
s = 0;
while (s < 4) {
if (Pipes[xp][yp - 1][2][2][s][1] == true) {
NumberToShare = NumberToShare + 1;
}
s++;
}
s = 0;
while (s < 4) {
if (Pipes[xp][yp - 1][2][2][s][1] == true) {
Value = (Pipes[xp][yp - 1][2][2][s][4] * Pipes[xp][yp - 1][2][2][s][2]) + (Pipes[xp][yp][2][i][n][4] / NumberToShare);
Pipes[xp][yp - 1][2][2][s][2] = Pipes[xp][yp - 1][2][2][s][2] + 1;
Pipes[xp][yp - 1][2][2][s][4] = Value / Pipes[xp][yp - 1][2][2][s][2];
}
s++;
}
}
} else if (n == 1) {
if ((((((((xp == 5) or (Pipes[xp + 1][yp][1] == 1)) or (Pipes[xp + 1][yp][1] == 2)) or (Pipes[xp + 1][yp][1] == 4)) or (Pipes[xp + 1][yp][1] == 9)) or (Pipes[xp + 1][yp][1] == 10)) or (Pipes[xp + 1][yp][1] == 14)) or (Pipes[xp + 1][yp][1] == 13)) {
NumberToShare = 1;
if (((xp + 1) == LastPieceX) & (yp == LastPieceY)) {
FluidInEnd = FluidInEnd + Pipes[xp][yp][2][i][n][4];
_root.LowerFlatSlime._yscale = (FluidInEnd / TotalFluid) * 100;
_root.AnimatedSlime._y = 289 - ((FluidInEnd / TotalFluid) * 218);
_root.LowerFlatSlime._alpha = 80;
_root.AnimatedSlime._alpha = 80;
} else {
SlimeBalls[NextSlimeBall][0] = 3 + random(5);
SlimeBalls[NextSlimeBall][1] = random(3) - random(3);
_root["SlimeBall" + NextSlimeBall]._x = (127 + (xp * 51)) + 51;
_root["SlimeBall" + NextSlimeBall]._y = ((55 + (yp * 51)) + 18) + random(20);
_root["SlimeBall" + NextSlimeBall]._alpha = 80;
if (NextSlimeBall > 63) {
NextSlimeBall = 0;
} else {
NextSlimeBall = NextSlimeBall + 1;
}
}
} else {
NumberToShare = 0;
s = 0;
while (s < 4) {
if (Pipes[xp + 1][yp][2][3][s][1] == true) {
NumberToShare = NumberToShare + 1;
}
s++;
}
s = 0;
while (s < 4) {
if (Pipes[xp + 1][yp][2][3][s][1] == true) {
Value = (Pipes[xp + 1][yp][2][3][s][4] * Pipes[xp + 1][yp][2][3][s][2]) + (Pipes[xp][yp][2][i][n][4] / NumberToShare);
Pipes[xp + 1][yp][2][3][s][2] = Pipes[xp + 1][yp][2][3][s][2] + 1;
Pipes[xp + 1][yp][2][3][s][4] = Value / Pipes[xp + 1][yp][2][3][s][2];
}
s++;
}
}
} else if (n == 2) {
if ((((((((yp == 5) or (Pipes[xp][yp + 1][1] == 1)) or (Pipes[xp][yp + 1][1] == 3)) or (Pipes[xp][yp + 1][1] == 5)) or (Pipes[xp][yp + 1][1] == 10)) or (Pipes[xp][yp + 1][1] == 11)) or (Pipes[xp][yp + 1][1] == 14)) or (Pipes[xp][yp + 1][1] == 13)) {
NumberToShare = 1;
SlimeBalls[NextSlimeBall][0] = random(3) - random(3);
SlimeBalls[NextSlimeBall][1] = 3 + random(5);
_root["SlimeBall" + NextSlimeBall]._x = ((127 + (xp * 51)) + 18) + random(20);
_root["SlimeBall" + NextSlimeBall]._y = (55 + (yp * 51)) + 51;
_root["SlimeBall" + NextSlimeBall]._alpha = 80;
if (NextSlimeBall > 63) {
NextSlimeBall = 0;
} else {
NextSlimeBall = NextSlimeBall + 1;
}
} else {
NumberToShare = 0;
s = 0;
while (s < 4) {
if (Pipes[xp][yp + 1][2][0][s][1] == true) {
NumberToShare = NumberToShare + 1;
}
s++;
}
s = 0;
while (s < 4) {
if (Pipes[xp][yp + 1][2][0][s][1] == true) {
Value = (Pipes[xp][yp + 1][2][0][s][4] * Pipes[xp][yp + 1][2][0][s][2]) + (Pipes[xp][yp][2][i][n][4] / NumberToShare);
Pipes[xp][yp + 1][2][0][s][2] = Pipes[xp][yp + 1][2][0][s][2] + 1;
Pipes[xp][yp + 1][2][0][s][4] = Value / Pipes[xp][yp + 1][2][0][s][2];
}
s++;
}
}
} else if (n == 3) {
if ((((((((xp == 0) or (Pipes[xp - 1][yp][1] == 1)) or (Pipes[xp - 1][yp][1] == 2)) or (Pipes[xp - 1][yp][1] == 6)) or (Pipes[xp - 1][yp][1] == 11)) or (Pipes[xp - 1][yp][1] == 12)) or (Pipes[xp - 1][yp][1] == 14)) or (Pipes[xp - 1][yp][1] == 13)) {
NumberToShare = 1;
SlimeBalls[NextSlimeBall][0] = -(5 + random(5));
SlimeBalls[NextSlimeBall][1] = random(3) - random(3);
_root["SlimeBall" + NextSlimeBall]._x = 127 + (xp * 51);
_root["SlimeBall" + NextSlimeBall]._y = ((55 + (yp * 51)) + 18) + random(20);
_root["SlimeBall" + NextSlimeBall]._alpha = 80;
if (NextSlimeBall > 63) {
NextSlimeBall = 0;
} else {
NextSlimeBall = NextSlimeBall + 1;
}
} else {
NumberToShare = 0;
s = 0;
while (s < 4) {
if (Pipes[xp - 1][yp][2][1][s][1] == true) {
NumberToShare = NumberToShare + 1;
}
s++;
}
s = 0;
while (s < 4) {
if (Pipes[xp - 1][yp][2][1][s][1] == true) {
Value = (Pipes[xp - 1][yp][2][1][s][4] * Pipes[xp - 1][yp][2][1][s][2]) + (Pipes[xp][yp][2][i][n][4] / NumberToShare);
Pipes[xp - 1][yp][2][1][s][2] = Pipes[xp - 1][yp][2][1][s][2] + 1;
Pipes[xp - 1][yp][2][1][s][4] = Value / Pipes[xp - 1][yp][2][1][s][2];
}
s++;
}
}
}
}
}
}
if (Pipes[xp][yp][2][i][n][3] == true) {
if (Pipes[xp][yp][2][i][n][2] > 0) {
Pipes[xp][yp][2][i][n][2] = Pipes[xp][yp][2][i][n][2] - 1;
}
} else if (Pipes[xp][yp][2][i][n][2] > 9) {
Pipes[xp][yp][2][i][n][2] = Pipes[xp][yp][2][i][n][2] - 1;
if (Pipes[xp][yp][2][i][n][2] > 9) {
Pipes[xp][yp][2][i][n][4] = (Pipes[xp][yp][2][i][n][2] * Pipes[xp][yp][2][i][n][4]) / 9;
Pipes[xp][yp][2][i][n][2] = 9;
}
}
if (((!((yp == (FirstPieceY + 1)) & (xp == FirstPieceX))) & (Pipes[xp][yp][2][i][n][2] > 0)) & (((((yp > 0) & (i == 0)) or ((xp < 5) & (i == 1))) or ((yp < 5) & (i == 2))) or ((xp > 0) & (i == 3)))) {
if (i == 0) {
ri = 2;
PositionX = xp;
PositionY = yp - 1;
} else if (i == 1) {
ri = 3;
PositionX = xp + 1;
PositionY = yp;
} else if (i == 2) {
ri = 0;
PositionX = xp;
PositionY = yp + 1;
} else if (i == 3) {
ri = 1;
PositionX = xp - 1;
PositionY = yp;
}
Force = false;
s = 0;
while (s < 4) {
if (Pipes[PositionX][PositionY][2][s][ri][2] > 0) {
Force = true;
}
s++;
}
if (Force == false) {
Pipes[xp][yp][2][i][n][3] = true;
} else {
Pipes[xp][yp][2][i][n][3] = false;
}
} else if (Pipes[xp][yp][2][i][n][2] == 0) {
Pipes[xp][yp][2][i][n][3] = false;
}
if (Pipes[xp][yp][2][i][n][2] >= 9) {
_root[(((((("Slimesx" + xp) + "y") + yp) + "i") + i) + "n") + n].gotoAndStop(10);
} else if (Pipes[xp][yp][2][i][n][3] == false) {
_root[(((((("Slimesx" + xp) + "y") + yp) + "i") + i) + "n") + n].gotoAndStop(1 + Pipes[xp][yp][2][i][n][2]);
} else {
_root[(((((("Slimesx" + xp) + "y") + yp) + "i") + i) + "n") + n].gotoAndStop(19 - Pipes[xp][yp][2][i][n][2]);
}
if (Pipes[xp][yp][2][i][n][1] == false) {
Alpha = _root[(((((("Slimesx" + xp) + "y") + yp) + "i") + i) + "n") + n]._alpha;
if (Alpha > 0) {
_root[(((((("Slimesx" + xp) + "y") + yp) + "i") + i) + "n") + n]._alpha = Math.round(Alpha - 10);
}
if (Alpha == 0) {
Pipes[xp][yp][2][i][n][2] = 0;
}
} else if (Pipes[xp][yp][2][i][n][2] > 0) {
_root[(((((("Slimesx" + xp) + "y") + yp) + "i") + i) + "n") + n]._alpha = 80;
}
if (Pipes[xp][yp][2][i][n][2] == 0) {
Pipes[xp][yp][2][i][n][4] = 1;
}
f--;
}
}
if ((FluidInSystem == false) & (TimeUntilNextLevel == 0)) {
if (FluidInTank > 0) {
FluidInTank = FluidInTank - 1;
_root.UpperFlatSlime._yscale = (FluidInTank / TotalFluid) * 100;
_root.StorageBlock._y = 64 + ((FluidInTank / TotalFluid) * 218);
SlimeBalls[NextSlimeBall][1] = random(3) - random(3);
_root["SlimeBall" + NextSlimeBall]._x = ((127 + (FirstPieceX * 51)) + 18) + random(20);
SlimeBalls[NextSlimeBall][0] = ((((127 + (FirstPieceX * 51)) + 25) - _root["SlimeBall" + NextSlimeBall]._x) + random(5)) - random(5);
_root["SlimeBall" + NextSlimeBall]._y = (55 + (FirstPieceY * 51)) + 51;
_root["SlimeBall" + NextSlimeBall]._alpha = 80;
if (NextSlimeBall > 63) {
NextSlimeBall = 0;
} else {
NextSlimeBall = NextSlimeBall + 1;
}
} else if (FluidInEnd >= NeededForVictory) {
Score = Score + FluidInEnd;
if (Level < 20) {
Format.size = 38;
Format.color = 13883346 /* 0xD3D7D2 */;
Status1.text = "Next level";
Status1.setTextFormat(Format);
Format.color = 12238777 /* 0xBABFB9 */;
Status2.text = "Next level";
Status2.setTextFormat(Format);
Status1._y = _root.UpperWall._y - 48;
Status2._y = _root.UpperWall._y - 46;
} else {
Status1.text = "";
Status2.text = "";
}
MissionComplete = true;
TimeUntilStart = 40;
} else {
MissionFailed = true;
Format.size = 38;
Format.color = 13883346 /* 0xD3D7D2 */;
Status1.text = "Game over";
Status1.setTextFormat(Format);
Format.color = 12238777 /* 0xBABFB9 */;
Status2.text = "Game over";
Status2.setTextFormat(Format);
Status1._y = _root.UpperWall._y - 48;
Status2._y = _root.UpperWall._y - 46;
TimeUntilStart = 40;
}
}
}
i = 0;
while (i < 64) {
Alpha = _root["SlimeBall" + i]._alpha;
if (Alpha > 0) {
PositionX = _root["SlimeBall" + i]._x;
PositionY = _root["SlimeBall" + i]._y;
_root["SlimeBall" + i]._x = PositionX + SlimeBalls[i][0];
_root["SlimeBall" + i]._y = PositionY + SlimeBalls[i][1];
_root["SlimeBall" + i]._alpha = Alpha - 10;
Angle = Math.atan2(SlimeBalls[i][1], SlimeBalls[i][0]);
Angle = Math.round((Angle / Math.PI) * 180);
_root["SlimeBall" + i]._rotation = Angle;
}
i++;
}
}
stop();
Instance of Symbol 94 MovieClip in Frame 3
onClipEvent (load) {
_root.initGame();
}
onClipEvent (enterFrame) {
_root.UpdateGame();
}
Frame 4
function initEndScreen() {
Format = new TextFormat();
Format.font = "Tahoma";
Format.bullet = false;
Format.bold = true;
Format.align = "center";
Format.size = 30;
Format.color = 15658734 /* 0xEEEEEE */;
_root.createTextField("ScoreField", 10503, 100, 300, 400, 50);
ScoreField.text = ("Score: " + Math.round(Score)) + "/5000";
ScoreField.border = false;
ScoreField.setTextFormat(Format);
ScoreField.selectable = false;
}
function Ending() {
if ((WallTime < 14) & (Opening == true)) {
_root.UpperWall._y = _root.UpperWall._y - WallTime;
_root.LowerWall._y = _root.LowerWall._y + WallTime;
WallTime = WallTime + 0.5;
} else {
Opening = false;
if (WallTime < 14) {
_root.UpperWall._y = _root.UpperWall._y + WallTime;
_root.LowerWall._y = _root.LowerWall._y - WallTime;
WallTime = WallTime + 0.5;
} else if (NewGame == true) {
ScoreField.removeTextField();
gotoAndStop (3);
}
}
}
stop();
Instance of Symbol 94 MovieClip in Frame 4
onClipEvent (load) {
_root.initEndScreen();
}
onClipEvent (enterFrame) {
_root.Ending();
}
Symbol 49 MovieClip [Storage Slime] Frame 11
gotoAndPlay (1);
Symbol 105 Button
on (release) {
if ((Opening == false) & (NewGame == false)) {
NewGame = true;
WallTime = 0;
PieceClick.start(0, 1);
}
}
Symbol 110 Button
on (release) {
getURL ("http://HamsterWorld.No-Ip.Info");
}
Symbol 112 Button
on (release) {
getURL ("http://www.chiptune.com");
}