[Tools][Expand/Collapse All]Note that automatic extraction of ActionScript 3 is still pretty much unsupported by swfchan. AS1/AS2 works okay most of the time.Frame 1 (772 B)
loup = new Sound();
loup.attachSound("overture");
loup.setvolume(100);
loup.start(0);
thesound = 1;
rotation = new Sound();
rotation.attachSound("rotation");
disparition = new Sound();
disparition.attachSound("disparition");
atterissage = new Sound();
atterissage.attachSound("atterissage");
fin = new Sound();
fin.attachSound("fin");
error = new Sound();
error.attachSound("error");
rotation.setvolume(100);
disparition.setvolume(100);
atterissage.setvolume(100);
error.setvolume(100);
presse = "";
cpt_presse = 0;
_root.onEnterFrame = function () {
if (presse != "") {
cpt_presse++;
if (cpt_presse == 12) {
if (test_qi._url.charAt(0) == "h") {
getURL (_root.presse);
}
presse = "";
cpt_presse = 0;
}
}
};
stop();
Frame 2 (42.14 KiB) ● ● ● ●
duplicateMovieClip (cadre, "cadre2", 3000);
cadre2._x = 104;
cadre2._y = 204;
duplicateMovieClip (test_qi, "test_qi2", 3001);
x0 = 14;
y0 = 14;
cpt = 0;
pos = 1;
pos_x = 4;
pos_y = 0;
nb = 0;
carre = 0;
tableau = ["mauve", "bleu", "jaune", "cyan", "vert", "orange", "rouge", "mauve2", "bleu2", "jaune2", "cyan2", "vert2", "orange2", "rouge2"];
jeu = "ON";
score = 0;
piece = random(14) + 1;
next = random(14) + 1;
switch (piece) {
case 1 :
pos_y = 0;
break;
case 2 :
pos_y = 0;
break;
case 3 :
pos_y = 0;
break;
case 4 :
pos_y = 0;
break;
case 5 :
pos_y = 0;
break;
case 6 :
pos_y = 0;
break;
case 7 :
pos_y = 0;
break;
case 8 :
pos_y = 1;
break;
case 9 :
pos_y = 1;
break;
case 10 :
pos_y = 1;
break;
case 11 :
pos_y = 2;
break;
case 12 :
pos_y = 2;
break;
case 13 :
pos_y = 1;
break;
case 14 :
pos_y = 0;
}
place_next = function () {
switch (next) {
case 1 :
_root[tableau[next - 1]]._x = 273;
_root[tableau[next - 1]]._y = 30;
return;
case 2 :
_root[tableau[next - 1]]._x = 273;
_root[tableau[next - 1]]._y = 30;
return;
case 3 :
_root[tableau[next - 1]]._x = 273;
_root[tableau[next - 1]]._y = 30;
return;
case 4 :
_root[tableau[next - 1]]._x = 273;
_root[tableau[next - 1]]._y = 30;
return;
case 5 :
_root[tableau[next - 1]]._x = 273;
_root[tableau[next - 1]]._y = 30;
return;
case 6 :
_root[tableau[next - 1]]._x = 263;
_root[tableau[next - 1]]._y = 38;
return;
case 7 :
_root[tableau[next - 1]]._x = 263;
_root[tableau[next - 1]]._y = 30;
return;
case 8 :
_root[tableau[next - 1]]._x = 273;
_root[tableau[next - 1]]._y = 38;
return;
case 9 :
_root[tableau[next - 1]]._x = 273;
_root[tableau[next - 1]]._y = 38;
return;
case 10 :
_root[tableau[next - 1]]._x = 273;
_root[tableau[next - 1]]._y = 38;
return;
case 11 :
_root[tableau[next - 1]]._x = 283;
_root[tableau[next - 1]]._y = 58;
return;
case 12 :
_root[tableau[next - 1]]._x = 283;
_root[tableau[next - 1]]._y = 58;
return;
case 13 :
_root[tableau[next - 1]]._x = 273;
_root[tableau[next - 1]]._y = 38;
return;
case 14 :
_root[tableau[next - 1]]._x = 273;
_root[tableau[next - 1]]._y = 30;
}
};
place_next();
duplicateMovieClip (tableau[piece - 1], "test" + nb, 0);
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]];
affiche_score = function () {
score_string = score.toString();
var i = 0;
while (i < 10) {
var j = 1;
while (j < 6) {
_root[("c" + i) + j]._x = 220 + (18 * j);
_root[("c" + i) + j]._y = 480;
j++;
}
i++;
}
scorey = 130;
if (score_string.length == 1) {
_root[("c" + _root.score_string.charAt(0)) + "5"]._y = scorey;
}
if (score_string.length == 2) {
_root[("c" + score_string.charAt(0)) + "4"]._y = scorey;
_root[("c" + score_string.charAt(1)) + "5"]._y = scorey;
}
if (score_string.length == 3) {
_root[("c" + score_string.charAt(0)) + "3"]._y = scorey;
_root[("c" + score_string.charAt(1)) + "4"]._y = scorey;
_root[("c" + score_string.charAt(2)) + "5"]._y = scorey;
}
if (score_string.length == 4) {
_root[("c" + score_string.charAt(0)) + "2"]._y = scorey;
_root[("c" + score_string.charAt(1)) + "3"]._y = scorey;
_root[("c" + score_string.charAt(2)) + "4"]._y = scorey;
_root[("c" + score_string.charAt(3)) + "5"]._y = scorey;
}
if (score_string.length == 5) {
_root[("c" + score_string.charAt(0)) + "1"]._y = scorey;
_root[("c" + score_string.charAt(1)) + "2"]._y = scorey;
_root[("c" + score_string.charAt(2)) + "3"]._y = scorey;
_root[("c" + score_string.charAt(3)) + "4"]._y = scorey;
_root[("c" + score_string.charAt(4)) + "5"]._y = scorey;
}
};
affiche_score();
verif_d = function () {
a = 0;
if (piece == 1) {
switch (pos) {
case 1 :
if ((tab[pos_y][pos_x + 2] == 0) and (tab[pos_y + 1][pos_x + 2] == 0)) {
a = 1;
}
break;
case 2 :
if (((tab[pos_y][pos_x + 1] == 0) and (tab[pos_y + 1][pos_x + 1] == 0)) and (tab[pos_y - 1][pos_x + 1] == 0)) {
a = 1;
}
break;
case 3 :
if ((tab[pos_y][pos_x + 2] == 0) and (tab[pos_y - 1][pos_x] == 0)) {
a = 1;
}
break;
case 4 :
if (!(((tab[pos_y][pos_x + 1] == 0) and (tab[pos_y + 1][pos_x + 1] == 0)) and (tab[pos_y - 1][pos_x + 2] == 0))) {
break;
}
a = 1;
}
}
if (piece == 2) {
switch (pos) {
case 1 :
if ((tab[pos_y][pos_x + 2] == 0) and (tab[pos_y + 1][pos_x] == 0)) {
a = 1;
}
break;
case 2 :
if (((tab[pos_y][pos_x + 1] == 0) and (tab[pos_y + 1][pos_x + 1] == 0)) and (tab[pos_y - 1][pos_x + 1] == 0)) {
a = 1;
}
break;
case 3 :
if ((tab[pos_y][pos_x + 2] == 0) and (tab[pos_y - 1][pos_x + 2] == 0)) {
a = 1;
}
break;
case 4 :
if (!(((tab[pos_y][pos_x + 1] == 0) and (tab[pos_y - 1][pos_x + 1] == 0)) and (tab[pos_y + 1][pos_x + 2] == 0))) {
break;
}
a = 1;
}
}
if (piece == 3) {
switch (pos) {
case 1 :
if ((tab[pos_y][pos_x + 2] == 0) and (tab[pos_y + 1][pos_x + 1] == 0)) {
a = 1;
}
break;
case 2 :
if (((tab[pos_y][pos_x + 1] == 0) and (tab[pos_y - 1][pos_x + 1] == 0)) and (tab[pos_y + 1][pos_x + 1] == 0)) {
a = 1;
}
break;
case 3 :
if ((tab[pos_y][pos_x + 2] == 0) and (tab[pos_y - 1][pos_x + 1] == 0)) {
a = 1;
}
break;
case 4 :
if (!(((tab[pos_y][pos_x + 2] == 0) and (tab[pos_y + 1][pos_x + 1] == 0)) and (tab[pos_y - 1][pos_x + 1] == 0))) {
break;
}
a = 1;
}
}
if (piece == 4) {
switch (pos) {
case 1 :
if ((tab[pos_y][pos_x + 2] == 0) and (tab[pos_y + 1][pos_x + 1] == 0)) {
a = 1;
}
break;
case 2 :
if (!(((tab[pos_y][pos_x + 2] == 0) and (tab[pos_y + 1][pos_x + 2] == 0)) and (tab[pos_y - 1][pos_x + 1] == 0))) {
break;
}
a = 1;
}
}
if (piece == 5) {
switch (pos) {
case 1 :
if ((tab[pos_y][pos_x + 1] == 0) and (tab[pos_y + 1][pos_x + 2] == 0)) {
a = 1;
}
break;
case 2 :
if (!(((tab[pos_y][pos_x + 2] == 0) and (tab[pos_y + 1][pos_x + 1] == 0)) and (tab[pos_y - 1][pos_x + 2] == 0))) {
break;
}
a = 1;
}
}
if (piece == 6) {
switch (pos) {
case 1 :
if (tab[pos_y][pos_x + 3] == 0) {
a = 1;
}
break;
case 2 :
if (!((((tab[pos_y][pos_x + 1] == 0) and (tab[pos_y + 1][pos_x + 1] == 0)) and (tab[pos_y + 2][pos_x + 1] == 0)) and (tab[pos_y - 1][pos_x + 1] == 0))) {
break;
}
a = 1;
}
}
if (piece == 7) {
if ((tab[pos_y][pos_x + 2] == 0) and (tab[pos_y + 1][pos_x + 2] == 0)) {
a = 1;
}
}
if (piece == 8) {
switch (pos) {
case 1 :
if (((tab[pos_y - 1][pos_x] == 0) and (tab[pos_y][pos_x + 2] == 0)) and (tab[pos_y + 1][pos_x + 2] == 0)) {
a = 1;
}
break;
case 2 :
if (!(((tab[pos_y - 1][pos_x + 2] == 0) and (tab[pos_y + 1][pos_x + 1] == 0)) and (tab[pos_y + 1][pos_x + 1] == 0))) {
break;
}
a = 1;
}
}
if (piece == 9) {
switch (pos) {
case 1 :
if (((tab[pos_y - 1][pos_x + 2] == 0) and (tab[pos_y][pos_x + 2] == 0)) and (tab[pos_y + 1][pos_x] == 0)) {
a = 1;
}
break;
case 2 :
if (!(((tab[pos_y - 1][pos_x + 1] == 0) and (tab[pos_y][pos_x + 1] == 0)) and (tab[pos_y + 1][pos_x + 2] == 0))) {
break;
}
a = 1;
}
}
if (piece == 10) {
if (((tab[pos_y - 1][pos_x + 1] == 0) and (tab[pos_y][pos_x + 2] == 0)) and (tab[pos_y + 1][pos_x + 1] == 0)) {
a = 1;
}
}
if (piece == 11) {
switch (pos) {
case 1 :
if (((tab[pos_y - 2][pos_x + 1] == 0) and (tab[pos_y - 1][pos_x + 1] == 0)) and (tab[pos_y][pos_x + 1] == 0)) {
a = 1;
}
break;
case 2 :
if ((tab[pos_y - 1][pos_x + 1] == 0) and (tab[pos_y][pos_x + 1] == 0)) {
a = 1;
}
break;
case 3 :
if (((tab[pos_y - 1][pos_x + 1] == 0) and (tab[pos_y][pos_x + 1] == 0)) and (tab[pos_y + 1][pos_x] == 0)) {
a = 1;
}
break;
case 4 :
if (!((tab[pos_y - 1][pos_x + 1] == 0) and (tab[pos_y][pos_x + 2] == 0))) {
break;
}
a = 1;
}
}
if (piece == 12) {
switch (pos) {
case 1 :
if (((tab[pos_y - 2][pos_x] == 0) and (tab[pos_y - 1][pos_x + 1] == 0)) and (tab[pos_y][pos_x + 1] == 0)) {
a = 1;
}
break;
case 2 :
if ((tab[pos_y - 1][pos_x + 1] == 0) and (tab[pos_y][pos_x + 1] == 0)) {
a = 1;
}
break;
case 3 :
if (((tab[pos_y - 1][pos_x + 1] == 0) and (tab[pos_y][pos_x + 1] == 0)) and (tab[pos_y + 1][pos_x + 1] == 0)) {
a = 1;
}
break;
case 4 :
if (!((tab[pos_y - 1][pos_x + 2] == 0) and (tab[pos_y][pos_x + 1] == 0))) {
break;
}
a = 1;
}
}
if (piece == 13) {
switch (pos) {
case 1 :
if (((tab[pos_y - 1][pos_x + 2] == 0) and (tab[pos_y][pos_x + 2] == 0)) and (tab[pos_y + 1][pos_x + 1] == 0)) {
a = 1;
}
break;
case 2 :
if (((tab[pos_y - 1][pos_x] == 0) and (tab[pos_y][pos_x + 1] == 0)) and (tab[pos_y + 1][pos_x + 2] == 0)) {
a = 1;
}
break;
case 3 :
if (((tab[pos_y - 1][pos_x + 2] == 0) and (tab[pos_y][pos_x + 1] == 0)) and (tab[pos_y + 1][pos_x] == 0)) {
a = 1;
}
break;
case 4 :
if (!(((tab[pos_y - 1][pos_x + 1] == 0) and (tab[pos_y][pos_x + 2] == 0)) and (tab[pos_y + 1][pos_x + 2] == 0))) {
break;
}
a = 1;
}
}
if (piece == 14) {
switch (pos) {
case 1 :
if ((tab[pos_y][pos_x + 2] == 0) and (tab[pos_y + 1][pos_x + 2] == 0)) {
a = 1;
}
break;
case 2 :
if (((tab[pos_y - 1][pos_x + 1] == 0) and (tab[pos_y][pos_x + 1] == 0)) and (tab[pos_y + 1][pos_x + 1] == 0)) {
a = 1;
}
break;
case 3 :
if ((tab[pos_y - 1][pos_x + 2] == 0) and (tab[pos_y][pos_x + 2] == 0)) {
a = 1;
}
break;
case 4 :
if (!(((tab[pos_y - 1][pos_x + 2] == 0) and (tab[pos_y][pos_x + 1] == 0)) and (tab[pos_y + 1][pos_x + 2] == 0))) {
break;
}
a = 1;
}
}
if (a == 1) {
return(true);
}
return(false);
};
verif_g = function () {
a = 0;
if (piece == 1) {
switch (pos) {
case 1 :
if ((tab[pos_y][pos_x - 2] == 0) and (tab[pos_y + 1][pos_x] == 0)) {
a = 1;
}
break;
case 2 :
if (((tab[pos_y][pos_x - 1] == 0) and (tab[pos_y + 1][pos_x - 2] == 0)) and (tab[pos_y - 1][pos_x - 1] == 0)) {
a = 1;
}
break;
case 3 :
if ((tab[pos_y][pos_x - 2] == 0) and (tab[pos_y - 1][pos_x - 2] == 0)) {
a = 1;
}
break;
case 4 :
if (!(((tab[pos_y][pos_x - 1] == 0) and (tab[pos_y + 1][pos_x - 1] == 0)) and (tab[pos_y - 1][pos_x - 1] == 0))) {
break;
}
a = 1;
}
}
if (piece == 2) {
switch (pos) {
case 1 :
if ((tab[pos_y][pos_x - 2] == 0) and (tab[pos_y + 1][pos_x - 2] == 0)) {
a = 1;
}
break;
case 2 :
if (((tab[pos_y][pos_x - 1] == 0) and (tab[pos_y + 1][pos_x - 1] == 0)) and (tab[pos_y - 1][pos_x - 2] == 0)) {
a = 1;
}
break;
case 3 :
if ((tab[pos_y][pos_x - 2] == 0) and (tab[pos_y - 1][pos_x] == 0)) {
a = 1;
}
break;
case 4 :
if (!(((tab[pos_y][pos_x - 1] == 0) and (tab[pos_y + 1][pos_x - 1] == 0)) and (tab[pos_y - 1][pos_x - 1] == 0))) {
break;
}
a = 1;
}
}
if (piece == 3) {
switch (pos) {
case 1 :
if ((tab[pos_y][pos_x - 2] == 0) and (tab[pos_y + 1][pos_x - 1] == 0)) {
a = 1;
}
break;
case 2 :
if (((tab[pos_y][pos_x - 2] == 0) and (tab[pos_y + 1][pos_x - 1] == 0)) and (tab[pos_y - 1][pos_x - 1] == 0)) {
a = 1;
}
break;
case 3 :
if ((tab[pos_y][pos_x - 2] == 0) and (tab[pos_y - 1][pos_x - 1] == 0)) {
a = 1;
}
break;
case 4 :
if (!(((tab[pos_y][pos_x - 1] == 0) and (tab[pos_y + 1][pos_x - 1] == 0)) and (tab[pos_y - 1][pos_x - 1] == 0))) {
break;
}
a = 1;
}
}
if (piece == 4) {
switch (pos) {
case 1 :
if ((tab[pos_y][pos_x - 1] == 0) and (tab[pos_y + 1][pos_x - 2] == 0)) {
a = 1;
}
break;
case 2 :
if (!(((tab[pos_y][pos_x - 1] == 0) and (tab[pos_y + 1][pos_x] == 0)) and (tab[pos_y - 1][pos_x - 1] == 0))) {
break;
}
a = 1;
}
}
if (piece == 5) {
switch (pos) {
case 1 :
if ((tab[pos_y][pos_x - 2] == 0) and (tab[pos_y + 1][pos_x - 1] == 0)) {
a = 1;
}
break;
case 2 :
if (!(((tab[pos_y][pos_x - 1] == 0) and (tab[pos_y + 1][pos_x - 1] == 0)) and (tab[pos_y - 1][pos_x] == 0))) {
break;
}
a = 1;
}
}
if (piece == 6) {
switch (pos) {
case 1 :
if (tab[pos_y][pos_x - 2] == 0) {
a = 1;
}
break;
case 2 :
if (!((((tab[pos_y][pos_x - 1] == 0) and (tab[pos_y + 1][pos_x - 1] == 0)) and (tab[pos_y + 2][pos_x - 1] == 0)) and (tab[pos_y - 1][pos_x - 1] == 0))) {
break;
}
a = 1;
}
}
if (piece == 7) {
if ((tab[pos_y][pos_x - 1] == 0) and (tab[pos_y + 1][pos_x - 1] == 0)) {
a = 1;
}
}
if (piece == 8) {
switch (pos) {
case 1 :
if (((tab[pos_y - 1][pos_x - 2] == 0) and (tab[pos_y][pos_x - 2] == 0)) and (tab[pos_y + 1][pos_x] == 0)) {
a = 1;
}
break;
case 2 :
if (!(((tab[pos_y - 1][pos_x - 1] == 0) and (tab[pos_y + 1][pos_x - 1] == 0)) and (tab[pos_y + 1][pos_x - 2] == 0))) {
break;
}
a = 1;
}
}
if (piece == 9) {
switch (pos) {
case 1 :
if (((tab[pos_y - 1][pos_x] == 0) and (tab[pos_y][pos_x - 2] == 0)) and (tab[pos_y + 1][pos_x - 2] == 0)) {
a = 1;
}
break;
case 2 :
if (!(((tab[pos_y - 1][pos_x - 2] == 0) and (tab[pos_y][pos_x - 1] == 0)) and (tab[pos_y + 1][pos_x - 1] == 0))) {
break;
}
a = 1;
}
}
if (piece == 10) {
if (((tab[pos_y - 1][pos_x - 1] == 0) and (tab[pos_y][pos_x - 2] == 0)) and (tab[pos_y + 1][pos_x - 1] == 0)) {
a = 1;
}
}
if (piece == 11) {
switch (pos) {
case 1 :
if (((tab[pos_y - 2][pos_x - 1] == 0) and (tab[pos_y - 1][pos_x - 2] == 0)) and (tab[pos_y][pos_x - 2] == 0)) {
a = 1;
}
break;
case 2 :
if ((tab[pos_y - 1][pos_x - 3] == 0) and (tab[pos_y][pos_x - 2] == 0)) {
a = 1;
}
break;
case 3 :
if (((tab[pos_y - 1][pos_x - 2] == 0) and (tab[pos_y][pos_x - 2] == 0)) and (tab[pos_y + 1][pos_x - 2] == 0)) {
a = 1;
}
break;
case 4 :
if (!((tab[pos_y - 1][pos_x - 2] == 0) and (tab[pos_y][pos_x - 2] == 0))) {
break;
}
a = 1;
}
}
if (piece == 12) {
switch (pos) {
case 1 :
if (((tab[pos_y - 2][pos_x - 2] == 0) and (tab[pos_y - 1][pos_x - 2] == 0)) and (tab[pos_y][pos_x - 2] == 0)) {
a = 1;
}
break;
case 2 :
if ((tab[pos_y - 1][pos_x - 2] == 0) and (tab[pos_y][pos_x - 3] == 0)) {
a = 1;
}
break;
case 3 :
if (((tab[pos_y - 1][pos_x - 2] == 0) and (tab[pos_y][pos_x - 2] == 0)) and (tab[pos_y + 1][pos_x - 1] == 0)) {
a = 1;
}
break;
case 4 :
if (!((tab[pos_y - 1][pos_x - 2] == 0) and (tab[pos_y][pos_x - 2] == 0))) {
break;
}
a = 1;
}
}
if (piece == 13) {
switch (pos) {
case 1 :
if (((tab[pos_y - 1][pos_x] == 0) and (tab[pos_y][pos_x - 1] == 0)) and (tab[pos_y + 1][pos_x - 2] == 0)) {
a = 1;
}
break;
case 2 :
if (((tab[pos_y - 1][pos_x - 2] == 0) and (tab[pos_y][pos_x - 2] == 0)) and (tab[pos_y + 1][pos_x - 1] == 0)) {
a = 1;
}
break;
case 3 :
if (((tab[pos_y - 1][pos_x - 1] == 0) and (tab[pos_y][pos_x - 2] == 0)) and (tab[pos_y + 1][pos_x - 2] == 0)) {
a = 1;
}
break;
case 4 :
if (!(((tab[pos_y - 1][pos_x - 2] == 0) and (tab[pos_y][pos_x - 1] == 0)) and (tab[pos_y + 1][pos_x] == 0))) {
break;
}
a = 1;
}
}
if (piece == 14) {
switch (pos) {
case 1 :
if ((tab[pos_y][pos_x - 2] == 0) and (tab[pos_y + 1][pos_x - 2] == 0)) {
a = 1;
}
break;
case 2 :
if (((tab[pos_y - 1][pos_x - 2] == 0) and (tab[pos_y][pos_x - 1] == 0)) and (tab[pos_y + 1][pos_x - 2] == 0)) {
a = 1;
}
break;
case 3 :
if ((tab[pos_y - 1][pos_x - 2] == 0) and (tab[pos_y][pos_x - 2] == 0)) {
a = 1;
}
break;
case 4 :
if (!(((tab[pos_y - 1][pos_x - 1] == 0) and (tab[pos_y][pos_x - 1] == 0)) and (tab[pos_y + 1][pos_x - 1] == 0))) {
break;
}
a = 1;
}
}
if (a == 1) {
return(true);
}
return(false);
};
verif_b = function () {
a = 0;
if (piece == 1) {
switch (pos) {
case 1 :
if (((tab[pos_y + 1][pos_x] == 0) and (tab[pos_y + 1][pos_x - 1] == 0)) and (tab[pos_y + 2][pos_x + 1] == 0)) {
a = 1;
}
break;
case 2 :
if ((tab[pos_y + 2][pos_x] == 0) and (tab[pos_y + 2][pos_x - 1] == 0)) {
a = 1;
}
break;
case 3 :
if (((tab[pos_y + 1][pos_x] == 0) and (tab[pos_y + 1][pos_x - 1] == 0)) and (tab[pos_y + 1][pos_x + 1] == 0)) {
a = 1;
}
break;
case 4 :
if (!((tab[pos_y + 2][pos_x] == 0) and (tab[pos_y][pos_x + 1] == 0))) {
break;
}
a = 1;
}
}
if (piece == 2) {
switch (pos) {
case 1 :
if (((tab[pos_y + 1][pos_x] == 0) and (tab[pos_y + 2][pos_x - 1] == 0)) and (tab[pos_y + 1][pos_x + 1] == 0)) {
a = 1;
}
break;
case 2 :
if ((tab[pos_y + 2][pos_x] == 0) and (tab[pos_y][pos_x - 1] == 0)) {
a = 1;
}
break;
case 3 :
if (((tab[pos_y + 1][pos_x] == 0) and (tab[pos_y + 1][pos_x - 1] == 0)) and (tab[pos_y + 1][pos_x + 1] == 0)) {
a = 1;
}
break;
case 4 :
if (!((tab[pos_y + 2][pos_x] == 0) and (tab[pos_y + 2][pos_x + 1] == 0))) {
break;
}
a = 1;
}
}
if (piece == 3) {
switch (pos) {
case 1 :
if (((tab[pos_y + 2][pos_x] == 0) and (tab[pos_y + 1][pos_x - 1] == 0)) and (tab[pos_y + 1][pos_x + 1] == 0)) {
a = 1;
}
break;
case 2 :
if ((tab[pos_y + 2][pos_x] == 0) and (tab[pos_y + 1][pos_x - 1] == 0)) {
a = 1;
}
break;
case 3 :
if (((tab[pos_y + 1][pos_x] == 0) and (tab[pos_y + 1][pos_x - 1] == 0)) and (tab[pos_y + 1][pos_x + 1] == 0)) {
a = 1;
}
break;
case 4 :
if (!((tab[pos_y + 2][pos_x] == 0) and (tab[pos_y + 1][pos_x + 1] == 0))) {
break;
}
a = 1;
}
}
if (piece == 4) {
switch (pos) {
case 1 :
if (((tab[pos_y + 2][pos_x] == 0) and (tab[pos_y + 2][pos_x - 1] == 0)) and (tab[pos_y + 1][pos_x + 1] == 0)) {
a = 1;
}
break;
case 2 :
if (!((tab[pos_y + 1][pos_x] == 0) and (tab[pos_y + 2][pos_x + 1] == 0))) {
break;
}
a = 1;
}
}
if (piece == 5) {
switch (pos) {
case 1 :
if (((tab[pos_y + 2][pos_x] == 0) and (tab[pos_y + 1][pos_x - 1] == 0)) and (tab[pos_y + 2][pos_x + 1] == 0)) {
a = 1;
}
break;
case 2 :
if (!((tab[pos_y + 2][pos_x] == 0) and (tab[pos_y + 1][pos_x + 1] == 0))) {
break;
}
a = 1;
}
}
if (piece == 6) {
switch (pos) {
case 1 :
if ((((tab[pos_y + 1][pos_x] == 0) and (tab[pos_y + 1][pos_x + 1] == 0)) and (tab[pos_y + 1][pos_x + 2] == 0)) and (tab[pos_y + 1][pos_x - 1] == 0)) {
a = 1;
}
break;
case 2 :
if (tab[pos_y + 3][pos_x] != 0) {
break;
}
a = 1;
}
}
if (piece == 7) {
if ((tab[pos_y + 2][pos_x] == 0) and (tab[pos_y + 2][pos_x + 1] == 0)) {
a = 1;
}
}
if (piece == 8) {
switch (pos) {
case 1 :
if (((tab[pos_y + 1][pos_x - 1] == 0) and (tab[pos_y + 1][pos_x] == 0)) and (tab[pos_y + 2][pos_x + 1] == 0)) {
a = 1;
}
break;
case 2 :
if (!(((tab[pos_y + 2][pos_x - 1] == 0) and (tab[pos_y + 2][pos_x] == 0)) and (tab[pos_y][pos_x + 1] == 0))) {
break;
}
a = 1;
}
}
if (piece == 9) {
switch (pos) {
case 1 :
if (((tab[pos_y + 2][pos_x - 1] == 0) and (tab[pos_y + 1][pos_x] == 0)) and (tab[pos_y + 1][pos_x + 1] == 0)) {
a = 1;
}
break;
case 2 :
if (!(((tab[pos_y][pos_x - 1] == 0) and (tab[pos_y + 2][pos_x] == 0)) and (tab[pos_y + 2][pos_x + 1] == 0))) {
break;
}
a = 1;
}
}
if (piece == 10) {
if (((tab[pos_y + 1][pos_x - 1] == 0) and (tab[pos_y + 2][pos_x] == 0)) and (tab[pos_y + 1][pos_x + 1] == 0)) {
a = 1;
}
}
if (piece == 11) {
switch (pos) {
case 1 :
if ((tab[pos_y + 1][pos_x - 1] == 0) and (tab[pos_y + 1][pos_x] == 0)) {
a = 1;
}
break;
case 2 :
if (((tab[pos_y][pos_x - 2] == 0) and (tab[pos_y + 1][pos_x - 1] == 0)) and (tab[pos_y + 1][pos_x] == 0)) {
a = 1;
}
break;
case 3 :
if ((tab[pos_y + 2][pos_x - 1] == 0) and (tab[pos_y + 1][pos_x] == 0)) {
a = 1;
}
break;
case 4 :
if (!(((tab[pos_y + 1][pos_x - 1] == 0) and (tab[pos_y + 1][pos_x] == 0)) and (tab[pos_y + 1][pos_x + 1] == 0))) {
break;
}
a = 1;
}
}
if (piece == 12) {
switch (pos) {
case 1 :
if ((tab[pos_y + 1][pos_x - 1] == 0) and (tab[pos_y + 1][pos_x] == 0)) {
a = 1;
}
break;
case 2 :
if (((tab[pos_y + 1][pos_x - 2] == 0) and (tab[pos_y + 1][pos_x - 1] == 0)) and (tab[pos_y + 1][pos_x] == 0)) {
a = 1;
}
break;
case 3 :
if ((tab[pos_y + 1][pos_x - 1] == 0) and (tab[pos_y + 2][pos_x] == 0)) {
a = 1;
}
break;
case 4 :
if (!(((tab[pos_y + 1][pos_x - 1] == 0) and (tab[pos_y + 1][pos_x] == 0)) and (tab[pos_y][pos_x + 1] == 0))) {
break;
}
a = 1;
}
}
if (piece == 13) {
switch (pos) {
case 1 :
if (((tab[pos_y + 2][pos_x - 1] == 0) and (tab[pos_y + 2][pos_x] == 0)) and (tab[pos_y + 1][pos_x + 1] == 0)) {
a = 1;
}
break;
case 2 :
if (((tab[pos_y + 1][pos_x - 1] == 0) and (tab[pos_y + 2][pos_x] == 0)) and (tab[pos_y + 2][pos_x + 1] == 0)) {
a = 1;
}
break;
case 3 :
if (((tab[pos_y + 2][pos_x - 1] == 0) and (tab[pos_y + 1][pos_x] == 0)) and (tab[pos_y][pos_x + 1] == 0)) {
a = 1;
}
break;
case 4 :
if (!(((tab[pos_y][pos_x - 1] == 0) and (tab[pos_y + 1][pos_x] == 0)) and (tab[pos_y + 2][pos_x + 1] == 0))) {
break;
}
a = 1;
}
}
if (piece == 14) {
switch (pos) {
case 1 :
if (((tab[pos_y + 2][pos_x - 1] == 0) and (tab[pos_y + 1][pos_x] == 0)) and (tab[pos_y + 2][pos_x + 1] == 0)) {
a = 1;
}
break;
case 2 :
if ((tab[pos_y + 2][pos_x - 1] == 0) and (tab[pos_y + 2][pos_x] == 0)) {
a = 1;
}
break;
case 3 :
if (((tab[pos_y + 1][pos_x - 1] == 0) and (tab[pos_y + 1][pos_x] == 0)) and (tab[pos_y + 1][pos_x + 1] == 0)) {
a = 1;
}
break;
case 4 :
if (!((tab[pos_y + 2][pos_x] == 0) and (tab[pos_y + 2][pos_x + 1] == 0))) {
break;
}
a = 1;
}
}
if (a == 1) {
return(true);
}
return(false);
};
verif_pos = function () {
a = 0;
if (piece == 1) {
switch (pos) {
case 4 :
if (((tab[pos_y][pos_x - 1] == 0) and (tab[pos_y][pos_x + 1] == 0)) and (tab[pos_y + 1][pos_x + 1] == 0)) {
a = 1;
}
break;
case 1 :
if (((tab[pos_y + 1][pos_x - 1] == 0) and (tab[pos_y + 1][pos_x] == 0)) and (tab[pos_y - 1][pos_x] == 0)) {
a = 1;
}
break;
case 2 :
if (((tab[pos_y][pos_x - 1] == 0) and (tab[pos_y][pos_x + 1] == 0)) and (tab[pos_y - 1][pos_x - 1] == 0)) {
a = 1;
}
break;
case 3 :
if (!(((tab[pos_y + 1][pos_x] == 0) and (tab[pos_y - 1][pos_x] == 0)) and (tab[pos_y - 1][pos_x + 1] == 0))) {
break;
}
a = 1;
}
}
if (piece == 2) {
switch (pos) {
case 4 :
if (((tab[pos_y][pos_x - 1] == 0) and (tab[pos_y][pos_x + 1] == 0)) and (tab[pos_y + 1][pos_x - 1] == 0)) {
a = 1;
}
break;
case 1 :
if (((tab[pos_y + 1][pos_x] == 0) and (tab[pos_y - 1][pos_x] == 0)) and (tab[pos_y - 1][pos_x - 1] == 0)) {
a = 1;
}
break;
case 2 :
if (((tab[pos_y][pos_x - 1] == 0) and (tab[pos_y][pos_x + 1] == 0)) and (tab[pos_y - 1][pos_x + 1] == 0)) {
a = 1;
}
break;
case 3 :
if (!(((tab[pos_y + 1][pos_x] == 0) and (tab[pos_y + 1][pos_x + 1] == 0)) and (tab[pos_y - 1][pos_x] == 0))) {
break;
}
a = 1;
}
}
if (piece == 3) {
switch (pos) {
case 4 :
if (((tab[pos_y + 1][pos_x] == 0) and (tab[pos_y][pos_x + 1] == 0)) and (tab[pos_y][pos_x - 1] == 0)) {
a = 1;
}
break;
case 1 :
if (((tab[pos_y + 1][pos_x] == 0) and (tab[pos_y][pos_x - 1] == 0)) and (tab[pos_y - 1][pos_x] == 0)) {
a = 1;
}
break;
case 2 :
if (((tab[pos_y][pos_x - 1] == 0) and (tab[pos_y][pos_x + 1] == 0)) and (tab[pos_y - 1][pos_x] == 0)) {
a = 1;
}
break;
case 3 :
if (!(((tab[pos_y + 1][pos_x] == 0) and (tab[pos_y - 1][pos_x] == 0)) and (tab[pos_y][pos_x + 1] == 0))) {
break;
}
a = 1;
}
}
if (piece == 4) {
switch (pos) {
case 2 :
if (((tab[pos_y + 1][pos_x] == 0) and (tab[pos_y][pos_x + 1] == 0)) and (tab[pos_y + 1][pos_x - 1] == 0)) {
a = 1;
}
break;
case 1 :
if (!(((tab[pos_y + 1][pos_x + 1] == 0) and (tab[pos_y][pos_x + 1] == 0)) and (tab[pos_y - 1][pos_x] == 0))) {
break;
}
a = 1;
}
}
if (piece == 5) {
switch (pos) {
case 2 :
if (((tab[pos_y + 1][pos_x] == 0) and (tab[pos_y][pos_x - 1] == 0)) and (tab[pos_y + 1][pos_x + 1] == 0)) {
a = 1;
}
break;
case 1 :
if (!(((tab[pos_y + 1][pos_x] == 0) and (tab[pos_y][pos_x + 1] == 0)) and (tab[pos_y - 1][pos_x + 1] == 0))) {
break;
}
a = 1;
}
}
if (piece == 6) {
switch (pos) {
case 2 :
if (((tab[pos_y][pos_x - 1] == 0) and (tab[pos_y][pos_x + 1] == 0)) and (tab[pos_y][pos_x + 2] == 0)) {
a = 1;
}
break;
case 1 :
if (!(((tab[pos_y - 1][pos_x] == 0) and (tab[pos_y + 1][pos_x] == 0)) and (tab[pos_y + 2][pos_x] == 0))) {
break;
}
a = 1;
}
}
if (piece == 7) {
a = 1;
}
if (piece == 8) {
switch (pos) {
case 2 :
if ((((tab[pos_y - 1][pos_x - 1] == 0) and (tab[pos_y][pos_x - 1] == 0)) and (tab[pos_y][pos_x + 1] == 0)) and (tab[pos_y + 1][pos_x + 1] == 0)) {
a = 1;
}
break;
case 1 :
if (!((((tab[pos_y - 1][pos_x] == 0) and (tab[pos_y - 1][pos_x + 1] == 0)) and (tab[pos_y + 1][pos_x] == 0)) and (tab[pos_y + 1][pos_x - 1] == 0))) {
break;
}
a = 1;
}
}
if (piece == 9) {
switch (pos) {
case 2 :
if ((((tab[pos_y][pos_x - 1] == 0) and (tab[pos_y + 1][pos_x - 1] == 0)) and (tab[pos_y][pos_x + 1] == 0)) and (tab[pos_y - 1][pos_x + 1] == 0)) {
a = 1;
}
break;
case 1 :
if (!((((tab[pos_y - 1][pos_x - 1] == 0) and (tab[pos_y - 1][pos_x] == 0)) and (tab[pos_y + 1][pos_x] == 0)) and (tab[pos_y + 1][pos_x + 1] == 0))) {
break;
}
a = 1;
}
}
if (piece == 10) {
a = 1;
}
if (piece == 11) {
switch (pos) {
case 4 :
if ((((tab[pos_y - 1][pos_x - 1] == 0) and (tab[pos_y][pos_x - 1] == 0)) and (tab[pos_y - 1][pos_x] == 0)) and (tab[pos_y - 2][pos_x] == 0)) {
a = 1;
}
break;
case 1 :
if ((((tab[pos_y - 1][pos_x - 2] == 0) and (tab[pos_y - 1][pos_x - 1] == 0)) and (tab[pos_y - 1][pos_x] == 0)) and (tab[pos_y][pos_x - 1] == 0)) {
a = 1;
}
break;
case 2 :
if ((((tab[pos_y - 1][pos_x - 1] == 0) and (tab[pos_y - 1][pos_x] == 0)) and (tab[pos_y][pos_x - 1] == 0)) and (tab[pos_y + 1][pos_x - 1] == 0)) {
a = 1;
}
break;
case 3 :
if (!((((tab[pos_y - 1][pos_x - 1] == 0) and (tab[pos_y - 1][pos_x] == 0)) and (tab[pos_y][pos_x - 1] == 0)) and (tab[pos_y][pos_x + 1] == 0))) {
break;
}
a = 1;
}
}
if (piece == 12) {
switch (pos) {
case 4 :
if ((((tab[pos_y - 2][pos_x - 1] == 0) and (tab[pos_y - 1][pos_x - 1] == 0)) and (tab[pos_y][pos_x - 1] == 0)) and (tab[pos_y - 1][pos_x] == 0)) {
a = 1;
}
break;
case 1 :
if ((((tab[pos_y][pos_x - 2] == 0) and (tab[pos_y][pos_x - 1] == 0)) and (tab[pos_y - 1][pos_x - 1] == 0)) and (tab[pos_y - 1][pos_x] == 0)) {
a = 1;
}
break;
case 2 :
if ((((tab[pos_y - 1][pos_x - 1] == 0) and (tab[pos_y][pos_x - 1] == 0)) and (tab[pos_y - 1][pos_x] == 0)) and (tab[pos_y + 1][pos_x] == 0)) {
a = 1;
}
break;
case 3 :
if (!((((tab[pos_y - 1][pos_x - 1] == 0) and (tab[pos_y - 1][pos_x] == 0)) and (tab[pos_y][pos_x - 1] == 0)) and (tab[pos_y - 1][pos_x + 1] == 0))) {
break;
}
a = 1;
}
}
if (piece == 13) {
switch (pos) {
case 4 :
if ((((tab[pos_y + 1][pos_x - 1] == 0) and (tab[pos_y + 1][pos_x] == 0)) and (tab[pos_y][pos_x + 1] == 0)) and (tab[pos_y - 1][pos_x + 1] == 0)) {
a = 1;
}
break;
case 1 :
if ((((tab[pos_y - 1][pos_x - 1] == 0) and (tab[pos_y][pos_x - 1] == 0)) and (tab[pos_y + 1][pos_x] == 0)) and (tab[pos_y + 1][pos_x + 1] == 0)) {
a = 1;
}
break;
case 2 :
if ((((tab[pos_y + 1][pos_x - 1] == 0) and (tab[pos_y][pos_x - 1] == 0)) and (tab[pos_y - 1][pos_x] == 0)) and (tab[pos_y - 1][pos_x + 1] == 0)) {
a = 1;
}
break;
case 3 :
if (!((((tab[pos_y - 1][pos_x - 1] == 0) and (tab[pos_y - 1][pos_x] == 0)) and (tab[pos_y][pos_x + 1] == 0)) and (tab[pos_y + 1][pos_x + 1] == 0))) {
break;
}
a = 1;
}
}
if (piece == 14) {
switch (pos) {
case 4 :
if ((((tab[pos_y][pos_x - 1] == 0) and (tab[pos_y + 1][pos_x - 1] == 0)) and (tab[pos_y][pos_x + 1] == 0)) and (tab[pos_y + 1][pos_x + 1] == 0)) {
a = 1;
}
break;
case 1 :
if ((((tab[pos_y - 1][pos_x] == 0) and (tab[pos_y - 1][pos_x - 1] == 0)) and (tab[pos_y + 1][pos_x] == 0)) and (tab[pos_y + 1][pos_x - 1] == 0)) {
a = 1;
}
break;
case 2 :
if ((((tab[pos_y - 1][pos_x - 1] == 0) and (tab[pos_y][pos_x - 1] == 0)) and (tab[pos_y][pos_x + 1] == 0)) and (tab[pos_y - 1][pos_x + 1] == 0)) {
a = 1;
}
break;
case 3 :
if (!((((tab[pos_y - 1][pos_x] == 0) and (tab[pos_y - 1][pos_x + 1] == 0)) and (tab[pos_y + 1][pos_x] == 0)) and (tab[pos_y + 1][pos_x + 1] == 0))) {
break;
}
a = 1;
}
}
if (a == 1) {
return(true);
}
return(false);
};
ralenti = 0;
up_cpt = 0;
mv_cpt = 0;
uptouch = 0;
rtouch = 0;
ltouch = 0;
dtouch = 0;
_root.onEnterFrame = function () {
if (thesound == 0) {
stopAllSounds();
}
ralenti++;
if (presse != "") {
cpt_presse++;
if (cpt_presse == 12) {
if (test_qi._url.charAt(0) == "h") {
getURL (_root.presse);
}
presse = "";
cpt_presse = 0;
}
}
if (up_cpt > 0) {
up_cpt--;
}
if (mv_cpt > 0) {
mv_cpt--;
}
if (Key.isDown(39) && (mv_cpt == 0)) {
mv_cpt = 2;
rtouch = 1;
}
if (Key.isDown(37) && (mv_cpt == 0)) {
mv_cpt = 2;
ltouch = 1;
}
if (Key.isDown(40)) {
dtouch = 1;
}
if (Key.isDown(38) && (up_cpt == 0)) {
up_cpt = 5;
uptouch = 1;
}
if ((jeu == "ON") and (ralenti == 2)) {
ralenti = 0;
_root["test" + nb]._x = 3 + (pos_x * 20);
_root["test" + nb]._y = 3 + (pos_y * 20);
if (dtouch == 1) {
dtouch = 0;
cpt = 5;
}
if (((uptouch == 1) && (rtouch == 0)) && (ltouch == 0)) {
if (verif_pos()) {
uptouch = 0;
if (_root.thesound == 1) {
rotation.start(0, 1);
}
_root["test" + nb].nextFrame();
if (piece < 4) {
if (pos == 4) {
pos = 1;
} else {
pos++;
}
} else if (piece < 11) {
if (pos == 2) {
pos = 1;
} else {
pos++;
}
} else if (pos == 4) {
pos = 1;
} else {
pos++;
}
}
}
if (rtouch == 1) {
rtouch = 0;
if (verif_d()) {
pos_x++;
}
}
if (ltouch == 1) {
ltouch = 0;
if (verif_g()) {
pos_x--;
}
}
if (cpt < 5) {
cpt++;
} else if (verif_b()) {
cpt = 0;
pos_y++;
} else {
tab[pos_y][pos_x] = piece;
if (piece == 1) {
switch (pos) {
case 1 :
tab[pos_y][pos_x - 1] = piece;
tab[pos_y][pos_x + 1] = piece;
tab[pos_y + 1][pos_x + 1] = piece;
break;
case 2 :
tab[pos_y + 1][pos_x - 1] = piece;
tab[pos_y + 1][pos_x] = piece;
tab[pos_y - 1][pos_x] = piece;
break;
case 3 :
tab[pos_y][pos_x - 1] = piece;
tab[pos_y][pos_x + 1] = piece;
tab[pos_y - 1][pos_x - 1] = piece;
break;
case 4 :
tab[pos_y + 1][pos_x] = piece;
tab[pos_y - 1][pos_x] = piece;
tab[pos_y - 1][pos_x + 1] = piece;
}
}
if (piece == 2) {
switch (pos) {
case 1 :
tab[pos_y][pos_x - 1] = piece;
tab[pos_y][pos_x + 1] = piece;
tab[pos_y + 1][pos_x - 1] = piece;
break;
case 2 :
tab[pos_y + 1][pos_x] = piece;
tab[pos_y - 1][pos_x] = piece;
tab[pos_y - 1][pos_x - 1] = piece;
break;
case 3 :
tab[pos_y][pos_x - 1] = piece;
tab[pos_y][pos_x + 1] = piece;
tab[pos_y - 1][pos_x + 1] = piece;
break;
case 4 :
tab[pos_y + 1][pos_x] = piece;
tab[pos_y + 1][pos_x + 1] = piece;
tab[pos_y - 1][pos_x] = piece;
}
}
if (piece == 3) {
switch (pos) {
case 1 :
tab[pos_y + 1][pos_x] = piece;
tab[pos_y][pos_x + 1] = piece;
tab[pos_y][pos_x - 1] = piece;
break;
case 2 :
tab[pos_y + 1][pos_x] = piece;
tab[pos_y][pos_x - 1] = piece;
tab[pos_y - 1][pos_x] = piece;
break;
case 3 :
tab[pos_y][pos_x - 1] = piece;
tab[pos_y][pos_x + 1] = piece;
tab[pos_y - 1][pos_x] = piece;
break;
case 4 :
tab[pos_y + 1][pos_x] = piece;
tab[pos_y - 1][pos_x] = piece;
tab[pos_y][pos_x + 1] = piece;
}
}
if (piece == 4) {
switch (pos) {
case 1 :
tab[pos_y + 1][pos_x] = piece;
tab[pos_y][pos_x + 1] = piece;
tab[pos_y + 1][pos_x - 1] = piece;
break;
case 2 :
tab[pos_y + 1][pos_x + 1] = piece;
tab[pos_y][pos_x + 1] = piece;
tab[pos_y - 1][pos_x] = piece;
}
}
if (piece == 5) {
switch (pos) {
case 1 :
tab[pos_y + 1][pos_x] = piece;
tab[pos_y][pos_x - 1] = piece;
tab[pos_y + 1][pos_x + 1] = piece;
break;
case 2 :
tab[pos_y + 1][pos_x] = piece;
tab[pos_y][pos_x + 1] = piece;
tab[pos_y - 1][pos_x + 1] = piece;
}
}
if (piece == 6) {
switch (pos) {
case 1 :
tab[pos_y][pos_x - 1] = piece;
tab[pos_y][pos_x + 1] = piece;
tab[pos_y][pos_x + 2] = piece;
break;
case 2 :
tab[pos_y - 1][pos_x] = piece;
tab[pos_y + 1][pos_x] = piece;
tab[pos_y + 2][pos_x] = piece;
}
}
if (piece == 7) {
tab[pos_y + 1][pos_x] = piece;
tab[pos_y][pos_x + 1] = piece;
tab[pos_y + 1][pos_x + 1] = piece;
}
if (piece == 8) {
switch (pos) {
case 1 :
tab[pos_y - 1][pos_x - 1] = piece;
tab[pos_y][pos_x - 1] = piece;
tab[pos_y][pos_x + 1] = piece;
tab[pos_y + 1][pos_x + 1] = piece;
break;
case 2 :
tab[pos_y - 1][pos_x] = piece;
tab[pos_y - 1][pos_x + 1] = piece;
tab[pos_y + 1][pos_x] = piece;
tab[pos_y + 1][pos_x - 1] = piece;
}
}
if (piece == 9) {
switch (pos) {
case 1 :
tab[pos_y][pos_x - 1] = piece;
tab[pos_y + 1][pos_x - 1] = piece;
tab[pos_y][pos_x + 1] = piece;
tab[pos_y - 1][pos_x + 1] = piece;
break;
case 2 :
tab[pos_y - 1][pos_x - 1] = piece;
tab[pos_y - 1][pos_x] = piece;
tab[pos_y + 1][pos_x] = piece;
tab[pos_y + 1][pos_x + 1] = piece;
}
}
if (piece == 10) {
tab[pos_y][pos_x - 1] = piece;
tab[pos_y - 1][pos_x] = piece;
tab[pos_y + 1][pos_x] = piece;
tab[pos_y][pos_x + 1] = piece;
}
if (piece == 11) {
switch (pos) {
case 1 :
tab[pos_y - 1][pos_x - 1] = piece;
tab[pos_y][pos_x - 1] = piece;
tab[pos_y - 1][pos_x] = piece;
tab[pos_y - 2][pos_x] = piece;
break;
case 2 :
tab[pos_y - 1][pos_x - 2] = piece;
tab[pos_y - 1][pos_x - 1] = piece;
tab[pos_y - 1][pos_x] = piece;
tab[pos_y][pos_x - 1] = piece;
break;
case 3 :
tab[pos_y - 1][pos_x - 1] = piece;
tab[pos_y - 1][pos_x] = piece;
tab[pos_y][pos_x - 1] = piece;
tab[pos_y + 1][pos_x - 1] = piece;
break;
case 4 :
tab[pos_y - 1][pos_x - 1] = piece;
tab[pos_y - 1][pos_x] = piece;
tab[pos_y][pos_x - 1] = piece;
tab[pos_y][pos_x + 1] = piece;
}
}
if (piece == 12) {
switch (pos) {
case 1 :
tab[pos_y - 2][pos_x - 1] = piece;
tab[pos_y - 1][pos_x - 1] = piece;
tab[pos_y][pos_x - 1] = piece;
tab[pos_y - 1][pos_x] = piece;
break;
case 2 :
tab[pos_y][pos_x - 2] = piece;
tab[pos_y][pos_x - 1] = piece;
tab[pos_y - 1][pos_x - 1] = piece;
tab[pos_y - 1][pos_x] = piece;
break;
case 3 :
tab[pos_y - 1][pos_x - 1] = piece;
tab[pos_y][pos_x - 1] = piece;
tab[pos_y - 1][pos_x] = piece;
tab[pos_y + 1][pos_x] = piece;
break;
case 4 :
tab[pos_y - 1][pos_x - 1] = piece;
tab[pos_y - 1][pos_x] = piece;
tab[pos_y][pos_x - 1] = piece;
tab[pos_y - 1][pos_x + 1] = piece;
}
}
if (piece == 13) {
switch (pos) {
case 1 :
tab[pos_y + 1][pos_x - 1] = piece;
tab[pos_y + 1][pos_x] = piece;
tab[pos_y][pos_x + 1] = piece;
tab[pos_y - 1][pos_x + 1] = piece;
break;
case 2 :
tab[pos_y - 1][pos_x - 1] = piece;
tab[pos_y][pos_x - 1] = piece;
tab[pos_y + 1][pos_x] = piece;
tab[pos_y + 1][pos_x + 1] = piece;
break;
case 3 :
tab[pos_y + 1][pos_x - 1] = piece;
tab[pos_y][pos_x - 1] = piece;
tab[pos_y - 1][pos_x] = piece;
tab[pos_y - 1][pos_x + 1] = piece;
break;
case 4 :
tab[pos_y - 1][pos_x - 1] = piece;
tab[pos_y - 1][pos_x] = piece;
tab[pos_y][pos_x + 1] = piece;
tab[pos_y + 1][pos_x + 1] = piece;
}
}
if (piece == 14) {
switch (pos) {
case 1 :
tab[pos_y][pos_x - 1] = piece;
tab[pos_y + 1][pos_x - 1] = piece;
tab[pos_y][pos_x + 1] = piece;
tab[pos_y + 1][pos_x + 1] = piece;
break;
case 2 :
tab[pos_y - 1][pos_x] = piece;
tab[pos_y - 1][pos_x - 1] = piece;
tab[pos_y + 1][pos_x] = piece;
tab[pos_y + 1][pos_x - 1] = piece;
break;
case 3 :
tab[pos_y - 1][pos_x - 1] = piece;
tab[pos_y][pos_x - 1] = piece;
tab[pos_y][pos_x + 1] = piece;
tab[pos_y - 1][pos_x + 1] = piece;
break;
case 4 :
tab[pos_y - 1][pos_x] = piece;
tab[pos_y - 1][pos_x + 1] = piece;
tab[pos_y + 1][pos_x] = piece;
tab[pos_y + 1][pos_x + 1] = piece;
}
}
score2 = 0;
var i = 0;
while (i < 20) {
ligne = 0;
var j = 0;
while (j < 10) {
if (tab[i][j] > 0) {
ligne++;
}
j++;
}
if (ligne == 10) {
if (score2 == 0) {
if (_root.thesound == 1) {
disparition.start(0, 1);
}
score = score + 10;
}
if (score2 == 1) {
score = score + 30;
}
if (score2 == 2) {
score = score + 40;
}
if (score2 == 3) {
score = score + 80;
}
score2++;
tab.splice(i, 1);
tab = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0]].concat(tab);
}
i++;
}
if (score2 == 0) {
if (_root.thesound == 1) {
atterissage.start(0, 1);
}
}
affiche_score();
var i = 0;
while (i < carre) {
removeMovieClip("carre" + i);
i++;
}
carre = 0;
var i = 0;
while (i < 20) {
var j = 0;
while (j < 10) {
if (tab[i][j] > 0) {
duplicateMovieClip ("b" + tableau[tab[i][j] - 1], "carre" + carre, carre + 1);
_root["carre" + carre]._x = 14 + (j * 20);
_root["carre" + carre]._y = 14 + (i * 20);
carre++;
}
j++;
}
i++;
}
removeMovieClip("test" + nb);
nb++;
piece = next;
next = random(14) + 1;
var i = 0;
while (i < 14) {
_root[tableau[i]]._y = -100;
i++;
}
place_next();
duplicateMovieClip (tableau[piece - 1], "test" + nb, 0);
pos_x = 4;
switch (piece) {
case 1 :
pos_y = 0;
break;
case 2 :
pos_y = 0;
break;
case 3 :
pos_y = 0;
break;
case 4 :
pos_y = 0;
break;
case 5 :
pos_y = 0;
break;
case 6 :
pos_y = 0;
break;
case 7 :
pos_y = 0;
break;
case 8 :
pos_y = 1;
break;
case 9 :
pos_y = 1;
break;
case 10 :
pos_y = 1;
break;
case 11 :
pos_y = 2;
break;
case 12 :
pos_y = 2;
break;
case 13 :
pos_y = 1;
break;
case 14 :
pos_y = 0;
}
cpt = 0;
if (piece < 4) {
pos = 4;
} else if (piece < 11) {
pos = 2;
} else {
pos = 4;
}
if (verif_pos()) {
pos = 1;
} else {
jeu = "OFF";
nextFrame();
}
}
}
};
stop();
Frame 3 (571 B)
if (_root.thesound == 1) {
stopAllSounds();
fin.start(0, 1);
}
removeMovieClip("next");
cadre2._x = -500;
duplicateMovieClip ("cache", "cache2", carre + 1);
cache2._x = 104;
cache2._y = 204;
duplicateMovieClip ("starti", "starti2", carre + 2);
duplicateMovieClip ("hs", "hs2", carre + 3);
starti2._x = 180;
hs2._x = 180;
_root.onEnterFrame = function () {
if (presse != "") {
cpt_presse++;
if (cpt_presse == 12) {
if (test_qi._url.charAt(0) == "h") {
getURL (_root.presse);
}
presse = "";
cpt_presse = 0;
}
}
};
stop();
Symbol 20 Button (234 B)
on (press) {
_root.go_url = "http://www.my-iq.net/index.php?ref=" + _root.test_qi._url;
getURL (_root.go_url, "_top");
_root.presse = _root.go_url;
}
on (rollOver) {
_root.iq._alpha = 50;
}
on (rollOut) {
_root.iq._alpha = 100;
}
Symbol 28 Button (205 B)
on (press) {
_root.go_url = "http://www.zodiac-games.com";
getURL (_root.go_url, "_top");
_root.presse = _root.go_url;
}
on (rollOver) {
_root.hs._alpha = 50;
}
on (rollOut) {
_root.hs._alpha = 100;
}
Symbol 57 Button (234 B)
on (press) {
_root.go_url = "http://www.my-iq.net/index.php?ref=" + _root.test_qi._url;
getURL (_root.go_url, "_top");
_root.presse = _root.go_url;
}
on (rollOver) {
_root.iq._alpha = 50;
}
on (rollOut) {
_root.iq._alpha = 100;
}
Symbol 65 Button (136 B)
on (press) {
_root.nextFrame();
}
on (rollOver) {
_root.intro.starti._alpha = 50;
}
on (rollOut) {
_root.intro.starti._alpha = 100;
}
Symbol 66 Button (225 B)
on (press) {
_root.go_url = "http://www.zodiac-games.com";
getURL (_root.go_url, "_top");
_root.presse = _root.go_url;
}
on (rollOver) {
_root.intro.zodiac._alpha = 50;
}
on (rollOut) {
_root.intro.zodiac._alpha = 100;
}
Symbol 67 Button (136 B)
on (press) {
_root.nextFrame();
}
on (rollOver) {
_root.intro.starti._alpha = 50;
}
on (rollOut) {
_root.intro.starti._alpha = 100;
}
Symbol 79 Button (33 B)
on (press) {
this.nextFrame();
}
Symbol 96 Button (53 B)
on (press) {
this.gotoAndPlay(1);
this._y = -500;
}
Symbol 101 MovieClip Frame 1 (8 B)
stop();
Symbol 101 MovieClip Frame 2 (8 B)
stop();
Symbol 101 MovieClip Frame 3 (8 B)
stop();
Symbol 102 MovieClip Frame 80 (8 B)
stop();
Symbol 107 MovieClip Frame 1 (8 B)
stop();
Symbol 107 MovieClip Frame 5 (17 B)
gotoAndStop (1);
Symbol 109 MovieClip Frame 1 (8 B)
stop();
Symbol 109 MovieClip Frame 5 (17 B)
gotoAndStop (1);
Symbol 122 MovieClip Frame 1 (8 B)
stop();
Symbol 122 MovieClip Frame 5 (17 B)
gotoAndStop (1);
Symbol 123 MovieClip Frame 1 (8 B)
stop();
Symbol 123 MovieClip Frame 3 (17 B)
gotoAndStop (1);
Symbol 124 MovieClip Frame 1 (8 B)
stop();
Symbol 124 MovieClip Frame 3 (17 B)
gotoAndStop (1);
Symbol 125 MovieClip Frame 1 (8 B)
stop();
Symbol 125 MovieClip Frame 3 (17 B)
gotoAndStop (1);
Symbol 126 MovieClip Frame 1 (8 B)
stop();
Symbol 126 MovieClip Frame 3 (17 B)
gotoAndStop (1);
Symbol 129 MovieClip Frame 1 (8 B)
stop();
Symbol 129 MovieClip Frame 5 (17 B)
gotoAndStop (1);
Symbol 130 MovieClip Frame 1 (8 B)
stop();
Symbol 130 MovieClip Frame 5 (17 B)
gotoAndStop (1);
Symbol 131 MovieClip Frame 1 (8 B)
stop();
Symbol 131 MovieClip Frame 5 (17 B)
gotoAndStop (1);
Symbol 132 MovieClip Frame 1 (8 B)
stop();
Symbol 132 MovieClip Frame 5 (17 B)
gotoAndStop (1);
Symbol 133 MovieClip Frame 1 (8 B)
stop();
Symbol 133 MovieClip Frame 5 (17 B)
gotoAndStop (1);
Symbol 134 MovieClip Frame 1 (8 B)
stop();
Symbol 134 MovieClip Frame 5 (17 B)
gotoAndStop (1);
Symbol 135 MovieClip Frame 1 (8 B)
stop();
Symbol 135 MovieClip Frame 5 (17 B)
gotoAndStop (1);
Symbol 211 Button (236 B)
on (press) {
_root.go_url = "http://www.my-iq.net/index.php?ref=" + _root.test_qi._url;
getURL (_root.go_url, "_top");
_root.presse = _root.go_url;
}
on (rollOver) {
_root.iq2._alpha = 50;
}
on (rollOut) {
_root.iq2._alpha = 100;
}
Symbol 212 Button (215 B)
on (press) {
_root.go_url = "http://www.zodiac-games.com";
getURL (_root.go_url, "_top");
_root.presse = _root.go_url;
}
on (rollOver) {
_root.zg_logo._alpha = 50;
}
on (rollOut) {
_root.zg_logo._alpha = 100;
}
Symbol 216 Button (203 B)
on (release) {
if (_root.thesound == 0) {
_root.snd_ok._alpha = 0;
_root.thesound = 1;
stopAllSounds();
_root.error.start(0, 1);
} else {
_root.snd_ok._alpha = 100;
_root.thesound = 0;
}
}
Symbol 222 Button (309 B)
on (press) {
var i = 0;
while (i < _root.carre) {
removeMovieClip(_root["carre" + i]);
i++;
}
removeMovieClip(_root.starti2);
removeMovieClip(_root.hs2);
removeMovieClip(_root.cache2);
gotoAndPlay (1);
}
on (rollOver) {
_root.starti2._alpha = 70;
}
on (rollOut) {
_root.starti2._alpha = 100;
}
Symbol 225 MovieClip Frame 5 (8 B)
stop();
Symbol 226 Button (857 B)
on (release) {
code1 = ["2", "1", "D", "F", "4", "0", "A", "8", "3", "C"];
code2 = ["2", "0", "A", "E", "B", "D", "6", "9", "5", "7"];
equa1 = (score + 10) * 11;
equa2 = (score + 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=2&result=" + codage;
getURL (_root.url_results, "_top");
_root.presse = _root.go_url_results;
}
on (rollOver) {
_root.hs2._alpha = 70;
}
on (rollOut) {
_root.hs2._alpha = 100;
}