Frame 2
bytes_loaded = getBytesLoaded();
total_bytes = getBytesTotal();
Kbytesloaded = int(bytes_loaded / 1024);
percent_done = int((bytes_loaded / total_bytes) * 100) add "%";
lechargement = int((bytes_loaded / total_bytes) * 100);
if (bytes_loaded >= total_bytes) {
gotoAndPlay ("depart");
}
_root.chargement.gotoAndStop(lechargement);
Frame 3
gotoAndPlay ("boucle");
Frame 10
var fdmusical = new Sound();
fdmusical.attachSound("fdmusical");
_root.francais_btn.onRelease = function () {
_root.langage = 1;
_root.ecranhome_mc.gotoAndStop("_1");
};
_root.anglais_btn.onRelease = function () {
_root.langage = 2;
_root.ecranhome_mc.gotoAndStop("_2");
};
Frame 11
stop();
Frame 17
_root.accueil_btn.onRelease = function () {
_root.gotoAndStop("accueil");
};
_root.bonus_btn.onRelease = function () {
_root.gotoAndStop("bonus");
};
_root.malus_btn.onRelease = function () {
_root.gotoAndStop("malus");
};
_root.ennemis_btn.onRelease = function () {
_root.gotoAndStop("ennemis");
};
_root.instruction_btn.onRelease = function () {
_root.gotoAndStop("instruction");
};
Frame 19
_root.accueil_btn.onRelease = function () {
_root.gotoAndStop("accueil");
};
_root.bonus_btn.onRelease = function () {
_root.gotoAndStop("bonus");
};
_root.malus_btn.onRelease = function () {
_root.gotoAndStop("malus");
};
_root.ennemis_btn.onRelease = function () {
_root.gotoAndStop("ennemis");
};
_root.instruction_btn.onRelease = function () {
_root.gotoAndStop("instruction");
};
Frame 23
function getLastDeapth() {
_root.deapth = _root.deapth + 1;
return(_root.deapth);
}
function initObject() {
pauseAsk = new Object();
Key.addListener(pauseAsk);
}
function destObject() {
Key.removeListener(pauseAsk);
}
function initLevel(numLevel) {
_root.nextLevel = false;
_root.activeDoor = false;
_root.findDoor = false;
_root.currentRoom = 0;
_root.rangeBomb = 1;
_root.nbLaunchedBomb = 0;
_root.maxBombToLaunch = 1;
_root.deapth = 10;
_root.bombDeapth = 8500;
_root.enemyDeapth = 14500;
_root.bonusDeapth = 7000;
_root.compteur = 12000;
_root.myLevel.initMap(numLevel);
_root.widthRoom = _root.sizeTile * _root.myLevel.dimMap[_root.currentRoom][0];
_root.heightRoom = _root.sizeTile * _root.myLevel.dimMap[_root.currentRoom][1];
displayScore();
displayLevel();
displayPowerBomb();
displayMultiBomb();
var _local3 = 0;
while (_local3 < _root.myLevel.dimMap[_root.currentRoom][1]) {
var _local2 = 0;
while (_local2 < _root.myLevel.dimMap[_root.currentRoom][0]) {
_root.myLevel.map[0][_local3][_local2].clip_mc._visible = true;
_local2++;
}
_local3++;
}
_local3 = 0;
while (_local3 < _root.myLevel.dimMap[1][1]) {
var _local2 = 0;
while (_local2 < _root.myLevel.dimMap[1][0]) {
_root.myLevel.map[1][_local3][_local2].clip_mc._visible = false;
_local2++;
}
_local3++;
}
var _local4 = 0;
while (_local4 < _root.enemyArray[0].length) {
_root.enemyArray[0][_local4]._visible = true;
_local4++;
}
_local4 = 0;
while (_local4 < _root.enemyArray[1].length) {
_root.enemyArray[1][_local4]._visible = false;
_local4++;
}
}
function displayScore() {
_root.score_txt.text = _root.score;
}
function displayLevel() {
_root.level_txt.text = _root.level;
}
function displayPowerBomb() {
if (_root.rangeBomb < 4) {
_root.powerbomb_mc.gotoAndStop(_root.rangeBomb);
} else {
_root.powerbomb_mc.gotoAndStop(4);
}
}
function displayMultiBomb() {
if (_root.maxBombToLaunch < 4) {
_root.nbrbomb_mc.gotoAndStop(_root.maxBombToLaunch);
} else {
_root.nbrbomb_mc.gotoAndStop(4);
}
}
function createMCLife() {
_root.attachMovie("life_mc", "life_mc", 16000);
_root.life_mc._x = 543;
_root.life_mc._y = 248;
_root.life_mc.gotoAndStop(_root.life + 1);
}
function creationHero(row, col, typeRef) {
_root.player = _root.game_mc.attachMovie("player_mc", "player_mc", _root.playerDeapth);
_root.player.init(row, col, typeRef, _root.life);
}
function creationBreakingWall(row, col, typeRef, numgrille) {
var _local2;
_local2 = _root.wallArray[numgrille].push(new wall(row, col, typeRef));
}
function creationEnemy(row, col, typeRef, numgrille) {
var _local2;
switch (typeRef) {
case _root.MONSTRE1 :
_local2 = _root.enemyArray[numgrille].push(new stupidmonster(row, col, typeRef));
_root.enemyArray[numgrille][_local2 - 1] = _root.game_mc.attachMovie("monstre1_mc", "monstre1_mc" + _root.enemyDeapth, _root.enemyDeapth);
_root.enemyArray[numgrille][_local2 - 1].init(row, col, typeRef);
break;
case _root.MONSTRE2 :
_local2 = _root.enemyArray[numgrille].push(new mediummonster(row, col, typeRef));
_root.enemyArray[numgrille][_local2 - 1] = _root.game_mc.attachMovie("monstre2_mc", "monstre2_mc" + _root.enemyDeapth, _root.enemyDeapth);
_root.enemyArray[numgrille][_local2 - 1].init(row, col, typeRef);
break;
case _root.MONSTERPETOMAN :
_root.nbMonsterPetoman++;
_local2 = _root.enemyArray[numgrille].push(new petoman());
_root.enemyArray[numgrille][_local2 - 1] = _root.game_mc.attachMovie("petoman_mc", "petoman_mc" + _root.enemyDeapth, _root.enemyDeapth);
_root.enemyArray[numgrille][_local2 - 1].init(row, col, typeRef);
break;
case _root.MONSTERTELEPORTE :
_local2 = _root.enemyArray[numgrille].push(new teleporte());
_root.enemyArray[numgrille][_local2 - 1] = _root.game_mc.attachMovie("teleporte_mc", "teleporte_mc" + _root.enemyDeapth, _root.enemyDeapth);
_root.enemyArray[numgrille][_local2 - 1].init(row, col, typeRef);
break;
case _root.MONSTERWALL :
_local2 = _root.enemyArray[numgrille].push(new mwall());
_root.enemyArray[numgrille][_local2 - 1] = _root.game_mc.attachMovie("mwall_mc", "mwall_mc" + _root.enemyDeapth, _root.enemyDeapth);
_root.enemyArray[numgrille][_local2 - 1].init(row, col, typeRef);
break;
case _root.MONSTERINVISIBLE :
_local2 = _root.enemyArray[numgrille].push(new invisible());
_root.enemyArray[numgrille][_local2 - 1] = _root.game_mc.attachMovie("invisible_mc", "invisible_mc" + _root.enemyDeapth, _root.enemyDeapth);
_root.enemyArray[numgrille][_local2 - 1].init(row, col, typeRef);
break;
case _root.MONSTERSTAR :
_local2 = _root.enemyArray[numgrille].push(new mediummonster(row, col, typeRef));
_root.enemyArray[numgrille][_local2 - 1] = _root.game_mc.attachMovie("mgv_mc", "mgv_mc" + _root.enemyDeapth, _root.enemyDeapth);
_root.enemyArray[_local2 - 1].init(row, col, typeRef);
_root.enemyArray[numgrille][_local2 - 1].init(row, col, typeRef);
break;
case _root.MONSTERBOMB :
_local2 = _root.enemyArray[numgrille].push(new mbomb());
_root.enemyArray[numgrille][_local2 - 1] = _root.game_mc.attachMovie("mbomb_mc", "mbomb_mc" + _root.enemyDeapth, _root.enemyDeapth);
_root.enemyArray[numgrille][_local2 - 1].init(row, col, typeRef);
break;
case _root.MONSTERGLOUTON :
_local2 = _root.enemyArray[numgrille].push(new glouton());
_root.enemyArray[numgrille][_local2 - 1] = _root.game_mc.attachMovie("glouton_mc", "glouton_mc" + _root.enemyDeapth, _root.enemyDeapth);
_root.enemyArray[numgrille][_local2 - 1].init(row, col, typeRef, bombArray);
break;
case _root.MONSTEROVERWALL :
_local2 = _root.enemyArray[numgrille].push(new overwall());
_root.enemyArray[numgrille][_local2 - 1] = _root.game_mc.attachMovie("overwall_mc", "overwall_mc" + _root.enemyDeapth, _root.enemyDeapth);
_root.enemyArray[numgrille][_local2 - 1].init(row, col, typeRef);
break;
case _root.MONSTEREATWALL :
_local2 = _root.enemyArray[numgrille].push(new eatwall());
_root.enemyArray[numgrille][_local2 - 1] = _root.game_mc.attachMovie("eatwall_mc", "eatwall_mc" + _root.enemyDeapth, _root.enemyDeapth);
_root.enemyArray[numgrille][_local2 - 1].init(row, col, typeRef);
break;
case _root.MONSTERSWITCHOFF :
_local2 = _root.enemyArray[numgrille].push(new glouton());
_root.enemyArray[numgrille][_local2 - 1] = _root.game_mc.attachMovie("switchoff_mc", "switchoff_mc" + _root.enemyDeapth, _root.enemyDeapth);
_root.enemyArray[numgrille][_local2 - 1].init(row, col, typeRef, bombArray);
break;
case _root.MONSTERTHIEF :
_local2 = _root.enemyArray[numgrille].push(new thief());
_root.enemyArray[numgrille][_local2 - 1] = _root.game_mc.attachMovie("thief_mc", "thief_mc" + _root.enemyDeapth, _root.enemyDeapth);
_root.enemyArray[numgrille][_local2 - 1].init(row, col, typeRef);
break;
case _root.MONSTERAMOEBA :
_local2 = _root.enemyArray[numgrille].push(new amoeba());
_root.enemyArray[numgrille][_local2 - 1] = _root.game_mc.attachMovie("amoeba_mc", "amoeba_mc" + _root.enemyDeapth, _root.enemyDeapth);
_root.enemyArray[numgrille][_local2 - 1].init(row, col, typeRef);
break;
case _root.MONSTERBLOB :
_local2 = _root.enemyArray[numgrille].push(new blob());
_root.enemyArray[numgrille][_local2 - 1] = _root.game_mc.attachMovie("blob_mc", "blob_mc" + _root.enemyDeapth, _root.enemyDeapth);
_root.enemyArray[numgrille][_local2 - 1].init(row, col, typeRef);
break;
}
_root.enemyDeapth++;
_root.enemyArray[numgrille][_local2 - 1].typeId = _local2 - 1;
}
function creationBonus(row, col, typeRef, numGrid) {
var _local2 = _root.bonusArray[numGrid].push(new bonus());
switch (typeRef) {
case _root.BONUSLIFE :
_root.bonusArray[numGrid][_local2 - 1] = _root.game_mc.attachMovie("bonuslife_mc", "bonuslife_mc" + _root.bonusDeapth, _root.bonusDeapth);
_root.bonusArray[numGrid][_local2 - 1].init(row, col, typeRef);
break;
case _root.MULTIBOMB :
_root.bonusArray[numGrid][_local2 - 1] = _root.game_mc.attachMovie("multibomb_mc", "multibomb_mc" + _root.bonusDeapth, _root.bonusDeapth);
_root.bonusArray[numGrid][_local2 - 1].init(row, col, typeRef);
break;
case _root.ROLLERS :
_root.bonusArray[numGrid][_local2 - 1] = _root.game_mc.attachMovie("rollers_mc", "rollers_mc" + _root.bonusDeapth, _root.bonusDeapth);
_root.bonusArray[numGrid][_local2 - 1].init(row, col, typeRef);
break;
case _root.REMOTECONTROL :
_root.bonusArray[numGrid][_local2 - 1] = _root.game_mc.attachMovie("remote_mc", "remote_mc" + _root.bonusDeapth, _root.bonusDeapth);
_root.bonusArray[numGrid][_local2 - 1].init(row, col, typeRef);
break;
case _root.WEAVE :
_root.bonusArray[numGrid][_local2 - 1] = _root.game_mc.attachMovie("weave_mc", "weave_mc" + _root.bonusDeapth, _root.bonusDeapth);
_root.bonusArray[numGrid][_local2 - 1].init(row, col, typeRef);
break;
case _root.TURTLE :
_root.bonusArray[numGrid][_local2 - 1] = _root.game_mc.attachMovie("slow_mc", "slow_mc" + _root.bonusDeapth, _root.bonusDeapth);
_root.bonusArray[numGrid][_local2 - 1].init(row, col, typeRef);
break;
case _root.BIGBOMB :
_root.bonusArray[numGrid][_local2 - 1] = _root.game_mc.attachMovie("bigbomb_mc", "bigbomb_mc" + _root.bonusDeapth, _root.bonusDeapth);
_root.bonusArray[numGrid][_local2 - 1].init(row, col, typeRef);
break;
case _root.STRONGBOX :
_root.bonusArray[numGrid][_local2 - 1] = _root.game_mc.attachMovie("strongbox_mc", "strongbox_mc" + _root.bonusDeapth, _root.bonusDeapth);
_root.bonusArray[numGrid][_local2 - 1].init(row, col, typeRef);
break;
case _root.BOXKEY :
_root.bonusArray[numGrid][_local2 - 1] = _root.game_mc.attachMovie("key_mc", "key_mc" + _root.bonusDeapth, _root.bonusDeapth);
_root.bonusArray[numGrid][_local2 - 1].init(row, col, typeRef);
break;
case _root.LEVELDOOR :
_root.bonusArray[numGrid][_local2 - 1] = _root.game_mc.attachMovie("leveldoor_mc", "leveldoor_mc" + _root.bonusDeapth, _root.bonusDeapth);
_root.bonusArray[numGrid][_local2 - 1].init(row, col, typeRef);
_root.findDoor = true;
if (_root.activeDoor) {
_root.bonusArray[numGrid][_local2 - 1].gotoAndStop("actif");
}
break;
case _root.BONUSPTS250 :
_root.bonusArray[numGrid][_local2 - 1] = _root.game_mc.attachMovie("pts250_mc", "pts250_mc" + _root.bonusDeapth, _root.bonusDeapth);
_root.bonusArray[numGrid][_local2 - 1].init(row, col, typeRef);
break;
case _root.BONUSPTS500 :
_root.bonusArray[numGrid][_local2 - 1] = _root.game_mc.attachMovie("pts500_mc", "pts500_mc" + _root.bonusDeapth, _root.bonusDeapth);
_root.bonusArray[numGrid][_local2 - 1].init(row, col, typeRef);
break;
case _root.BONUSPTS750 :
_root.bonusArray[numGrid][_local2 - 1] = _root.game_mc.attachMovie("pts750_mc", "pts750_mc" + _root.bonusDeapth, _root.bonusDeapth);
_root.bonusArray[numGrid][_local2 - 1].init(row, col, typeRef);
break;
case _root.BONUSPTS1000 :
_root.bonusArray[numGrid][_local2 - 1] = _root.game_mc.attachMovie("pts1000_mc", "pts1000_mc" + _root.bonusDeapth, _root.bonusDeapth);
_root.bonusArray[numGrid][_local2 - 1].init(row, col, typeRef);
break;
case _root.BONUSMDEAD :
_root.bonusArray[numGrid][_local2 - 1] = _root.game_mc.attachMovie("ptsmdead_mc", "ptsmdead_mc" + _root.bonusDeapth, _root.bonusDeapth);
_root.bonusArray[numGrid][_local2 - 1].init(row, col, typeRef);
break;
case _root.MALUSLIFE :
_root.bonusArray[numGrid][_local2 - 1] = _root.game_mc.attachMovie("maluslife_mc", "maluslife_mc" + _root.bonusDeapth, _root.bonusDeapth);
_root.bonusArray[numGrid][_local2 - 1].init(row, col, typeRef);
break;
case _root.MALUSSPEED :
_root.bonusArray[numGrid][_local2 - 1] = _root.game_mc.attachMovie("malusspeed_mc", "malusspeed_mc" + _root.bonusDeapth, _root.bonusDeapth);
break;
case _root.MALUSBOMB :
_root.bonusArray[numGrid][_local2 - 1] = _root.game_mc.attachMovie("malusbomb_mc", "malusbomb_mc" + _root.bonusDeapth, _root.bonusDeapth);
_root.bonusArray[numGrid][_local2 - 1].init(row, col, typeRef);
break;
case _root.NOREMOTE :
_root.bonusArray[numGrid][_local2 - 1] = _root.game_mc.attachMovie("noremote_mc", "noremote_mc" + _root.bonusDeapth, _root.bonusDeapth);
_root.bonusArray[numGrid][_local2 - 1].init(row, col, typeRef);
break;
case _root.LITTLEBOMB :
_root.bonusArray[numGrid][_local2 - 1] = _root.game_mc.attachMovie("littlebomb_mc", "littlebomb_mc" + _root.bonusDeapth, _root.bonusDeapth);
_root.bonusArray[numGrid][_local2 - 1].init(row, col, typeRef);
break;
}
_root.bonusDeapth++;
_root.bonusArray[numGrid][_local2 - 1].typeId = _local2 - 1;
}
function explosionDisplay(numB) {
var _local4;
var _local5;
var _local3 = new Array([0, 0], [0, -1], [0, 1], [-1, 0], [1, 0]);
var _local9 = new Array(0, 0, 0, 0, 0);
var _local10 = new Array();
_root.explosionEnd = false;
var _local2 = 0;
while (_local2 < _local3.length) {
var _local6 = 1;
while (_local6 <= _root.bombArray[_root.currentRoom][numB].range) {
_local4 = _root.bombArray[_root.currentRoom][numB].row + (_local3[_local2][0] * _local6);
_local5 = _root.bombArray[_root.currentRoom][numB].column + (_local3[_local2][1] * _local6);
if ((((_local4 >= 0) && (_local4 < _root.myLevel.dimMap[_root.currentRoom][1])) && (_local5 >= 0)) && (_local5 < _root.myLevel.dimMap[_root.currentRoom][0])) {
if (_root.myLevel.map[_root.currentRoom][_local4][_local5].walkable) {
if ((_local3[_local2][0] + _local3[_local2][1]) != 0) {
_local9[_local2]++;
}
} else if (((_root.myLevel.map[_root.currentRoom][_local4][_local5].value == _root.BREAKINGWALL1) || (_root.myLevel.map[_root.currentRoom][_local4][_local5].value == _root.BREAKINGWALL2)) || (_root.myLevel.map[_root.currentRoom][_local4][_local5].value == _root.BREAKINGWALL3)) {
if ((_local3[_local2][0] + _local3[_local2][1]) != 0) {
_local9[_local2]++;
}
_local3[_local2][0] = 0;
_local3[_local2][1] = 0;
} else {
_local3[_local2][0] = 0;
_local3[_local2][1] = 0;
}
}
_local6++;
}
_local2++;
}
_root.explose_snd.attachSound("explosion");
_root.explose_snd.start();
var _local7 = 1;
while (_local7 < _local9.length) {
if (_local9[_local7] != 0) {
var _local11 = ("boutexplosion" + _local7) + "_mc";
_local10[_local7] = _root.game_mc.attachMovie([_local11], "explosion_mc" + _root.compteur, _root.compteur);
_local10[_local7].gotoAndStop(String("power" + _local9[_local7]));
_local10[_local7]._x = (_root.bombArray[_root.currentRoom][numB].column * _root.sizeTile) + _root.halfSizeTile;
_local10[_local7]._y = (_root.bombArray[_root.currentRoom][numB].row * _root.sizeTile) + _root.halfSizeTile;
_root.compteur++;
}
_local7++;
}
explosionSpreading(numB);
_root.explosionEnd = true;
}
function explosionSpreading(numBomb) {
var _local2;
var _local3;
var _local9 = new Array([0, 0], [0, -1], [0, 1], [-1, 0], [1, 0]);
var _local7 = 0;
while (_local7 < _local9.length) {
var _local10 = 1;
while (_local10 <= _root.bombArray[_root.currentRoom][numBomb].range) {
_local2 = _root.bombArray[_root.currentRoom][numBomb].row + (_local9[_local7][0] * _local10);
_local3 = _root.bombArray[_root.currentRoom][numBomb].column + (_local9[_local7][1] * _local10);
if ((((_local2 >= 0) && (_local2 < _root.myLevel.dimMap[_root.currentRoom][1])) && (_local3 >= 0)) && (_local3 < _root.myLevel.dimMap[_root.currentRoom][0])) {
if (_root.myLevel.map[_root.currentRoom][_local2][_local3].walkable) {
var _local6 = 0;
while (_local6 < _root.bonusArray[_root.currentRoom].length) {
if ((_root.bonusArray[_root.currentRoom][_local6].row == _local2) && (_root.bonusArray[_root.currentRoom][_local6].column == _local3)) {
if (_root.bonusArray[_root.currentRoom][_local6].typeRef != _root.LEVELDOOR) {
_root.bonusArray[_root.currentRoom][_local6].die();
_root.bonusArray[_root.currentRoom][_local6].removeMovieClip();
_root.myLevel.map[_root.currentRoom][_local2][_local3].value = _root.EMPTY;
} else {
var _local5;
var _local8 = 0;
while (_local8 < 3) {
_local5 = _root.enemyArray[_root.currentRoom].push(new blobbies());
_root.enemyArray[_root.currentRoom][_local5 - 1] = _root.game_mc.attachMovie("blobbies_mc", "blobbies_mc" + _root.enemyDeapth, _root.enemyDeapth);
_root.enemyArray[_root.currentRoom][_local5 - 1].init(_local2, _local3, _root.MONSTERBLOBBIES);
_root.enemyArray[_root.currentRoom][_local5 - 1].setClip();
_root.enemyDeapth++;
_root.enemyArray[_root.currentRoom][_local5 - 1].typeId = _local5 - 1;
_local8++;
}
}
}
_local6++;
}
var _local4 = 0;
while (_local4 < _root.enemyArray[_root.currentRoom].length) {
if (((_root.enemyArray[_root.currentRoom][_local4].row == _local2) && (_root.enemyArray[_root.currentRoom][_local4].column == _local3)) && (_root.enemyArray[_root.currentRoom][_local4].isWalking)) {
_root.enemyArray[_root.currentRoom][_local4].die();
if (!_root.enemyArray[_root.currentRoom][_local4].isAlive) {
_root.enemyArray[_root.currentRoom].splice(_local4, 1);
}
_root.score = _root.score + _root.pointsMonster;
_root.displayScore();
_root.myLevel.map[_root.currentRoom][_local2][_local3].value = _root.BONUS;
_root.myLevel.map[_root.currentRoom][_local2][_local3].bonus = _root.BONUSMDEAD;
_root.creationBonus(_local2, _local3, _root.BONUSMDEAD, _root.currentRoom);
}
_local4++;
}
_local6 = 0;
while (_local6 < _root.bombArray[_root.currentRoom].length) {
if ((_root.bombArray[_root.currentRoom][_local6].row == _local2) && (_root.bombArray[_root.currentRoom][_local6].column == _local3)) {
if ((_root.bombArray[_root.currentRoom][_local6].etat == "eteinte") || (_root.bombArray[_root.currentRoom][_local6].etat == "attente")) {
_root.bombArray[_root.currentRoom][_local6].etat = "explosion";
}
}
_local6++;
}
if ((_root.player.row == _local2) && (_root.player.column == _local3)) {
_root.player.die();
_root.updateLife();
}
} else if (((_root.myLevel.map[_root.currentRoom][_local2][_local3].value == _root.BREAKINGWALL1) || (_root.myLevel.map[_root.currentRoom][_local2][_local3].value == _root.BREAKINGWALL2)) || (_root.myLevel.map[_root.currentRoom][_local2][_local3].value == _root.BREAKINGWALL3)) {
_root.checkBreakingWall(_local2, _local3);
_local9[_local7][0] = 0;
_local9[_local7][1] = 0;
} else {
_local9[_local7][0] = 0;
_local9[_local7][1] = 0;
}
}
_local10++;
}
_local7++;
}
_root.bombArray[_root.currentRoom][numBomb].etat = "explosee";
_root.bombArray[_root.currentRoom][numBomb].clip_mc.removeMovieClip();
_root.bombArray[_root.currentRoom][numBomb].die();
_root.bombArray[_root.currentRoom].splice(numBomb, 1);
}
function updateLife() {
_root.life = _root.player.life;
if (_root.player.life >= 0) {
_root.life_mc.gotoAndStop(_root.player.life + 1);
} else {
_root.gameover = true;
}
}
function checkBreakingWall(rbtemp, cbtemp) {
if (((_root.myLevel.map[_root.currentRoom][rbtemp][cbtemp].value == _root.BREAKINGWALL1) || (_root.myLevel.map[_root.currentRoom][rbtemp][cbtemp].value == _root.BREAKINGWALL2)) || (_root.myLevel.map[_root.currentRoom][rbtemp][cbtemp].value == _root.BREAKINGWALL3)) {
var _local4 = 0;
while (_local4 < _root.wallArray[_root.currentRoom].length) {
if ((_root.wallArray[_root.currentRoom][_local4].row == rbtemp) && (_root.wallArray[_root.currentRoom][_local4].column == cbtemp)) {
_root.wallArray[_root.currentRoom][_local4].explosion(_root.myLevel.map[_root.currentRoom][rbtemp][cbtemp].clip_mc);
if (_root.wallArray[_root.currentRoom][_local4].resistance <= 0) {
var _local5 = getLastDeapth();
_root.myLevel.map[_root.currentRoom][rbtemp][cbtemp].clip_mc = _root.game_mc.attachMovie("casevide_mc", "casevide_mc" + _local5, _local5);
_root.myLevel.map[_root.currentRoom][rbtemp][cbtemp].setClip(rbtemp, cbtemp);
if (_root.myLevel.map[_root.currentRoom][rbtemp][cbtemp].bonus != 0) {
_root.myLevel.map[_root.currentRoom][rbtemp][cbtemp].value = _root.BONUS;
_root.creationBonus(rbtemp, cbtemp, _root.myLevel.map[_root.currentRoom][rbtemp][cbtemp].bonus, _root.currentRoom);
}
_root.wallArray[_root.currentRoom].splice(_local4, 1);
}
}
_local4++;
}
}
}
function displayPlayer() {
var _local2;
_local2 = (_root.player.direct_x + (2 * _root.player.direct_y)) + 3;
_root.player.gotoAndStop(_local2);
}
function testNoMonster() {
if (((_root.enemyArray[0].length < 1) && (_root.enemyArray[1].length < 1)) && (!_root.activeDoor)) {
if (_root.findDoor) {
var _local2 = 0;
while (_local2 < _root.bonusArray[0].length) {
if (_root.bonusArray[0][_local2].typeRef == _root.LEVELDOOR) {
_root.bonusArray[0][_local2].gotoAndStop("actif");
}
_local2++;
}
_local2 = 0;
while (_local2 < _root.bonusArray[1].length) {
if (_root.bonusArray[1][_local2].typeRef == _root.LEVELDOOR) {
_root.bonusArray[1][_local2].gotoAndStop("actif");
}
_local2++;
}
}
_root.activeDoor = true;
_root.porte_snd.attachSound("porte");
_root.porte_snd.start();
}
}
function isAliveToxicCloud() {
var _local2 = 0;
while (_local2 < _root.limitedTimeObjectArray[_root.currentRoom].length) {
if ((getTimer() - _root.limitedTimeObjectArray[_root.currentRoom][_local2].lifeTimeToxicCloud) > _root.limitedTimeObjectArray[_root.currentRoom][_local2].timeLife) {
_root.limitedTimeObjectArray[_root.currentRoom][_local2].die();
_root.limitedTimeObjectArray[_root.currentRoom].splice(_local2, 1);
}
_local2++;
}
}
function cloudVsHero() {
var _local2 = 0;
while (_local2 <= _root.limitedTimeObjectArray[_root.currentRoom].length) {
if (Math.sqrt(Math.pow(_root.limitedTimeObjectArray[_root.currentRoom][_local2].current_x - _root.player.current_x, 2) + Math.pow(_root.limitedTimeObjectArray[_root.currentRoom][_local2].current_y - _root.player.current_y, 2)) < _root.halfSizeTile) {
_root.limitedTimeObjectArray[_root.currentRoom][_local2].die();
_root.limitedTimeObjectArray[_root.currentRoom].splice(_local2, 1);
_root.player.die();
_root.updateLife();
return(true);
}
_local2++;
}
return(false);
}
function destructionObject() {
_root.player.die();
var _local2 = 0;
while (_local2 < _root.enemyArray[0].length) {
_root.enemyArray[0].die();
_local2++;
}
_local2 = 0;
while (_local2 < _root.enemyArray[1].length) {
_root.enemyArray[1].die();
_local2++;
}
_local2 = 0;
while (_local2 < _root.bombArray[0].length) {
_root.bombArray[0].die();
_local2++;
}
_local2 = 0;
while (_local2 < _root.bombArray[1].length) {
_root.bombArray[1].die();
_local2++;
}
_local2 = 0;
while (_local2 < _root.bonusArray[0].length) {
_root.bonusArray[0].die();
_local2++;
}
_local2 = 0;
while (_local2 < _root.bonusArray[1].length) {
_root.bonusArray[1].die();
_local2++;
}
for (var _local3 in _root.game_mc) {
removeMovieClip(_root.game_mc[_local3]);
}
_local2 = 0;
while (_local2 < _root.limitedTimeObjectArray[0].length) {
_root.limitedTimeObjectArray[0].die();
_local2++;
}
_local2 = 0;
while (_local2 < _root.limitedTimeObjectArray[1].length) {
_root.limitedTimeObjectArray[1].die();
_local2++;
}
_root.enemyArray[0].splice(0);
_root.enemyArray[1].splice(0);
_root.bonusArray[0].splice(0);
_root.bonusArray[1].splice(0);
_root.bombArray[0].splice(0);
_root.bombArray[1].splice(0);
_root.wallArray[0].splice(0);
_root.wallArray[1].splice(0);
_root.limitedTimeObjectArray[0].splice(0);
_root.limitedTimeObjectArray[1].splice(0);
}
function prepaTransition() {
_root.player.isWalking = false;
_root.level++;
_root.attachMovie("transition_mc", "transition_mc", 25999);
transition_mc._x = 0;
transition_mc._y = 0;
}
var EMPTY = 0;
var FLAQUE = 1;
var CAROUSELNS = 2;
var CAROUSELSN = 3;
var CAROUSELEW = 4;
var CAROUSELWE = 5;
var SOAPYFLOOR = 6;
var SLIPPERYFLOOR = 7;
var TELEPORTEUR = 8;
var BOMB = 9;
var BREAKINGWALL1 = 11;
var BREAKINGWALL2 = 12;
var BREAKINGWALL3 = 13;
var WALL = 21;
var MONSTRE1 = 50;
var MONSTRE2 = 51;
var MONSTERPETOMAN = 52;
var MONSTERTELEPORTE = 53;
var MONSTERWALL = 54;
var MONSTERINVISIBLE = 55;
var MONSTERSTAR = 56;
var MONSTERBOMB = 57;
var MONSTERGLOUTON = 58;
var MONSTEROVERWALL = 59;
var MONSTEREATWALL = 60;
var MONSTERSWITCHOFF = 61;
var MONSTERTHIEF = 62;
var MONSTERAMOEBA = 63;
var MONSTERBLOB = 64;
var MONSTERBLOBBIES = 65;
var BONUS = 100;
var MULTIBOMB = 102;
var BIGBOMB = 103;
var REMOTECONTROL = 104;
var BONUSLIFE = 105;
var ROLLERS = 106;
var WEAVE = 108;
var TURTLE = 109;
var BONUSPTS250 = 110;
var BONUSPTS500 = 111;
var BONUSPTS750 = 112;
var BONUSPTS1000 = 113;
var LEVELDOOR = 115;
var STRONGBOX = 117;
var BOXKEY = 118;
var BONUSMDEAD = 119;
var MALUSLIFE = 125;
var MALUSSPEED = 126;
var MALUSBOMB = 127;
var NOREMOTE = 128;
var LITTLEBOMB = 129;
var DOOR = 200;
var HERO = 1000;
var TOXICCLOUD = 8;
var SPEEDCOEFNORMAL = 1;
var SPEEDCOEFSOAPYFLOOR = 0.2;
var SPEEDCOEFSLIPPERYFLOOR = 4;
var SPEEDCOEFCAROUSELNSN = 20;
var SPEEDCOEFCAROUSELEWE = 20;
var gameover = false;
var gamepause = false;
var sizeTile = 32;
var halfSizeTile = (sizeTile / 2);
var currentRoom = 0;
var widthRoom;
var heightRoom;
var myLevel = new niveau();
var level = 1;
var activeDoor = false;
var findDoor = false;
var nextLevel = false;
var transition = false;
var finTransition = false;
var score = 0;
var pointsMonster = 10;
var bonusMonsterDead = 20;
var deapth = 10;
var player;
var playerDeapth = 15000;
var life = 3;
var enemyArray = new Array();
var enemyDeapth = 14500;
var nbMonsterPetoman = 0;
var bombArray = new Array();
var bombDeapth = 8500;
var idBomb;
var rangeBomb;
var nbLaunchedBomb;
var maxBombToLaunch;
var compteur = 12000;
var wallArray = new Array();
var bonusArray = new Array();
var bonusDeapth;
var explosionEnd = false;
var limitedTimeObjectArray = new Array();
var idLimitedLifeObject = 0;
var porte_snd = new Sound();
var teleportation_snd = new Sound();
var explose_snd = new Sound();
var depot_snd = new Sound();
var takebonus_snd = new Sound();
_root.enemyArray[0] = new Array();
_root.enemyArray[1] = new Array();
_root.bonusArray[0] = new Array();
_root.bonusArray[1] = new Array();
_root.bombArray[0] = new Array();
_root.bombArray[1] = new Array();
_root.wallArray[0] = new Array();
_root.wallArray[1] = new Array();
_root.limitedTimeObjectArray[0] = new Array();
_root.limitedTimeObjectArray[1] = new Array();
createMCLife();
initLevel(_root.level);
initObject();
stop();
pauseAsk.onKeyDown = function () {
var _local2 = Key.getCode();
if (_local2 == 80) {
if (_root.gamepause) {
pausemc.removeMovieClip();
} else {
pausemc = _root.game_mc.attachMovie("pause_mc", "pause_mc", 15998);
pausemc._x = 0;
pausemc._y = 0;
}
_root.gamepause = !_root.gamepause;
}
};
_root.action_mc.onEnterFrame = function () {
if (!_root.gameover) {
if (!_root.gamepause) {
if (!_root.nextLevel) {
_root.testNoMonster();
if (_root.player.isAlive) {
_root.player.deplace();
if (_root.player.isWalking) {
_root.displayPlayer();
}
if (_root.player.multibombe && (_root.player.launchedBomb)) {
if ((Math.abs(_root.player.old_x - _root.player.current_x) > _root.sizeTile) || (Math.abs(_root.player.old_y - _root.player.current_y) > _root.sizeTile)) {
_root.player.launchedBomb = false;
}
}
}
var _local3 = 0;
while (_local3 < _root.bombArray[_root.currentRoom].length) {
_root.bombArray[_root.currentRoom][_local3].action();
if (_root.bombArray[_root.currentRoom][_local3].etat == "explosion") {
if (_root.bombArray[_root.currentRoom][_local3].reference == _root.HERO) {
_root.nbLaunchedBomb--;
if (_root.nbLaunchedBomb < 0) {
_root.nbLaunchedBomb = 0;
}
_root.player.launchedBomb = false;
}
explosionDisplay(_local3);
}
_local3++;
}
var _local2 = 0;
while (_local2 < _root.enemyArray[_root.currentRoom].length) {
_root.enemyArray[_root.currentRoom][_local2].action(_root.player);
if (_root.enemyArray[_root.currentRoom][_local2].isWalking) {
frame = (_root.enemyArray[_root.currentRoom][_local2].direct_x + (2 * _root.enemyArray[_root.currentRoom][_local2].direct_y)) + 3;
_root.enemyArray[_root.currentRoom][_local2].gotoAndStop(frame);
}
_local2++;
}
var _local4 = 0;
while (_local4 < _root.bonusArray[0].length) {
if (!_root.bonusArray[0][_local4].isAlive) {
_root.bonusArray[0].splice(_local4, 1);
}
_local4++;
}
_local4 = 0;
while (_local4 < _root.bonusArray[1].length) {
if (!_root.bonusArray[1][_local4].isAlive) {
_root.bonusArray[1].splice(_local4, 1);
}
_local4++;
}
_root.isAliveToxicCloud();
_root.cloudVsHero();
} else if ((_root.nextLevel && (!_root.transition)) && (!_root.finTransition)) {
transition_mc.gotoAndPlay(1);
} else if ((_root.nextLevel && (!_root.transition)) && (_root.finTransition)) {
transition_mc.removeMovieClip();
_root.finTransition = false;
_root.nextLevel = false;
}
}
} else {
destructionObject();
destObject();
gotoAndStop ("fin");
}
};
Frame 24
Mouse.show();
_root.rejouer_btn.onRelease = function () {
_root.gotoAndPlay("depart");
};
_root.enregistrer_btn.onRelease = function () {
_root.gotoAndStop("ok");
};
stop();
Frame 25
_root.rejouer_btn.onRelease = function () {
_root.gotoAndPlay("depart");
};
stop();
Symbol 8 MovieClip Frame 1
stop();
Symbol 28 MovieClip Frame 12
stop();
Symbol 29 MovieClip [teleporte_mc] Frame 1
#initclip 59
Object.registerClass("teleporte_mc", teleporte);
#endinitclip
stop();
Symbol 29 MovieClip [teleporte_mc] Frame 7
teleporte_tel_mc.gotoAndPlay("teleportation");
Symbol 29 MovieClip [teleporte_mc] Frame 8
play();
Symbol 29 MovieClip [teleporte_mc] Frame 20
this.removeMovieClip();
stop();
Symbol 49 MovieClip [amoeba_mc] Frame 1
#initclip 23
Object.registerClass("amoeba_mc", amoeba);
#endinitclip
if (resistance > 1) {
protec_mc._visible = true;
} else {
protec_mc._visible = false;
}
stop();
Symbol 49 MovieClip [amoeba_mc] Frame 8
play();
Symbol 49 MovieClip [amoeba_mc] Frame 20
this.removeMovieClip();
stop();
Symbol 63 MovieClip [monstre2_mc] Frame 1
#initclip 24
Object.registerClass("monstre2_mc", mediummonster);
#endinitclip
stop();
Symbol 63 MovieClip [monstre2_mc] Frame 8
play();
Symbol 63 MovieClip [monstre2_mc] Frame 20
this.removeMovieClip();
stop();
Symbol 105 MovieClip [thief_mc] Frame 1
#initclip 25
Object.registerClass("thief_mc", thief);
#endinitclip
stop();
Symbol 105 MovieClip [thief_mc] Frame 8
play();
Symbol 105 MovieClip [thief_mc] Frame 19
this.removeMovieClip();
stop();
Symbol 105 MovieClip [thief_mc] Frame 20
play();
Symbol 105 MovieClip [thief_mc] Frame 32
this.isWalking = true;
stop();
Symbol 145 MovieClip [switchoff_mc] Frame 1
#initclip 26
Object.registerClass("switchoff_mc", glouton);
#endinitclip
stop();
Symbol 145 MovieClip [switchoff_mc] Frame 8
stop();
Symbol 145 MovieClip [switchoff_mc] Frame 9
play();
Symbol 145 MovieClip [switchoff_mc] Frame 20
this.removeMovieClip();
stop();
Symbol 145 MovieClip [switchoff_mc] Frame 21
play();
Symbol 145 MovieClip [switchoff_mc] Frame 43
this.isWalking = true;
stop();
Symbol 152 MovieClip [petoman_mc] Frame 1
#initclip 27
Object.registerClass("petoman_mc", petoman);
#endinitclip
stop();
Symbol 152 MovieClip [petoman_mc] Frame 8
play();
Symbol 152 MovieClip [petoman_mc] Frame 20
this.removeMovieClip();
stop();
Symbol 160 MovieClip [overwall_mc] Frame 1
#initclip 28
Object.registerClass("overwall_mc", overwall);
#endinitclip
stop();
Symbol 160 MovieClip [overwall_mc] Frame 8
play();
Symbol 160 MovieClip [overwall_mc] Frame 20
this.removeMovieClip();
stop();
Symbol 167 MovieClip [monstre1_mc] Frame 1
#initclip 29
Object.registerClass("monstre1_mc", stupidmonster);
#endinitclip
stop();
Symbol 167 MovieClip [monstre1_mc] Frame 8
play();
Symbol 167 MovieClip [monstre1_mc] Frame 20
this.removeMovieClip();
stop();
Symbol 181 MovieClip [mbomb_mc] Frame 1
#initclip 30
Object.registerClass("mbomb_mc", mbomb);
#endinitclip
stop();
Symbol 181 MovieClip [mbomb_mc] Frame 8
play();
Symbol 181 MovieClip [mbomb_mc] Frame 20
this.removeMovieClip();
stop();
Symbol 200 MovieClip [invisible_mc] Frame 1
#initclip 31
Object.registerClass("invisible_mc", invisible);
#endinitclip
stop();
Symbol 200 MovieClip [invisible_mc] Frame 8
play();
Symbol 200 MovieClip [invisible_mc] Frame 20
this.removeMovieClip();
stop();
Symbol 219 MovieClip [glouton_mc] Frame 1
#initclip 32
Object.registerClass("glouton_mc", glouton);
#endinitclip
stop();
Symbol 219 MovieClip [glouton_mc] Frame 8
play();
Symbol 219 MovieClip [glouton_mc] Frame 20
this.removeMovieClip();
stop();
Symbol 219 MovieClip [glouton_mc] Frame 21
play();
Symbol 219 MovieClip [glouton_mc] Frame 35
this.isWalking = true;
stop();
Symbol 228 MovieClip [eatwall_mc] Frame 1
#initclip 33
Object.registerClass("eatwall_mc", eatwall);
#endinitclip
stop();
Symbol 228 MovieClip [eatwall_mc] Frame 8
play();
Symbol 228 MovieClip [eatwall_mc] Frame 21
this.removeMovieClip();
stop();
Symbol 228 MovieClip [eatwall_mc] Frame 22
play();
Symbol 228 MovieClip [eatwall_mc] Frame 44
this.isWalking = true;
stop();
Symbol 231 MovieClip [malusspeed_mc] Frame 1
#initclip 34
Object.registerClass("malusspeed_mc", bonus);
#endinitclip
Symbol 231 MovieClip [malusspeed_mc] Frame 2
play();
Symbol 231 MovieClip [malusspeed_mc] Frame 18
this.die();
this.removeMovieClip();
stop();
Symbol 234 MovieClip [noremote_mc] Frame 1
#initclip 35
Object.registerClass("noremote_mc", bonus);
#endinitclip
Symbol 234 MovieClip [noremote_mc] Frame 2
play();
Symbol 234 MovieClip [noremote_mc] Frame 18
this.die();
this.removeMovieClip();
stop();
Symbol 237 MovieClip [malusbomb_mc] Frame 1
#initclip 36
Object.registerClass("malusbomb_mc", bonus);
#endinitclip
Symbol 237 MovieClip [malusbomb_mc] Frame 2
play();
Symbol 237 MovieClip [malusbomb_mc] Frame 18
this.die();
this.removeMovieClip();
stop();
Symbol 239 MovieClip [maluslife_mc] Frame 1
#initclip 37
Object.registerClass("maluslife_mc", bonus);
#endinitclip
Symbol 239 MovieClip [maluslife_mc] Frame 2
play();
Symbol 239 MovieClip [maluslife_mc] Frame 18
this.die();
this.removeMovieClip();
stop();
Symbol 241 MovieClip [littlebomb_mc] Frame 1
#initclip 38
Object.registerClass("littlebomb_mc", bonus);
#endinitclip
Symbol 241 MovieClip [littlebomb_mc] Frame 2
play();
Symbol 241 MovieClip [littlebomb_mc] Frame 18
this.die();
this.removeMovieClip();
stop();
Symbol 243 MovieClip [weave_mc] Frame 1
#initclip 39
Object.registerClass("weave_mc", bonus);
#endinitclip
Symbol 243 MovieClip [weave_mc] Frame 2
play();
Symbol 243 MovieClip [weave_mc] Frame 18
this.die();
this.removeMovieClip();
stop();
Symbol 250 MovieClip Frame 1
stop();
Symbol 251 MovieClip [strongbox_mc] Frame 1
#initclip 40
Object.registerClass("strongbox_mc", bonus);
#endinitclip
Symbol 251 MovieClip [strongbox_mc] Frame 3
play();
Symbol 251 MovieClip [strongbox_mc] Frame 19
this.die();
this.removeMovieClip();
stop();
Symbol 253 MovieClip [slow_mc] Frame 1
#initclip 41
Object.registerClass("slow_mc", bonus);
#endinitclip
Symbol 253 MovieClip [slow_mc] Frame 2
play();
Symbol 253 MovieClip [slow_mc] Frame 18
this.die();
this.removeMovieClip();
stop();
Symbol 255 MovieClip [rollers_mc] Frame 1
#initclip 42
Object.registerClass("rollers_mc", bonus);
#endinitclip
Symbol 255 MovieClip [rollers_mc] Frame 2
play();
Symbol 255 MovieClip [rollers_mc] Frame 18
this.die();
this.removeMovieClip();
stop();
Symbol 257 MovieClip [remote_mc] Frame 1
#initclip 43
Object.registerClass("remote_mc", bonus);
#endinitclip
Symbol 257 MovieClip [remote_mc] Frame 2
play();
Symbol 257 MovieClip [remote_mc] Frame 18
this.die();
this.removeMovieClip();
stop();
Symbol 258 MovieClip [multibomb_mc] Frame 1
#initclip 44
Object.registerClass("multibomb_mc", bonus);
#endinitclip
Symbol 258 MovieClip [multibomb_mc] Frame 2
play();
Symbol 258 MovieClip [multibomb_mc] Frame 18
this.die();
this.removeMovieClip();
stop();
Symbol 261 MovieClip [key_mc] Frame 1
#initclip 45
Object.registerClass("key_mc", bonus);
#endinitclip
Symbol 261 MovieClip [key_mc] Frame 2
play();
Symbol 261 MovieClip [key_mc] Frame 18
this.die();
this.removeMovieClip();
stop();
Symbol 263 MovieClip [bonuslife_mc] Frame 1
#initclip 46
Object.registerClass("bonuslife_mc", bonus);
#endinitclip
Symbol 263 MovieClip [bonuslife_mc] Frame 2
play();
Symbol 263 MovieClip [bonuslife_mc] Frame 18
this.die();
this.removeMovieClip();
stop();
Symbol 265 MovieClip [bigbomb_mc] Frame 1
#initclip 47
Object.registerClass("bigbomb_mc", bonus);
#endinitclip
Symbol 265 MovieClip [bigbomb_mc] Frame 2
play();
Symbol 265 MovieClip [bigbomb_mc] Frame 18
this.die();
this.removeMovieClip();
stop();
Symbol 267 MovieClip [ptsmdead_mc] Frame 1
#initclip 48
Object.registerClass("ptsmdead_mc", bonus);
#endinitclip
Symbol 267 MovieClip [ptsmdead_mc] Frame 2
play();
Symbol 267 MovieClip [ptsmdead_mc] Frame 18
this.die();
this.removeMovieClip();
stop();
Symbol 269 MovieClip [pts1000_mc] Frame 1
#initclip 49
Object.registerClass("pts1000_mc", bonus);
#endinitclip
Symbol 269 MovieClip [pts1000_mc] Frame 2
play();
Symbol 269 MovieClip [pts1000_mc] Frame 18
this.die();
this.removeMovieClip();
stop();
Symbol 271 MovieClip [pts750_mc] Frame 1
#initclip 50
Object.registerClass("pts750_mc", bonus);
#endinitclip
Symbol 271 MovieClip [pts750_mc] Frame 2
play();
Symbol 271 MovieClip [pts750_mc] Frame 18
this.die();
this.removeMovieClip();
stop();
Symbol 273 MovieClip [pts500_mc] Frame 1
#initclip 51
Object.registerClass("pts500_mc", bonus);
#endinitclip
Symbol 273 MovieClip [pts500_mc] Frame 2
play();
Symbol 273 MovieClip [pts500_mc] Frame 18
this.die();
this.removeMovieClip();
stop();
Symbol 275 MovieClip [pts250_mc] Frame 1
#initclip 52
Object.registerClass("pts250_mc", bonus);
#endinitclip
Symbol 275 MovieClip [pts250_mc] Frame 2
play();
Symbol 275 MovieClip [pts250_mc] Frame 18
this.die();
this.removeMovieClip();
stop();
Symbol 282 MovieClip [leveldoor_mc] Frame 1
#initclip 53
Object.registerClass("leveldoor_mc", bonus);
#endinitclip
Symbol 282 MovieClip [leveldoor_mc] Frame 3
play();
Symbol 282 MovieClip [leveldoor_mc] Frame 19
Symbol 328 MovieClip [player_mc] Frame 1
#initclip 54
Object.registerClass("player_mc", hero);
#endinitclip
if (_root.player.resistance == INVINCIBLE) {
cape_mc._visible = true;
} else {
cape_mc._visible = false;
}
if (_root.player.inRoller) {
wheel_mc._visible = true;
} else {
wheel_mc._visible = false;
}
stop();
Symbol 328 MovieClip [player_mc] Frame 2
if (_root.player.resistance == INVINCIBLE) {
cape_mc._visible = true;
} else {
cape_mc._visible = false;
}
if (_root.player.inRoller) {
wheel_mc._visible = true;
} else {
wheel_mc._visible = false;
}
stop();
Symbol 328 MovieClip [player_mc] Frame 3
if (_root.player.resistance == INVINCIBLE) {
cape_mc._visible = true;
} else {
cape_mc._visible = false;
}
if (_root.player.inRoller) {
wheel_mc._visible = true;
} else {
wheel_mc._visible = false;
}
stop();
Symbol 328 MovieClip [player_mc] Frame 4
if (_root.player.resistance == INVINCIBLE) {
cape_mc._visible = true;
} else {
cape_mc._visible = false;
}
if (_root.player.inRoller) {
wheel_mc._visible = true;
} else {
wheel_mc._visible = false;
}
stop();
Symbol 328 MovieClip [player_mc] Frame 5
if (_root.player.resistance == INVINCIBLE) {
cape_mc._visible = true;
} else {
cape_mc._visible = false;
}
if (_root.player.inRoller) {
wheel_mc._visible = true;
} else {
wheel_mc._visible = false;
}
stop();
Symbol 328 MovieClip [player_mc] Frame 6
if (_root.player.resistance == INVINCIBLE) {
cape_mc._visible = true;
} else {
cape_mc._visible = false;
}
if (_root.player.inRoller) {
wheel_mc._visible = true;
} else {
wheel_mc._visible = false;
}
stop();
Symbol 328 MovieClip [player_mc] Frame 7
if (_root.player.resistance == INVINCIBLE) {
cape_mc._visible = true;
} else {
cape_mc._visible = false;
}
if (_root.player.inRoller) {
wheel_mc._visible = true;
} else {
wheel_mc._visible = false;
}
stop();
Symbol 328 MovieClip [player_mc] Frame 8
play();
Symbol 328 MovieClip [player_mc] Frame 26
this.removeMovieClip();
stop();
Symbol 328 MovieClip [player_mc] Frame 27
isAlive = false;
isBlesse = true;
play();
Symbol 328 MovieClip [player_mc] Frame 34
isAlive = true;
startTimeInvincible = getTimer();
_alpha = 30;
stop();
Symbol 342 MovieClip [boutexplosion3_mc] Frame 1
play();
Symbol 342 MovieClip [boutexplosion3_mc] Frame 5
this.removeMovieClip();
stop();
Symbol 342 MovieClip [boutexplosion3_mc] Frame 6
play();
Symbol 342 MovieClip [boutexplosion3_mc] Frame 10
this.removeMovieClip();
stop();
Symbol 342 MovieClip [boutexplosion3_mc] Frame 11
play();
Symbol 342 MovieClip [boutexplosion3_mc] Frame 15
this.removeMovieClip();
stop();
Symbol 342 MovieClip [boutexplosion3_mc] Frame 16
play();
Symbol 342 MovieClip [boutexplosion3_mc] Frame 20
this.removeMovieClip();
stop();
Symbol 343 MovieClip [bombe_mc] Frame 1
play();
Symbol 343 MovieClip [bombe_mc] Frame 35
stop();
Symbol 343 MovieClip [bombe_mc] Frame 55
stop();
Symbol 346 MovieClip Frame 1
direction = "_" add _root.langage;
gotoAndStop(direction);
stop();
Symbol 351 MovieClip [transition_mc] Frame 1
_root.transition = true;
_root.finTransition = false;
leniveau = _root.level;
leniveauombre = _root.level;
Symbol 351 MovieClip [transition_mc] Frame 18
_root.destructionObject();
if (_root.level >= 5) {
_root.gotoAndStop("fin");
}
Symbol 351 MovieClip [transition_mc] Frame 36
_root.transition = false;
_root.finTransition = true;
_root.initLevel(_root.level);
stop();
Symbol 358 MovieClip [breakingwall_mc] Frame 1
stop();
Symbol 359 MovieClip [casevide_mc] Frame 1
stop();
Symbol 361 MovieClip [mur_mc] Frame 1
stop();
Symbol 367 MovieClip Frame 1
play();
Symbol 370 MovieClip Frame 1
play();
Symbol 371 MovieClip [mwall_mc] Frame 1
#initclip 55
Object.registerClass("mwall_mc", mwall);
#endinitclip
stop();
Symbol 371 MovieClip [mwall_mc] Frame 8
stop();
Symbol 371 MovieClip [mwall_mc] Frame 9
play();
Symbol 371 MovieClip [mwall_mc] Frame 20
this.removeMovieClip();
stop();
Symbol 378 MovieClip [mgv_mc] Frame 1
#initclip 56
Object.registerClass("mgv_mc", mediummonster);
#endinitclip
stop();
Symbol 378 MovieClip [mgv_mc] Frame 8
play();
Symbol 378 MovieClip [mgv_mc] Frame 20
this.removeMovieClip();
stop();
Symbol 396 MovieClip [blobbies_mc] Frame 1
#initclip 57
Object.registerClass("blobbies_mc", blobbies);
#endinitclip
stop();
Symbol 396 MovieClip [blobbies_mc] Frame 6
stop();
Symbol 396 MovieClip [blobbies_mc] Frame 8
play();
Symbol 396 MovieClip [blobbies_mc] Frame 20
this.removeMovieClip();
stop();
Symbol 397 MovieClip [blob_mc] Frame 1
#initclip 58
Object.registerClass("blob_mc", blob);
#endinitclip
stop();
Symbol 397 MovieClip [blob_mc] Frame 6
stop();
Symbol 397 MovieClip [blob_mc] Frame 8
play();
Symbol 397 MovieClip [blob_mc] Frame 20
this.removeMovieClip();
stop();
Symbol 408 MovieClip [carouselwe_mc] Frame 1
play();
Symbol 409 MovieClip [carouselew_mc] Frame 1
play();
Symbol 410 MovieClip [carouselsn_mc] Frame 1
play();
Symbol 411 MovieClip [carouselns_mc] Frame 1
play();
Symbol 416 MovieClip [life_mc] Frame 1
stop();
Symbol 430 MovieClip [boutexplosion2_mc] Frame 1
play();
Symbol 430 MovieClip [boutexplosion2_mc] Frame 5
this.removeMovieClip();
stop();
Symbol 430 MovieClip [boutexplosion2_mc] Frame 6
play();
Symbol 430 MovieClip [boutexplosion2_mc] Frame 10
this.removeMovieClip();
stop();
Symbol 430 MovieClip [boutexplosion2_mc] Frame 11
play();
Symbol 430 MovieClip [boutexplosion2_mc] Frame 15
this.removeMovieClip();
stop();
Symbol 430 MovieClip [boutexplosion2_mc] Frame 16
play();
Symbol 430 MovieClip [boutexplosion2_mc] Frame 20
this.removeMovieClip();
stop();
Symbol 431 MovieClip [boutexplosion1_mc] Frame 1
play();
Symbol 431 MovieClip [boutexplosion1_mc] Frame 5
this.removeMovieClip();
stop();
Symbol 431 MovieClip [boutexplosion1_mc] Frame 6
play();
Symbol 431 MovieClip [boutexplosion1_mc] Frame 10
this.removeMovieClip();
stop();
Symbol 431 MovieClip [boutexplosion1_mc] Frame 11
play();
Symbol 431 MovieClip [boutexplosion1_mc] Frame 15
this.removeMovieClip();
stop();
Symbol 431 MovieClip [boutexplosion1_mc] Frame 16
play();
Symbol 431 MovieClip [boutexplosion1_mc] Frame 20
this.removeMovieClip();
stop();
Symbol 432 MovieClip [boutexplosion4_mc] Frame 1
play();
Symbol 432 MovieClip [boutexplosion4_mc] Frame 5
this.removeMovieClip();
stop();
Symbol 432 MovieClip [boutexplosion4_mc] Frame 6
play();
Symbol 432 MovieClip [boutexplosion4_mc] Frame 10
this.removeMovieClip();
stop();
Symbol 432 MovieClip [boutexplosion4_mc] Frame 11
play();
Symbol 432 MovieClip [boutexplosion4_mc] Frame 15
this.removeMovieClip();
stop();
Symbol 432 MovieClip [boutexplosion4_mc] Frame 16
play();
Symbol 432 MovieClip [boutexplosion4_mc] Frame 20
this.removeMovieClip();
stop();
Symbol 437 Button [rejouer_btn]
on (release) {
_root.gotoAndPlay("depart");
}
Symbol 439 MovieClip [porte_mc] Frame 1
stop();
Symbol 448 MovieClip [progbar_mc] Frame 1
stop();
Symbol 648 MovieClip [__Packages.character] Frame 0
class character extends MovieClip
{
var taille, speedCoef, deltaCarouselX, deltaCarouselY, resistance, getRemote, changeDirection, inTeleportation, inReapparition, inRoller, multibombe, getKey, walkonwall, _x, current_x, _y, current_y, gotoAndStop, _xscale, _yscale, isWalking, columnLeft, columnRight, rowUp, rowDown, upLeft, upRight, downLeft, downRight, row, column, isAlive, speed_x, speed_y;
function character () {
super();
taille = _root.sizeTile;
speedCoef = _root.SPEEDCOEFNORMAL;
deltaCarouselX = 0;
deltaCarouselY = 0;
resistance = 1;
getRemote = false;
changeDirection = false;
inTeleportation = false;
inReapparition = false;
inRoller = false;
multibombe = false;
getKey = false;
walkonwall = false;
}
function setClip() {
_x = current_x;
_y = current_y;
(gotoAndStop("wait"));// not popped
}
function checkMove(objet) {
var _local4 = Math.floor((current_y + (taille / 4)) / taille);
var _local3 = Math.floor(current_x / taille);
_root.myLevel.map[_root.currentRoom][_local4][_local3].checkFloorBis(objet);
if (inTeleportation) {
if (numAnim < nbAnim) {
(gotoAndStop("teleportation"));// not popped
_xscale = _xscale - 2;
_yscale = _yscale - 2;
numAnim++;
} else {
inTeleportation = false;
inReapparition = true;
isWalking = false;
numAnim = 0;
_xscale = 0;
_yscale = 0;
newPosition();
}
} else if (inReapparition) {
if (numAnim < nbAnim) {
(gotoAndStop("teleportation"));// not popped
_xscale = _xscale + 2;
_yscale = _yscale + 2;
numAnim++;
} else {
(gotoAndStop(1));// not popped
_xscale = 100;
_yscale = 100;
inTeleportation = false;
inReapparition = false;
isWalking = true;
}
}
}
function getCorner(nextx, nexty, objet) {
columnLeft = Math.floor(((nextx - (taille / 2)) + 6) / taille);
columnRight = Math.floor(((nextx + (taille / 2)) - 6) / taille);
rowUp = Math.floor(((nexty - (taille / 2)) + 6) / taille);
rowDown = Math.floor(((nexty + (taille / 2)) - 6) / taille);
if (columnLeft < 0) {
columnLeft = 0;
} else if (columnRight > _root.myLevel.dimMap[_root.currentRoom][0]) {
columnRight = _root.myLevel.dimMap[_root.currentRoom][0] - 1;
}
if (rowUp < 0) {
rowUp = 0;
} else if (rowDown > _root.myLevel.dimMap[_root.currentRoom][1]) {
rowDown = _root.myLevel.dimMap[_root.currentRoom][1] - 1;
}
upLeft = _root.myLevel.map[_root.currentRoom][rowUp][columnLeft].checkWalking(objet, rowUp, columnLeft);
upRight = _root.myLevel.map[_root.currentRoom][rowUp][columnRight].checkWalking(objet, rowUp, columnRight);
downLeft = _root.myLevel.map[_root.currentRoom][rowDown][columnLeft].checkWalking(objet, rowDown, columnLeft);
downRight = _root.myLevel.map[_root.currentRoom][rowDown][columnRight].checkWalking(objet, rowDown, columnRight);
}
function display() {
_x = current_x;
_y = current_y;
}
function newPosition() {
var _local3 = random(_root.myLevel.emptyCellArray[_root.currentRoom].length);
row = Math.floor(_root.myLevel.emptyCellArray[_root.currentRoom][_local3] / _root.myLevel.dimMap[_root.currentRoom][0]);
column = Math.floor(_root.myLevel.emptyCellArray[_root.currentRoom][_local3] % _root.myLevel.dimMap[_root.currentRoom][0]);
current_x = (column * taille) + (taille / 2);
current_y = (row * taille) + (taille / 2);
_x = current_x;
_y = current_y;
}
function die() {
if ((resistance - 1) <= 0) {
(gotoAndStop("die"));// not popped
isAlive = false;
isWalking = false;
column = 0;
row = 0;
current_x = 0;
current_y = 0;
speed_x = 0;
speed_y = 0;
} else {
resistance--;
(gotoAndStop("wait"));// not popped
}
}
var INVINCIBLE = 99;
var numAnim = 0;
var nbAnim = 40;
}
Symbol 649 MovieClip [__Packages.mediummonster] Frame 0
class mediummonster extends character
{
var life, column, row, reference, initspeedX, initspeedY, direct_x, direct_y, speed_x, speed_y, resistance, isAlive, isWalking, inTeleportation, inReapparition, changeDirection, current_x, taille, current_y, checkMove, deltaCarouselX, speedCoef, deltaCarouselY, getCorner, upLeft, downLeft, upRight, downRight, oldrow, oldcol, display;
function mediummonster (line, col, genre) {
super();
life = 1;
column = col;
row = line;
reference = genre;
initspeedX = 3;
initspeedY = 3;
direct_x = random(3) - 1;
if (direct_x == 0) {
direct_y = (random(2) * 2) - 1;
} else {
direct_y = 0;
}
if (reference == _root.MONSTERSTAR) {
speed_x = initspeedX * 1.5;
speed_y = initspeedY * 1.5;
} else {
speed_x = initspeedX;
speed_y = initspeedY;
}
resistance = 1;
isAlive = true;
isWalking = true;
inTeleportation = false;
inReapparition = false;
changeDirection = false;
current_x = (column * taille) + (taille / 2);
current_y = (row * taille) + (taille / 2);
}
function init(line, col, genre) {
column = col;
row = line;
reference = genre;
life = 1;
column = col;
row = line;
reference = genre;
initspeedX = 3;
initspeedY = 3;
direct_x = random(3) - 1;
if (direct_x == 0) {
direct_y = (random(2) * 2) - 1;
} else {
direct_y = 0;
}
if (reference == _root.MONSTERSTAR) {
speed_x = initspeedX * 3;
speed_y = initspeedY * 3;
} else {
speed_x = initspeedX;
speed_y = initspeedY;
}
resistance = 1;
isAlive = true;
isWalking = true;
inTeleportation = false;
inReapparition = false;
changeDirection = false;
current_x = (column * taille) + (taille / 2);
current_y = (row * taille) + (taille / 2);
}
function action(heroTarget) {
var _local3 = false;
go();
_local3 = monsterVsHero(heroTarget);
if (_local3) {
heroTarget.die();
_root.updateLife();
}
}
function go() {
var _local7;
var _local6;
var _local4;
var _local3;
var _local5 = 3;
checkMove(this);
if (isWalking) {
_local4 = (current_x + ((direct_x * speed_x) * speedCoef)) + deltaCarouselX;
_local3 = (current_y + ((direct_y * speed_y) * speedCoef)) + deltaCarouselY;
getCorner(_local4, _local3, this);
if ((((((((upLeft && (downLeft)) && (upRight)) && (downRight)) && (_local4 > (taille / 2))) && (_local4 < (_root.widthRoom - (taille / 2)))) && (_local3 > (taille / 2))) && (_local3 < (_root.widthRoom - (taille / 2)))) && (random(100) > _local5)) {
current_y = _local3;
current_x = _local4;
} else if (direct_x == 0) {
direct_x = (random(2) * 2) - 1;
direct_y = 0;
_local4 = current_x + (direct_x * speed_x);
_local3 = current_y + (direct_y * speed_y);
getCorner(_local4, _local3, this);
if ((((((!upLeft) || (!downLeft)) || (!upRight)) || (!downRight)) || (_local4 > (taille / 2))) || (_local4 < (_root.widthRoom - (taille / 2)))) {
direct_x = direct_x * -1;
}
} else {
direct_x = 0;
direct_y = (random(2) * 2) - 1;
_local4 = current_x + (direct_x * speed_x);
_local3 = current_y + (direct_y * speed_y);
getCorner(_local4, _local3, this);
if ((((((!upLeft) || (!downLeft)) || (!upRight)) || (!downRight)) || (_local3 > (taille / 2))) || (_local3 < (_root.widthRoom - (taille / 2)))) {
direct_y = direct_y * -1;
}
}
oldrow = row;
oldcol = column;
column = Math.round((current_x - (taille / 2)) / taille);
row = Math.round((current_y - (taille / 2)) / taille);
display();
}
}
function monsterVsHero(Target) {
if (((Math.sqrt(Math.pow(current_x - Target.current_x, 2) + Math.pow(current_y - Target.current_y, 2)) < taille) && (Target.isAlive)) && (!_root.player.isBlesse)) {
return(true);
}
return(false);
}
}
Symbol 650 MovieClip [__Packages.amoeba] Frame 0
class amoeba extends mediummonster
{
var resistance, go, monsterVsHero;
function amoeba () {
super();
}
function init(line, col, genre) {
super(line, col, genre);
resistance = 2;
}
function action(heroTarget) {
var _local3 = false;
go();
_local3 = monsterVsHero(heroTarget);
if (_local3) {
heroTarget.die();
_root.updateLife();
}
}
}
Symbol 651 MovieClip [__Packages.thief] Frame 0
class thief extends mediummonster
{
var go, monsterVsHero;
function thief () {
super();
}
function init(line, col, genre) {
super(line, col, genre);
}
function action(heroTarget) {
var _local3 = false;
go();
_local3 = monsterVsHero(heroTarget);
if (_local3) {
_root.player.cancelBonus();
_root.player.isAlive = true;
heroTarget.gotoAndStop("wait");
}
}
}
Symbol 652 MovieClip [__Packages.glouton] Frame 0
class glouton extends mediummonster
{
var walkonwall, go, isWalking, monsterVsHero, row, column, reference, gotoAndStop;
function glouton () {
super();
}
function init(line, col, genre, bomb) {
super(line, col, genre);
arrayBomb = bomb;
walkonwall = true;
}
function action(heroTarget) {
var _local3 = false;
go();
if (isWalking) {
_local3 = monsterVsHero(heroTarget);
if (_local3) {
heroTarget.die();
_root.updateLife();
}
}
checkBomb();
}
function checkBomb() {
var _local3 = 0;
while (_local3 < arrayBomb[_root.currentRoom].length) {
if ((arrayBomb[_root.currentRoom][_local3].row == row) && (arrayBomb[_root.currentRoom][_local3].column == column)) {
if (reference == _root.MONSTERGLOUTON) {
(gotoAndStop("eat"));// not popped
isWalking = false;
arrayBomb[_root.currentRoom][_local3].etat = "eteinte";
if ((arrayBomb[_root.currentRoom][_local3].reference == _root.HERO) && (_root.nbLaunchedBomb > 0)) {
_root.player.launchedBomb = false;
_root.nbLaunchedBomb--;
if (_root.nbLaunchedBomb < 0) {
_root.nbLaunchedBomb = 0;
}
}
arrayBomb[_root.currentRoom][_local3].die();
arrayBomb[_root.currentRoom].splice(_local3, 1);
} else if (arrayBomb[_root.currentRoom][_local3].etat == "attente") {
(gotoAndStop("switchoff"));// not popped
isWalking = false;
if ((arrayBomb[_root.currentRoom][_local3].reference == _root.HERO) && (_root.nbLaunchedBomb > 0)) {
_root.player.launchedBomb = false;
_root.nbLaunchedBomb--;
if (_root.nbLaunchedBomb < 0) {
_root.nbLaunchedBomb = 0;
}
}
arrayBomb[_root.currentRoom][_local3].etat = "eteinte";
arrayBomb[_root.currentRoom][_local3].setClip();
}
}
_local3++;
}
}
var arrayBomb = new Array();
}
Symbol 653 MovieClip [__Packages.petoman] Frame 0
class petoman extends mediummonster
{
var startTimeLaunchObject, go, monsterVsHero, current_x, current_y;
function petoman () {
super();
}
function init(line, col, genre) {
super(line, col, genre);
startTimeLaunchObject = getTimer();
}
function action(heroTarget) {
var _local3 = false;
go();
_local3 = monsterVsHero(heroTarget);
if (_local3) {
heroTarget.die();
_root.updateLife();
}
if ((getTimer() - startTimeLaunchObject) > gapTimeToxicCloud) {
creationToxicCloud();
startTimeLaunchObject = getTimer();
_root.limitedTimeObjectArray[_root.currentRoom][_root.idLimitedLifeObject - 1].lifeTimeToxicCloud = startTimeLaunchObject;
}
}
function creationToxicCloud() {
_root.idLimitedLifeObject = _root.limitedTimeObjectArray[_root.currentRoom].push(new limitedlife(current_x, current_y, 5000, _root.TOXICCLOUD));
_root.limitedTimeObjectArray[_root.currentRoom][_root.idLimitedLifeObject - 1].clip_mc = _root.game_mc.attachMovie("toxiccloud_mc", "toxiccloud_mc" + _root.enemyDeapth, _root.enemyDeapth);
_root.limitedTimeObjectArray[_root.currentRoom][_root.idLimitedLifeObject - 1].clip_mc._x = _root.limitedTimeObjectArray[_root.currentRoom][_root.idLimitedLifeObject - 1].current_x;
_root.limitedTimeObjectArray[_root.currentRoom][_root.idLimitedLifeObject - 1].clip_mc._y = _root.limitedTimeObjectArray[_root.currentRoom][_root.idLimitedLifeObject - 1].current_y;
_root.enemyDeapth++;
}
function die() {
super.die();
}
var gapTimeToxicCloud = 10000;
}
Symbol 654 MovieClip [__Packages.limitedlife] Frame 0
class limitedlife
{
var taille, isAlive, current_x, current_y, row, column, timeLife, typeRef, clip_mc;
function limitedlife (x, y, durationAlive, nameObject) {
var _local3;
taille = _root.sizeTile;
isAlive = true;
current_x = x;
current_y = y;
row = (current_y - (taille / 2)) / taille;
column = (current_x - (taille / 2)) / taille;
timeLife = durationAlive;
typeRef = nameObject;
_local3 = _root.getLastDeapth();
}
function die() {
clip_mc.removeMovieClip();
isAlive = false;
timeLife = 0;
row = 0;
column = 0;
current_x = 0;
current_y = 0;
timeLife = 0;
}
}
Symbol 655 MovieClip [__Packages.overwall] Frame 0
class overwall extends mediummonster
{
var go, monsterVsHero;
function overwall () {
super();
}
function init(line, col, genre) {
super(line, col, genre);
}
function action(heroTarget) {
var _local3 = false;
go();
_local3 = monsterVsHero(heroTarget);
if (_local3) {
heroTarget.die();
_root.updateLife();
}
}
}
Symbol 656 MovieClip [__Packages.stupidmonster] Frame 0
class stupidmonster extends character
{
var life, column, row, direct_x, direct_y, resistance, isAlive, isWalking, inTeleportation, inReapparition, changeDirection, reference, current_x, taille, current_y, initspeedX, initspeedY, speed_x, speed_y, checkMove, deltaCarouselX, speedCoef, deltaCarouselY, getCorner, upLeft, downLeft, upRight, downRight, oldrow, oldcol, display;
function stupidmonster (line, col, genre) {
super();
life = 1;
column = col;
row = line;
direct_x = random(3) - 1;
if (direct_x == 0) {
direct_y = (random(2) * 2) - 1;
} else {
direct_y = 0;
}
resistance = 1;
isAlive = true;
isWalking = true;
inTeleportation = false;
inReapparition = false;
changeDirection = false;
reference = genre;
current_x = (column * taille) + (taille / 2);
current_y = (row * taille) + (taille / 2);
initspeedX = 3;
initspeedY = 3;
speed_x = initspeedX;
speed_y = initspeedY;
}
function init(line, col, genre) {
column = col;
row = line;
reference = genre;
current_x = (column * taille) + (taille / 2);
current_y = (row * taille) + (taille / 2);
}
function action(heroTarget) {
var _local3 = false;
go();
_local3 = monsterVsHero(heroTarget);
if (_local3) {
heroTarget.die();
_root.updateLife();
}
}
function go() {
var _local7;
var _local6;
var _local4;
var _local3;
var _local5 = 3;
checkMove(this);
if (isWalking) {
_local4 = (current_x + ((direct_x * speed_x) * speedCoef)) + deltaCarouselX;
_local3 = (current_y + ((direct_y * speed_y) * speedCoef)) + deltaCarouselY;
getCorner(_local4, _local3, this);
if ((((((((upLeft && (downLeft)) && (upRight)) && (downRight)) && (_local4 > (taille / 2))) && (_local4 < (_root.widthRoom - (taille / 2)))) && (_local3 > (taille / 2))) && (_local3 < (_root.widthRoom - (taille / 2)))) && (random(100) > _local5)) {
current_y = _local3;
current_x = _local4;
} else {
direct_x = direct_x * -1;
direct_y = direct_y * -1;
}
oldrow = row;
oldcol = column;
column = Math.round((current_x - (taille / 2)) / taille);
row = Math.round((current_y - (taille / 2)) / taille);
display();
}
}
function monsterVsHero(Target) {
if (((Math.sqrt(Math.pow(current_x - Target.current_x, 2) + Math.pow(current_y - Target.current_y, 2)) < taille) && (Target.isAlive)) && (!_root.player.isBlesse)) {
return(true);
}
return(false);
}
}
Symbol 657 MovieClip [__Packages.mbomb] Frame 0
class mbomb extends mediummonster
{
var initspeedX, initspeedY, speed_x, speed_y, startTimeLaunchObject, go, monsterVsHero, direct_x, current_x, direct_y, current_y, reference;
function mbomb () {
super();
}
function init(line, col, genre) {
super(line, col, genre);
initspeedX = 5;
initspeedY = 5;
speed_x = initspeedX;
speed_y = initspeedY;
startTimeLaunchObject = getTimer();
}
function action(heroTarget) {
var _local3 = false;
go();
_local3 = monsterVsHero(heroTarget);
if (_local3) {
heroTarget.die();
_root.updateLife();
}
if ((getTimer() - startTimeLaunchObject) > gapTimeBomb) {
putBomb();
startTimeLaunchObject = getTimer();
}
}
function putBomb() {
var _local4 = Math.round(((current_x - (40 * direct_x)) - _root.halfSizeTile) / _root.sizeTile);
var _local3 = Math.round(((current_y - (40 * direct_y)) - _root.halfSizeTile) / _root.sizeTile);
if ((((_local4 >= 0) && (_local3 >= 0)) && (_local3 < _root.myLevel.dimMap[_root.currentRoom][1])) && (_local4 < _root.myLevel.dimMap[_root.currentRoom][0])) {
if (_root.myLevel.map[_root.currentRoom][_local3][_local4].walkable) {
_root.idBomb = _root.bombArray[_root.currentRoom].push(new bomb(current_x - (40 * direct_x), current_y - (40 * direct_y), false, _root.rangeBomb, reference));
_root.bombArray[_root.currentRoom][_root.idBomb - 1].clip_mc = _root.game_mc.attachMovie("bombe_mc", "bomb_mc" + _root.bombDeapth, _root.bombDeapth);
_root.bombArray[_root.currentRoom][_root.idBomb - 1].setClip();
_root.bombDeapth++;
}
}
}
var gapTimeBomb = 7000;
}
Symbol 658 MovieClip [__Packages.bomb] Frame 0
class bomb
{
var column, row, current_x, current_y, direct_x, direct_y, range, reference, etat, remoteControl, startTimeLaunchObject, clip_mc;
function bomb (x, y, remote, sizebomb, ref) {
column = Math.round((x - _root.halfSizeTile) / _root.sizeTile);
row = Math.round((y - _root.halfSizeTile) / _root.sizeTile);
_root.myLevel.map[_root.currentRoom][row][column].value = _root.BOMB;
current_x = _root.halfSizeTile + (column * _root.sizeTile);
current_y = _root.halfSizeTile + (row * _root.sizeTile);
direct_x = 0;
direct_y = 0;
range = sizebomb;
reference = ref;
etat = "attente";
remoteControl = remote;
setClip();
startTimeLaunchObject = getTimer();
}
function action() {
if ((etat == "attente") && (!remoteControl)) {
if ((getTimer() - startTimeLaunchObject) > startTimeExplosion) {
etat = "explosion";
startTimeLaunchObject = getTimer();
}
}
}
function setClip() {
clip_mc._x = current_x;
clip_mc._y = current_y;
clip_mc.gotoAndStop(etat);
}
function die() {
_root.myLevel.map[_root.currentRoom][row][column].value = _root.EMPTY;
current_x = 0;
current_y = 0;
column = 0;
row = 0;
etat = "";
clip_mc.removeMovieClip();
}
var startTimeExplosion = 2000;
}
Symbol 659 MovieClip [__Packages.invisible] Frame 0
class invisible extends mediummonster
{
var startTimeLaunchObject, go, isWalking, monsterVsHero, inTeleportation, inReapparition, _alpha, resistance, INVINCIBLE, lifeTimeInvisible, gotoAndStop, isAlive, column, row, current_x, current_y, speed_x, speed_y;
function invisible () {
super();
}
function init(line, col, genre) {
super(line, col, genre);
startTimeLaunchObject = getTimer();
}
function action(heroTarget) {
var _local3 = false;
go();
if (isWalking) {
_local3 = monsterVsHero(heroTarget);
if (_local3) {
heroTarget.die();
_root.updateLife();
}
}
if ((((getTimer() - startTimeLaunchObject) > startTimeInvisible) && (!inTeleportation)) && (!inReapparition)) {
_alpha = 50;
resistance = INVINCIBLE;
startTimeLaunchObject = getTimer();
lifeTimeInvisible = getTimer();
}
isAlwaysInvisible();
}
function isAlwaysInvisible() {
if ((getTimer() - lifeTimeInvisible) > lifeTimeInvisibleMax) {
_alpha = 100;
resistance = 1;
}
}
function die() {
if ((resistance - 1) <= 0) {
(gotoAndStop("die"));// not popped
isAlive = false;
isWalking = false;
column = 0;
row = 0;
current_x = 0;
current_y = 0;
speed_x = 0;
speed_y = 0;
} else if (resistance == INVINCIBLE) {
resistance = INVINCIBLE;
} else {
resistance--;
}
}
var startTimeInvisible = 15000;
var lifeTimeInvisibleMax = 10000;
}
Symbol 660 MovieClip [__Packages.eatwall] Frame 0
class eatwall extends mediummonster
{
var isEating, go, monsterVsHero, column, row, gotoAndStop, isWalking;
function eatwall () {
super();
isEating = false;
}
function init(line, col, genre) {
super(line, col, genre);
}
function action(heroTarget) {
var _local3 = false;
go();
_local3 = monsterVsHero(heroTarget);
if (_local3) {
heroTarget.die();
_root.updateLife();
}
checkWall();
}
function checkWall() {
if (((_root.myLevel.map[_root.currentRoom][row][column].value == _root.BREAKINGWALL1) || (_root.myLevel.map[_root.currentRoom][row][column].value == _root.BREAKINGWALL2)) || (_root.myLevel.map[_root.currentRoom][row][column].value == _root.BREAKINGWALL3)) {
for (var _local4 in _root.wallArray[_root.currentRoom]) {
if ((_root.wallArray[_root.currentRoom][_local4].row == row) && (_root.wallArray[_root.currentRoom][_local4].column == column)) {
_root.wallArray[_root.currentRoom][_local4].explosion(_root.myLevel.map[_root.currentRoom][row][column].clip_mc);
(gotoAndStop("eat"));// not popped
isWalking = false;
if (_root.wallArray[_root.currentRoom][_local4].resistance <= 0) {
var _local3 = _root.getLastDeapth();
_root.myLevel.map[_root.currentRoom][row][column].clip_mc = _root.game_mc.attachMovie("casevide_mc", "casevide_mc" + _local3, _local3);
_root.myLevel.map[_root.currentRoom][row][column].setClip(row, column);
if (_root.myLevel.map[_root.currentRoom][row][column].bonus == _root.LEVELDOOR) {
_root.myLevel.map[_root.currentRoom][row][column].value = _root.BONUS;
_root.creationBonus(row, column, _root.myLevel.map[_root.currentRoom][row][column].bonus, _root.currentRoom);
}
_root.wallArray[_root.currentRoom].splice(_local4, 1);
}
}
}
}
}
}
Symbol 661 MovieClip [__Packages.bonus] Frame 0
class bonus extends MovieClip
{
var isAlive, row, column, _x, _y, typeRef, gotoAndStop;
function bonus () {
super();
isAlive = true;
}
function init(i, j, genre) {
row = i;
column = j;
_x = (j * _root.sizeTile) + _root.halfSizeTile;
_y = (i * _root.sizeTile) + _root.halfSizeTile;
typeRef = genre;
(gotoAndStop(1));// not popped
}
function die() {
isAlive = false;
row = 0;
column = 0;
typeRef = 0;
}
}
Symbol 662 MovieClip [__Packages.hero] Frame 0
class hero extends character
{
var resistance, initspeedX, initspeedY, getRemote, changeDirection, launchedBomb, isAlive, isWalking, inRoller, getKey, isBlesse, speed_x, speed_y, column, row, reference, life, current_x, taille, current_y, old_x, old_y, setClip, startTimeInvincible, _alpha, _x, _y, gotoAndStop, direct_x, direct_y, checkMove, speedCoef, deltaCarouselX, deltaCarouselY, inTeleportation, inReapparition, getCorner, upLeft, downLeft, upRight, downRight, oldrow, oldcol, display, INVINCIBLE, multibombe;
function hero () {
super();
resistance = 1;
initspeedX = 4;
initspeedY = 4;
getRemote = false;
changeDirection = false;
launchedBomb = false;
isAlive = true;
isWalking = false;
inRoller = false;
getKey = false;
isBlesse = false;
}
function init(line, col, genre, lives) {
speed_x = initspeedX;
speed_y = initspeedY;
column = col;
row = line;
reference = genre;
life = lives;
current_x = (column * taille) + (taille / 2);
current_y = (row * taille) + (taille / 2);
old_x = current_x;
old_y = current_y;
setClip();
}
function deplace() {
if ((getTimer() - startTimeInvincible) > gapTimeInvincible) {
_alpha = 100;
isBlesse = false;
}
if (isAlive) {
detectKey();
}
}
function replaceClip() {
isWalking = false;
if ((column == (_root.myLevel.dimMap[_root.currentRoom][0] - 1)) || (column == (_root.myLevel.dimMap[_root.currentRoom][0] - 2))) {
column = 1;
} else {
column = _root.myLevel.dimMap[_root.currentRoom][0] - 2;
}
current_x = (column * taille) + (taille / 2);
current_y = (row * taille) + (taille / 2);
_x = current_x;
_y = current_y;
(gotoAndStop("wait"));// not popped
}
function detectKey() {
var _local8;
var _local7;
var _local5;
var _local4;
if (!_root.gamepause) {
var _local6 = true;
if (Key.isDown(37)) {
_local6 = false;
if (direct_x == 0) {
column = Math.round((current_x - (taille / 2)) / taille);
row = Math.round((current_y - (taille / 2)) / taille);
_local5 = (column * taille) + (taille / 2);
_local4 = (row * taille) + (taille / 2);
if (Math.abs(current_y - _local4) <= 8) {
if (movingTest(-speed_x, 0, _local5, _local4)) {
current_x = (column * taille) + (taille / 2);
current_y = (row * taille) + (taille / 2);
}
}
}
isWalking = true;
direct_x = -1;
direct_y = 0;
_local8 = speed_x * direct_x;
_local7 = speed_y * direct_y;
} else if (Key.isDown(39)) {
_local6 = false;
if (direct_x == 0) {
column = Math.round((current_x - (taille / 2)) / taille);
row = Math.round((current_y - (taille / 2)) / taille);
_local5 = (column * taille) + (taille / 2);
_local4 = (row * taille) + (taille / 2);
if (Math.abs(current_y - _local4) <= 8) {
if (movingTest(speed_x, 0, _local5, _local4)) {
current_x = (column * taille) + (taille / 2);
current_y = (row * taille) + (taille / 2);
}
}
}
isWalking = true;
direct_x = 1;
direct_y = 0;
_local8 = speed_x * direct_x;
_local7 = speed_y * direct_y;
} else if (Key.isDown(38)) {
_local6 = false;
if (direct_y == 0) {
column = Math.round((current_x - (taille / 2)) / taille);
row = Math.round((current_y - (taille / 2)) / taille);
_local5 = (column * taille) + (taille / 2);
_local4 = (row * taille) + (taille / 2);
if (Math.abs(current_x - _local5) <= 8) {
if (movingTest(0, -speed_y, _local5, _local4)) {
current_x = (column * taille) + (taille / 2);
current_y = (row * taille) + (taille / 2);
}
}
}
isWalking = true;
direct_x = 0;
direct_y = -1;
_local8 = speed_x * direct_x;
_local7 = speed_y * direct_y;
} else if (Key.isDown(40)) {
_local6 = false;
if (direct_y == 0) {
column = Math.round((current_x - (taille / 2)) / taille);
row = Math.round((current_y - (taille / 2)) / taille);
_local5 = (column * taille) + (taille / 2);
_local4 = (row * taille) + (taille / 2);
if (Math.abs(current_x - _local5) <= 8) {
if (movingTest(0, speed_y, _local5, _local4)) {
current_x = (column * taille) + (taille / 2);
current_y = (row * taille) + (taille / 2);
}
}
}
isWalking = true;
direct_x = 0;
direct_y = 1;
_local8 = speed_x * direct_x;
_local7 = speed_y * direct_y;
}
if ((Key.isDown(32) && (!launchedBomb)) && (_root.nbLaunchedBomb < _root.maxBombToLaunch)) {
_local6 = false;
isWalking = false;
launchedBomb = true;
_root.nbLaunchedBomb++;
old_x = current_x;
old_y = current_y;
_root.depot_snd.attachSound("depotbombe");
_root.depot_snd.start();
_root.idBomb = _root.bombArray[_root.currentRoom].push(new bomb(current_x, current_y, getRemote, _root.rangeBomb, _root.HERO));
_root.bombArray[_root.currentRoom][_root.idBomb - 1].clip_mc = _root.game_mc.attachMovie("bombe_mc", "bomb_mc" + _root.bombDeapth, _root.bombDeapth);
_root.bombArray[_root.currentRoom][_root.idBomb - 1].setClip();
_root.bombDeapth++;
}
if (Key.isDown(16) && (getRemote)) {
var _local3 = 0;
while (_local3 < _root.bombArray[_root.currentRoom].length) {
_root.bombArray[_root.currentRoom][_local3].etat = "explosion";
_local3++;
}
}
if (_local6) {
checkMove(this);
if (speedCoef == _root.SPEEDCOEFSLIPPERYFLOOR) {
isWalking = true;
_local8 = speed_x * direct_x;
_local7 = speed_y * direct_y;
} else if ((deltaCarouselX == _root.SPEEDCOEFCAROUSELEWE) || (deltaCarouselY == _root.SPEEDCOEFCAROUSELNSN)) {
isWalking = true;
_local8 = 0;
_local7 = 0;
} else {
isWalking = false;
(gotoAndStop("wait"));// not popped
}
}
moving(_local8, _local7);
}
}
function moving(deltaX, deltaY) {
var _local4;
var _local3;
checkMove(this);
if ((!inTeleportation) && (!inReapparition)) {
_local4 = (current_x + (deltaX * speedCoef)) + deltaCarouselX;
_local3 = (current_y + (deltaY * speedCoef)) + deltaCarouselY;
getCorner(_local4, _local3, this);
if (direct_x < 0) {
if ((upLeft && (downLeft)) && (_local4 > (taille / 4))) {
current_x = _local4;
current_y = _local3;
} else {
changeDirection = true;
}
} else if (direct_x > 0) {
if ((upRight && (downRight)) && (_local4 < (_root.widthRoom - (taille / 4)))) {
current_x = _local4;
current_y = _local3;
} else {
changeDirection = true;
}
} else if (direct_y < 0) {
if ((upRight && (upLeft)) && (_local3 > (taille / 4))) {
current_y = _local3;
current_x = _local4;
} else {
changeDirection = true;
}
} else if (direct_y > 0) {
if ((downRight && (downLeft)) && (_local3 < (_root.widthRoom - (taille / 4)))) {
current_y = _local3;
current_x = _local4;
} else {
changeDirection = true;
}
}
oldrow = row;
oldcol = column;
column = Math.round((current_x - (taille / 2)) / taille);
row = Math.round((current_y - (taille / 2)) / taille);
display();
}
}
function movingTest(deltaX, deltaY, currX, currY) {
var _local4;
var _local3;
if ((!inTeleportation) && (!inReapparition)) {
_local4 = (currX + (deltaX * speedCoef)) + deltaCarouselX;
_local3 = (currY + (deltaY * speedCoef)) + deltaCarouselY;
getCorner(_local4, _local3, this);
if (direct_x < 0) {
if ((upLeft && (downLeft)) && (_local4 > (taille / 4))) {
return(true);
}
return(false);
}
if (direct_x > 0) {
if ((upRight && (downRight)) && (_local4 < (_root.widthRoom - (taille / 4)))) {
return(true);
}
return(false);
}
if (direct_y < 0) {
if ((upRight && (upLeft)) && (_local3 > (taille / 4))) {
return(true);
}
return(false);
}
if (direct_y > 0) {
if ((downRight && (downLeft)) && (_local3 < (_root.widthRoom - (taille / 4)))) {
return(true);
}
return(false);
}
}
}
function getLife() {
return(life);
}
function die() {
if ((resistance - 1) <= 0) {
if (life > 0) {
life--;
(gotoAndStop("blesse"));// not popped
setSpeedInit();
} else {
life--;
(gotoAndStop("die"));// not popped
column = 0;
row = 0;
current_x = 0;
current_y = 0;
speed_x = 0;
speed_y = 0;
}
} else if (resistance == INVINCIBLE) {
resistance = 1;
setSpeedInit();
launchedBomb = false;
_root.nbLaunchedBomb = 0;
isAlive = true;
isBlesse = true;
startTimeInvincible = getTimer();
_alpha = 30;
(gotoAndStop("wait"));// not popped
} else {
setSpeedInit();
launchedBomb = false;
_root.nbLaunchedBomb = 0;
resistance--;
}
}
function cancelBonus() {
isAlive = false;
isWalking = false;
inRoller = false;
multibombe = false;
getRemote = false;
getKey = false;
launchedBomb = false;
_root.nbLaunchedBomb = 0;
var _local3 = 0;
while (_local3 < _root.enemyArray[_root.currentRoom].length) {
if (_root.enemyArray[_root.currentRoom][_local3].reference == _root.MONSTERSTAR) {
_root.enemyArray[_root.currentRoom][_local3].speed_x = 1.5 * _root.enemyArray[_root.currentRoom][_local3].initspeedX;
_root.enemyArray[_root.currentRoom][_local3].speed_y = 1.5 * _root.enemyArray[_root.currentRoom][_local3].initspeedY;
} else {
_root.enemyArray[_root.currentRoom][_local3].speed_x = _root.enemyArray[_root.currentRoom][_local3].initspeedX;
_root.enemyArray[_root.currentRoom][_local3].speed_y = _root.enemyArray[_root.currentRoom][_local3].initspeedY;
}
_local3++;
}
_root.maxBombToLaunch = 1;
_root.rangeBomb = 1;
_root.displayMultiBomb();
_root.displayPowerBomb();
}
function setSpeedInit() {
inRoller = false;
speed_x = initspeedX;
speed_y = initspeedY;
}
var gapTimeInvincible = 2000;
}
Symbol 663 MovieClip [__Packages.mwall] Frame 0
class mwall extends mediummonster
{
var startTimeLaunchObject, go, isWalking, monsterVsHero, inTeleportation, inReapparition, gotoAndStop, _x, current_x, _y, current_y, column, row, lifeTimeWall, taille;
function mwall () {
super();
}
function init(line, col, genre) {
super(line, col, genre);
startTimeLaunchObject = getTimer();
}
function action(heroTarget) {
var _local3 = false;
var _local4;
go();
if (isWalking) {
_local3 = monsterVsHero(heroTarget);
if (_local3) {
heroTarget.die();
_root.updateLife();
}
}
if ((((getTimer() - startTimeLaunchObject) > gapTimeWall) && (!inTeleportation)) && (!inReapparition)) {
_local4 = valideWallPosition();
if (_local4) {
isWalking = false;
(gotoAndStop("wall"));// not popped
_x = current_x;
_y = current_y;
_root.myLevel.map[_root.currentRoom][row][column].walkable = false;
startTimeLaunchObject = getTimer();
lifeTimeWall = getTimer();
} else {
startTimeLaunchObject = getTimer();
}
}
isAlwaysWall();
}
function isAlwaysWall() {
if ((getTimer() - lifeTimeWall) > lifeTimeWallMax) {
_root.myLevel.map[_root.currentRoom][row][column].walkable = true;
(gotoAndStop(1));// not popped
isWalking = true;
}
}
function valideWallPosition() {
var _local3;
column = Math.round((current_x - (taille / 2)) / taille);
row = Math.round((current_y - (taille / 2)) / taille);
current_x = (column * taille) + (taille / 2);
current_y = (row * taille) + (taille / 2);
if ((_root.myLevel.map[_root.currentRoom][row][column].value == _root.EMPTY) || (_root.myLevel.map[_root.currentRoom][row][column].value == _root.FLAQUE)) {
_local3 = testProximityMonster();
if (!_local3) {
return(true);
}
}
return(false);
}
function testProximityMonster() {
var _local5 = 0;
var _local4 = -1;
while (_local4 <= 1) {
var _local3 = -1;
while (_local3 <= 1) {
for (var _local6 in _root.enemyArray[_root.currentRoom]) {
if ((_root.enemyArray[_root.currentRoom][_local6].row == (row + _local3)) && (_root.enemyArray[_root.currentRoom][_local6].column == (column + _local4))) {
_local5++;
}
}
if ((_root.player.row == (row + _local3)) && (_root.player.column == (column + _local4))) {
_local5++;
}
_local3++;
}
_local4++;
}
if (_local5 <= 1) {
return(false);
}
return(true);
}
var gapTimeWall = 15000;
var lifeTimeWallMax = 10000;
}
Symbol 664 MovieClip [__Packages.blobbies] Frame 0
class blobbies extends mediummonster
{
var isCreated, isWalking, go, monsterVsHero;
function blobbies () {
super();
isCreated = true;
}
function init(line, col, genre) {
super(line, col, genre);
isWalking = false;
}
function action(heroTarget) {
var _local3 = false;
if (_root.explosionEnd && (isCreated)) {
isWalking = true;
isCreated = false;
}
go();
_local3 = monsterVsHero(heroTarget);
if (_local3) {
heroTarget.die();
_root.updateLife();
}
}
}
Symbol 665 MovieClip [__Packages.blob] Frame 0
class blob extends mediummonster
{
var go, monsterVsHero, row, column;
function blob () {
super();
}
function init(line, col, genre) {
super(line, col, genre);
}
function action(heroTarget) {
var _local3 = false;
go();
_local3 = monsterVsHero(heroTarget);
if (_local3) {
heroTarget.die();
_root.updateLife();
}
}
function die() {
var _local4;
var _local5 = 0;
while (_local5 < 3) {
_local4 = _root.enemyArray[_root.currentRoom].push(new blobbies());
_root.enemyArray[_root.currentRoom][_local4 - 1] = _root.game_mc.attachMovie("blobbies_mc", "blobbies_mc" + _root.enemyDeapth, _root.enemyDeapth);
_root.enemyArray[_root.currentRoom][_local4 - 1].init(row, column, _root.MONSTERBLOBBIES);
_root.enemyArray[_root.currentRoom][_local4 - 1].setClip();
_root.enemyDeapth++;
_root.enemyArray[_root.currentRoom][_local4 - 1].typeId = _local4 - 1;
_local5++;
}
super.die();
}
}
Symbol 666 MovieClip [__Packages.teleporte] Frame 0
class teleporte extends mediummonster
{
var startTime, gotoAndStop, inTeleportation, inReapparition, isWalking, go, monsterVsHero;
function teleporte (line, col, genre) {
super();
}
function init(line, col, genre) {
super(line, col, genre);
startTime = getTimer();
}
function action(heroTarget) {
var _local3 = false;
if ((getTimer() - startTime) > gapTimeTeleporte) {
(gotoAndStop("teleportation"));// not popped
inTeleportation = true;
inReapparition = false;
isWalking = false;
startTime = getTimer();
}
go();
_local3 = monsterVsHero(heroTarget);
if (_local3) {
heroTarget.die();
_root.updateLife();
}
}
var gapTimeTeleporte = 15000;
}
Symbol 667 MovieClip [__Packages.niveau] Frame 0
class niveau
{
var room;
function niveau () {
room = 1;
map[0] = new Array();
map[1] = new Array();
bonusArray[0] = new Array();
bonusArray[1] = new Array();
dimMap[0] = new Array();
dimMap[1] = new Array();
emptyCellArray[0] = new Array();
emptyCellArray[1] = new Array();
}
function clearMap(numgrid) {
var _local4 = 0;
while (_local4 < dimMap[numgrid][1]) {
map[numgrid][_local4] = new Array();
var _local3 = 0;
while (_local3 < dimMap[numgrid][0]) {
map[numgrid][_local4][_local3] = new tile();
map[numgrid][_local4][_local3].value = _root.EMPTY;
_local3++;
}
nbEmptyCell = 0;
_local4++;
}
}
function initMap(numLevel) {
var _local4 = 0;
while (_local4 < 15) {
var _local3 = 0;
while (_local3 < 13) {
grid[_local4][_local3] = 0;
grid2[_local4][_local3] = 0;
_local3++;
}
_local4++;
}
switch (numLevel) {
case 2 :
room = 2;
dimMap[0][0] = 15;
dimMap[0][1] = 13;
clearMap(0);
grid = [[0, 0, 0, 59, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 21, 0, 21, 21, 21, 11, 21, 21, 21, 0, 21, 0, 0], [0, 0, 0, 0, 21, 63, 0, 0, 0, 0, 21, 0, 0, 0, 0], [21, 21, 21, 0, 21, 11, 21, 11, 21, 11, 21, 0, 21, 21, 21], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [21, 21, 21, 0, 21, 11, 21, 21, 21, 11, 21, 0, 21, 21, 21], [0, 0, 0, 0, 11, 0, 0, 0, 1000, 0, 11, 0, 0, 0, 0], [51, 0, 21, 21, 21, 11, 21, 21, 21, 11, 21, 21, 21, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 21, 0, 21, 11, 21, 11, 21, 11, 21, 0, 21, 0, 0], [0, 0, 0, 0, 21, 0, 0, 0, 0, 63, 21, 0, 0, 0, 0], [0, 0, 21, 0, 21, 21, 21, 11, 21, 21, 21, 0, 21, 0, 0], [200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 59, 0, 0]];
bonusArray[0] = [_root.LEVELDOOR, _root.MULTIBOMB, _root.MULTIBOMB, _root.TURTLE, _root.BIGBOMB, _root.BIGBOMB, _root.WEAVE];
dimMap[1][0] = 15;
dimMap[1][1] = 13;
clearMap(1);
grid2 = [[0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 0, 0, 0, 0], [0, 0, 21, 21, 21, 11, 21, 21, 21, 11, 21, 21, 21, 0, 0], [0, 63, 21, 0, 0, 0, 0, 0, 62, 0, 0, 0, 21, 0, 63], [0, 0, 21, 11, 21, 21, 11, 21, 11, 21, 21, 11, 21, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 51, 0, 0, 0, 0], [21, 21, 21, 0, 21, 21, 21, 11, 21, 21, 21, 0, 21, 0, 0], [0, 0, 0, 0, 21, 0, 0, 11, 0, 0, 21, 0, 21, 21, 21], [21, 21, 21, 0, 21, 0, 21, 21, 21, 0, 21, 0, 21, 0, 0], [0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 0, 0, 0, 0], [0, 0, 21, 11, 21, 11, 21, 21, 21, 11, 21, 11, 21, 0, 0], [0, 0, 21, 0, 21, 0, 0, 21, 0, 0, 21, 0, 21, 0, 0], [0, 0, 21, 21, 21, 11, 21, 21, 21, 11, 21, 21, 21, 0, 0], [0, 0, 0, 0, 59, 0, 0, 11, 0, 0, 0, 0, 0, 0, 200]];
bonusArray[1] = [_root.WEAVE, _root.BIGBOMB, _root.ROLLERS, _root.MULTIBOMB];
break;
case 1 :
room = 2;
dimMap[0][0] = 15;
dimMap[0][1] = 13;
clearMap(0);
grid = [[1000, 0, 0, 11, 0, 0, 11, 0, 11, 0, 0, 0, 0, 0, 0], [0, 21, 0, 21, 0, 0, 21, 0, 21, 0, 21, 11, 21, 11, 0], [0, 0, 0, 11, 0, 0, 11, 0, 11, 0, 0, 0, 59, 0, 0], [11, 21, 11, 21, 0, 0, 21, 0, 21, 0, 21, 11, 21, 11, 0], [0, 0, 0, 0, 63, 0, 11, 0, 11, 0, 0, 0, 0, 0, 0], [11, 21, 11, 21, 11, 21, 21, 0, 21, 11, 21, 11, 21, 11, 21], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [11, 21, 11, 21, 11, 21, 21, 0, 21, 21, 11, 21, 11, 21, 11], [0, 0, 0, 0, 0, 0, 11, 0, 11, 0, 0, 0, 0, 0, 0], [0, 21, 0, 21, 0, 0, 21, 0, 21, 0, 0, 21, 11, 21, 11], [0, 11, 59, 11, 0, 0, 11, 0, 11, 0, 0, 11, 0, 51, 0], [0, 0, 0, 21, 0, 0, 21, 0, 21, 0, 0, 21, 0, 21, 0], [200, 0, 0, 0, 0, 0, 11, 0, 11, 0, 0, 11, 0, 0, 0]];
bonusArray[0] = [_root.LEVELDOOR, _root.MULTIBOMB, _root.MULTIBOMB, _root.WEAVE, _root.BIGBOMB, _root.BIGBOMB, _root.LITTLEBOMB];
dimMap[1][0] = 15;
dimMap[1][1] = 13;
clearMap(1);
grid2 = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 21, 11, 21, 21, 21, 11, 21, 21, 21, 11, 21, 0, 0], [0, 0, 0, 0, 21, 0, 0, 59, 0, 0, 21, 0, 0, 0, 0], [21, 21, 21, 0, 21, 0, 21, 11, 21, 0, 21, 0, 21, 21, 21], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [21, 21, 21, 11, 21, 11, 21, 21, 21, 11, 21, 11, 21, 21, 21], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 21, 21, 21, 0, 21, 21, 21, 0, 21, 21, 21, 0, 0], [0, 51, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 21, 11, 21, 0, 21, 11, 21, 0, 21, 11, 21, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 51, 0, 0], [0, 21, 63, 21, 21, 21, 11, 21, 21, 21, 0, 21, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 200]];
bonusArray[1] = [_root.WEAVE, _root.BIGBOMB, _root.MULTIBOMB, _root.MULTIBOMB];
break;
case 3 :
room = 2;
dimMap[0][0] = 15;
dimMap[0][1] = 13;
clearMap(0);
grid = [[0, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 200], [0, 0, 21, 21, 21, 11, 21, 21, 21, 11, 21, 21, 21, 0, 0], [0, 0, 21, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 59, 0], [0, 0, 21, 0, 21, 21, 11, 21, 11, 21, 21, 0, 21, 0, 0], [0, 0, 11, 0, 11, 0, 0, 0, 51, 0, 11, 0, 11, 0, 0], [21, 21, 21, 0, 21, 21, 21, 11, 21, 21, 21, 0, 21, 0, 0], [0, 0, 0, 0, 21, 63, 0, 0, 0, 0, 21, 0, 21, 21, 21], [21, 21, 21, 0, 21, 0, 21, 21, 21, 0, 21, 0, 21, 0, 0], [0, 0, 11, 0, 11, 0, 0, 21, 0, 0, 11, 0, 11, 0, 0], [0, 59, 21, 0, 21, 0, 21, 21, 21, 0, 21, 0, 21, 0, 0], [0, 0, 21, 0, 21, 0, 0, 21, 0, 0, 21, 0, 21, 0, 0], [0, 0, 21, 21, 21, 11, 21, 21, 21, 11, 21, 21, 21, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1000]];
bonusArray[0] = [_root.LEVELDOOR, _root.MULTIBOMB, _root.WEAVE, _root.ROLLERS, _root.BIGBOMB, _root.LITTLEBOMB];
dimMap[1][0] = 15;
dimMap[1][1] = 13;
clearMap(1);
grid2 = [[200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 21, 21, 11, 21, 21, 0, 21, 21, 11, 21, 21, 0, 0], [0, 0, 21, 0, 0, 0, 21, 0, 21, 0, 0, 0, 21, 0, 0], [0, 0, 21, 63, 21, 0, 21, 11, 21, 0, 21, 62, 21, 0, 0], [0, 0, 21, 0, 0, 0, 21, 0, 21, 0, 0, 0, 21, 0, 0], [0, 0, 21, 21, 21, 21, 21, 0, 21, 21, 21, 21, 21, 0, 0], [0, 0, 0, 0, 11, 0, 0, 0, 0, 0, 11, 0, 0, 0, 0], [0, 0, 21, 21, 21, 21, 21, 0, 21, 21, 21, 21, 21, 0, 0], [0, 0, 21, 0, 0, 0, 21, 0, 21, 0, 0, 0, 21, 55, 0], [0, 0, 21, 0, 21, 51, 21, 0, 21, 59, 21, 0, 21, 0, 0], [0, 0, 21, 0, 0, 0, 21, 0, 21, 0, 0, 0, 21, 0, 0], [0, 0, 21, 21, 11, 21, 21, 0, 21, 21, 11, 21, 21, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
bonusArray[1] = [_root.WEAVE, _root.BIGBOMB, _root.MULTIBOMB, _root.BIGBOMB, _root.ROLLERS];
break;
case 4 :
room = 2;
dimMap[0][0] = 15;
dimMap[0][1] = 13;
clearMap(0);
grid = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 21, 21, 21, 21, 21, 11, 21, 21, 21, 21, 21, 0, 0], [0, 0, 21, 0, 0, 0, 21, 0, 21, 0, 0, 0, 21, 0, 0], [0, 0, 21, 0, 21, 63, 11, 0, 11, 0, 21, 62, 21, 0, 0], [0, 54, 21, 0, 0, 0, 21, 0, 21, 0, 0, 0, 21, 0, 0], [0, 0, 21, 21, 11, 21, 21, 0, 21, 21, 11, 21, 21, 56, 0], [0, 0, 11, 0, 0, 0, 0, 1000, 0, 0, 0, 0, 11, 0, 0], [0, 0, 21, 21, 11, 21, 21, 0, 21, 21, 11, 21, 21, 0, 0], [0, 0, 21, 0, 0, 0, 21, 0, 21, 0, 0, 0, 21, 0, 0], [0, 0, 21, 51, 21, 51, 21, 0, 21, 59, 21, 0, 21, 0, 0], [0, 0, 21, 0, 0, 0, 21, 0, 21, 0, 0, 0, 21, 0, 0], [0, 0, 21, 21, 21, 21, 21, 0, 21, 21, 21, 21, 21, 0, 0], [200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
bonusArray[0] = [_root.LEVELDOOR, _root.MULTIBOMB, _root.MULTIBOMB, _root.WEAVE, _root.ROLLERS, _root.BIGBOMB, _root.LITTLEBOMB, _root.REMOTECONTROL];
dimMap[1][0] = 15;
dimMap[1][1] = 13;
clearMap(1);
grid2 = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 21, 0, 21, 0, 21, 11, 21, 0, 21, 0, 21, 0, 0], [21, 21, 21, 11, 21, 21, 21, 55, 21, 11, 21, 21, 21, 11, 11], [0, 0, 21, 0, 21, 0, 21, 11, 21, 0, 21, 0, 21, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 52, 0, 0, 0, 0, 0], [21, 21, 21, 11, 21, 0, 21, 0, 21, 0, 21, 11, 21, 21, 21], [0, 0, 51, 0, 21, 21, 21, 11, 21, 21, 21, 64, 0, 0, 0], [21, 21, 21, 11, 21, 0, 21, 0, 21, 0, 21, 11, 21, 21, 21], [0, 0, 0, 0, 0, 0, 0, 0, 0, 59, 0, 0, 0, 0, 0], [0, 0, 21, 0, 21, 0, 21, 0, 21, 0, 21, 0, 21, 0, 0], [0, 0, 21, 21, 21, 0, 63, 0, 0, 0, 21, 21, 21, 11, 11], [11, 11, 21, 0, 21, 11, 21, 11, 21, 11, 21, 0, 21, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 200]];
bonusArray[1] = [_root.WEAVE, _root.BIGBOMB, _root.MULTIBOMB, _root.MULTIBOMB, _root.TURTLE];
break;
case 5 :
room = 2;
dimMap[0][0] = 15;
dimMap[0][1] = 13;
clearMap(0);
grid = [[1000, 0, 0, 0, 11, 0, 0, 0, 11, 0, 0, 0, 11, 0, 200], [0, 0, 21, 0, 21, 0, 21, 0, 21, 0, 21, 0, 21, 0, 0], [21, 21, 21, 0, 21, 21, 21, 0, 21, 62, 21, 21, 21, 0, 0], [0, 0, 21, 0, 21, 0, 21, 0, 21, 0, 21, 0, 21, 0, 0], [0, 0, 0, 0, 11, 64, 11, 0, 11, 0, 11, 0, 11, 0, 0], [21, 21, 21, 11, 21, 0, 21, 0, 21, 0, 21, 0, 21, 21, 21], [0, 0, 62, 0, 21, 21, 21, 0, 21, 21, 21, 0, 0, 0, 0], [21, 21, 21, 11, 21, 0, 21, 0, 21, 0, 21, 0, 21, 21, 21], [0, 0, 0, 0, 11, 0, 11, 52, 11, 0, 11, 0, 11, 0, 0], [0, 60, 21, 0, 21, 0, 21, 0, 21, 0, 21, 0, 21, 59, 0], [0, 0, 21, 21, 21, 0, 11, 0, 11, 0, 21, 0, 21, 0, 0], [0, 0, 21, 0, 21, 0, 21, 0, 21, 0, 21, 21, 21, 0, 0], [0, 0, 53, 0, 0, 0, 11, 0, 0, 0, 11, 0, 0, 0, 0]];
bonusArray[0] = [_root.LEVELDOOR, _root.MULTIBOMB, _root.BIGBOMB, _root.WEAVE, _root.ROLLERS, _root.BIGBOMB, _root.MULTIBOMB, _root.LITTLEBOMB, _root.REMOTECONTROL];
dimMap[1][0] = 15;
dimMap[1][1] = 13;
clearMap(1);
grid2 = [[200, 0, 0, 0, 11, 0, 55, 0, 0, 0, 11, 0, 0, 52, 0], [0, 0, 21, 0, 21, 0, 21, 21, 21, 0, 21, 0, 21, 0, 0], [21, 21, 21, 0, 21, 0, 0, 11, 0, 0, 21, 11, 21, 21, 21], [0, 0, 21, 0, 21, 0, 21, 21, 21, 0, 21, 0, 21, 0, 0], [0, 0, 0, 0, 11, 0, 0, 0, 0, 0, 11, 0, 0, 0, 0], [11, 21, 21, 11, 21, 21, 21, 11, 21, 21, 21, 11, 21, 21, 11], [0, 0, 0, 0, 0, 0, 0, 0, 0, 56, 0, 0, 0, 0, 0], [11, 21, 21, 11, 21, 21, 21, 11, 21, 21, 21, 11, 21, 21, 11], [0, 0, 0, 0, 11, 0, 0, 0, 0, 0, 11, 0, 0, 0, 0], [0, 0, 21, 0, 21, 0, 21, 21, 21, 0, 21, 0, 0, 21, 0], [21, 21, 21, 0, 21, 0, 0, 51, 0, 0, 21, 0, 0, 21, 21], [0, 0, 21, 0, 21, 11, 21, 21, 21, 11, 21, 0, 0, 21, 0], [0, 58, 0, 0, 0, 0, 0, 11, 0, 0, 0, 0, 59, 0, 0]];
bonusArray[1] = [_root.WEAVE, _root.BIGBOMB, _root.MULTIBOMB, _root.BIGBOMB, _root.MULTIBOMB, _root.MULTIBOMB, _root.ROLLERS];
break;
case 6 :
room = 2;
dimMap[0][0] = 15;
dimMap[0][1] = 13;
clearMap(0);
grid = [[1000, 0, 0, 0, 12, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0], [0, 0, 21, 0, 21, 0, 21, 21, 21, 12, 21, 0, 21, 0, 0], [21, 21, 21, 0, 21, 0, 0, 0, 12, 0, 21, 0, 21, 21, 21], [0, 0, 21, 0, 21, 58, 21, 21, 21, 0, 21, 0, 21, 0, 0], [0, 0, 13, 0, 13, 0, 13, 0, 0, 0, 12, 52, 0, 0, 0], [0, 0, 21, 13, 21, 21, 21, 0, 21, 21, 21, 0, 21, 21, 12], [0, 0, 0, 0, 0, 0, 12, 0, 12, 0, 0, 0, 12, 0, 0], [0, 21, 0, 0, 21, 21, 21, 0, 21, 21, 21, 12, 21, 0, 0], [0, 12, 0, 0, 12, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0], [0, 21, 57, 0, 21, 0, 21, 21, 21, 0, 21, 0, 21, 0, 0], [21, 21, 0, 0, 21, 0, 12, 0, 12, 0, 21, 0, 21, 21, 21], [0, 0, 0, 0, 21, 12, 21, 21, 21, 12, 21, 55, 21, 0, 0], [200, 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0]];
bonusArray[0] = [_root.LEVELDOOR, _root.BONUSLIFE, _root.MULTIBOMB, _root.MULTIBOMB, _root.WEAVE, _root.ROLLERS, _root.BIGBOMB, _root.BIGBOMB, _root.LITTLEBOMB, _root.REMOTECONTROL];
dimMap[1][0] = 15;
dimMap[1][1] = 13;
clearMap(1);
grid2 = [[0, 0, 0, 0, 13, 0, 0, 13, 0, 0, 12, 0, 21, 0, 0], [0, 21, 21, 0, 21, 0, 21, 21, 21, 0, 21, 0, 21, 58, 0], [0, 0, 0, 0, 21, 0, 0, 0, 0, 0, 21, 0, 0, 0, 0], [13, 21, 21, 21, 21, 21, 13, 21, 13, 21, 21, 21, 21, 21, 21], [0, 63, 0, 0, 21, 0, 0, 0, 0, 0, 21, 0, 0, 0, 0], [0, 0, 21, 12, 21, 13, 21, 0, 21, 13, 21, 12, 21, 0, 0], [0, 0, 21, 0, 0, 0, 21, 0, 21, 0, 0, 0, 21, 0, 0], [0, 0, 21, 12, 21, 13, 21, 52, 21, 13, 21, 12, 21, 0, 0], [0, 0, 0, 0, 21, 0, 0, 0, 0, 0, 21, 0, 0, 0, 55], [0, 21, 12, 21, 21, 21, 0, 21, 0, 21, 21, 21, 21, 12, 0], [0, 0, 0, 21, 0, 0, 0, 13, 0, 0, 21, 0, 0, 0, 0], [0, 21, 59, 21, 0, 0, 21, 21, 21, 0, 21, 0, 21, 0, 0], [0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 200]];
bonusArray[1] = [_root.WEAVE, _root.BIGBOMB, _root.MULTIBOMB, _root.ROLLERS, _root.BIGBOMB, _root.MULTIBOMB, _root.MULTIBOMB];
break;
case 7 :
default :
room = 2;
dimMap[0][0] = 15;
dimMap[0][1] = 13;
clearMap(0);
grid = [[0, 0, 63, 0, 13, 0, 0, 1000, 0, 0, 13, 0, 0, 0, 0], [0, 21, 21, 0, 21, 0, 21, 21, 21, 0, 21, 0, 21, 21, 0], [0, 0, 0, 0, 21, 0, 0, 0, 0, 0, 21, 0, 0, 0, 0], [21, 21, 21, 21, 21, 21, 13, 21, 13, 21, 21, 21, 21, 21, 21], [0, 0, 0, 0, 21, 0, 0, 0, 0, 0, 21, 0, 0, 62, 0], [0, 0, 21, 0, 21, 0, 21, 13, 21, 0, 21, 0, 21, 0, 0], [0, 64, 8, 0, 21, 0, 21, 59, 21, 0, 21, 0, 8, 0, 0], [0, 0, 21, 0, 21, 0, 21, 13, 21, 0, 21, 0, 21, 0, 0], [0, 0, 0, 0, 21, 0, 0, 58, 0, 0, 21, 0, 0, 0, 0], [21, 21, 21, 21, 21, 21, 13, 21, 13, 21, 21, 21, 21, 21, 21], [0, 0, 0, 0, 13, 0, 0, 0, 0, 0, 13, 0, 0, 0, 0], [0, 0, 21, 0, 21, 0, 21, 8, 21, 55, 21, 0, 21, 0, 0], [0, 0, 0, 0, 13, 0, 0, 0, 0, 0, 13, 0, 0, 0, 200]];
bonusArray[0] = [_root.LEVELDOOR, _root.MULTIBOMB, _root.WEAVE, _root.ROLLERS, _root.BIGBOMB, _root.MULTIBOMB, _root.WEAVE, _root.BIGBOMB, _root.LITTLEBOMB, _root.REMOTECONTROL];
dimMap[1][0] = 15;
dimMap[1][1] = 13;
clearMap(1);
grid2 = [[0, 51, 0, 0, 0, 21, 21, 21, 21, 21, 0, 0, 0, 0, 0], [0, 21, 12, 21, 0, 12, 0, 0, 0, 12, 0, 21, 12, 21, 0], [0, 0, 0, 0, 0, 21, 21, 21, 21, 21, 0, 0, 0, 0, 0], [0, 21, 12, 21, 0, 0, 0, 12, 0, 0, 0, 21, 12, 21, 0], [0, 0, 0, 0, 0, 21, 21, 21, 21, 21, 0, 0, 0, 0, 0], [0, 21, 12, 21, 0, 12, 0, 58, 0, 12, 0, 21, 12, 21, 0], [0, 0, 0, 0, 0, 21, 21, 21, 21, 21, 0, 0, 0, 0, 0], [0, 21, 0, 21, 0, 12, 0, 21, 0, 12, 0, 21, 0, 21, 7], [6, 0, 57, 0, 0, 21, 59, 21, 0, 21, 0, 0, 61, 0, 0], [0, 21, 7, 21, 12, 21, 0, 0, 63, 21, 0, 21, 6, 21, 0], [0, 21, 7, 21, 0, 21, 0, 21, 0, 21, 0, 21, 6, 21, 0], [0, 0, 0, 0, 0, 21, 0, 21, 0, 21, 0, 0, 0, 0, 0], [200, 0, 0, 21, 0, 12, 0, 0, 0, 12, 0, 21, 0, 0, 0]];
bonusArray[1] = [_root.WEAVE, _root.BIGBOMB, _root.TURTLE, _root.ROLERS, _root.MULTIBOMB, _root.MALUSSPEED, _root.BIGBOMB, _root.MULTIBOMB, _root.MULTIBOMB];
}
createMap(grid, 0);
createMap(grid2, 1);
}
function createMap(grille, numgrid) {
var _local6;
var _local8;
var _local4 = 0;
while (_local4 < dimMap[numgrid][1]) {
var _local3 = 0;
while (_local3 < dimMap[numgrid][0]) {
_local6 = _root.getLastDeapth();
if (grille[_local4][_local3] == _root.EMPTY) {
map[numgrid][_local4][_local3].value = _root.EMPTY;
listEmptyCell(numgrid, _local4, _local3);
map[numgrid][_local4][_local3].walkable = true;
map[numgrid][_local4][_local3].clip_mc = _root.game_mc.attachMovie("casevide_mc", "casevide_mc" + _local6, _local6);
map[numgrid][_local4][_local3].clip_mc.gotoAndStop(random(3) + 1);
} else if (((grille[_local4][_local3] == _root.BREAKINGWALL1) || (grille[_local4][_local3] == _root.BREAKINGWALL2)) || (grille[_local4][_local3] == _root.BREAKINGWALL3)) {
map[numgrid][_local4][_local3].value = grille[_local4][_local3];
map[numgrid][_local4][_local3].walkable = false;
map[numgrid][_local4][_local3].clip_mc = _root.game_mc.attachMovie("breakingwall_mc", "breakingwall_mc" + _local6, _local6);
_local8 = map[numgrid][_local4][_local3].value - 10;
map[numgrid][_local4][_local3].clip_mc.gotoAndStop(_local8);
_root.creationBreakingWall(_local4, _local3, map[numgrid][_local4][_local3].value, numgrid);
} else if (grille[_local4][_local3] == _root.WALL) {
map[numgrid][_local4][_local3].value = _root.WALL;
map[numgrid][_local4][_local3].walkable = false;
map[numgrid][_local4][_local3].clip_mc = _root.game_mc.attachMovie("mur_mc", "mur_mc" + _local6, _local6);
} else if (grille[_local4][_local3] == _root.DOOR) {
map[numgrid][_local4][_local3].value = _root.DOOR;
map[numgrid][_local4][_local3].walkable = false;
map[numgrid][_local4][_local3].clip_mc = _root.game_mc.attachMovie("porte_mc", "porte_mc" + _local6, _local6);
} else if (grille[_local4][_local3] == _root.FLAQUE) {
map[numgrid][_local4][_local3].value = _root.FLAQUE;
listEmptyCell(numgrid, _local4, _local3);
map[numgrid][_local4][_local3].walkable = true;
map[numgrid][_local4][_local3].clip_mc = _root.game_mc.attachMovie("flaque_mc", "flaque_mc" + _local6, _local6);
} else if (grille[_local4][_local3] == _root.SOAPYFLOOR) {
map[numgrid][_local4][_local3].value = _root.SOAPYFLOOR;
listEmptyCell(numgrid, _local4, _local3);
map[numgrid][_local4][_local3].walkable = true;
map[numgrid][_local4][_local3].clip_mc = _root.game_mc.attachMovie("soapyfloor_mc", "soapyfloor_mc" + _local6, _local6);
} else if (grille[_local4][_local3] == _root.SLIPPERYFLOOR) {
map[numgrid][_local4][_local3].value = _root.SLIPPERYFLOOR;
listEmptyCell(numgrid, _local4, _local3);
map[numgrid][_local4][_local3].walkable = true;
map[numgrid][_local4][_local3].clip_mc = _root.game_mc.attachMovie("slipperyfloor_mc", "slipperyfloor_mc" + _local6, _local6);
} else if (grille[_local4][_local3] == _root.CAROUSELNS) {
map[numgrid][_local4][_local3].value = _root.CAROUSELNS;
listEmptyCell(numgrid, _local4, _local3);
map[numgrid][_local4][_local3].walkable = true;
map[numgrid][_local4][_local3].clip_mc = _root.game_mc.attachMovie("carouselns_mc", "carouselns_mc" + _local6, _local6);
} else if (map[_local4][_local3] == _root.CAROUSELSN) {
map[numgrid][_local4][_local3].value = _root.CAROUSELSN;
listEmptyCell(numgrid, _local4, _local3);
map[numgrid][_local4][_local3].walkable = true;
map[numgrid][_local4][_local3].clip_mc = _root.game_mc.attachMovie("carouselsn_mc", "carouselsn_mc" + _local6, _local6);
} else if (grille[_local4][_local3] == _root.CAROUSELEW) {
map[numgrid][_local4][_local3].value = _root.CAROUSELEW;
listEmptyCell(numgrid, _local4, _local3);
map[numgrid][_local4][_local3].walkable = true;
map[numgrid][_local4][_local3].clip_mc = _root.game_mc.attachMovie("carouselew_mc", "carouselew_mc" + _local6, _local6);
} else if (grille[_local4][_local3] == _root.CAROUSELWE) {
map[numgrid][_local4][_local3].value = _root.CAROUSELWE;
listEmptyCell(numgrid, _local4, _local3);
map[numgrid][_local4][_local3].walkable = true;
map[numgrid][_local4][_local3].clip_mc = _root.game_mc.attachMovie("carouselwe_mc", "carouselwe_mc" + _local6, _local6);
} else if (grille[_local4][_local3] == _root.TELEPORTEUR) {
map[numgrid][_local4][_local3].value = _root.TELEPORTEUR;
listEmptyCell(numgrid, _local4, _local3);
map[numgrid][_local4][_local3].walkable = true;
map[numgrid][_local4][_local3].clip_mc = _root.game_mc.attachMovie("teleporteur_mc", "teleporteur_mc" + _local6, _local6);
} else if ((grille[_local4][_local3] >= _root.MONSTRE1) && (grille[_local4][_local3] <= _root.MONSTERBLOBBIES)) {
map[numgrid][_local4][_local3].value = _root.EMPTY;
listEmptyCell(numgrid, _local4, _local3);
map[numgrid][_local4][_local3].walkable = true;
map[numgrid][_local4][_local3].clip_mc = _root.game_mc.attachMovie("casevide_mc", "casevide_mc" + _local6, _local6);
map[numgrid][_local4][_local3].clip_mc.gotoAndStop(random(3) + 1);
_root.creationEnemy(_local4, _local3, grille[_local4][_local3], numgrid);
} else if (grille[_local4][_local3] == _root.HERO) {
map[numgrid][_local4][_local3].value = _root.EMPTY;
listEmptyCell(numgrid, _local4, _local3);
map[numgrid][_local4][_local3].walkable = true;
map[numgrid][_local4][_local3].clip_mc = _root.game_mc.attachMovie("casevide_mc", "casevide_mc" + _local6, _local6);
map[numgrid][_local4][_local3].clip_mc.gotoAndStop(random(3) + 1);
_root.creationHero(_local4, _local3, grille[_local4][_local3]);
}
map[numgrid][_local4][_local3].clip_mc._x = (_local3 * map[numgrid][_local4][_local3].taille) + (map[numgrid][_local4][_local3].taille / 2);
map[numgrid][_local4][_local3].clip_mc._y = (_local4 * map[numgrid][_local4][_local3].taille) + (map[numgrid][_local4][_local3].taille / 2);
_local3++;
}
_local4++;
}
choiceBonus(numgrid);
}
function listEmptyCell(grid, numi, numj) {
emptyCellArray[grid][nbEmptyCell] = (numi * dimMap[grid][0]) + numj;
nbEmptyCell++;
}
function choiceBonus(selectedGrid) {
var _local6;
var _local4 = new Array();
_local4.splice(0);
var _local3 = 0;
while (_local3 < _root.wallArray[selectedGrid].length) {
_local4[_local3] = new Array();
_local4[_local3][0] = _root.wallArray[selectedGrid][_local3].row;
_local4[_local3][1] = _root.wallArray[selectedGrid][_local3].column;
_local3++;
}
var _local7 = 0;
while (_local7 < bonusArray[selectedGrid].length) {
_local6 = random(_local4.length);
map[selectedGrid][_local4[_local6][0]][_local4[_local6][1]].bonus = bonusArray[selectedGrid][_local7];
_local4[_local6].splice(0);
_local4.splice(_local6, 1);
_local7++;
}
_local4.splice(0);
}
var grid = new Array();
var grid2 = new Array();
var map = new Array();
var bonusArray = new Array();
var dimMap = new Array();
var emptyCellArray = new Array();
var nbEmptyCell = 0;
}
Symbol 668 MovieClip [__Packages.tile] Frame 0
class tile
{
var row, column, taille, value, bonus, walkable, clip_mc;
function tile (line, col) {
row = line;
column = col;
taille = _root.sizeTile;
value = _root.EMPTY;
bonus = 0;
walkable = true;
}
function setClip(line, col) {
clip_mc._x = (col * taille) + (taille / 2);
clip_mc._y = (line * taille) + (taille / 2);
clip_mc.gotoAndStop(1);
}
function checkWalking(obj, line, col) {
if (walkable && (value != _root.BOMB)) {
return(true);
}
if (walkable && (value == _root.BOMB)) {
if (obj.walkonwall) {
return(true);
}
if ((obj.oldrow == line) && (obj.oldcol == col)) {
return(true);
}
} else {
if ((obj.reference == _root.HERO) && (value == _root.DOOR)) {
return(true);
}
if (((obj.reference == _root.MONSTEROVERWALL) || (obj.reference == _root.MONSTEREATWALL)) && (((value == _root.BREAKINGWALL1) || (value == _root.BREAKINGWALL2)) || (value == _root.BREAKINGWALL3))) {
return(true);
}
}
return(false);
}
function checkFloorBis(obj) {
var _local6 = 0;
if (value == _root.DOOR) {
_root.teleportation_snd.attachSound("teleportation");
_root.teleportation_snd.start();
changeRoom();
obj.speedCoef = _root.SPEEDCOEFNORMAL;
} else if (value == _root.SOAPYFLOOR) {
obj.speedCoef = _root.SPEEDCOEFSOAPYFLOOR;
} else if (value == _root.SLIPPERYFLOOR) {
obj.speedCoef = _root.SPEEDCOEFSLIPPERYFLOOR;
} else if (value == _root.CAROUSELNS) {
obj.deltaCarouselX = 0;
obj.deltaCarouselY = _root.SPEEDCOEFCAROUSELNSN;
} else if (value == _root.CAROUSELSN) {
obj.deltaCarouselX = 0;
obj.deltaCarouselY = -_root.SPEEDCOEFCAROUSELNSN;
} else if (value == _root.CAROUSELEW) {
obj.deltaCarouselX = _root.SPEEDCOEFCAROUSELEWE;
obj.deltaCarouselY = 0;
} else if (value == _root.CAROUSELWE) {
obj.deltaCarouselX = -_root.SPEEDCOEFCAROUSELEWE;
obj.deltaCarouselY = 0;
} else if (value == _root.TELEPORTEUR) {
obj.inTeleportation = true;
obj.inReapparition = false;
obj.isWalking = false;
} else if (value == _root.BONUS) {
var _local7 = _root.getLastDeapth();
if (obj.reference == _root.HERO) {
switch (bonus) {
case _root.BONUSMDEAD :
_root.score = _root.score + _root.bonusMonsterDead;
_root.displayScore();
break;
case _root.MULTIBOMB :
obj.multibombe = true;
_root.maxBombToLaunch++;
_root.displayMultiBomb();
break;
case _root.BIGBOMB :
_root.rangeBomb++;
if (_root.rangeBomb > 3) {
_root.rangeBomb = 4;
}
_root.displayPowerBomb();
break;
case _root.ROLLERS :
if (!obj.inRoller) {
obj.inRoller = true;
obj.speed_x = obj.speed_x * 2.5;
obj.speed_y = obj.speed_y * 2.5;
}
break;
case _root.WEAVE :
obj.resistance = obj.INVINCIBLE;
_root.player.cape_mc._visible = true;
break;
case _root.REMOTECONTROL :
obj.getRemote = true;
break;
case _root.BONUSLIFE :
obj.life = obj.life + 1;
_root.updateLife();
break;
case _root.BOXKEY :
obj.getKey = true;
break;
case _root.STRONGBOX :
if (obj.getKey) {
_local6 = _root.MULTIBOMB + random(3);
if (_local6 == _root.MULTIBOMB) {
obj.multibombe = true;
_root.maxBombToLaunch++;
_root.displayMultiBomb();
} else if (_local6 == _root.BIGBOMB) {
_root.rangeBomb++;
if (_root.rangeBomb > 3) {
_root.rangeBomb = 4;
}
_root.displayPowerBomb();
} else {
obj.getRemote = true;
}
}
break;
case _root.TURTLE :
var _local5 = 0;
while (_local5 < _root.enemyArray[_root.currentRoom].length) {
_root.enemyArray[_root.currentRoom][_local5].speed_x = _root.enemyArray[_root.currentRoom][_local5].speed_x / 3;
_root.enemyArray[_root.currentRoom][_local5].speed_y = _root.enemyArray[_root.currentRoom][_local5].speed_y / 3;
_local5++;
}
break;
case _root.LEVELDOOR :
if (_root.activeDoor && _root.findDoor) {
_root.teleportation_snd.attachSound("teleportation");
_root.teleportation_snd.start();
_root.nextLevel = true;
_root.prepaTransition();
}
break;
case _root.MALUSLIFE :
obj.life = obj.life - 1;
_root.updateLife();
break;
case _root.MALUSBOMB :
obj.multibombe = false;
_root.maxBombToLaunch = 1;
_root.displayMultiBomb();
break;
case _root.MALUSSPEED :
obj.inRoller = false;
obj.speed_x = obj.speed_x * 0.7;
obj.speed_y = obj.speed_y * 0.7;
break;
case _root.NOREMOTE :
obj.getRemote = false;
break;
case _root.LITTLEBOMB :
_root.rangeBomb = 1;
_root.displayPowerBomb();
break;
case _root.BONUSPTS250 :
_root.score = _root.score + 250;
_root.displayScore();
break;
case _root.BONUSPTS500 :
_root.score = _root.score + 500;
_root.displayScore();
break;
case _root.BONUSPTS750 :
_root.score = _root.score + 750;
_root.displayScore();
break;
case _root.BONUSPTS1000 :
_root.score = _root.score + 1000;
_root.displayScore();
break;
}
}
if (bonus != _root.LEVELDOOR) {
if ((bonus == _root.STRONGBOX) && (obj.reference == _root.HERO)) {
if (_root.player.getKey) {
var _local3 = 0;
while (_local3 < _root.bonusArray[_root.currentRoom].length) {
if ((Math.round((clip_mc._y - (taille / 2)) / taille) == _root.bonusArray[_root.currentRoom][_local3].row) && (Math.round((clip_mc._x - (taille / 2)) / taille) == _root.bonusArray[_root.currentRoom][_local3].column)) {
_local6 = (_local6 + 1) - _root.MULTIBOMB;
_root.bonusArray[_root.currentRoom][_local3].bonuscof_mc.gotoAndStop(_local6);
_root.bonusArray[_root.currentRoom][_local3].gotoAndStop("actif");
}
_local3++;
}
value = _root.EMPTY;
bonus = 0;
_root.takebonus_snd.attachSound("attrapebonus");
_root.takebonus_snd.start();
}
} else {
var _local3 = 0;
while (_local3 < _root.bonusArray[_root.currentRoom].length) {
if ((Math.round((clip_mc._y - (taille / 2)) / taille) == _root.bonusArray[_root.currentRoom][_local3].row) && (Math.round((clip_mc._x - (taille / 2)) / taille) == _root.bonusArray[_root.currentRoom][_local3].column)) {
_root.bonusArray[_root.currentRoom][_local3].gotoAndStop("actif");
}
_local3++;
}
value = _root.EMPTY;
bonus = 0;
_root.takebonus_snd.attachSound("attrapebonus");
_root.takebonus_snd.start();
}
}
obj.deltaCarouselX = 0;
obj.deltaCarouselY = 0;
obj.speedCoef = _root.SPEEDCOEFNORMAL;
} else {
obj.deltaCarouselX = 0;
obj.deltaCarouselY = 0;
obj.speedCoef = _root.SPEEDCOEFNORMAL;
}
}
function changeRoom() {
var _local3 = 0;
while (_local3 < _root.myLevel.dimMap[_root.currentRoom][1]) {
var _local2 = 0;
while (_local2 < _root.myLevel.dimMap[_root.currentRoom][0]) {
_root.myLevel.map[_root.currentRoom][_local3][_local2].clip_mc._visible = false;
_local2++;
}
_local3++;
}
var _local7 = 0;
while (_local7 < _root.enemyArray[_root.currentRoom].length) {
_root.enemyArray[_root.currentRoom][_local7]._visible = false;
_local7++;
}
var _local4 = 0;
while (_local4 < _root.bonusArray[_root.currentRoom].length) {
_root.bonusArray[_root.currentRoom][_local4]._visible = false;
_local4++;
}
var _local8 = 0;
while (_local8 < _root.bombArray[_root.currentRoom].length) {
_root.bombArray[_root.currentRoom][_local8].clip_mc._visible = false;
_local8++;
}
var _local6 = 0;
while (_local6 < _root.limitedTimeObjectArray[_root.currentRoom].length) {
_root.limitedTimeObjectArray[_root.currentRoom][_local6].clip_mc._visible = false;
_local6++;
}
_root.player.launchedBomb = false;
_root.nbLaunchedBomb = 0;
_root.player.replaceClip();
_root.currentRoom = (_root.currentRoom + 1) % 2;
_local3 = 0;
while (_local3 < _root.myLevel.dimMap[_root.currentRoom][1]) {
var _local2 = 0;
while (_local2 < _root.myLevel.dimMap[_root.currentRoom][0]) {
_root.myLevel.map[_root.currentRoom][_local3][_local2].clip_mc._visible = true;
_local2++;
}
_local3++;
}
var _local5 = 0;
while (_local5 < _root.enemyArray[_root.currentRoom].length) {
_root.enemyArray[_root.currentRoom][_local5]._visible = true;
_local5++;
}
_local4 = 0;
while (_local4 < _root.bonusArray[_root.currentRoom].length) {
_root.bonusArray[_root.currentRoom][_local4]._visible = true;
_local4++;
}
_local8 = 0;
while (_local8 < _root.bombArray[_root.currentRoom].length) {
_root.bombArray[_root.currentRoom][_local8].clip_mc._visible = true;
_local8++;
}
_local6 = 0;
while (_local6 < _root.limitedTimeObjectArray[_root.currentRoom].length) {
_root.limitedTimeObjectArray[_root.currentRoom][_local6].clip_mc._visible = true;
_local6++;
}
}
}
Symbol 669 MovieClip [__Packages.wall] Frame 0
class wall
{
var taille, row, column, resistance, current_x, current_y;
function wall (i, j, resist) {
taille = _root.sizeTile;
row = i;
column = j;
resistance = resist - 10;
current_x = (column * taille) + (taille / 2);
current_y = (row * taille) + (taille / 2);
}
function explosion(clip) {
resistance--;
if (resistance == 2) {
clip.gotoAndStop(2);
} else if (resistance == 1) {
clip.gotoAndStop(1);
} else {
clip.gotoAndStop("destruction");
_root.myLevel.map[_root.currentRoom][row][column].value = _root.EMPTY;
_root.myLevel.map[_root.currentRoom][row][column].walkable = true;
}
}
}
Symbol 474 MovieClip Frame 1
direction = "_" add _root.langage;
gotoAndStop(direction);
jouer_btn.onRelease = function () {
_root.gotoAndStop("jeu");
_root.fdmusical.start(0, 400000);
_root.fdmusical.setVolume(50);
};
instruction_btn.onRelease = function () {
_root.gotoAndStop("instruction");
};
stop();
Symbol 474 MovieClip Frame 2
jouer_btn.onRelease = function () {
_root.gotoAndStop("jeu");
_root.fdmusical.start(0, 400000);
_root.fdmusical.setVolume(50);
};
instruction_btn.onRelease = function () {
_root.gotoAndStop("instruction");
};
stop();
Symbol 508 MovieClip Frame 1
direction = "_" add _root.langage;
gotoAndStop(direction);
accueil_btn.onRelease = function () {
_root.gotoAndStop("accueil");
};
bonus_btn.onRelease = function () {
_root.gotoAndStop("bonus");
};
malus_btn.onRelease = function () {
_root.gotoAndStop("malus");
};
ennemis_btn.onRelease = function () {
_root.gotoAndStop("ennemis");
};
instruction_btn.onRelease = function () {
_root.gotoAndStop("instruction");
};
stop();
Symbol 537 MovieClip Frame 1
direction = "_" add _root.langage;
gotoAndStop(direction);
accueil_btn.onRelease = function () {
_root.gotoAndStop("accueil");
};
bonus_btn.onRelease = function () {
_root.gotoAndStop("bonus");
};
malus_btn.onRelease = function () {
_root.gotoAndStop("malus");
};
ennemis_btn.onRelease = function () {
_root.gotoAndStop("ennemis");
};
instruction_btn.onRelease = function () {
_root.gotoAndStop("instruction");
};
stop();
Symbol 548 MovieClip Frame 1
direction = "_" add _root.langage;
gotoAndStop(direction);
accueil_btn.onRelease = function () {
_root.gotoAndStop("accueil");
};
bonus_btn.onRelease = function () {
_root.gotoAndStop("bonus");
};
malus_btn.onRelease = function () {
_root.gotoAndStop("malus");
};
ennemis_btn.onRelease = function () {
_root.gotoAndStop("ennemis");
};
instruction_btn.onRelease = function () {
_root.gotoAndStop("instruction");
};
stop();
Symbol 579 MovieClip Frame 1
direction = "_" add _root.langage;
gotoAndStop(direction);
accueil_btn.onRelease = function () {
_root.gotoAndStop("accueil");
};
bonus_btn.onRelease = function () {
_root.gotoAndStop("bonus");
};
malus_btn.onRelease = function () {
_root.gotoAndStop("malus");
};
ennemis_btn.onRelease = function () {
_root.gotoAndStop("ennemis");
};
instruction_btn.onRelease = function () {
_root.gotoAndStop("instruction");
};
stop();
Symbol 588 Button
on (release) {
if (_root.etatzik == "on") {
_root.etatzik = "off";
_root.musik_mc.gotoAndStop("off");
_root.fdmusical.stop();
} else {
_root.etatzik = "on";
_root.musik_mc.gotoAndStop("on");
_root.fdmusical.start(0, 400000);
_root.fdmusical.setVolume(50);
}
}
Symbol 602 MovieClip Frame 1
stop();
Symbol 606 MovieClip Frame 1
stop();
Symbol 607 MovieClip Frame 1
stop();
Symbol 627 Button
on (release) {
getURL ("http://www.gargul-studio.com", "_blank");
}
Symbol 633 MovieClip Frame 1
direction = "_" add _root.langage;
gotoAndStop(direction);
francais_btn.onRelease = function () {
_root.langage = 1;
gotoAndStop ("_1");
};
anglais_btn.onRelease = function () {
_root.langage = 2;
gotoAndStop ("_2");
};
stop();
Symbol 633 MovieClip Frame 2
direction = "_" add _root.langage;
gotoAndStop(direction);
francais_btn.onRelease = function () {
_root.langage = 1;
gotoAndStop ("_1");
};
anglais_btn.onRelease = function () {
_root.langage = 2;
gotoAndStop ("_2");
};
Symbol 641 Button
on (release) {
_root.gotoAndPlay("depart");
}
Symbol 643 MovieClip Frame 1
direction = "_" add _root.langage;
gotoAndStop(direction);
stop();
Symbol 647 MovieClip Frame 1
direction = "_" add _root.langage;
gotoAndStop(direction);
stop();