Frame 1
patte._xscale = 300;
patte._yscale = 300;
texte._alpha = 5;
musik = new Sound();
musik.attachSound("musik");
musik.start(0, 1);
_root.onEnterFrame = function () {
if (patte._xscale > 100) {
patte._xscale = patte._xscale - 5;
patte._yscale = patte._yscale - 5;
}
if (texte._alpha < 100) {
texte._alpha = texte._alpha + 3;
}
};
stop();
Frame 2
function init() {
score._x = 428;
scorer._x = 366;
score._y = 885;
scorer._y = 467;
calcul2 = 0;
lance = 0;
lance_cpt = 0;
the_goal1 = 0;
the_goal2 = 0;
the_goal3 = 0;
goal1.gotoAndStop(1);
goal2.gotoAndStop(1);
goal3.gotoAndStop(1);
cols = partie_values[partie][0];
nums = partie_values[partie][1];
coul = partie_values[partie][2];
left = combo_values[partie][0];
combo1_nb = combo_values[partie][1];
qte_combo = combo_values[partie][2];
combo2_nb = combo_values[partie][3];
combo = 0;
combo_cpt = 0;
qte_restante = cols * nums;
next._y = 800;
next._alpha = 100;
replay._y = 800;
replay._alpha = 100;
restarter._y = 800;
restarter._alpha = 100;
gameover._y = 800;
submit._y = 800;
jeu = "Jeu en cours";
total_col = 12;
calcul = 0;
if (debut == 0) {
tab = [];
tab2 = [];
debut = 1;
}
j = 0;
while (j < 18) {
i = 0;
while (i < 12) {
if (tab[i][j] > 0) {
removeMovieClip(_root["-" + tab2[i][j]]);
}
i++;
}
j++;
}
tab = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
tab2 = [["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ""], ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ""], ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ""], ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ""], ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ""], ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ""], ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ""], ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ""], ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ""], ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ""], ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ""], ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ""]];
bille = (nums * cols) / coul;
do {
place_x = random(cols);
place_y = (random(nums) + 18) - nums;
} while (tab[place_x][place_y] > 0);
i = 0;
while (i < bille) {
duplicateMovieClip (rouge, "-rouge" + i, 2 * i);
do {
place_x = random(cols);
place_y = (random(nums) + 18) - nums;
} while (tab[place_x][place_y] > 0);
tab[place_x][place_y] = 1;
tab2[place_x][place_y] = "rouge" + i;
_root["-rouge" + i]._x = place_x * 25;
_root["-rouge" + i]._y = place_y * 25;
duplicateMovieClip (jaune, "-jaune" + i, (2 * i) + 1);
do {
place_x = random(cols);
place_y = (random(nums) + 18) - nums;
} while (tab[place_x][place_y] > 0);
tab[place_x][place_y] = 2;
tab2[place_x][place_y] = "jaune" + i;
_root["-jaune" + i]._x = place_x * 25;
_root["-jaune" + i]._y = place_y * 25;
if (coul > 2) {
duplicateMovieClip (vert, "-vert" + i, 108 + (2 * i));
do {
place_x = random(cols);
place_y = (random(nums) + 18) - nums;
} while (tab[place_x][place_y] > 0);
tab[place_x][place_y] = 3;
tab2[place_x][place_y] = "vert" + i;
_root["-vert" + i]._x = place_x * 25;
_root["-vert" + i]._y = place_y * 25;
if (coul > 3) {
duplicateMovieClip (bleu, "-bleu" + i, (108 + (2 * i)) + 1);
do {
place_x = random(cols);
place_y = (random(nums) + 18) - nums;
} while (tab[place_x][place_y] > 0);
tab[place_x][place_y] = 4;
tab2[place_x][place_y] = "bleu" + i;
_root["-bleu" + i]._x = place_x * 25;
_root["-bleu" + i]._y = place_y * 25;
}
if (coul > 4) {
duplicateMovieClip (rose, "-rose" + i, 216 + (2 * i));
do {
place_x = random(cols);
place_y = (random(nums) + 18) - nums;
} while (tab[place_x][place_y] > 0);
tab[place_x][place_y] = 5;
tab2[place_x][place_y] = "rose" + i;
_root["-rose" + i]._x = place_x * 25;
_root["-rose" + i]._y = place_y * 25;
}
if (coul > 5) {
duplicateMovieClip (orange, "-orange" + i, (216 + (2 * i)) + 1);
do {
place_x = random(cols);
place_y = (random(nums) + 18) - nums;
} while (tab[place_x][place_y] > 0);
tab[place_x][place_y] = 6;
tab2[place_x][place_y] = "orange" + i;
_root["-orange" + i]._x = place_x * 25;
_root["-orange" + i]._y = place_y * 25;
}
}
i++;
}
affiche_score_right(partie, "score_right1", -240);
affiche_score_right(lives, "score_right2", -400);
affiche_score_left(qte_combo, "score_left2", -292);
affiche_score_right(qte_restante, "score_right3", -398);
affiche_score_right(combo, "score_right4", -332);
affiche_score_right(total_col, "score_right5", -265);
affiche_score_left(left, "score_left3", -398);
affiche_score_left(combo1_nb, "score_left4", -332);
affiche_score_left(combo2_nb, "score_left5", -265);
affiche_score_left(thescore, "score", -425);
intro = 1;
partie_old = partie;
lives_old = lives;
qte_combo_old = qte_combo;
qte_restante_old = qte_restante;
combo_old = combo;
total_col_old = total_col;
left_old = left;
combo1_nb_old = combo1_nb;
combo2_nb_old = combo2_nb;
}
intro = 0;
debut = 0;
partie = 1;
thescore = 0;
lives = 3;
mysound = 0;
son = new Sound();
son.attachSound("pickup.wav");
partie_values = [[12, 18, 4], [10, 10, 2], [12, 12, 2], [8, 16, 2], [9, 9, 3], [10, 10, 4], [12, 18, 4], [12, 12, 6], [10, 6, 3], [10, 8, 5], [12, 18, 6]];
combo_values = [[20, 5, 5, 4], [0, 1, 10, 0], [0, 2, 20, 0], [0, 2, 25, 0], [6, 4, 5, 3], [10, 3, 6, 6], [18, 5, 7, 5], [30, 5, 5, 9], [0, 5, 5, 0], [20, 3, 4, 8], [50, 5, 5, 10]];
affiche_score_left = function (score, score_aff, scorey) {
score_string = score.toString();
setx = 0;
sety = 0;
if (intro > 0) {
var i = 0;
while (i < 10) {
var j = 1;
while (j < 6) {
_root[score_aff][("c" + i) + j]._x = setx + (18 * (j - 1));
_root[score_aff][("c" + i) + j]._y = sety;
j++;
}
i++;
}
}
_root[score_aff][("c" + _root.score_string.charAt(0)) + "1"]._y = scorey;
if (score_string.length > 1) {
_root[score_aff][("c" + score_string.charAt(1)) + "2"]._y = scorey;
}
if (score_string.length > 2) {
_root[score_aff][("c" + score_string.charAt(2)) + "3"]._y = scorey;
}
if (score_string.length > 3) {
_root[score_aff][("c" + score_string.charAt(3)) + "4"]._y = scorey;
}
if (score_string.length > 4) {
_root[score_aff][("c" + score_string.charAt(4)) + "5"]._y = scorey;
}
};
affiche_score_right = function (score, score_aff, scorey) {
score_string = score.toString();
setx = 0;
sety = 0;
if (intro > 0) {
var i = 0;
while (i < 10) {
var j = 1;
while (j < 6) {
_root[score_aff][("c" + i) + j]._x = setx + (18 * (j - 1));
_root[score_aff][("c" + i) + j]._y = sety;
j++;
}
i++;
}
}
if (score_string.length == 1) {
_root[score_aff][("c" + score_string.charAt(0)) + "5"]._y = scorey;
}
if (score_string.length == 2) {
_root[score_aff][("c" + score_string.charAt(0)) + "4"]._y = scorey;
_root[score_aff][("c" + score_string.charAt(1)) + "5"]._y = scorey;
}
if (score_string.length == 3) {
_root[score_aff][("c" + score_string.charAt(0)) + "3"]._y = scorey;
_root[score_aff][("c" + score_string.charAt(1)) + "4"]._y = scorey;
_root[score_aff][("c" + score_string.charAt(2)) + "5"]._y = scorey;
}
if (score_string.length == 4) {
_root[score_aff][("c" + score_string.charAt(0)) + "2"]._y = scorey;
_root[score_aff][("c" + score_string.charAt(1)) + "3"]._y = scorey;
_root[score_aff][("c" + score_string.charAt(2)) + "4"]._y = scorey;
_root[score_aff][("c" + score_string.charAt(3)) + "5"]._y = scorey;
}
if (score_string.length == 5) {
_root[score_aff][("c" + score_string.charAt(0)) + "1"]._y = scorey;
_root[score_aff][("c" + score_string.charAt(1)) + "2"]._y = scorey;
_root[score_aff][("c" + score_string.charAt(2)) + "3"]._y = scorey;
_root[score_aff][("c" + score_string.charAt(3)) + "4"]._y = scorey;
_root[score_aff][("c" + score_string.charAt(4)) + "5"]._y = scorey;
}
};
init();
onEnterFrame = function () {
if (lance == 1) {
if (lance_cpt == 3) {
j = 0;
while (j < 18) {
i = 0;
while (i < 12) {
if (tab3[i][j] > 0) {
tab[i][-1] = 0;
tab2[i][-1] = "";
k = j;
while (k > -1) {
if (k > 0) {
_root["-" + tab2[i][k - 1]]._y = _root["-" + tab2[i][k - 1]]._y + 25;
}
tab[i][k] = tab[i][k - 1];
tab2[i][k] = tab2[i][k - 1];
k--;
}
}
i++;
}
j++;
}
refact = 1;
while (refact > 0) {
i = 0;
game_over = 1;
qte_restante = 0;
refact = 0;
do {
ul = 0;
j = 0;
while (j < 18) {
if (tab[i][j] > 0) {
qte_restante++;
if ((((tab[i][j - 1] == tab[i][j]) or (tab[i][j + 1] == tab[i][j])) or (tab[i - 1][j] == tab[i][j])) or (tab[i + 1][j] == tab[i][j])) {
game_over = 0;
}
}
ul = ul + tab[i][j];
j++;
}
if (ul == 0) {
p = i;
while (p < 11) {
q = 0;
while (q < 18) {
_root["-" + tab2[p + 1][q]]._x = _root["-" + tab2[p + 1][q]]._x - 25;
tab[p][q] = tab[p + 1][q];
tab2[p][q] = tab2[p + 1][q];
if (p == 10) {
tab[11][q] = 0;
tab2[11][q] = "";
}
q++;
}
p++;
}
total_col--;
refact = 1;
if (total_col == 0) {
game_over = 2;
refact = 0;
}
}
i++;
} while (i < total_col);
}
if (combo_cpt >= qte_combo) {
combo++;
}
if (qte_restante <= left) {
goal1.gotoAndStop(2);
}
if (combo >= combo1_nb) {
goal2.gotoAndStop(2);
}
if (total_col <= combo2_nb) {
goal3.gotoAndStop(2);
}
if (game_over > 0) {
if ((qte_restante <= left) or (game_over == 2)) {
the_goal1 = 1;
}
if (combo >= combo1_nb) {
the_goal2 = 1;
}
if (total_col <= combo2_nb) {
the_goal3 = 1;
}
if (((the_goal1 == 1) and (the_goal2 == 1)) and (the_goal3 == 1)) {
thescore = thescore + ((Math.ceil((left - qte_restante) / 3) + (combo - combo1_nb)) + (combo2_nb - total_col));
affiche_score_left(thescore, "score", -425);
if (partie == 10) {
thescore = thescore + (lives * 30);
scorer._x = 120;
scorer._y = 220;
score._x = 185;
score._y = score._y - 247;
restarter._y = 260;
submit._y = 330;
stop();
} else {
jeu = "Victoire";
next._y = 180;
}
} else {
jeu = "Perdu";
lives--;
if (lives == 0) {
gameover._y = 120;
submit._y = 190;
restarter._y = 260;
stop();
} else {
replay._y = 180;
}
}
}
lance_cpt = 0;
lance = 0;
if (partie != partie_old) {
affiche_score_right(partie, "score_right1", -240);
}
if (lives != lives_old) {
affiche_score_right(lives, "score_right2", -400);
}
if (qte_combo != qte_combo_old) {
affiche_score_left(qte_combo, "score_left2", -292);
}
if (qte_restante != qte_restante_old) {
affiche_score_right(qte_restante, "score_right3", -398);
}
if (combo != combo_old) {
affiche_score_right(combo, "score_right4", -332);
}
if (total_col != total_col_old) {
affiche_score_right(total_col, "score_right5", -265);
}
if (left != left_old) {
affiche_score_left(left, "score_left3", -398);
}
if (combo1_nb != combo1_nb_old) {
affiche_score_left(combo1_nb, "score_left4", -332);
}
if (combo2_nb != combo2_nb_old) {
affiche_score_left(combo2_nb, "score_left5", -265);
}
partie_old = partie;
lives_old = lives;
qte_combo_old = qte_combo;
qte_restante_old = qte_restante;
combo_old = combo;
total_col_old = total_col;
left_old = left;
combo1_nb_old = combo1_nb;
combo2_nb_old = combo2_nb;
calcul2 = 0;
} else {
lance_cpt++;
}
}
if (((calcul > 0) and (calcul2 == 0)) and ((((tab[cx][cy - 1] == calcul) or (tab[cx][cy + 1] == calcul)) or (tab[cx - 1][cy] == calcul)) or (tab[cx + 1][cy] == calcul))) {
calcul2 = 1;
if (mysound == 0) {
son.start(0);
}
tab3 = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
place_x = [];
place_y = [];
place_x[0] = cx;
place_y[0] = cy;
tab3[cx][cy] = 1;
result = 0;
tabfin = 0;
do {
x = place_x[result];
y = place_y[result];
if ((tab[x][y - 1] == calcul) and (tab3[x][y - 1] == 0)) {
tabfin++;
tab3[x][y - 1] = 1;
place_x[tabfin] = x;
place_y[tabfin] = y - 1;
}
if ((tab[x - 1][y] == calcul) and (tab3[x - 1][y] == 0)) {
tabfin++;
tab3[x - 1][y] = 1;
place_x[tabfin] = x - 1;
place_y[tabfin] = y;
}
if ((tab[x][y + 1] == calcul) and (tab3[x][y + 1] == 0)) {
tabfin++;
tab3[x][y + 1] = 1;
place_x[tabfin] = x;
place_y[tabfin] = y + 1;
}
if ((tab[x + 1][y] == calcul) and (tab3[x + 1][y] == 0)) {
tabfin++;
tab3[x + 1][y] = 1;
place_x[tabfin] = x + 1;
place_y[tabfin] = y;
}
result++;
} while (result < (tabfin + 1));
combo_cpt = 0;
j = 0;
while (j < 18) {
i = 0;
while (i < 12) {
if (tab3[i][j] > 0) {
_root["-" + tab2[i][j]].gotoAndPlay(2);
combo_cpt++;
}
i++;
}
j++;
}
calcul = 0;
}
};
stop();
Instance of Symbol 50 MovieClip "bleu" in Frame 2
on (release) {
_root.name = this._name;
_root.calcul = 4;
_root.cx = this._x / 25;
_root.cy = this._y / 25;
_root.name2 = _root.tab[_root.cx][_root.cy];
}
Instance of Symbol 53 MovieClip "rouge" in Frame 2
on (release) {
_root.name = this._name;
_root.calcul = 1;
_root.cx = this._x / 25;
_root.cy = this._y / 25;
_root.name2 = _root.tab[_root.cx][_root.cy];
}
Instance of Symbol 62 MovieClip "jaune" in Frame 2
on (release) {
_root.name = this._name;
_root.calcul = 2;
_root.cx = this._x / 25;
_root.cy = this._y / 25;
_root.name2 = _root.tab[_root.cx][_root.cy];
}
Instance of Symbol 66 MovieClip "vert" in Frame 2
on (release) {
_root.name = this._name;
_root.calcul = 3;
_root.cx = this._x / 25;
_root.cy = this._y / 25;
_root.name2 = _root.tab[_root.cx][_root.cy];
}
Instance of Symbol 76 MovieClip "orange" in Frame 2
on (release) {
_root.name = this._name;
_root.calcul = 6;
_root.cx = this._x / 25;
_root.cy = this._y / 25;
_root.name2 = _root.tab[_root.cx][_root.cy];
}
Instance of Symbol 80 MovieClip "rose" in Frame 2
on (release) {
_root.name = this._name;
_root.calcul = 5;
_root.cx = this._x / 25;
_root.cy = this._y / 25;
_root.name2 = _root.tab[_root.cx][_root.cy];
}
Symbol 25 Button
on (press) {
_root.nextFrame();
}
on (rollOver) {
_root.starti._alpha = 50;
}
on (rollOut) {
_root.starti._alpha = 100;
}
Symbol 33 Button
on (press) {
_root.urls = "http://www.zodiac-games.com";
getURL (_root.urls);
}
on (rollOver) {
_root.zodiac._alpha = 50;
}
on (rollOut) {
_root.zodiac._alpha = 0;
}
Symbol 50 MovieClip Frame 1
stop();
Symbol 50 MovieClip Frame 10
_root.lance = 1;
removeMovieClip(this);
Symbol 53 MovieClip Frame 1
stop();
Symbol 53 MovieClip Frame 10
_root.lance = 1;
removeMovieClip(this);
Symbol 62 MovieClip Frame 1
stop();
Symbol 62 MovieClip Frame 10
_root.lance = 1;
removeMovieClip(this);
Symbol 66 MovieClip Frame 1
stop();
Symbol 66 MovieClip Frame 10
_root.lance = 1;
removeMovieClip(this);
Symbol 71 Button
on (release) {
if (_root.mysound == 0) {
_root.mysound = 1;
_root.mysound2._y = 700;
} else {
_root.mysound = 0;
_root.mysound2._y = 425;
}
}
Symbol 76 MovieClip Frame 1
stop();
Symbol 76 MovieClip Frame 10
_root.lance = 1;
removeMovieClip(this);
Symbol 80 MovieClip Frame 1
stop();
Symbol 80 MovieClip Frame 10
_root.lance = 1;
removeMovieClip(this);
Symbol 93 MovieClip Frame 1
stop();
Symbol 93 MovieClip Frame 2
stop();
Symbol 121 Button
on (press) {
_root.go_url = "http://www.my-iq.net/index.php?ref=" + _root.test_qi._url;
getURL (_root.go_url);
}
on (rollOver) {
_root.iq._alpha = 50;
}
on (rollOut) {
_root.iq._alpha = 100;
}
Symbol 130 Button
on (press) {
_root.go_url = "http://www.zodiac-games.com";
getURL (_root.go_url);
_root.presse = _root.go_url;
}
on (rollOver) {
_root.zg_logo._alpha = 50;
}
on (rollOut) {
_root.zg_logo._alpha = 100;
}
Symbol 138 Button
on (press) {
_root.partie++;
init();
}
on (rollOver) {
_root.next._alpha = 50;
}
on (rollOut) {
_root.next._alpha = 100;
}
Symbol 146 Button
on (press) {
init();
}
on (rollOver) {
_root.replay._alpha = 50;
}
on (rollOut) {
_root.replay._alpha = 100;
}
Symbol 233 Button
on (press) {
_root.partie = 1;
_root.lives = 3;
_root.thescore = 0;
_root.mysound = 0;
_root.init();
}
on (rollOver) {
_root.restarter._alpha = 50;
}
on (rollOut) {
_root.restarter._alpha = 100;
}
Symbol 241 Button
on (release) {
code1 = ["A", "F", "2", "B", "1", "0", "E", "4", "7", "9"];
code2 = ["9", "7", "5", "3", "A", "B", "1", "0", "E", "D"];
equa1 = (_root.thescore + 10) * 11;
equa2 = (_root.thescore + 11) * 11;
score_string1 = equa1.toString();
score_string2 = equa2.toString();
while (score_string1.length < score_string2.length) {
score_string1 = "0" + score_string1;
}
i = 0;
codage = "";
while (i < score_string2.length) {
pos_string1 = Number(score_string1.charAt(i));
pos_string2 = Number(score_string2.charAt(i));
codage = (codage + code1[pos_string1]) + code2[pos_string2];
i++;
}
_root.url_results = "http://www.zodiac-games.com/index.php?page=10&game=6&result=" + codage;
getURL (_root.url_results);
}
on (rollOver) {
_root.submit._alpha = 75;
}
on (rollOut) {
_root.submit._alpha = 100;
}