Frame 1
_global.bProductsLoaded = true;
_global.nRoom = 0;
_global.nPoints = 0;
_global.aComponentsList = new Array();
loadMovieNum ("http://www.kerb.co.uk/logging/newgrounds_ccl.swf", 1000);
_global.checkEmail = function (email) {
var _local2 = email;
var dot = _local2.lastIndexOf(".");
var _local1 = _local2.indexOf("@");
var _local3 = _local2.indexOf(" ");
var colon = _local2.lastIndexOf("..");
if ((((_local3 < 0) && (_local1 > 0)) && (_local1 < dot)) && (colon == -1)) {
return(true);
}
return(false);
};
_global.formatNumber = function (inNum) {
var _local1 = inNum.toString();
if (_local1.indexOf(".") == -1) {
_local1 = _local1 + ".00";
} else if (_local1.indexOf(".") >= (_local1.length - 2)) {
_local1 = _local1 + "0";
}
return(_local1);
};
_global.resetVariables = function () {
var _local1 = _global;
_local1.nPoints = 0;
_local1.sResult = null;
_local1.nRoom = 0;
_local1.nTimeBonus = null;
_local1.nAttemp = null;
_local1.nRoomPoint = null;
delete _local1.aComponentsList;
_local1.aComponentsList = new Array();
};
_global.gotoLabel = function (sLabel) {
_global.sLabel = sLabel;
_root.mcTransition.gotoAndPlay("close");
};
loader_mc.onEnterFrame = function () {
var _local1 = _root.getBytesLoaded();
var _local2 = _root.getBytesTotal();
if ((_local1 >= _local2) && (_global.bProductsLoaded)) {
gotoAndStop ("animation");
} else {
this.gotoAndStop(parseInt((100 * _local1) / _local2));
}
};
stop();
Symbol 19 MovieClip Frame 1
stop();
Symbol 25 MovieClip [box] Frame 1
#initclip 2
function Box() {
var _local1 = this;
_local1.sType = "box";
_local1.nGravity = 0.9;
_local1.nAirDrag = 0.94;
_local1.nGroundDrag = 0.92;
_local1.nBounce = 0.9;
_local1.nSpeedX = 0;
_local1.nSpeedY = 0;
_local1.bFanSound = false;
_local1.bConveyorSound = false;
_local1.bBoxSound = false;
}
Box.prototype = new MovieClip();
Box.prototype.init = function (mcScene) {
var _local1 = this;
_local1.mcScene = mcScene;
_local1.nOrgX = _local1._x;
_local1.nOrgY = _local1._y;
_local1.nX = _local1._x;
_local1.nY = _local1._y;
_local1.nPrevX = _local1.nX;
_local1.nPrevY = _local1.nY;
_local1.nWidth = _local1._width;
_local1.nHeight = _local1._height;
};
Box.prototype.reset = function () {
var _local1 = this;
_local1._x = _local1.nOrgX;
_local1._y = _local1.nOrgY;
_local1.nX = _local1.nOrgX;
_local1.nY = _local1.nOrgY;
_local1.nPrevX = _local1.nX;
_local1.nPrevY = _local1.nY;
_local1._rotation = 0;
_local1.nSpeedX = 0;
_local1.nSpeedY = 0;
delete _local1.onEnterFrame;
_local1.bFanSound = false;
_local1.bConveyorSound = false;
_local1.bBoxSound = false;
};
Box.prototype.go = function () {
var _local1 = this;
var _local2 = _local1.mcScene.aRoom;
var nRoomX = (_local2[0].length - 1);
var nRoomY = (_local2.length - 1);
_local1.onEnterFrame = function () {
var _local1 = this;
_local1.frame++;
_local1.nSpeedY = _local1.nSpeedY * _local1.nAirDrag;
_local1.nSpeedY = _local1.nSpeedY + _local1.nGravity;
_local1.nSpeedX = _local1.nSpeedX * _local1.nAirDrag;
_local1.nPrevX = _local1.nX;
_local1.nPrevY = _local1.nY;
_local1.nX = _local1.nX + _local1.nSpeedX;
_local1.nY = _local1.nY + _local1.nSpeedY;
_local1._rotation = 0;
if (_local1.nX < _local1.mcScene.nTileSize) {
_local1.nX = _local1.mcScene.nTileSize;
} else if (_local1.nX > (nRoomX * _local1.mcScene.nTileSize)) {
_local1.nX = nRoomX * _local1.mcScene.nTileSize;
}
if (_local1.nY < _local1.mcScene.nTileSize) {
_local1.nY = _local1.mcScene.nTileSize;
} else if (_local1.nY > (nRoomY * _local1.mcScene.nTileSize)) {
_local1.nY = nRoomY * _local1.mcScene.nTileSize;
}
_local1.checkFans();
_local1.checkCollision();
_local1._x = _local1.nX;
_local1._y = _local1.nY;
};
};
Box.prototype.checkFans = function () {
var nTileSize = this.mcScene.nTileSize;
var _local3 = Math.floor(this.nX / nTileSize);
var _local2 = Math.floor(this.nY / nTileSize);
var aRoom = this.mcScene.aRoom;
var _local1 = this.mcScene.aTiles;
var bFan = false;
var i = _local3;
while (i > 0) {
if ((((aRoom[_local2][i] > 0) && (_local1[_local2][i].sType != "distributor")) && (_local1[_local2][i].sType != "exit")) && ((_local1[_local2][i].sType != "diagonalLeftDown") || (i != _local3))) {
if (_local1[_local2][i].sType == "rightFan") {
this.nSpeedX = this.nSpeedX + 0.9;
bFan = true;
}
break;
}
i--;
}
var i = _local3;
while (i < aRoom[0].length) {
if ((((aRoom[_local2][i] > 0) && (_local1[_local2][i].sType != "distributor")) && (_local1[_local2][i].sType != "exit")) && ((_local1[_local2][i].sType != "diagonalRightDown") || (i != _local3))) {
if (_local1[_local2][i].sType == "leftFan") {
this.nSpeedX = this.nSpeedX - 0.9;
bFan = true;
}
break;
}
i++;
}
var i = _local2;
while (i < aRoom.length) {
if (((aRoom[i][_local3] > 0) && (_local1[i][_local3].sType != "distributor")) && (_local1[i][_local3].sType != "exit")) {
if (_local1[i][_local3].sType == "anti-gravity") {
this.nSpeedY = this.nSpeedY - 1.4;
bFan = true;
}
break;
}
i++;
}
trace("starting fan sound");
if (bFan) {
var sndFan = _global.aSounds.sndFan;
if (!this.bFanSound) {
this.bFanSound = true;
sndFan.start(0, 9999);
}
var nVolume = sndFan.getVolume();
if (nVolume < 100) {
nVolume = nVolume + 10;
} else {
nVolume = 100;
}
sndFan.setVolume(nVolume);
} else {
var sndFan = _global.aSounds.sndFan;
var nVolume = sndFan.getVolume();
if (nVolume > 0) {
nVolume = nVolume - 10;
sndFan.setVolume(nVolume);
} else if (this.bFanSound) {
this.bFanSound = false;
sndFan.stop();
}
}
};
Box.prototype.checkCollision = function () {
var _local1 = this;
var aRoom = _local1.mcScene.aRoom;
var aTiles = _local1.mcScene.aTiles;
var _local2 = _local1.mcScene.nTileSize;
var nCenterX = Math.floor(_local1.nX / _local2);
var _local3 = Math.floor(_local1.nY / _local2);
_local1.bConveyor = false;
if (aRoom[_local3][nCenterX] > 0) {
_local1.reactToTile(nCenterX, _local3, _local1.getSide(aTiles[_local3][nCenterX]));
}
var nCenterX = Math.floor(_local1.nX / _local2);
_local3 = Math.floor(_local1.nY / _local2);
var oBounds = _local1.getBounds();
var nLeft = Math.floor((_local1.nX + oBounds.xMin) / _local2);
var nRight = Math.floor((_local1.nX + oBounds.xMax) / _local2);
var nTop = Math.floor((_local1.nY + oBounds.yMin) / _local2);
var nBottom = Math.floor((_local1.nY + oBounds.yMax) / _local2);
if ((nBottom != _local3) && (aRoom[nBottom][nCenterX] > 0)) {
_local1.reactToTile(nCenterX, nBottom, "bottom");
} else if ((nTop != _local3) && (aRoom[nTop][nCenterX] > 0)) {
_local1.reactToTile(nCenterX, nTop, "top");
}
_local3 = Math.floor(_local1.nY / _local2);
if ((nLeft != nCenterX) && (aRoom[_local3][nLeft] > 0)) {
_local1.reactToTile(nLeft, _local3, "left");
} else if ((nRight != nCenterX) && (aRoom[_local3][nRight] > 0)) {
_local1.reactToTile(nRight, _local3, "right");
}
if (_local1.bConveyor) {
var sndConveyor = _global.aSounds.sndConveyor;
if (!_local1.bConveyorSound) {
_local1.bConveyorSound = true;
sndConveyor.start(0, 9999);
}
var nVolume = sndConveyor.getVolume();
if (nVolume < 100) {
nVolume = nVolume + 10;
} else {
nVolume = 100;
}
sndConveyor.setVolume(nVolume);
} else {
var sndConveyor = _global.aSounds.sndConveyor;
var nVolume = sndConveyor.getVolume();
if (nVolume > 0) {
nVolume = nVolume - 10;
sndConveyor.setVolume(nVolume);
} else if (_local1.bConveyorSound) {
_local1.bConveyorSound = false;
sndConveyor.stop();
}
}
};
Box.prototype.reactToTile = function (nTileX, nTileY, sSide) {
var _local1 = this;
var _local3 = sSide;
var nTile = _local1.mcScene.aRoom[nTileY][nTileX];
var nTileSize = _local1.mcScene.nTileSize;
var _local2 = _local1.mcScene.aTiles[nTileY][nTileX];
if (_local2.sType != "distributor") {
if (_local2.sType == "wall") {
_local1.bounceBox(_local2, _local3);
} else if (_local2.sType == "horizontalConveyor") {
if (_local3 == "bottom") {
_local1.nSpeedX = ((nTile == 31) ? 3 : -3);
_local1.nSpeedY = 0;
_local1.nY = _local2._y - (_local1.nHeight / 2);
_local1.bConveyor = true;
} else {
_local1.bounceBox(_local2, _local3);
}
} else if (_local2.sType == "conveyorRightUp") {
var oPoint = new Object({x:_local1.nX, y:_local1.nY});
_local1.mcScene.localToGlobal(oPoint);
_local2.globalToLocal(oPoint);
if ((oPoint.x < 32) && (oPoint.y < 32)) {
if (oPoint.y > ((-oPoint.x) + 16)) {
_local1._rotation = 45;
_local1.nSpeedX = 3;
_local1.nSpeedY = -3;
var nB = (((-oPoint.x) + oPoint.y) - 16);
var nLocY = (nB * 0.5);
var nLocX = (-nLocY);
_local1.nY = (_local2._y + nLocY) + 16;
_local1.nX = _local2._x + nLocX;
_local1.bConveyor = true;
}
} else {
_local1.bounceBox(_local2, _local3);
}
} else if (_local2.sType == "conveyorLeftUp") {
var oPoint = new Object({x:_local1.nX, y:_local1.nY});
_local1.mcScene.localToGlobal(oPoint);
_local2.globalToLocal(oPoint);
if ((oPoint.x >= 0) && (oPoint.y < 32)) {
if (oPoint.y > (oPoint.x - 16)) {
_local1._rotation = 45;
_local1.nSpeedX = -3;
_local1.nSpeedY = -3;
var nB = ((oPoint.x + oPoint.y) + 16);
var nLocY = (nB * 0.5);
var nLocX = nLocY;
_local1.nY = (_local2._y + nLocY) - 16;
_local1.nX = _local2._x + nLocX;
_local1.bConveyor = true;
}
} else {
_local1.bounceBox(_local2, _local3);
}
} else if (_local2.sType == "lbouncer") {
if ((_local3 == "bottom") || (_local3 == "right")) {
_local1.nSpeedX = -10;
_local1.nSpeedY = -15;
_local2.spring.play();
_global.aSounds.sndSpring.start(0, 0);
} else {
_local1.bounceBox(_local2, _local3);
}
} else if (_local2.sType == "rbouncer") {
if ((_local3 == "bottom") || (_local3 == "left")) {
_local1.nSpeedX = 10;
_local1.nSpeedY = -15;
_local2.spring.play();
_global.aSounds.sndSpring.start(0, 0);
} else {
_local1.bounceBox(_local2, _local3);
}
} else if (_local2.sType == "tbouncer") {
if (_local3 == "bottom") {
_local1.nSpeedY = -18;
_local2.spring.play();
_global.aSounds.sndSpring.start(0, 0);
} else {
_local1.bounceBox(_local2, _local3);
}
} else if (_local2.sType == "anti-gravity") {
if (_local3 == "bottom") {
_local1.nY = _local2._y - (_local1.nHeight / 2);
} else {
_local1.bounceBox(_local2, _local3);
}
} else if (_local2.sType == "leftFan") {
if (_local3 == "right") {
_local1.nX = _local2._x - (_local1.nHeight / 2);
} else {
_local1.bounceBox(_local2, _local3);
}
} else if (_local2.sType == "rightFan") {
if (_local3 == "left") {
_local1.nX = (_local2._x + nTileSize) + (_local1.nHeight / 2);
} else {
_local1.bounceBox(_local2, _local3);
}
} else if (_local2.sType == "diagonalLeft") {
var oPoint = new Object({x:_local1.nX, y:_local1.nY});
_local1.mcScene.localToGlobal(oPoint);
_local2.globalToLocal(oPoint);
var oPrevPoint = new Object({x:_local1.nPrevX, y:_local1.nPrevY});
_local1.mcScene.localToGlobal(oPrevPoint);
_local2.globalToLocal(oPrevPoint);
if (((oPoint.x < 32) && (oPoint.y > 0)) && (oPrevPoint.y > 0)) {
if (oPoint.y < (oPoint.x + 16)) {
var nTmp = _local1.nSpeedY;
_local1.nSpeedY = Math.abs(_local1.nSpeedX);
_local1.nSpeedX = -Math.abs(nTmp);
var nB = ((oPoint.x + oPoint.y) - 16);
var nLocY = (nB * 0.5);
var nLocX = nLocY;
_local1.nY = (_local2._y + nLocY) + 16;
_local1.nX = _local2._x + nLocX;
}
} else {
_local1.bounceBox(_local2, _local3);
}
} else if (_local2.sType == "diagonalRight") {
var oPoint = new Object({x:_local1.nX, y:_local1.nY});
_local1.mcScene.localToGlobal(oPoint);
_local2.globalToLocal(oPoint);
var oPrevPoint = new Object({x:_local1.nPrevX, y:_local1.nPrevY});
_local1.mcScene.localToGlobal(oPrevPoint);
_local2.globalToLocal(oPrevPoint);
if (((oPoint.x > 0) && (oPoint.y > 0)) && (oPrevPoint.y > 0)) {
if (oPoint.y < ((-oPoint.x) + 48)) {
var nTmp = _local1.nSpeedY;
_local1.nSpeedY = Math.abs(_local1.nSpeedX);
_local1.nSpeedX = Math.abs(nTmp);
var nB = (((-oPoint.x) + oPoint.y) - 48);
var nLocY = (nB * 0.5);
var nLocX = (-nLocY);
_local1.nY = (_local2._y + nLocY) + 48;
_local1.nX = _local2._x + nLocX;
}
} else {
_local1.bounceBox(_local2, _local3);
}
} else if (_local2.sType == "diagonalLeftDown") {
var oPoint = new Object({x:_local1.nX, y:_local1.nY});
_local1.mcScene.localToGlobal(oPoint);
_local2.globalToLocal(oPoint);
var oPrevPoint = new Object({x:_local1.nPrevX, y:_local1.nPrevY});
_local1.mcScene.localToGlobal(oPrevPoint);
_local2.globalToLocal(oPrevPoint);
if (((oPoint.x <= 32) && (oPoint.y < 34)) && (oPrevPoint.y <= 32)) {
if (oPoint.y > ((-oPoint.x) + 20)) {
_local1._rotation = 45;
_local1.nSpeedX = _local1.nSpeedX - (_local1.nGravity * 0.5);
_local1.nSpeedX = _local1.nSpeedX * _local1.nGroundDrag;
_local1.nSpeedY = _local1.nSpeedY * _local1.nGroundDrag;
_local1.nY = (_local2._y + 20) - oPoint.x;
}
} else {
_local1.bounceBox(_local2, _local3);
}
} else if (_local2.sType == "diagonalRightDown") {
var oPoint = new Object({x:_local1.nX, y:_local1.nY});
_local1.mcScene.localToGlobal(oPoint);
_local2.globalToLocal(oPoint);
var oPrevPoint = new Object({x:_local1.nPrevX, y:_local1.nPrevY});
_local1.mcScene.localToGlobal(oPrevPoint);
_local2.globalToLocal(oPrevPoint);
if (((oPoint.x >= 0) && (oPoint.y < 34)) && (oPrevPoint.y <= 32)) {
if (oPoint.y > (oPoint.x - 12)) {
_local1._rotation = 45;
_local1.nSpeedX = _local1.nSpeedX + (_local1.nGravity * 0.5);
_local1.nSpeedX = _local1.nSpeedX * _local1.nGroundDrag;
_local1.nSpeedY = _local1.nSpeedY * _local1.nGroundDrag;
_local1.nY = (_local2._y + oPoint.x) - 12;
}
} else {
_local1.bounceBox(_local2, _local3);
}
} else if (_local2.sType == "roundBouncer") {
var oPoint = new Object({x:_local1.nX, y:_local1.nY});
_local1.mcScene.localToGlobal(oPoint);
_local2.globalToLocal(oPoint);
oPoint.x = oPoint.x - (nTileSize * 0.5);
oPoint.y = oPoint.y - (nTileSize * 0.5);
var nAngleRad = Math.atan2(oPoint.x, -oPoint.y);
_local1.nSpeedX = 18 * Math.sin(nAngleRad);
_local1.nSpeedY = -18 * Math.cos(nAngleRad);
_local2.spring_mc.play();
_global.aSounds.sndSpring.start(0, 0);
} else if (_local2.sType == "exit") {
var oPoint = new Object({x:_local1.nX, y:_local1.nY});
_local1.mcScene.localToGlobal(oPoint);
_local2.globalToLocal(oPoint);
if (((oPoint.x > 7) && (oPoint.x < 25)) && (oPoint.y > 16)) {
_local1.roomCompleted();
}
}
}
};
Box.prototype.bounceBox = function (mcTile, sSide) {
var _local1 = this;
var _local3 = mcTile;
var _local2 = _local1.mcScene.nTileSize;
switch (sSide) {
case "left" :
_local1.nX = (_local3._x + _local2) + (_local1.nWidth / 2);
_local1.nY = _local1.nPrevY;
_local1.nSpeedX = _local1.nBounce * Math.abs(_local1.nSpeedX);
break;
case "right" :
_local1.nX = _local3._x - (_local1.nWidth / 2);
_local1.nY = _local1.nPrevY;
_local1.nSpeedX = (-_local1.nBounce) * Math.abs(_local1.nSpeedX);
break;
case "bottom" :
var nPrevY = _local1.nY;
_local1.nY = _local3._y - (_local1.nHeight / 2);
_local1.nSpeedX = _local1.nSpeedX * _local1.nGroundDrag;
_local1.nSpeedY = (-_local1.nBounce) * Math.abs(_local1.nSpeedY);
break;
case "top" :
_local1.nY = (_local3._y + _local2) + (_local1.nHeight / 2);
_local1.nSpeedY = _local1.nBounce * Math.abs(_local1.nSpeedY);
}
if (Math.abs(_local1.nSpeedY) > 1) {
_global.aSounds.sndBox.start(0, 0);
}
};
Box.prototype.getSide = function (mcTile) {
var _local1 = mcTile;
var _local2 = this;
var nTileSize = _local2.mcScene.nTileSize;
var _local3 = _local2.mcScene.aRoom;
if (_local2.nSpeedY >= 0) {
if ((_local2.nPrevX > _local1._x) && (_local2.nPrevX < (_local1._x + nTileSize))) {
return("bottom");
}
if (_local2.nSpeedX > 0) {
if (((_local3[_local1.nY][_local1.nX - 1] == 0) || (_local3[_local1.nY][_local1.nX - 1] == 21)) || (_local3[_local1.nY][_local1.nX - 1] == 20)) {
return("right");
}
return("bottom");
}
if (((_local3[_local1.nY][_local1.nX + 1] == 0) || (_local3[_local1.nY][_local1.nX + 1] == 21)) || (_local3[_local1.nY][_local1.nX + 1] == 20)) {
return("left");
}
return("bottom");
}
if ((_local2.nPrevX > _local1._x) && (_local2.nPrevX < (_local1._x + nTileSize))) {
return("top");
}
if (_local2.nSpeedX > 0) {
return("right");
}
return("left");
};
Box.prototype.roomCompleted = function () {
var _local3 = _global;
var _local1 = this.mcScene._parent;
_local1.stopSounds();
var _local2 = 1;
_local3.nTimeBonus = Math.round(_local1.nBonus * _local2);
_local3.nRoomPoints = Math.round(_local1.nPoints * _local2);
delete this.onEnterFrame;
_local3.gotoLabel("roomSummary");
};
Object.registerClass("box", Box);
#endinitclip
Symbol 57 MovieClip Frame 1
stop();
Symbol 61 MovieClip Frame 1
stop();
Symbol 81 MovieClip [listTile] Frame 2
sType = "wall";
Symbol 81 MovieClip [listTile] Frame 3
sType = "wall";
Symbol 81 MovieClip [listTile] Frame 4
sType = "wall";
Symbol 81 MovieClip [listTile] Frame 5
sType = "wall";
Symbol 81 MovieClip [listTile] Frame 6
sType = "wall";
Symbol 81 MovieClip [listTile] Frame 7
sType = "wall";
Symbol 81 MovieClip [listTile] Frame 8
sType = "wall";
Symbol 81 MovieClip [listTile] Frame 9
sType = "wall";
Symbol 81 MovieClip [listTile] Frame 10
sType = "wall";
Symbol 81 MovieClip [listTile] Frame 11
sType = "wall";
Symbol 81 MovieClip [listTile] Frame 12
sType = "wall";
Symbol 81 MovieClip [listTile] Frame 21
sType = "distributor";
Symbol 81 MovieClip [listTile] Frame 22
sType = "exit";
Symbol 81 MovieClip [listTile] Frame 31
sType = "wall";
Symbol 81 MovieClip [listTile] Frame 32
sType = "horizontalConveyor";
Symbol 81 MovieClip [listTile] Frame 33
sType = "horizontalConveyor";
Symbol 81 MovieClip [listTile] Frame 34
sType = "conveyorRightUp";
Symbol 81 MovieClip [listTile] Frame 35
sType = "conveyorLeftUp";
Symbol 81 MovieClip [listTile] Frame 36
sType = "lbouncer";
Symbol 81 MovieClip [listTile] Frame 37
sType = "rbouncer";
Symbol 81 MovieClip [listTile] Frame 38
sType = "tbouncer";
Symbol 81 MovieClip [listTile] Frame 39
sType = "roundBouncer";
Symbol 81 MovieClip [listTile] Frame 40
sType = "anti-gravity";
Symbol 81 MovieClip [listTile] Frame 41
sType = "leftFan";
Symbol 81 MovieClip [listTile] Frame 42
sType = "rightFan";
Symbol 81 MovieClip [listTile] Frame 43
sType = "diagonalLeft";
Symbol 81 MovieClip [listTile] Frame 44
sType = "diagonalRight";
Symbol 81 MovieClip [listTile] Frame 45
sType = "diagonalLeftDown";
Symbol 81 MovieClip [listTile] Frame 46
sType = "diagonalRightDown";
Symbol 88 MovieClip [tile] Frame 1
#initclip 1
function Tile() {
var _local1 = this;
var ref = _local1;
var mcGame = _local1._parent._parent;
_local1.mcScene;
_local1.move_btn.onRollOver = function () {
mcGame.arrows_mc.gotoAndStop("show");
mcGame.arrows_mc._x = (ref._x + ref.mcScene._x) + (ref.mcScene.nTileSize * 0.5);
mcGame.arrows_mc._y = (ref._y + ref.mcScene._y) + (ref.mcScene.nTileSize * 0.5);
ref.trash_mc.gotoAndStop("inactive");
};
_local1.move_btn.onRollOut = function () {
mcGame.arrows_mc.gotoAndStop("hide");
ref.trash_mc.gotoAndStop("hide");
};
_local1.move_btn.onPress = function () {
mcGame.moveTile(ref);
};
_local1.trash_btn.onRollOver = function () {
ref.trash_mc.gotoAndStop("active");
};
_local1.trash_btn.onRollOut = (_local1.trash_btn.onReleaseOutside = function () {
ref.trash_mc.gotoAndStop("hide");
mcGame.arrows_mc.gotoAndStop("hide");
});
_local1.trash_btn.onRelease = function () {
ref.mcScene.removeTile(ref, true);
};
}
Tile.prototype = new MovieClip();
Tile.prototype.init = function (nX, nY, nTileNr, nTileSize, sMode, mcScene) {
var _local1 = this;
_local1.nTileNr = nTileNr;
_local1.nX = nX;
_local1.nY = nY;
_local1._x = nX * nTileSize;
_local1._y = nY * nTileSize;
_local1.sMode = sMode;
if (_local1.sMode == "noRemove") {
_local1.move_btn.enabled = false;
_local1.trash_btn.enabled = false;
}
_local1.mcScene = mcScene;
_local1.gotoAndStop(nTileNr + 1);
_local1.cross_mc.gotoAndStop("hide");
_local1.trash_mc.gotoAndStop("hide");
};
Object.registerClass("tile", Tile);
#endinitclip
Symbol 88 MovieClip [tile] Frame 2
sType = "wall";
Symbol 88 MovieClip [tile] Frame 3
sType = "wall";
Symbol 88 MovieClip [tile] Frame 4
sType = "wall";
Symbol 88 MovieClip [tile] Frame 5
sType = "wall";
Symbol 88 MovieClip [tile] Frame 6
sType = "wall";
Symbol 88 MovieClip [tile] Frame 7
sType = "wall";
Symbol 88 MovieClip [tile] Frame 8
sType = "wall";
Symbol 88 MovieClip [tile] Frame 9
sType = "wall";
Symbol 88 MovieClip [tile] Frame 10
sType = "wall";
Symbol 88 MovieClip [tile] Frame 11
sType = "wall";
Symbol 88 MovieClip [tile] Frame 12
sType = "wall";
Symbol 88 MovieClip [tile] Frame 21
sType = "distributor";
Symbol 88 MovieClip [tile] Frame 22
sType = "exit";
Symbol 88 MovieClip [tile] Frame 31
sType = "wall";
Symbol 88 MovieClip [tile] Frame 32
sType = "horizontalConveyor";
Symbol 88 MovieClip [tile] Frame 33
sType = "horizontalConveyor";
Symbol 88 MovieClip [tile] Frame 34
sType = "conveyorRightUp";
Symbol 88 MovieClip [tile] Frame 35
sType = "conveyorLeftUp";
Symbol 88 MovieClip [tile] Frame 36
sType = "lbouncer";
Symbol 88 MovieClip [tile] Frame 37
sType = "rbouncer";
Symbol 88 MovieClip [tile] Frame 38
sType = "tbouncer";
Symbol 88 MovieClip [tile] Frame 39
sType = "roundBouncer";
Symbol 88 MovieClip [tile] Frame 40
sType = "anti-gravity";
Symbol 88 MovieClip [tile] Frame 41
sType = "leftFan";
Symbol 88 MovieClip [tile] Frame 42
sType = "rightFan";
Symbol 88 MovieClip [tile] Frame 43
sType = "diagonalLeft";
Symbol 88 MovieClip [tile] Frame 44
sType = "diagonalRight";
Symbol 88 MovieClip [tile] Frame 45
sType = "diagonalLeftDown";
Symbol 88 MovieClip [tile] Frame 46
sType = "diagonalRightDown";
Symbol 111 MovieClip Frame 111
_parent.gotoAndStop("firstFront");
Symbol 111 MovieClip Frame 134
stop();
Symbol 121 MovieClip Frame 1
play_btn.onRelease = function () {
_global.gotoLabel("game");
};
instruction_btn.onRelease = function () {
_root.gotoAndStop("instruction");
};
Symbol 124 MovieClip Frame 1
stop();
Symbol 124 MovieClip Frame 36
_root.gotoAndStop(_global.sLabel);
Symbol 124 MovieClip Frame 74
_root.mcProduct.playAnimation();
Symbol 140 MovieClip Frame 1
play_btn.onRelease = function () {
_global.gotoLabel("game");
};
back_btn.onRelease = function () {
_root.gotoAndStop("front");
};
kerb_btn.onRelease = function () {
getURL ("http://www.kerb.co.uk", "_blank");
};
Symbol 166 MovieClip Frame 1
stop();
Symbol 166 MovieClip Frame 47
_root.mcProduct.setProductRow(mcProd0, 0);
Symbol 166 MovieClip Frame 52
_root.mcProduct.setProductRow(mcProd1, 1);
Symbol 166 MovieClip Frame 57
_root.mcProduct.setProductRow(mcProd2, 2);
Symbol 166 MovieClip Frame 75
stop();
Symbol 177 MovieClip Frame 1
stop();
Symbol 177 MovieClip Frame 39
_root.mcProduct.setProductRow(mcProd0, 0);
Symbol 177 MovieClip Frame 44
_root.mcProduct.setProductRow(mcProd1, 1);
Symbol 177 MovieClip Frame 49
_root.mcProduct.setProductRow(mcProd2, 2);
Symbol 177 MovieClip Frame 67
stop();
Symbol 187 MovieClip Frame 1
stop();
Symbol 187 MovieClip Frame 47
_root.mcProduct.setProductRow(mcProd0, 0);
Symbol 187 MovieClip Frame 52
_root.mcProduct.setProductRow(mcProd1, 1);
Symbol 187 MovieClip Frame 57
_root.mcProduct.setProductRow(mcProd2, 2);
Symbol 187 MovieClip Frame 72
stop();
Symbol 192 MovieClip Frame 1
stop();
Symbol 192 MovieClip Frame 53
_root.mcProduct.setProductRow(mcProd0, 0);
Symbol 192 MovieClip Frame 58
_root.mcProduct.setProductRow(mcProd1, 1);
Symbol 192 MovieClip Frame 63
_root.mcProduct.setProductRow(mcProd2, 2);
Symbol 192 MovieClip Frame 76
stop();
Symbol 200 MovieClip Frame 1
stop();
Symbol 200 MovieClip Frame 59
_root.mcProduct.setProductRow(mcProd0, 0);
Symbol 200 MovieClip Frame 64
_root.mcProduct.setProductRow(mcProd1, 1);
Symbol 200 MovieClip Frame 69
_root.mcProduct.setProductRow(mcProd2, 2);
Symbol 200 MovieClip Frame 87
stop();
Symbol 205 MovieClip Frame 1
stop();
Symbol 205 MovieClip Frame 70
_root.mcProduct.setProductRow(mcProd0, 0);
Symbol 205 MovieClip Frame 75
_root.mcProduct.setProductRow(mcProd1, 1);
Symbol 205 MovieClip Frame 80
_root.mcProduct.setProductRow(mcProd2, 2);
Symbol 205 MovieClip Frame 97
stop();
Symbol 213 MovieClip Frame 1
stop();
Symbol 213 MovieClip Frame 88
_root.mcProduct.setProductRow(mcProd0, 0);
Symbol 213 MovieClip Frame 93
_root.mcProduct.setProductRow(mcProd1, 1);
Symbol 213 MovieClip Frame 98
_root.mcProduct.setProductRow(mcProd2, 2);
Symbol 213 MovieClip Frame 114
stop();
Symbol 218 MovieClip Frame 1
stop();
Symbol 219 MovieClip [product] Frame 1
#initclip 3
function Product() {
this.mcAnimationsHolder.gotoAndStop(_global.nRoom + 1);
}
Product.prototype = new MovieClip();
Product.prototype.init = function (aProducts) {
this.aProducts = aProducts;
};
Product.prototype.playAnimation = function () {
this.mcAnimationsHolder.mcAnimation.play();
};
Product.prototype.setProductRow = function (mcProd, nNumber) {
var _local1 = this;
var _local2 = mcProd;
var _local3 = nNumber;
var me = _local1;
var oProduct = _local1.aProducts[_global.nRoom];
_local2.gotoAndStop("out");
_local2.name_txt.autoSize = "left";
_local2.sName = oProduct.aProduct[_local3].sName;
_local2.price_txt.autoSize = "left";
_local2.nPrice = formatNumber(oProduct.aProduct[_local3].nPrice);
_local2.bBonus = oProduct.aProduct[_local3].bBonus;
_local2.sInfo = oProduct.aProduct[_local3].sInfo;
_local2.button_btn.onRelease = function () {
var _local1 = this;
_local1 = _local1._parent;
var mcGame = _local1._parent._parent;
_global.aComponentsList.push({sCategory:oProduct.sCategory, sName:_local1.sName, nPrice:_local1.nPrice, bBonus:_local1.bBonus});
if (_local1.bBonus) {
_global.nPoints = _global.nPoints + 100;
_root.gotoAndStop("game");
} else {
_root.gotoAndStop("game");
}
};
_local2.button_btn.onRollOver = function () {
var _local1 = this;
_local1 = _local1._parent;
_local1.gotoAndStop("over");
_local1.name_txt.autoSize = "left";
_local1.price_txt.autoSize = "left";
};
_local2.button_btn.onRollOut = function () {
var _local1 = this;
_local1 = _local1._parent;
_local1.gotoAndStop("out");
_local1.name_txt.autoSize = "left";
_local1.price_txt.autoSize = "left";
};
_local2.info_btn.onRollOver = function () {
var _local1 = this;
_local1 = _local1._parent;
var _local3 = _local1._parent._parent._parent;
var _local2 = _local3.mcCloud;
_local2.gotoAndStop("show");
_local2.tfInfo.autoSize = "left";
_local2.tfInfo.text = _local1.sInfo;
_local2.mcBox._height = _local2.tfInfo._height + 14;
var oPoint = new Object({x:_local1.info_btn._x, y:_local1.info_btn._y});
_local1.localToGlobal(oPoint);
_local3.globalToLocal(oPoint);
};
_local2.info_btn.onRollOut = (_local2.info_btn.onDragOut = function () {
var _local1 = this;
_local1 = _local1._parent;
var _local2 = _local1._parent._parent._parent;
var _local3 = _local2.mcCloud;
_local3.gotoAndStop("hide");
});
};
Object.registerClass("product", Product);
#endinitclip
this.init(_parent.oData.getProducts());
Symbol 240 MovieClip Frame 6
stop();
Symbol 259 MovieClip [scene] Frame 1
#initclip 5
function Scene() {
var _local1 = this;
_local1.nTileSize = 32;
_local1.nDepth = 0;
_local1.aTiles = new Array();
}
Scene.prototype = new MovieClip();
Scene.prototype.init = function (aRoom) {
var _local2 = aRoom;
var _local3 = this;
_local3.aOrgRoom = new Array(_local2.length);
var _local1 = 0;
while (_local1 < _local2.length) {
_local3.aOrgRoom[_local1] = _local2[_local1].slice();
_local1++;
}
_local3.aRoom = new Array(_local2.length);
_local1 = 0;
while (_local1 < _local2.length) {
_local3.aRoom[_local1] = _local2[_local1].slice();
_local1++;
}
_local3.createRoom();
};
Scene.prototype.createRoom = function () {
var _local1 = this;
var _local3 = 0;
while (_local3 < _local1.aOrgRoom.length) {
_local1.aTiles[_local3] = new Array(_local1.aOrgRoom[0].length);
var _local2 = 0;
while (_local2 < _local1.aOrgRoom[0].length) {
var nTileNr = _local1.aOrgRoom[_local3][_local2];
var mcTile = _local1.attachMovie("tile", "tile" + _local1.nDepth, _local1.nDepth);
mcTile.init(_local2, _local3, nTileNr, _local1.nTileSize, "noRemove", _local1);
_local1.aTiles[_local3][_local2] = mcTile;
_local1.nDepth++;
if (nTileNr == 20) {
var nDepth = 901;
var mcBox = _local1.attachMovie("box", "mcBox", nDepth);
mcBox._x = (_local2 + 0.5) * _local1.nTileSize;
mcBox._y = (_local3 + 0.5) * _local1.nTileSize;
mcBox.init(_local1);
}
_local2++;
}
_local3++;
}
};
Scene.prototype.resetRoom = function () {
this.mcBox.reset();
};
Scene.prototype.clearRoom = function () {
var _local2 = this;
_local2.mcBox.reset();
var _local3 = 0;
while (_local3 < _local2.aOrgRoom.length) {
var _local1 = 0;
while (_local1 < _local2.aOrgRoom[0].length) {
if (_local2.aRoom[_local3][_local1] != _local2.aOrgRoom[_local3][_local1]) {
_local2.removeTile(_local2.aTiles[_local3][_local1], true);
_local2.aRoom[_local3][_local1] = _local2.aOrgRoom[_local3][_local1];
}
_local1++;
}
_local3++;
}
};
Scene.prototype.putTile = function (nX, nY, nTileNr) {
var _local1 = this;
var _local2 = nY;
var _local3 = nX;
var nDepth = _local1.aTiles[_local2][_local3].getDepth();
_local1.aTiles[_local2][_local3].removeMovieClip();
var mcTile = _local1.attachMovie("tile", "tile" + nDepth, nDepth);
mcTile.init(_local3, _local2, nTileNr, _local1.nTileSize, "remove", _local1);
_local1.aRoom[_local2][_local3] = nTileNr;
_local1.aTiles[_local2][_local3] = mcTile;
};
Scene.prototype.removeTile = function (mcTile, bIncrase) {
var nX = mcTile.nX;
var nY = mcTile.nY;
var _local3 = mcTile.nTileNr;
var nDepth = mcTile.getDepth();
mcTile.removeMovieClip();
var nNewTileNr = 0;
var mcTile = this.attachMovie("tile", "tile" + nDepth, nDepth);
mcTile.init(nX, nY, nNewTileNr, this.nTileSize, "noRemove", this);
this.aRoom[nY][nX] = nNewTileNr;
this.aTiles[nY][nX] = mcTile;
if (bIncrase) {
var _local2 = this._parent;
var mcListTile = _local2.tilesList_mc["tile" + _local3];
mcListTile.count++;
var _local1 = 0;
while (_local2.aListTiles[_local1].tile != _local3) {
_local1++;
}
_local2.aListTiles[_local1].nr++;
}
};
Scene.prototype.setTilesState = function (bState) {
var _local3 = this;
var _local2 = 0;
while (_local2 < _local3.aRoom.length) {
var _local1 = 0;
while (_local1 < _local3.aRoom[0].length) {
if (_local3.aTiles[_local2][_local1].sMode == "remove") {
_local3.aTiles[_local2][_local1].move_btn.enabled = bState;
_local3.aTiles[_local2][_local1].trash_btn.enabled = bState;
}
_local1++;
}
_local2++;
}
};
Object.registerClass("scene", Scene);
#endinitclip
Symbol 264 MovieClip [game] Frame 1
#initclip 4
function Game() {
var _local1 = this;
var _local2 = _global;
_local1.sMode = "project";
_local1.mcTakenTile;
_local1.arrows_mc.gotoAndStop("hide");
_local1.go_btn.onRelease = function () {
var _local1 = this;
_local1 = _local1._parent;
_local1.changeMode("test");
};
_local1.stop_btn.onRelease = function () {
var _local1 = this;
_local1 = _local1._parent;
_local1.changeMode("project");
};
_local1.clear_btn.onRelease = function () {
var _local1 = this;
_local1 = _local1._parent;
_local1.clearRoom();
};
_local1.skip_btn.onRelease = function () {
var _local1 = _global;
var _local2 = this;
_local2 = _local2._parent;
_local2.stopSounds();
_local1.nTimeBonus = 0;
_local1.nRoomPoints = 0;
_local1.gotoLabel("roomSummary");
};
_local2.aSounds = new Array();
var _local3 = _local1.createEmptyMovieClip("mcSound0", 0);
_local2.aSounds.sndBoxStart = new Sound(_local3);
_local2.aSounds.sndBoxStart.attachSound("sndBoxStart");
_local3 = _local1.createEmptyMovieClip("mcSound1", 1);
_local2.aSounds.sndBox = new Sound(_local3);
_local2.aSounds.sndBox.attachSound("sndBox");
_local3 = _local1.createEmptyMovieClip("mcSound2", 2);
_local2.aSounds.sndConveyor = new Sound(_local3);
_local2.aSounds.sndConveyor.attachSound("sndConveyor");
_local2.aSounds.sndConveyor.setVolume(0);
_local3 = _local1.createEmptyMovieClip("mcSound3", 3);
_local2.aSounds.sndFan = new Sound(_local3);
_local2.aSounds.sndFan.attachSound("sndFan");
_local2.aSounds.sndFan.setVolume(0);
_local3 = _local1.createEmptyMovieClip("mcSound4", 4);
_local2.aSounds.sndSpring = new Sound(_local3);
_local2.aSounds.sndSpring.attachSound("sndSpring");
}
Game.prototype = new MovieClip();
Game.prototype.init = function () {
var _local1 = this;
var _local2 = _global;
_local1.nFPS = 32;
_local1.nFrame = 0;
_local1.nAttemp = 1;
_local1.nMaxAttemps = _local1.aAttemps[_local2.nRoom];
_local1.nBonus = 1000;
_local1.nBonusStep = 1;
_local1.nPoints = 1000;
_local1.points_txt.text = _local2.nPoints;
_local1.attemp_txt.text = (_local1.nAttemp + "/") + _local1.nMaxAttemps;
_local1.room_txt.text = _local2.nRoom + 1;
_local1.scene_mc.init(_local1.aRoom[_local2.nRoom]);
_local1.aListTiles = _local1.aTiles[_local2.nRoom].slice();
_local1.nMaxListTiles = 10;
_local1.nListPage = 0;
_local1.createList();
_local1.startGame();
_local1.stop_btn._visible = false;
_local1.bonusBar_mc.bar_mc.gotoAndStop("still");
};
Game.prototype.startGame = function () {
this.startBonusTimer();
};
Game.prototype.createList = function () {
var _local1 = this;
var ref = _local1;
for (sName in _local1.tilesList_mc) {
_local1.tilesList_mc[sName].removeMovieClip();
}
var nListBegin = (_local1.nListPage * _local1.nMaxListTiles);
if ((_local1.aListTiles.length - nListBegin) > _local1.nMaxListTiles) {
var nListLength = _local1.nMaxListTiles;
} else {
var nListLength = (_local1.aListTiles.length - nListBegin);
}
var _local3 = 0;
while (_local3 < nListLength) {
var nInd = (nListBegin + _local3);
var sName = ("tile" + _local1.aListTiles[nInd].tile);
var _local2 = _local1.tilesList_mc.attachMovie("listTile", sName, _local3);
_local2._x = 10 + ((_local3 % 2) * 70);
_local2._y = 10 + (Math.floor(_local3 / 2) * 50);
_local2.gotoAndStop(_local1.aListTiles[nInd].tile + 1);
_local2.nListIndex = nInd;
_local2.nTileNr = _local1.aListTiles[nInd].tile;
_local2.count = _local1.aListTiles[nInd].nr;
_local2.take_btn.onPress = function () {
ref.takeTile(this._parent);
};
if (((_local1.nListPage + 1) * _local1.nMaxListTiles) < _local1.aListTiles.length) {
_local1.tilesList_mc.next_btn.enabled = true;
_local1.tilesList_mc.next_btn._alpha = 100;
_local1.tilesList_mc.next_btn.onRelease = function () {
ref.nListPage++;
ref.createList();
};
} else {
_local1.tilesList_mc.next_btn.enabled = false;
_local1.tilesList_mc.next_btn._alpha = 0;
}
if (_local1.nListPage > 0) {
_local1.tilesList_mc.prev_btn.enabled = true;
_local1.tilesList_mc.prev_btn._alpha = 100;
_local1.tilesList_mc.prev_btn.onRelease = function () {
ref.nListPage--;
ref.createList();
};
} else {
_local1.tilesList_mc.prev_btn.enabled = false;
_local1.tilesList_mc.prev_btn._alpha = 0;
}
_local3++;
}
};
Game.prototype.changeMode = function (sMode) {
var _local1 = this;
_local1.sMode = sMode;
if (sMode == "test") {
_local1.scene_mc.mcBox.go();
_local1.go_btn._visible = false;
_local1.stop_btn._visible = true;
_local1.clear_btn.enabled = false;
_local1.clear_btn._alpha = 70;
for (var _local3 in _local1.tilesList_mc) {
var _local2 = _local1.tilesList_mc[_local3];
_local2._alpha = 70;
_local2.take_btn.enabled = false;
}
_local1.tilesList_mc.next_btn.enabled = false;
_local1.tilesList_mc.prev_btn.enabled = false;
_local1.scene_mc.setTilesState(false);
_local1.stopBonusTimer();
_global.aSounds.sndBoxStart.start(0, 0);
} else {
_local1.stopSounds();
if (_local1.nAttemp == _local1.nMaxAttemps) {
_local1.gameOver();
} else {
_local1.nAttemp++;
_local1.attemp_txt.text = (_local1.nAttemp + "/") + _local1.nMaxAttemps;
_local1.scene_mc.resetRoom();
_local1.go_btn._visible = true;
_local1.stop_btn._visible = false;
_local1.clear_btn.enabled = true;
_local1.clear_btn._alpha = 100;
_local1.createList();
_local1.scene_mc.setTilesState(true);
_local1.startBonusTimer();
}
}
};
Game.prototype.clearRoom = function () {
this.scene_mc.clearRoom();
};
Game.prototype.takeTile = function (mcTakenTile) {
var _local1 = mcTakenTile;
if (_local1.count > 0) {
_local1.count--;
this.aListTiles[_local1.nListIndex].nr--;
this.movingTile(_local1.nTileNr);
}
};
Game.prototype.moveTile = function (mcTile) {
var _local1 = mcTile.nTileNr;
this.scene_mc.removeTile(mcTile, false);
this.movingTile(_local1);
};
Game.prototype.movingTile = function (nTakenTileNr) {
var _local1 = this;
var _local3 = _root;
var ref = _local1;
var nX;
var nY;
var bOverScene;
var bAvailable = true;
var nTileSize = _local1.scene_mc.nTileSize;
_local1.nTakenTileNr = nTakenTileNr;
var mcTile = _local1.attachMovie("tile", "tileTmp", 0);
mcTile.cross_mc.gotoAndStop("hide");
mcTile.trash_mc.gotoAndStop("hide");
mcTile._alpha = 50;
mcTile.gotoAndStop(nTakenTileNr + 1);
if (!_local1.scene_mc.hitTest(_local3._xmouse, _local3._ymouse, true)) {
bOverScene = false;
mcTile._x = _local1._xmouse - (nTileSize / 2);
mcTile._y = _local1._ymouse - (nTileSize / 2);
} else {
bOverScene = true;
nX = Math.floor((_local3._xmouse - _local1.scene_mc._x) / nTileSize);
nY = Math.floor((_local3._ymouse - _local1.scene_mc._y) / nTileSize);
mcTile._x = _local1.scene_mc._x + (nX * nTileSize);
mcTile._y = _local1.scene_mc._y + (nY * nTileSize);
}
_local1.MouseList = new Object();
_local1.MouseList.onMouseUp = function () {
if (bOverScene && (bAvailable)) {
ref.scene_mc.putTile(nX, nY, ref.nTakenTileNr);
} else {
ref.arrows_mc.gotoAndStop("hide");
ref.tilesList_mc["tile" + nTakenTileNr].count++;
var _local1 = 0;
while (ref.aListTiles[_local1].tile != ref.nTakenTileNr) {
_local1++;
}
ref.aListTiles[_local1].nr++;
}
mcTile.removeMovieClip();
Mouse.removeListener(this);
};
_local1.MouseList.onMouseMove = function () {
var _local1 = _root._xmouse;
var _local2 = _root._ymouse;
if (ref.scene_mc.hitTest(_local1, _local2, true)) {
bOverScene = true;
nX = Math.floor((_local1 - ref.scene_mc._x) / nTileSize);
nY = Math.floor((_local2 - ref.scene_mc._y) / nTileSize);
mcTile._x = ref.scene_mc._x + (nX * nTileSize);
mcTile._y = ref.scene_mc._y + (nY * nTileSize);
if (ref.scene_mc.aRoom[nY][nX] == 0) {
bAvailable = true;
mcTile.cross_mc.gotoAndStop("hide");
} else {
bAvailable = false;
mcTile.cross_mc.gotoAndStop("show");
}
} else {
bOverScene = false;
mcTile.cross_mc.gotoAndStop("hide");
mcTile._x = _local1 - (nTileSize / 2);
mcTile._y = _local2 - (nTileSize / 2);
}
ref.arrows_mc._x = mcTile._x + (nTileSize * 0.5);
ref.arrows_mc._y = mcTile._y + (nTileSize * 0.5);
};
Mouse.addListener(_local1.MouseList);
};
Game.prototype.addTileToList = function (nTileNr) {
var _local2 = this;
var _local3 = nTileNr;
var sName = ("tile" + _local3);
var mcListTile = _local2.tilesList_mc[sName];
_local2.mcListTile.count++;
var _local1 = 0;
while (_local2.aListTiles[_local1].tile != _local3) {
_local1++;
}
_local2.aListTiles[_local1].nr++;
};
Game.prototype.startBonusTimer = function () {
this.invBonus = setInterval(this, "decraseBonus", 200);
};
Game.prototype.stopBonusTimer = function () {
clearInterval(this.invBonus);
};
Game.prototype.decraseBonus = function () {
var _local1 = this;
if (_local1.nBonus > 0) {
_local1.nBonus = _local1.nBonus - _local1.nBonusStep;
} else {
_local1.nBonus = 0;
_local1.stopBonusTimer();
}
_local1.bonusBar_mc.mask_mc._xscale = _local1.nBonus / 10;
if (_local1.nBonus < 300) {
_local1.bonusBar_mc.bar_mc.gotoAndStop("flick");
}
};
Game.prototype.gameOver = function () {
_global.sResult = "failed";
_global.gotoLabel("endGame");
};
Game.prototype.stopSounds = function () {
var _local1 = _global;
_local1.aSounds.sndBoxStart.stop();
_local1.aSounds.sndBox.stop();
_local1.aSounds.sndConveyor.stop();
_local1.aSounds.sndConveyor.setVolume(0);
_local1.aSounds.sndFan.stop();
_local1.aSounds.sndFan.setVolume(0);
_local1.aSounds.sndSpring.stop();
};
Object.registerClass("game", Game);
#endinitclip
_global.nTotalRooms = 3;
aRoom = new Array();
aTiles = new Array();
aAttemps = new Array();
var i = 0;
while (i < _global.nTotalRooms) {
aRoom[i] = new Array();
aTiles = new Array();
i++;
}
aRoom[0][0] = [8, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 9];
aRoom[0][1] = [3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3];
aRoom[0][2] = [3, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3];
aRoom[0][3] = [3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3];
aRoom[0][4] = [3, 6, 1, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3];
aRoom[0][5] = [3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3];
aRoom[0][6] = [3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 3];
aRoom[0][7] = [3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 1, 1, 1, 7, 3];
aRoom[0][8] = [3, 30, 0, 0, 0, 0, 30, 0, 0, 0, 0, 0, 0, 0, 0, 3];
aRoom[0][9] = [3, 30, 30, 4, 0, 30, 30, 0, 4, 0, 0, 0, 0, 0, 0, 3];
aRoom[0][10] = [3, 30, 30, 5, 30, 30, 30, 30, 5, 0, 0, 0, 0, 0, 0, 3];
aRoom[0][11] = [10, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 11];
aTiles[0] = [{tile:31, nr:4}, {tile:33, nr:1}, {tile:41, nr:1}, {tile:36, nr:1}];
aAttemps[0] = 10;
aRoom[1][0] = [8, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 9];
aRoom[1][1] = [3, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 3];
aRoom[1][2] = [3, 0, 20, 0, 0, 0, 10, 9, 0, 0, 0, 0, 0, 0, 0, 3];
aRoom[1][3] = [3, 6, 1, 7, 0, 0, 0, 10, 9, 0, 0, 0, 0, 21, 0, 3];
aRoom[1][4] = [3, 0, 0, 0, 0, 0, 0, 30, 3, 0, 0, 0, 0, 6, 7, 3];
aRoom[1][5] = [3, 0, 0, 0, 0, 0, 0, 30, 3, 0, 0, 0, 0, 0, 0, 3];
aRoom[1][6] = [3, 0, 0, 0, 6, 1, 1, 1, 11, 0, 0, 0, 0, 0, 0, 3];
aRoom[1][7] = [3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 1, 7, 3];
aRoom[1][8] = [3, 30, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 30, 0, 3];
aRoom[1][9] = [3, 8, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 30, 0, 3];
aRoom[1][10] = [3, 10, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 30, 30, 3];
aRoom[1][11] = [10, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 11];
aTiles[1] = [{tile:40, nr:1}, {tile:41, nr:2}, {tile:39, nr:1}, {tile:33, nr:5}, {tile:37, nr:1}, {tile:36, nr:1}, {tile:35, nr:1}, {tile:30, nr:1}];
aAttemps[1] = 10;
aRoom[2][0] = [8, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 9];
aRoom[2][1] = [3, 0, 0, 0, 0, 4, 30, 4, 0, 0, 0, 42, 43, 0, 0, 3];
aRoom[2][2] = [3, 0, 0, 0, 0, 3, 30, 3, 0, 0, 0, 0, 0, 0, 0, 3];
aRoom[2][3] = [3, 0, 0, 0, 0, 3, 30, 3, 0, 0, 0, 0, 0, 0, 0, 3];
aRoom[2][4] = [3, 0, 0, 0, 0, 10, 2, 11, 0, 0, 0, 0, 0, 0, 0, 3];
aRoom[2][5] = [3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3];
aRoom[2][6] = [3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3];
aRoom[2][7] = [3, 0, 8, 1, 9, 0, 0, 0, 8, 1, 9, 0, 0, 0, 0, 3];
aRoom[2][8] = [3, 0, 3, 30, 3, 0, 0, 0, 3, 30, 3, 0, 0, 20, 0, 3];
aRoom[2][9] = [3, 0, 3, 30, 3, 0, 0, 0, 3, 30, 3, 0, 0, 0, 0, 3];
aRoom[2][10] = [3, 21, 5, 30, 5, 0, 0, 0, 5, 30, 5, 0, 0, 0, 0, 3];
aRoom[2][11] = [10, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 11];
aTiles[2] = [{tile:34, nr:1}, {tile:39, nr:1}, {tile:32, nr:1}, {tile:35, nr:1}, {tile:40, nr:1}];
aAttemps[2] = 10;
this.init();
Symbol 280 MovieClip [summary] Frame 1
#initclip 6
function Summary() {
var _local1 = _global;
var _local2 = this;
_local2.header_txt.text = "ROOM " + (_local1.nRoom + 1);
_local2.bonus_txt.text = _local1.nTimeBonus;
_local2.roomPoints_txt.text = _local1.nRoomPoints;
_local1.nPoints = _local1.nPoints + (_local1.nRoomPoints + _local1.nTimeBonus);
_local2.totalPoints_txt.text = _local1.nPoints;
if ((_local1.nRoom + 1) >= _local1.nTotalRooms) {
_local2.nextRoom_btn._visible = false;
_local2.continue_btn.onRelease = function () {
_global.sResult = "success";
_root.gotoAndStop("endGame");
};
} else {
_local2.continue_btn._visible = false;
_local2.nextRoom_btn.onRelease = function () {
_global.nRoom++;
_global.gotoLabel("game");
};
}
_local2.star_mc._visible = _local1.aComponentsList[_local1.nRoom].bBonus;
}
Summary.prototype = new MovieClip();
Object.registerClass("summary", Summary);
#endinitclip
Symbol 284 Button
on (release) {
getURL ("http://www.kerb.co.uk", "_blank");
}
Symbol 289 Button
on (release) {
getURL ("http://www.cclonline.com/pc/hardware/software/thecclgame/", "_blank");
}
Symbol 294 MovieClip [end] Frame 1
#initclip 7
function End() {
if (_global.sResult == "success") {
this.gotoAndStop("success");
} else {
this.gotoAndStop("failed");
}
this.points_txt.text = _global.nPoints;
this.playAgain_btn.onRelease = function () {
_global.resetVariables();
_root.gotoAndStop("front");
};
this.sendScore_btn.onRelease = function () {
_root.gotoAndStop("send");
};
var nLength = _global.aComponentsList.length;
var nTotalPrice = 0;
var _local2 = 0;
while (_local2 < nLength) {
var _local3 = _global.aComponentsList[_local2];
var _local1 = this.components_mc.attachMovie("component_row", "component" + _local2, _local2, {_x:-10, _y:66 + (_local2 * 30)});
_local1.sCategory = _local3.sCategory + ":";
_local1.sName = _local3.sName;
_local1.price_txt.autoSize = "right";
_local1.nPrice = formatNumber(_local3.nPrice);
_local1.star_mc._visible = _local3.bBonus;
nTotalPrice = nTotalPrice + Number(_local1.nPrice);
_local1.pound_mc._x = _local1.price_txt._x - 2;
_local2++;
}
var mcTotal = this.components_mc.total_mc;
mcTotal.price_txt.autoSize = "right";
mcTotal.nTotalPrice = formatNumber(nTotalPrice);
mcTotal.pound_mc._x = mcTotal.price_txt._x - 2;
mcTotal.mcTotal._x = mcTotal.pound_mc._x - 23;
}
End.prototype = new MovieClip();
End.prototype.setComponentsList = function () {
};
Object.registerClass("end", End);
#endinitclip
this.setComponentsList();
Symbol 294 MovieClip [end] Frame 11
this.setComponentsList();
Symbol 316 MovieClip Frame 1
stop();
Symbol 316 MovieClip Frame 2
blockade_btn.useHandCursor = false;
Symbol 321 MovieClip [friend] Frame 1
#initclip 8
function Friend() {
var ref = this;
this.back_btn.onRelease = function () {
_root.gotoAndStop("front");
};
this.message_mc._visible = false;
with (this.submitForm_mc) {
Selection.setFocus(nick_txt);
nick_txt.tabIndex = 0;
email_txt.tabIndex = 1;
friendNick_txt.tabIndex = 2;
friendEmail_txt.tabIndex = 3;
nick_txt.restrict = "A-Za-z0-9 ";
friendNick_txt.restrict = "A-Za-z0-9 ";
email_txt.restrict = "A-Za-z0-9_.@\\-";
friendEmail_txt.restrict = "A-Za-z0-9_.@\\-";
nick_mc.gotoAndStop("black");
friendNick_mc.gotoAndStop("black");
email_mc.gotoAndStop("black");
friendEmail_mc.gotoAndStop("black");
send_btn.onRelease = function () {
nick_mc.gotoAndStop("black");
friendNick_mc.gotoAndStop("black");
email_mc.gotoAndStop("black");
friendEmail_mc.gotoAndStop("black");
if (nick_txt.length > 0) {
if ((email_txt.length > 0) && (_global.checkEmail(email_txt.text))) {
if (friendNick_txt.length > 0) {
if ((friendEmail_txt.length > 0) && (_global.checkEmail(friendEmail_txt.text))) {
loader_mc.gotoAndStop("show");
var _local1 = new LoadVars();
_local1.sendername = nick_txt.text;
_local1.sendermail = email_txt.text;
_local1.friendname = friendNick_txt.text;
_local1.friendmail = friendEmail_txt.text;
_local1.loader_mc = loader_mc;
_local1.onLoad = function (success) {
trace(("email send [" + success) + "]");
trace(("hiding [" + loader_mc) + "]");
this.loader_mc.gotoAndStop("hide");
if (success) {
ref.onSendEmail();
}
};
_local1.sendAndLoad("_scripts/fgf.asp", _local1, "GET");
} else {
friendEmail_mc.gotoAndStop("red");
Selection.setFocus(friendEmail_txt);
Selection.setSelection(0, friendEmail_txt.length);
}
} else {
friendNick_mc.gotoAndStop("red");
Selection.setFocus(friendNick_txt);
}
} else {
email_mc.gotoAndStop("red");
Selection.setFocus(email_txt);
Selection.setSelection(0, email_txt.length);
}
} else {
nick_mc.gotoAndStop("red");
Selection.setFocus(nick_txt);
}
};
}
}
Friend.prototype = new MovieClip();
Friend.prototype.onSendEmail = function () {
this.message_mc._visible = true;
this.submitForm_mc._visible = false;
this.back_btn._visible = false;
with (this.message_mc) {
play_btn.onRelease = function () {
_root.gotoAndStop("game");
};
back_btn.onRelease = function () {
_root.gotoAndStop("front");
};
}
};
Object.registerClass("friend", Friend);
#endinitclip
Symbol 330 MovieClip Frame 1
stop();
Symbol 333 MovieClip Frame 1
stop();
Symbol 333 MovieClip Frame 2
blockade_btn.useHandCursor = false;
Symbol 339 MovieClip [send] Frame 1
#initclip 9
function Send() {
var ref = this;
var bSendEmail = false;
this.back_btn.onRelease = function () {
_global.gotoLabel("end");
};
this.playAgain_btn.onRelease = function () {
_global.resetVariables();
_root.gotoAndStop("front");
};
this.messages_mc.gotoAndStop("none");
with (this.submitForm_mc) {
nick_mc.gotoAndStop("black");
email_mc.gotoAndStop("black");
Selection.setFocus(nick_txt);
nick_txt.tabIndex = 0;
email_txt.tabIndex = 1;
nick_txt.restrict = "A-Za-z0-9";
email_txt.restrict = "A-Za-z0-9_.@\\-";
mcCheckBox.onRelease = function () {
bSendEmail = !bSendEmail;
if (bSendEmail) {
this.gotoAndStop("on");
} else {
this.gotoAndStop("off");
}
};
send_btn.onRelease = function () {
var _local3 = _global;
nick_mc.gotoAndStop("black");
email_mc.gotoAndStop("black");
if (nick_txt.length > 0) {
if (((email_txt.length > 0) && (_local3.checkEmail(email_txt.text))) || (!bSendEmail)) {
_local3.saved = true;
loader_mc.gotoAndStop("show");
var _local1 = new LoadVars();
_local1.score = _local3.nPoints;
_local1.name = nick_txt.text;
_local1.onLoad = function (success) {
loader_mc.gotoAndStop("hide");
if (success) {
ref.submitForm_mc._visible = false;
ref.messages_mc.gotoAndStop("send");
}
};
_local1.sendAndLoad("_scripts/savehighscore.asp", _local1, "POST");
if (bSendEmail) {
var _local2 = new LoadVars();
_local2.email = email_txt.text;
_local2.name = nick_txt.text;
_local2.sendAndLoad("_scripts/saveemail.asp", _local2, "POST");
}
} else {
email_mc.gotoAndStop("red");
Selection.setFocus(email_txt);
Selection.setSelection(0, email_txt.length);
}
} else {
nick_mc.gotoAndStop("red");
Selection.setFocus(nick_txt);
}
};
}
}
Send.prototype = new MovieClip();
Object.registerClass("send", Send);
#endinitclip