Frame 1
if (intro != 0) {
go_url = 0;
thesound = 1;
lang = System.capabilities.language;
timetogodeb = 0;
if (((lang == "fr") or (lang == "FR")) or (lang == "Fr")) {
versFR._y = 380;
rulesFR._y = 325;
rulesEN._y = 450;
}
musik = new Sound();
musik.attachSound("musik");
musik.start(0);
error = new Sound();
error.attachSound("error");
soundclocktick = new Sound();
soundclocktick.attachSound("soundclocktick");
soundtimesup = new Sound();
soundtimesup.attachSound("soundtimesup");
selecte = new Sound();
selecte.attachSound("selecte");
win = new Sound();
win.attachSound("win");
level = 0;
lives = 3;
pts = 0;
restarter = 0;
}
intro = 0;
barre._width = barre._width + 1.2;
Instance of Symbol 36 MovieClip in Frame 1
/* no clip actions */
Instance of Symbol 67 MovieClip "rulesEN" in Frame 1
on (rollOver) {
_root.rulesEN._alpha = 50;
}
on (rollOut) {
_root.rulesEN._alpha = 100;
}
on (release) {
getURL ("http://www.high-scores.eu/rules-flash-magnetic-5.html", "_blank");
}
Instance of Symbol 69 MovieClip "rulesFR" in Frame 1
on (rollOver) {
_root.rulesFR._alpha = 50;
}
on (rollOut) {
_root.rulesFR._alpha = 100;
}
on (release) {
getURL ("http://www.high-scores.eu/regles-flash-magnetic-5.html", "_blank");
}
Frame 2
if (barre._width < 500) {
gotoAndPlay (1);
} else {
gotoAndPlay (3);
}
Frame 3
function remapper(k) {
if (depth < 3) {
depth++;
} else {
depth++;
}
switch (k) {
case "left" :
table = [[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12], [13, 14, 15, 16]];
break;
case "right" :
table = [[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12], [13, 14, 15, 16]];
break;
case "down" :
table = [[1, 3, 7, 12], [2, 5, 9, 13], [4, 8, 11, 15], [6, 10, 14, 16]];
break;
case "up" :
table = [[1, 3, 7, 11], [2, 5, 9, 13], [4, 8, 12, 15], [6, 10, 14, 16]];
}
var i = 0;
while (i < 4) {
var j = 0;
while (j < 4) {
this[(("c_" + i) + "_") + j].swapDepths((100 * depth) + table[i][j]);
j++;
}
i++;
}
}
function mapper() {
rx = 0;
ry = 0;
var i = 0;
while (i < 4) {
rx = 0;
var j = 0;
while (j < 4) {
this[(("c_" + i) + "_") + j]._x = (init_x + (rx * delta_x)) + (ry * delta_xy);
this[(("c_" + i) + "_") + j]._y = init_y + (ry * delta_y);
this[(("c_" + i) + "_") + j].gotoAndStop(map[i][j]);
rx++;
j++;
}
ry++;
i++;
}
}
function buildMap(arr) {
W = arr[0].length;
H = arr.length;
rx = 0;
ry = 0;
var _loc4 = 0;
while (_loc4 < H) {
rx = 0;
var _loc2 = 0;
while (_loc2 < W) {
this.attachMovie("tile", (("t_" + _loc4) + "_") + _loc2, ++d);
var _loc3 = this[(("t_" + _loc4) + "_") + _loc2];
_loc3._x = -200;
_loc3._y = -200;
_loc3.mark = 0;
_loc3.frame = arr[_loc4][_loc2];
this.attachMovie("Cube", (("c_" + _loc4) + "_") + _loc2, ++d);
var _loc5 = this[(("c_" + _loc4) + "_") + _loc2];
_loc5._alpha = 100;
_loc5._width = 65.7;
_loc5._height = 35.9;
_loc5._x = (init_x + (rx * delta_x)) + (ry * delta_xy);
_loc5._y = init_y + (ry * delta_y);
_loc5.gotoAndStop(arr[_loc4][_loc2]);
rx++;
_loc2++;
}
ry++;
_loc4++;
}
}
function updateVars(y, x) {
ob = this[(("t_" + y) + "_") + x];
obL = this[(("t_" + y) + "_") + (x - 1)];
obR = this[(("t_" + y) + "_") + (x + 1)];
obU = this[(("t_" + (y - 1)) + "_") + x];
obD = this[(("t_" + (y + 1)) + "_") + x];
obUR = this[(("t_" + (y - 1)) + "_") + (x + 1)];
obDR = this[(("t_" + (y + 1)) + "_") + (x + 1)];
obUL = this[(("t_" + (y - 1)) + "_") + (x - 1)];
obDL = this[(("t_" + (y + 1)) + "_") + (x - 1)];
obUU = this[(("t_" + (y - 2)) + "_") + x];
obDD = this[(("t_" + (y + 2)) + "_") + x];
obLL = this[(("t_" + y) + "_") + (x - 2)];
obRR = this[(("t_" + y) + "_") + (x + 2)];
m = map[y][x];
mL = map[y][x - 1];
mR = map[y][x + 1];
mU = map[y - 1][x];
mD = map[y + 1][x];
mUR = map[y - 1][x + 1];
mDR = map[y + 1][x + 1];
mUL = map[y - 1][x - 1];
mDL = map[y + 1][x - 1];
mUU = map[y - 2][x];
mDD = map[y + 2][x];
mLL = map[y][x - 2];
mRR = map[y][x + 2];
}
function doRight() {
var _loc3 = 0;
var _loc2 = (W - 2);
while (_loc2 >= 0) {
var _loc1 = (H - 1);
while (_loc1 >= 0) {
updateVars(_loc1, _loc2);
if (m != 6) {
if ((((mL != m) && (mU != m)) && (mD != m)) && (mR == 6)) {
map[_loc1][_loc2] = 6;
ob.mark = 1;
_loc3 = 1;
}
if ((((mL == m) && (mU == m)) && (mR == 6)) && (mUR == 6)) {
map[_loc1][_loc2] = 6;
map[_loc1 - 1][_loc2] = 6;
map[_loc1][_loc2 - 1] = 6;
ob.mark = 1;
obU.mark = 1;
obL.mark = 1;
_loc3 = 1;
}
if ((((mL == m) && (mD == m)) && (mR == 6)) && (mDR == 6)) {
map[_loc1][_loc2] = 6;
map[_loc1][_loc2 - 1] = 6;
map[_loc1 + 1][_loc2] = 6;
ob.mark = 1;
obL.mark = 1;
obD.mark = 1;
_loc3 = 1;
}
if ((((mR == m) && (mD == m)) && (mRR == 6)) && (mDR == 6)) {
map[_loc1][_loc2] = 6;
map[_loc1][_loc2 + 1] = 6;
map[_loc1 + 1][_loc2] = 6;
ob.mark = 1;
obR.mark = 1;
obD.mark = 1;
_loc3 = 1;
}
if ((((mR == m) && (mU == m)) && (mRR == 6)) && (mUR == 6)) {
map[_loc1][_loc2] = 6;
map[_loc1][_loc2 + 1] = 6;
map[_loc1 - 1][_loc2] = 6;
ob.mark = 1;
obU.mark = 1;
obR.mark = 1;
_loc3 = 1;
}
if (((mL == m) && (mR == m)) && (mRR == 6)) {
map[_loc1][_loc2] = 6;
map[_loc1][_loc2 - 1] = 6;
map[_loc1][_loc2 + 1] = 6;
ob.mark = 1;
obL.mark = 1;
obR.mark = 1;
_loc3 = 1;
}
if (((((mU == m) && (mD == m)) && (mR == 6)) && (mUR == 6)) && (mDR == 6)) {
map[_loc1][_loc2] = 6;
map[_loc1 - 1][_loc2] = 6;
map[_loc1 + 1][_loc2] = 6;
ob.mark = 1;
obU.mark = 1;
obD.mark = 1;
_loc3 = 1;
}
if (((((((mL == m) && (mR == 6)) && (mU != m)) && (mD != m)) && (mUL != m)) && (mDL != m)) && (mLL != m)) {
map[_loc1][_loc2] = 6;
map[_loc1][_loc2 - 1] = 6;
ob.mark = 1;
obL.mark = 1;
_loc3 = 1;
}
if (((((((mU == m) && (mR == 6)) && (mUR == 6)) && (mUU != m)) && (mD != m)) && (mL != m)) && (mUL != m)) {
map[_loc1][_loc2] = 6;
map[_loc1 - 1][_loc2] = 6;
ob.mark = 1;
obU.mark = 1;
_loc3 = 1;
}
}
_loc1--;
}
_loc2--;
}
return(_loc3);
}
function moveRight() {
var _loc3 = (W - 2);
while (_loc3 >= 0) {
var _loc2 = (H - 1);
while (_loc2 >= 0) {
updateVars(_loc2, _loc3);
if (ob.mark) {
this[(("c_" + _loc2) + "_") + _loc3]._x = this[(("c_" + _loc2) + "_") + _loc3]._x + xh;
}
_loc2--;
}
_loc3--;
}
counter++;
if (counter == 10) {
clearInterval(gameClock);
var _loc3 = (W - 2);
while (_loc3 >= 0) {
var _loc2 = (H - 1);
while (_loc2 >= 0) {
updateVars(_loc2, _loc3);
if (ob.mark) {
ob.mark = 0;
ob.gotoAndStop(6);
obR.gotoAndStop(ob.frame);
obR.frame = ob.frame;
map[_loc2][_loc3 + 1] = ob.frame;
ob.frame = 6;
mapper();
}
_loc2--;
}
_loc3--;
}
var _loc4 = doRight();
if (_loc4) {
counter = 0;
gameClock = setInterval(this, "moveRight", 10);
} else {
playGame = 1;
checkWin();
}
}
}
function doLeft() {
var _loc3 = 0;
var _loc2 = 1;
while (_loc2 < W) {
var _loc1 = (H - 1);
while (_loc1 >= 0) {
updateVars(_loc1, _loc2);
if (m != 6) {
if ((((mR != m) && (mU != m)) && (mD != m)) && (mL == 6)) {
map[_loc1][_loc2] = 6;
ob.mark = 1;
_loc3 = 1;
}
if ((((mR == m) && (mU == m)) && (mL == 6)) && (mUL == 6)) {
map[_loc1][_loc2] = 6;
map[_loc1 - 1][_loc2] = 6;
map[_loc1][_loc2 + 1] = 6;
ob.mark = 1;
obU.mark = 1;
obR.mark = 1;
_loc3 = 1;
}
if ((((mR == m) && (mD == m)) && (mL == 6)) && (mDL == 6)) {
map[_loc1][_loc2] = 6;
map[_loc1][_loc2 + 1] = 6;
map[_loc1 + 1][_loc2] = 6;
ob.mark = 1;
obR.mark = 1;
obD.mark = 1;
_loc3 = 1;
}
if ((((mL == m) && (mD == m)) && (mLL == 6)) && (mDL == 6)) {
map[_loc1][_loc2] = 6;
map[_loc1][_loc2 - 1] = 6;
map[_loc1 + 1][_loc2] = 6;
ob.mark = 1;
obL.mark = 1;
obD.mark = 1;
_loc3 = 1;
}
if ((((mL == m) && (mU == m)) && (mLL == 6)) && (mUL == 6)) {
map[_loc1][_loc2] = 6;
map[_loc1][_loc2 - 1] = 6;
map[_loc1 - 1][_loc2] = 6;
ob.mark = 1;
obU.mark = 1;
obL.mark = 1;
_loc3 = 1;
}
if (((mR == m) && (mL == m)) && (mLL == 6)) {
map[_loc1][_loc2] = 6;
map[_loc1][_loc2 + 1] = 6;
map[_loc1][_loc2 - 1] = 6;
ob.mark = 1;
obL.mark = 1;
obR.mark = 1;
_loc3 = 1;
}
if (((((mU == m) && (mD == m)) && (mL == 6)) && (mUL == 6)) && (mDL == 6)) {
map[_loc1][_loc2] = 6;
map[_loc1 - 1][_loc2] = 6;
map[_loc1 + 1][_loc2] = 6;
ob.mark = 1;
obU.mark = 1;
obD.mark = 1;
_loc3 = 1;
}
if (((((((mR == m) && (mL == 6)) && (mU != m)) && (mD != m)) && (mUR != m)) && (mDR != m)) && (mRR != m)) {
map[_loc1][_loc2] = 6;
map[_loc1][_loc2 + 1] = 6;
ob.mark = 1;
obR.mark = 1;
_loc3 = 1;
}
if (((((((mU == m) && (mL == 6)) && (mUL == 6)) && (mUU != m)) && (mD != m)) && (mR != m)) && (mUR != m)) {
map[_loc1][_loc2] = 6;
map[_loc1 - 1][_loc2] = 6;
ob.mark = 1;
obU.mark = 1;
_loc3 = 1;
}
}
_loc1--;
}
_loc2++;
}
return(_loc3);
}
function moveLeft() {
var _loc3 = 1;
while (_loc3 < W) {
var _loc2 = (H - 1);
while (_loc2 >= 0) {
updateVars(_loc2, _loc3);
if (ob.mark) {
this[(("c_" + _loc2) + "_") + _loc3]._x = this[(("c_" + _loc2) + "_") + _loc3]._x - xh;
}
_loc2--;
}
_loc3++;
}
counter++;
if (counter == 10) {
clearInterval(gameClock);
var _loc3 = 1;
while (_loc3 < W) {
var _loc2 = (H - 1);
while (_loc2 >= 0) {
updateVars(_loc2, _loc3);
if (ob.mark) {
ob.mark = 0;
ob.gotoAndStop(6);
obL.gotoAndStop(ob.frame);
obL.frame = ob.frame;
map[_loc2][_loc3 - 1] = ob.frame;
ob.frame = 6;
mapper();
}
_loc2--;
}
_loc3++;
}
var _loc4 = doLeft();
if (_loc4) {
counter = 0;
gameClock = setInterval(this, "moveLeft", 10);
} else {
playGame = 1;
checkWin();
}
}
}
function doDown() {
var _loc3 = 0;
var _loc2 = (H - 2);
while (_loc2 >= 0) {
var _loc1 = (W - 1);
while (_loc1 >= 0) {
updateVars(_loc2, _loc1);
if (m != 6) {
if ((((mL != m) && (mU != m)) && (mD == 6)) && (mR != m)) {
map[_loc2][_loc1] = 6;
ob.mark = 1;
_loc3 = 1;
}
if ((((mL == m) && (mU == m)) && (mD == 6)) && (mDL == 6)) {
map[_loc2][_loc1] = 6;
map[_loc2][_loc1 - 1] = 6;
map[_loc2 - 1][_loc1] = 6;
ob.mark = 1;
obU.mark = 1;
obL.mark = 1;
_loc3 = 1;
}
if ((((mL == m) && (mD == m)) && (mDD == 6)) && (mDL == 6)) {
map[_loc2][_loc1] = 6;
map[_loc2][_loc1 - 1] = 6;
map[_loc2 + 1][_loc1] = 6;
ob.mark = 1;
obL.mark = 1;
obD.mark = 1;
_loc3 = 1;
}
if ((((mD == m) && (mR == m)) && (mDD == 6)) && (mDR == 6)) {
map[_loc2][_loc1] = 6;
map[_loc2 + 1][_loc1] = 6;
map[_loc2][_loc1 + 1] = 6;
ob.mark = 1;
obD.mark = 1;
obR.mark = 1;
_loc3 = 1;
}
if ((((mR == m) && (mU == m)) && (mD == 6)) && (mDR == 6)) {
map[_loc2][_loc1] = 6;
map[_loc2 - 1][_loc1] = 6;
map[_loc2][_loc1 + 1] = 6;
ob.mark = 1;
obU.mark = 1;
obR.mark = 1;
_loc3 = 1;
}
if (((mU == m) && (mD == m)) && (mDD == 6)) {
map[_loc2][_loc1] = 6;
map[_loc2 - 1][_loc1] = 6;
map[_loc2 + 1][_loc1] = 6;
ob.mark = 1;
obU.mark = 1;
obD.mark = 1;
_loc3 = 1;
}
if (((((mL == m) && (mR == m)) && (mD == 6)) && (mDR == 6)) && (mDL == 6)) {
map[_loc2][_loc1] = 6;
map[_loc2][_loc1 - 1] = 6;
map[_loc2][_loc1 + 1] = 6;
ob.mark = 1;
obL.mark = 1;
obR.mark = 1;
_loc3 = 1;
}
if (((((((mU == m) && (mL != m)) && (mR != m)) && (mUU != m)) && (mUR != m)) && (mUL != m)) && (mD == 6)) {
map[_loc2][_loc1] = 6;
map[_loc2 - 1][_loc1] = 6;
ob.mark = 1;
obU.mark = 1;
_loc3 = 1;
}
if (((((((mL == m) && (mLL != m)) && (mR != m)) && (mD == 6)) && (mDL == 6)) && (mU != m)) && (mUL != m)) {
map[_loc2][_loc1] = 6;
map[_loc2][_loc1 - 1] = 6;
ob.mark = 1;
obL.mark = 1;
_loc3 = 1;
}
}
_loc1--;
}
_loc2--;
}
return(_loc3);
}
function moveDown() {
var _loc3 = (H - 2);
while (_loc3 >= 0) {
var _loc2 = (W - 1);
while (_loc2 >= 0) {
updateVars(_loc3, _loc2);
if (ob.mark) {
this[(("c_" + _loc3) + "_") + _loc2]._x = this[(("c_" + _loc3) + "_") + _loc2]._x - xv;
this[(("c_" + _loc3) + "_") + _loc2]._y = this[(("c_" + _loc3) + "_") + _loc2]._y + yv;
}
_loc2--;
}
_loc3--;
}
counter++;
if (counter == 10) {
clearInterval(gameClock);
var _loc3 = (H - 2);
while (_loc3 >= 0) {
var _loc2 = (W - 1);
while (_loc2 >= 0) {
updateVars(_loc3, _loc2);
if (ob.mark) {
ob.mark = 0;
ob.gotoAndStop(6);
obD.gotoAndStop(ob.frame);
obD.frame = ob.frame;
map[_loc3 + 1][_loc2] = ob.frame;
ob.frame = 6;
mapper();
}
_loc2--;
}
_loc3--;
}
var _loc4 = doDown();
if (_loc4) {
counter = 0;
gameClock = setInterval(this, "moveDown", 10);
} else {
playGame = 1;
checkWin();
}
}
}
function doUp() {
var _loc3 = 0;
var _loc2 = 1;
while (_loc2 < H) {
var _loc1 = 0;
while (_loc1 < W) {
updateVars(_loc2, _loc1);
if (m != 6) {
if ((((mL != m) && (mU == 6)) && (mD != m)) && (mR != m)) {
map[_loc2][_loc1] = 6;
ob.mark = 1;
_loc3 = 1;
}
if ((((mL == m) && (mD == m)) && (mU == 6)) && (mUL == 6)) {
map[_loc2][_loc1] = 6;
map[_loc2][_loc1 - 1] = 6;
map[_loc2 + 1][_loc1] = 6;
ob.mark = 1;
obD.mark = 1;
obL.mark = 1;
_loc3 = 1;
}
if ((((mL == m) && (mU == m)) && (mUU == 6)) && (mUL == 6)) {
map[_loc2][_loc1] = 6;
map[_loc2][_loc1 - 1] = 6;
map[_loc2 - 1][_loc1] = 6;
ob.mark = 1;
obL.mark = 1;
obU.mark = 1;
_loc3 = 1;
}
if ((((mU == m) && (mR == m)) && (mUU == 6)) && (mUR == 6)) {
map[_loc2][_loc1] = 6;
map[_loc2 - 1][_loc1] = 6;
map[_loc2][_loc1 + 1] = 6;
ob.mark = 1;
obU.mark = 1;
obR.mark = 1;
_loc3 = 1;
}
if ((((mR == m) && (mD == m)) && (mU == 6)) && (mUR == 6)) {
map[_loc2][_loc1] = 6;
map[_loc2 + 1][_loc1] = 6;
map[_loc2][_loc1 + 1] = 6;
ob.mark = 1;
obD.mark = 1;
obR.mark = 1;
_loc3 = 1;
}
if (((mD == m) && (mU == m)) && (mUU == 6)) {
map[_loc2][_loc1] = 6;
map[_loc2 + 1][_loc1] = 6;
map[_loc2 - 1][_loc1] = 6;
ob.mark = 1;
obU.mark = 1;
obD.mark = 1;
_loc3 = 1;
}
if (((((mL == m) && (mR == m)) && (mU == 6)) && (mUR == 6)) && (mUL == 6)) {
map[_loc2][_loc1] = 6;
map[_loc2][_loc1 - 1] = 6;
map[_loc2][_loc1 + 1] = 6;
ob.mark = 1;
obL.mark = 1;
obR.mark = 1;
_loc3 = 1;
}
if (((((((mD == m) && (mL != m)) && (mR != m)) && (mDD != m)) && (mDR != m)) && (mDL != m)) && (mU == 6)) {
map[_loc2][_loc1] = 6;
map[_loc2 + 1][_loc1] = 6;
ob.mark = 1;
obD.mark = 1;
_loc3 = 1;
}
if (((((((mL == m) && (mLL != m)) && (mR != m)) && (mU == 6)) && (mUL == 6)) && (mD != m)) && (mDL != m)) {
map[_loc2][_loc1] = 6;
map[_loc2][_loc1 - 1] = 6;
ob.mark = 1;
obL.mark = 1;
_loc3 = 1;
}
}
_loc1++;
}
_loc2++;
}
return(_loc3);
}
function moveUp() {
var _loc3 = 1;
while (_loc3 < H) {
var _loc2 = 0;
while (_loc2 < W) {
updateVars(_loc3, _loc2);
if (ob.mark) {
this[(("c_" + _loc3) + "_") + _loc2]._x = this[(("c_" + _loc3) + "_") + _loc2]._x + xv;
this[(("c_" + _loc3) + "_") + _loc2]._y = this[(("c_" + _loc3) + "_") + _loc2]._y - yv;
}
_loc2++;
}
_loc3++;
}
counter++;
if (counter == 10) {
clearInterval(gameClock);
var _loc3 = 1;
while (_loc3 < H) {
var _loc2 = 0;
while (_loc2 < W) {
updateVars(_loc3, _loc2);
if (ob.mark) {
ob.mark = 0;
ob.gotoAndStop(6);
obU.gotoAndStop(ob.frame);
obU.frame = ob.frame;
map[_loc3 - 1][_loc2] = ob.frame;
ob.frame = 6;
mapper();
}
_loc2++;
}
_loc3++;
}
var _loc4 = doUp();
if (_loc4) {
counter = 0;
gameClock = setInterval(this, "moveUp", 10);
} else {
playGame = 1;
checkWin();
}
}
}
function checkWin() {
mapper();
var _loc3 = 0;
var _loc2 = 0;
while (_loc2 < H) {
var _loc1 = 0;
while (_loc1 < W) {
updateVars(_loc2, _loc1);
if (((((m != 6) && (mR != m)) && (mL != m)) && (mD != m)) && (mU != m)) {
_loc3++;
}
_loc1++;
}
_loc2++;
}
if (_loc3 == 1) {
if (thesound == 1) {
win.start(0);
}
pts = pts + (timer + ((par_tab[level] - moves) * 5));
if (pts < 0) {
pts = 0;
}
if (pts < pts_old) {
pts = pts_old;
}
pts_old = pts;
nextFrame();
}
}
if (((lang == "fr") or (lang == "FR")) or (lang == "Fr")) {
rulesFR._x = 32;
rulesFR._y = 78;
} else {
rulesEN._x = 32;
rulesEN._y = 78;
}
map0 = [[2, 3, 4, 5], [6, 6, 6, 6], [2, 3, 4, 4], [1, 6, 1, 1]];
map1 = [[4, 1, 6, 1], [6, 6, 6, 6], [6, 3, 6, 3], [4, 6, 5, 6]];
map2 = [[6, 4, 6, 6], [2, 5, 2, 6], [6, 4, 6, 6], [6, 6, 3, 3]];
map3 = [[1, 4, 1, 6], [4, 1, 6, 6], [6, 6, 3, 6], [6, 5, 6, 3]];
map4 = [[4, 2, 4, 6], [6, 5, 6, 6], [4, 2, 3, 6], [3, 6, 3, 6]];
map5 = [[4, 3, 4, 2], [6, 2, 6, 6], [4, 5, 6, 6], [6, 3, 6, 6]];
map6 = [[1, 2, 6, 6], [1, 6, 6, 1], [2, 1, 6, 6], [3, 6, 3, 5]];
map7 = [[6, 6, 1, 6], [3, 5, 3, 6], [6, 6, 6, 4], [4, 6, 1, 6]];
map8 = [[1, 6, 6, 6], [2, 6, 3, 5], [1, 6, 6, 6], [6, 2, 6, 3]];
map9 = [[5, 6, 1, 2], [6, 6, 2, 1], [6, 4, 1, 6], [4, 6, 6, 6]];
map10 = [[3, 3, 1, 4], [5, 1, 2, 2], [6, 1, 3, 6], [6, 4, 2, 6]];
map = _root["map" + level];
par_tab = [2, 3, 5, 4, 5, 7, 6, 5, 7, 6, 13];
par.par = par_tab[level];
timer_tab = [15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65];
timer_max = timer_tab[level];
timer = timer_max;
frame_cpt = 0;
first_boum = 0;
if (((lang == "fr") or (lang == "FR")) or (lang == "Fr")) {
textesEN._y = -1000;
textesFR._y = 12;
txtEN._x = -1000;
txtFR._x = 455;
restartEN._y = -1000;
restartFR._y = 370.5;
testEN._y = -1000;
testFR._y = 370.5;
} else {
textesFR._y = -1000;
textesEN._y = 12;
txtFR._x = -1000;
txtEN._x = 455;
restartFR._y = -1000;
restartEN._y = 370.5;
testFR._y = -1000;
testEN._y = 370.5;
}
if (restarter == 0) {
a1 = random(4) + 1;
a2 = random(3) + 1;
if (a2 == a1) {
a2++;
}
a3 = random(2) + 1;
if (a3 == a1) {
a3 = a3 + 2;
if (a3 == a2) {
if (a3 == 3) {
a3++;
} else {
a3--;
}
}
}
if (a3 == a2) {
a3 = a3 + 2;
if (a3 == a1) {
if (a3 == 3) {
a3++;
} else {
a3--;
}
}
}
a4 = ((10 - a1) - a2) - a3;
}
var i = 0;
while (i < 4) {
var j = 0;
while (j < 4) {
if (map[i][j] == 1) {
map[i][j] = a1;
} else if (map[i][j] == 2) {
map[i][j] = a2;
} else if (map[i][j] == 3) {
map[i][j] = a3;
} else if (map[i][j] == 4) {
map[i][j] = a4;
}
j++;
}
i++;
}
mapx = [[6, 6, 6, 6], [6, 6, 6, 6], [6, 6, 6, 6], [6, 6, 6, 6]];
if (restarter == 0) {
tour = random(4) + 1;
}
if (tour == 1) {
var i = 0;
while (i < 4) {
var j = 0;
while (j < 4) {
mapx[i][j] = map[j][3 - i];
j++;
}
i++;
}
}
if (tour == 2) {
var i = 0;
while (i < 4) {
var j = 0;
while (j < 4) {
mapx[i][j] = map[3 - i][3 - j];
j++;
}
i++;
}
}
if (tour == 3) {
var i = 0;
while (i < 4) {
var j = 0;
while (j < 4) {
mapx[i][j] = map[3 - j][i];
j++;
}
i++;
}
}
if (tour < 4) {
map = mapx;
}
init_x = 205;
init_y = 160;
delta_x = 48;
delta_y = 27;
delta_xy = -17;
xh = 5.2;
xv = 1.7;
yv = 2.7;
depth = 0;
table = [];
_root.fond.Bright._alpha = 50;
_root.fond1.Bright._alpha = 50;
_root.fond2.Bright._alpha = 50;
_root.fond3.Bright._alpha = 50;
_root.fond.Bleft._alpha = 50;
_root.fond1.Bleft._alpha = 50;
_root.fond2.Bleft._alpha = 50;
_root.fond3.Bleft._alpha = 50;
_root.fond.Bup._alpha = 50;
_root.fond1.Bup._alpha = 50;
_root.fond2.Bup._alpha = 50;
_root.fond3.Bup._alpha = 50;
_root.fond.Bdown._alpha = 50;
_root.fond1.Bdown._alpha = 50;
_root.fond2.Bdown._alpha = 50;
_root.fond3.Bdown._alpha = 50;
_root.onEnterFrame = function () {
if (timer > 0) {
frame_cpt++;
timer = timer_max - Math.ceil(frame_cpt / 120);
tim.timer = timer;
}
if ((timer == 0) and (lives > 0)) {
if (_root.thesound == 1) {
_root.soundtimesup.start(0);
}
level--;
lives--;
restarter = 1;
nextFrame();
}
if ((timer == 3) && (first_boum == 0)) {
first_boum = 1;
if (_root.thesound == 1) {
_root.soundclocktick.start(0);
}
}
};
_root.onKey = function () {
if (playGame) {
if (Bright == 1) {
if (Key.isDown(39)) {
_root.remapper("right");
}
Bright = 0;
var _loc2 = doRight();
if (_loc2) {
moves++;
playGame = 0;
counter = 0;
gameClock = setInterval(this, "moveRight", 10);
}
} else if (Bleft == 1) {
if (Key.isDown(37)) {
_root.remapper("left");
}
Bleft = 0;
_loc2 = doLeft();
if (_loc2) {
moves++;
playGame = 0;
counter = 0;
gameClock = setInterval(this, "moveLeft", 10);
}
} else if (Bdown == 1) {
if (Key.isDown(40)) {
_root.remapper("down");
}
Bdown = 0;
_loc2 = doDown();
if (_loc2) {
moves++;
playGame = 0;
counter = 0;
gameClock = setInterval(this, "moveDown", 10);
}
} else if (Bup == 1) {
if (Key.isDown(38)) {
_root.remapper("up");
}
Bup = 0;
_loc2 = doUp();
if (_loc2) {
moves++;
playGame = 0;
counter = 0;
gameClock = setInterval(this, "moveUp", 10);
}
}
}
};
d = 0;
size = 50;
space = 30;
moves = 0;
playGame = 1;
gameClock = null;
buildMap(map);
winText = "";
Key.addListener(_root);
stop();
Instance of Symbol 97 MovieClip "restartEN" in Frame 3
on (release) {
_root.level--;
_root.lives--;
_root.timer_max = _root.timer_tab[_root.level];
_root.timer = _root.timer_max;
if (_root.thesound == 1) {
_root.soundtimesup.start(0);
}
_root.restarter = 1;
_root.nextFrame();
}
on (rollOver) {
this._alpha = 50;
}
on (rollOut) {
this._alpha = 100;
}
Instance of Symbol 99 MovieClip "testEN" in Frame 3
on (release) {
desturl = (("http://www.intelligence-test.eu/index.php?lang=" + _root.lang) + "&ref=") + _root.fond._url;
getURL (desturl);
_root.go_url = 1;
_root.go_url2 = desturl;
}
on (rollOver) {
this._alpha = 50;
}
on (rollOut) {
this._alpha = 100;
}
Instance of Symbol 101 MovieClip "restartFR" in Frame 3
on (release) {
_root.level--;
_root.lives--;
_root.timer_max = _root.timer_tab[_root.level];
_root.timer = _root.timer_max;
if (_root.thesound == 1) {
_root.soundtimesup.start(0);
}
_root.restarter = 1;
_root.nextFrame();
}
on (rollOver) {
this._alpha = 50;
}
on (rollOut) {
this._alpha = 100;
}
Instance of Symbol 104 MovieClip "testFR" in Frame 3
on (release) {
desturl = "http://www.test-de-qi.net/index.php?ref=" + _root.fond._url;
getURL (desturl);
_root.go_url = 1;
_root.go_url2 = desturl;
}
on (rollOver) {
this._alpha = 50;
}
on (rollOut) {
this._alpha = 100;
}
Frame 4
var i = 0;
while (i < H) {
var j = 0;
while (j < W) {
var ob = this[(("t_" + i) + "_") + j];
removeMovieClip(ob);
var ob2 = this[(("c_" + i) + "_") + j];
removeMovieClip(ob2);
j++;
}
i++;
}
level++;
if (lives > 0) {
prevFrame();
} else {
gameover._y = 150;
if (((lang == "fr") or (lang == "FR")) or (lang == "Fr")) {
saveEN._y = -1000;
saveFR._y = 270;
restartEN._y = -1000;
restartFR._y = 320;
} else {
saveFR._y = -1000;
saveEN._y = 270;
restartFR._y = -1000;
restartEN._y = 320;
}
}
Instance of Symbol 97 MovieClip "restartEN" in Frame 4
on (release) {
_root.level = 0;
_root.lives = 3;
_root.pts = 0;
_root.prevFrame();
}
on (rollOver) {
this._alpha = 50;
}
on (rollOut) {
this._alpha = 100;
}
Instance of Symbol 101 MovieClip "restartFR" in Frame 4
on (release) {
_root.level = 0;
_root.lives = 3;
_root.pts = 0;
_root.prevFrame();
}
on (rollOver) {
this._alpha = 50;
}
on (rollOut) {
this._alpha = 100;
}
Instance of Symbol 130 MovieClip "saveEN" in Frame 4
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.pts + 10) * 11;
equa2 = (_root.pts + 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++;
}
desturl = (("http://www.high-scores.eu/index.php?page=10&game=6&lang=" + _root.lang) + "&result=") + codage;
getURL (desturl);
_root.go_url = 1;
_root.go_url2 = desturl;
}
on (rollOver) {
this._alpha = 50;
}
on (rollOut) {
this._alpha = 100;
}
Instance of Symbol 132 MovieClip "saveFR" in Frame 4
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.pts + 10) * 11;
equa2 = (_root.pts + 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++;
}
desturl = (("http://www.high-scores.eu/index.php?page=10&game=6&lang=" + _root.lang) + "&result=") + codage;
getURL (desturl);
_root.go_url = 1;
_root.go_url2 = desturl;
}
on (rollOver) {
this._alpha = 50;
}
on (rollOut) {
this._alpha = 100;
}
Symbol 12 MovieClip [tile] Frame 1
stop();
Symbol 18 MovieClip [Cube] Frame 1
stop();
Symbol 22 Button
on (press) {
getURL ("http://www.flash-gamer.eu");
}
Symbol 23 Button
on (press) {
getURL ("http://www.high-scores.eu");
}
Symbol 24 Button
on (press) {
getURL ("http://www.iq-tests.eu");
}
Symbol 25 Button
on (press) {
getURL ("http://www.zodiac-games.com");
}
Symbol 26 Button
on (press) {
getURL ("http://www.intelligence-test.eu");
}
Symbol 27 Button
on (press) {
getURL ("http://www.my-iq.net");
}
Symbol 28 Button
on (press) {
getURL ("http://www.z-lyrics.eu");
}
Symbol 29 Button
on (press) {
getURL ("http://www.inachisio.com");
}
Symbol 30 Button
on (press) {
getURL ("http://www.clock4blog.eu");
}
Symbol 31 Button
on (press) {
getURL ("http://www.photo-pixel.eu");
}
Symbol 32 Button
on (press) {
getURL ("http://www.guitare-tabs.eu");
}
Symbol 33 Button
on (press) {
getURL ("http://www.test-de-qi.eu");
}
Symbol 34 Button
on (press) {
getURL ("http://www.agora-photo.com");
}
Symbol 35 Button
on (press) {
getURL ("http://www.test-de-qi.net");
}
Symbol 36 MovieClip Frame 1
if (_root.go == 1) {
if ((_root.red._alpha > 0) or (_root.green._alpha < 100)) {
_root.red._alpha = _root.red._alpha - 3;
_root.green._alpha = _root.green._alpha + 3;
}
} else if ((_root.red._alpha < 100) or (_root.green._alpha > 0)) {
_root.red._alpha = _root.red._alpha + 3;
_root.green._alpha = _root.green._alpha - 3;
}
if (_root._url.substr(0, 4) == "http") {
if (_root.go_url == 1) {
_root.timetogodeb = getTimer();
_root.go_url = 2;
}
if ((_root.go_url == 2) and ((getTimer() - _root.timetogodeb) > 1000)) {
getURL (_root.go_url2, "_blank");
_root.go_url = 0;
}
}
Symbol 36 MovieClip Frame 2
if (_root.go == 1) {
if ((_root.red._alpha > 0) or (_root.green._alpha < 100)) {
_root.red._alpha = _root.red._alpha - 3;
_root.green._alpha = _root.green._alpha + 3;
}
} else if ((_root.red._alpha < 100) or (_root.green._alpha > 0)) {
_root.red._alpha = _root.red._alpha + 3;
_root.green._alpha = _root.green._alpha - 3;
}
if (_root._url.substr(0, 4) == "http") {
if (_root.go_url == 1) {
_root.timetogodeb = getTimer();
_root.go_url = 2;
}
if ((_root.go_url == 2) and ((getTimer() - _root.timetogodeb) > 1000)) {
getURL (_root.go_url2, "_blank");
_root.go_url = 0;
}
}
Symbol 52 Button
on (release) {
desturl = "http://www.high-scores.eu/index.php?lang=" + _root.lang;
getURL (desturl);
_root.go_url = 1;
_root.go_url2 = desturl;
}
on (rollOver) {
_root.go = 1;
}
on (rollOut) {
_root.go = 0;
}
Symbol 80 Button
on (release) {
_root.remapper("left");
_root.Bleft = 1;
_root.onKey();
}
on (rollOver) {
_root.fond.Bleft._alpha = 100;
_root.fond1.Bleft._alpha = 100;
_root.fond2.Bleft._alpha = 100;
_root.fond3.Bleft._alpha = 100;
}
on (rollOut) {
_root.fond.Bleft._alpha = 50;
_root.fond1.Bleft._alpha = 50;
_root.fond2.Bleft._alpha = 50;
_root.fond3.Bleft._alpha = 50;
}
Symbol 82 Button
on (release) {
_root.remapper("right");
_root.Bright = 1;
_root.onKey();
}
on (rollOver) {
_root.fond.Bright._alpha = 100;
_root.fond1.Bright._alpha = 100;
_root.fond2.Bright._alpha = 100;
_root.fond3.Bright._alpha = 100;
}
on (rollOut) {
_root.fond.Bright._alpha = 50;
_root.fond1.Bright._alpha = 50;
_root.fond2.Bright._alpha = 50;
_root.fond3.Bright._alpha = 50;
}
Symbol 84 Button
on (release) {
_root.remapper("up");
_root.Bup = 1;
_root.onKey();
}
on (rollOver) {
_root.fond.Bup._alpha = 100;
_root.fond1.Bup._alpha = 100;
_root.fond2.Bup._alpha = 100;
_root.fond3.Bup._alpha = 100;
}
on (rollOut) {
_root.fond.Bup._alpha = 50;
_root.fond1.Bup._alpha = 50;
_root.fond2.Bup._alpha = 50;
_root.fond3.Bup._alpha = 50;
}
Symbol 86 Button
on (release) {
_root.remapper("down");
_root.Bdown = 1;
_root.onKey();
}
on (rollOver) {
_root.fond.Bdown._alpha = 100;
_root.fond1.Bdown._alpha = 100;
_root.fond2.Bdown._alpha = 100;
_root.fond3.Bdown._alpha = 100;
}
on (rollOut) {
_root.fond.Bdown._alpha = 50;
_root.fond1.Bdown._alpha = 50;
_root.fond2.Bdown._alpha = 50;
_root.fond3.Bdown._alpha = 50;
}
Symbol 102 Button
on (release) {
_root.error.start(0);
_root.init();
}
on (rollOver) {
this.button._alpha = 30;
}
on (rollOut) {
this.button._alpha = 0;
}
Symbol 115 Button
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;
}
}