Frame 1
function gameIntF() {
this.gameResetF();
this.gameLevelV++;
var _local4 = Number(this.cubixMinV) + Number(this.gameLevelV);
if ((this.gameLevelV % 4) != 0) {
var _local5 = (Number(this.cubixRandomMinV) + (Number(this.gameLevelV) % 4)) - 1;
} else {
var _local5 = Number(this.cubixRandomMinV) + (Number(this.gameLevelV) % 4);
}
this.cubixColorStartV = (this.gameLevelV % 8) - 1;
if (this.cubixColorStartV < 0) {
this.cubixColorStartV = 0;
}
trace((("pieceV : " + _local4) + " -- randomV : ") + _local5);
this.cubixPieceV = _local4;
this.cubixRowTotalV = _local4;
this.cubixColTotalV = _local4;
this.cubixTotalV = _local4 * _local4;
this.cubixWV = this.stageWV / this.cubixPieceV;
this.cubixHV = this.stageHV / this.cubixPieceV;
this.cubixIntXGapV = 0;
this.cubixIntYGapV = 0;
this.cubixRandomV = _local5;
this.itemChanceV = this.itemChanceMaxV;
this.lineStepV = 0;
this.lineStepTotalV = _local4;
var _local3 = 1;
while (_local3 <= this.cubixRowTotalV) {
this["dataArr" + _local3] = new Array();
this["tempDataArr" + _local3] = new Array();
var _local2 = 1;
while (_local2 <= this.cubixColTotalV) {
this["dataArr" + _local3][_local2 - 1] = 0;
this["tempDataArr" + _local3][_local2 - 1] = 0;
_local2++;
}
_local3++;
}
_local3 = 1;
while (_local3 <= this.cubixRandomV) {
this["cubixTypeV" + _local3] = 0;
_local3++;
}
this.gameEndTrig = false;
this.makeCubixF();
this.visualInterfaceIntF(true);
this.visualPopupMF(true, "start");
}
function gameStartF() {
this.gameBtnControlF(true);
this.visualTimeMF(true);
this.gameSoundObj.start();
}
function gameEndF(typeV) {
if (!this.gameEndTrig) {
this.gameSoundObj.stop();
if (typeV == "fail") {
} else if (typeV == "clear") {
}
trace("gameOver : " + typeV);
this.gameEndTrig = true;
this.visualTimeMF(false);
this.gameBtnControlF(false);
this.ID_delay = setInterval(popupDelayF, 1000, typeV);
}
}
function popupDelayF(typeV) {
clearInterval(ID_delay);
visualPopupMF(true, typeV);
}
function gameResetF() {
var _local3 = 1;
while (_local3 <= this.cubixTotalV) {
this["cubixM" + _local3].removeMovieClip();
_local3++;
}
_local3 = 1;
while (_local3 <= this.cubixRowTotalV) {
this["dataArr" + _local3] = new Array();
this["tempDataArr" + _local3] = new Array();
var _local2 = 1;
while (_local2 <= this.cubixColTotalV) {
this["dataArr" + _local3][_local2 - 1] = 0;
this["tempDataArr" + _local3][_local2 - 1] = 0;
_local2++;
}
_local3++;
}
}
function gameBtnControlF(bool) {
if (bool) {
var _local2 = 1;
while (_local2 <= this.cubixTotalV) {
this["cubixM" + _local2].enabled = true;
this["cubixM" + _local2].onPress = function () {
this._parent.removeCubixF(this.typeV, this.xPosSV, this.yPosSV);
};
_local2++;
}
if (this.itemChanceV > 0) {
this.btn_random.enabled = true;
this.btn_CCW.enabled = true;
this.btn_CW.enabled = true;
this.btn_random.onPress = function () {
this.gotoAndStop("offL");
this._parent.visualItemCheckF("random");
};
this.btn_random.onRollOver = function () {
this.onEnterFrame = function () {
this.nextFrame();
if (this._currentframe == this._totalframes) {
this.onEnterFrame = null;
}
};
};
this.btn_random.onRollOut = function () {
this.onEnterFrame = function () {
this.prevFrame();
if (this._currentframe == 1) {
this.onEnterFrame = null;
}
};
};
this.btn_CCW.onPress = function () {
this.gotoAndStop("offL");
this._parent.visualItemCheckF("rotation", "CCW");
};
this.btn_CCW.onRollOver = function () {
this.onEnterFrame = function () {
this.nextFrame();
if (this._currentframe == this._totalframes) {
this.onEnterFrame = null;
}
};
};
this.btn_CCW.onRollOut = function () {
this.onEnterFrame = function () {
this.prevFrame();
if (this._currentframe == 1) {
this.onEnterFrame = null;
}
};
};
this.btn_CW.onPress = function () {
this.gotoAndStop("offL");
this._parent.visualItemCheckF("rotation", "CW");
};
this.btn_CW.onRollOver = function () {
this.onEnterFrame = function () {
this.nextFrame();
if (this._currentframe == this._totalframes) {
this.onEnterFrame = null;
}
};
};
this.btn_CW.onRollOut = function () {
this.onEnterFrame = function () {
this.prevFrame();
if (this._currentframe == 1) {
this.onEnterFrame = null;
}
};
};
}
} else {
var _local2 = 1;
while (_local2 <= this.cubixTotalV) {
this["cubixM" + _local2].enabled = false;
_local2++;
}
this.btn_random.enabled = false;
this.btn_CCW.enabled = false;
this.btn_CW.enabled = false;
this.btn_random.gotoAndStop("offL");
this.btn_CCW.gotoAndStop("offL");
this.btn_CW.gotoAndStop("offL");
}
}
function makeCubixF() {
var _local6 = 0;
var _local5 = 1;
while (_local5 <= this.cubixRowTotalV) {
var _local3 = 1;
while (_local3 <= this.cubixColTotalV) {
_local6++;
var _local2 = this.attachMovie("cubixM", "cubixM" + _local6, _local6);
_local2._x = (this.intXPosV + (this.cubixWV / 2)) + (this.cubixWV * (_local3 - 1));
_local2._y = (this.intYPosV + (this.cubixHV / 2)) + (this.cubixHV * (_local5 - 1));
var _local7 = Number(random(this.cubixRandomV) + 1);
var _local4 = new Object();
_local4.nameV = _local2._name;
_local4.typeV = _local7;
_local4.checkTrig = false;
this["dataArr" + _local5][_local3 - 1] = _local4;
_local2.intF(_local2._name, _local6, _local7, this.cubixWV, this.cubixHV, _local3, _local5, this.cubixColorStartV);
_local3++;
}
_local5++;
}
}
function setPositionCubixF(typeNumV) {
this.gameBtnControlF(false);
this.cubixExistCountV = 0;
this.existCubixCheckF();
if (this.cubixExistTotalV != 0) {
this.calCubixSpeedF();
var _local3 = this.cubixRowTotalV;
while (_local3 >= 1) {
var _local2 = this.cubixColTotalV;
while (_local2 >= 1) {
var _local4 = this[this["dataArr" + _local3][_local2 - 1].nameV];
_local4.changeInfoArrayPositionF(_local2, _local3);
var _local5 = ((this.intXPosV + this.cubixIntXGapV) + (this.cubixWV / 2)) + (this.cubixWV * (_local2 - 1));
var _local6 = ((this.intYPosV + this.cubixIntYGapV) + (this.cubixHV / 2)) + (this.cubixHV * (_local3 - 1));
_local4.changeInfoStagePositionF(_local5, _local6, typeNumV, this.cubixMoveSpeedV);
_local2--;
}
_local3--;
}
} else {
this.gameEndF("clear");
}
}
function rotationCubixF(dirTypeV) {
if (dirTypeV == "CCW") {
var _local3 = 1;
while (_local3 <= this.cubixRowTotalV) {
this["tempDataArr" + _local3] = new Array();
var _local2 = 1;
while (_local2 <= this.cubixColTotalV) {
this["tempDataArr" + _local3][_local2 - 1] = this["dataArr" + _local2][this.cubixPieceV - _local3];
_local2++;
}
_local3++;
}
} else if (dirTypeV == "CW") {
var _local3 = 1;
while (_local3 <= this.cubixRowTotalV) {
this["tempDataArr" + _local3] = new Array();
var _local2 = 1;
while (_local2 <= this.cubixColTotalV) {
this["tempDataArr" + _local3][_local2 - 1] = this["dataArr" + Number((this.cubixPieceV - _local2) + 1)][_local3 - 1];
_local2++;
}
_local3++;
}
}
var _local3 = 1;
while (_local3 <= this.cubixRowTotalV) {
this["dataArr" + _local3] = this["tempDataArr" + _local3];
_local3++;
}
this.setPositionCubixF(1);
}
function checkCubixF(typeV, xPosV, yPosV) {
var _local6 = typeV;
var _local5 = 0;
var _local4 = new Array();
if (this["dataArr" + Number(yPosV - 1)][xPosV - 1].typeV == _local6) {
_local5++;
_local4.push(this["dataArr" + Number(yPosV - 1)][xPosV - 1].nameV);
}
if (this["dataArr" + Number(yPosV + 1)][xPosV - 1].typeV == _local6) {
_local5++;
_local4.push(this["dataArr" + Number(yPosV + 1)][xPosV - 1].nameV);
}
if (this["dataArr" + Number(yPosV)][xPosV - 2].typeV == _local6) {
_local5++;
_local4.push(this["dataArr" + Number(yPosV)][xPosV - 2].nameV);
}
if (this["dataArr" + Number(yPosV)][xPosV].typeV == _local6) {
_local5++;
_local4.push(this["dataArr" + Number(yPosV)][xPosV].nameV);
}
return(_local4);
}
function removeCubixF(typeV, xPosV, yPosV) {
if (!this.removeCheckTrig) {
this.removeCheckTrig = true;
var _local14 = this.checkCubixF(typeV, xPosV, yPosV);
var _local5 = new Array();
var _local10 = new Array();
var _local9 = new Array();
var _local15 = _local14.length;
var _local13 = 0;
var _local12 = false;
if (_local15 >= 1) {
_local5 = _local5.concat(_local14);
while (!_local12) {
var _local11 = _local5.length;
var _local7 = 0;
while (_local7 <= (_local11 - 1)) {
var _local4 = this[_local5[_local7]];
if (!_local4.checkTrig) {
var _local3 = new Array();
_local3 = this.checkCubixF(_local4.typeV, _local4.xPosSV, _local4.yPosSV).concat();
if (_local3.length != 0) {
_local4.checkTrig = true;
var _local8 = _local3.length;
var _local2 = 1;
while (_local2 <= _local8) {
var _local6 = Number(String(_local3[_local2 - 1]).slice(6));
if (_local9[_local6 - 1] == undefined) {
_local9[_local6 - 1] = _local3[_local2 - 1];
_local10.push(_local3[_local2 - 1]);
}
_local2++;
}
}
}
_local7++;
}
_local5 = new Array();
_local5 = _local10.concat();
if (_local5.length == _local13) {
this.removeSoundObj.start();
for (p in _local5) {
this.matrixInfoDeleteF(_local5[p]);
this[_local5[p]].removeMovieClip();
}
_local12 = true;
this.removeCheckTrig = false;
this.existCubixCheckF();
this.matrixReformF();
} else {
_local13 = _local5.length;
}
}
} else {
this.removeCheckTrig = false;
this.visualMisClickMF(xPosV, yPosV);
this.visualScoreF((this.gameLevelV * 13) * -1);
}
}
}
function matrixInfoDeleteF(mcNameV) {
var _local2 = this[mcNameV];
var _local3 = _local2.xPosSV;
var _local4 = _local2.yPosSV;
this["dataArr" + _local4][_local3 - 1] = undefined;
}
function matrixReformF() {
var _local6 = new Array();
var _local3 = 1;
while (_local3 <= this.cubixRowTotalV) {
this["tempDataArr" + _local3] = new Array();
_local3++;
}
var _local2 = 1;
while (_local2 <= this.cubixColTotalV) {
var _local4 = this.cubixRowTotalV;
_local3 = this.cubixRowTotalV;
while (_local3 >= 1) {
if (this["dataArr" + _local3][_local2 - 1] != undefined) {
this["tempDataArr" + _local4].push(this["dataArr" + _local3][_local2 - 1]);
_local4--;
}
_local3--;
}
if (_local4 == this.cubixRowTotalV) {
_local6.push("blank");
} else {
_local6.push("noBlank");
}
if (_local4 > 0) {
_local3 = _local4;
while (_local3 >= 1) {
this["tempDataArr" + _local3][_local2 - 1] = undefined;
_local3--;
}
}
_local2++;
}
var _local5 = 1;
while (_local5 <= this.cubixRowTotalV) {
this["dataArr" + _local5] = this["tempDataArr" + _local5];
_local5++;
}
_local3 = 1;
while (_local3 <= this.cubixRowTotalV) {
this["tempDataArr" + _local3] = new Array();
var _local4 = this.cubixRowTotalV;
_local2 = this.cubixColTotalV;
while (_local2 >= 1) {
if (_local6[_local2 - 1] == "noBlank") {
_local4--;
this["tempDataArr" + _local3][_local4] = this["dataArr" + _local3][_local2 - 1];
}
_local2--;
}
_local3++;
}
_local5 = 1;
while (_local5 <= this.cubixRowTotalV) {
this["dataArr" + _local5] = this["tempDataArr" + _local5];
_local5++;
}
this.setPositionCubixF(2);
}
function randomCubixF() {
var _local7 = new Array();
var _local9 = new Array();
var _local14 = false;
var _local3 = 1;
while (_local3 <= this.cubixRowTotalV) {
var _local2 = 1;
while (_local2 <= this.cubixColTotalV) {
if (this["dataArr" + _local3][_local2 - 1] != undefined) {
_local7.push(this["dataArr" + _local3][_local2 - 1]);
}
_local2++;
}
_local3++;
}
var _local11 = 0;
var _local8 = _local7.length;
var _local5 = 0;
while (!_local14) {
do {
_local5 = random(_local8);
} while (_local9[_local5] != undefined);
_local9[_local5] = _local7[_local11].typeV;
_local11++;
if (_local11 == _local8) {
_local14 = true;
}
}
var _local4 = 1;
while (_local4 <= _local8) {
var _local6 = _local7[_local4 - 1].nameV;
var _local10 = _local9[_local4 - 1];
var _local12 = this[_local6].xPosSV;
var _local13 = this[_local6].yPosSV;
this["dataArr" + _local13][_local12 - 1].typeV = _local10;
this[_local6].changeTypeF(_local10);
_local4++;
}
}
function matrixRebuild() {
var _local6 = new Array();
var _local7 = new Array();
var _local5 = 1;
while (_local5 <= (this.cubixRowTotalV - 1)) {
this["tempDataArr" + _local5] = new Array();
_local5++;
}
_local5 = this.cubixRowTotalV;
while (_local5 >= 1) {
var _local2 = this.cubixColTotalV;
while (_local2 >= 1) {
if ((_local2 != 1) and (_local5 != 1)) {
if (this["dataArr" + _local5][_local2 - 1] != undefined) {
this["tempDataArr" + Number(_local5 - 1)][_local2 - 2] = this["dataArr" + _local5][_local2 - 1];
} else {
var _local3 = new Object();
_local3.xPosV = _local2 - 2;
_local3.yPosV = _local5 - 1;
_local6.push(_local3);
}
} else if (this["dataArr" + _local5][_local2 - 1] != undefined) {
_local7.push(this["dataArr" + _local5][_local2 - 1]);
}
_local2--;
}
_local5--;
}
if (_local6.length >= _local7.length) {
var _local4 = 1;
while (_local4 <= _local7.length) {
var _local8 = _local6[_local4 - 1].xPosV;
var _local9 = _local6[_local4 - 1].yPosV;
this["tempDataArr" + _local9][_local8] = _local7[_local4 - 1];
_local4++;
}
_local5 = this.cubixRowTotalV - 1;
while (_local5 >= 1) {
var _local2 = this.cubixColTotalV - 1;
while (_local2 >= 1) {
if (this["tempDataArr" + _local5][_local2 - 1].typeV == undefined) {
this["tempDataArr" + _local5][_local2 - 1] = undefined;
}
_local2--;
}
_local5--;
}
this["dataArr" + cubixRowTotalV] = new Array();
this.cubixRowTotalV--;
this.cubixColTotalV--;
this.cubixPieceV--;
this.cubixIntXGapV = this.cubixIntXGapV + (this.cubixWV / 2);
this.cubixIntYGapV = this.cubixIntYGapV + (this.cubixHV / 2);
_local5 = 1;
while (_local5 <= this.cubixRowTotalV) {
this["dataArr" + _local5] = new Array();
this["dataArr" + _local5] = this["tempDataArr" + _local5].concat();
_local5++;
}
this.existCubixCheckF();
this.setPositionCubixF(3);
this.lineStepV++;
this.visualResizeLineMF(true, (this.cubixColTotalV * this.cubixWV) + 4);
} else {
this.gameEndF("fail");
}
}
function moveEndCheckF1() {
this.cubixExistCountV++;
if (this.cubixExistCountV == this.cubixExistTotalV) {
this.cubixExistCountV = 0;
this.matrixReformF();
}
}
function moveEndCheckF2() {
this.cubixExistCountV++;
if ((this.cubixExistCountV == this.cubixExistTotalV) and (!this.gameEndTrig)) {
this.gameEndCheckF();
this.cubixExistCountV = 0;
}
}
function existCubixCheckF() {
this.cubixExistTotalV = 0;
var _local3 = 1;
while (_local3 <= this.cubixRowTotalV) {
var _local2 = 1;
while (_local2 <= this.cubixColTotalV) {
if (this["dataArr" + _local3][_local2 - 1] != undefined) {
this.cubixExistTotalV++;
}
_local2++;
}
_local3++;
}
}
function gameEndCheckF() {
var _local6 = 0;
var _local7 = false;
var _local5 = 1;
while (_local5 <= this.cubixRandomV) {
this["cubixTypeV" + _local5] = 0;
_local5++;
}
var _local4 = 1;
while (_local4 <= this.cubixRowTotalV) {
var _local2 = 1;
while (_local2 <= this.cubixColTotalV) {
var _local3 = this["dataArr" + _local4][_local2 - 1].typeV;
this["cubixTypeV" + _local3]++;
_local2++;
}
_local4++;
}
_local5 = 1;
while (_local5 <= this.cubixRandomV) {
if (this["cubixTypeV" + _local5] >= 2) {
_local7 = true;
break;
}
_local5++;
}
_local4 = 1;
while (_local4 <= this.cubixRowTotalV) {
var _local2 = 1;
while (_local2 <= this.cubixColTotalV) {
var _local3 = this["dataArr" + _local4][_local2 - 1].typeV;
this["cubixTypeV" + _local3]++;
if (_local3 != undefined) {
if (this.checkCubixF(_local3, _local2, _local4).length != 0) {
break;
}
_local6++;
}
_local2++;
}
_local4++;
}
if (_local6 == this.cubixExistTotalV) {
if (this.itemChanceV > 0) {
if (!_local7) {
this.gameEndF("clear");
} else {
this.gameBtnControlF(true);
}
} else if (this.itemChanceV <= 0) {
this.gameEndF("clear");
}
} else {
this.gameBtnControlF(true);
}
}
function calPersentF() {
this.existCubixCheckF();
var _local2;
var _local3;
_local2 = Math.abs(this.cubixExistTotalV / this.cubixTotalV);
_local3 = (_local2 * 100) - Math.floor(_local2 * 100);
if (_local3 != 0) {
_local3 = 1;
}
_local2 = Math.round(100 - (_local2 * 100)) - _local3;
return(_local2);
}
function calCubixSpeedF() {
var _local4 = 0;
var _local5 = 0;
var _local3 = 1;
while (_local3 <= this.cubixRowTotalV) {
var _local2 = 1;
while (_local2 <= this.cubixColTotalV) {
if (this["dataArr" + _local3][_local2 - 1] != undefined) {
_local4++;
}
_local2++;
}
_local3++;
}
_local5 = Math.round(_local4 / this.cubixMoveSpeedStepV);
this.cubixMoveSpeedV = this.cubixMoveSpeedMinV + (_local5 * 0.025);
}
function visualItemCheckF(typeV1, typeV2) {
this.itemChanceV--;
if (this.itemChanceV >= 0) {
if (typeV1 == "rotation") {
this.itemSoundObj1.start();
this.rotationCubixF(typeV2);
} else if (typeV1 == "random") {
this.itemSoundObj2.start();
this.visualRandomF();
}
this.visualItemM.win.text = this.itemChanceV;
this.visualItemM.gotoAndStop(("s" + this.itemChanceV) + "L");
if (this.itemChanceV == 0) {
this.btn_random.enabled = false;
this.btn_CCW.enabled = false;
this.btn_CW.enabled = false;
}
} else {
this.itemChanceV = 0;
this.btn_random.enabled = false;
this.btn_CCW.enabled = false;
this.btn_CW.enabled = false;
}
}
function visualRandomF() {
var _local2 = this.createEmptyMovieClip("randomM", this.randomDepthV);
this.gameBtnControlF(false);
_local2.countV = 0;
_local2.onEnterFrame = function () {
this._parent.randomCubixF();
this.countV++;
if (this.countV >= 10) {
this._parent.gameEndCheckF();
this.removeMovieClip();
this.onEnterFrame = null;
}
};
}
function visualTimeMF(bool) {
var _local2 = this.visualTimeM;
if (bool) {
_local2.fpsV = this.fpsV;
_local2.timeV = 0;
_local2.timeSV = 0;
_local2.timeMaxV = _local2.fpsV * this.gameLimitSecV;
_local2.onEnterFrame = function () {
if (!this._parent.popupTrig) {
this.timeV++;
this.timeSV = this.timeMaxV - this.timeV;
if (this.timeSV <= 0) {
this._parent.matrixRebuild();
this.timeV = 0;
}
this._parent.visualTimeM.barM._xscale = (this.timeSV / this.timeMaxV) * 100;
this._parent.visualTimeM.arrowM._x = this._parent.visualTimeM.barM._x + this._parent.visualTimeM.barM._width;
}
};
} else {
_local2.onEnterFrame = null;
}
}
function visualPopupMF(bool, typeV) {
if (bool) {
this.openPopupTrig = true;
var _local2 = this.attachMovie("visualPopupM", "visualPopupM", this.popupDepthV);
_local2._x = this.intXPosV + (this.stageWV / 2);
_local2._y = this.intYPosV + (this.stageHV / 2);
_local2.gotoAndStop(typeV + "L");
} else {
this.openPopupTrig = false;
this.visualPopupM.gotoAndStop("offL");
}
}
function visualMisClickMF(xPosV, yPosV) {
var _local3 = this.getNextHighestDepth();
var _local2 = this.attachMovie("baloomM", "baloomM" + _local3, _local3);
_local2._x = ((this.intXPosV + this.cubixIntXGapV) + (this.cubixWV / 2)) + (this.cubixWV * (xPosV - 1));
_local2._y = ((this.intYPosV + this.cubixIntYGapV) + (this.cubixHV / 2)) + (this.cubixHV * (yPosV - 1));
_local2.countV = 0;
_local2.onEnterFrame = function () {
if (!this._parent.gameEndTrig) {
this.countV++;
if (this.countV >= 10) {
this.removeMovieClip();
this.onEnterFrame = null;
}
} else {
this.removeMovieClip();
this.onEnterFrame = null;
}
};
}
function visualResizeLineMF(bool, widthV) {
if (bool) {
this.lineM.targetWidthV = widthV;
this.lineM.speedV = 0.25;
this.lineM.onEnterFrame = function () {
this._width = this._width + ((this.targetWidthV - this._width) * this.speedV);
this._height = this._width;
if (Math.abs(this.targetWidthV - this._width) < 1) {
this._width = this.targetWidthV;
this._height = this.targetWidthV;
this.onEnterFrame = null;
}
};
} else {
this.lineM._width = this.stageWV;
this.lineM._height = this.stageHV;
}
}
function visualInterfaceIntF(bool) {
if (bool) {
this.visualLevelM.win.text = this.gameLevelV;
this.visualScoreM.win.text = this.gameScoreV;
this.visualItemM.win.text = this.itemChanceMaxV;
this.visualItemM.gotoAndStop("s3L");
this.visualResizeLineMF(false);
} else {
this.visualLevelM.win.text = 0;
this.visualScoreM.win.text = 0;
this.visualItemM.win.text = this.itemChanceMaxV;
this.visualItemM.gotoAndStop("s3L");
this.visualResizeLineMF(false);
}
}
function visualScoreF(numV) {
this.gameScoreV = this.gameScoreV + Number(numV);
if (this.gameScoreV <= 0) {
this.gameScoreV = 0;
}
this.visualScoreM.win.text = this.gameScoreV;
}
function visualTotalScoreF(typeV) {
var _local2 = this.visualPopupM.visualEndM;
_local2.levelV = this.gameLevelV;
_local2.persentageV = 0;
_local2.persentageSV = this.calPersentF();
_local2.timeBonusV = 0;
_local2.timeBonusSV = (this.lineStepTotalV - this.lineStepV) * 30;
_local2.itemBonusV = 0;
_local2.itemBonusSV = this.itemChanceV * 100;
_local2.scoreV = 0;
_local2.pageStepV = 1;
_local2.soundCountV = 0;
_local2.soundStepV = 4;
if (typeV == "clear") {
_local2.scoreSV = ((Number(_local2.persentageSV) * 10) + Number(_local2.timeBonusSV)) + Number(_local2.itemBonusSV);
_local2.onEnterFrame = function () {
if (this.pageStepV == 1) {
this.levelWin.text = this.levelV;
this.pageStepV++;
this.soundCountV = 0;
this.gotoAndStop(("s" + this.pageStepV) + "L");
} else if (this.pageStepV == 2) {
this.persentageV = this.persentageV + 3;
this.soundCountV++;
if ((this.soundCountV % this.soundStepV) == 1) {
this._parent._parent.scoreSoundObj.start();
}
if (this.persentageV >= this.persentageSV) {
this.persentageV = this.persentageSV;
this.persentageWin.text = this.persentageV + " %";
this.pageStepV++;
this.soundCountV = 0;
this.gotoAndStop(("s" + this.pageStepV) + "L");
} else {
this.persentageWin.text = this.persentageV + " %";
}
} else if (this.pageStepV == 3) {
this.timeBonusV = this.timeBonusV + 5;
this.soundCountV++;
if ((this.soundCountV % this.soundStepV) == 1) {
this._parent._parent.scoreSoundObj.start();
}
if (this.timeBonusV >= this.timeBonusSV) {
this.timeBonusV = this.timeBonusSV;
this.timeBonusWin.text = this.timeBonusSV;
this.pageStepV++;
this.soundCountV = 0;
this.gotoAndStop(("s" + this.pageStepV) + "L");
} else {
this.timeBonusWin.text = this.timeBonusV;
}
} else if (this.pageStepV == 4) {
this.itemBonusV = this.itemBonusV + 30;
this.soundCountV++;
if ((this.soundCountV % this.soundStepV) == 1) {
this._parent._parent.scoreSoundObj.start();
}
if (this.itemBonusV >= this.itemBonusSV) {
this.itemBonusV = this.itemBonusSV;
this.itemBonusWin.text = this.itemBonusSV;
this.pageStepV++;
this.soundCountV = 0;
this.gotoAndStop(("s" + this.pageStepV) + "L");
} else {
this.itemBonusWin.text = this.itemBonusV;
}
} else if (this.pageStepV == 5) {
this.scoreV = this.scoreV + 30;
this.soundCountV++;
if ((this.soundCountV % this.soundStepV) == 1) {
this._parent._parent.scoreSoundObj.start();
}
if (this.scoreV >= this.scoreSV) {
this.scoreV = this.scoreSV;
this.totalScoreWin.text = this.scoreSV;
this.pageStepV++;
this.soundCountV = 0;
this.gotoAndStop(("s" + this.pageStepV) + "L");
} else {
this.totalScoreWin.text = this.scoreV;
}
} else if (this.pageStepV == 6) {
this._parent._parent.visualScoreF(this.scoreSV);
this.btn_next.onPress = function () {
this._parent._parent._parent.gameIntF();
this._parent._parent._parent.visualPopupMF(false);
};
this.onEnterFrame = null;
}
};
} else if (typeV == "fail") {
_local2.scoreSV = Number(_local2.persentageSV) * 10;
_local2.onEnterFrame = function () {
if (this.pageStepV == 1) {
this.levelWin.text = this.levelV;
this.pageStepV++;
this.soundCountV = 0;
this.gotoAndStop(("s" + this.pageStepV) + "L");
} else if (this.pageStepV == 2) {
this.persentageV = this.persentageV + 3;
this.soundCountV++;
if ((this.soundCountV % this.soundStepV) == 1) {
this._parent._parent.scoreSoundObj.start();
}
if (this.persentageV >= this.persentageSV) {
this.persentageV = this.persentageSV;
this.persentageWin.text = this.persentageV + " %";
this.pageStepV++;
this.soundCountV = 0;
this.gotoAndStop(("s" + this.pageStepV) + "L");
} else {
this.persentageWin.text = this.persentageV + " %";
}
} else if (this.pageStepV == 3) {
this.scoreV = this.scoreV + 30;
this.soundCountV++;
if ((this.soundCountV % this.soundStepV) == 1) {
this._parent._parent.scoreSoundObj.start();
}
if (this.scoreV >= this.scoreSV) {
this.scoreV = this.scoreSV;
this.levelScoreWin.text = this.scoreSV;
this.pageStepV++;
this.soundCountV = 0;
this.gotoAndStop(("s" + this.pageStepV) + "L");
} else {
this.levelScoreWin.text = this.scoreV;
}
} else if (this.pageStepV == 4) {
this._parent._parent.visualScoreF(this.scoreSV);
this.totalScoreWin.text = this._parent._parent.gameScoreV;
this.pageStepV++;
this.gotoAndStop(("s" + this.pageStepV) + "L");
} else if (this.pageStepV == 5) {
this.btn_submit.onPress = function () {
this._parent._parent._parent.gameLevelV = 0;
this._parent._parent._parent.gameScoreV = 0;
this._parent._parent._parent.gameResetF();
this._parent._parent._parent.gotoAndStop("introL");
this._parent._parent._parent.visualPopupMF(false);
};
this.btn_replay.onPress = function () {
this._parent._parent._parent.gameLevelV = 0;
this._parent._parent._parent.gameScoreV = 0;
this._parent._parent._parent.visualInterfaceIntF(false);
this._parent._parent._parent.gameIntF();
this._parent._parent._parent.visualPopupMF(false);
};
this.onEnterFrame = null;
}
};
}
}
stop();
fscommand ("allowScale", false);
Stage.showMenu = false;
this.stageXPosMinV = 192;
this.stageXPosMaxV = 476;
this.stageYPosMinV = 49;
this.stageYPosMaxV = 333;
this.intXPosV = this.stageXPosMinV;
this.intYPosV = this.stageYPosMinV;
this.bottomXPosV = this.stageXPosMinV;
this.bottomYPosV = this.stageYPosMaxV;
this.stageWV = this.stageXPosMaxV - this.stageXPosMinV;
this.stageHV = this.stageYPosMaxV - this.stageYPosMinV;
this.cubixPieceV = 0;
this.cubixRowTotalV = 0;
this.cubixColTotalV = 0;
this.cubixTotalV = 0;
this.cubixMinV = 4;
this.cubixRandomV = 0;
this.cubixRandomMinV = 3;
this.cubixColorStartV = 0;
this.cubixWV = 0;
this.cubixHV = 0;
this.cubixIntXGapV = 0;
this.cubixIntYGapV = 0;
this.cubixExistTotalV = 0;
this.cubixExistCountV = 0;
this.cubixMoveSpeedMinV = 0.2;
this.cubixMoveSpeedV = 0;
this.cubixMoveSpeedStepV = 25;
this.fpsV = 40;
this.gameLevelV = 0;
this.gameScoreV = 0;
this.gameLimitSecV = 10;
this.lineStepV = 0;
this.lineStepTotalV = 0;
this.gameEndTrig = false;
this.itemChanceV = 0;
this.itemChanceMaxV = 3;
this.removeCheckTrig = false;
this.openPopupTrig = false;
this.popupDepthV = 1000;
this.randomDepthV = 1001;
this.mainSoundObj = new Sound(this);
this.mainSoundObj.setVolume(50);
this.introSoundObj = new Sound();
this.introSoundObj.attachSound("introSound");
this.gameSoundObj = new Sound();
this.gameSoundObj.attachSound("gameSound");
this.gameSoundObj.onSoundComplete = function () {
this.start();
};
this.btnSoundObj = new Sound();
this.btnSoundObj.attachSound("btnSound");
this.clearSoundObj = new Sound();
this.clearSoundObj.attachSound("clearSound");
this.failSoundObj = new Sound();
this.failSoundObj.attachSound("failSound");
this.scoreSoundObj = new Sound();
this.scoreSoundObj.attachSound("scoreSound");
this.levelSoundObj = new Sound();
this.levelSoundObj.attachSound("levelSound");
this.itemSoundObj1 = new Sound();
this.itemSoundObj1.attachSound("itemSound1");
this.itemSoundObj2 = new Sound();
this.itemSoundObj2.attachSound("itemSound2");
this.removeSoundObj = new Sound();
this.removeSoundObj.attachSound("removeSound");
Frame 31
this.visualInterfaceIntF(false);
this.gameIntF();
Symbol 34 MovieClip Frame 1
this.gotoAndStop(("s" + Number(Number(this._parent.typeV) + Number(this._parent.colorStartV))) + "L");
Symbol 37 MovieClip [cubixM] Frame 1
#initclip 2
Object.registerClass("cubixM", Cubix);
#endinitclip
Symbol 106 MovieClip Frame 9
this.levelWin.text = this._parent._parent.gameLevelV + " ";
this._parent._parent.levelSoundObj.start();
Symbol 106 MovieClip Frame 70
stop();
this._parent._parent.gameStartF();
this._parent.removeMovieClip();
Symbol 192 MovieClip Frame 1
this._parent._parent.clearSoundObj.start();
Symbol 192 MovieClip Frame 31
stop();
this._parent._parent.visualTotalScoreF("clear");
Symbol 192 MovieClip Frame 89
stop();
Symbol 255 MovieClip Frame 31
gotoAndPlay (20);
Symbol 267 MovieClip Frame 1
this._parent._parent.failSoundObj.start();
Symbol 267 MovieClip Frame 30
stop();
this._parent._parent.visualTotalScoreF("fail");
Symbol 277 MovieClip [baloomM] Frame 12
stop();
Symbol 283 MovieClip Frame 1
this.onEnterFrame = function () {
if (this._parent.getBytesLoaded() >= this._parent.getBytesTotal()) {
this._parent.gotoAndStop("introL");
this.onEnterFrame = null;
} else {
this.barM._xscale = (this._parent.getBytesLoaded() / this._parent.getBytesTotal()) * 100;
this.win.text = ((this._parent.getBytesLoaded() + " / ") + this._parent.getBytesTotal()) + " Bytes";
}
};
Symbol 368 MovieClip [__Packages.Cubix] Frame 0
class Cubix extends MovieClip
{
var nameV, numberV, typeV, widthV, heightV, xPosSV, yPosSV, backM, shadowM, lineM, numberWin, intervalIDV, xPosV, yPosV, moveTypeNumV, _x, _y;
function Cubix () {
super();
}
function intF(nameV, numberV, typeV, widthV, heightV, xPosSV, yPosSV, colorStartV) {
this.nameV = nameV;
this.numberV = numberV;
this.typeV = typeV;
this.widthV = widthV;
this.heightV = heightV;
this.xPosSV = xPosSV;
this.yPosSV = yPosSV;
this.colorStartV = colorStartV;
backM._width = this.widthV - 4;
backM._height = this.heightV - 4;
shadowM._width = this.widthV;
shadowM._height = this.heightV;
lineM._width = this.widthV - 4;
lineM._height = this.heightV - 4;
}
function showTestWinF() {
numberWin.text = numberV;
}
function setTypeF(typeV) {
this.typeV = typeV;
}
function changeTypeF(typeV) {
this.typeV = typeV;
backM.gotoAndStop(("s" + Number(Number(this.typeV) + Number(colorStartV))) + "L");
}
function changeInfoArrayPositionF(xPosSV, yPosSV) {
this.xPosSV = xPosSV;
this.yPosSV = yPosSV;
}
function changeInfoStagePositionF(xPosV, yPosV, moveTypeNumV, moveSpeedV) {
clearInterval(intervalIDV);
this.xPosV = xPosV;
this.yPosV = yPosV;
this.moveTypeNumV = moveTypeNumV;
this.moveSpeedV = moveSpeedV;
if (this.moveTypeNumV == 1) {
intervalIDV = setInterval(this, "moveStagePositionF2", intervalSecV);
} else if (this.moveTypeNumV == 2) {
intervalIDV = setInterval(this, "delayF", delaySecV);
} else if (this.moveTypeNumV == 3) {
intervalIDV = setInterval(this, "moveStagePositionF2", intervalSecV);
}
}
function delayF() {
clearInterval(intervalIDV);
intervalIDV = setInterval(this, "moveStagePositionF3", intervalSecV);
}
function moveStagePositionF1() {
_x = xPosV;
_y = yPosV;
}
function moveStagePositionF2() {
_x = _x + ((xPosV - _x) * moveSpeedV);
_y = _y + ((yPosV - _y) * moveSpeedV);
if ((Math.abs(xPosV - _x) < 1) and (Math.abs(yPosV - _y) < 1)) {
_x = xPosV;
_y = yPosV;
clearInterval(intervalIDV);
_root.moveEndCheckF1();
}
}
function moveStagePositionF3() {
_x = _x + ((xPosV - _x) * moveSpeedV);
_y = _y + ((yPosV - _y) * moveSpeedV);
if ((Math.abs(xPosV - _x) < 1) and (Math.abs(yPosV - _y) < 1)) {
_x = xPosV;
_y = yPosV;
clearInterval(intervalIDV);
_root.moveEndCheckF2();
}
}
var fpsV = 70;
var intervalSecV = 1000 / fpsV;
var delaySecV = 300;
var moveSpeedV = 0.1;
var checkTrig = false;
var colorStartV = 0;
}
Symbol 302 MovieClip Frame 142
this.gotoAndPlay("loopL");
Symbol 307 MovieClip Frame 35
stop();
this.onPress = function () {
this._parent._parent.gotoAndStop("gameL");
};
Symbol 308 MovieClip Frame 1
this._parent.introSoundObj.start();
Symbol 308 MovieClip Frame 5
stop();
Symbol 329 MovieClip Frame 142
this.gotoAndPlay("loopL");
Symbol 335 MovieClip Frame 1
stop();
Symbol 335 MovieClip Frame 12
stop();
Symbol 339 MovieClip Frame 1
stop();
Symbol 339 MovieClip Frame 12
stop();
Symbol 344 MovieClip Frame 1
stop();
Symbol 344 MovieClip Frame 12
stop();
Symbol 351 MovieClip Frame 1
stop();