Frame 2
iBytesTotal = _root.getBytesTotal();
iBytesLoaded = _root.getBytesLoaded();
iBytes = Math.ceil((iBytesLoaded / iBytesTotal) * 100);
_root.txtLoading.text = iBytes + "%";
Frame 3
if (iBytes < 100) {
gotoAndPlay (2);
} else {
gotoAndPlay (4);
}
Frame 5
function SetBoard() {
_root.mcPlayAgain._visible = false;
_root.mcDraw._visible = false;
_root.RejumpDelayTimer = 5000;
_root.GameOverFlag = false;
_root.GameBegin();
_root.checkComputerWin();
}
function ComputerMove(updown, leftright, piece, style) {
_root.Turn++;
if (!_root.HadAJump) {
_root.TurnsWithNoJumps++;
if (_root.TurnsWithNoJumps >= 8) {
_root.mcDraw._visible = true;
}
} else {
_root.TurnsWithNoJumps = 0;
_root.HadAJump = false;
}
_root.UpdateTurn(_root.Turn);
_root[piece].UpDown = updown;
_root[piece].LeftRight = leftright;
if (style == "jump") {
_global.Jump = true;
}
if (style == "rejump") {
_global.Jump = true;
_global.Rejump = true;
}
_root[piece].Go = true;
_root.CheckPCNewQueen(piece, _root[piece].row);
_root.ShowContent();
}
function CheckPCMove(style) {
if ((CheckPCJump() == false) || (style == "free")) {
if (_global.Recursion == undefined) {
_global.Recursion = 0;
}
flagmove = false;
z = 12;
while (z >= 1) {
if ((_root["R" + z].alive == true) && (_root["R" + z].Queen == false)) {
if (_root[(("sq" + (_root["R" + z].row + 1)) + "") + (_root["R" + z].col - 1)].content == "") {
if (((_root[(("sq" + (_root["R" + z].row + 2)) + "") + (_root["R" + z].col - 2)].content != "B") && (style == "safe")) || (style == "free")) {
_root[(("sq" + _root["R" + z].row) + "") + _root["R" + z].col].content = "";
_root[(("sq" + (_root["R" + z].row + 1)) + "") + (_root["R" + z].col - 1)].content = "R";
_root["R" + z].row++;
_root["R" + z].col--;
_root.ComputerMove("down", "left", "R" + z, "move");
flagmove = true;
z = -1;
}
}
if (_root[(("sq" + (_root["R" + z].row + 1)) + "") + (_root["R" + z].col + 1)].content == "") {
if (((_root[(("sq" + (_root["R" + z].row + 2)) + "") + (_root["R" + z].col + 2)].content != "B") && (style == "safe")) || (style == "free")) {
_root[(("sq" + _root["R" + z].row) + "") + _root["R" + z].col].content = "";
_root[(("sq" + (_root["R" + z].row + 1)) + "") + (_root["R" + z].col + 1)].content = "R";
_root["R" + z].row++;
_root["R" + z].col++;
_root.ComputerMove("down", "right", "R" + z, "move");
flagmove = true;
z = -1;
}
}
}
z--;
}
if ((flagmove == false) && (_root.hasPCQueen == true)) {
z = 12;
while (z >= 1) {
if ((_root["R" + z].alive == true) && (_root["R" + z].Queen == true)) {
if (_root[(("sq" + (_root["R" + z].row - 1)) + "") + (_root["R" + z].col - 1)].content == "") {
if (((_root[(("sq" + (_root["R" + z].row - 2)) + "") + (_root["R" + z].col - 2)].content != "B") && (style == "safe")) || (style == "free")) {
_root[(("sq" + _root["R" + z].row) + "") + _root["R" + z].col].content = "";
_root[(("sq" + (_root["R" + z].row - 1)) + "") + (_root["R" + z].col - 1)].content = "R";
_root["R" + z].row--;
_root["R" + z].col--;
_root.ComputerMove("up", "left", "R" + z, "move");
flagmove = true;
z = -1;
}
}
if (_root[(("sq" + (_root["R" + z].row - 1)) + "") + (_root["R" + z].col + 1)].content == "") {
if (((_root[(("sq" + (_root["R" + z].row - 2)) + "") + (_root["R" + z].col + 2)].content != "B") && (style == "safe")) || (style == "free")) {
_root[(("sq" + _root["R" + z].row) + "") + _root["R" + z].col].content = "";
_root[(("sq" + (_root["R" + z].row - 1)) + "") + (_root["R" + z].col + 1)].content = "R";
_root["R" + z].row--;
_root["R" + z].col++;
_root.ComputerMove("up", "right", "R" + z, "move");
flagmove = true;
z = -1;
}
}
if (_root[(("sq" + (_root["R" + z].row + 1)) + "") + (_root["R" + z].col - 1)].content == "") {
if (((_root[(("sq" + (_root["R" + z].row + 2)) + "") + (_root["R" + z].col - 2)].content != "B") && (style == "safe")) || (style == "free")) {
_root[(("sq" + _root["R" + z].row) + "") + _root["R" + z].col].content = "";
_root[(("sq" + (_root["R" + z].row + 1)) + "") + (_root["R" + z].col - 1)].content = "R";
_root["R" + z].row++;
_root["R" + z].col--;
_root.ComputerMove("down", "left", "R" + z, "move");
flagmove = true;
z = -1;
}
} else if (_root[(("sq" + (_root["R" + z].row + 1)) + "") + (_root["R" + z].col + 1)].content == "") {
if (((_root[(("sq" + (_root["R" + z].row + 2)) + "") + (_root["R" + z].col + 2)].content != "B") && (style == "safe")) || (style == "free")) {
_root[(("sq" + _root["R" + z].row) + "") + _root["R" + z].col].content = "";
_root[(("sq" + (_root["R" + z].row + 1)) + "") + (_root["R" + z].col + 1)].content = "R";
_root["R" + z].row++;
_root["R" + z].col++;
_root.ComputerMove("down", "right", "R" + z, "move");
flagmove = true;
z = -1;
}
}
}
z--;
}
}
if (flagmove == false) {
if (_global.Recursion == 0) {
_global.Recursion = 1;
_root.CheckPCMove("free");
if (flagmove == true) {
_global.Recursion = 0;
}
} else {
_global.Recursion = undefined;
_root.GameOver("YOU");
}
} else {
_global.recursion = 0;
}
}
}
function CheckPCJump() {
flagjump = false;
z = 12;
while (z >= 1) {
if ((_root["R" + z].alive == true) && (_root["R" + z].Queen == false)) {
if (_root[(("sq" + (_root["R" + z].row + 1)) + "") + (_root["R" + z].col - 1)].content == "B") {
if (_root[(("sq" + (_root["R" + z].row + 2)) + "") + (_root["R" + z].col - 2)].content == "") {
_root[(("sq" + _root["R" + z].row) + "") + _root["R" + z].col].content = "";
_root[(("sq" + (_root["R" + z].row + 1)) + "") + (_root["R" + z].col - 1)].content = "";
_root[(("sq" + (_root["R" + z].row + 2)) + "") + (_root["R" + z].col - 2)].content = "R";
_root["R" + z].row = _root["R" + z].row + 2;
_root["R" + z].col = _root["R" + z].col - 2;
_root.ComputerMove("down", "left", "R" + z, "jump");
flagjump = true;
z = -1;
}
}
if (_root[(("sq" + (_root["R" + z].row + 1)) + "") + (_root["R" + z].col + 1)].content == "B") {
if (_root[(("sq" + (_root["R" + z].row + 2)) + "") + (_root["R" + z].col + 2)].content == "") {
_root[(("sq" + _root["R" + z].row) + "") + _root["R" + z].col].content = "";
_root[(("sq" + (_root["R" + z].row + 1)) + "") + (_root["R" + z].col + 1)].content = "";
_root[(("sq" + (_root["R" + z].row + 2)) + "") + (_root["R" + z].col + 2)].content = "R";
_root["R" + z].row = _root["R" + z].row + 2;
_root["R" + z].col = _root["R" + z].col + 2;
_root.ComputerMove("down", "right", "R" + z, "jump");
flagjump = true;
z = -1;
}
}
}
z--;
}
if ((flagjump == false) && (_root.hasPCQueen == true)) {
z = 12;
while (z >= 1) {
if ((_root["R" + z].alive == true) && (_root["R" + z].Queen == true)) {
if (_root[(("sq" + (_root["R" + z].row - 1)) + "") + (_root["R" + z].col - 1)].content == "B") {
if (_root[(("sq" + (_root["R" + z].row - 2)) + "") + (_root["R" + z].col - 2)].content == "") {
_root[(("sq" + _root["R" + z].row) + "") + _root["R" + z].col].content = "";
_root[(("sq" + (_root["R" + z].row - 1)) + "") + (_root["R" + z].col - 1)].content = "";
_root[(("sq" + (_root["R" + z].row - 2)) + "") + (_root["R" + z].col - 2)].content = "R";
_root["R" + z].row = _root["R" + z].row - 2;
_root["R" + z].col = _root["R" + z].col - 2;
_root.ComputerMove("up", "left", "R" + z, "jump");
flagjump = true;
z = -1;
}
}
if (_root[(("sq" + (_root["R" + z].row - 1)) + "") + (_root["R" + z].col + 1)].content == "B") {
if (_root[(("sq" + (_root["R" + z].row - 2)) + "") + (_root["R" + z].col + 2)].content == "") {
_root[(("sq" + _root["R" + z].row) + "") + _root["R" + z].col].content = "";
_root[(("sq" + (_root["R" + z].row - 1)) + "") + (_root["R" + z].col + 1)].content = "";
_root[(("sq" + (_root["R" + z].row - 2)) + "") + (_root["R" + z].col + 2)].content = "R";
_root["R" + z].row = _root["R" + z].row - 2;
_root["R" + z].col = _root["R" + z].col + 2;
_root.ComputerMove("up", "right", "R" + z, "jump");
flagjump = true;
z = -1;
}
}
if (_root[(("sq" + (_root["R" + z].row + 1)) + "") + (_root["R" + z].col - 1)].content == "B") {
if (_root[(("sq" + (_root["R" + z].row + 2)) + "") + (_root["R" + z].col - 2)].content == "") {
_root[(("sq" + _root["R" + z].row) + "") + _root["R" + z].col].content = "";
_root[(("sq" + (_root["R" + z].row + 1)) + "") + (_root["R" + z].col - 1)].content = "";
_root[(("sq" + (_root["R" + z].row + 2)) + "") + (_root["R" + z].col - 2)].content = "R";
_root["R" + z].row = _root["R" + z].row + 2;
_root["R" + z].col = _root["R" + z].col - 2;
_root.ComputerMove("down", "left", "R" + z, "jump");
flagjump = true;
z = -1;
}
}
if (_root[(("sq" + (_root["R" + z].row + 1)) + "") + (_root["R" + z].col + 1)].content == "B") {
if (_root[(("sq" + (_root["R" + z].row + 2)) + "") + (_root["R" + z].col + 2)].content == "") {
_root[(("sq" + _root["R" + z].row) + "") + _root["R" + z].col].content = "";
_root[(("sq" + (_root["R" + z].row + 1)) + "") + (_root["R" + z].col + 1)].content = "";
_root[(("sq" + (_root["R" + z].row + 2)) + "") + (_root["R" + z].col + 2)].content = "R";
_root["R" + z].row = _root["R" + z].row + 2;
_root["R" + z].col = _root["R" + z].col + 2;
_root.ComputerMove("down", "right", "R" + z, "jump");
flagjump = true;
z = -1;
}
}
}
z--;
}
}
if (flagjump == false) {
return(false);
}
return(true);
}
function CheckPCRejump(piece, theupdown, theleftright) {
flagjump = false;
if (_root[piece].Queen == true) {
if (_root[(("sq" + (_root[piece].row - 1)) + "") + (_root[piece].col - 1)].content == "B") {
if (_root[(("sq" + (_root[piece].row - 2)) + "") + (_root[piece].col - 2)].content == "") {
_root[(("sq" + _root[piece].row) + "") + _root[piece].col].content = "";
_root[(("sq" + (_root[piece].row - 1)) + "") + (_root[piece].col - 1)].content = "";
_root[(("sq" + (_root[piece].row - 2)) + "") + (_root[piece].col - 2)].content = "R";
_root[piece].row = _root[piece].row - 2;
_root[piece].col = _root[piece].col - 2;
if (theleftright == "right") {
_root[piece]._x = _root[piece]._x + 20;
} else {
_root[piece]._x = _root[piece]._x - 20;
}
_root.ComputerMove("up", "left", piece, "jump");
flagjump = true;
z = -1;
}
}
if (_root[(("sq" + (_root[piece].row - 1)) + "") + (_root[piece].col + 1)].content == "B") {
if (_root[(("sq" + (_root[piece].row - 2)) + "") + (_root[piece].col + 2)].content == "") {
_root[(("sq" + _root[piece].row) + "") + _root[piece].col].content = "";
_root[(("sq" + (_root[piece].row - 1)) + "") + (_root[piece].col + 1)].content = "";
_root[(("sq" + (_root[piece].row - 2)) + "") + (_root[piece].col + 2)].content = "R";
_root[piece].row = _root[piece].row - 2;
_root[piece].col = _root[piece].col + 2;
if (theleftright == "right") {
_root[piece]._x = _root[piece]._x + 20;
} else {
_root[piece]._x = _root[piece]._x - 20;
}
_root.ComputerMove("up", "right", piece, "jump");
flagjump = true;
z = -1;
}
}
}
if (_root[(("sq" + (_root[piece].row + 1)) + "") + (_root[piece].col - 1)].content == "B") {
if (_root[(("sq" + (_root[piece].row + 2)) + "") + (_root[piece].col - 2)].content == "") {
_root[(("sq" + _root[piece].row) + "") + _root[piece].col].content = "";
_root[(("sq" + (_root[piece].row + 1)) + "") + (_root[piece].col - 1)].content = "";
_root[(("sq" + (_root[piece].row + 2)) + "") + (_root[piece].col - 2)].content = "R";
_root[piece].row = _root[piece].row + 2;
_root[piece].col = _root[piece].col - 2;
if (theupdown == "up") {
_root[piece]._y = _root[piece]._y - 10;
} else {
_root[piece]._y = _root[piece]._y + 10;
}
if (theleftright == "right") {
_root[piece]._x = _root[piece]._x + 10;
} else {
_root[piece]._x = _root[piece]._x - 10;
}
_root.ComputerMove("down", "left", piece, "rejump");
flagjump = true;
z = -1;
}
}
if (_root[(("sq" + (_root[piece].row + 1)) + "") + (_root[piece].col + 1)].content == "B") {
if (_root[(("sq" + (_root[piece].row + 2)) + "") + (_root[piece].col + 2)].content == "") {
_root[(("sq" + _root[piece].row) + "") + _root[piece].col].content = "";
_root[(("sq" + (_root[piece].row + 1)) + "") + (_root[piece].col + 1)].content = "";
_root[(("sq" + (_root[piece].row + 2)) + "") + (_root[piece].col + 2)].content = "R";
_root[piece].row = _root[piece].row + 2;
_root[piece].col = _root[piece].col + 2;
if (theupdown == "up") {
_root[piece]._y = _root[piece]._y - 10;
} else {
_root[piece]._y = _root[piece]._y + 10;
}
if (theleftright == "right") {
_root[piece]._x = _root[piece]._x + 10;
} else {
_root[piece]._x = _root[piece]._x - 10;
}
_root.ComputerMove("down", "right", piece, "rejump");
flagjump = true;
z = -1;
}
}
if (flagjump == false) {
return(false);
}
return(true);
}
function CheckPCNewQueen(piece, row) {
if (_root[piece].row == 8) {
if (_root[piece].Queen == false) {
_root[piece].Queen = true;
_root[piece].mcCrown._visible = true;
_root.hasPCQueen = true;
_root.pcNewQueen = true;
}
}
}
function CheckAvailable(piece, row, col) {
_global.Piece = piece;
_global.Row = row;
_global.Col = col;
if ((_root.rejump == undefined) || (_root.rejump == false)) {
if (_root.OficialGame == true) {
if (_root.CheckPossibleJumpAvaliable(piece, row, col, "left") || (_root.CheckPossibleJumpAvaliable(piece, row, col, "right"))) {
_root.CheckJumpAvaliable(piece, row, col, "left");
_root.CheckJumpAvaliable(piece, row, col, "right");
} else {
if (_root[("sq" + (row - 1)) + (col - 1)].content == "") {
_root[("sq" + (row - 1)) + (col - 1)].enabled = true;
}
if (_root[("sq" + (row - 1)) + (col + 1)].content == "") {
_root[("sq" + (row - 1)) + (col + 1)].enabled = true;
}
}
} else {
if (_root[("sq" + (row - 1)) + (col - 1)].content == "") {
_root[("sq" + (row - 1)) + (col - 1)].enabled = true;
} else {
_root.CheckJumpAvaliable(piece, row, col, "left");
}
if (_root[("sq" + (row - 1)) + (col + 1)].content == "") {
_root[("sq" + (row - 1)) + (col + 1)].enabled = true;
} else {
_root.CheckJumpAvaliable(piece, row, col, "right");
}
}
if (_root[piece].Queen == true) {
if (_root.OficialGame == true) {
if (_root.CheckPossibleJumpAvaliable(piece, row, col, "left") || (_root.CheckPossibleJumpAvaliable(piece, row, col, "right"))) {
_root.CheckJumpAvaliable(piece, row, col, "left");
_root.CheckJumpAvaliable(piece, row, col, "right");
} else {
if (_root[("sq" + (row + 1)) + (col + 1)].content == "") {
_root[("sq" + (row + 1)) + (col + 1)].enabled = true;
}
if (_root[("sq" + (row + 1)) + (col - 1)].content == "") {
_root[("sq" + (row + 1)) + (col - 1)].enabled = true;
}
}
} else {
if (_root[("sq" + (row + 1)) + (col + 1)].content == "") {
_root[("sq" + (row + 1)) + (col + 1)].enabled = true;
} else {
_root.CheckJumpAvaliable(piece, row, col, "right");
}
if (_root[("sq" + (row + 1)) + (col - 1)].content == "") {
_root[("sq" + (row + 1)) + (col - 1)].enabled = true;
} else {
_root.CheckJumpAvaliable(piece, row, col, "left");
}
}
}
} else {
_root.CheckJumpAvaliable(piece, row, col, "left");
_root.CheckJumpAvaliable(piece, row, col, "right");
}
}
function CheckJumpAvaliable(piece, row, col, side) {
if (side == "left") {
if (_root[("sq" + (row - 1)) + (col - 1)].content == "R") {
if (_root[("sq" + (row - 2)) + (col - 2)].content == "") {
_root[("sq" + (row - 2)) + (col - 2)].jump = true;
_root[("sq" + (row - 2)) + (col - 2)].enabled = true;
} else {
_root[("sq" + (row - 2)) + (col - 2)].jump = false;
_root[("sq" + (row - 2)) + (col - 2)].enabled = false;
}
}
if (_root[piece].Queen == true) {
if (_root[("sq" + (row + 1)) + (col - 1)].content == "R") {
if (_root[("sq" + (row + 2)) + (col - 2)].content == "") {
_root[("sq" + (row + 2)) + (col - 2)].jump = true;
_root[("sq" + (row + 2)) + (col - 2)].enabled = true;
} else {
_root[("sq" + (row + 2)) + (col - 2)].jump = false;
_root[("sq" + (row + 2)) + (col - 2)].enabled = false;
}
}
}
} else {
if (_root[("sq" + (row - 1)) + (col + 1)].content == "R") {
if (_root[("sq" + (row - 2)) + (col + 2)].content == "") {
_root[("sq" + (row - 2)) + (col + 2)].jump = true;
_root[("sq" + (row - 2)) + (col + 2)].enabled = true;
} else {
_root[("sq" + (row - 2)) + (col + 2)].jump = false;
_root[("sq" + (row - 2)) + (col + 2)].enabled = false;
}
}
if (_root[piece].Queen == true) {
if (_root[("sq" + (row + 1)) + (col + 1)].content == "R") {
if (_root[("sq" + (row + 2)) + (col + 2)].content == "") {
_root[("sq" + (row + 2)) + (col + 2)].jump = true;
_root[("sq" + (row + 2)) + (col + 2)].enabled = true;
} else {
_root[("sq" + (row + 2)) + (col + 2)].jump = false;
_root[("sq" + (row + 2)) + (col + 2)].enabled = false;
}
}
}
}
}
function CheckRejump() {
piece = _global.Piece;
row = _root[piece].row;
col = _root[piece].col;
_root.rejump = false;
if (_root[("sq" + (row - 1)) + (col - 1)].content == "R") {
if (_root[("sq" + (row - 2)) + (col - 2)].content == "") {
_root.rejump = true;
}
}
if (_root[("sq" + (row - 1)) + (col + 1)].content == "R") {
if (_root[("sq" + (row - 2)) + (col + 2)].content == "") {
_root.rejump = true;
}
}
if (_root[piece].Queen == true) {
if (_root[("sq" + (row + 1)) + (col + 1)].content == "R") {
if (_root[("sq" + (row + 2)) + (col + 2)].content == "") {
_root.rejump = true;
}
}
if (_root[("sq" + (row + 1)) + (col - 1)].content == "R") {
if (_root[("sq" + (row + 2)) + (col - 2)].content == "") {
_root.rejump = true;
}
}
}
return(_root.rejump);
}
function rejumpLost() {
clearInterval(_root.rejumpInterval);
_root.mcTabs.mcRedTab.gotoAndPlay("out");
_root.rejump = false;
_root.CheckPCMove("safe");
}
function rejumpWarning() {
clearInterval(_root.rejumpInterval);
_root.mcTabs.mcRedTab.gotoAndPlay("in");
_root.FlagTabOut = true;
}
function checkComputerWin() {
_root.ResetBoard("");
this.possible0 = false;
if (_root.OficialGame == true) {
z = 1;
while (z <= 12) {
if (_root["B" + z].alive == true) {
if ((_root.CheckPossibleJumpAvaliable("B" + z, _root["B" + z].row, _root["B" + z].col, "left") == true) || (_root.CheckPossibleJumpAvaliable("B" + z, _root["B" + z].row, _root["B" + z].col, "right") == true)) {
this.possible0 = true;
_root["B" + z].enabled = true;
} else {
_root["B" + z].enabled = false;
}
}
z++;
}
if (this.possible0 == false) {
z = 1;
while (z <= 12) {
if (_root["B" + z].alive == true) {
if (_root.CheckPossibleMoviment("B" + z, _root["B" + z].row, _root["B" + z].col, false) == true) {
this.possible0 = true;
_root["B" + z].enabled = true;
} else {
_root["B" + z].enabled = false;
}
}
z++;
}
}
} else {
z = 1;
while (z <= 12) {
if (_root["B" + z].alive == true) {
if (_root.CheckPossibleMoviment("B" + z, _root["B" + z].row, _root["B" + z].col, true) == true) {
this.possible0 = true;
_root["B" + z].enabled = true;
} else {
_root["B" + z].enabled = false;
}
}
z++;
}
}
if (this.possible0 == false) {
_root.GameOver("PC");
}
}
function CheckPossibleMoviment(piece, row, col, checkjump) {
this.possible1 = false;
if (_root[("sq" + (row - 1)) + (col - 1)].content == "") {
this.possible1 = true;
} else if ((checkjump == true) && (_root.CheckPossibleJumpAvaliable(piece, row, col, "left") == true)) {
this.possible1 = true;
}
if (_root[("sq" + (row - 1)) + (col + 1)].content == "") {
this.possible1 = true;
} else if ((checkjump == true) && (_root.CheckPossibleJumpAvaliable(piece, row, col, "right") == true)) {
this.possible1 = true;
}
if (_root[piece].Queen == true) {
if (_root[("sq" + (row + 1)) + (col + 1)].content == "") {
this.possible1 = true;
} else if ((checkjump == true) && (_root.CheckPossibleJumpAvaliable(piece, row, col, "right") == true)) {
this.possible1 = true;
}
if (_root[("sq" + (row + 1)) + (col - 1)].content == "") {
this.possible1 = true;
} else if ((checkjump == true) && (_root.CheckPossibleJumpAvaliable(piece, row, col, "left") == true)) {
this.possible1 = true;
}
}
return(this.possible1);
}
function CheckPossibleJumpAvaliable(piece, row, col, side) {
this.possible2 = false;
if (side == "left") {
if (_root[("sq" + (row - 1)) + (col - 1)].content == "R") {
if (_root[("sq" + (row - 2)) + (col - 2)].content == "") {
this.possible2 = true;
}
}
if (_root[piece].Queen == true) {
if (_root[("sq" + (row + 1)) + (col - 1)].content == "R") {
if (_root[("sq" + (row + 2)) + (col - 2)].content == "") {
this.possible2 = true;
}
}
}
} else {
if (_root[("sq" + (row - 1)) + (col + 1)].content == "R") {
if (_root[("sq" + (row - 2)) + (col + 2)].content == "") {
this.possible2 = true;
}
}
if (_root[piece].Queen == true) {
if (_root[("sq" + (row + 1)) + (col + 1)].content == "R") {
if (_root[("sq" + (row + 2)) + (col + 2)].content == "") {
this.possible2 = true;
}
}
}
}
if (this.possible2) {
clearInterval(_root.rejumpInterval);
if (_root.OficialGame) {
_root.rejumpInterval = setInterval(_root.rejumpWarning, _root.RejumpDelayTimer);
}
}
return(this.possible2);
}
function ShowContent() {
z = 11;
while (z <= 88) {
_root["sq" + z].txtContent.text = _root["sq" + z].content;
z++;
}
z = 1;
while (z <= 12) {
if (_root["R" + z].Queen == true) {
_root["R" + z].txtId.text = "*R" + z;
} else {
_root["R" + z].txtId.text = "R" + z;
}
if (_root["B" + z].Queen == true) {
_root["B" + z].txtId.text = "*B" + z;
} else {
_root["B" + z].txtId.text = "B" + z;
}
z++;
}
}
function ResetBoard(thesquare) {
z = 1;
while (z <= 12) {
_root["B" + z]._alpha = 100;
z++;
}
z = 11;
while (z <= 88) {
_root["sq" + z].enabled = false;
_root["sq" + z].jump = false;
z++;
}
}
function GameBegin() {
_root.HadAJump = false;
_root.TurnsWithNoJumps = 0;
_root.Turn = 1;
_root.UpdateTurn(_root.Turn);
_root.UpdatePlays(_root.Plays, _root.Wins);
_root.R1._x = 125;
_root.R1._y = 75;
_root.R2._x = 225;
_root.R2._y = 75;
_root.R3._x = 325;
_root.R3._y = 75;
_root.R4._x = 425;
_root.R4._y = 75;
_root.R5._x = 75;
_root.R5._y = 125;
_root.R6._x = 175;
_root.R6._y = 125;
_root.R7._x = 275;
_root.R7._y = 125;
_root.R8._x = 375;
_root.R8._y = 125;
_root.R9._x = 125;
_root.R9._y = 175;
_root.R10._x = 225;
_root.R10._y = 175;
_root.R11._x = 325;
_root.R11._y = 175;
_root.R12._x = 425;
_root.R12._y = 175;
_root.B1._x = 75;
_root.B1._y = 325;
_root.B2._x = 175;
_root.B2._y = 325;
_root.B3._x = 275;
_root.B3._y = 325;
_root.B4._x = 375;
_root.B4._y = 325;
_root.B5._x = 125;
_root.B5._y = 375;
_root.B6._x = 225;
_root.B6._y = 375;
_root.B7._x = 325;
_root.B7._y = 375;
_root.B8._x = 425;
_root.B8._y = 375;
_root.B9._x = 75;
_root.B9._y = 425;
_root.B10._x = 175;
_root.B10._y = 425;
_root.B11._x = 275;
_root.B11._y = 425;
_root.B12._x = 375;
_root.B12._y = 425;
_root.B1._visible = true;
_root.B2._visible = true;
_root.B3._visible = true;
_root.B4._visible = true;
_root.B5._visible = true;
_root.B6._visible = true;
_root.B7._visible = true;
_root.B8._visible = true;
_root.B9._visible = true;
_root.B10._visible = true;
_root.B11._visible = true;
_root.B12._visible = true;
_root.R1.row = 1;
_root.R1.col = 2;
_root.R2.row = 1;
_root.R2.col = 4;
_root.R3.row = 1;
_root.R3.col = 6;
_root.R4.row = 1;
_root.R4.col = 8;
_root.R5.row = 2;
_root.R5.col = 1;
_root.R6.row = 2;
_root.R6.col = 3;
_root.R7.row = 2;
_root.R7.col = 5;
_root.R8.row = 2;
_root.R8.col = 7;
_root.R9.row = 3;
_root.R9.col = 2;
_root.R10.row = 3;
_root.R10.col = 4;
_root.R11.row = 3;
_root.R11.col = 6;
_root.R12.row = 3;
_root.R12.col = 8;
_root.R1._visible = true;
_root.R2._visible = true;
_root.R3._visible = true;
_root.R4._visible = true;
_root.R5._visible = true;
_root.R6._visible = true;
_root.R7._visible = true;
_root.R8._visible = true;
_root.R9._visible = true;
_root.R10._visible = true;
_root.R11._visible = true;
_root.R12._visible = true;
_root.B1.row = 6;
_root.B1.col = 1;
_root.B2.row = 6;
_root.B2.col = 3;
_root.B3.row = 6;
_root.B3.col = 5;
_root.B4.row = 6;
_root.B4.col = 7;
_root.B5.row = 7;
_root.B5.col = 2;
_root.B6.row = 7;
_root.B6.col = 4;
_root.B7.row = 7;
_root.B7.col = 6;
_root.B8.row = 7;
_root.B8.col = 8;
_root.B9.row = 8;
_root.B9.col = 1;
_root.B10.row = 8;
_root.B10.col = 3;
_root.B11.row = 8;
_root.B11.col = 5;
_root.B12.row = 8;
_root.B12.col = 7;
z = 1;
while (z <= 12) {
_root["B" + z].alive = true;
_root["R" + z].alive = true;
_root["B" + z].mcCrown._visible = false;
_root["R" + z].mcCrown._visible = false;
z++;
}
z = 12;
while (z <= 38) {
_root["sq" + z].content = "R";
z++;
}
z = 41;
while (z <= 58) {
_root["sq" + z].content = "";
z++;
}
z = 61;
while (z <= 87) {
_root["sq" + z].content = "B";
z++;
}
z = 11;
while (z <= 88) {
_root["sq" + z].jump = false;
z++;
}
_root.ShowContent();
z = 1;
while (z <= 12) {
_root["B" + z].Go = false;
_root["B" + z].UpDown = "up";
_root["B" + z].LeftRight = "right";
_root["B" + z].Queen = false;
_root["B" + z].onRelease = function () {
_root.ResetBoard("");
this._alpha = 50;
_root.CheckAvailable(this._name, this.row, this.col);
if (_root.OficialGame == true) {
k = 1;
while (k <= 12) {
_root["B" + k].enabled = false;
k++;
}
}
_root[this._name].enabled = true;
};
_root["B" + z].onEnterFrame = function () {
if (this.Go == true) {
if (this.zzz == undefined) {
if ((_global.Jump == true) or (_global.Rejump == true)) {
_global.Limit = 9;
} else {
_global.Limit = 4;
if (_root.newQueen == true) {
_root.newQueen = undefined;
}
}
this.zzz = 1;
} else if (this.zzz < _global.Limit) {
this.zzz++;
} else if (_root.PieceToRemove != "") {
_root[_root.PieceToRemove]._visible = false;
_root[_root.PieceToRemove].alive = false;
_root[_root.PieceToRemove]._x = 10000;
_root[_root.PieceToRemove]._y = 10000;
_root.PieceToRemove = "";
this.zzz = undefined;
this.Go = false;
_global.Jump = false;
if ((_root.newQueen == undefined) && (_root.CheckRejump())) {
_root.ResetBoard("");
this._alpha = 50;
_root.CheckAvailable(this._name, this.row, this.col);
if (_root.OficialGame == false) {
clearInterval(_root.rejumpInterval);
_root.rejumpInterval = setInterval(_root.rejumpLost, _root.RejumpDelayTimer);
} else {
clearInterval(_root.rejumpInterval);
_root.rejumpInterval = setInterval(_root.rejumpWarning, _root.RejumpDelayTimer);
}
} else {
_root.newQueen = undefined;
_root.CheckPCMove("safe");
}
} else {
this.zzz = undefined;
this.Go = false;
_global.Jump = false;
_root.CheckPCMove("safe");
}
if (this.UpDown == "up") {
this._y = this._y - 10;
} else {
this._y = this._y + 10;
}
if (this.LeftRight == "right") {
this._x = this._x + 10;
} else {
this._x = this._x - 10;
}
this.zz = 1;
while (this.zz <= 12) {
_root.PieceToRemove = "";
if (this.hitTest(_root["R" + this.zz])) {
_root.HadAJump = true;
_root.PieceToRemove = "R" + this.zz;
this.zz = 13;
}
this.zz++;
}
}
};
z++;
}
z = 1;
while (z <= 12) {
_root["R" + z].Go = false;
_root["R" + z].UpDown = "up";
_root["R" + z].LeftRight = "right";
_root["R" + z].Queen = false;
_root["R" + z].onEnterFrame = function () {
if (this.Go == true) {
if (this.zzz == undefined) {
if ((_global.Jump == true) or (_global.Rejump == true)) {
if (_global.Rejump == true) {
_global.Limit = 8;
} else {
_global.Limit = 9;
}
} else {
_global.Limit = 4;
}
this.zzz = 1;
} else if (this.zzz < _global.Limit) {
this.zzz++;
} else {
if (_root.PieceToRemove != "") {
_root[_root.PieceToRemove]._visible = false;
_root[_root.PieceToRemove].alive = false;
_root[_root.PieceToRemove]._x = 10000;
_root[_root.PieceToRemove]._y = 10000;
_root.PieceToRemove = "";
}
this.zzz = undefined;
this.Go = false;
if (_global.Jump == true) {
_global.Jump = false;
_global.Rejump = false;
if (_root.pcNewQueen == undefined) {
_root.CheckPCRejump(this._name, this.UpDown, this.LeftRight);
} else {
_root.pcNewQueen = undefined;
}
} else if (_root.pcNewQueen == true) {
_root.pcNewQueen = undefined;
}
_root.checkComputerWin();
}
if (this.UpDown == "up") {
this._y = this._y - 10;
} else {
this._y = this._y + 10;
}
if (this.LeftRight == "right") {
this._x = this._x + 10;
} else {
this._x = this._x - 10;
}
this.zz = 1;
while (this.zz <= 12) {
_root.PieceToRemove = "";
if (this.hitTest(_root["B" + this.zz])) {
_root.HadAJump = true;
this.swapDepths(_root["B" + this.zz]);
_root.PieceToRemove = "B" + this.zz;
this.zz = 13;
}
this.zz++;
}
}
};
z++;
}
z = 11;
while (z <= 88) {
_root["sq" + z].enabled = false;
_root["sq" + z].onRelease = function () {
if (_root.rejump == true) {
clearInterval(_root.rejumpInterval);
if (_root.OficialGame == true) {
_root.mcTabs.mcRedTab.gotoAndPlay("out");
}
}
if (_global.Row > (substring(this._name, 3, 1))) {
_root[_global.Piece].UpDown = "up";
} else {
_root[_global.Piece].UpDown = "down";
}
if (_global.Col > (substring(this._name, 4, 1))) {
_root[_global.Piece].LeftRight = "left";
} else {
_root[_global.Piece].LeftRight = "right";
}
if (this.jump == true) {
_global.Jump = true;
} else {
_global.Jump = false;
}
_root[_global.Piece].row = parseInt(substring(this._name, 3, 1));
_root[_global.Piece].col = parseInt(substring(this._name, 4, 1));
_root[(("sq" + _global.Row) + "") + _global.Col].content = "";
if (_root[_global.Piece].row == 1) {
if (_root[_global.Piece].Queen == false) {
_root[_global.Piece].Queen = true;
_root[_global.Piece].mcCrown._visible = true;
_root.newQueen = true;
}
}
if (this.jump == true) {
if (_root[_global.Piece].UpDown == "up") {
if (_root[_global.Piece].LeftRight == "left") {
_root[(("sq" + (parseInt(_global.Row) - 1)) + "") + (parseInt(_global.Col) - 1)].content = "";
} else {
_root[(("sq" + (parseInt(_global.Row) - 1)) + "") + (parseInt(_global.Col) + 1)].content = "";
}
} else if (_root[_global.Piece].LeftRight == "left") {
_root[(("sq" + (parseInt(_global.Row) + 1)) + "") + (parseInt(_global.Col) - 1)].content = "";
} else {
_root[(("sq" + (parseInt(_global.Row) + 1)) + "") + (parseInt(_global.Col) + 1)].content = "";
}
}
_root[this._name].content = "B";
_root[_global.Piece]._alpha = 100;
_root[_global.Piece].Go = true;
_root.ResetBoard("");
_root.ShowContent();
};
z++;
}
}
function UpdateTurn(theturn) {
this.firstnumber = Math.floor(theturn / 10);
this.secondnumber = theturn - (Math.floor(theturn / 10) * 10);
_root.mcScore.txtTurn1.text = this.firstnumber;
_root.mcScore.txtTurn2.text = this.secondnumber;
clearInterval(_root.rejumpInterval);
if (_root.FlagTabOut) {
_root.mcTabs.mcRedTab.gotoAndPlay("out");
_root.FlagTabOut = false;
}
}
function UpdatePlays(theplay, thewin) {
this.firstplay = Math.floor(theplay / 10);
this.secondplay = theplay - (Math.floor(theplay / 10) * 10);
_root.mcScore.txtPlays1.text = this.firstplay;
_root.mcScore.txtPlays2.text = this.secondplay;
this.firstwin = Math.floor(thewin / 10);
this.secondwin = thewin - (Math.floor(thewin / 10) * 10);
_root.mcScore.txtWins1.text = this.firstwin;
_root.mcScore.txtWins2.text = this.secondwin;
}
function GameOver(winner) {
_root.GameOverFlag = true;
_root.Winner = winner;
z = 1;
while (z <= 12) {
delete _root["B" + z].onRelease;
delete _root["B" + z].onEnterFrame;
z++;
}
_root.Plays++;
if (winner == "YOU") {
_root.mcTabs.mcBlueTab.gotoAndPlay("in");
_root.Wins++;
_root.UpdatePlays(_root.Plays, _root.Wins);
} else {
_root.mcTabs.mcOrangeTab.gotoAndPlay("in");
}
_root.mcPlayAgain._visible = true;
}
_root.Plays = 0;
_root.Wins = 0;
_root.mcDraw.btnBigButton.useHandCursor = false;
_root.mcTitle.btnBig.useHandCursor = false;
_root.Playing = false;
_root.mcQuit._visible = false;
_root.mcTitle.mcRules._visible = false;
_root.mcTitle.mcRulesOfficial._visible = false;
_root.mcTitle.mcRulesGrandpa._visible = false;
_root.OficialGame = true;
stop();
Instance of Symbol 38 MovieClip "mcPlayAgain" in Frame 5
on (release) {
if (_root.Winner == "YOU") {
_root.mcTabs.mcBlueTab.gotoAndPlay("out");
} else {
_root.mcTabs.mcOrangeTab.gotoAndPlay("out");
}
_root.SetBoard();
}
Symbol 43 Button
on (release) {
_root.mcDraw._visible = false;
_root.SetBoard();
}
Symbol 44 Button
on (release) {
_root.TurnsWithNoJumps = 0;
_root.mcDraw._visible = false;
}
Symbol 53 Button
on (release) {
getURL ("http://www.lostjungle.com/yankleber", "_blank");
}
Symbol 62 Button
on (release) {
_root.mcTitle.mcBall._x = 218;
_root.mcTitle.mcBall._y = 218;
_root.OficialGame = true;
}
on (rollOver) {
_root.mcTitle.mcRules._visible = true;
_root.mcTitle.mcRulesOfficial._visible = true;
}
on (rollOut, dragOut) {
_root.mcTitle.mcRules._visible = false;
_root.mcTitle.mcRulesOfficial._visible = false;
}
Symbol 66 Button
on (release) {
_root.mcTitle.mcBall._x = 328;
_root.mcTitle.mcBall._y = 198;
_root.OficialGame = false;
}
on (rollOver) {
_root.mcTitle.mcRules._visible = true;
_root.mcTitle.mcRulesGrandpa._visible = true;
}
on (rollOut, dragOut) {
_root.mcTitle.mcRules._visible = false;
_root.mcTitle.mcRulesGrandpa._visible = false;
}
Symbol 80 Button
on (release) {
getURL ("http://www.lostjungle.com/", "_self");
}
Symbol 81 Button
on (release) {
getURL ("http://www.lostjungle.com/add.php?game=checkers");
}
Symbol 89 Button
on (release) {
if (_root.Playing) {
_root.mcTitle._visible = true;
_root.mcPlay._visible = true;
_root.mcQuit._visible = false;
_root.Playing = false;
} else {
_root.mcTitle._visible = false;
_root.Playing = true;
_root.mcPlay._visible = false;
_root.mcQuit._visible = true;
_root.GameOverFlag = false;
SetBoard();
}
}
Symbol 94 MovieClip Frame 1
stop();
Symbol 94 MovieClip Frame 2
play();
Symbol 94 MovieClip Frame 11
stop();
Symbol 94 MovieClip Frame 12
play();
Symbol 94 MovieClip Frame 21
stop();
Symbol 98 MovieClip Frame 1
stop();
Symbol 98 MovieClip Frame 2
play();
Symbol 98 MovieClip Frame 11
stop();
Symbol 98 MovieClip Frame 12
play();
Symbol 98 MovieClip Frame 21
stop();
Symbol 102 MovieClip Frame 1
stop();
Symbol 102 MovieClip Frame 2
play();
Symbol 102 MovieClip Frame 11
stop();
Symbol 102 MovieClip Frame 12
play();
Symbol 102 MovieClip Frame 21
stop();