Frame 1
Stage.showMenu = false;
var click = new Sound();
click.attachSound("click");
var click2 = new Sound();
click2.attachSound("click2");
animationspeed = 3;
strength = 6.5;
sound = true;
stop();
Instance of Symbol 26 MovieClip in Frame 1
onClipEvent (enterFrame) {
this._x = this._x - 1;
this._y = this._y - 1;
if (_x < -200) {
_x = 750;
}
if (_y < -200) {
_y = 600;
}
}
Instance of Symbol 26 MovieClip in Frame 1
onClipEvent (enterFrame) {
this._x = this._x + 1;
this._y = this._y + 1;
if (_x > 750) {
_x = -200;
}
if (_y > 600) {
_y = -200;
}
}
Instance of Symbol 26 MovieClip in Frame 1
onClipEvent (enterFrame) {
this._x = this._x + 1;
this._y = this._y - 1;
if (_x > 750) {
_x = -200;
}
if (_y < -200) {
_y = 600;
}
}
Instance of Symbol 26 MovieClip in Frame 1
onClipEvent (enterFrame) {
this._x = this._x - 1;
this._y = this._y + 1;
if (_x < -200) {
_x = 750;
}
if (_y > 600) {
_y = -200;
}
}
Instance of Symbol 65 MovieClip in Frame 1
onClipEvent (load) {
_root.stop();
}
Frame 2
stop();
Frame 3
function init() {
ltcpX = 430;
ltcpY = 60;
ltppX = 430;
ltppY = 230;
squaredir = ["rd", "ld", "ru", "lu"];
numbers = [undefined, "a", "b", "c", "d", "e", "f", "g", "h", undefined];
letters = {a:1, b:2, c:3, d:4, e:5, f:6, g:7, h:8};
squares = {a1:"player1", c1:"player1", e1:"player1", g1:"player1", b2:"player1", d2:"player1", f2:"player1", h2:"player1", a3:"player1", c3:"player1", e3:"player1", g3:"player1", b6:"player2", d6:"player2", f6:"player2", h6:"player2", a7:"player2", c7:"player2", e7:"player2", g7:"player2", b8:"player2", d8:"player2", f8:"player2", h8:"player2"};
piecePos = {a1:"p1_a1", c1:"p1_c1", e1:"p1_e1", g1:"p1_g1", b2:"p1_b2", d2:"p1_d2", f2:"p1_f2", h2:"p1_h2", a3:"p1_a3", c3:"p1_c3", e3:"p1_e3", g3:"p1_g3", b6:"p2_b6", d6:"p2_d6", f6:"p2_f6", h6:"p2_h6", a7:"p2_a7", c7:"p2_c7", e7:"p2_e7", g7:"p2_g7", b8:"p2_b8", d8:"p2_d8", f8:"p2_f8", h8:"p2_h8"};
}
function reset() {
for (var piece in _root.main_game) {
if (piece != "board") {
var square = piece.split("_");
var rac = square[1].split("");
var point = {x:eval (("_root.main_game.board." + square[1]) + "._x"), y:eval (("_root.main_game.board." + square[1]) + "._y")};
_root.main_game.board.localToGlobal(point);
setProperty(eval ("_root.main_game." + piece), _x , point.x);
setProperty(eval ("_root.main_game." + piece), _y , point.y);
eval ("_root.main_game." + piece).gotoAndStop(1);
delete eval (("_root.main_game." + piece) + ".graphic.original.s");
eval (("_root.main_game." + piece) + ".graphic").original = new Object();
eval (("_root.main_game." + piece) + ".graphic").original.c = rac[0];
eval (("_root.main_game." + piece) + ".graphic").original.r = rac[1];
_root.main_game[piece].graphic.playing = true;
}
}
if (!sound) {
sound_btn.soundon._visible = false;
}
animating = false;
squares = {a1:"player1", c1:"player1", e1:"player1", g1:"player1", b2:"player1", d2:"player1", f2:"player1", h2:"player1", a3:"player1", c3:"player1", e3:"player1", g3:"player1", b6:"player2", d6:"player2", f6:"player2", h6:"player2", a7:"player2", c7:"player2", e7:"player2", g7:"player2", b8:"player2", d8:"player2", f8:"player2", h8:"player2"};
piecePos = {a1:"p1_a1", c1:"p1_c1", e1:"p1_e1", g1:"p1_g1", b2:"p1_b2", d2:"p1_d2", f2:"p1_f2", h2:"p1_h2", a3:"p1_a3", c3:"p1_c3", e3:"p1_e3", g3:"p1_g3", b6:"p2_b6", d6:"p2_d6", f6:"p2_f6", h6:"p2_h6", a7:"p2_a7", c7:"p2_c7", e7:"p2_e7", g7:"p2_g7", b8:"p2_b8", d8:"p2_d8", f8:"p2_f8", h8:"p2_h8"};
}
function rand() {
return(random(100 * Math.ceil(strength)) / 100);
}
function findMove(forcedPiece) {
comPieceNum = 0;
plPieceNum = 0;
goodMoveScore = worstmove;
goodMovePiece = "";
goodMoveName = "";
for (var piece in _root.main_game) {
if (piece != "board") {
curLet = eval ("_root.main_game." + piece).graphic.original.c;
curNumb = eval ("_root.main_game." + piece).graphic.original.r;
playing = _root.main_game[piece].graphic.playing;
if (curLet == undefined) {
curLet = _root.main_game[piece].originalc;
curNumb = _root.main_game[piece].originalr;
_root.main_game[piece].graphic.original = new Object();
_root.main_game[piece].graphic.original.c = curLet;
_root.main_game[piece].graphic.original.r = curNumb;
_root.main_game[piece].graphic.original.s = curLet + curNumb;
_root.main_game[piece].graphic.news = new Array();
_root.main_game[piece].graphic.news[0] = curLet;
_root.main_game[piece].graphic.news[1] = curNumb;
_root.main_game[piece].graphic.playing = true;
playing = true;
}
if ((squares[curLet + curNumb] == "player2") && (playing)) {
comPieceNum = comPieceNum + 1;
movePiece = undefined;
moveScore = startScore;
moveJump = false;
rnd = rand();
nextLet = numbers[int(letters[curLet]) + 1];
secnextLet = numbers[int(letters[curLet]) + 2];
thirdnextLet = numbers[int(letters[curLet]) + 3];
prevLet = numbers[int(letters[curLet]) - 1];
secprevLet = numbers[int(letters[curLet]) - 2];
thirdprevLet = numbers[int(letters[curLet]) - 3];
nextNumb = int(curNumb) + 1;
secnextNumb = int(curNumb) + 2;
thirdnextNumb = int(curNumb) + 3;
prevNumb = curNumb - 1;
secprevNumb = curNumb - 2;
thirdprevNumb = curNumb - 3;
rd = squares[(rds = nextLet + prevNumb)];
rrdd = squares[(rrdds = secnextLet + secprevNumb)];
rrrd = squares[(rrrds = thirdnextLet + prevNumb)];
rrrddd = squares[(rrrddds = thirdnextLet + thirdprevNumb)];
rddd = squares[(rdds = nextLet + thirdprevNumb)];
ld = squares[(lds = prevLet + prevNumb)];
lldd = squares[(lldds = secprevLet + secprevNumb)];
llld = squares[(lllds = thirdprevLet + prevNumb)];
lllddd = squares[(lllddds = thirdprevLet + thirdprevNumb)];
lddd = squares[(lddds = prevLet + thirdprevNumb)];
ru = squares[(rus = nextLet + nextNumb)];
rruu = squares[(rruus = secnextLet + secnextNumb)];
rrru = squares[(rrrus = thirdnextLet + nextNumb)];
rrruuu = squares[(rrruuus = thirdnextLet + thirdnextNumb)];
ruuu = squares[(ruuus = nextLet + thirdnextNumb)];
lu = squares[(lus = prevLet + nextNumb)];
lluu = squares[(lluus = secprevLet + secnextNumb)];
lllu = squares[(lllus = thirdprevLet + nextNumb)];
llluuu = squares[(llluuus = thirdprevLet + thirdnextNumb)];
luuu = squares[(luuus = prevLet + thirdnextNumb)];
ll = squares[(lls = secprevLet + curNumb)];
rr = squares[(rrs = secnextLet + curNumb)];
uu = squares[(uus = curLet + secnextNumb)];
dd = squares[(dds = curLet + secprevNumb)];
for (var x in squaredir) {
if ((_root[squaredir[x]] == "player1") && (_root.main_game[piecePos[_root[squaredir[x] + "s"]]]._currentframe == 2)) {
_root[squaredir[x] + "k"] = true;
} else {
_root[squaredir[x] + "k"] = undefined;
}
}
pieceType = _root.main_game[piece]._currentframe;
if (((!rd) && (nextLet)) && (prevNumb > 0)) {
if ((((((((((((ld == "player1") && (!ru)) && (nextNumb < 9)) || ((lddd == "player1") && (dd == "player2"))) || ((rrrddd == "player1") && (rrdd == "player2"))) || (luk)) || ((ruk && (!ld)) && (prevLet))) || (rrruk && (rr == "player2"))) && (rrdd != "player1")) && (!(((dd == "player1") && (!rr)) && (secnextLet)))) && (!((ld == "player2") && (lldd == "player1")))) && (!((!dd) && (rrk)))) {
movePiece = nextLet + prevNumb;
moveScore = (2 + pieceType) + rnd;
} else if ((((((rrdd == "player1") || (((dd == "player1") && (!rr)) && (secnextLet))) || ((ld == "player2") && (lldd == "player1"))) || (lluuk && (lu == "player2"))) || (rruuk && (ru == "player2"))) || ((rrk && (!dd)) && (secprevNumb > 0))) {
movePiece = nextLet + prevNumb;
moveScore = (-pieceType) + rnd;
} else {
movePiece = nextLet + prevNumb;
moveScore = 1 + rnd;
}
} else if ((((rd == "player1") && (rrdd == undefined)) && (secnextLet != undefined)) && (secprevNumb > 0)) {
if (moveScore < (50 + rand())) {
movePiece = secnextLet + secprevNumb;
moveScore = 50 + rnd;
moveJump = true;
jps = nextLet + prevNumb;
}
}
if (((!ld) && (prevLet)) && (prevNumb > 0)) {
if ((((((((((((rd == "player1") && (!lu)) && (nextNumb < 9)) || ((rddd == "player1") && (dd == "player2"))) || ((lllddd == "player1") && (lldd == "player2"))) || (ruk)) || ((luk && (!rd)) && (nextLet))) || (llluk && (ll == "player2"))) && (lldd != "player1")) && (!(((dd == "player1") && (!ll)) && (secprevLet)))) && (!((rd == "player2") && (rrdd == "player1")))) && (!((!dd) && (llk)))) {
if (((moveScore < ((2 + pieceType) + rand())) && (!Giveaway)) || ((Giveaway && (!moveJump)) && (moveScore > ((2 + pieceType) + rand())))) {
movePiece = prevLet + prevNumb;
moveScore = (2 + pieceType) + rnd;
}
} else if ((((((lldd == "player1") || (((dd == "player1") && (!ll)) && (secprevLet))) || ((rd == "player2") && (rrdd == "player1"))) || (rruuk && (ru == "player2"))) || (lluuk && (lu == "player2"))) || ((llk && (!dd)) && (secprevNumb > 0))) {
if (((moveScore < ((-pieceType) + rand())) && (!Giveaway)) || ((Giveaway && (!moveJump)) && (moveScore > ((-pieceType) + rand())))) {
movePiece = prevLet + prevNumb;
moveScore = (-pieceType) + rnd;
}
} else if (((moveScore < (1 + rand())) && (!Giveaway)) || ((Giveaway && (!moveJump)) && (moveScore > (1 + rand())))) {
movePiece = prevLet + prevNumb;
moveScore = 1 + rnd;
}
} else if ((((ld == "player1") && (lldd == undefined)) && (secprevLet != undefined)) && (secprevNumb > 0)) {
if (moveScore < (50 + rand())) {
movePiece = secprevLet + secprevNumb;
moveScore = 50 + rnd;
moveJump = true;
jps = prevLet + prevNumb;
}
}
if (pieceType == 2) {
if (((!ru) && (nextLet)) && (nextNumb < 9)) {
if ((((((((((((ld == "player1") || ((rd == "player1") && (!lu))) || ((rr == "player2") && (rrrd == "player1"))) || ((luk && (!rd)) && (prevNumb > 0))) || (luuuk && (uu == "player2"))) || (rrruuuk && (rruu == "player2"))) && (!(((rr == "player1") && (!uu)) && (secnextNumb < 9)))) && (rruu != "player1")) && (!((uuk && (!rr)) && (secnextLet)))) && (!((ld == "player2") && (lldd == "player1")))) && (!((rd == "player2") && (rrdd == "player1")))) && (!(lluuk && (lu == "player2")))) {
if (((moveScore < ((2 + pieceType) + rand())) && (!Giveaway)) || ((Giveaway && (!moveJump)) && (moveScore > ((2 + pieceType) + rand())))) {
movePiece = nextLet + nextNumb;
moveScore = (2 + pieceType) + rnd;
}
} else if (((((((rr == "player1") && (!uu)) && (secnextNumb < 9)) || ((ld == "player2") && (lldd == "player1"))) || ((rd == "player2") && (rrdd == "player1"))) || (rruuk)) || ((uuk && (!rr)) && (secnextLet))) {
if (((moveScore < ((-pieceType) + rand())) && (!Giveaway)) || ((Giveaway && (!moveJump)) && (moveScore > ((-pieceType) + rand())))) {
movePiece = nextLet + nextNumb;
moveScore = (-pieceType) + rnd;
}
} else if (((moveScore < (1 + rand())) && (!Giveaway)) || ((Giveaway && (!moveJump)) && (moveScore > (1 + rand())))) {
movePiece = nextLet + nextNumb;
moveScore = 1 + rnd;
}
} else if ((((ru == "player1") && (rruu == undefined)) && (secnextLet != undefined)) && (secnextNumb < 9)) {
if (moveScore < (50 + rand())) {
movePiece = secnextLet + secnextNumb;
moveScore = 50 + rnd;
moveJump = true;
jps = nextLet + nextNumb;
}
}
if (((!lu) && (prevLet)) && (nextNumb < 9)) {
if ((((((((((((rd == "player1") || ((ld == "player1") && (!ru))) || ((ll == "player2") && (llld == "player1"))) || ((ruk && (!ld)) && (prevNumb > 0))) || (ruuuk && (uu == "player2"))) || (llluuuk && (lluu == "player2"))) && (!(((ll == "player1") && (!uu)) && (secnextNumb < 9)))) && (lluu != "player1")) && (!((uuk && (!ll)) && (secprevLet)))) && (!((rd == "player2") && (rrdd == "player1")))) && (!((ld == "player2") && (lldd == "player1")))) && (!(rruuk && (ru == "player2")))) {
if (((moveScore < ((2 + pieceType) + rand())) && (!Giveaway)) || ((Giveaway && (!moveJump)) && (moveScore > ((2 + pieceType) + rand())))) {
movePiece = prevLet + nextNumb;
moveScore = (2 + pieceType) + rnd;
}
} else if (((((((ll == "player1") && (!uu)) && (secnextNumb < 9)) || ((rd == "player2") && (rrdd == "player1"))) || ((ld == "player2") && (lldd == "player1"))) || (lluuk)) || ((uuk && (!ll)) && (secprevLet))) {
if (((moveScore < ((-pieceType) + rand())) && (!Giveaway)) || ((Giveaway && (!moveJump)) && (moveScore > ((-pieceType) + rand())))) {
movePiece = prevLet + nextNumb;
moveScore = (-pieceType) + rnd;
}
} else if (((moveScore < (1 + rand())) && (!Giveaway)) || ((Giveaway && (!moveJump)) && (moveScore > (1 + rand())))) {
movePiece = prevLet + nextNumb;
moveScore = 1 + rnd;
}
} else if ((((lu == "player1") && (lluu == undefined)) && (secprevLet != undefined)) && (secnextNumb < 9)) {
if (moveScore < (50 + rand())) {
movePiece = secprevLet + secnextNumb;
moveScore = 50 + rnd;
moveJump = true;
jps = prevLet + nextNumb;
}
}
}
if (Giveaway && (!moveJump)) {
moveScore = -moveScore;
}
if (((moveScore > goodMoveScore) && (piece != forcedPiece)) && (movePiece)) {
goodMoveSquare = curLet + curNumb;
goodMoveScore = moveScore;
goodMoveJump = moveJump;
goodjps = jps;
goodMovePiece = movePiece;
goodMoveName = piece;
} else if (piece == forcedPiece) {
goodMoveSquare = curLet + curNumb;
goodMoveScore = moveScore + 100;
goodMoveJump = moveJump;
goodjps = jps;
goodMovePiece = movePiece;
goodMoveName = piece;
}
} else if ((squares[curLet + curNumb] == "player1") && (playing)) {
plPieceNum = plPieceNum + 1;
}
}
}
winner();
if (goodMoveName != "") {
changePiecePos(goodMoveName, goodMovePiece, goodMoveSquare);
if (goodMoveJump) {
if (!Atomic) {
removePiece(goodjps);
if (jump(goodMoveName) && (!Extreme)) {
animatingnextmove = goodMoveName;
}
}
}
}
}
function numMoves(player) {
numLegMoves = 0;
comPieceNum = 0;
plPieceNum = 0;
for (var piece in _root.main_game) {
if (piece != "board") {
curLet = eval ("_root.main_game." + piece).graphic.original.c;
curNumb = eval ("_root.main_game." + piece).graphic.original.r;
playing = _root.main_game[piece].graphic.playing;
if (curLet == undefined) {
curLet = _root.main_game[piece].originalc;
curNumb = _root.main_game[piece].originalr;
_root.main_game[piece].graphic.original = new Object();
_root.main_game[piece].graphic.original.c = curLet;
_root.main_game[piece].graphic.original.r = curNumb;
_root.main_game[piece].graphic.playing = true;
playing = true;
}
if ((squares[curLet + curNumb] == player) && (playing)) {
if (player == "player2") {
opp = "player1";
} else {
opp = "player2";
}
pieceNum = pieceNum + 1;
nextLet = numbers[int(letters[curLet]) + 1];
secnextLet = numbers[int(letters[curLet]) + 2];
prevLet = numbers[int(letters[curLet]) - 1];
secprevLet = numbers[int(letters[curLet]) - 2];
nextNumb = int(curNumb) + 1;
secnextNumb = int(curNumb) + 2;
prevNumb = curNumb - 1;
secprevNumb = curNumb - 2;
rd = squares[nextLet + prevNumb];
rrdd = squares[secnextLet + secprevNumb];
ld = squares[prevLet + prevNumb];
lldd = squares[secprevLet + secprevNumb];
pieceType = eval ("_root.main_game." + piece)._currentframe;
if ((player == "player2") or (pieceType == 2)) {
if (((rd == undefined) && (nextLet != undefined)) && (prevNumb > 0)) {
numLegMoves = numLegMoves + 1;
} else if ((((rd == opp) && (rrdd == undefined)) && (secnextLet != undefined)) && (secprevNumb > 0)) {
numLegMoves = numLegMoves + 1;
}
if (((ld == undefined) && (prevLet != undefined)) && (prevNumb > 0)) {
numLegMoves = numLegMoves + 1;
} else if ((((ld == opp) && (lldd == undefined)) && (secprevLet != undefined)) && (secprevNumb > 0)) {
numLegMoves = numLegMoves + 1;
}
}
if ((player == "player1") or (pieceType == 2)) {
ru = squares[nextLet + nextNumb];
rruu = squares[secnextLet + secnextNumb];
lu = squares[prevLet + nextNumb];
lluu = squares[secprevLet + secnextNumb];
if (((ru == undefined) && (nextLet != undefined)) && (nextNumb < 9)) {
numLegMoves = numLegMoves + 1;
} else if ((((ru == opp) && (rruu == undefined)) && (secnextLet != undefined)) && (secnextNumb < 9)) {
numLegMoves = numLegMoves + 1;
}
if (((lu == undefined) && (prevLet != undefined)) && (nextNumb < 9)) {
numLegMoves = numLegMoves + 1;
} else if ((((lu == opp) && (lluu == undefined)) && (secprevLet != undefined)) && (secnextNumb < 9)) {
numLegMoves = numLegMoves + 1;
}
}
}
}
}
return(numLegMoves);
}
function changePiecePos(pname, endSquare, startSquare) {
var point = new Object();
point.x = eval (("_root.main_game.board." + endSquare) + "._x");
point.y = eval (("_root.main_game.board." + endSquare) + "._y");
_root.main_game.board.localToGlobal(point);
_root.main_game.globalToLocal(point);
_root.main_game[pname].x = point.x;
_root.main_game[pname].y = point.y;
animating = true;
animatingpiece = pname;
delete _root.squares[startSquare];
_root.squares[endSquare] = "player2";
delete _root.piecePos[startSquare];
_root.piecePos[endSquare] = pname;
eval ("_root.main_game." + pname).graphic.original.s = endSquare;
var news = endSquare.split("");
eval ("_root.main_game." + pname).graphic.original.c = news[0];
eval ("_root.main_game." + pname).graphic.original.r = news[1];
if (news[1] == "1") {
_root.main_game[pname].gotoAndStop(2);
_root.main_game[pname].graphic.playing = true;
_root.main_game[pname].originalc = news[0];
_root.main_game[pname].originalr = news[1];
_root.main_game[pname].news = news[0];
}
}
function removePiece(jps) {
jumpedPiece = _root.piecePos[jps];
if (jumpedPiece == _root.dragging) {
_root.main_game[jumpedPiece].stopDrag();
}
if (squares[jps] == "player1") {
jppX = "ltppX";
jppY = "ltppY";
} else {
jppX = "ltcpX";
jppY = "ltcpY";
}
_root.main_game[jumpedPiece].graphic.playing = false;
_root.main_game[jumpedPiece]._x = _root[jppX];
_root.main_game[jumpedPiece]._y = _root[jppY];
_root[jppX] = _root[jppX] + 40;
if (_root[jppX] > 510) {
_root[jppX] = _root[jppX] - 120;
_root[jppY] = _root[jppY] + 40;
}
delete _root.squares[jps];
delete _root.piecePos[jps];
}
function jump(piece) {
curLet = _root.main_game[piece].graphic.original.c;
curNumb = _root.main_game[piece].graphic.original.r;
if (curLet == undefined) {
return(false);
}
nextLet = numbers[int(letters[curLet]) + 1];
secnextLet = numbers[int(letters[curLet]) + 2];
prevLet = numbers[int(letters[curLet]) - 1];
secprevLet = numbers[int(letters[curLet]) - 2];
nextNumb = int(curNumb) + 1;
secnextNumb = int(curNumb) + 2;
prevNumb = curNumb - 1;
secprevNumb = curNumb - 2;
rd = squares[nextLet + prevNumb];
rrdd = squares[secnextLet + secprevNumb];
ld = squares[prevLet + prevNumb];
lldd = squares[secprevLet + secprevNumb];
ru = squares[nextLet + nextNumb];
rruu = squares[secnextLet + secnextNumb];
lu = squares[prevLet + nextNumb];
lluu = squares[secprevLet + secnextNumb];
pieceType = eval ("_root.main_game." + piece)._currentframe;
if (squares[curLet + curNumb] == "player2") {
if ((((rd == "player1") && (rrdd == undefined)) && (secnextLet != undefined)) && (secprevNumb > 0)) {
return(true);
}
if ((((ld == "player1") && (lldd == undefined)) && (secprevLet != undefined)) && (secprevNumb > 0)) {
return(true);
}
if (pieceType == 2) {
if ((((ru == "player1") && (rruu == undefined)) && (secnextLet != undefined)) && (secnextNumb < 9)) {
return(true);
}
if ((((lu == "player1") && (lluu == undefined)) && (secprevLet != undefined)) && (secnextNumb < 9)) {
return(true);
}
}
} else if (squares[curLet + curNumb] == "player1") {
if ((((ru == "player2") && (rruu == undefined)) && (secnextLet != undefined)) && (secnextNumb < 9)) {
return(true);
}
if ((((lu == "player2") && (lluu == undefined)) && (secprevLet != undefined)) && (secnextNumb < 9)) {
return(true);
}
if (pieceType == 2) {
if ((((rd == "player2") && (rrdd == undefined)) && (secnextLet != undefined)) && (secprevNumb > 0)) {
return(true);
}
if ((((ld == "player2") && (lldd == undefined)) && (secprevLet != undefined)) && (secprevNumb > 0)) {
return(true);
}
}
}
return(false);
}
function jumpPossible(player) {
for (var _local2 in _root.main_game) {
curLet = _root.main_game[_local2].graphic.original.c;
curNumb = _root.main_game[_local2].graphic.original.r;
playing = _root.main_game[_local2].graphic.playing;
if (curLet == undefined) {
curLet = _root.main_game[_local2].originalc;
curNumb = _root.main_game[_local2].originalr;
playing = true;
}
if (((squares[curLet + curNumb] == player) && (playing)) && (jump(_local2))) {
return(true);
}
}
return(false);
}
function showJumps(player) {
for (var _local3 in _root.main_game) {
curLet = _root.main_game[_local3].graphic.original.c;
curNumb = _root.main_game[_local3].graphic.original.r;
playing = _root.main_game[_local3].graphic.playing;
if (((squares[curLet + curNumb] == player) && (playing)) && (jump(_local3))) {
x = (letters[curLet] - 1) * 50;
y = (8 - curNumb) * 50;
attachMovie("squareBorder", ("sb" + curLet) + curNumb, (100 + (letters[curLet] * 10)) + curNumb);
this[("sb" + curLet) + curNumb]._x = x;
this[("sb" + curLet) + curNumb]._y = y;
this[("sb" + curLet) + curNumb]._alpha = 1;
this[("sb" + curLet) + curNumb].dir = 1;
this[("sb" + curLet) + curNumb].times = 1;
this[("sb" + curLet) + curNumb].onEnterFrame = function () {
if ((this._alpha < 0) || (this._alpha > 100)) {
this.dir = -this.dir;
this.times = this.times + 1;
} else if (this.times > 6) {
removeMovieClip(this);
}
this._alpha = this._alpha + (15 * this.dir);
};
}
}
}
function winner() {
if ((numMoves("player1") == 0) && ((turn == "player") || (Extreme))) {
if (numMoves("player2") == 0) {
_root.winner = "Draw";
} else {
_root.winner = "You lost";
}
gotoAndStop (4);
} else if ((numMoves("player2") == 0) && ((turn == "comp") || (Extreme))) {
if (numMoves("player1") == 0) {
_root.winner = "Draw";
} else {
_root.winner = "You won!";
}
gotoAndStop (4);
}
}
function hidePieces(action) {
for (var _local3 in _root.main_game) {
playing = _root.main_game[_local3].graphic.playing;
if (playing && (_root.main_game[_local3]._visible != action)) {
_root.main_game[_local3]._visible = action;
}
}
}
function explode(exsquare) {
var _local4 = exsquare.split("");
curLet = _local4[0];
curNumb = _local4[1];
nextLet = numbers[int(letters[curLet]) + 1];
prevLet = numbers[int(letters[curLet]) - 1];
nextNumb = int(curNumb) + 1;
prevNumb = curNumb - 1;
rd = squares[(rds = nextLet + prevNumb)];
ld = squares[(lds = prevLet + prevNumb)];
ru = squares[(rus = nextLet + nextNumb)];
lu = squares[(lus = prevLet + nextNumb)];
for (var _local3 in squaredir) {
if (this[squaredir[_local3]]) {
removePiece(this[squaredir[_local3] + "s"]);
}
}
if (_root.main_game[piecePos[exsquare]]._currentframe == 1) {
removePiece(exsquare);
}
}
init();
reset();
Instance of Symbol 106 MovieClip "main_game" in Frame 3
onClipEvent (load) {
if (_root.Extreme == true) {
_root.oldTime = getTimer();
_root.attachMovie("extremeTimer", "compMover", 100);
_root.compMover.attachMovie("Level", "Level", 109);
_root.compMover.Level.level.text = " Level " + int((_root.level / 200) + 1);
_root.compMover.Level.time = 20;
} else {
_root.attachMovie("normalCheckers", "compMover", 100);
}
}
onClipEvent (unload) {
removeMovieClip(_root.compMover);
}
onClipEvent (enterFrame) {
if (_parent.animating) {
pname = _parent.animatingpiece;
if (_root.main_game[pname].graphic.playing == true) {
speedx = (_root.main_game[pname].x - _root.main_game[pname]._x) / _root.animationspeed;
speedy = (_root.main_game[pname].y - _root.main_game[pname]._y) / _root.animationspeed;
minspeed = 0.8;
if (Math.abs(speedx) < minspeed) {
if (speedx < 0) {
speedx = -minspeed;
} else {
speedx = minspeed;
}
}
if (Math.abs(speedy) < minspeed) {
if (speedy < 0) {
speedy = -minspeed;
} else {
speedy = minspeed;
}
}
_root.main_game[pname]._x = _root.main_game[pname]._x + speedx;
_root.main_game[pname]._y = _root.main_game[pname]._y + speedy;
if (Math.abs(_root.main_game[pname]._x - _root.main_game[pname].x) < 1) {
if (_root.sound) {
_root.click2.start();
}
if (_root.Atomic && (_root.goodMoveJump)) {
_parent.animating = false;
_parent.animatingpiece = "";
_root.explode(_root.goodMovePiece);
_root.winner();
} else {
anm = _parent.animatingnextmove;
_parent.animating = false;
_parent.animatingpiece = "";
_parent.animatingnextmove = false;
if (anm) {
_parent.findMove(anm);
} else {
_parent.winner();
}
}
}
}
}
}
Instance of Symbol 110 MovieClip "sound_btn" in Frame 3
on (release) {
if (_root.sound) {
_root.sound = false;
soundon._visible = false;
} else {
_root.sound = true;
soundon._visible = true;
}
}
Frame 4
stop();
if (Giveaway) {
if (winner == "You won!") {
winner = "You lost";
} else {
winner = "You won!";
}
}
if ((winner == "You won!") && (Extreme)) {
NextLevel._visible = true;
ReplayLevel._visible = true;
PlayAgain._visible = false;
} else if (Extreme) {
NextLevel._visible = false;
ReplayLevel._visible = true;
PlayAgain._visible = false;
} else {
NextLevel._visible = false;
ReplayLevel._visible = false;
PlayAgain._visible = true;
}
Symbol 3 MovieClip [normalCheckers] Frame 1
if (_root.turn == "comp") {
_root.findMove();
_root.turn = "player";
}
Symbol 4 MovieClip [extremeTimer] Frame 1
_root.newTime = getTimer();
if ((_root.newTime - _root.oldTime) > (5000 - _root.level)) {
_root.findMove();
_root.oldTime = _root.newTime;
}
Symbol 7 MovieClip [Level] Frame 1
if (time > 1) {
_root.oldTime = getTimer();
time = time - 1;
_alpha = (time * 20);
} else {
_root.oldTime = getTimer() - _root.level;
removeMovieClip(this);
}
Symbol 11 Button
on (release) {
_root.init();
_root.reset();
removeMovieClip(this);
}
Symbol 13 Button
on (release) {
_root.gotoAndStop(2);
removeMovieClip(this);
}
Symbol 15 Button
on (release) {
removeMovieClip(this);
}
Instance of Symbol 21 MovieClip "bs" in Symbol 22 MovieClip Frame 1
/* no clip actions */
Instance of Symbol 24 MovieClip "ws" in Symbol 25 MovieClip Frame 1
/* no clip actions */
Symbol 49 MovieClip Frame 1
stop();
Instance of Symbol 48 MovieClip in Symbol 49 MovieClip Frame 1
onClipEvent (enterFrame) {
bar._xscale = (_root.getBytesLoaded() / _root.getBytesTotal()) * 100;
if (bar._xscale == 100) {
_root.percent = 100;
}
}
Symbol 64 MovieClip Frame 1
stop();
Symbol 65 MovieClip Frame 1
gotoAndPlay (2);
Instance of Symbol 46 MovieClip in Symbol 65 MovieClip Frame 1
on (release) {
getURL ("http://www.crazymonkeygames.com", "_blank");
}
Symbol 65 MovieClip Frame 81
stop();
_root.loaderdone = getTimer();
_root.createEmptyMovieClip("proceed", 11);
_root.proceed.onEnterFrame = function () {
if ((_root.loaderdone < (getTimer() - 1000)) && (_root.percent)) {
_root.gotoAndStop(2);
removeMovieClip(this);
} else {
_root.loaderdone++;
}
};
Instance of Symbol 64 MovieClip in Symbol 65 MovieClip Frame 81
onClipEvent (enterFrame) {
chance = random(90);
if (chance == 1) {
play();
}
}
Symbol 68 Button
on (release) {
if (_root.percent >= 100) {
_root.level = 0;
_root.Atomic = false;
_root.Giveaway = false;
_root.Extreme = true;
_root.worstmove = 1;
_root.startScore = -100;
gotoAndStop (5);
}
}
on (rollOver) {
description.text = "Checkers with a unique twist. Instead of taking turns moving you move as fast as you can.";
}
on (rollOut) {
description.text = "Pick a type of checkers to play.";
}
Symbol 71 Button
on (release) {
getURL ("http://www.webgamedesign.com", _blank);
}
on (rollOver) {
description.text = "Created by Ddot Design www.WebGameDesign.com";
}
on (rollOut) {
description.text = "Pick a type of checkers to play.";
}
Symbol 74 Button
on (press) {
startDrag (this, false, this.left, this.top, this.right, this.bottom);
}
on (release, releaseOutside) {
stopDrag();
_root.strength = Math.pow(1 - ((this.bottom - this._y) / 150), 2) * 50;
}
on (rollOver) {
_root.description.text = "Slide up and down to ajust the computer strength.";
}
on (rollOut) {
_root.description.text = "Pick a type of checkers to play.";
}
Symbol 75 MovieClip Frame 1
top = _y;
bottom = _y + 149;
left = _x;
right = _x;
_y = (((Math.sqrt(_root.strength / 50) * 150) - 1) + top);
Symbol 83 Button
on (release) {
if (_root.percent >= 100) {
_root.turn = "player";
_root.Atomic = false;
_root.Giveaway = true;
_root.Extreme = false;
_root.worstmove = -100;
_root.startScore = 49;
gotoAndStop (3);
}
}
on (rollOver) {
description.text = "Tired of taking all of your opponents pieces? If so this game is for you. The goal of this game is to force the other player to take all your pieces.";
}
on (rollOut) {
description.text = "Pick a type of checkers to play.";
}
Symbol 86 Button
on (release) {
if (_root.percent >= 100) {
_root.turn = "player";
_root.Atomic = false;
_root.Giveaway = false;
_root.Extreme = false;
_root.worstmove = -100;
_root.startScore = -100;
gotoAndStop (3);
}
}
on (rollOver) {
description.text = "Play a standard game of checkers against a computer. You must jump if possible.";
}
on (rollOut) {
description.text = "Pick a type of checkers to play.";
}
Symbol 90 Button
on (release) {
getURL ("http://www.crazymonkeygames.com", _blank);
}
on (rollOver) {
description.text = "Find many more fun games to play at Crazy Monkey Games.";
}
on (rollOut) {
description.text = "Pick a type of checkers to play.";
}
Symbol 95 Button
on (release) {
attachMovie("Menu", "Menu", 109);
Menu._x = 225;
Menu._y = 200;
_root.hidePieces(false);
Menu.onEnterFrame = function () {
_root.oldTime = getTimer();
};
Menu.onUnload = function () {
_root.hidePieces(true);
};
}
Symbol 100 MovieClip Frame 1
stop();
Instance of Symbol 97 MovieClip "graphic" in Symbol 100 MovieClip Frame 1
on (press) {
if (playing) {
if (_root.Extreme) {
_root.playerMustJump = false;
_root.ppn = false;
} else {
_root.playerMustJump = _root.jumpPossible("player1");
}
if (original.s == undefined) {
var news = [_root.numbers[Math.round((_parent._x + 25) / 50)], 9 - Math.round((_parent._y + 25) / 50)];
var original = {x:_parent._x, y:_parent._y, r:news[1], c:news[0], s:news[0] + news[1]};
} else {
var original = {x:_parent._x, y:_parent._y, r:news[1], c:news[0], s:original.s};
}
if (((!_root.ppn) or (_root.ppn == _parent._name)) && ((!_root.playerMustJump) or _root.jump(_parent._name))) {
_parent.startDrag();
_root.dragging = _parent._name;
_parent._x = _root.main_game._xmouse;
_parent._y = _root.main_game._ymouse;
} else {
_root.showJumps("player1");
}
}
}
on (release, releaseOutside) {
if (playing && (_root.dragging)) {
_root.dragging = false;
move = true;
jps = false;
var square = eval (eval (_parent._droptarget) + "._parent._name");
var square = square.split("");
_root.stopDrag();
if (((((((square[1] - original.r) == 1) && (Math.abs(_root.letters[square[0]] - _root.letters[original.c]) == 1)) && (_root.squares[eval (eval (_parent._droptarget) + "._parent._name")] == undefined)) && (!_root.ppn)) && (!_root.playerMustJump)) && ((!_root.animating) || (_root.Extreme))) {
var point = {x:eval (eval (_parent._droptarget) + "._parent._x"), y:eval (eval (_parent._droptarget) + "._parent._y")};
_root.main_game.board.localToGlobal(point);
_root.main_game.globalToLocal(point);
_parent._x = point.x;
_parent._y = point.y;
delete _root.squares[original.s];
delete _root.piecePos[original.s];
original.s = eval (eval (_parent._droptarget) + "._parent._name");
_root.squares[original.s] = "player1";
_root.piecePos[original.s] = _parent._name;
_root.squares[original.s] = "player1";
var news = original.s.split("");
original.c = news[0];
original.r = news[1];
jump = false;
} else if ((((((square[1] - original.r) == 2) && (Math.abs(_root.letters[square[0]] - _root.letters[original.c]) == 2)) && (_root.squares[_root.numbers[int(_root.letters[original.c]) + ((int(_root.letters[square[0]]) - int(_root.letters[original.c])) / 2)] + (int(original.r) + 1)] == "player2")) && (_root.squares[eval (eval (_parent._droptarget) + "._parent._name")] == undefined)) && ((!_root.animating) || (_root.Extreme))) {
jps = _root.numbers[int(_root.letters[original.c]) + ((int(_root.letters[square[0]]) - int(_root.letters[original.c])) / 2)] + (int(original.r) + 1);
_root.removePiece(jps);
var point = {x:eval (eval (_parent._droptarget) + "._parent._x"), y:eval (eval (_parent._droptarget) + "._parent._y")};
_root.main_game.board.localToGlobal(point);
_root.main_game.globalToLocal(point);
_parent._x = point.x;
_parent._y = point.y;
delete _root.squares[original.s];
delete _root.piecePos[original.s];
original.s = eval (eval (_parent._droptarget) + "._parent._name");
_root.squares[original.s] = "player1";
_root.piecePos[original.s] = _parent._name;
var news = original.s.split("");
original.c = news[0];
original.r = news[1];
jump = true;
} else {
_parent._x = original.x;
_parent._y = original.y;
move = false;
}
if (move == true) {
if (_root.sound) {
_root.click.start();
}
_parent.originalc = news[0];
_parent.originalr = news[1];
_parent.news = news[0];
if ((!_root.jump(_parent._name)) or (!jps)) {
_root.ppn = undefined;
_root.turn = "comp";
} else {
_root.ppn = _parent._name;
}
if (_root.Atomic && (jump)) {
_root.turn = "comp";
_root.ppn = undefined;
_root.explode(news[0] + news[1]);
}
if (news[1] == "8") {
_parent.gotoAndStop(2);
}
}
}
}
Symbol 100 MovieClip Frame 2
stop();
Instance of Symbol 99 MovieClip "graphic" in Symbol 100 MovieClip Frame 2
on (press) {
if ((!original.s) or (!original.c)) {
var original = {x:_parent._x, y:_parent._y, r:8, c:_parent.news, s:_parent.news + "8"};
playing = true;
} else {
var original = {x:_parent._x, y:_parent._y, r:news[1], c:news[0], s:original.s};
}
if (playing) {
if (_root.Extreme) {
_root.playerMustJump = false;
_root.ppn = false;
} else {
_root.playerMustJump = _root.jumpPossible("player1");
}
if (((!_root.ppn) or (_root.ppn == _parent._name)) && ((!_root.playerMustJump) or _root.jump(_parent._name))) {
_parent.startDrag();
_root.dragging = _parent._name;
_parent._x = _root.main_game._xmouse;
_parent._y = _root.main_game._ymouse;
} else {
_root.showJumps("player1");
}
}
}
on (release, releaseOutside) {
if (playing) {
_root.dragging = false;
move = true;
jps = false;
var square = eval (eval (_parent._droptarget) + "._parent._name");
var square = square.split("");
_parent.stopDrag();
if ((((((Math.abs(square[1] - original.r) == 1) && (Math.abs(_root.letters[square[0]] - _root.letters[original.c]) == 1)) && (_root.squares[eval (eval (_parent._droptarget) + "._parent._name")] == undefined)) && (!_root.ppn)) && (!_root.playerMustJump)) && ((!_root.animating) || (_root.Extreme))) {
var point = {x:eval (eval (_parent._droptarget) + "._parent._x"), y:eval (eval (_parent._droptarget) + "._parent._y")};
_root.main_game.board.localToGlobal(point);
_root.main_game.globalToLocal(point);
_parent._x = point.x;
_parent._y = point.y;
delete _root.squares[original.s];
delete _root.piecePos[original.s];
original.s = eval (eval (_parent._droptarget) + "._parent._name");
_root.squares[original.s] = "player1";
_root.piecePos[original.s] = _parent._name;
var news = original.s.split("");
original.c = news[0];
original.r = news[1];
jump = false;
} else if (((((Math.abs(square[1] - original.r) == 2) && (Math.abs(_root.letters[square[0]] - _root.letters[original.c]) == 2)) && (_root.squares[_root.numbers[int(_root.letters[original.c]) + ((int(_root.letters[square[0]]) - int(_root.letters[original.c])) / 2)] + (int(original.r) + ((square[1] - original.r) / 2))] == "player2")) && (_root.squares[eval (eval (_parent._droptarget) + "._parent._name")] == undefined)) && ((!_root.animating) || (_root.Extreme))) {
jps = _root.numbers[int(_root.letters[original.c]) + ((int(_root.letters[square[0]]) - int(_root.letters[original.c])) / 2)] + (int(original.r) + ((square[1] - original.r) / 2));
_root.removePiece(jps);
var point = {x:eval (eval (_parent._droptarget) + "._parent._x"), y:eval (eval (_parent._droptarget) + "._parent._y")};
_root.main_game.board.localToGlobal(point);
_root.main_game.globalToLocal(point);
_parent._x = point.x;
_parent._y = point.y;
delete _root.squares[original.s];
delete _root.piecePos[original.s];
original.s = eval (eval (_parent._droptarget) + "._parent._name");
_root.squares[original.s] = "player1";
_root.piecePos[original.s] = _parent._name;
var news = original.s.split("");
original.c = news[0];
original.r = news[1];
jump = true;
} else {
move = false;
_parent._x = original.x;
_parent._y = original.y;
}
if (move == true) {
if (_root.sound) {
_root.click.start();
}
if ((!_root.jump(_parent._name)) or (!jps)) {
_root.ppn = undefined;
_root.turn = "comp";
}
if (_root.Atomic && (jump)) {
_root.turn = "comp";
_root.ppn = undefined;
_root.explode(news[0] + news[1]);
}
}
}
}
Symbol 105 MovieClip Frame 1
stop();
Instance of Symbol 102 MovieClip "graphic" in Symbol 105 MovieClip Frame 1
/* no clip actions */
Symbol 105 MovieClip Frame 2
stop();
Instance of Symbol 104 MovieClip "graphic" in Symbol 105 MovieClip Frame 2
/* no clip actions */
Symbol 111 Button
on (release) {
gotoAndStop (2);
}
Symbol 115 Button
on (release) {
_root.level = _root.level + 200;
gotoAndStop (3);
}
Symbol 116 Button
on (release) {
gotoAndStop (3);
}
Symbol 118 Button
on (release) {
gotoAndStop (3);
}
Symbol 120 Button
on (release) {
getURL ("http://www.crazymonkeygames.com", _blank);
}
Symbol 136 Button
on (release) {
selection._x = easy._x;
_root.level = 0;
}
Symbol 138 Button
on (release) {
selection._x = medium._x;
_root.level = 1800;
}
Symbol 140 Button
on (release) {
selection._x = hard._x;
_root.level = 3800;
}
Symbol 144 Button
on (release) {
_root.oldTime = getTimer() + 100;
gotoAndStop (3);
}