Frame 1
stop();
Stage.showMenu = false;
_quality = "BEST";
_root.cube.onEnterFrame = function () {
percentloaded = (_root.getBytesLoaded() / _root.getBytesTotal()) * 100;
if (percentloaded != 100) {
cube.percentage.text = Math.ceil(percentloaded) + "%";
} else {
_root.play();
}
updateAfterEvent();
};
Frame 4
stop();
_root.createEmptyMovieClip("mcmenusound_", 1337);
menusound_ = new Sound(mcmenusound_);
menusound_.attachSound("menusound");
menusound_.setVolume(45);
menusound_.start(0, 999);
_root.createEmptyMovieClip("mcbuttonsound_", 1338);
buttonsound_ = new Sound(mcbuttonsound_);
buttonsound_.attachSound("buttonsound");
buttonsound_.setVolume(75);
_root.createEmptyMovieClip("mcmove_", 1339);
move_ = new Sound(mcmove_);
move_.setVolume(75);
move_.attachSound("move");
_root.createEmptyMovieClip("mcmusic", 1340);
mcmusic.music = new Sound(mcmusic);
mcmusic.music.attachSound("song");
mcmusic.music.setVolume(30);
buttonplay.onPress = function () {
stopAllSounds();
_root.gotoAndStop(5);
};
buttonplay.onRollOver = function () {
buttonsound_.start(0, 0);
};
buttoninstructions.onPress = function () {
_root.gotoAndStop(6);
};
buttoninstructions.onRollOver = function () {
buttonsound_.start(0, 0);
};
buttonmoregames.onPress = function () {
getURL ("http://team-atemis.com", "blank");
};
buttonmoregames.onRollOver = function () {
buttonsound_.start(0, 0);
};
buttoncredits.onPress = function () {
_root.gotoAndStop(7);
};
buttoncredits.onRollOver = function () {
buttonsound_.start(0, 0);
};
Frame 5
function mapChange() {
gameEnabled = true;
switch (mapNumber) {
case 1 :
myMap = [[0, 0, 0, 0, 0, 0], [0, 5, 1, 1, 1, 0], [0, 1, 0, 0, 1, 0], [0, 1, 1, 1, 1, 0], [0, 0, 0, 0, 0, 0]];
charPos = [1, 1];
break;
case 2 :
myMap = [[0, 0, 0, 0, 0, 0, 4, 4], [0, 1, 1, 1, 1, 0, 0, 4], [0, 1, 1, 1, 1, 1, 0, 4], [0, 1, 0, 0, 0, 1, 0, 4], [0, 1, 0, 4, 0, 1, 0, 0], [0, 1, 0, 0, 0, 1, 1, 0], [0, 1, 1, 1, 1, 1, 5, 0], [0, 0, 0, 0, 0, 0, 0, 0]];
charPos = [6, 6];
break;
case 3 :
myMap = [[0, 0, 0, 0, 0, 0, 0, 0], [0, 1, 1, 1, 1, 1, 1, 0], [0, 1, 1, 1, 1, 1, 1, 0], [0, 0, 0, 5, 1, 0, 0, 0], [0, 1, 1, 1, 1, 1, 1, 0], [0, 1, 1, 1, 1, 1, 1, 0], [0, 0, 0, 0, 0, 0, 0, 0]];
charPos = [3, 3];
break;
case 4 :
myMap = [[4, 0, 0, 0, 0, 0, 0, 0, 0], [4, 0, 1, 1, 1, 1, 1, 1, 0], [4, 0, 1, 1, 1, 5, 1, 1, 0], [0, 0, 0, 1, 1, 1, 1, 0, 0], [0, 1, 1, 1, 1, 1, 1, 0, 4], [0, 1, 1, 1, 1, 1, 1, 0, 4], [0, 0, 0, 0, 0, 1, 1, 0, 4], [4, 4, 4, 4, 0, 0, 0, 0, 4]];
charPos = [5, 2];
break;
case 5 :
myMap = [[0, 0, 0, 0, 0, 0, 4, 4], [0, 1, 1, 1, 1, 0, 4, 4], [0, 1, 1, 1, 1, 0, 0, 4], [0, 0, 1, 1, 1, 1, 0, 4], [0, 0, 1, 1, 1, 1, 0, 0], [0, 1, 1, 1, 1, 1, 5, 0], [0, 1, 1, 1, 1, 1, 1, 0], [0, 0, 0, 1, 1, 0, 0, 0], [4, 4, 0, 0, 0, 0, 4, 4]];
charPos = [6, 5];
break;
case 6 :
myMap = [[0, 0, 0, 0, 0, 0, 0, 0], [0, 1, 1, 0, 0, 1, 1, 0], [0, 1, 1, 0, 1, 1, 1, 0], [0, 5, 1, 1, 1, 1, 1, 0], [0, 1, 1, 1, 1, 1, 0, 0], [0, 0, 0, 0, 0, 0, 0, 4]];
charPos = [1, 3];
break;
case 7 :
myMap = [[0, 0, 0, 0, 4, 4, 4, 4], [0, 1, 1, 0, 0, 0, 0, 0], [0, 1, 1, 1, 1, 1, 1, 0], [0, 1, 1, 1, 1, 1, 5, 0], [0, 1, 1, 0, 0, 1, 1, 0], [0, 1, 1, 0, 0, 1, 1, 0], [0, 1, 1, 1, 1, 0, 0, 0], [0, 1, 1, 1, 1, 0, 4, 4], [0, 0, 0, 0, 0, 0, 4, 4]];
charPos = [6, 3];
break;
case 8 :
myMap = [[0, 0, 0, 0, 0, 0, 0, 0, 4, 4], [0, 1, 1, 1, 1, 1, 1, 0, 0, 0], [0, 1, 1, 1, 1, 1, 1, 1, 1, 0], [0, 1, 1, 1, 5, 1, 1, 1, 1, 0], [0, 0, 0, 1, 1, 1, 1, 0, 0, 0], [4, 4, 0, 0, 1, 1, 0, 0, 4, 4], [4, 4, 4, 0, 1, 1, 0, 4, 4, 4], [4, 4, 4, 0, 0, 0, 0, 4, 4, 4]];
charPos = [4, 3];
break;
case 9 :
myMap = [[4, 4, 0, 0, 0, 0, 0, 0], [4, 4, 0, 1, 1, 1, 1, 0], [4, 4, 0, 1, 5, 1, 1, 0], [4, 4, 0, 1, 1, 1, 1, 0], [0, 0, 0, 1, 1, 1, 1, 0], [0, 1, 1, 1, 1, 1, 1, 0], [0, 1, 1, 1, 1, 1, 1, 0], [0, 0, 0, 0, 0, 1, 1, 0], [4, 4, 4, 4, 0, 0, 0, 0]];
charPos = [4, 2];
break;
case 10 :
myMap = [[0, 0, 0, 0, 4, 4, 4, 4], [0, 1, 1, 0, 0, 0, 0, 0], [0, 1, 1, 1, 1, 1, 1, 0], [0, 1, 1, 1, 1, 1, 1, 0], [0, 1, 1, 1, 1, 0, 0, 0], [0, 1, 1, 1, 1, 1, 1, 0], [0, 1, 1, 1, 5, 1, 1, 0], [0, 0, 0, 0, 0, 0, 0, 0]];
charPos = [4, 6];
break;
case 11 :
myMap = [[4, 4, 0, 0, 0, 0, 4, 4, 4, 4], [0, 0, 0, 1, 1, 0, 0, 0, 0, 0], [0, 1, 1, 1, 1, 1, 1, 1, 1, 0], [0, 1, 1, 5, 1, 1, 1, 1, 1, 0], [0, 0, 1, 1, 1, 1, 0, 1, 1, 0], [0, 0, 1, 1, 1, 1, 0, 1, 1, 0], [4, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
charPos = [3, 3];
break;
case 12 :
myMap = [[4, 4, 4, 4, 4, 4, 0, 0, 0, 0, 4], [4, 4, 4, 4, 4, 4, 0, 1, 5, 0, 4], [0, 0, 0, 0, 4, 4, 0, 1, 1, 0, 4], [0, 1, 1, 0, 4, 4, 0, 1, 1, 0, 4], [0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 4], [0, 1, 1, 2, 2, 2, 2, 2, 1, 0, 4], [0, 1, 1, 1, 0, 0, 0, 1, 1, 0, 4], [0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 4]];
charPos = [8, 1];
break;
case 13 :
myMap = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 1, 1, 1, 1, 1, 1, 1, 5, 0], [0, 1, 0, 0, 0, 0, 0, 0, 1, 0], [0, 1, 0, 4, 4, 4, 4, 0, 1, 0], [0, 1, 0, 0, 0, 0, 0, 0, 2, 0], [0, 1, 1, 1, 1, 1, 1, 1, 2, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
charPos = [8, 1];
break;
case 14 :
myMap = [[0, 0, 0, 0, 0, 0, 0], [0, 5, 2, 2, 2, 1, 0], [0, 1, 1, 0, 0, 0, 0], [0, 0, 0, 0, 4, 4, 4]];
charPos = [1, 1];
break;
case 15 :
myMap = [[0, 0, 0, 0, 0, 0, 0, 0], [0, 5, 1, 1, 2, 1, 1, 0], [0, 1, 0, 0, 2, 0, 1, 0], [0, 1, 1, 1, 2, 1, 1, 0], [0, 0, 0, 0, 0, 0, 0, 0]];
charPos = [1, 1];
break;
case 16 :
myMap = [[0, 0, 0, 0, 0, 0, 0, 4, 4, 4], [0, 1, 2, 2, 1, 1, 0, 4, 4, 4], [0, 1, 1, 1, 1, 1, 0, 0, 4, 4], [0, 1, 1, 1, 1, 1, 1, 0, 0, 0], [0, 1, 1, 1, 1, 1, 1, 1, 1, 0], [0, 0, 0, 1, 1, 1, 1, 1, 1, 0], [4, 4, 0, 5, 1, 0, 0, 0, 0, 0], [4, 4, 0, 0, 0, 0, 4, 4, 4, 4]];
charPos = [3, 6];
break;
case 17 :
myMap = [[0, 0, 0, 0, 4, 0, 0, 0, 0], [0, 1, 1, 0, 0, 0, 1, 1, 0], [0, 2, 2, 2, 2, 2, 2, 1, 0], [0, 5, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 4, 4, 4, 4, 4, 4]];
charPos = [1, 3];
break;
case 18 :
myMap = [[4, 4, 0, 0, 0, 0, 4, 4, 4, 4], [0, 0, 0, 1, 1, 0, 4, 4, 4, 4], [0, 1, 1, 2, 2, 0, 4, 4, 4, 4], [0, 1, 1, 2, 2, 0, 0, 4, 4, 4], [0, 1, 1, 1, 5, 1, 0, 0, 0, 0], [0, 1, 2, 2, 1, 1, 2, 2, 1, 0], [0, 0, 0, 0, 1, 1, 2, 2, 1, 0], [4, 4, 4, 0, 0, 0, 0, 0, 0, 0]];
charPos = [4, 4];
break;
case 19 :
myMap = [[0, 0, 0, 0, 0, 0, 0], [0, 1, 2, 2, 1, 1, 0], [0, 1, 1, 1, 1, 1, 0], [0, 0, 0, 0, 1, 1, 0], [0, 1, 2, 2, 1, 1, 0], [0, 1, 1, 1, 1, 1, 0], [0, 1, 1, 0, 1, 1, 0], [0, 1, 5, 0, 1, 1, 0], [0, 0, 0, 0, 0, 0, 0]];
charPos = [2, 7];
break;
case 20 :
myMap = [[4, 4, 4, 4, 4, 4, 4, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0], [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0], [0, 1, 5, 1, 1, 1, 2, 2, 1, 1, 0], [0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0], [4, 4, 0, 1, 1, 1, 1, 0, 4, 4, 4], [4, 4, 0, 1, 2, 1, 0, 0, 4, 4, 4], [4, 4, 0, 1, 1, 0, 0, 4, 4, 4, 4], [4, 4, 0, 0, 0, 0, 4, 4, 4, 4, 4]];
charPos = [2, 3];
break;
case 21 :
myMap = [[0, 0, 0, 0, 0], [0, 2, 2, 1, 0], [0, 2, 5, 1, 0], [0, 1, 1, 1, 0], [0, 0, 0, 0, 0]];
charPos = [2, 2];
break;
case 22 :
myMap = [[4, 0, 0, 0, 0, 4, 4, 4, 4], [4, 0, 1, 1, 0, 4, 4, 4, 4], [4, 0, 2, 2, 0, 4, 4, 4, 4], [0, 0, 2, 2, 0, 0, 0, 0, 0], [0, 1, 1, 1, 1, 2, 2, 1, 0], [0, 1, 1, 1, 1, 2, 2, 1, 0], [0, 5, 1, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 4, 4, 4, 4, 4]];
charPos = [1, 6];
break;
case 23 :
myMap = [[0, 0, 0, 0, 4, 4, 4, 4, 4], [0, 1, 1, 0, 0, 4, 4, 4, 4], [0, 1, 2, 1, 0, 0, 0, 0, 0], [0, 1, 1, 0, 0, 0, 1, 1, 0], [0, 1, 2, 1, 0, 0, 1, 1, 0], [0, 1, 1, 2, 2, 1, 1, 1, 0], [0, 1, 1, 2, 2, 1, 5, 1, 0], [0, 1, 1, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 4, 4, 4, 4, 4]];
charPos = [6, 6];
break;
case 24 :
myMap = [[4, 4, 4, 4, 4, 4, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 1, 1, 0], [0, 1, 2, 2, 1, 2, 2, 1, 1, 0], [0, 1, 1, 1, 1, 1, 1, 1, 1, 0], [0, 1, 1, 1, 1, 1, 1, 0, 0, 0], [0, 5, 1, 1, 1, 1, 1, 0, 4, 4], [0, 0, 0, 0, 0, 0, 0, 0, 4, 4]];
charPos = [1, 5];
break;
case 25 :
myMap = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 1, 2, 1, 1, 5, 1, 2, 2, 0], [0, 2, 2, 1, 1, 0, 0, 1, 2, 0], [0, 1, 1, 1, 1, 1, 1, 1, 1, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
charPos = [5, 1];
break;
case 26 :
myMap = [[4, 4, 0, 0, 0, 4, 4, 4], [0, 0, 0, 1, 0, 0, 0, 4], [0, 1, 5, 2, 0, 1, 0, 0], [0, 1, 1, 1, 1, 3, 1, 0], [0, 0, 1, 1, 1, 1, 0, 0], [4, 0, 0, 0, 0, 0, 0, 4]];
charPos = [2, 2];
break;
case 27 :
myMap = [[0, 0, 0, 0, 0, 0], [0, 4, 0, 1, 1, 0], [0, 0, 0, 5, 1, 0], [4, 0, 1, 3, 2, 0], [4, 0, 0, 0, 0, 0]];
charPos = [3, 2];
break;
case 28 :
myMap = [[0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 2, 2, 2, 3, 3, 2, 2, 0], [0, 1, 0, 0, 0, 0, 0, 2, 0], [0, 5, 2, 2, 3, 3, 2, 2, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0]];
charPos = [1, 3];
break;
case 29 :
myMap = [[0, 0, 0, 4, 4, 4, 4, 4, 4], [0, 5, 0, 4, 4, 4, 4, 4, 4], [0, 2, 0, 0, 0, 0, 0, 0, 0], [0, 3, 2, 1, 0, 1, 1, 1, 0], [0, 1, 0, 1, 1, 1, 0, 1, 0], [0, 1, 1, 1, 1, 1, 1, 1, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0]];
charPos = [1, 1];
break;
case 30 :
myMap = [[0, 0, 0, 0, 0, 4, 4, 4, 4, 4], [0, 1, 1, 1, 0, 0, 0, 0, 0, 4], [0, 1, 1, 3, 1, 1, 1, 5, 0, 4], [0, 1, 1, 2, 1, 1, 1, 1, 0, 4], [0, 1, 1, 0, 0, 0, 1, 1, 0, 4], [0, 1, 3, 1, 1, 1, 1, 1, 0, 0], [0, 0, 1, 0, 1, 1, 1, 3, 1, 0], [4, 0, 0, 0, 0, 0, 0, 1, 0, 0], [4, 4, 4, 4, 4, 4, 0, 0, 0, 4]];
charPos = [7, 2];
break;
case 31 :
myMap = [[0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 1, 1, 2, 1, 1, 1, 1, 0], [0, 1, 1, 3, 1, 1, 1, 5, 0], [0, 1, 1, 1, 1, 1, 1, 1, 0], [0, 0, 1, 1, 1, 1, 1, 1, 0], [4, 0, 1, 1, 0, 0, 1, 1, 0], [4, 0, 0, 0, 0, 0, 0, 0, 0]];
charPos = [7, 2];
break;
case 32 :
myMap = [[4, 4, 4, 0, 0, 0, 4, 4, 4], [0, 0, 0, 0, 1, 0, 0, 4, 4], [0, 1, 1, 1, 3, 1, 0, 0, 0], [0, 1, 1, 1, 1, 1, 1, 1, 0], [0, 0, 0, 1, 1, 1, 1, 1, 0], [4, 4, 0, 1, 1, 0, 1, 1, 0], [4, 4, 0, 5, 1, 2, 1, 1, 0], [4, 4, 0, 1, 1, 3, 1, 1, 0], [4, 4, 0, 1, 1, 1, 0, 0, 0], [4, 4, 0, 0, 0, 0, 0, 4, 4]];
charPos = [3, 6];
break;
case 33 :
myMap = [[4, 4, 4, 4, 4, 0, 0, 0, 0], [4, 4, 4, 4, 0, 0, 1, 1, 0], [0, 0, 0, 0, 0, 1, 1, 1, 0], [0, 1, 1, 1, 1, 2, 2, 1, 0], [0, 5, 1, 1, 1, 2, 3, 1, 0], [0, 1, 1, 1, 1, 0, 0, 0, 0], [0, 1, 1, 1, 3, 1, 0, 0, 4], [0, 1, 1, 0, 1, 0, 0, 4, 4], [0, 0, 0, 0, 0, 0, 4, 4, 4]];
charPos = [1, 4];
break;
case 34 :
myMap = [[4, 4, 4, 4, 4, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 1, 1, 0], [0, 1, 1, 2, 1, 1, 1, 1, 0], [0, 1, 1, 3, 1, 1, 1, 1, 0], [0, 1, 1, 5, 1, 1, 0, 0, 0], [0, 0, 0, 0, 1, 1, 0, 0, 4], [4, 0, 1, 1, 1, 2, 1, 0, 4], [4, 0, 1, 1, 1, 1, 0, 0, 4], [4, 0, 0, 0, 0, 0, 0, 4, 4]];
charPos = [3, 4];
break;
case 35 :
myMap = [[4, 4, 4, 0, 0, 0, 0, 0, 0, 4], [4, 4, 4, 0, 1, 1, 0, 1, 0, 0], [4, 4, 4, 0, 1, 1, 1, 3, 1, 0], [4, 4, 4, 0, 1, 1, 1, 1, 0, 0], [0, 0, 0, 0, 1, 1, 1, 1, 0, 4], [0, 5, 1, 2, 1, 1, 1, 1, 0, 4], [0, 1, 1, 3, 1, 1, 1, 1, 0, 4], [0, 1, 1, 1, 0, 0, 0, 0, 0, 4], [0, 0, 0, 0, 0, 4, 4, 4, 4, 4]];
charPos = [1, 5];
break;
case 36 :
myMap = [[4, 4, 4, 0, 0, 0, 0, 4, 4], [4, 4, 0, 0, 1, 1, 0, 0, 0], [0, 0, 0, 1, 1, 1, 1, 1, 0], [0, 1, 1, 2, 2, 5, 1, 1, 0], [0, 1, 1, 2, 3, 1, 0, 0, 0], [0, 1, 1, 1, 1, 0, 0, 4, 4], [0, 1, 1, 1, 1, 0, 4, 4, 4], [0, 1, 3, 1, 0, 0, 4, 4, 4], [0, 0, 1, 0, 0, 4, 4, 4, 4], [4, 0, 0, 0, 4, 4, 4, 4, 4]];
charPos = [5, 3];
break;
case 37 :
myMap = [[0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 2, 2, 2, 2, 2, 2, 2, 0], [0, 2, 2, 2, 2, 2, 2, 2, 0], [0, 2, 2, 2, 2, 2, 2, 2, 0], [0, 2, 2, 2, 5, 2, 2, 2, 0], [0, 2, 2, 2, 2, 2, 2, 2, 0], [0, 2, 2, 2, 2, 2, 2, 2, 0], [0, 1, 2, 2, 2, 2, 2, 2, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0]];
charPos = [4, 4];
break;
case 38 :
myMap = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 1, 2, 2, 1, 2, 2, 1, 5, 0], [0, 1, 0, 0, 0, 0, 0, 1, 1, 0], [0, 2, 1, 0, 0, 0, 1, 1, 0, 0], [0, 1, 0, 0, 0, 1, 2, 2, 0, 0], [0, 1, 0, 0, 0, 0, 1, 3, 1, 0], [0, 1, 2, 1, 0, 0, 0, 0, 1, 0], [0, 2, 3, 2, 0, 2, 2, 1, 1, 0], [0, 2, 1, 1, 1, 1, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 4, 4, 4]];
charPos = [8, 1];
break;
case 39 :
myMap = [[0, 0, 0, 0, 0, 0, 0, 4, 4], [0, 1, 1, 1, 1, 1, 0, 4, 4], [0, 1, 0, 0, 0, 1, 0, 0, 0], [0, 1, 0, 1, 1, 1, 1, 1, 0], [0, 1, 0, 1, 2, 3, 2, 1, 0], [0, 1, 0, 1, 2, 5, 2, 1, 0], [0, 1, 1, 1, 2, 2, 2, 1, 0], [0, 0, 0, 1, 1, 1, 1, 1, 0], [4, 4, 0, 0, 0, 0, 0, 0, 0]];
charPos = [5, 5];
break;
case 40 :
myMap = [[4, 4, 4, 0, 0, 0, 0, 4, 4, 4], [4, 0, 0, 0, 2, 2, 0, 0, 0, 4], [4, 0, 5, 1, 1, 1, 1, 1, 0, 4], [0, 0, 1, 1, 1, 1, 0, 1, 0, 0], [0, 2, 1, 1, 0, 3, 3, 1, 2, 0], [0, 2, 1, 1, 3, 0, 1, 1, 2, 0], [0, 0, 1, 0, 3, 1, 2, 1, 0, 0], [4, 0, 1, 1, 1, 1, 1, 0, 0, 4], [4, 0, 0, 0, 2, 2, 0, 0, 0, 4], [4, 4, 4, 0, 0, 0, 0, 4, 4, 4]];
charPos = [2, 2];
break;
default :
_root.attachMovie("complete", "_complete", 100, {_x:Stage.width / 2, _y:Stage.height / 2});
_complete.scoredisplay2.text = score;
gameEnabled = false;
currenttime = getTimer();
_complete.onEnterFrame = function () {
if ((getTimer() - currenttime) > 8000) {
stopAllSounds();
clearInterval(timeInterval);
mapNumber = 1;
_complete.removeMovieClip();
level.removeMovieClip();
_root.gotoAndStop(4);
}
};
}
rotate();
}
function menufunction1() {
maxitem = 6;
minitem = 1;
keyDOWN = 40;
keyUP = 38;
keyRIGHT = 39;
keyLEFT = 37;
if ((!_paused) && (gameEnabled)) {
_root.attachMovie("menuoptions", "menuoptions", 2, {_x:Stage.width / 2, _y:Stage.height / 2});
menuoptions.attachMovie("cursor", "cursor", 3);
itemselected = 1;
rendercursor();
_paused = true;
gameEnabled = false;
clearInterval(timeInterval);
} else if (_paused) {
switch (itemselected) {
case 1 :
menuoptions.removeMovieClip();
gameEnabled = true;
_paused = false;
clearInterval(timeInterval);
timeInterval = setInterval(timer, 1000);
reverse();
break;
case 2 :
_paused = false;
tries++;
gameEnabled = true;
menuoptions.removeMovieClip();
clearInterval(timeInterval);
timeLeft = 60;
timedisplay.text = "0:" + timeLeft;
timeInterval = setInterval(timer, 1000);
level.removeMovieClip();
mapChange();
reverse();
break;
case 3 :
menuoptions.removeMovieClip();
_paused = false;
gameEnabled = true;
timeInterval = setInterval(timer, 1000);
render();
if (angle >= 2) {
angle = 1;
} else {
angle++;
}
rotate();
reverse();
break;
case 4 :
if (musicon) {
stopAllSounds();
musicon = false;
} else {
musicon = true;
mcmusic.music.start(0, 999);
mcmusic.music.setVolume(20);
}
break;
case 5 :
switch (_quality) {
case "LOW" :
_quality = "MEDIUM";
break;
case "MEDIUM" :
_quality = "HIGH";
break;
case "HIGH" :
_quality = "BEST";
break;
case "BEST" :
_quality = "LOW";
}
break;
case 6 :
stopAllSounds();
Key.removeListener(kblistener);
level.removeMovieClip();
menuoptions.removeMovieClip();
_root.gotoAndStop(4);
}
}
}
function reverse() {
if (angle == 2) {
keyDOWN = 38;
keyUP = 40;
keyRIGHT = 37;
keyLEFT = 39;
}
}
function setgameover() {
keyDOWN = 40;
keyUP = 38;
keyRIGHT = 39;
keyLEFT = 37;
itemselected = 1;
dead = true;
clearInterval(timeInterval);
gameEnabled = false;
_root.attachMovie("gameover", "gameover_", 2, {_x:Stage.width / 2, _y:Stage.height / 2});
maxitem = 3;
minitem = 1;
gameover_.attachMovie("cursor", "cursor", 3);
itemselected = 1;
rendercursor();
_paused = true;
gameEnabled = false;
clearInterval(timeInterval);
}
function menufunction2() {
switch (itemselected) {
case 1 :
dead = false;
tries++;
_paused = false;
gameEnabled = true;
gameover_.removeMovieClip();
clearInterval(timeInterval);
timeLeft = 60;
timedisplay.text = "0:" + timeLeft;
timeInterval = setInterval(timer, 1000);
level.removeMovieClip();
mapChange();
reverse();
break;
case 2 :
getURL ("http://www.team-atemis.com", "blank");
break;
case 3 :
stopAllSounds();
dead = false;
level.removeMovieClip();
gameover_.removeMovieClip();
reverse();
_root.gotoAndStop(4);
}
}
function timer() {
if (timeLeft > 0) {
timeLeft--;
timedisplay.text = "0:" + timeLeft;
} else {
setgameover();
}
}
function rotate() {
d = 0;
if (angle == 1) {
keyDOWN = 40;
keyUP = 38;
keyRIGHT = 39;
keyLEFT = 37;
dFactor = 1;
yFactor = 1;
xFactor = 1;
} else {
keyDOWN = 38;
keyUP = 40;
keyRIGHT = 37;
keyLEFT = 39;
dFactor = -1;
xFactor = -1;
yFactor = -1;
}
render();
}
function render() {
leveldisplay.text = "level " + mapNumber;
level.removeMovieClip();
_root.createEmptyMovieClip("level", 0);
mapWidth = myMap[0].length;
mapHeight = myMap.length;
i = 0;
while (i < mapHeight) {
j = 0;
while (j < mapWidth) {
d = dFactor * (((i * tileH) + (j * tileW)) + i);
_root.level.attachMovie("tile", ("latile" + i) + j, d, {_x:xFactor * ((tileW / 2) * (j - i)), _y:yFactor * ((tileH / 2) * (j + i))});
_root.level[("latile" + i) + j].gotoAndStop(myMap[i][j] + 1);
if ((i == charPos[1]) && (j == charPos[0])) {
_root.level.attachMovie("char", "char", d, {_x:xFactor * ((tileW / 2) * (j - i)), _y:yFactor * ((tileH / 2) * (j + i))});
}
j++;
}
i++;
}
position();
}
function winning() {
if (gameEnabled) {
if (myMap[currenti][currentj] == 5) {
win = true;
i = 0;
while (i < mapHeight) {
j = 0;
while (j < mapWidth) {
if (((myMap[i][j] != 0) && (myMap[i][j] != 4)) && (myMap[i][j] != 5)) {
win = false;
}
j++;
}
i++;
}
if (win) {
success();
} else {
setgameover();
}
}
}
}
function position() {
level._x = 0;
level._y = 0;
height_ = (Stage.height - level._height) / 2;
width_ = (Stage.width - level._width) / 2;
level.bounds = level.getBounds(_root);
while (level.bounds.xMin < width_) {
level.bounds = level.getBounds(_root);
level._x++;
}
while (level.bounds.yMin < height_) {
level.bounds = level.getBounds(_root);
level._y++;
}
}
function success() {
if (mapNumber != 40) {
score = score + ((timeLeft + mapNumber) - tries);
scoredisplay.text = score;
gameEnabled = false;
_root.attachMovie("success", "success_", 2, {_x:Stage.width / 2, _y:Stage.height / 2});
currenttime = getTimer();
success_.onEnterFrame = function () {
if ((getTimer() - currenttime) > 1000) {
clearInterval(timeInterval);
timeLeft = 60;
timedisplay.text = "0:" + timeLeft;
timeInterval = setInterval(timer, 1000);
mapNumber++;
tries = 1;
mapChange();
success_.removeMovieClip();
}
};
} else {
mapNumber++;
mapChange();
}
}
function rendercursor() {
buttonsound_.start(0, 0);
if (!dead) {
menuoptions.cursor._x = -40;
menuoptions.cursor._y = menuoptions["menu" + itemselected]._y;
} else {
gameover_.cursor._x = -55;
gameover_.cursor._y = gameover_["gom_" + itemselected]._y;
}
}
stop();
musicon = true;
mcmusic.music.start(0, 999);
moved = false;
tileW = 32;
tileH = 16;
dead = false;
tries = 1;
d = 0;
score = 0;
_paused = false;
gameEnabled = true;
angle = 1;
xFactor = 1;
yFactor = 1;
dFactor = 1;
mapNumber = 1;
itemselected = 1;
timeLeft = 60;
timedisplay.text = "0:" + timeLeft;
scoredisplay.text = score;
mapChange();
rotate();
render();
keyDOWN = 40;
keyUP = 38;
keyRIGHT = 39;
keyLEFT = 37;
Key.removeListener(kblistener);
timeInterval = setInterval(timer, 1000);
buttonlink.onPress = function () {
getURL ("http://team-atemis.com", "blank");
};
kblistener = new Object();
kblistener.onKeyDown = function () {
if (Key.isDown(32) || (Key.isDown(13))) {
if (!dead) {
menufunction1();
} else {
menufunction2();
}
}
if (!moved) {
currenti = charPos[1];
currentj = charPos[0];
if (Key.isDown(keyDOWN)) {
if (!_paused) {
if (level[("latile" + (currenti + 1)) + currentj]._currentframe != 1) {
charPos[1]++;
currenti++;
if (myMap[currenti][currentj] != 5) {
myMap[currenti][currentj]--;
} else {
winning();
}
move_.start(0, 0);
render();
moved = true;
}
} else {
if (itemselected < maxitem) {
itemselected++;
}
rendercursor();
}
} else if (Key.isDown(keyUP)) {
if (!_paused) {
if (level[("latile" + (currenti - 1)) + currentj]._currentframe != 1) {
charPos[1]--;
currenti--;
if (myMap[currenti][currentj] != 5) {
myMap[currenti][currentj]--;
} else {
winning();
}
move_.start(0, 0);
render();
moved = true;
}
} else {
if (itemselected > minitem) {
itemselected--;
}
rendercursor();
}
} else if (Key.isDown(keyRIGHT)) {
if (!_paused) {
if (level[("latile" + currenti) + (currentj + 1)]._currentframe != 1) {
charPos[0]++;
currentj++;
if (myMap[currenti][currentj] != 5) {
myMap[currenti][currentj]--;
} else {
winning();
}
move_.start(0, 0);
render();
moved = true;
}
}
} else if (Key.isDown(keyLEFT)) {
if (!_paused) {
if (level[("latile" + currenti) + (currentj - 1)]._currentframe != 1) {
charPos[0]--;
currentj--;
if (myMap[currenti][currentj] != 5) {
myMap[currenti][currentj]--;
} else {
winning();
}
move_.start(0, 0);
render();
moved = true;
}
}
}
}
};
kblistener.onKeyUp = function () {
moved = false;
};
Key.addListener(kblistener);
Frame 6
stop();
buttonback.onPress = function () {
stopAllSounds();
level.removeMovieClip();
_root.gotoAndStop(4);
};
buttonback.onRollOver = function () {
buttonsound_.start(0, 0);
};
Frame 7
stop();
buttonback.onPress = function () {
stopAllSounds();
level.removeMovieClip();
_root.gotoAndStop(4);
};
buttonback.onRollOver = function () {
buttonsound_.start(0, 0);
};