Frame 1
function init_var() {
var _local1 = _root;
_local1.flag_dep = 0;
_local1.score = 0;
_local1.niveau = 1;
_local1.dniveau = 1;
_local1.nb_cube_t2 = 3;
_local1.nb_life = 3;
_local1.flag_stop = false;
_local1.nb_glouton = 0;
_local1.flag_niv_info = 0;
}
function start_game(niveau) {
var _local1 = _root;
var _local2 = this;
delete demo_time.onEnterFrame;
_local1.demo_mc.removeMovieClip();
_local1.presentation.removeMovieClip();
if (nb_life == 0) {
_local2.musique("attente_game_over.mp3", 1000);
disp_life.removeMovieClip();
_local1.attachMovie("game_over_mc", "game_over_mc", 5000);
_local1.game_over_mc._x = offset_x;
_local1.game_over_mc._y = offset_y;
_local1.game_over_mc._width = larg_plateau;
_local1.game_over_mc._height = haut_plateau;
_local1.game_over_mc.gotoAndPlay("0");
_local1.createEmptyMovieClip("waitgo", 70);
waitgo.onEnterFrame = function () {
if (Key.isDown(32)) {
game_over_mc.removeMovieClip();
init_var();
start_game(_root.niveau);
delete waitgo.onEnterFrame;
}
};
} else {
_local1.flag_demo = false;
flag_niv_info = 0;
_local2.musique("", 0);
if (niveau > 21) {
niveau = 1;
nb_cube_t2 = nb_cube_t2 + 1;
}
if (Acube7[niveau] == 0) {
flag_vie = 0;
} else if (flag_vie == 1) {
Acube7[niveau] = 0;
}
disp_life.removeMovieClip();
_local1.createEmptyMovieClip("disp_life", 10);
n = 1;
while (n <= nb_life) {
disp_life.attachMovie("perso_logo_mc", "perso_logo_mc" + n, 10 + n);
disp_life["perso_logo_mc" + n]._x = 598 + (16 * n);
disp_life["perso_logo_mc" + n]._y = 250;
n++;
}
_local1.barre_time._alpha = 0;
nb_glouton = 0;
Qty_glouton = qty_glouton_array[niveau];
_local1.createEmptyMovieClip("plateau_glouton_mc", 9000);
delais_repos = int(Math.random() * 10) + 2;
_local1.perso._alpha = 0;
seq_date = new Date();
time = seq_date.getTime();
flag = 0;
_local1.info_niveau_txt = "LEVEL " + niveau;
_local1.niveau = niveau;
_local1.disp_level = String(_local1.dniveau);
_local1.createEmptyMovieClip("wait_start", 91);
wait_start.onEnterFrame = function () {
var _local1 = _root;
Tdate = new Date();
tmp = Tdate.getTime();
if (flag == 0) {
this.musique("info_niveau.mp3", 1);
_local1.attachMovie("info_niveau", "info_niveau", 5001);
_local1.info_niveau._y = 450;
plateau_mc.removeMovieClip();
flag = 1;
}
if ((tmp > (time + 3500)) && (flag == 1)) {
_local1.info_niveau.removeMovieClip();
flag = 2;
}
if ((tmp > (time + 1800)) && (flag == 2)) {
this.musique("game_play", 1000);
flag_dep = 0;
_local1.tableau = new Array(100);
init_personnage();
init_cube();
init_pion2(nb_cube_t2);
tableau[ping_pos] = undefined;
_local1.perso.gotoAndStop("basstop");
_local1.perso._alpha = 100;
_local1.wait.removeMovieClip();
_local1.barre_time._alpha = 100;
_local1.attachMovie("cache_time", "cache_time", 3);
_local1.cache_time._x = _local1.barre_time._x + _local1.barre_time._width;
_local1.cache_time._y = _local1.barre_time._y;
_local1.cache_time._width = 0;
_local1.inc = _local1.barre_time._width / gametime[niveau];
_local1.flag_stop = true;
delete wait_start.onEnterFrame;
}
};
}
}
function mode_demo() {
_root.flag_demo = true;
init_var();
game_over_mc.removeMovieClip();
flag_niv_info = 0;
this.musique("", 0);
disp_life.removeMovieClip();
_root.createEmptyMovieClip("disp_life", 10);
n = 1;
while (n <= nb_life) {
disp_life.attachMovie("perso_logo_mc", "perso_logo_mc" + n, 10 + n);
disp_life["perso_logo_mc" + n]._x = 598 + (16 * n);
disp_life["perso_logo_mc" + n]._y = 250;
n++;
}
_root.barre_time._alpha = 0;
_root.perso._alpha = 0;
seq_date = new Date();
time = seq_date.getTime();
flag = 0;
_root.createEmptyMovieClip("wait_start", 91);
wait_start.onEnterFrame = function () {
Tdate = new Date();
tmp = Tdate.getTime();
if (flag == 0) {
this.musique("info_niveau.mp3", 1);
_root.attachMovie("info_niveau", "info_niveau", 5001);
_root.info_niveau_txt = " DEMO ";
_root.info_niveau._y = 450;
plateau_mc.removeMovieClip();
flag = 1;
}
if ((tmp > (time + 3500)) && (flag == 1)) {
_root.info_niveau.removeMovieClip();
flag = 2;
}
if ((tmp > (time + 1800)) && (flag == 2)) {
this.musique("game_play", 1000);
flag_dep = 0;
_root.tableau = new Array(100);
num_d = int(Math.random() * 6);
_root.createEmptyMovieClip("plateau_mc", 1000);
n = 1;
while (n < demo_array[num_d].length) {
tmp = demo_array[num_d][n].split("|");
pos = (Number(tmp[1]) * 100) + Number(tmp[2]);
name_cube = pos;
_root.tableau[pos] = tmp[0];
type = ("pion_" + tmp[0]) + "_mc";
plateau_mc.attachMovie(type, name_cube, 1000 + n);
plateau_mc[name_cube]._x = ((Number(tmp[1]) * larg_cube) + offset_x) + 1;
plateau_mc[name_cube]._y = ((Number(tmp[2]) * haut_cube) + offset_y) + 1;
plateau_mc[name_cube]._width = larg_cube - 4;
plateau_mc[name_cube]._height = haut_cube - 4;
n++;
}
tmp = demo_array[num_d][0].split("|");
_root.perso._x = (tmp[1] * larg_cube) + offset_x;
_root.perso._y = (tmp[2] * haut_cube) + offset_y;
new_x = _root.perso._x;
new_y = _root.perso._y;
_root.perso.gotoAndStop("basstop");
_root.perso._alpha = 100;
_root.barre_time._alpha = 100;
_root.attachMovie("cache_time", "cache_time", 3);
_root.cache_time._x = _root.barre_time._x + _root.barre_time._width;
_root.cache_time._y = _root.barre_time._y;
_root.cache_time._width = 0;
_root.inc = _root.barre_time._width / 120;
_root.disp_level = "DEMO";
flag = 3;
}
if ((tmp > (time + 800)) && (flag == 3)) {
_root.createEmptyMovieClip("demo_time", 1);
Ademodep1 = Array(2, 4, 4, 2, 8, 2, 2, 2, 10, 4, 10, 2, 4, 8, 4, 10, 4, 4, 8, 4, 10, 4, 10, 4, 2, 9, 3, 3, 3, 3, 3, 1, 3, 1, 7, 1, 7, 1, 7, 1, 7, 1, 10, 4, 7, 1, 7, 1, 3, 8);
Ademodep2 = Array(2, 3, 3, 8, 3, 2, 2, 2, 8, 2, 8, 1, 1, 3, 3, 3, 2, 8, 2, 10, 1, 1, 3, 1, 3, 9, 3, 2, 10, 4, 4, 4, 4, 4, 7, 1, 4, 8, 4, 10, 4, 4, 10, 2, 2, 2, 8, 2, 2, 8, 2, 3, 9, 3, 9, 3, 7);
Ademodep3 = Array(1, 3, 3, 1, 1, 4, 1, 1, 7, 1, 1, 7, 3, 7, 3, 3, 3, 3, 3, 1, 3, 8, 4, 4, 2, 2, 2, 2, 4, 8, 2, 9, 3, 3, 2, 2, 10, 2, 4, 4, 10, 4, 10, 2, 8, 2, 3, 7, 4, 1, 1, 9, 3, 3, 3, 3, 3, 2, 10, 9, 3, 7);
Ademodep4 = Array(3, 9, 3, 9, 3, 9, 4, 4, 4, 8, 2, 10, 2, 9, 3, 9, 7, 4, 8, 2, 8, 2, 2, 3, 7, 4, 4, 7, 3, 3, 3, 7, 4, 2, 9, 2, 10, 1, 1, 1, 1, 1, 1, 4, 1, 9, 2, 4, 10, 4, 7, 1, 4, 1, 9, 3, 2, 2, 3, 3, 1, 10, 4, 4, 1, 4, 4, 8, 2, 9);
Ademodep5 = Array(4, 4, 4, 8, 4, 4, 10, 4, 10, 4, 2, 9, 3, 3, 3, 2, 2, 9, 3, 8, 9, 3, 9, 3, 2, 10, 2, 10, 4, 10, 4, 7, 4, 8, 3, 3, 2, 10, 2, 10, 8, 9, 3, 3, 8, 2, 8, 10, 1, 4, 4, 4, 4, 10, 4, 10, 4, 2, 2, 3, 9, 3, 9, 3, 7);
Ademodep6 = Array(3, 1, 3, 3, 3, 3, 2, 3, 3, 8, 2, 2, 2, 2, 4, 4, 7, 1, 7, 1, 1, 1, 3, 7, 1, 1, 10, 1, 10, 4, 10, 4, 10, 4, 10, 4, 2, 2, 3, 8, 2, 2, 2, 2, 2, 3, 3, 2, 10, 8, 2, 10, 4, 10, 4, 7, 1, 1, 1, 1, 4, 10, 4, 10, 4, 4, 10, 1, 1, 3, 1, 7, 1, 1, 7, 10, 2, 2, 3, 3, 9);
demodep_array = new Array(Ademodep1, Ademodep2, Ademodep3, Ademodep4, Ademodep5, Ademodep6);
num_dep = 0;
flg_act = 0;
Gdate = new Date();
Gtime = Gdate.getTime();
_root.attachMovie("demo_mc", "demo_mc", 55000);
_root.demo_mc._x = offset_x;
_root.demo_mc._y = offset_y;
_root.demo_mc._width = larg_plateau;
_root.demo_mc._height = haut_plateau;
_root.demo_mc.gotoAndPlay("0");
_root.demo_time.onEnterFrame = function () {
Tdate = new Date();
Ttime = Tdate.getTime();
if (Ttime >= (Gtime + 50)) {
Gdate = new Date();
Gtime = Gdate.getTime();
_root.cache_time._width = _root.cache_time._width + (_root.inc / 10);
_root.cache_time._x = (_root.barre_time._x + _root.barre_time._width) - _root.cache_time._width;
niv_info = _root.barre_time._width - _root.cache_time._width;
}
_root.disp_score = String(_root.score);
if (Key.isDown(32)) {
_root.demo_mc.removeMovieClip();
init_var();
delete demo_time.onEnterFrame;
delete _root.win_wait.onEnterFrame;
_root.win_wait.removeMovieClip();
_root.win_mc.removeMovieClip();
start_game(_root.niveau);
}
with (_root.perso) {
px = int(new_x / larg_cube) * 100;
py = int(new_y / haut_cube);
if (((_x == new_x) && (_y == new_y)) && (flg_act == 0)) {
dir = demodep_array[num_d][num_dep];
if (num_dep < demodep_array[num_d].length) {
num_dep++;
}
if (dir == 1) {
new_x = new_x + larg_cube;
gotoAndStop("droite");
flag_dep = 1;
}
if (dir == 2) {
new_x = new_x - larg_cube;
gotoAndStop("gauche");
flag_dep = 2;
}
if (dir == 3) {
new_y = new_y - haut_cube;
gotoAndStop("haut");
flag_dep = 3;
}
if (dir == 4) {
new_y = new_y + haut_cube;
gotoAndStop("bas");
flag_dep = 4;
}
if (dir == 7) {
flg_act = 7;
gotoAndStop("pousse_d");
plateau_mc[(px + 100) + py].gotoAndStop("move_left");
}
if (dir == 8) {
flg_act = 8;
gotoAndStop("pousse_g");
plateau_mc[(px - 100) + py].gotoAndStop("move_right");
}
if (dir == 9) {
flg_act = 9;
gotoAndStop("pousse_h");
plateau_mc[(px + py) - 1].gotoAndStop("move_up");
}
if (dir == 10) {
flg_act = 10;
gotoAndStop("pousse_b");
plateau_mc[(px + py) + 1].gotoAndStop("move_down");
}
}
incx = larg_cube / increment;
incy = haut_cube / increment;
if (_x < new_x) {
_x = _x + incx;
} else if (_x > new_x) {
_x = _x - incx;
} else if (_y < new_y) {
_y = _y + incy;
} else if (_y > new_y) {
_y = _y - incy;
} else {
if ((flag_dep == 1) && (flg_act == 0)) {
gotoAndStop("dstop");
}
if ((flag_dep == 2) && (flg_act == 0)) {
gotoAndStop("gstop");
}
if ((flag_dep == 3) && (flg_act == 0)) {
gotoAndStop("hautstop");
}
if ((flag_dep == 4) && (flg_act == 0)) {
gotoAndStop("basstop");
}
flag_dep = 0;
}
if (flg_act != 0) {
if ((flg_act == 8) && (tableau[(px - 100) + py] == undefined)) {
flg_act = 0;
}
if ((flg_act == 7) && (tableau[(px + 100) + py] == undefined)) {
flg_act = 0;
}
if ((flg_act == 9) && (tableau[(px + py) - 1] == undefined)) {
flg_act = 0;
}
if ((flg_act == 10) && (tableau[(px + py) + 1] == undefined)) {
flg_act = 0;
}
}
}
};
delete wait_start.onEnterFrame;
}
};
}
function init_personnage() {
var _local1 = _root;
nbc_x = (larg_plateau / larg_cube) - 1;
x = int(Math.random() * (nbc_x + 1));
nbc_y = (haut_plateau / haut_cube) - 1;
y = int(Math.random() * (nbc_y + 1));
ping_pos = (x * 100) + y;
_local1.tableau[ping_pos] = 100;
_local1.perso._x = (x * larg_cube) + offset_x;
_local1.perso._y = (y * haut_cube) + offset_y;
new_x = _local1.perso._x;
new_y = _local1.perso._y;
}
function init_cube() {
nb_cube = 1;
_root.createEmptyMovieClip("plateau_mc", 1000);
n = 0;
while (n < Acube1[niveau]) {
pos_cube("pion_1_mc", 1, nb_cube);
nb_cube++;
n++;
}
n = 0;
while (n < Acube3[niveau]) {
pos_cube("pion_3_mc", 3, nb_cube);
nb_cube++;
n++;
}
n = 0;
while (n < Acube4[niveau]) {
pos_cube("pion_4_mc", 4, nb_cube);
nb_cube++;
n++;
}
n = 0;
while (n < Acube5[niveau]) {
pos_cube("pion_5_mc", 5, nb_cube);
nb_cube++;
n++;
}
n = 0;
while (n < Acube6[niveau]) {
pos_cube("pion_6_mc", 6, nb_cube);
nb_cube++;
n++;
}
if ((max_life - nb_life) < Acube7[niveau]) {
nbc7 = max_life - nb_life;
} else {
nbc7 = Acube7[niveau];
}
n = 0;
while (n < nbc7) {
pos_cube("pion_7_mc", 7, nb_cube);
nb_cube++;
n++;
}
}
function pos_cube(type, code, nb_cube) {
var _local1 = _root;
var _local2 = code;
var _local3 = nb_cube;
flag_pos = 0;
while (flag_pos == 0) {
nbc_x = (larg_plateau / larg_cube) - 1;
x = int(Math.random() * (nbc_x + 1));
nbc_y = (haut_plateau / haut_cube) - 1;
y = int(Math.random() * (nbc_y + 1));
pos = (x * 100) + y;
if (_local1.tableau[pos] == undefined) {
name_cube = pos;
_local1.tableau[pos] = _local2;
plateau_mc.attachMovie(type, name_cube, 1000 + _local3);
plateau_mc[name_cube]._x = ((x * larg_cube) + offset_x) + 1;
plateau_mc[name_cube]._y = ((y * haut_cube) + offset_y) + 1;
plateau_mc[name_cube]._width = larg_cube - 4;
plateau_mc[name_cube]._height = haut_cube - 4;
flag_pos = 1;
}
}
}
function init_pion2(nb_pion) {
var _local1 = nb_pion;
var _local2 = _root;
pass = 0;
while (_local1 > 0) {
if (pass == 0) {
nbc_x = (larg_plateau / larg_cube) - 1;
x = int(Math.random() * (nbc_x + 1));
nbc_y = (haut_plateau / haut_cube) - 1;
y = int(Math.random() * (nbc_y + 1));
} else {
nbc_x = (larg_plateau / larg_cube) - 3;
x = int(Math.random() * (nbc_x + 1)) + 1;
nbc_y = (haut_plateau / haut_cube) - 3;
y = int(Math.random() * (nbc_y + 1)) + 1;
}
pos = (x * 100) + y;
if (_local2.tableau[pos] == undefined) {
name_cube = pos;
_local2.tableau[pos] = 2;
plateau_mc.attachMovie("pion_2_mc", name_cube, 6000 + _local1);
plateau_mc[name_cube]._x = (x * larg_cube) + offset_x;
plateau_mc[name_cube]._y = (y * haut_cube) + offset_y;
plateau_mc[name_cube]._width = larg_cube;
plateau_mc[name_cube]._height = haut_cube;
_local1 = _local1 - 1;
pass = 1;
}
}
}
function win(zone) {
var _local1 = _root;
var _local2 = zone;
var _local3 = this;
_local1.perso._alpha = 0;
_local1.flag_stop = false;
plateau_glouton_mc.removeMovieClip();
_local1.time_title_mc.gotoAndStop("bl0");
fps = 0;
flag_pos_win = 0;
max_x = (((larg_plateau / larg_cube) - 1) * larg_cube) + offset_x;
max_y = (((haut_plateau / haut_cube) - 1) * haut_cube) + offset_y;
n = 1;
while (n <= nb_cube_t2) {
x_pion = _local1.plateau_mc[_local2[n]]._x;
y_pion = _local1.plateau_mc[_local2[n]]._y;
if ((x_pion == offset_x) || (x_pion == max_x)) {
flag_pos_win++;
}
if ((y_pion == offset_y) || (y_pion == max_y)) {
flag_pos_win++;
}
plateau_mc[_local2[n]].pion_2_base.gotoAndPlay(80);
n++;
}
_local1.attachMovie("win_mc", "win_mc", 9000);
_local1.win_mc._x = 300 + offset_x;
_local1.win_mc._y = 300 + offset_y;
if (flag_pos_win == 0) {
_local1.score = _local1.score + (1000 * niveau);
_local1.win_mc.win_txt_mc.win_txt.text = ("You win \n" + String(1000 * niveau)) + " pts";
} else if (flag_pos_win == 1) {
_local1.score = _local1.score + (500 * niveau);
_local1.win_mc.win_txt_mc.win_txt.text = ("You win \n" + String(500 * niveau)) + " pts";
} else {
_local1.score = _local1.score + (100 * niveau);
_local1.win_mc.win_txt_mc.win_txt.text = ("You win \n" + String(100 * niveau)) + " pts";
}
_local1.disp_score = String(_local1.score);
_local3.musique("win.mp3");
if (!_local1.flag_demo) {
_local1.niveau = _local1.niveau + 1;
_local1.dniveau = _local1.dniveau + 1;
}
seq_date = new Date();
time = seq_date.getTime();
flag = 0;
_local1.createEmptyMovieClip("win_wait", 72);
_local1.win_wait.onEnterFrame = function () {
var _local1 = _root;
Tdate = new Date();
tmp = Tdate.getTime();
if ((flag == 0) && (tmp > (time + 3500))) {
seq_date = new Date();
time = seq_date.getTime();
this.musique("comptage.mp3", 10000, 0);
flag = 1;
}
if ((flag == 1) && (tmp > (time + 10))) {
_local1.score = _local1.score + 10;
_local1.disp_score = String(_local1.score);
_local1.cache_time._width = _local1.cache_time._width + 1;
_local1.cache_time._x = (_local1.barre_time._x + _local1.barre_time._width) - _local1.cache_time._width;
seq_date = new Date();
time = seq_date.getTime();
if (_local1.cache_time._width >= _local1.barre_time._width) {
flag = 2;
this.musique("");
}
}
if ((flag == 2) && (tmp > (time + 500))) {
seq_date = new Date();
time = seq_date.getTime();
flag = 3;
}
if ((flag == 3) && (tmp > (time + 1000))) {
_local1.win_mc.removeMovieClip();
if (_local1.flag_demo) {
nb_life = 0;
}
start_game(niveau);
delete _local1.win_wait.onEnterFrame;
_local1.win_wait.removeMovieClip();
}
};
}
function wrong() {
var _local1 = _root;
_local1.perso._alpha = 0;
_local1.flag_stop = false;
plateau_glouton_mc.removeMovieClip();
this.musique("Explosion_perso_fin.mp3", 1, 0.5);
fps = 0;
_local1.time_title_mc.gotoAndStop("bl0");
_local1.attachMovie("McExplosion", "Explosion", 10001);
_local1.Explosion._x = (_local1.perso._x + (haut_cube / 2)) + offset_x;
_local1.Explosion._y = (_local1.perso._y + (larg_cube / 2)) + offset_y;
n = 0;
while (n <= tableau.length) {
if (tableau[n] == 2) {
plateau_mc[n].pion_2_base.gotoAndStop(1);
}
n++;
}
_local1.createEmptyMovieClip("wrong_wait", 93);
flag3 = 0;
nb_life = nb_life - 1;
seq_date = new Date();
time = seq_date.getTime() / 1000;
_local1.wrong_wait.onEnterFrame = function () {
var _local1 = _root;
Tdate = new Date();
tmp = Tdate.getTime() / 1000;
if ((tmp > (time + 2)) && (flag3 == 0)) {
_local1.attachMovie("lose_mc", "lose_mc", 5000);
_local1.lose_mc._x = 250 + offset_x;
_local1.lose_mc._y = 300 + offset_y;
_local1.lose_mc.gotoAndPlay("0");
this.musique("wrong.mp3");
flag3 = 1;
}
if ((tmp > (time + 6)) && (flag3 == 1)) {
_local1.lose_mc.removeMovieClip();
start_game(niveau);
delete _local1.wrong_wait.onEnterFrame;
_local1.wrong_wait.removeMovieClip();
}
};
}
function demo_game() {
var _local1 = _root;
_local1.presentation.removeMovieClip();
delete waitgo.onEnterFrame;
delete demo_time.onEnterFrame;
delete wait_start.onEnterFrame;
delete win_wait.onEnterFrame;
delete wrong_wait.onEnterFrame;
_local1.demo_time.removeMovieClip();
_local1.waitgo.removeMovieClip();
_local1.wait_start.removeMovieClip();
_local1.win_wait.removeMovieClip();
_local1.wrong_wait.removeMovieClip();
_local1.game_over_mc.removeMovieClip();
_local1.perso_logo_mc.removeMovieClip();
_local1.info_niveau.removeMovieClip();
_local1.cache_time.removeMovieClip();
_local1.demo_mc.removeMovieClip();
_local1.win_mc.removeMovieClip();
_local1.lose_mc.removeMovieClip();
_local1.disp_life.removeMovieClip();
_local1.plateau_glouton_mc.removeMovieClip();
_local1.plateau_mc.removeMovieClip();
flag_stop = false;
mode_demo();
}
var increment = 10;
var increment_glouton = 14;
var offset_x = 15;
var offset_y = 15;
var larg_plateau = 550;
var haut_plateau = 550;
var larg_cube = 50;
var haut_cube = 50;
var flag_dep = 0;
var score = 0;
var niveau = 1;
var dniveau = niveau;
var nb_cube_t2 = 3;
var nb_life = 0;
var flag_stop = false;
var nb_glouton = 0;
var flag_niv_info = 0;
Stage.scaleMode = "noScale";
game_sound = new Sound();
game_sound.setVolume(100);
var max_life = 5;
_root.debug = false;
MovieClip.prototype.musique = function (idSound, bl, st) {
var _local2 = new Sound();
_local2.stop();
var _local1 = new Sound(this);
_local1.attachSound(idSound);
_local1.start(st, bl);
};
MovieClip.prototype.bip = function (idSound, bl) {
var _local1 = new Sound(this);
_local1.attachSound(idSound);
_local1.start(0, bl);
};
_root.demo_btn.onPress = function () {
demo_game();
};
_root.attachMovie("perso", "perso", 10000);
_root.perso._alpha = 0;
_root.perso._width = larg_cube;
_root.perso._height = haut_cube;
_root.createEmptyMovieClip("grille", 40);
_root.grille.lineStyle(2, 16777215, 5);
n = offset_x;
while (n <= (larg_plateau + offset_x)) {
_root.grille.moveTo(n, offset_y);
_root.grille.lineTo(n, haut_plateau + offset_y);
n = n + larg_cube;
}
n = offset_y;
while (n <= (haut_plateau + offset_y)) {
_root.grille.moveTo(offset_x, n);
_root.grille.lineTo(haut_plateau + offset_x, n);
n = n + haut_cube;
}
Acube1 = new Array(0, 30, 30, 30, 40, 45, 45, 45, 45, 50, 50, 50, 50, 50, 55, 55, 55, 55, 60, 60, 60, 60, 60);
Acube3 = new Array(0, 2, 2, 2, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 6, 6, 6, 6, 6, 6, 6);
Acube4 = new Array(0, 2, 0, 2, 0, 2, 0, 0, 2, 0, 2, 0, 0, 0, 0, 2, 0, 0, 0, 1, 0, 0, 1);
Acube5 = new Array(0, 5, 5, 0, 5, 0, 0, 5, 0, 5, 0, 5, 8, 0, 8, 0, 8, 8, 5, 2, 2, 1, 1);
Acube6 = new Array(0, 1, 2, 0, 2, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 8);
Acube7 = new Array(0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
glouton_array = new Array(0, 1, 1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 4, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6);
qty_glouton_array = new Array(0, 5, 5, 5, 8, 8, 8, 8, 8, 8, 10, 10, 10, 10, 10, 10, 12, 12, 12, 12, 12, 12, 12);
gametime = new Array(0, 120, 120, 100, 100, 100, 100, 100, 100, 80, 80, 80, 80, 60, 60, 60, 60, 60, 50, 50, 50, 50, 40);
Ademo1 = new Array("0|9|0", "1|0|4", "1|0|5", "1|0|6", "4|0|10", "2|1|4", "1|1|6", "1|1|9", "1|2|2", "1|2|3", "1|2|4", "1|2|7", "2|2|9", "1|3|1", "1|3|6", "1|3|10", "5|4|3", "5|4|5", "1|4|7", "1|4|8", "5|5|3", "1|5|4", "1|5|7", "1|5|10", "1|6|2", "1|6|3", "1|6|8", "6|6|9", "1|7|0", "1|7|1", "1|7|4", "5|7|5", "3|7|8", "1|7|9", "1|8|4", "1|8|5", "1|8|6", "1|8|9", "1|9|2", "1|9|3", "2|9|4", "5|9|5", "3|10|1", "4|10|5");
Ademo2 = Array("0|8|9", "6|0|0", "1|0|1", "1|0|4", "1|0|6", "1|0|7", "1|1|3", "2|1|6", "1|1|7", "1|1|10", "5|2|4", "1|2|5", "5|2|9", "1|3|0", "1|3|3", "2|3|4", "1|3|6", "1|3|7", "1|3|8", "3|4|2", "1|4|5", "1|4|7", "1|4|8", "2|5|1", "1|5|10", "1|6|0", "3|6|3", "1|6|4", "4|6|5", "1|6|7", "5|6|8", "5|7|0", "1|7|3", "4|7|5", "1|9|0", "1|9|1", "1|9|2", "1|9|3", "1|9|7", "1|9|8", "1|9|9", "1|9|10", "1|10|1", "5|10|10");
Ademo3 = Array("0|2|10", "7|8|9", "1|0|0", "3|0|2", "3|0|3", "1|0|6", "1|0|7", "1|0|9", "5|0|10", "1|1|0", "5|1|2", "1|1|3", "1|1|4", "2|1|5", "1|1|8", "1|1|9", "1|1|10", "4|2|6", "1|2|8", "4|3|2", "1|3|4", "1|3|6", "1|3|7", "2|4|1", "1|4|4", "1|4|5", "1|4|7", "1|4|9", "1|4|10", "1|5|4", "1|5|5", "6|5|7", "1|6|1", "5|6|3", "1|6|6", "5|6|8", "1|7|0", "1|7|5", "1|8|10", "2|9|2", "1|10|0", "1|10|5", "1|10|6", "1|10|7", "5|10|8");
Ademo4 = Array("0|9|5", "6|0|2", "1|0|3", "1|0|4", "1|0|6", "5|0|10", "3|1|0", "1|1|1", "3|1|2", "1|1|7", "1|1|8", "4|2|5", "1|2|6", "1|2|9", "1|2|10", "1|3|1", "5|3|2", "5|3|3", "1|3|6", "5|5|3", "2|5|4", "1|5|5", "2|5|6", "1|5|10", "1|6|1", "1|6|3", "1|7|2", "5|7|4", "1|7|7", "1|8|0", "1|8|1", "1|8|2", "1|8|4", "1|8|5", "1|8|6", "1|8|7", "1|8|9", "2|9|0", "1|9|2", "4|9|3", "1|9|7", "1|9|9", "1|10|0", "1|10|6");
Ademo5 = Array("0|9|2", "1|0|0", "1|0|3", "1|0|5", "4|0|6", "1|1|1", "5|1|2", "2|1|3", "1|1|4", "1|1|7", "5|2|3", "1|2|5", "4|2|8", "1|2|9", "5|2|10", "5|3|1", "1|3|5", "1|3|6", "1|4|1", "1|4|4", "1|4|8", "1|4|9", "1|5|0", "2|5|4", "1|5|5", "6|5|6", "1|6|0", "1|6|3", "1|6|4", "5|6|7", "1|7|2", "1|7|3", "1|7|8", "1|7|9", "1|8|2", "3|8|4", "1|8|5", "2|8|8", "1|9|8", "1|9|9", "1|10|2", "1|10|5", "3|10|8", "1|10|9");
Ademo6 = Array("0|6|7", "1|0|2", "1|0|3", "2|1|3", "1|1|5", "1|1|7", "1|1|9", "1|2|6", "1|2|9", "4|2|10", "3|3|1", "1|3|2", "1|3|8", "1|3|9", "1|3|10", "1|4|2", "1|4|3", "1|4|6", "4|4|7", "1|4|10", "5|5|0", "1|5|1", "3|5|3", "1|5|5", "2|6|3", "1|6|4", "1|6|5", "1|6|9", "1|7|1", "1|8|0", "2|8|2", "1|8|4", "5|8|7", "6|8|8", "1|9|0", "1|9|2", "1|9|3", "5|9|5", "5|9|6", "5|9|8", "1|9|9", "1|9|10", "1|10|0", "1|10|3");
demo_array = new Array(Ademo1, Ademo2, Ademo3, Ademo4, Ademo5, Ademo6);
_root.attachMovie("presentation", "presentation", 99785);
_root.presentation._x = 12;
_root.presentation._y = 12;
this.musique("attente_game_over.mp3", 1000);
Gdate = new Date();
Gtime = Gdate.getTime();
_root.createEmptyMovieClip("global_game", 8);
_root.global_game.onEnterFrame = function () {
if (_root.flag_stop) {
Tdate = new Date();
Ttime = Tdate.getTime();
if (Ttime >= (Gtime + 50)) {
Gdate = new Date();
Gtime = Gdate.getTime();
_root.cache_time._width = _root.cache_time._width + (_root.inc / 10);
_root.cache_time._x = (_root.barre_time._x + _root.barre_time._width) - _root.cache_time._width;
if (_root.cache_time._width >= _root.barre_time._width) {
fps = 0;
wrong();
}
niv_info = _root.barre_time._width - _root.cache_time._width;
if (((niv_info <= 45) && (niv_info > 30)) && (flag_niv_info != 1)) {
_root.time_title_mc.gotoAndPlay("bl1");
flag_niv_info = 1;
}
if ((niv_info <= 30) && (flag_niv_info != 2)) {
_root.time_title_mc.gotoAndPlay("bl2");
flag_niv_info = 2;
}
if ((niv_info > 45) && (flag_niv_info != 0)) {
_root.time_title_mc.gotoAndPlay("bl0");
flag_niv_info = 0;
}
}
_root.disp_score = String(_root.score);
with (_root.perso) {
px = int(new_x / larg_cube) * 100;
py = int(new_y / haut_cube);
if (_y == new_y) {
if (Key.isDown(39) && (_x >= new_x)) {
if (tableau[(px + 100) + py] == undefined) {
new_x = new_x + larg_cube;
gotoAndStop("droite");
flag_dep = 1;
if (new_x > ((larg_plateau - larg_cube) + offset_x)) {
new_x = (larg_plateau - larg_cube) + offset_x;
flag_dep = 0;
gotoAndStop("dstop");
}
} else if (Key.isDown(32)) {
gotoAndStop("pousse_d");
plateau_mc[(px + 100) + py].gotoAndStop("move_left");
}
}
if (Key.isDown(37) && (_x <= new_x)) {
if (tableau[(px - 100) + py] == undefined) {
new_x = new_x - larg_cube;
flag_dep = 2;
gotoAndStop("gauche");
if (new_x < offset_x) {
new_x = offset_x;
flag_dep = 0;
gotoAndStop("gstop");
}
} else if (Key.isDown(32)) {
gotoAndStop("pousse_g");
plateau_mc[(px - 100) + py].gotoAndStop("move_right");
}
}
}
if (_x == new_x) {
if (Key.isDown(38) && (_y <= new_y)) {
if (tableau[(px + py) - 1] == undefined) {
new_y = new_y - haut_cube;
flag_dep = 3;
gotoAndStop("haut");
if (new_y < offset_y) {
new_y = offset_y;
flag_dep = 0;
gotoAndStop("hautstop");
}
} else if (Key.isDown(32)) {
gotoAndStop("pousse_h");
plateau_mc[(px + py) - 1].gotoAndStop("move_up");
}
}
if (Key.isDown(40) && (_y >= new_y)) {
if (tableau[(px + py) + 1] == undefined) {
new_y = new_y + haut_cube;
flag_dep = 4;
gotoAndStop("bas");
if (new_y > ((haut_plateau - haut_cube) + offset_y)) {
flag_dep = 0;
gotoAndStop("basstop");
new_y = (haut_plateau - haut_cube) + offset_y;
}
} else if (Key.isDown(32)) {
gotoAndStop("pousse_b");
_root.plateau_mc[(px + py) + 1].gotoAndStop("move_down");
}
}
}
incx = larg_cube / increment;
incy = haut_cube / increment;
if (_x < new_x) {
_x = _x + incx;
} else if (_x > new_x) {
_x = _x - incx;
} else if (_y < new_y) {
_y = _y + incy;
} else if (_y > new_y) {
_y = _y - incy;
} else {
if (flag_dep == 1) {
gotoAndStop("dstop");
}
if (flag_dep == 2) {
gotoAndStop("gstop");
}
if (flag_dep == 3) {
gotoAndStop("hautstop");
}
if (flag_dep == 4) {
gotoAndStop("basstop");
}
flag_dep = 0;
}
if (((nb_glouton < glouton_array[niveau]) && (_root.cache_time._width > delais_repos)) && (Qty_glouton > 0)) {
nbc_x = (larg_plateau / larg_cube) - 1;
x = int(Math.random() * (nbc_x + 1));
nbc_y = (haut_plateau / haut_cube) - 1;
y = int(Math.random() * (nbc_y + 1));
pos_tst = (x * 100) + y;
flag_tst_pos = 0;
if (tableau[pos_tst] == 1) {
if ((tableau[pos_tst + 100] == undefined) && ((x + 1) <= nbc_x)) {
flag_tst_pos++;
}
if ((tableau[pos_tst - 100] == undefined) && ((x - 1) >= 0)) {
flag_tst_pos++;
}
if ((tableau[pos_tst + 1] == undefined) && ((y + 1) <= nbc_y)) {
flag_tst_pos++;
}
if ((tableau[pos_tst - 1] == undefined) && ((y - 1) >= 0)) {
flag_tst_pos++;
}
if (flag_tst_pos != 0) {
gx = plateau_mc[pos_tst]._x;
gy = plateau_mc[pos_tst]._y;
plateau_mc[pos_tst]._visible = false;
n = 0;
while (n < glouton_array[niveau]) {
if (!plateau_glouton_mc["gl" + n]) {
num_glouton = n;
}
n++;
}
plateau_glouton_mc.attachMovie("glouton_mc", "gl" + num_glouton, 9001 + num_glouton);
plateau_glouton_mc["gl" + num_glouton]._width = larg_cube - 4;
plateau_glouton_mc["gl" + num_glouton]._height = haut_cube - 4;
plateau_glouton_mc["gl" + num_glouton]._x = gx + 2;
plateau_glouton_mc["gl" + num_glouton]._y = gy + 2;
nb_glouton++;
Qty_glouton--;
delais_repos = (_root.cache_time._width + int(Math.random() * 10)) + 2;
}
}
} else if (nb_glouton >= glouton_array[niveau]) {
delais_repos = (_root.cache_time._width + int(Math.random() * 10)) + 2;
}
}
}
};
Symbol 61 MovieClip [marche] Frame 19
gotoAndPlay ("bas");
Symbol 61 MovieClip [marche] Frame 39
gotoAndPlay ("profil");
Symbol 61 MovieClip [marche] Frame 60
gotoAndPlay ("basdroit");
Symbol 61 MovieClip [marche] Frame 81
gotoAndPlay ("haut");
Symbol 61 MovieClip [marche] Frame 102
gotoAndPlay ("hautdroit");
Symbol 61 MovieClip [marche] Frame 103
_root.flag_mvt = 0;
Symbol 61 MovieClip [marche] Frame 107
_root.flag_mvt = 1;
gotoAndStop ("profilstop");
Symbol 61 MovieClip [marche] Frame 108
_root.flag_mvt = 0;
Symbol 61 MovieClip [marche] Frame 113
_root.flag_mvt = 1;
gotoAndStop ("basdroitstop");
Symbol 61 MovieClip [marche] Frame 114
_root.flag_mvt = 0;
Symbol 61 MovieClip [marche] Frame 119
_root.flag_mvt = 1;
gotoAndStop ("hautdroitstop");
Symbol 62 MovieClip [perso] Frame 1
stop();
perso.gotoAndPlay("bas");
Symbol 62 MovieClip [perso] Frame 2
stop();
perso.gotoAndStop("basstop");
Symbol 62 MovieClip [perso] Frame 3
stop();
perso.gotoAndPlay("profil");
Symbol 62 MovieClip [perso] Frame 4
stop();
perso.gotoAndStop("profilstop");
Symbol 62 MovieClip [perso] Frame 5
stop();
perso.gotoAndPlay("haut");
Symbol 62 MovieClip [perso] Frame 6
stop();
perso.gotoAndStop("hautstop");
Symbol 62 MovieClip [perso] Frame 7
stop();
perso.gotoAndPlay("bas");
Symbol 62 MovieClip [perso] Frame 8
stop();
perso.gotoAndStop("basstop");
Symbol 62 MovieClip [perso] Frame 9
stop();
perso.gotoAndPlay("profil");
Symbol 62 MovieClip [perso] Frame 10
stop();
perso.gotoAndStop("profilstop");
Symbol 62 MovieClip [perso] Frame 11
stop();
perso.gotoAndPlay("haut");
Symbol 62 MovieClip [perso] Frame 12
stop();
perso.gotoAndStop("hautstop");
Symbol 62 MovieClip [perso] Frame 13
stop();
perso.gotoAndPlay("basdroit");
Symbol 62 MovieClip [perso] Frame 14
stop();
perso.gotoAndStop("basdroitstop");
Symbol 62 MovieClip [perso] Frame 15
stop();
perso.gotoAndPlay("hautdroit");
Symbol 62 MovieClip [perso] Frame 16
stop();
perso.gotoAndStop("hautdroitstop");
Symbol 62 MovieClip [perso] Frame 17
stop();
perso.gotoAndPlay("pousse_droite");
Symbol 62 MovieClip [perso] Frame 18
stop();
perso.gotoAndPlay("pousse_droite");
Symbol 62 MovieClip [perso] Frame 19
stop();
perso.gotoAndPlay("pousse_haut");
Symbol 62 MovieClip [perso] Frame 20
stop();
perso.gotoAndPlay("pousse_bas");
Symbol 64 MovieClip [McDebris] Frame 1
Angle = (Math.PI/180) * (Math.random() * 360);
VitesseV = (Math.random() * 8) + 2;
VitesseH = (Math.random() * 15) + 2;
Gravite = 1.2;
Hauteur = (Math.random() * 10) + 10;
Ralentis = 0.95;
Taille = (Math.random() * 100) + 50;
Counter = -3;
Rebond = true;
_xscale = ((this._yscale = Taille));
this.onEnterFrame = function () {
var _local1 = _parent;
var _local3 = this;
Counter++;
var CounterGoal = Math.ceil(5 - (VitesseV / 2));
if (((Counter == CounterGoal) && (VitesseV > 1)) && (Taille >= 100)) {
_local1.attachMovie("MCFumee", "Fumee" + _local1.Depth, _local1.Depth);
var _local2 = "Fumee" + _local1.Depth;
_local1[_local2]._x = _local3._x;
_local1[_local2]._y = _local3._y;
_local1[_local2]._alpha = VitesseV * 10;
_local1[_local2]._xscale = (_local1[_local2]._yscale = VitesseV * 10);
_local1.Depth++;
Counter = 0;
}
_local3._x = _local3._x + (Math.cos(Angle) * VitesseV);
Yadd = Yadd + (Math.sin(Angle) * VitesseV);
_local3._y = (Yadd - Hauteur) * 0.75;
VitesseV = VitesseV * Ralentis;
VitesseH = VitesseH - Gravite;
if ((Hauteur + VitesseH) <= 0) {
if ((Math.abs(VitesseH) > 4) && (Rebond)) {
VitesseH = -(VitesseH * 0.3);
} else {
VitesseH = 0;
Hauteur = 0;
Rebond = false;
}
}
Hauteur = Hauteur + VitesseH;
if (VitesseV < 1) {
_local3._alpha = _local3._alpha - 4;
}
if (_alpha <= 2) {
_local3.removeMovieClip();
}
};
Symbol 66 MovieClip Frame 31
stop();
Symbol 67 MovieClip [McExplosion] Frame 1
Explode_S = new Sound();
Explode_S.attachSound("Exploding");
Explode_S.start();
NbDebris = Math.floor(Math.random() * 6) + 15;
NbBoules = Math.floor(Math.random() * 6) + 10;
Depth = 1;
var i = 1;
while (i <= NbBoules) {
this.attachMovie("McBoule", "Boule" + i, Depth + 1);
with (this["Boule" + i]) {
_rotation = (math.random() * 90) - 45;
_x = (Math.Random() * 30) - 15;
_y = (Math.Random() * 30) - 10;
gotoAndplay(Math.ceil(Math.random() * 20));
}
Depth++;
i++;
}
var i = 1;
while (i <= NbDebris) {
this.attachMovie("McDebris", "Debris" + i, Depth);
Depth++;
i++;
}
Symbol 72 MovieClip [McBoule] Frame 40
this.removeMovieClip();
stop();
Symbol 78 MovieClip [pion_7_base] Frame 5
if (_root.flag_stop) {
gotoAndPlay (1);
} else {
gotoAndPlay (5);
}
Symbol 81 MovieClip [pion_7_mc] Frame 1
function del_glouton() {
var _local1 = _root;
var _local2 = this;
na = 0;
while (na < hit_glouton_array.length) {
_local1.plateau_glouton_mc["hgl" + hit_glouton_array[na]].gotoAndPlay("explosion");
_local1.attachMovie("points__mc", "points__mc" + na, 10001 + na);
_local1["points__mc" + na]._x = _local2._x;
_local1["points__mc" + na]._y = _local2._y;
if ((_local2._x < (_local1.larg_plateau / 2)) && (_local2._y < (_local1.haut_plateau / 2))) {
_local1["points__mc" + na].gotoAndPlay("st1");
} else if ((_local2._x > (_local1.larg_plateau / 2)) && (_local2._y < (_local1.haut_plateau / 2))) {
_local1["points__mc" + na].gotoAndPlay("st2");
} else if ((_local2._x > (_local1.larg_plateau / 2)) && (_local2._y > (_local1.haut_plateau / 2))) {
_local1["points__mc" + na].gotoAndPlay("st3");
} else {
_local1["points__mc" + na].gotoAndPlay("st4");
}
_local1.nb_glouton--;
_local1.score = _local1.score + 900;
na++;
}
hit_glouton_array = new Array();
}
function find_hit() {
var _local1 = _root;
var _local2 = this;
ngl = 0;
while (ngl < _local1.glouton_array[_local1.niveau]) {
if (_local1.plateau_glouton_mc["gl" + ngl]) {
if (_local2.hitTest(_local1.plateau_glouton_mc["gl" + ngl])) {
delete _local1.plateau_glouton_mc["gl" + ngl].onEnterFrame;
_local1.plateau_glouton_mc["gl" + ngl]._name = "hgl" + ngl;
hit_glouton_array[hit_glouton_array.length] = ngl;
}
}
ngl++;
}
}
if (root.debug) {
this._dsp = this._name;
}
num_cube = Number(this._name);
max_x = ((_root.larg_plateau / _root.larg_cube) - 1) * 100;
max_y = _root.haut_plateau / _root.haut_cube;
var hit_glouton_array = new Array();
stop();
Symbol 81 MovieClip [pion_7_mc] Frame 10
if (num_cube >= max_x) {
this.gotoAndPlay("destruction");
} else if (_root.tableau[num_cube + 100] != undefined) {
this.gotoAndPlay("destruction");
} else {
_root.game_sound.attachSound("cube_glisse.mp3");
_root.game_sound.start(0.2, 1);
base = num_cube + 100;
while ((_root.tableau[base] == undefined) && (base < (max_x + 100))) {
base = base + 100;
}
base = base - 100;
dep = (base - num_cube) / 100;
dep = this._x + (dep * _root.larg_cube);
_root.dir_dep = 1;
this.onEnterFrame = function () {
if (this._x < dep) {
this._x = this._x + (_root.larg_cube / 2);
find_hit();
na = 0;
while (na < hit_glouton_array.length) {
if (_root.plateau_glouton_mc["hgl" + hit_glouton_array[na]]) {
with (_root.plateau_glouton_mc["hgl" + hit_glouton_array[na]]) {
_y = this._y + 3;
_x = (this._x + _root.larg_cube) - 5;
if (Math.abs(this._x - dep) <= (_root.larg_cube / 2)) {
_width = 0;
} else {
_width = _root.larg_cube / 2;
}
}
}
na++;
}
} else {
_root.tableau[num_cube] = undefined;
_root.tableau[base] = 7;
this._name = base;
del_glouton();
this.gotoAndPlay("repos");
delete this.onEnterFrame;
}
};
}
stop();
Symbol 81 MovieClip [pion_7_mc] Frame 11
if (num_cube < 100) {
this.gotoAndPlay("destruction");
} else if (_root.tableau[num_cube - 100] != undefined) {
this.gotoAndPlay("destruction");
} else {
_root.game_sound.attachSound("cube_glisse.mp3");
_root.game_sound.start(0.2, 1);
base = num_cube - 100;
while ((_root.tableau[base] == undefined) && (base >= 0)) {
base = base - 100;
}
base = base + 100;
dep = (num_cube - base) / 100;
dep = this._x - (dep * _root.larg_cube);
_root.dir_dep = 2;
this.onEnterFrame = function () {
if (this._x > dep) {
this._x = this._x - (_root.larg_cube / 2);
find_hit();
na = 0;
while (na < hit_glouton_array.length) {
if (_root.plateau_glouton_mc["hgl" + hit_glouton_array[na]]) {
with (_root.plateau_glouton_mc["hgl" + hit_glouton_array[na]]) {
if (Math.abs(this._x - dep) <= (_root.larg_cube / 2)) {
_width = 0;
} else {
_width = _root.larg_cube / 2;
}
_y = this._y + 3;
_x = this._x - _width;
}
}
na++;
}
} else {
_root.tableau[num_cube] = undefined;
_root.tableau[base] = 7;
this._name = base;
del_glouton();
this.gotoAndPlay("repos");
delete this.onEnterFrame;
}
};
}
stop();
Symbol 81 MovieClip [pion_7_mc] Frame 12
cube = String(Number(this._name) + 1);
pos_y = Number(cube.substr(-2));
if (pos_y == 1) {
this.gotoAndPlay("destruction");
} else if (_root.tableau[num_cube - 1] != undefined) {
this.gotoAndPlay("destruction");
} else {
_root.game_sound.attachSound("cube_glisse.mp3");
_root.game_sound.start(0.2, 1);
base = num_cube - 1;
base_y = Number(String(base + 1).substr(-2));
while ((_root.tableau[base] == undefined) && (base_y > 0)) {
base = base - 1;
base_y = Number(String(base + 1).substr(-2));
}
base = base + 1;
dep = num_cube - base;
dep = this._y - (dep * _root.haut_cube);
_root.dir_dep = 4;
this.onEnterFrame = function () {
if (this._y > dep) {
this._y = this._y - (_root.larg_cube / 2);
find_hit();
na = 0;
while (na < hit_glouton_array.length) {
if (_root.plateau_glouton_mc["hgl" + hit_glouton_array[na]]) {
with (_root.plateau_glouton_mc["hgl" + hit_glouton_array[na]]) {
_x = this._x + 3;
_y = (this._y - _root.haut_cube) + 5;
if (Math.abs(this._y - dep) <= (_root.haut_cube / 2)) {
_height = 0;
} else {
_height = _root.haut_cube / 2;
}
}
}
na++;
}
} else {
_root.tableau[num_cube] = undefined;
_root.tableau[base] = 7;
this._name = base;
del_glouton();
this.gotoAndPlay("repos");
delete this.onEnterFrame;
}
};
}
stop();
Symbol 81 MovieClip [pion_7_mc] Frame 13
cube = String(Number(this._name) + 1);
pos_y = Number(cube.substr(-2));
if (pos_y == max_y) {
this.gotoAndPlay("destruction");
} else if (_root.tableau[num_cube + 1] != undefined) {
this.gotoAndPlay("destruction");
} else {
_root.game_sound.attachSound("cube_glisse.mp3");
_root.game_sound.start(0.2, 1);
base = num_cube + 1;
base_y = Number(String(base + 1).substr(-2));
while ((_root.tableau[base] == undefined) && (base_y <= max_y)) {
base = base + 1;
base_y = Number(String(base + 1).substr(-2));
}
base = base - 1;
dep = base - num_cube;
dep = this._y + (dep * _root.haut_cube);
_root.dir_dep = 3;
this.onEnterFrame = function () {
if (this._y < dep) {
this._y = this._y + (_root.larg_cube / 2);
find_hit();
na = 0;
while (na < hit_glouton_array.length) {
if (_root.plateau_glouton_mc["hgl" + hit_glouton_array[na]]) {
with (_root.plateau_glouton_mc["hgl" + hit_glouton_array[na]]) {
_x = this._x + 3;
_y = (this._y + _root.haut_cube) - 5;
if (Math.abs(this._y - dep) <= (_root.haut_cube / 2)) {
_height = 0;
} else {
_height = _root.haut_cube / 2;
}
}
}
na++;
}
} else {
_root.tableau[num_cube] = undefined;
_root.tableau[base] = 7;
this._name = base;
del_glouton();
this.gotoAndPlay("repos");
delete this.onEnterFrame;
}
};
}
stop();
Symbol 81 MovieClip [pion_7_mc] Frame 14
this.play();
Symbol 81 MovieClip [pion_7_mc] Frame 19
num_cube = Number(this._name);
_root.tableau[num_cube] = undefined;
_root.nb_life = _root.nb_life + 1;
_root.flag_vie = 1;
this.bip("vie.mp3");
_root.disp_life.attachMovie("perso_logo_mc", "perso_logo_mc" + _root.nb_life, 10 + _root.nb_life);
_root.disp_life["perso_logo_mc" + _root.nb_life]._x = 598 + (16 * _root.nb_life);
_root.disp_life["perso_logo_mc" + _root.nb_life]._y = 250;
this.removeMovieClip();
stop();
Symbol 85 MovieClip [pion_1_mc] Frame 1
function del_glouton() {
var _local1 = _root;
var _local2 = this;
na = 0;
while (na < hit_glouton_array.length) {
_local1.plateau_glouton_mc["hgl" + hit_glouton_array[na]].gotoAndPlay("explosion");
_local1.attachMovie("points__mc", "points__mc" + na, 10001 + na);
_local1["points__mc" + na]._x = _local2._x;
_local1["points__mc" + na]._y = _local2._y;
if ((_local2._x < (_local1.larg_plateau / 2)) && (_local2._y < (_local1.haut_plateau / 2))) {
_local1["points__mc" + na].gotoAndPlay("st1");
} else if ((_local2._x > (_local1.larg_plateau / 2)) && (_local2._y < (_local1.haut_plateau / 2))) {
_local1["points__mc" + na].gotoAndPlay("st2");
} else if ((_local2._x > (_local1.larg_plateau / 2)) && (_local2._y > (_local1.haut_plateau / 2))) {
_local1["points__mc" + na].gotoAndPlay("st3");
} else {
_local1["points__mc" + na].gotoAndPlay("st4");
}
_local1.nb_glouton--;
_local1.score = _local1.score + 900;
na++;
}
hit_glouton_array = new Array();
}
function find_hit() {
var _local1 = _root;
var _local2 = this;
ngl = 0;
while (ngl < _local1.glouton_array[_local1.niveau]) {
if (_local1.plateau_glouton_mc["gl" + ngl]) {
if (_local2.hitTest(_local1.plateau_glouton_mc["gl" + ngl])) {
delete _local1.plateau_glouton_mc["gl" + ngl].onEnterFrame;
_local1.plateau_glouton_mc["gl" + ngl]._name = "hgl" + ngl;
hit_glouton_array[hit_glouton_array.length] = ngl;
}
}
ngl++;
}
}
if (_root.debug) {
this._dsp = this._name;
}
num_cube = Number(this._name);
max_x = ((_root.larg_plateau / _root.larg_cube) - 1) * 100;
max_y = _root.haut_plateau / _root.haut_cube;
var hit_glouton_array = new Array();
stop();
Symbol 85 MovieClip [pion_1_mc] Frame 10
if (num_cube >= max_x) {
this.gotoAndPlay("destruction");
} else if (_root.tableau[num_cube + 100] != undefined) {
this.gotoAndPlay("destruction");
} else {
_root.game_sound.attachSound("cube_glisse.mp3");
_root.game_sound.start(0.2, 1);
base = num_cube + 100;
while ((_root.tableau[base] == undefined) && (base < (max_x + 100))) {
base = base + 100;
}
base = base - 100;
dep = (base - num_cube) / 100;
dep = this._x + (dep * _root.larg_cube);
_root.dir_dep = 1;
this.onEnterFrame = function () {
if (this._x < dep) {
this._x = this._x + (_root.larg_cube / 2);
find_hit();
na = 0;
while (na < hit_glouton_array.length) {
if (_root.plateau_glouton_mc["hgl" + hit_glouton_array[na]]) {
with (_root.plateau_glouton_mc["hgl" + hit_glouton_array[na]]) {
_y = this._y + 3;
_x = (this._x + _root.larg_cube) - 5;
if (Math.abs(this._x - dep) <= (_root.larg_cube / 2)) {
_width = 0;
} else {
_width = _root.larg_cube / 2;
}
}
}
na++;
}
} else {
_root.tableau[num_cube] = undefined;
_root.tableau[base] = 1;
this._name = base;
del_glouton();
this.gotoAndPlay("repos");
delete this.onEnterFrame;
}
};
}
stop();
Symbol 85 MovieClip [pion_1_mc] Frame 11
if (num_cube < 100) {
this.gotoAndPlay("destruction");
} else if (_root.tableau[num_cube - 100] != undefined) {
this.gotoAndPlay("destruction");
} else {
_root.game_sound.attachSound("cube_glisse.mp3");
_root.game_sound.start(0.2, 1);
base = num_cube - 100;
while ((_root.tableau[base] == undefined) && (base >= 0)) {
base = base - 100;
}
base = base + 100;
dep = (num_cube - base) / 100;
dep = this._x - (dep * _root.larg_cube);
_root.dir_dep = 2;
this.onEnterFrame = function () {
if (this._x > dep) {
this._x = this._x - (_root.larg_cube / 2);
find_hit();
na = 0;
while (na < hit_glouton_array.length) {
if (_root.plateau_glouton_mc["hgl" + hit_glouton_array[na]]) {
with (_root.plateau_glouton_mc["hgl" + hit_glouton_array[na]]) {
if (Math.abs(this._x - dep) <= (_root.larg_cube / 2)) {
_width = 0;
} else {
_width = _root.larg_cube / 2;
}
_y = this._y + 3;
_x = this._x - _width;
}
}
na++;
}
} else {
_root.tableau[num_cube] = undefined;
_root.tableau[base] = 1;
this._name = base;
del_glouton();
this.gotoAndPlay("repos");
delete this.onEnterFrame;
}
};
}
stop();
Symbol 85 MovieClip [pion_1_mc] Frame 12
cube = String(Number(this._name) + 1);
pos_y = Number(cube.substr(-2));
if (pos_y == 1) {
this.gotoAndPlay("destruction");
} else if (_root.tableau[num_cube - 1] != undefined) {
this.gotoAndPlay("destruction");
} else {
_root.game_sound.attachSound("cube_glisse.mp3");
_root.game_sound.start(0.2, 1);
base = num_cube - 1;
base_y = Number(String(base + 1).substr(-2));
while ((_root.tableau[base] == undefined) && (base_y > 0)) {
base = base - 1;
base_y = Number(String(base + 1).substr(-2));
}
base = base + 1;
dep = num_cube - base;
dep = this._y - (dep * _root.haut_cube);
_root.dir_dep = 4;
this.onEnterFrame = function () {
if (this._y > dep) {
this._y = this._y - (_root.larg_cube / 2);
find_hit();
na = 0;
while (na < hit_glouton_array.length) {
if (_root.plateau_glouton_mc["hgl" + hit_glouton_array[na]]) {
with (_root.plateau_glouton_mc["hgl" + hit_glouton_array[na]]) {
_x = this._x + 3;
_y = (this._y - _root.haut_cube) + 5;
if (Math.abs(this._y - dep) <= (_root.haut_cube / 2)) {
_height = 0;
} else {
_height = _root.haut_cube / 2;
}
}
}
na++;
}
} else {
_root.tableau[num_cube] = undefined;
_root.tableau[base] = 1;
this._name = base;
del_glouton();
this.gotoAndPlay("repos");
delete this.onEnterFrame;
}
};
}
stop();
Symbol 85 MovieClip [pion_1_mc] Frame 13
cube = String(Number(this._name) + 1);
pos_y = Number(cube.substr(-2));
if (pos_y == max_y) {
this.gotoAndPlay("destruction");
} else if (_root.tableau[num_cube + 1] != undefined) {
this.gotoAndPlay("destruction");
} else {
_root.game_sound.attachSound("cube_glisse.mp3");
_root.game_sound.start(0.2, 1);
base = num_cube + 1;
base_y = Number(String(base + 1).substr(-2));
while ((_root.tableau[base] == undefined) && (base_y <= max_y)) {
base = base + 1;
base_y = Number(String(base + 1).substr(-2));
}
base = base - 1;
dep = base - num_cube;
dep = this._y + (dep * _root.haut_cube);
_root.dir_dep = 3;
this.onEnterFrame = function () {
if (this._y < dep) {
this._y = this._y + (_root.larg_cube / 2);
find_hit();
na = 0;
while (na < hit_glouton_array.length) {
if (_root.plateau_glouton_mc["hgl" + hit_glouton_array[na]]) {
with (_root.plateau_glouton_mc["hgl" + hit_glouton_array[na]]) {
_x = this._x + 3;
_y = (this._y + _root.haut_cube) - 5;
if (Math.abs(this._y - dep) <= (_root.haut_cube / 2)) {
_height = 0;
} else {
_height = _root.haut_cube / 2;
}
}
}
na++;
}
} else {
_root.tableau[num_cube] = undefined;
_root.tableau[base] = 1;
this._name = base;
del_glouton();
this.gotoAndPlay("repos");
delete this.onEnterFrame;
}
};
}
stop();
Symbol 85 MovieClip [pion_1_mc] Frame 14
_root.game_sound.attachSound("destruction_cube.mp3");
_root.game_sound.start(0.1, 1);
this.play();
Symbol 85 MovieClip [pion_1_mc] Frame 19
num_cube = Number(this._name);
_root.tableau[num_cube] = undefined;
_root.score = _root.score + 100;
this.removeMovieClip();
stop();
Symbol 100 MovieClip [lose_mc] Frame 20
stop();
Symbol 104 MovieClip [win_mc] Frame 1
Symbol 104 MovieClip [win_mc] Frame 30
stop();
Symbol 107 MovieClip [McFumee] Frame 35
this.removeMovieClip();
stop();
Symbol 126 MovieClip [glouton_mc] Frame 1
this.bip("DangerA.wav");
Symbol 126 MovieClip [glouton_mc] Frame 30
_root.plateau_mc[_root.pos_tst]._visible = true;
Symbol 126 MovieClip [glouton_mc] Frame 40
function dispo(pos) {
var _local1 = pos;
Tx = Gpx;
Ty = Gpy;
if (_local1 == 1) {
Tx = Gpx + 100;
} else if (_local1 == 2) {
Tx = Gpx - 100;
} else if (_local1 == 3) {
Ty = Gpy - 1;
test = Glob_pos - 1;
} else if (_local1 == 4) {
Ty = Gpy + 1;
}
if (((((Tx > max_x) || (Tx < 0)) || (Ty > max_y)) || (Ty < 0)) || (_root.tableau[Tx + Ty] != undefined)) {
return(false);
}
return(true);
}
function go(pos) {
var _local1 = pos;
var _local2 = this;
var _local3 = _root;
if (_local1 == 1) {
Gnew_x = Gnew_x + _local3.larg_cube;
_local2.gotoAndStop("droite");
} else if (_local1 == 2) {
Gnew_x = Gnew_x - _local3.larg_cube;
_local2.gotoAndStop("gauche");
} else if (_local1 == 3) {
_local2.gotoAndStop("haut");
Gnew_y = Gnew_y - _local3.haut_cube;
} else if (_local1 == 4) {
Gnew_y = Gnew_y + _local3.haut_cube;
_local2.gotoAndStop("bas");
}
}
var Gincx = 0;
var Gincy = 0;
var Gnew_x = this._x;
var Gnew_y = this._y;
var flag_dep_G = 0;
var new_flag_dep_G = 0;
var cont_or_change = 90;
var nb_cont;
max_x = ((_root.larg_plateau / _root.larg_cube) - 1) * 100;
max_y = (_root.haut_plateau / _root.haut_cube) - 1;
Gincx = _root.larg_cube / _root.increment_glouton;
Gincy = _root.haut_cube / _root.increment_glouton;
GX = int(this._x / _root.larg_cube) * 100;
GY = int(this._y / _root.haut_cube);
G = GX + GY;
pos_dep = 0;
n = 0;
while (n < 20) {
if (pos_dep == 0) {
pdr = int(Math.random() * 3) + 1;
if (((pdr == 1) && (_root.tableau[G + 100] == undefined)) && ((GX + 100) <= max_x)) {
pos_dep = 1;
} else if (((pdr == 2) && (_root.tableau[G - 100] == undefined)) && ((GX - 100) >= 0)) {
pos_dep = 2;
} else if (((pdr == 3) && (_root.tableau[G - 1] == undefined)) && ((GY - 1) >= 0)) {
pos_dep = 3;
} else if (((pdr == 4) && (_root.tableau[G + 1] == undefined)) && ((GY + 1) <= max_y)) {
pos_dep = 4;
}
}
n++;
}
if (((pos_dep == 0) && (_root.tableau[G + 100] == undefined)) && ((GX + 100) <= max_x)) {
pos_dep = 1;
}
if (((pos_dep == 0) && (_root.tableau[G - 100] == undefined)) && ((GX - 100) >= 0)) {
pos_dep = 2;
}
if (((pos_dep == 0) && (_root.tableau[G - 1] == undefined)) && ((GY - 1) >= 0)) {
pos_dep = 3;
}
if (((pos_dep == 0) && (_root.tableau[G + 1] == undefined)) && ((GY + 1) <= max_y)) {
pos_dep = 4;
}
if (pos_dep != 0) {
flag_dep_G = pos_dep;
go(flag_dep_G);
} else {
_root.nb_glouton--;
this.removeMovieClip();
}
this.createEmptyMovieClip("calc_mc", 5002);
this.calc_mc.onEnterFrame = function () {
var _local1 = _root;
x = Math.abs(this._parent._x - Gnew_x);
y = Math.abs(this._parent._y - Gnew_y);
if (((flag_dep_G == 0) || ((x > 0) && (x <= 10))) || ((y > 0) && (y <= 10))) {
Gpx = int(Gnew_x / _local1.larg_cube) * 100;
Gpy = int(Gnew_y / _local1.haut_cube);
if ((_local1.px == Gpx) && (_local1.py == (Gpy - 1))) {
new_flag_dep_G = 3;
} else if ((_local1.px == Gpx) && (_local1.py == (Gpy + 1))) {
new_flag_dep_G = 4;
} else if ((_local1.py == Gpy) && (_local1.px == (Gpx + 100))) {
new_flag_dep_G = 1;
} else if ((_local1.py == Gpy) && (_local1.px == (Gpx - 100))) {
new_flag_dep_G = 2;
} else {
tmp = int(Math.random() * 100);
if (((((flag_dep_G != 0) && (tmp < cont_or_change)) && (dispo(flag_dep_G) == true)) && (nb_cont < 6)) && (flag_dep_G != 0)) {
new_flag_dep_G = flag_dep_G;
nb_cont++;
} else {
nb_cont = 0;
if ((((flag_dep_G == 0) || (flag_dep_G == 1)) || (flag_dep_G == 2)) && ((dispo(3) == true) || (dispo(4) == true))) {
tmp = int(Math.random() * 2) + 3;
if ((tmp == 3) && (dispo(3) == true)) {
new_flag_dep_G = 3;
} else if ((tmp == 4) && (dispo(4) == true)) {
new_flag_dep_G = 4;
} else if (dispo(3) == true) {
new_flag_dep_G = 3;
} else if (dispo(4) == true) {
new_flag_dep_G = 4;
}
} else if ((((flag_dep_G == 0) || (flag_dep_G == 3)) || (flag_dep_G == 4)) && ((dispo(1) == true) || (dispo(2) == true))) {
tmp = int(Math.random() * 2) + 1;
if ((tmp == 1) && (dispo(1) == true)) {
new_flag_dep_G = 1;
} else if ((tmp == 2) && (dispo(2) == true)) {
new_flag_dep_G = 2;
} else if (dispo(1) == true) {
new_flag_dep_G = 1;
} else if (dispo(2) == true) {
new_flag_dep_G = 2;
}
} else if (((flag_dep_G == 0) || (flag_dep_G == 3)) && (dispo(4) == true)) {
new_flag_dep_G = 4;
} else if (((flag_dep_G == 0) || (flag_dep_G == 4)) && (dispo(3) == true)) {
new_flag_dep_G = 3;
} else if (((flag_dep_G == 0) || (flag_dep_G == 1)) && (dispo(2) == true)) {
new_flag_dep_G = 2;
} else if (((flag_dep_G == 0) || (flag_dep_G == 2)) && (dispo(1) == true)) {
new_flag_dep_G = 1;
}
}
}
}
};
this.onEnterFrame = function () {
with (this) {
if (Math.abs(_x - Gnew_x) < 1) {
_x = Gnew_x;
}
if (Math.abs(_y - Gnew_y) < 1) {
_y = Gnew_y;
}
if ((_x == Gnew_x) && (_y == Gnew_y)) {
flag_dep_G = new_flag_dep_G;
new_flag_dep_G = 0;
go(flag_dep_G);
}
if (_x < Gnew_x) {
_x = _x + Gincx;
} else if (_x > Gnew_x) {
_x = _x - Gincx;
} else if (_y < Gnew_y) {
_y = _y + Gincx;
} else if (_y > Gnew_y) {
_y = _y - Gincy;
}
}
if (this.hitTest(_root.perso)) {
_root.wrong();
}
};
stop();
stop();
Symbol 126 MovieClip [glouton_mc] Frame 41
stop();
Symbol 126 MovieClip [glouton_mc] Frame 42
stop();
Symbol 126 MovieClip [glouton_mc] Frame 43
stop();
Symbol 126 MovieClip [glouton_mc] Frame 44
stop();
Symbol 126 MovieClip [glouton_mc] Frame 46
this._width = _root.larg_cube;
this._height = _root.haut_cube;
if (_root.dir_dep == 1) {
this._x = this._x - _root.larg_cube;
}
if (_root.dir_dep == 2) {
}
if (_root.dir_dep == 4) {
this._y = this._y + _root.haut_cube;
}
if (_root.dir_dep == 3) {
this._y = this._y - _root.haut_cube;
}
NbDebris = Math.floor(Math.random() * 4) + 5;
NbBoules = Math.floor(Math.random() * 4) + 5;
Depth = 1;
var i = 1;
while (i <= NbBoules) {
this.attachMovie("McBoule", "Boule" + i, Depth + 1);
with (this["Boule" + i]) {
_rotation = (math.random() * 90) - 45;
_x = (Math.Random() * 30) - 15;
_y = (Math.Random() * 30) - 10;
}
Depth++;
i++;
}
var i = 1;
while (i <= NbDebris) {
this.attachMovie("McDebris", "Debris" + i, Depth);
Depth++;
i++;
}
Symbol 126 MovieClip [glouton_mc] Frame 67
this.removeMovieClip();
Symbol 132 MovieClip [points_5000_mc] Frame 63
this.removeMovieClip();
stop();
Symbol 132 MovieClip [points_5000_mc] Frame 126
this.removeMovieClip();
stop();
Symbol 132 MovieClip [points_5000_mc] Frame 188
this.removeMovieClip();
stop();
Symbol 132 MovieClip [points_5000_mc] Frame 249
this.removeMovieClip();
stop();
Symbol 135 MovieClip [points__mc] Frame 63
this.removeMovieClip();
stop();
Symbol 135 MovieClip [points__mc] Frame 126
this.removeMovieClip();
stop();
Symbol 135 MovieClip [points__mc] Frame 188
this.removeMovieClip();
stop();
Symbol 135 MovieClip [points__mc] Frame 249
this.removeMovieClip();
stop();
Symbol 143 MovieClip [pion_6_mc] Frame 1
function del_glouton() {
var _local1 = _root;
var _local2 = this;
na = 0;
while (na < hit_glouton_array.length) {
_local1.plateau_glouton_mc["hgl" + hit_glouton_array[na]].removeMovieClip();
_local1.attachMovie("points__mc", "points__mc" + na, 10001 + na);
_local1["points__mc" + na]._x = _local2._x;
_local1["points__mc" + na]._y = _local2._y;
if ((_local2._x < (_local1.larg_plateau / 2)) && (_local2._y < (_local1.haut_plateau / 2))) {
_local1["points__mc" + na].gotoAndPlay("st1");
} else if ((_local2._x > (_local1.larg_plateau / 2)) && (_local2._y < (_local1.haut_plateau / 2))) {
_local1["points__mc" + na].gotoAndPlay("st2");
} else if ((_local2._x > (_local1.larg_plateau / 2)) && (_local2._y > (_local1.haut_plateau / 2))) {
_local1["points__mc" + na].gotoAndPlay("st3");
} else {
_local1["points__mc" + na].gotoAndPlay("st4");
}
_local1.nb_glouton--;
_local1.score = _local1.score + 900;
na++;
}
hit_glouton_array = new Array();
}
function find_hit() {
var _local1 = _root;
var _local2 = this;
ngl = 0;
while (ngl < _local1.glouton_array[_local1.niveau]) {
if (_local1.plateau_glouton_mc["gl" + ngl]) {
if (_local2.hitTest(_local1.plateau_glouton_mc["gl" + ngl])) {
delete _local1.plateau_glouton_mc["gl" + ngl].onEnterFrame;
_local1.plateau_glouton_mc["gl" + ngl]._name = "hgl" + ngl;
hit_glouton_array[hit_glouton_array.length] = ngl;
}
}
ngl++;
}
}
if (root.debug) {
this._dsp = this._name;
}
num_cube = Number(this._name);
max_x = ((_root.larg_plateau / _root.larg_cube) - 1) * 100;
max_y = _root.haut_plateau / _root.haut_cube;
stop();
Symbol 143 MovieClip [pion_6_mc] Frame 10
_root.tableau[num_cube] = undefined;
_root.wrong();
this.removeMovieClip();
stop();
Symbol 143 MovieClip [pion_6_mc] Frame 11
_root.tableau[num_cube] = undefined;
_root.wrong();
this.removeMovieClip();
stop();
Symbol 143 MovieClip [pion_6_mc] Frame 12
_root.tableau[num_cube] = undefined;
_root.wrong();
this.removeMovieClip();
stop();
Symbol 143 MovieClip [pion_6_mc] Frame 13
_root.tableau[num_cube] = undefined;
_root.wrong();
this.removeMovieClip();
stop();
Symbol 155 MovieClip [pion_5_mc] Frame 1
function del_glouton() {
var _local1 = _root;
var _local2 = this;
na = 0;
while (na < hit_glouton_array.length) {
_local1.plateau_glouton_mc["hgl" + hit_glouton_array[na]].gotoAndPlay("explosion");
_local1.attachMovie("points__mc", "points__mc" + na, 10001 + na);
_local1["points__mc" + na]._x = _local2._x;
_local1["points__mc" + na]._y = _local2._y;
if ((_local2._x < (_local1.larg_plateau / 2)) && (_local2._y < (_local1.haut_plateau / 2))) {
_local1["points__mc" + na].gotoAndPlay("st1");
} else if ((_local2._x > (_local1.larg_plateau / 2)) && (_local2._y < (_local1.haut_plateau / 2))) {
_local1["points__mc" + na].gotoAndPlay("st2");
} else if ((_local2._x > (_local1.larg_plateau / 2)) && (_local2._y > (_local1.haut_plateau / 2))) {
_local1["points__mc" + na].gotoAndPlay("st3");
} else {
_local1["points__mc" + na].gotoAndPlay("st4");
}
_local1.nb_glouton--;
_local1.score = _local1.score + 900;
na++;
}
hit_glouton_array = new Array();
}
function find_hit() {
var _local1 = _root;
var _local2 = this;
ngl = 0;
while (ngl < _local1.glouton_array[_local1.niveau]) {
if (_local1.plateau_glouton_mc["gl" + ngl]) {
if (_local2.hitTest(_local1.plateau_glouton_mc["gl" + ngl])) {
delete _local1.plateau_glouton_mc["gl" + ngl].onEnterFrame;
_local1.plateau_glouton_mc["gl" + ngl]._name = "hgl" + ngl;
hit_glouton_array[hit_glouton_array.length] = ngl;
}
}
ngl++;
}
}
if (root.debug) {
this._dsp = this._name;
}
num_cube = Number(this._name);
max_x = ((_root.larg_plateau / _root.larg_cube) - 1) * 100;
max_y = _root.haut_plateau / _root.haut_cube;
var hit_glouton_array = new Array();
stop();
Symbol 155 MovieClip [pion_5_mc] Frame 10
if (num_cube >= max_x) {
this.gotoAndPlay("destruction");
} else if (_root.tableau[num_cube + 100] != undefined) {
this.gotoAndPlay("destruction");
} else {
_root.game_sound.attachSound("cube_glisse.mp3");
_root.game_sound.start(0.2, 1);
base = num_cube + 100;
while ((_root.tableau[base] == undefined) && (base < (max_x + 100))) {
base = base + 100;
}
base = base - 100;
dep = (base - num_cube) / 100;
dep = this._x + (dep * _root.larg_cube);
_root.dir_dep = 1;
this.onEnterFrame = function () {
if (this._x < dep) {
this._x = this._x + (_root.larg_cube / 2);
find_hit();
na = 0;
while (na < hit_glouton_array.length) {
if (_root.plateau_glouton_mc["hgl" + hit_glouton_array[na]]) {
with (_root.plateau_glouton_mc["hgl" + hit_glouton_array[na]]) {
_y = this._y + 3;
_x = (this._x + _root.larg_cube) - 5;
if (Math.abs(this._x - dep) <= (_root.larg_cube / 2)) {
_width = 0;
} else {
_width = _root.larg_cube / 2;
}
}
}
na++;
}
} else {
_root.tableau[num_cube] = undefined;
_root.tableau[base] = 5;
this._name = base;
del_glouton();
this.gotoAndPlay("repos");
delete this.onEnterFrame;
}
};
}
stop();
Symbol 155 MovieClip [pion_5_mc] Frame 11
if (num_cube < 100) {
this.gotoAndPlay("destruction");
} else if (_root.tableau[num_cube - 100] != undefined) {
this.gotoAndPlay("destruction");
} else {
_root.game_sound.attachSound("cube_glisse.mp3");
_root.game_sound.start(0.2, 1);
base = num_cube - 100;
while ((_root.tableau[base] == undefined) && (base >= 0)) {
base = base - 100;
}
base = base + 100;
dep = (num_cube - base) / 100;
dep = this._x - (dep * _root.larg_cube);
_root.dir_dep = 2;
this.onEnterFrame = function () {
if (this._x > dep) {
this._x = this._x - (_root.larg_cube / 2);
find_hit();
na = 0;
while (na < hit_glouton_array.length) {
if (_root.plateau_glouton_mc["hgl" + hit_glouton_array[na]]) {
with (_root.plateau_glouton_mc["hgl" + hit_glouton_array[na]]) {
if (Math.abs(this._x - dep) <= (_root.larg_cube / 2)) {
_width = 0;
} else {
_width = _root.larg_cube / 2;
}
_y = this._y + 3;
_x = this._x - _width;
}
}
na++;
}
} else {
_root.tableau[num_cube] = undefined;
_root.tableau[base] = 5;
this._name = base;
del_glouton();
this.gotoAndPlay("repos");
delete this.onEnterFrame;
}
};
}
stop();
Symbol 155 MovieClip [pion_5_mc] Frame 12
cube = String(Number(this._name) + 1);
pos_y = Number(cube.substr(-2));
if (pos_y == 1) {
this.gotoAndPlay("destruction");
} else if (_root.tableau[num_cube - 1] != undefined) {
this.gotoAndPlay("destruction");
} else {
_root.game_sound.attachSound("cube_glisse.mp3");
_root.game_sound.start(0.2, 1);
base = num_cube - 1;
base_y = Number(String(base + 1).substr(-2));
while ((_root.tableau[base] == undefined) && (base_y > 0)) {
base = base - 1;
base_y = Number(String(base + 1).substr(-2));
}
base = base + 1;
dep = num_cube - base;
dep = this._y - (dep * _root.haut_cube);
_root.dir_dep = 4;
this.onEnterFrame = function () {
if (this._y > dep) {
this._y = this._y - (_root.larg_cube / 2);
find_hit();
na = 0;
while (na < hit_glouton_array.length) {
if (_root.plateau_glouton_mc["hgl" + hit_glouton_array[na]]) {
with (_root.plateau_glouton_mc["hgl" + hit_glouton_array[na]]) {
_x = this._x + 3;
_y = (this._y - _root.haut_cube) + 5;
if (Math.abs(this._y - dep) <= (_root.haut_cube / 2)) {
_height = 0;
} else {
_height = _root.haut_cube / 2;
}
}
}
na++;
}
} else {
_root.tableau[num_cube] = undefined;
_root.tableau[base] = 5;
this._name = base;
del_glouton();
this.gotoAndPlay("repos");
delete this.onEnterFrame;
}
};
}
stop();
Symbol 155 MovieClip [pion_5_mc] Frame 13
cube = String(Number(this._name) + 1);
pos_y = Number(cube.substr(-2));
if (pos_y == max_y) {
this.gotoAndPlay("destruction");
} else if (_root.tableau[num_cube + 1] != undefined) {
this.gotoAndPlay("destruction");
} else {
_root.game_sound.attachSound("cube_glisse.mp3");
_root.game_sound.start(0.2, 1);
base = num_cube + 1;
base_y = Number(String(base + 1).substr(-2));
while ((_root.tableau[base] == undefined) && (base_y <= max_y)) {
base = base + 1;
base_y = Number(String(base + 1).substr(-2));
}
base = base - 1;
dep = base - num_cube;
dep = this._y + (dep * _root.haut_cube);
_root.dir_dep = 3;
this.onEnterFrame = function () {
if (this._y < dep) {
this._y = this._y + (_root.larg_cube / 2);
find_hit();
na = 0;
while (na < hit_glouton_array.length) {
if (_root.plateau_glouton_mc["hgl" + hit_glouton_array[na]]) {
with (_root.plateau_glouton_mc["hgl" + hit_glouton_array[na]]) {
_x = this._x + 3;
_y = (this._y + _root.haut_cube) - 5;
if (Math.abs(this._y - dep) <= (_root.haut_cube / 2)) {
_height = 0;
} else {
_height = _root.haut_cube / 2;
}
}
}
na++;
}
} else {
_root.tableau[num_cube] = undefined;
_root.tableau[base] = 5;
this._name = base;
del_glouton();
this.gotoAndPlay("repos");
delete this.onEnterFrame;
}
};
}
stop();
Symbol 155 MovieClip [pion_5_mc] Frame 14
this.play();
Symbol 155 MovieClip [pion_5_mc] Frame 32
num_cube = Number(this._name);
_root.tableau[num_cube] = undefined;
_root.score = _root.score + 110;
if ((_root.cache_time._width - 10) < 0) {
_root.cache_time._width = 0;
} else {
_root.cache_time._width = _root.cache_time._width - 10;
}
_root.delais_repos = (_root.cache_time._width + int(Math.random() * 10)) + 2;
this.removeMovieClip();
stop();
Symbol 160 MovieClip [pion_4_mc] Frame 1
function del_glouton() {
var _local1 = _root;
var _local2 = this;
na = 0;
while (na < hit_glouton_array.length) {
_local1.plateau_glouton_mc["hgl" + hit_glouton_array[na]].gotoAndPlay("explosion");
_local1.attachMovie("points__mc", "points__mc" + na, 10001 + na);
_local1["points__mc" + na]._x = _local2._x;
_local1["points__mc" + na]._y = _local2._y;
if ((_local2._x < (_local1.larg_plateau / 2)) && (_local2._y < (_local1.haut_plateau / 2))) {
_local1["points__mc" + na].gotoAndPlay("st1");
} else if ((_local2._x > (_local1.larg_plateau / 2)) && (_local2._y < (_local1.haut_plateau / 2))) {
_local1["points__mc" + na].gotoAndPlay("st2");
} else if ((_local2._x > (_local1.larg_plateau / 2)) && (_local2._y > (_local1.haut_plateau / 2))) {
_local1["points__mc" + na].gotoAndPlay("st3");
} else {
_local1["points__mc" + na].gotoAndPlay("st4");
}
_local1.nb_glouton--;
_local1.score = _local1.score + 900;
na++;
}
hit_glouton_array = new Array();
}
function find_hit() {
var _local1 = _root;
var _local2 = this;
ngl = 0;
while (ngl < _local1.glouton_array[_local1.niveau]) {
if (_local1.plateau_glouton_mc["gl" + ngl]) {
if (_local2.hitTest(_local1.plateau_glouton_mc["gl" + ngl])) {
delete _local1.plateau_glouton_mc["gl" + ngl].onEnterFrame;
_local1.plateau_glouton_mc["gl" + ngl]._name = "hgl" + ngl;
hit_glouton_array[hit_glouton_array.length] = ngl;
}
}
ngl++;
}
}
if (root.debug) {
this._dsp = this._name;
}
num_cube = Number(this._name);
max_x = ((_root.larg_plateau / _root.larg_cube) - 1) * 100;
max_y = _root.haut_plateau / _root.haut_cube;
var hit_glouton_array = new Array();
stop();
Symbol 160 MovieClip [pion_4_mc] Frame 10
if (num_cube >= max_x) {
this.gotoAndPlay("destruction");
} else if (_root.tableau[num_cube + 100] != undefined) {
this.gotoAndPlay("destruction");
} else {
_root.game_sound.attachSound("cube_glisse.mp3");
_root.game_sound.start(0.2, 1);
base = num_cube + 100;
while ((_root.tableau[base] == undefined) && (base < (max_x + 100))) {
base = base + 100;
}
base = base - 100;
dep = (base - num_cube) / 100;
dep = this._x + (dep * _root.larg_cube);
_root.dir_dep = 1;
this.onEnterFrame = function () {
if (this._x < dep) {
this._x = this._x + (_root.larg_cube / 2);
find_hit();
na = 0;
while (na < hit_glouton_array.length) {
if (_root.plateau_glouton_mc["hgl" + hit_glouton_array[na]]) {
with (_root.plateau_glouton_mc["hgl" + hit_glouton_array[na]]) {
_y = this._y + 3;
_x = (this._x + _root.larg_cube) - 5;
if (Math.abs(this._x - dep) <= (_root.larg_cube / 2)) {
_width = 0;
} else {
_width = _root.larg_cube / 2;
}
}
}
na++;
}
} else {
_root.tableau[num_cube] = undefined;
_root.tableau[base] = 4;
this._name = base;
del_glouton();
this.gotoAndPlay("repos");
delete this.onEnterFrame;
}
};
}
stop();
Symbol 160 MovieClip [pion_4_mc] Frame 11
if (num_cube < 100) {
this.gotoAndPlay("destruction");
} else if (_root.tableau[num_cube - 100] != undefined) {
this.gotoAndPlay("destruction");
} else {
_root.game_sound.attachSound("cube_glisse.mp3");
_root.game_sound.start(0.2, 1);
base = num_cube - 100;
while ((_root.tableau[base] == undefined) && (base >= 0)) {
base = base - 100;
}
base = base + 100;
dep = (num_cube - base) / 100;
dep = this._x - (dep * _root.larg_cube);
_root.dir_dep = 2;
this.onEnterFrame = function () {
if (this._x > dep) {
this._x = this._x - (_root.larg_cube / 2);
find_hit();
na = 0;
while (na < hit_glouton_array.length) {
if (_root.plateau_glouton_mc["hgl" + hit_glouton_array[na]]) {
with (_root.plateau_glouton_mc["hgl" + hit_glouton_array[na]]) {
if (Math.abs(this._x - dep) <= (_root.larg_cube / 2)) {
_width = 0;
} else {
_width = _root.larg_cube / 2;
}
_y = this._y + 3;
_x = this._x - _width;
}
}
na++;
}
} else {
_root.tableau[num_cube] = undefined;
_root.tableau[base] = 4;
this._name = base;
del_glouton();
this.gotoAndPlay("repos");
delete this.onEnterFrame;
}
};
}
stop();
Symbol 160 MovieClip [pion_4_mc] Frame 12
cube = String(Number(this._name) + 1);
pos_y = Number(cube.substr(-2));
if (pos_y == 1) {
this.gotoAndPlay("destruction");
} else if (_root.tableau[num_cube - 1] != undefined) {
this.gotoAndPlay("destruction");
} else {
_root.game_sound.attachSound("cube_glisse.mp3");
_root.game_sound.start(0.2, 1);
base = num_cube - 1;
base_y = Number(String(base + 1).substr(-2));
while ((_root.tableau[base] == undefined) && (base_y > 0)) {
base = base - 1;
base_y = Number(String(base + 1).substr(-2));
}
base = base + 1;
dep = num_cube - base;
dep = this._y - (dep * _root.haut_cube);
_root.dir_dep = 4;
this.onEnterFrame = function () {
if (this._y > dep) {
this._y = this._y - (_root.larg_cube / 2);
find_hit();
na = 0;
while (na < hit_glouton_array.length) {
if (_root.plateau_glouton_mc["hgl" + hit_glouton_array[na]]) {
with (_root.plateau_glouton_mc["hgl" + hit_glouton_array[na]]) {
_x = this._x + 3;
_y = (this._y - _root.haut_cube) + 5;
if (Math.abs(this._y - dep) <= (_root.haut_cube / 2)) {
_height = 0;
} else {
_height = _root.haut_cube / 2;
}
}
}
na++;
}
} else {
_root.tableau[num_cube] = undefined;
_root.tableau[base] = 4;
this._name = base;
del_glouton();
this.gotoAndPlay("repos");
delete this.onEnterFrame;
}
};
}
stop();
Symbol 160 MovieClip [pion_4_mc] Frame 13
cube = String(Number(this._name) + 1);
pos_y = Number(cube.substr(-2));
if (pos_y == max_y) {
this.gotoAndPlay("destruction");
} else if (_root.tableau[num_cube + 1] != undefined) {
this.gotoAndPlay("destruction");
} else {
_root.game_sound.attachSound("cube_glisse.mp3");
_root.game_sound.start(0.2, 1);
base = num_cube + 1;
base_y = Number(String(base + 1).substr(-2));
while ((_root.tableau[base] == undefined) && (base_y <= max_y)) {
base = base + 1;
base_y = Number(String(base + 1).substr(-2));
}
base = base - 1;
dep = base - num_cube;
dep = this._y + (dep * _root.haut_cube);
_root.dir_dep = 3;
this.onEnterFrame = function () {
if (this._y < dep) {
this._y = this._y + (_root.larg_cube / 2);
find_hit();
na = 0;
while (na < hit_glouton_array.length) {
if (_root.plateau_glouton_mc["hgl" + hit_glouton_array[na]]) {
with (_root.plateau_glouton_mc["hgl" + hit_glouton_array[na]]) {
_x = this._x + 3;
_y = (this._y + _root.haut_cube) - 5;
if (Math.abs(this._y - dep) <= (_root.haut_cube / 2)) {
_height = 0;
} else {
_height = _root.haut_cube / 2;
}
}
}
na++;
}
} else {
_root.tableau[num_cube] = undefined;
_root.tableau[base] = 4;
this._name = base;
del_glouton();
this.gotoAndPlay("repos");
delete this.onEnterFrame;
}
};
}
stop();
Symbol 160 MovieClip [pion_4_mc] Frame 14
this.play();
Symbol 160 MovieClip [pion_4_mc] Frame 16
_root.attachMovie("points_5000_mc", "points_5000_mc" + na, 10001 + na);
_root["points_5000_mc" + na]._x = this._x;
_root["points_5000_mc" + na]._y = this._y;
if ((this._x < (_root.larg_plateau / 2)) && (this._y < (_root.haut_plateau / 2))) {
_root["points_5000_mc" + na].gotoAndPlay("st1");
} else if ((this._x > (_root.larg_plateau / 2)) && (this._y < (_root.haut_plateau / 2))) {
_root["points_5000_mc" + na].gotoAndPlay("st2");
} else if ((this._x > (_root.larg_plateau / 2)) && (this._y > (_root.haut_plateau / 2))) {
_root["points_5000_mc" + na].gotoAndPlay("st3");
} else {
_root["points_5000_mc" + na].gotoAndPlay("st4");
}
Symbol 160 MovieClip [pion_4_mc] Frame 21
num_cube = Number(this._name);
_root.tableau[num_cube] = undefined;
_root.score = _root.score + 5000;
this.removeMovieClip();
stop();
Symbol 165 MovieClip [pion_3_mc] Frame 1
if (root.debug) {
this._dsp = this._name;
}
num_cube = Number(this._name);
max_x = ((_root.larg_plateau / _root.larg_cube) - 1) * 100;
max_y = _root.haut_plateau / _root.haut_cube;
stop();
Symbol 165 MovieClip [pion_3_mc] Frame 10
this.gotoAndPlay("repos");
stop();
Symbol 165 MovieClip [pion_3_mc] Frame 11
this.gotoAndPlay("repos");
stop();
Symbol 165 MovieClip [pion_3_mc] Frame 12
this.gotoAndPlay("repos");
stop();
Symbol 165 MovieClip [pion_3_mc] Frame 13
this.gotoAndPlay("repos");
stop();
Symbol 165 MovieClip [pion_3_mc] Frame 14
this.play();
Symbol 165 MovieClip [pion_3_mc] Frame 19
num_cube = Number(this._name);
_root.tableau[num_cube] = undefined;
this.removeMovieClip();
stop();
Symbol 175 MovieClip [pion_2_base] Frame 1
Symbol 175 MovieClip [pion_2_base] Frame 79
this.gotoAndPlay(1);
Symbol 175 MovieClip [pion_2_base] Frame 80
this.play();
Symbol 175 MovieClip [pion_2_base] Frame 87
this.gotoAndPlay(80);
Symbol 177 MovieClip [pion_2_mc] Frame 1
function del_glouton() {
var _local1 = _root;
var _local2 = this;
na = 0;
while (na < hit_glouton_array.length) {
_local1.plateau_glouton_mc["hgl" + hit_glouton_array[na]].gotoAndPlay("explosion");
_local1.attachMovie("points__mc", "points__mc" + na, 10001 + na);
_local1["points__mc" + na]._x = _local2._x;
_local1["points__mc" + na]._y = _local2._y;
if ((_local2._x < (_local1.larg_plateau / 2)) && (_local2._y < (_local1.haut_plateau / 2))) {
_local1["points__mc" + na].gotoAndPlay("st1");
} else if ((_local2._x > (_local1.larg_plateau / 2)) && (_local2._y < (_local1.haut_plateau / 2))) {
_local1["points__mc" + na].gotoAndPlay("st2");
} else if ((_local2._x > (_local1.larg_plateau / 2)) && (_local2._y > (_local1.haut_plateau / 2))) {
_local1["points__mc" + na].gotoAndPlay("st3");
} else {
_local1["points__mc" + na].gotoAndPlay("st4");
}
_local1.nb_glouton--;
_local1.score = _local1.score + 900;
na++;
}
hit_glouton_array = new Array();
}
function find_hit() {
var _local1 = _root;
var _local2 = this;
ngl = 0;
while (ngl < _local1.glouton_array[_local1.niveau]) {
if (_local1.plateau_glouton_mc["gl" + ngl]) {
if (_local2.hitTest(_local1.plateau_glouton_mc["gl" + ngl])) {
delete _local1.plateau_glouton_mc["gl" + ngl].onEnterFrame;
_local1.plateau_glouton_mc["gl" + ngl]._name = "hgl" + ngl;
hit_glouton_array[hit_glouton_array.length] = ngl;
}
}
ngl++;
}
}
if (root.debug) {
this._dsp = this._name;
}
num_cube = Number(this._name);
max_x = ((_root.larg_plateau / _root.larg_cube) - 1) * 100;
max_y = _root.haut_plateau / _root.haut_cube;
var hit_glouton_array = new Array();
var n = (num_cube - (_root.nb_cube_t2 * 100));
var f = 0;
var fw = 0;
var zone = new Array();
m = 1;
while (m <= (_root.nb_cube_t2 * 2)) {
if (_root.tableau[n] == 2) {
if (fw != 1) {
f++;
zone[f] = n;
}
} else if ((f != 0) && (fw == 0)) {
fw = 1;
}
n = n + 100;
m++;
}
if (f == _root.nb_cube_t2) {
_root.win(zone);
} else {
n = num_cube - _root.nb_cube_t2;
f = 0;
fw = 0;
zone = new Array();
m = 1;
while (m <= (_root.nb_cube_t2 * 2)) {
if (_root.tableau[n] == 2) {
if (fw != 1) {
f++;
zone[f] = n;
}
} else if ((f != 0) && (fw == 0)) {
fw = 1;
}
n++;
m++;
}
if (f == _root.nb_cube_t2) {
_root.win(zone);
}
}
stop();
Symbol 177 MovieClip [pion_2_mc] Frame 10
if (num_cube >= max_x) {
} else if (_root.tableau[num_cube + 100] != undefined) {
} else {
_root.game_sound.attachSound("cube_glisse.mp3");
_root.game_sound.start(0.2, 1);
base = num_cube + 100;
while ((_root.tableau[base] == undefined) && (base < (max_x + 100))) {
base = base + 100;
}
base = base - 100;
dep = (base - num_cube) / 100;
dep = this._x + (dep * _root.larg_cube);
_root.dir_dep = 1;
this.onEnterFrame = function () {
if (this._x < dep) {
this._x = this._x + (_root.larg_cube / 2);
find_hit();
na = 0;
while (na < hit_glouton_array.length) {
if (_root.plateau_glouton_mc["hgl" + hit_glouton_array[na]]) {
with (_root.plateau_glouton_mc["hgl" + hit_glouton_array[na]]) {
_y = this._y + 3;
_x = (this._x + _root.larg_cube) - 5;
if (Math.abs(this._x - dep) <= (_root.larg_cube / 2)) {
_width = 0;
} else {
_width = _root.larg_cube / 2;
}
}
}
na++;
}
} else {
type = _root.tableau[num_cube];
_root.tableau[num_cube] = undefined;
_root.tableau[base] = type;
this._name = base;
del_glouton();
this.gotoAndPlay("repos");
delete this.onEnterFrame;
}
};
}
stop();
Symbol 177 MovieClip [pion_2_mc] Frame 11
if (num_cube < 100) {
} else if (_root.tableau[num_cube - 100] != undefined) {
} else {
_root.game_sound.attachSound("cube_glisse.mp3");
_root.game_sound.start(0.2, 1);
base = num_cube - 100;
while ((_root.tableau[base] == undefined) && (base >= 0)) {
base = base - 100;
}
base = base + 100;
dep = (num_cube - base) / 100;
dep = this._x - (dep * _root.larg_cube);
_root.dir_dep = 2;
this.onEnterFrame = function () {
if (this._x > dep) {
this._x = this._x - (_root.larg_cube / 2);
find_hit();
na = 0;
while (na < hit_glouton_array.length) {
if (_root.plateau_glouton_mc["hgl" + hit_glouton_array[na]]) {
with (_root.plateau_glouton_mc["hgl" + hit_glouton_array[na]]) {
if (Math.abs(this._x - dep) <= (_root.larg_cube / 2)) {
_width = 0;
} else {
_width = _root.larg_cube / 2;
}
_y = this._y + 3;
_x = this._x - _width;
}
}
na++;
}
} else {
type = _root.tableau[num_cube];
_root.tableau[num_cube] = undefined;
_root.tableau[base] = type;
this._name = base;
del_glouton();
this.gotoAndPlay("repos");
delete this.onEnterFrame;
}
};
}
stop();
Symbol 177 MovieClip [pion_2_mc] Frame 12
cube = String(Number(this._name) + 1);
pos_y = Number(cube.substr(-2));
if (pos_y == 1) {
} else if (_root.tableau[num_cube - 1] != undefined) {
} else {
_root.game_sound.attachSound("cube_glisse.mp3");
_root.game_sound.start(0.2, 1);
base = num_cube - 1;
base_y = Number(String(base + 1).substr(-2));
while ((_root.tableau[base] == undefined) && (base_y > 0)) {
base = base - 1;
base_y = Number(String(base + 1).substr(-2));
}
base = base + 1;
dep = num_cube - base;
dep = this._y - (dep * _root.haut_cube);
_root.dir_dep = 4;
this.onEnterFrame = function () {
if (this._y > dep) {
this._y = this._y - (_root.larg_cube / 2);
find_hit();
na = 0;
while (na < hit_glouton_array.length) {
if (_root.plateau_glouton_mc["hgl" + hit_glouton_array[na]]) {
with (_root.plateau_glouton_mc["hgl" + hit_glouton_array[na]]) {
_x = this._x + 3;
_y = (this._y - _root.haut_cube) + 5;
if (Math.abs(this._y - dep) <= (_root.haut_cube / 2)) {
_height = 0;
} else {
_height = _root.haut_cube / 2;
}
}
}
na++;
}
} else {
type = _root.tableau[num_cube];
_root.tableau[num_cube] = undefined;
_root.tableau[base] = type;
this._name = base;
del_glouton();
this.gotoAndPlay("repos");
delete this.onEnterFrame;
}
};
}
stop();
Symbol 177 MovieClip [pion_2_mc] Frame 13
cube = String(Number(this._name) + 1);
pos_y = Number(cube.substr(-2));
if (pos_y == max_y) {
} else if (_root.tableau[num_cube + 1] != undefined) {
} else {
_root.game_sound.attachSound("cube_glisse.mp3");
_root.game_sound.start(0.2, 1);
base = num_cube + 1;
base_y = Number(String(base + 1).substr(-2));
while ((_root.tableau[base] == undefined) && (base_y <= max_y)) {
base = base + 1;
base_y = Number(String(base + 1).substr(-2));
}
base = base - 1;
dep = base - num_cube;
dep = this._y + (dep * _root.haut_cube);
_root.dir_dep = 3;
this.onEnterFrame = function () {
if (this._y < dep) {
this._y = this._y + (_root.larg_cube / 2);
find_hit();
na = 0;
while (na < hit_glouton_array.length) {
if (_root.plateau_glouton_mc["hgl" + hit_glouton_array[na]]) {
with (_root.plateau_glouton_mc["hgl" + hit_glouton_array[na]]) {
_x = this._x + 3;
_y = (this._y + _root.haut_cube) - 5;
if (Math.abs(this._y - dep) <= (_root.haut_cube / 2)) {
_height = 0;
} else {
_height = _root.haut_cube / 2;
}
}
}
na++;
}
} else {
type = _root.tableau[num_cube];
_root.tableau[num_cube] = undefined;
_root.tableau[base] = type;
this._name = base;
del_glouton();
this.gotoAndPlay("repos");
delete this.onEnterFrame;
}
};
}
stop();
Symbol 215 MovieClip [presentation] Frame 1
start_btn.onPress = function () {
var _local1 = _root;
_local1.init_var();
_local1.start_game(_local1.niveau);
_this.removeMovieClip();
};
demo_btn.onPress = function () {
_root.demo_game();
_this.removeMovieClip();
};
next_1_btn.onPress = function () {
gotoAndStop (2);
};
next_2_btn.onPress = function () {
gotoAndStop (1);
};
stop();
Symbol 215 MovieClip [presentation] Frame 2
start_btn.onPress = function () {
var _local1 = _root;
_local1.init_var();
_local1.start_game(_local1.niveau);
_this.removeMovieClip();
};
demo_btn.onPress = function () {
_root.demo_game();
_this.removeMovieClip();
};
next_2_btn.onPress = function () {
gotoAndStop (3);
};
stop();
Symbol 215 MovieClip [presentation] Frame 3
start_btn.onPress = function () {
var _local1 = _root;
_local1.init_var();
_local1.start_game(_local1.niveau);
_this.removeMovieClip();
};
demo_btn.onPress = function () {
_root.demo_game();
_this.removeMovieClip();
};
next_3_btn.onPress = function () {
gotoAndStop (1);
};
stop();
Symbol 219 MovieClip [time_title_mc] Frame 1
stop();
Symbol 219 MovieClip [time_title_mc] Frame 41
gotoAndPlay ("bl1");
Symbol 219 MovieClip [time_title_mc] Frame 61
gotoAndPlay ("bl2");