Frame 1
function calcLevel(levelNo) {
var maxLevels = 100;
var minClickTimeFactor = 1.65;
var cubesFactor = 0.9;
var changePaceFactor = 0.8;
var clickTime1 = 1.5;
var minClickTime = (1.25 / (Math.log(levelNo) / Math.log(minClickTimeFactor)));
if (levelNo == 1) {
minClickTime = clickTime1;
}
Set(("_root.level" + levelNo) + "_numOfCubes", Math.pow(levelNo + 1, cubesFactor));
if (eval (("_root.level" + levelNo) + "_numOfCubes") > 24) {
Set(("_root.level" + levelNo) + "_numOfCubes", 24);
}
Set(("_root.level" + levelNo) + "_stayDelay", minClickTime * eval (("_root.level" + levelNo) + "_numOfCubes"));
Set(("_root.level" + levelNo) + "_changePace", changePaceFactor * eval (("_root.level" + levelNo) + "_stayDelay"));
Set(("_root.level" + levelNo) + "_numOfCubes", Math.round(eval (("_root.level" + levelNo) + "_numOfCubes")));
}
Stage.showMenu = false;
stop();
_root.config_frameRate = 20;
_root.actLevel = 1;
calcLevel(_root.actLevel);
if (_root.firstFrameLoaded == undefined) {
_root.attachMovie("credits_element", "creditLine", 100005);
_root.creditLine._x = 375;
_root.creditLine._y = 472.9;
_root.firstFrameLoaded = true;
}
Frame 2
function initLevel() {
tidyUp();
var i = 0;
while (i < eval (("_root.level" + _root.actLevel) + "_numOfCubes")) {
var temp = _root.attachMovie("cube", "cube" + i, i);
switch (eval (("_root.level" + _root.actLevel) + "_numOfCubes")) {
case 2 :
temp._yscale = 120;
temp._xscale = 120;
break;
case 3 :
case 4 :
case 5 :
case 6 :
break;
case 7 :
case 8 :
temp._yscale = 95;
temp._xscale = 95;
break;
case 9 :
case 10 :
case 11 :
case 12 :
case 13 :
case 14 :
temp._yscale = 85;
temp._xscale = 85;
break;
case 15 :
case 16 :
case 17 :
temp._yscale = 80;
temp._xscale = 80;
break;
case 18 :
temp._yscale = 75;
temp._xscale = 75;
break;
case 19 :
temp._yscale = 70;
temp._xscale = 70;
break;
case 20 :
case 21 :
case 22 :
case 23 :
case 24 :
temp._yscale = 60;
temp._xscale = 60;
break;
default :
trace("no scaling for this number of cubes!");
}
temp.ampel.gotoAndPlay(Math.round(Math.random() * temp.ampel._totalframes));
temp.ticker.count = Math.round((Math.random() * eval (("_root.level" + _root.actLevel) + "_changePace")) * _root.config_frameRate);
i++;
}
switch (eval (("_root.level" + _root.actLevel) + "_numOfCubes")) {
case 2 :
_root.cube0._x = (Stage.width / 2) - 100;
_root.cube1._x = (Stage.width / 2) + 100;
_root.cube0._y = Stage.height / 2;
_root.cube1._y = Stage.height / 2;
break;
case 3 :
_root.cube0._x = (Stage.width / 2) - 180;
_root.cube1._x = Stage.width / 2;
_root.cube2._x = (Stage.width / 2) + 180;
_root.cube0._y = Stage.height / 2;
_root.cube1._y = Stage.height / 2;
_root.cube2._y = Stage.height / 2;
break;
case 4 :
_root.cube0._x = (Stage.width / 2) - 100;
_root.cube1._x = (Stage.width / 2) + 100;
_root.cube2._x = (Stage.width / 2) - 100;
_root.cube3._x = (Stage.width / 2) + 100;
_root.cube0._y = (Stage.height / 2) - 80;
_root.cube1._y = (Stage.height / 2) - 80;
_root.cube2._y = (Stage.height / 2) + 80;
_root.cube3._y = (Stage.height / 2) + 80;
break;
case 5 :
_root.cube0._x = (Stage.width / 2) - 180;
_root.cube1._x = Stage.width / 2;
_root.cube2._x = (Stage.width / 2) + 180;
_root.cube3._x = (Stage.width / 2) - 90;
_root.cube4._x = (Stage.width / 2) + 90;
_root.cube0._y = (Stage.height / 2) - 80;
_root.cube1._y = (Stage.height / 2) - 80;
_root.cube2._y = (Stage.height / 2) - 80;
_root.cube3._y = (Stage.height / 2) + 80;
_root.cube4._y = (Stage.height / 2) + 80;
break;
case 6 :
_root.cube0._x = (Stage.width / 2) - 180;
_root.cube1._x = Stage.width / 2;
_root.cube2._x = (Stage.width / 2) + 180;
_root.cube3._x = (Stage.width / 2) - 180;
_root.cube4._x = Stage.width / 2;
_root.cube5._x = (Stage.width / 2) + 180;
_root.cube0._y = (Stage.height / 2) - 80;
_root.cube1._y = (Stage.height / 2) - 80;
_root.cube2._y = (Stage.height / 2) - 80;
_root.cube3._y = (Stage.height / 2) + 80;
_root.cube4._y = (Stage.height / 2) + 80;
_root.cube5._y = (Stage.height / 2) + 80;
break;
case 7 :
_root.cube0._x = (Stage.width / 2) - 255;
_root.cube1._x = (Stage.width / 2) - 85;
_root.cube2._x = (Stage.width / 2) + 85;
_root.cube3._x = (Stage.width / 2) + 255;
_root.cube4._x = (Stage.width / 2) - 180;
_root.cube5._x = Stage.width / 2;
_root.cube6._x = (Stage.width / 2) + 180;
_root.cube0._y = (Stage.height / 2) - 80;
_root.cube1._y = (Stage.height / 2) - 80;
_root.cube2._y = (Stage.height / 2) - 80;
_root.cube3._y = (Stage.height / 2) - 80;
_root.cube4._y = (Stage.height / 2) + 80;
_root.cube5._y = (Stage.height / 2) + 80;
_root.cube6._y = (Stage.height / 2) + 80;
break;
case 8 :
_root.cube0._x = (Stage.width / 2) - 255;
_root.cube1._x = (Stage.width / 2) - 85;
_root.cube2._x = (Stage.width / 2) + 85;
_root.cube3._x = (Stage.width / 2) + 255;
_root.cube4._x = (Stage.width / 2) - 255;
_root.cube5._x = (Stage.width / 2) - 85;
_root.cube6._x = (Stage.width / 2) + 85;
_root.cube7._x = (Stage.width / 2) + 255;
_root.cube0._y = (Stage.height / 2) - 80;
_root.cube1._y = (Stage.height / 2) - 80;
_root.cube2._y = (Stage.height / 2) - 80;
_root.cube3._y = (Stage.height / 2) - 80;
_root.cube4._y = (Stage.height / 2) + 80;
_root.cube5._y = (Stage.height / 2) + 80;
_root.cube6._y = (Stage.height / 2) + 80;
_root.cube7._y = (Stage.height / 2) + 80;
break;
case 9 :
_root.cube0._x = (Stage.width / 2) - 175;
_root.cube1._x = Stage.width / 2;
_root.cube2._x = (Stage.width / 2) + 175;
_root.cube3._x = (Stage.width / 2) - 175;
_root.cube4._x = Stage.width / 2;
_root.cube5._x = (Stage.width / 2) + 175;
_root.cube6._x = (Stage.width / 2) - 175;
_root.cube7._x = Stage.width / 2;
_root.cube8._x = (Stage.width / 2) + 175;
_root.cube0._y = (Stage.height / 2) - 130;
_root.cube1._y = (Stage.height / 2) - 130;
_root.cube2._y = (Stage.height / 2) - 130;
_root.cube3._y = Stage.height / 2;
_root.cube4._y = Stage.height / 2;
_root.cube5._y = Stage.height / 2;
_root.cube6._y = (Stage.height / 2) + 130;
_root.cube7._y = (Stage.height / 2) + 130;
_root.cube8._y = (Stage.height / 2) + 130;
break;
case 10 :
_root.cube0._x = (Stage.width / 2) - 260;
_root.cube1._x = (Stage.width / 2) - 130;
_root.cube2._x = Stage.width / 2;
_root.cube3._x = (Stage.width / 2) + 130;
_root.cube4._x = (Stage.width / 2) + 260;
_root.cube5._x = (Stage.width / 2) - 260;
_root.cube6._x = (Stage.width / 2) - 130;
_root.cube7._x = Stage.width / 2;
_root.cube8._x = (Stage.width / 2) + 130;
_root.cube9._x = (Stage.width / 2) + 260;
_root.cube0._y = (Stage.height / 2) - 75;
_root.cube1._y = (Stage.height / 2) - 75;
_root.cube2._y = (Stage.height / 2) - 75;
_root.cube3._y = (Stage.height / 2) - 75;
_root.cube4._y = (Stage.height / 2) - 75;
_root.cube5._y = (Stage.height / 2) + 75;
_root.cube6._y = (Stage.height / 2) + 75;
_root.cube7._y = (Stage.height / 2) + 75;
_root.cube8._y = (Stage.height / 2) + 75;
_root.cube9._y = (Stage.height / 2) + 75;
break;
case 11 :
_root.cube0._x = (Stage.width / 2) - 225;
_root.cube1._x = (Stage.width / 2) - 75;
_root.cube2._x = (Stage.width / 2) + 75;
_root.cube3._x = (Stage.width / 2) + 225;
_root.cube4._x = (Stage.width / 2) - 140;
_root.cube5._x = Stage.width / 2;
_root.cube6._x = (Stage.width / 2) + 140;
_root.cube7._x = (Stage.width / 2) - 225;
_root.cube8._x = (Stage.width / 2) - 75;
_root.cube9._x = (Stage.width / 2) + 75;
_root.cube10._x = (Stage.width / 2) + 225;
_root.cube0._y = (Stage.height / 2) - 130;
_root.cube1._y = (Stage.height / 2) - 130;
_root.cube2._y = (Stage.height / 2) - 130;
_root.cube3._y = (Stage.height / 2) - 130;
_root.cube4._y = Stage.height / 2;
_root.cube5._y = Stage.height / 2;
_root.cube6._y = Stage.height / 2;
_root.cube7._y = (Stage.height / 2) + 130;
_root.cube8._y = (Stage.height / 2) + 130;
_root.cube9._y = (Stage.height / 2) + 130;
_root.cube10._y = (Stage.height / 2) + 130;
break;
case 12 :
_root.cube0._x = (Stage.width / 2) - 255;
_root.cube1._x = (Stage.width / 2) - 85;
_root.cube2._x = (Stage.width / 2) + 85;
_root.cube3._x = (Stage.width / 2) + 255;
_root.cube4._x = (Stage.width / 2) - 255;
_root.cube5._x = (Stage.width / 2) - 85;
_root.cube6._x = (Stage.width / 2) + 85;
_root.cube7._x = (Stage.width / 2) + 255;
_root.cube8._x = (Stage.width / 2) - 255;
_root.cube9._x = (Stage.width / 2) - 85;
_root.cube10._x = (Stage.width / 2) + 85;
_root.cube11._x = (Stage.width / 2) + 255;
_root.cube0._y = (Stage.height / 2) - 130;
_root.cube1._y = (Stage.height / 2) - 130;
_root.cube2._y = (Stage.height / 2) - 130;
_root.cube3._y = (Stage.height / 2) - 130;
_root.cube4._y = Stage.height / 2;
_root.cube5._y = Stage.height / 2;
_root.cube6._y = Stage.height / 2;
_root.cube7._y = Stage.height / 2;
_root.cube8._y = (Stage.height / 2) + 130;
_root.cube9._y = (Stage.height / 2) + 130;
_root.cube10._y = (Stage.height / 2) + 130;
_root.cube11._y = (Stage.height / 2) + 130;
break;
case 13 :
_root.cube0._x = (Stage.width / 2) - 210;
_root.cube1._x = (Stage.width / 2) - 70;
_root.cube2._x = (Stage.width / 2) + 70;
_root.cube3._x = (Stage.width / 2) + 210;
_root.cube4._x = (Stage.width / 2) - 260;
_root.cube5._x = (Stage.width / 2) - 130;
_root.cube6._x = Stage.width / 2;
_root.cube7._x = (Stage.width / 2) + 130;
_root.cube8._x = (Stage.width / 2) + 260;
_root.cube9._x = (Stage.width / 2) - 210;
_root.cube10._x = (Stage.width / 2) - 70;
_root.cube11._x = (Stage.width / 2) + 70;
_root.cube12._x = (Stage.width / 2) + 210;
_root.cube0._y = (Stage.height / 2) - 130;
_root.cube1._y = (Stage.height / 2) - 130;
_root.cube2._y = (Stage.height / 2) - 130;
_root.cube3._y = (Stage.height / 2) - 130;
_root.cube4._y = Stage.height / 2;
_root.cube5._y = Stage.height / 2;
_root.cube6._y = Stage.height / 2;
_root.cube7._y = Stage.height / 2;
_root.cube8._y = Stage.height / 2;
_root.cube9._y = (Stage.height / 2) + 130;
_root.cube10._y = (Stage.height / 2) + 130;
_root.cube11._y = (Stage.height / 2) + 130;
_root.cube12._y = (Stage.height / 2) + 130;
break;
case 14 :
_root.cube0._x = (Stage.width / 2) - 260;
_root.cube1._x = (Stage.width / 2) - 130;
_root.cube2._x = Stage.width / 2;
_root.cube3._x = (Stage.width / 2) + 130;
_root.cube4._x = (Stage.width / 2) + 260;
_root.cube5._x = (Stage.width / 2) - 210;
_root.cube6._x = (Stage.width / 2) - 70;
_root.cube7._x = (Stage.width / 2) + 70;
_root.cube8._x = (Stage.width / 2) + 210;
_root.cube9._x = (Stage.width / 2) - 260;
_root.cube10._x = (Stage.width / 2) - 130;
_root.cube11._x = Stage.width / 2;
_root.cube12._x = (Stage.width / 2) + 130;
_root.cube13._x = (Stage.width / 2) + 260;
_root.cube0._y = (Stage.height / 2) - 130;
_root.cube1._y = (Stage.height / 2) - 130;
_root.cube2._y = (Stage.height / 2) - 130;
_root.cube3._y = (Stage.height / 2) - 130;
_root.cube4._y = (Stage.height / 2) - 130;
_root.cube5._y = Stage.height / 2;
_root.cube6._y = Stage.height / 2;
_root.cube7._y = Stage.height / 2;
_root.cube8._y = Stage.height / 2;
_root.cube9._y = (Stage.height / 2) + 130;
_root.cube10._y = (Stage.height / 2) + 130;
_root.cube11._y = (Stage.height / 2) + 130;
_root.cube12._y = (Stage.height / 2) + 130;
_root.cube13._y = (Stage.height / 2) + 130;
break;
case 15 :
_root.cube0._x = (Stage.width / 2) - 260;
_root.cube1._x = (Stage.width / 2) - 130;
_root.cube2._x = Stage.width / 2;
_root.cube3._x = (Stage.width / 2) + 130;
_root.cube4._x = (Stage.width / 2) + 260;
_root.cube5._x = (Stage.width / 2) - 260;
_root.cube6._x = (Stage.width / 2) - 130;
_root.cube7._x = Stage.width / 2;
_root.cube8._x = (Stage.width / 2) + 130;
_root.cube9._x = (Stage.width / 2) + 260;
_root.cube10._x = (Stage.width / 2) - 260;
_root.cube11._x = (Stage.width / 2) - 130;
_root.cube12._x = Stage.width / 2;
_root.cube13._x = (Stage.width / 2) + 130;
_root.cube14._x = (Stage.width / 2) + 260;
_root.cube0._y = (Stage.height / 2) - 130;
_root.cube1._y = (Stage.height / 2) - 130;
_root.cube2._y = (Stage.height / 2) - 130;
_root.cube3._y = (Stage.height / 2) - 130;
_root.cube4._y = (Stage.height / 2) - 130;
_root.cube5._y = Stage.height / 2;
_root.cube6._y = Stage.height / 2;
_root.cube7._y = Stage.height / 2;
_root.cube8._y = Stage.height / 2;
_root.cube9._y = Stage.height / 2;
_root.cube10._y = (Stage.height / 2) + 130;
_root.cube11._y = (Stage.height / 2) + 130;
_root.cube12._y = (Stage.height / 2) + 130;
_root.cube13._y = (Stage.height / 2) + 130;
_root.cube14._y = (Stage.height / 2) + 130;
break;
case 16 :
_root.cube0._x = (Stage.width / 2) - 260;
_root.cube1._x = (Stage.width / 2) - 130;
_root.cube2._x = Stage.width / 2;
_root.cube3._x = (Stage.width / 2) + 130;
_root.cube4._x = (Stage.width / 2) + 260;
_root.cube5._x = (Stage.width / 2) - 300;
_root.cube6._x = (Stage.width / 2) - 180;
_root.cube7._x = (Stage.width / 2) - 60;
_root.cube8._x = (Stage.width / 2) + 60;
_root.cube9._x = (Stage.width / 2) + 180;
_root.cube10._x = (Stage.width / 2) + 300;
_root.cube11._x = (Stage.width / 2) - 260;
_root.cube12._x = (Stage.width / 2) - 130;
_root.cube13._x = Stage.width / 2;
_root.cube14._x = (Stage.width / 2) + 130;
_root.cube15._x = (Stage.width / 2) + 260;
_root.cube0._y = (Stage.height / 2) - 130;
_root.cube1._y = (Stage.height / 2) - 130;
_root.cube2._y = (Stage.height / 2) - 130;
_root.cube3._y = (Stage.height / 2) - 130;
_root.cube4._y = (Stage.height / 2) - 130;
_root.cube5._y = Stage.height / 2;
_root.cube6._y = Stage.height / 2;
_root.cube7._y = Stage.height / 2;
_root.cube8._y = Stage.height / 2;
_root.cube9._y = Stage.height / 2;
_root.cube10._y = Stage.height / 2;
_root.cube11._y = (Stage.height / 2) + 130;
_root.cube12._y = (Stage.height / 2) + 130;
_root.cube13._y = (Stage.height / 2) + 130;
_root.cube14._y = (Stage.height / 2) + 130;
_root.cube15._y = (Stage.height / 2) + 130;
break;
case 17 :
_root.cube0._x = (Stage.width / 2) - 300;
_root.cube1._x = (Stage.width / 2) - 180;
_root.cube2._x = (Stage.width / 2) - 60;
_root.cube3._x = (Stage.width / 2) + 60;
_root.cube4._x = (Stage.width / 2) + 180;
_root.cube5._x = (Stage.width / 2) + 300;
_root.cube6._x = (Stage.width / 2) - 260;
_root.cube7._x = (Stage.width / 2) - 130;
_root.cube8._x = Stage.width / 2;
_root.cube9._x = (Stage.width / 2) + 130;
_root.cube10._x = (Stage.width / 2) + 260;
_root.cube11._x = (Stage.width / 2) - 300;
_root.cube12._x = (Stage.width / 2) - 180;
_root.cube13._x = (Stage.width / 2) - 60;
_root.cube14._x = (Stage.width / 2) + 60;
_root.cube15._x = (Stage.width / 2) + 180;
_root.cube16._x = (Stage.width / 2) + 300;
_root.cube0._y = (Stage.height / 2) - 130;
_root.cube1._y = (Stage.height / 2) - 130;
_root.cube2._y = (Stage.height / 2) - 130;
_root.cube3._y = (Stage.height / 2) - 130;
_root.cube4._y = (Stage.height / 2) - 130;
_root.cube5._y = (Stage.height / 2) - 130;
_root.cube6._y = Stage.height / 2;
_root.cube7._y = Stage.height / 2;
_root.cube8._y = Stage.height / 2;
_root.cube9._y = Stage.height / 2;
_root.cube10._y = Stage.height / 2;
_root.cube11._y = (Stage.height / 2) + 130;
_root.cube12._y = (Stage.height / 2) + 130;
_root.cube13._y = (Stage.height / 2) + 130;
_root.cube14._y = (Stage.height / 2) + 130;
_root.cube15._y = (Stage.height / 2) + 130;
_root.cube16._y = (Stage.height / 2) + 130;
break;
case 18 :
_root.cube0._x = (Stage.width / 2) - 300;
_root.cube1._x = (Stage.width / 2) - 180;
_root.cube2._x = (Stage.width / 2) - 60;
_root.cube3._x = (Stage.width / 2) + 60;
_root.cube4._x = (Stage.width / 2) + 180;
_root.cube5._x = (Stage.width / 2) + 300;
_root.cube6._x = (Stage.width / 2) - 300;
_root.cube7._x = (Stage.width / 2) - 180;
_root.cube8._x = (Stage.width / 2) - 60;
_root.cube9._x = (Stage.width / 2) + 60;
_root.cube10._x = (Stage.width / 2) + 180;
_root.cube11._x = (Stage.width / 2) + 300;
_root.cube12._x = (Stage.width / 2) - 300;
_root.cube13._x = (Stage.width / 2) - 180;
_root.cube14._x = (Stage.width / 2) - 60;
_root.cube15._x = (Stage.width / 2) + 60;
_root.cube16._x = (Stage.width / 2) + 180;
_root.cube17._x = (Stage.width / 2) + 300;
_root.cube0._y = (Stage.height / 2) - 130;
_root.cube1._y = (Stage.height / 2) - 130;
_root.cube2._y = (Stage.height / 2) - 130;
_root.cube3._y = (Stage.height / 2) - 130;
_root.cube4._y = (Stage.height / 2) - 130;
_root.cube5._y = (Stage.height / 2) - 130;
_root.cube6._y = Stage.height / 2;
_root.cube7._y = Stage.height / 2;
_root.cube8._y = Stage.height / 2;
_root.cube9._y = Stage.height / 2;
_root.cube10._y = Stage.height / 2;
_root.cube11._y = Stage.height / 2;
_root.cube12._y = (Stage.height / 2) + 130;
_root.cube13._y = (Stage.height / 2) + 130;
_root.cube14._y = (Stage.height / 2) + 130;
_root.cube15._y = (Stage.height / 2) + 130;
_root.cube16._y = (Stage.height / 2) + 130;
_root.cube17._y = (Stage.height / 2) + 130;
break;
case 19 :
_root.cube0._x = (Stage.width / 2) - 250;
_root.cube1._x = (Stage.width / 2) - 150;
_root.cube2._x = (Stage.width / 2) - 50;
_root.cube3._x = (Stage.width / 2) + 50;
_root.cube4._x = (Stage.width / 2) + 150;
_root.cube5._x = (Stage.width / 2) + 250;
_root.cube6._x = (Stage.width / 2) - 300;
_root.cube7._x = (Stage.width / 2) - 200;
_root.cube8._x = (Stage.width / 2) - 100;
_root.cube9._x = Stage.width / 2;
_root.cube10._x = (Stage.width / 2) + 100;
_root.cube11._x = (Stage.width / 2) + 200;
_root.cube12._x = (Stage.width / 2) + 300;
_root.cube13._x = (Stage.width / 2) - 250;
_root.cube14._x = (Stage.width / 2) - 150;
_root.cube15._x = (Stage.width / 2) - 50;
_root.cube16._x = (Stage.width / 2) + 50;
_root.cube17._x = (Stage.width / 2) + 150;
_root.cube18._x = (Stage.width / 2) + 250;
_root.cube0._y = (Stage.height / 2) - 120;
_root.cube1._y = (Stage.height / 2) - 120;
_root.cube2._y = (Stage.height / 2) - 120;
_root.cube3._y = (Stage.height / 2) - 120;
_root.cube4._y = (Stage.height / 2) - 120;
_root.cube5._y = (Stage.height / 2) - 120;
_root.cube6._y = Stage.height / 2;
_root.cube7._y = Stage.height / 2;
_root.cube8._y = Stage.height / 2;
_root.cube9._y = Stage.height / 2;
_root.cube10._y = Stage.height / 2;
_root.cube11._y = Stage.height / 2;
_root.cube12._y = Stage.height / 2;
_root.cube13._y = (Stage.height / 2) + 120;
_root.cube14._y = (Stage.height / 2) + 120;
_root.cube15._y = (Stage.height / 2) + 120;
_root.cube16._y = (Stage.height / 2) + 120;
_root.cube17._y = (Stage.height / 2) + 120;
_root.cube18._y = (Stage.height / 2) + 120;
break;
case 20 :
_root.cube0._x = (Stage.width / 2) - 260;
_root.cube1._x = (Stage.width / 2) - 130;
_root.cube2._x = Stage.width / 2;
_root.cube3._x = (Stage.width / 2) + 130;
_root.cube4._x = (Stage.width / 2) + 260;
_root.cube5._x = (Stage.width / 2) - 260;
_root.cube6._x = (Stage.width / 2) - 130;
_root.cube7._x = Stage.width / 2;
_root.cube8._x = (Stage.width / 2) + 130;
_root.cube9._x = (Stage.width / 2) + 260;
_root.cube10._x = (Stage.width / 2) - 260;
_root.cube11._x = (Stage.width / 2) - 130;
_root.cube12._x = Stage.width / 2;
_root.cube13._x = (Stage.width / 2) + 130;
_root.cube14._x = (Stage.width / 2) + 260;
_root.cube15._x = (Stage.width / 2) - 260;
_root.cube16._x = (Stage.width / 2) - 130;
_root.cube17._x = Stage.width / 2;
_root.cube18._x = (Stage.width / 2) + 130;
_root.cube19._x = (Stage.width / 2) + 260;
_root.cube0._y = (Stage.height / 2) - 135;
_root.cube1._y = (Stage.height / 2) - 135;
_root.cube2._y = (Stage.height / 2) - 135;
_root.cube3._y = (Stage.height / 2) - 135;
_root.cube4._y = (Stage.height / 2) - 135;
_root.cube5._y = (Stage.height / 2) - 45;
_root.cube6._y = (Stage.height / 2) - 45;
_root.cube7._y = (Stage.height / 2) - 45;
_root.cube8._y = (Stage.height / 2) - 45;
_root.cube9._y = (Stage.height / 2) - 45;
_root.cube10._y = (Stage.height / 2) + 45;
_root.cube11._y = (Stage.height / 2) + 45;
_root.cube12._y = (Stage.height / 2) + 45;
_root.cube13._y = (Stage.height / 2) + 45;
_root.cube14._y = (Stage.height / 2) + 45;
_root.cube15._y = (Stage.height / 2) + 135;
_root.cube16._y = (Stage.height / 2) + 135;
_root.cube17._y = (Stage.height / 2) + 135;
_root.cube18._y = (Stage.height / 2) + 135;
_root.cube19._y = (Stage.height / 2) + 135;
break;
case 21 :
_root.cube0._x = (Stage.width / 2) - 300;
_root.cube1._x = (Stage.width / 2) - 200;
_root.cube2._x = (Stage.width / 2) - 100;
_root.cube3._x = Stage.width / 2;
_root.cube4._x = (Stage.width / 2) + 100;
_root.cube5._x = (Stage.width / 2) + 200;
_root.cube6._x = (Stage.width / 2) + 300;
_root.cube7._x = (Stage.width / 2) - 300;
_root.cube8._x = (Stage.width / 2) - 200;
_root.cube9._x = (Stage.width / 2) - 100;
_root.cube10._x = Stage.width / 2;
_root.cube11._x = (Stage.width / 2) + 100;
_root.cube12._x = (Stage.width / 2) + 200;
_root.cube13._x = (Stage.width / 2) + 300;
_root.cube14._x = (Stage.width / 2) - 300;
_root.cube15._x = (Stage.width / 2) - 200;
_root.cube16._x = (Stage.width / 2) - 100;
_root.cube17._x = Stage.width / 2;
_root.cube18._x = (Stage.width / 2) + 100;
_root.cube19._x = (Stage.width / 2) + 200;
_root.cube20._x = (Stage.width / 2) + 300;
_root.cube0._y = (Stage.height / 2) - 100;
_root.cube1._y = (Stage.height / 2) - 100;
_root.cube2._y = (Stage.height / 2) - 100;
_root.cube3._y = (Stage.height / 2) - 100;
_root.cube4._y = (Stage.height / 2) - 100;
_root.cube5._y = (Stage.height / 2) - 100;
_root.cube6._y = (Stage.height / 2) - 100;
_root.cube7._y = Stage.height / 2;
_root.cube8._y = Stage.height / 2;
_root.cube9._y = Stage.height / 2;
_root.cube10._y = Stage.height / 2;
_root.cube11._y = Stage.height / 2;
_root.cube12._y = Stage.height / 2;
_root.cube13._y = Stage.height / 2;
_root.cube14._y = (Stage.height / 2) + 100;
_root.cube15._y = (Stage.height / 2) + 100;
_root.cube16._y = (Stage.height / 2) + 100;
_root.cube17._y = (Stage.height / 2) + 100;
_root.cube18._y = (Stage.height / 2) + 100;
_root.cube19._y = (Stage.height / 2) + 100;
_root.cube20._y = (Stage.height / 2) + 100;
break;
case 22 :
_root.cube0._x = (Stage.width / 2) - 260;
_root.cube1._x = (Stage.width / 2) - 130;
_root.cube2._x = Stage.width / 2;
_root.cube3._x = (Stage.width / 2) + 130;
_root.cube4._x = (Stage.width / 2) + 260;
_root.cube5._x = (Stage.width / 2) - 275;
_root.cube6._x = (Stage.width / 2) - 165;
_root.cube7._x = (Stage.width / 2) - 55;
_root.cube8._x = (Stage.width / 2) + 55;
_root.cube9._x = (Stage.width / 2) + 165;
_root.cube10._x = (Stage.width / 2) + 275;
_root.cube11._x = (Stage.width / 2) - 275;
_root.cube12._x = (Stage.width / 2) - 165;
_root.cube13._x = (Stage.width / 2) - 55;
_root.cube14._x = (Stage.width / 2) + 55;
_root.cube15._x = (Stage.width / 2) + 165;
_root.cube16._x = (Stage.width / 2) + 275;
_root.cube17._x = (Stage.width / 2) - 260;
_root.cube18._x = (Stage.width / 2) - 130;
_root.cube19._x = Stage.width / 2;
_root.cube20._x = (Stage.width / 2) + 130;
_root.cube21._x = (Stage.width / 2) + 260;
_root.cube0._y = (Stage.height / 2) - 135;
_root.cube1._y = (Stage.height / 2) - 135;
_root.cube2._y = (Stage.height / 2) - 135;
_root.cube3._y = (Stage.height / 2) - 135;
_root.cube4._y = (Stage.height / 2) - 135;
_root.cube5._y = (Stage.height / 2) - 45;
_root.cube6._y = (Stage.height / 2) - 45;
_root.cube7._y = (Stage.height / 2) - 45;
_root.cube8._y = (Stage.height / 2) - 45;
_root.cube9._y = (Stage.height / 2) - 45;
_root.cube10._y = (Stage.height / 2) - 45;
_root.cube11._y = (Stage.height / 2) + 45;
_root.cube12._y = (Stage.height / 2) + 45;
_root.cube13._y = (Stage.height / 2) + 45;
_root.cube14._y = (Stage.height / 2) + 45;
_root.cube15._y = (Stage.height / 2) + 45;
_root.cube16._y = (Stage.height / 2) + 45;
_root.cube17._y = (Stage.height / 2) + 135;
_root.cube18._y = (Stage.height / 2) + 135;
_root.cube19._y = (Stage.height / 2) + 135;
_root.cube20._y = (Stage.height / 2) + 135;
_root.cube21._y = (Stage.height / 2) + 135;
break;
case 23 :
_root.cube0._x = (Stage.width / 2) - 260;
_root.cube1._x = (Stage.width / 2) - 130;
_root.cube2._x = Stage.width / 2;
_root.cube3._x = (Stage.width / 2) + 130;
_root.cube4._x = (Stage.width / 2) + 260;
_root.cube5._x = (Stage.width / 2) - 275;
_root.cube6._x = (Stage.width / 2) - 165;
_root.cube7._x = (Stage.width / 2) - 55;
_root.cube8._x = (Stage.width / 2) + 55;
_root.cube9._x = (Stage.width / 2) + 165;
_root.cube10._x = (Stage.width / 2) + 275;
_root.cube11._x = (Stage.width / 2) - 275;
_root.cube12._x = (Stage.width / 2) - 165;
_root.cube13._x = (Stage.width / 2) - 55;
_root.cube14._x = (Stage.width / 2) + 55;
_root.cube15._x = (Stage.width / 2) + 165;
_root.cube16._x = (Stage.width / 2) + 275;
_root.cube17._x = (Stage.width / 2) - 275;
_root.cube18._x = (Stage.width / 2) - 165;
_root.cube19._x = (Stage.width / 2) - 55;
_root.cube20._x = (Stage.width / 2) + 55;
_root.cube21._x = (Stage.width / 2) + 165;
_root.cube22._x = (Stage.width / 2) + 275;
_root.cube0._y = (Stage.height / 2) - 135;
_root.cube1._y = (Stage.height / 2) - 135;
_root.cube2._y = (Stage.height / 2) - 135;
_root.cube3._y = (Stage.height / 2) - 135;
_root.cube4._y = (Stage.height / 2) - 135;
_root.cube5._y = (Stage.height / 2) - 45;
_root.cube6._y = (Stage.height / 2) - 45;
_root.cube7._y = (Stage.height / 2) - 45;
_root.cube8._y = (Stage.height / 2) - 45;
_root.cube9._y = (Stage.height / 2) - 45;
_root.cube10._y = (Stage.height / 2) - 45;
_root.cube11._y = (Stage.height / 2) + 45;
_root.cube12._y = (Stage.height / 2) + 45;
_root.cube13._y = (Stage.height / 2) + 45;
_root.cube14._y = (Stage.height / 2) + 45;
_root.cube15._y = (Stage.height / 2) + 45;
_root.cube16._y = (Stage.height / 2) + 45;
_root.cube17._y = (Stage.height / 2) + 135;
_root.cube18._y = (Stage.height / 2) + 135;
_root.cube19._y = (Stage.height / 2) + 135;
_root.cube20._y = (Stage.height / 2) + 135;
_root.cube21._y = (Stage.height / 2) + 135;
_root.cube22._y = (Stage.height / 2) + 135;
break;
case 24 :
_root.cube0._x = (Stage.width / 2) - 275;
_root.cube1._x = (Stage.width / 2) - 165;
_root.cube2._x = (Stage.width / 2) - 55;
_root.cube3._x = (Stage.width / 2) + 55;
_root.cube4._x = (Stage.width / 2) + 165;
_root.cube5._x = (Stage.width / 2) + 275;
_root.cube6._x = (Stage.width / 2) - 275;
_root.cube7._x = (Stage.width / 2) - 165;
_root.cube8._x = (Stage.width / 2) - 55;
_root.cube9._x = (Stage.width / 2) + 55;
_root.cube10._x = (Stage.width / 2) + 165;
_root.cube11._x = (Stage.width / 2) + 275;
_root.cube12._x = (Stage.width / 2) - 275;
_root.cube13._x = (Stage.width / 2) - 165;
_root.cube14._x = (Stage.width / 2) - 55;
_root.cube15._x = (Stage.width / 2) + 55;
_root.cube16._x = (Stage.width / 2) + 165;
_root.cube17._x = (Stage.width / 2) + 275;
_root.cube18._x = (Stage.width / 2) - 275;
_root.cube19._x = (Stage.width / 2) - 165;
_root.cube20._x = (Stage.width / 2) - 55;
_root.cube21._x = (Stage.width / 2) + 55;
_root.cube22._x = (Stage.width / 2) + 165;
_root.cube23._x = (Stage.width / 2) + 275;
_root.cube0._y = (Stage.height / 2) - 135;
_root.cube1._y = (Stage.height / 2) - 135;
_root.cube2._y = (Stage.height / 2) - 135;
_root.cube3._y = (Stage.height / 2) - 135;
_root.cube4._y = (Stage.height / 2) - 135;
_root.cube5._y = (Stage.height / 2) - 135;
_root.cube6._y = (Stage.height / 2) - 45;
_root.cube7._y = (Stage.height / 2) - 45;
_root.cube8._y = (Stage.height / 2) - 45;
_root.cube9._y = (Stage.height / 2) - 45;
_root.cube10._y = (Stage.height / 2) - 45;
_root.cube11._y = (Stage.height / 2) - 45;
_root.cube12._y = (Stage.height / 2) + 45;
_root.cube13._y = (Stage.height / 2) + 45;
_root.cube14._y = (Stage.height / 2) + 45;
_root.cube15._y = (Stage.height / 2) + 45;
_root.cube16._y = (Stage.height / 2) + 45;
_root.cube17._y = (Stage.height / 2) + 45;
_root.cube18._y = (Stage.height / 2) + 135;
_root.cube19._y = (Stage.height / 2) + 135;
_root.cube20._y = (Stage.height / 2) + 135;
_root.cube21._y = (Stage.height / 2) + 135;
_root.cube22._y = (Stage.height / 2) + 135;
_root.cube23._y = (Stage.height / 2) + 135;
break;
default :
trace("no design for this number of cubes!");
}
_root.attachMovie("loading_anim", "loadingAnim", i);
}
function checkColor() {
var actCodeWord = _root.cube0.ampel.codeWord;
var allTheSame = true;
if (!_root.cube0.rahmen._visible) {
allTheSame = false;
} else {
var i = 1;
while (i < eval (("_root.level" + _root.actLevel) + "_numOfCubes")) {
if (actCodeWord != eval (("_root.cube" + i) + ".ampel.codeWord")) {
allTheSame = false;
break;
}
if (!eval (("_root.cube" + i) + ".rahmen._visible")) {
allTheSame = false;
break;
}
i++;
}
}
if (allTheSame) {
var i = 0;
while (i < eval (("_root.level" + _root.actLevel) + "_numOfCubes")) {
eval ("cube" + i).isStopped = true;
i++;
}
_root.gotoAndStop("levelCleared");
}
}
function tidyUp() {
removeMovieClip("nextLevelButton");
var i = 0;
while (i < eval (("_root.level" + _root.actLevel) + "_numOfCubes")) {
removeMovieClip(eval ("cube" + i));
i++;
}
removeMovieClip("loadingAnim");
}
initLevel();
Frame 3
_root.actLevel++;
calcLevel(_root.actLevel);
var temp = _root.attachMovie("next-level-button", "nextLevelButton", 1000000);
temp._rotation = (Math.random() * 20) - 30;
temp._x = 375;
temp._y = (Math.random() * 70) + 170;
Symbol 21 MovieClip Frame 1
stop();
codeWord = "yellow";
Symbol 21 MovieClip Frame 2
codeWord = "lightGrey";
Symbol 21 MovieClip Frame 6
stop();
codeWord = "lightGrey";
Symbol 21 MovieClip Frame 7
codeWord = "red";
Symbol 21 MovieClip Frame 11
stop();
codeWord = "red";
Symbol 21 MovieClip Frame 12
codeWord = "darkGrey";
Symbol 21 MovieClip Frame 16
stop();
codeWord = "darkGrey";
Symbol 21 MovieClip Frame 17
codeWord = "yellow";
Symbol 21 MovieClip Frame 21
this.gotoAndStop(1);
Symbol 27 MovieClip Frame 1
maskOrigHeight = 120;
Symbol 28 MovieClip Frame 1
this.onEnterFrame = function () {
if (!_parent.isStopped) {
if (count >= (eval (("_root.level" + _root.actLevel) + "_changePace") * _root.config_frameRate)) {
_parent.ampel.play();
_parent.rahmen._visible = false;
count = 0;
} else if (_parent.rahmen._visible) {
_parent.rahmen.mask._height = _parent.rahmen.mask._height - (_parent.rahmen.maskOrigHeight / (eval (("_root.level" + _root.actLevel) + "_stayDelay") * _root.config_frameRate));
}
count++;
}
};
Symbol 30 Button
on (press) {
ticker.count = (eval (("_root.level" + _root.actLevel) + "_changePace") * _root.config_frameRate) - (eval (("_root.level" + _root.actLevel) + "_stayDelay") * _root.config_frameRate);
if (!this.rahmen._visible) {
this.rahmen._visible = true;
_root.checkColor();
}
this.rahmen.mask._height = this.rahmen.maskOrigHeight;
}
Symbol 31 MovieClip [cube] Frame 1
isStopped = false;
this.rahmen._visible = false;
Symbol 39 MovieClip Frame 1
this.displayText.text = _root.actLevel;
Symbol 42 MovieClip Frame 1
this.level.displayText.text = _root.actLevel;
Symbol 43 MovieClip [loading_anim] Frame 60
stop();
Symbol 48 Button
on (release) {
_root.gotoAndStop("level");
}
Symbol 54 MovieClip [next-level-button] Frame 60
stop();
Symbol 55 Button
on (rollOver) {
mouseIsOver = true;
play();
}
on (release) {
_root.attachMovie("Credits-Page", "credits", 1000007);
}
on (rollOut) {
mouseIsOver = false;
gotoAndPlay((16 - _currentframe) + 16);
}
Symbol 63 Button
on (rollOut) {
mouseIsOver = false;
play();
}
on (release) {
_root.attachMovie("Credits-Page", "credits", 1000007);
}
Symbol 64 MovieClip [credits_element] Frame 1
stop();
mouseIsOver = false;
Symbol 64 MovieClip [credits_element] Frame 16
if (mouseIsOver) {
stop();
}
Symbol 64 MovieClip [credits_element] Frame 38
gotoAndStop (1);
Symbol 65 Button
on (release) {
_root.creditLine.gotoAndStop(1);
this.unloadMovie();
}
Symbol 69 Button
on (release) {
_parent.play();
}
Symbol 74 Button
on (release) {
getURL ("mailto:reinhard@subliminal.at");
}
Symbol 79 Button
on (release) {
getURL ("http://reinhard.subliminal.at", "_blank");
}
Symbol 87 Button
on (release) {
getURL ("http://laex.name", "_blank");
}
Symbol 92 Button
on (release) {
getURL ("mailto:alexander.lang@laex.name");
}
Symbol 94 MovieClip [Credits-Page] Frame 1
play();
Symbol 94 MovieClip [Credits-Page] Frame 7
stop();
Symbol 94 MovieClip [Credits-Page] Frame 14
_root.creditLine.gotoAndStop(1);
this.unloadMovie();
Symbol 98 Button
on (release) {
_parent._parent.gotoAndPlay(2);
}
Symbol 105 MovieClip Frame 90
stop();
Symbol 108 Button
on (release) {
_root.gotoAndStop("level");
}
Symbol 114 MovieClip Frame 1
stop();
Symbol 114 MovieClip Frame 121
_root.gotoAndStop("level");
Symbol 116 Button
on (release) {
_root.tidyUp();
_root.gotoAndStop(1);
}