Instance of Symbol 13 MovieClip "mc_load_info" in Frame 1
//component parameters
onClipEvent (initialize) {
STREAM = true;
PLAY_TYPE = "bytes";
PLAY_BYTES = 10000;
PLAY_FRAMES = 0;
PLAY_PERCENTAGE = 0;
}
Instance of Symbol 18 MovieClip in Frame 1
onClipEvent (load) {
var myStartWidth = this._width;
this._width = 0;
}
onClipEvent (enterFrame) {
this._width = myStartWidth * _root.mc_load_info.fractionLoaded;
}
Frame 2
sound_spawn = new Sound();
sound_spawn.attachSound("sound_spawn");
sound_spawn.setVolume(50);
sound_take = new Sound();
sound_take.attachSound("sound_take");
sound_take.setVolume(50);
sound_drums = new Sound();
sound_drums.attachSound("sound_drums");
muted = false;
stop();
redwins = 0;
bluewins = 0;
numGames = 0;
sound_select = new Sound();
sound_select.attachSound("sound_select");
sound_select.setVolume(15);
sound_pass = new Sound();
sound_pass.attachSound("sound_pass");
sound_end = new Sound();
sound_end.attachSound("sound_end");
sound_attack = new Sound();
sound_attack.attachSound("sound_attack");
sound_attack1 = new Sound();
sound_attack1.attachSound("sound_attack1");
sound_attack2 = new Sound();
sound_attack2.attachSound("sound_attack2");
sound_laugh = new Sound();
sound_laugh.attachSound("sound_laugh");
twoUpGame = false;
Frame 3
stop();
Frame 4
stop();
Frame 5
stop();
Frame 6
stop();
Instance of Symbol 134 MovieClip "container" in Frame 6
onClipEvent (load) {
function updateScrollbar() {
content._y = -(((scroller._y - top) / diff_y) * (content._height - bound_box._height));
}
diff_y = bound_box._height - scroller._height;
bounds = bound_box.getBounds(this);
top = bounds.yMin + (scroller._height / 2);
bottom = bounds.yMax - (scroller._height / 2);
friction = 0;
}
onClipEvent (mouseDown) {
if (scroller.hitTest(_root._xmouse, _root._ymouse)) {
startDrag ("scroller", false, scroller._x, top, scroller._x, bottom);
scrolling = true;
}
}
onClipEvent (mouseUp) {
stopDrag();
scrolling = false;
}
onClipEvent (enterFrame) {
if (scrolling) {
updateScrollbar();
newY = scroller._y;
yspeed = (newY - oldY) * 0.5;
oldY = newY;
done = false;
} else if (!done) {
oldypos = scroller._y;
newypos = oldypos + yspeed;
if ((yspeed < -0.2) || (yspeed > 0.2)) {
yspeed = yspeed * friction;
} else {
yspeed = 0;
done = true;
}
if (newypos < top) {
yspeed = (-1 * yspeed) * friction;
newypos = top;
}
if (newypos > bottom) {
yspeed = (-1 * yspeed) * friction;
newypos = bottom;
}
scroller._y = newypos;
updateScrollbar();
}
}
Frame 7
stop();
name_txt.restrict = "a-z 0-9.:\\-@";
Selection.setFocus(name_txt);
Selection.setSelection(name_txt.length, name_txt.length);
ok_btn.onRelease = function () {
if (name_txt.length > 0) {
_root.game_so.data.playerName = name_txt.text;
}
Body = Body + "\n\nCheck out Blob Wars and other free games at www.kwikgames.com/blobwars.htm";
loadVariablesNum ("http://www.kwikgames.com/cgi/flashemail.php", 0, "POST");
nextFrame();
};
ok_btn.onKeyDown = function () {
if (Key.getCode() == 13) {
Key.removeListener(ok_btn);
this.onRelease();
}
};
Key.addListener(ok_btn);
Frame 8
stop();
Frame 33
trace("first scene blink");
Instance of Symbol 158 MovieClip "playerHL" in Frame 33
onClipEvent (enterFrame) {
if (_root.whoseGo == _root.PLAYER) {
}
}
Instance of Symbol 160 MovieClip "computerLight" in Frame 33
onClipEvent (enterFrame) {
if (_root.whoseGo == _root.PLAYER) {
}
}
Frame 34
function delay(length) {
x = getTimer();
do {
y = getTimer();
} while (y < (x + length));
}
function computerGo() {
playersGo = false;
jumpMove = false;
canGo = false;
canGo2 = false;
highscore = 0;
highestscore = 0;
score = 0;
bestmove = n;
backupmove = 0;
highscore2 = 0;
highestscore2 = 0;
score2 = 0;
bestmove2 = n;
backupmove = 0;
direction = 0;
direction2 = 0;
canTake = false;
canTake2 = false;
compFull.length = 0;
compFull2.length = 0;
copyArrays();
i = 0;
while (i < 100) {
if (compboard1[i] == 2) {
backupmove = i;
canMove = false;
canMove2 = false;
trace("comp at " + i);
if (compboard1[i + 1] == 1) {
canMove = true;
j = i + 1;
if (compboard1[j - 11] == 3) {
score++;
}
if (compboard1[j - 10] == 3) {
score++;
}
if (compboard1[j - 9] == 3) {
score++;
}
if (compboard1[j - 1] == 3) {
score++;
}
if (compboard1[j + 1] == 3) {
score++;
}
if (compboard1[j + 11] == 3) {
score++;
}
if (compboard1[j + 10] == 3) {
score++;
}
if (compboard1[j + 9] == 3) {
score++;
}
if (score > highscore) {
highscore = score;
if (highscore > highestscore) {
highestscore = score;
bestmove = i;
bestblob = j;
direction = 1;
canTake = true;
}
}
score = 0;
}
if (compboard1[i - 1] == 1) {
canMove = true;
j = i - 1;
if (compboard1[j - 11] == 3) {
score++;
}
if (compboard1[j - 10] == 3) {
score++;
}
if (compboard1[j - 9] == 3) {
score++;
}
if (compboard1[j - 1] == 3) {
score++;
}
if (compboard1[j + 1] == 3) {
score++;
}
if (compboard1[j + 11] == 3) {
score++;
}
if (compboard1[j + 10] == 3) {
score++;
}
if (compboard1[j + 9] == 3) {
score++;
}
if (score > highscore) {
highscore = score;
if (highscore > highestscore) {
highestscore = score;
bestmove = i;
bestblob = j;
direction = -1;
canTake = true;
}
}
score = 0;
}
if (compboard1[i + 9] == 1) {
canMove = true;
j = i + 9;
if (compboard1[j - 11] == 3) {
score++;
}
if (compboard1[j - 10] == 3) {
score++;
}
if (compboard1[j - 9] == 3) {
score++;
}
if (compboard1[j - 1] == 3) {
score++;
}
if (compboard1[j + 1] == 3) {
score++;
}
if (compboard1[j + 11] == 3) {
score++;
}
if (compboard1[j + 10] == 3) {
score++;
}
if (compboard1[j + 9] == 3) {
score++;
}
if (score > highscore) {
highscore = score;
if (highscore > highestscore) {
highestscore = score;
bestmove = i;
bestblob = j;
direction = 9;
canTake = true;
}
}
score = 0;
}
if (compboard1[i + 10] == 1) {
canMove = true;
j = i + 10;
if (compboard1[j - 11] == 3) {
score++;
}
if (compboard1[j - 10] == 3) {
score++;
}
if (compboard1[j - 9] == 3) {
score++;
}
if (compboard1[j - 1] == 3) {
score++;
}
if (compboard1[j + 1] == 3) {
score++;
}
if (compboard1[j + 11] == 3) {
score++;
}
if (compboard1[j + 10] == 3) {
score++;
}
if (compboard1[j + 9] == 3) {
score++;
}
if (score > highscore) {
highscore = score;
if (highscore > highestscore) {
highestscore = score;
bestmove = i;
bestblob = j;
direction = 10;
canTake = true;
}
}
score = 0;
}
if (compboard1[i + 11] == 1) {
canMove = true;
j = i + 11;
if (compboard1[j - 11] == 3) {
score++;
}
if (compboard1[j - 10] == 3) {
score++;
}
if (compboard1[j - 9] == 3) {
score++;
}
if (compboard1[j - 1] == 3) {
score++;
}
if (compboard1[j + 1] == 3) {
score++;
}
if (compboard1[j + 11] == 3) {
score++;
}
if (compboard1[j + 10] == 3) {
score++;
}
if (compboard1[j + 9] == 3) {
score++;
}
if (score > highscore) {
highscore = score;
if (highscore > highestscore) {
highestscore = score;
bestmove = i;
bestblob = j;
direction = 11;
canTake = true;
}
}
score = 0;
}
if (compboard1[i - 9] == 1) {
canMove = true;
j = i - 9;
if (compboard1[j - 11] == 3) {
score++;
}
if (compboard1[j - 10] == 3) {
score++;
}
if (compboard1[j - 9] == 3) {
score++;
}
if (compboard1[j - 1] == 3) {
score++;
}
if (compboard1[j + 1] == 3) {
score++;
}
if (compboard1[j + 11] == 3) {
score++;
}
if (compboard1[j + 10] == 3) {
score++;
}
if (compboard1[j + 9] == 3) {
score++;
}
if (score > highscore) {
highscore = score;
if (highscore > highestscore) {
highestscore = score;
bestmove = i;
bestblob = j;
direction = -9;
canTake = true;
}
}
score = 0;
}
if (compboard1[i - 10] == 1) {
canMove = true;
j = i - 10;
if (compboard1[j - 11] == 3) {
score++;
}
if (compboard1[j - 10] == 3) {
score++;
}
if (compboard1[j - 9] == 3) {
score++;
}
if (compboard1[j - 1] == 3) {
score++;
}
if (compboard1[j + 1] == 3) {
score++;
}
if (compboard1[j + 11] == 3) {
score++;
}
if (compboard1[j + 10] == 3) {
score++;
}
if (compboard1[j + 9] == 3) {
score++;
}
if (score > highscore) {
highscore = score;
if (highscore > highestscore) {
highestscore = score;
bestmove = i;
bestblob = j;
direction = -10;
canTake = true;
}
}
score = 0;
}
if (compboard1[i - 11] == 1) {
canMove = true;
j = i - 11;
if (compboard1[j - 11] == 3) {
score++;
}
if (compboard1[j - 10] == 3) {
score++;
}
if (compboard1[j - 9] == 3) {
score++;
}
if (compboard1[j - 1] == 3) {
score++;
}
if (compboard1[j + 1] == 3) {
score++;
}
if (compboard1[j + 11] == 3) {
score++;
}
if (compboard1[j + 10] == 3) {
score++;
}
if (compboard1[j + 9] == 3) {
score++;
}
if (score > highscore) {
highscore = score;
if (highscore > highestscore) {
highestscore = score;
bestmove = i;
bestblob = j;
direction = -11;
canTake = true;
}
}
score = 0;
}
if (compboard1[i + 2] == 1) {
canMove2 = true;
j = i + 2;
if (compboard1[j - 11] == 3) {
score++;
}
if (compboard1[j - 10] == 3) {
score++;
}
if (compboard1[j - 9] == 3) {
score++;
}
if (compboard1[j - 1] == 3) {
score++;
}
if (compboard1[j + 1] == 3) {
score++;
}
if (compboard1[j + 11] == 3) {
score++;
}
if (compboard1[j + 10] == 3) {
score++;
}
if (compboard1[j + 9] == 3) {
score++;
}
if (score > highscore2) {
highscore2 = score;
if (highscore2 > highestscore2) {
highestscore2 = score;
bestmove2 = i;
bestblob2 = j;
direction2 = 2;
canTake2 = true;
}
}
score = 0;
}
if (compboard1[i - 2] == 1) {
canMove2 = true;
j = i - 2;
if (compboard1[j - 11] == 3) {
score++;
}
if (compboard1[j - 10] == 3) {
score++;
}
if (compboard1[j - 9] == 3) {
score++;
}
if (compboard1[j - 1] == 3) {
score++;
}
if (compboard1[j + 1] == 3) {
score++;
}
if (compboard1[j + 11] == 3) {
score++;
}
if (compboard1[j + 10] == 3) {
score++;
}
if (compboard1[j + 9] == 3) {
score++;
}
if (score > highscore2) {
highscore2 = score;
if (highscore2 > highestscore2) {
highestscore2 = score;
bestmove2 = i;
bestblob2 = j;
direction2 = -2;
canTake2 = true;
}
}
score = 0;
}
if (compboard1[i + 8] == 1) {
canMove2 = true;
j = i + 8;
if (compboard1[j - 11] == 3) {
score++;
}
if (compboard1[j - 10] == 3) {
score++;
}
if (compboard1[j - 9] == 3) {
score++;
}
if (compboard1[j - 1] == 3) {
score++;
}
if (compboard1[j + 1] == 3) {
score++;
}
if (compboard1[j + 11] == 3) {
score++;
}
if (compboard1[j + 10] == 3) {
score++;
}
if (compboard1[j + 9] == 3) {
score++;
}
if (score > highscore2) {
highscore2 = score;
if (highscore2 > highestscore2) {
highestscore2 = score;
bestmove2 = i;
bestblob2 = j;
direction2 = 8;
canTake2 = true;
}
}
score = 0;
}
if (compboard1[i + 10] == 1) {
canMove2 = true;
j = i + 10;
if (compboard1[j - 11] == 3) {
score++;
}
if (compboard1[j - 10] == 3) {
score++;
}
if (compboard1[j - 9] == 3) {
score++;
}
if (compboard1[j - 1] == 3) {
score++;
}
if (compboard1[j + 1] == 3) {
score++;
}
if (compboard1[j + 11] == 3) {
score++;
}
if (compboard1[j + 10] == 3) {
score++;
}
if (compboard1[j + 9] == 3) {
score++;
}
if (score > highscore2) {
highscore2 = score;
if (highscore2 > highestscore2) {
highestscore2 = score;
bestmove2 = i;
bestblob2 = j;
direction2 = 10;
canTake2 = true;
}
}
score = 0;
}
if (compboard1[i + 12] == 1) {
canMove2 = true;
j = i + 12;
if (compboard1[j - 11] == 3) {
score++;
}
if (compboard1[j - 10] == 3) {
score++;
}
if (compboard1[j - 9] == 3) {
score++;
}
if (compboard1[j - 1] == 3) {
score++;
}
if (compboard1[j + 1] == 3) {
score++;
}
if (compboard1[j + 11] == 3) {
score++;
}
if (compboard1[j + 10] == 3) {
score++;
}
if (compboard1[j + 9] == 3) {
score++;
}
if (score > highscore2) {
highscore2 = score;
if (highscore2 > highestscore2) {
highestscore2 = score;
bestmove2 = i;
bestblob2 = j;
direction2 = 12;
canTake2 = true;
}
}
score = 0;
}
if (compboard1[i + 18] == 1) {
canMove2 = true;
j = i + 18;
if (compboard1[j - 11] == 3) {
score++;
}
if (compboard1[j - 10] == 3) {
score++;
}
if (compboard1[j - 9] == 3) {
score++;
}
if (compboard1[j - 1] == 3) {
score++;
}
if (compboard1[j + 1] == 3) {
score++;
}
if (compboard1[j + 11] == 3) {
score++;
}
if (compboard1[j + 10] == 3) {
score++;
}
if (compboard1[j + 9] == 3) {
score++;
}
if (score > highscore2) {
highscore2 = score;
if (highscore2 > highestscore2) {
highestscore2 = score;
bestmove2 = i;
bestblob2 = j;
direction2 = 18;
canTake2 = true;
}
}
score = 0;
}
if (compboard1[i + 19] == 1) {
canMove2 = true;
j = i + 19;
if (compboard1[j - 11] == 3) {
score++;
}
if (compboard1[j - 10] == 3) {
score++;
}
if (compboard1[j - 9] == 3) {
score++;
}
if (compboard1[j - 1] == 3) {
score++;
}
if (compboard1[j + 1] == 3) {
score++;
}
if (compboard1[j + 11] == 3) {
score++;
}
if (compboard1[j + 10] == 3) {
score++;
}
if (compboard1[j + 9] == 3) {
score++;
}
if (score > highscore2) {
highscore2 = score;
if (highscore2 > highestscore2) {
highestscore2 = score;
bestmove2 = i;
bestblob2 = j;
direction2 = 19;
canTake2 = true;
}
}
score = 0;
}
if (compboard1[i + 20] == 1) {
canMove2 = true;
j = i + 20;
if (compboard1[j - 11] == 3) {
score++;
}
if (compboard1[j - 10] == 3) {
score++;
}
if (compboard1[j - 9] == 3) {
score++;
}
if (compboard1[j - 1] == 3) {
score++;
}
if (compboard1[j + 1] == 3) {
score++;
}
if (compboard1[j + 11] == 3) {
score++;
}
if (compboard1[j + 10] == 3) {
score++;
}
if (compboard1[j + 9] == 3) {
score++;
}
if (score > highscore2) {
highscore2 = score;
if (highscore2 > highestscore2) {
highestscore2 = score;
bestmove2 = i;
bestblob2 = j;
direction2 = 20;
canTake2 = true;
}
}
score = 0;
}
if (compboard1[i + 21] == 1) {
canMove2 = true;
j = i + 21;
if (compboard1[j - 11] == 3) {
score++;
}
if (compboard1[j - 10] == 3) {
score++;
}
if (compboard1[j - 9] == 3) {
score++;
}
if (compboard1[j - 1] == 3) {
score++;
}
if (compboard1[j + 1] == 3) {
score++;
}
if (compboard1[j + 11] == 3) {
score++;
}
if (compboard1[j + 10] == 3) {
score++;
}
if (compboard1[j + 9] == 3) {
score++;
}
if (score > highscore2) {
highscore2 = score;
if (highscore2 > highestscore2) {
highestscore2 = score;
bestmove2 = i;
bestblob2 = j;
direction2 = 21;
canTake2 = true;
}
}
score = 0;
}
if (compboard1[i + 22] == 1) {
canMove2 = true;
j = i + 22;
if (compboard1[j - 11] == 3) {
score++;
}
if (compboard1[j - 10] == 3) {
score++;
}
if (compboard1[j - 9] == 3) {
score++;
}
if (compboard1[j - 1] == 3) {
score++;
}
if (compboard1[j + 1] == 3) {
score++;
}
if (compboard1[j + 11] == 3) {
score++;
}
if (compboard1[j + 10] == 3) {
score++;
}
if (compboard1[j + 9] == 3) {
score++;
}
if (score > highscore2) {
highscore2 = score;
if (highscore2 > highestscore2) {
highestscore2 = score;
bestmove2 = i;
bestblob2 = j;
direction2 = 22;
canTake2 = true;
}
}
score = 0;
}
if (compboard1[i - 8] == 1) {
canMove2 = true;
j = i - 8;
if (compboard1[j - 11] == 3) {
score++;
}
if (compboard1[j - 10] == 3) {
score++;
}
if (compboard1[j - 9] == 3) {
score++;
}
if (compboard1[j - 1] == 3) {
score++;
}
if (compboard1[j + 1] == 3) {
score++;
}
if (compboard1[j + 11] == 3) {
score++;
}
if (compboard1[j + 10] == 3) {
score++;
}
if (compboard1[j + 9] == 3) {
score++;
}
if (score > highscore2) {
highscore2 = score;
if (highscore2 > highestscore2) {
highestscore2 = score;
bestmove2 = i;
bestblob2 = j;
direction2 = -8;
canTake2 = true;
}
}
score = 0;
}
if (compboard1[i - 10] == 1) {
canMove2 = true;
j = i - 10;
if (compboard1[j - 11] == 3) {
score++;
}
if (compboard1[j - 10] == 3) {
score++;
}
if (compboard1[j - 9] == 3) {
score++;
}
if (compboard1[j - 1] == 3) {
score++;
}
if (compboard1[j + 1] == 3) {
score++;
}
if (compboard1[j + 11] == 3) {
score++;
}
if (compboard1[j + 10] == 3) {
score++;
}
if (compboard1[j + 9] == 3) {
score++;
}
if (score > highscore2) {
highscore2 = score;
if (highscore2 > highestscore2) {
highestscore2 = score;
bestmove2 = i;
bestblob2 = j;
direction2 = -10;
canTake2 = true;
}
}
score = 0;
}
if (compboard1[i - 12] == 1) {
canMove2 = true;
j = i - 12;
if (compboard1[j - 11] == 3) {
score++;
}
if (compboard1[j - 10] == 3) {
score++;
}
if (compboard1[j - 9] == 3) {
score++;
}
if (compboard1[j - 1] == 3) {
score++;
}
if (compboard1[j + 1] == 3) {
score++;
}
if (compboard1[j + 11] == 3) {
score++;
}
if (compboard1[j + 10] == 3) {
score++;
}
if (compboard1[j + 9] == 3) {
score++;
}
if (score > highscore2) {
highscore2 = score;
if (highscore2 > highestscore2) {
highestscore2 = score;
bestmove2 = i;
bestblob2 = j;
direction2 = -12;
canTake2 = true;
}
}
score = 0;
}
if (compboard1[i - 18] == 1) {
canMove2 = true;
j = i - 18;
if (compboard1[j - 11] == 3) {
score++;
}
if (compboard1[j - 10] == 3) {
score++;
}
if (compboard1[j - 9] == 3) {
score++;
}
if (compboard1[j - 1] == 3) {
score++;
}
if (compboard1[j + 1] == 3) {
score++;
}
if (compboard1[j + 11] == 3) {
score++;
}
if (compboard1[j + 10] == 3) {
score++;
}
if (compboard1[j + 9] == 3) {
score++;
}
if (score > highscore2) {
highscore2 = score;
if (highscore2 > highestscore2) {
highestscore2 = score;
bestmove2 = i;
bestblob2 = j;
direction2 = -18;
canTake2 = true;
}
}
score = 0;
}
if (compboard1[i - 19] == 1) {
canMove2 = true;
j = i - 19;
if (compboard1[j - 11] == 3) {
score++;
}
if (compboard1[j - 10] == 3) {
score++;
}
if (compboard1[j - 9] == 3) {
score++;
}
if (compboard1[j - 1] == 3) {
score++;
}
if (compboard1[j + 1] == 3) {
score++;
}
if (compboard1[j + 11] == 3) {
score++;
}
if (compboard1[j + 10] == 3) {
score++;
}
if (compboard1[j + 9] == 3) {
score++;
}
if (score > highscore2) {
highscore2 = score;
if (highscore2 > highestscore2) {
highestscore2 = score;
bestmove2 = i;
bestblob2 = j;
direction2 = -19;
canTake2 = true;
}
}
score = 0;
}
if (compboard1[i - 20] == 1) {
canMove2 = true;
j = i - 20;
if (compboard1[j - 11] == 3) {
score++;
}
if (compboard1[j - 10] == 3) {
score++;
}
if (compboard1[j - 9] == 3) {
score++;
}
if (compboard1[j - 1] == 3) {
score++;
}
if (compboard1[j + 1] == 3) {
score++;
}
if (compboard1[j + 11] == 3) {
score++;
}
if (compboard1[j + 10] == 3) {
score++;
}
if (compboard1[j + 9] == 3) {
score++;
}
if (score > highscore2) {
highscore2 = score;
if (highscore2 > highestscore2) {
highestscore2 = score;
bestmove2 = i;
bestblob2 = j;
direction2 = -20;
canTake2 = true;
}
}
score = 0;
}
if (compboard1[i - 21] == 1) {
canMove2 = true;
j = i - 21;
if (compboard1[j - 11] == 3) {
score++;
}
if (compboard1[j - 10] == 3) {
score++;
}
if (compboard1[j - 9] == 3) {
score++;
}
if (compboard1[j - 1] == 3) {
score++;
}
if (compboard1[j + 1] == 3) {
score++;
}
if (compboard1[j + 11] == 3) {
score++;
}
if (compboard1[j + 10] == 3) {
score++;
}
if (compboard1[j + 9] == 3) {
score++;
}
if (score > highscore2) {
highscore2 = score;
if (highscore2 > highestscore2) {
highestscore2 = score;
bestmove2 = i;
bestblob2 = j;
direction2 = -21;
canTake2 = true;
}
}
score = 0;
}
if (compboard1[i - 22] == 1) {
canMove2 = true;
j = i - 22;
if (compboard1[j - 11] == 3) {
score++;
}
if (compboard1[j - 10] == 3) {
score++;
}
if (compboard1[j - 9] == 3) {
score++;
}
if (compboard1[j - 1] == 3) {
score++;
}
if (compboard1[j + 1] == 3) {
score++;
}
if (compboard1[j + 11] == 3) {
score++;
}
if (compboard1[j + 10] == 3) {
score++;
}
if (compboard1[j + 9] == 3) {
score++;
}
if (score > highscore2) {
highscore2 = score;
if (highscore2 > highestscore2) {
highestscore2 = score;
bestmove2 = i;
bestblob2 = j;
direction2 = -22;
canTake2 = true;
}
}
score = 0;
}
if (canMove) {
compFull.push(i);
canGo = true;
}
if (canMove2) {
compFull2.push(i);
canGo2 = true;
}
compboard2[i] = highscore;
compboard3[i] = highscore2;
trace(highscore);
trace("jump " + highscore2);
trace(compboard3);
trace("jump moves" + compFull2);
highscore = 0;
highscore2 = 0;
}
i++;
}
if (highestscore == 0) {
bestmove = backupmove;
trace("backup move");
}
trace((((("best move : " + bestmove) + " score : ") + highestscore) + " direction : ") + direction);
trace((((("bestJmove : " + bestmove2) + " score : ") + highestscore2) + " direction : ") + direction2);
debugShowBoard();
bestblob = bestmove;
bestmove = bestmove + direction;
bestmove = compensateArrays(bestmove);
bestblob = compensateArrays(bestblob);
bestblob2 = bestmove2;
bestmove2 = bestmove2 + direction2;
bestmove2 = compensateArrays(bestmove2);
bestblob2 = compensateArrays(bestblob2);
if ((canTake2 == true) && (highestscore2 > highestscore)) {
if (blues == 2) {
canGo = flase;
} else if (blues < 5) {
newRandom = myRandom(0, 4);
if (newRandom < 2) {
canGo = false;
}
} else if (highestscore2 == 8) {
canGo = false;
} else if (highestscore2 < (highestscore + 6)) {
newRandom = myRandom(0, 5);
if (newRandom < 2) {
canGo = false;
}
} else if (highestscore2 < (highestscore + 5)) {
newRandom = myRandom(0, 6);
if (newRandom < 2) {
canGo = false;
}
} else if (highestscore2 < (highestscore + 3)) {
newRandom = myRandom(0, 6);
if (newRandom < 1) {
canGo = false;
}
} else {
newRandom = myRandom(0, 12);
if (newRandom < 1) {
canGo = false;
}
}
}
if (canGo) {
if (canTake) {
gameboard[bestblob] = 46;
computerClicked(name, bestblob);
gameboard[bestblob] = 2;
computerGoDelay.play();
} else {
pos = compFull.length - 1;
newRandom = myRandom(0, pos);
j = compFull[newRandom];
trace((((("Move blob : " + j) + " | ") + pos) + " | ") + newRandom);
bestblob = compensateArrays(j);
compFull.length = 0;
if (compboard1[j - 11] == 1) {
compFull.push(j - 11);
}
if (compboard1[j - 10] == 1) {
compFull.push(j - 10);
}
if (compboard1[j - 9] == 1) {
compFull.push(j - 9);
}
if (compboard1[j - 1] == 1) {
compFull.push(j - 1);
}
if (compboard1[j + 1] == 1) {
compFull.push(j + 1);
}
if (compboard1[j + 11] == 1) {
compFull.push(j + 11);
}
if (compboard1[j + 10] == 1) {
compFull.push(j + 10);
}
if (compboard1[j + 9] == 1) {
compFull.push(j + 9);
}
pos = compFull.length - 1;
bestmove = myRandom(0, pos);
bestmove = compFull[bestmove];
trace((bestmove + " | ") + compFull);
bestmove = compensateArrays(bestmove);
gameboard[bestblob] = 46;
computerClicked(name, bestblob);
gameboard[bestblob] = 2;
trace((("moves " + bestblob) + " to ") + bestmove);
computerDelay2.play();
computerGoDelay.gotoAndStop(1);
}
} else if (canGo2) {
bestmove = bestmove2;
bestblob = bestblob2;
if (canTake2) {
gameboard[bestblob2] = 46;
computerClicked(name, bestblob2);
gameboard[bestblob2] = 1;
computerGoDelay.play();
} else {
pos = compFull2.length - 1;
newRandom = myRandom(0, pos);
j = compFull2[newRandom];
trace((((("Move blob : " + j) + " | ") + pos) + " | ") + newRandom);
bestblob2 = compensateArrays(j);
compFull2.length = 0;
if (compboard1[j - 22] == 1) {
compFull2.push(j - 22);
}
if (compboard1[j - 21] == 1) {
compFull2.push(j - 21);
}
if (compboard1[j - 20] == 1) {
compFull2.push(j - 20);
}
if (compboard1[j - 19] == 1) {
compFull2.push(j - 19);
}
if (compboard1[j - 18] == 1) {
compFull2.push(j - 18);
}
if (compboard1[j - 12] == 1) {
compFull2.push(j - 12);
}
if (compboard1[j - 8] == 1) {
compFull2.push(j - 8);
}
if (compboard1[j - 2] == 1) {
compFull2.push(j - 2);
}
if (compboard1[j + 2] == 1) {
compFull2.push(j + 2);
}
if (compboard1[j + 8] == 1) {
compFull2.push(j + 8);
}
if (compboard1[j + 10] == 1) {
compFull2.push(j + 10);
}
if (compboard1[j + 12] == 1) {
compFull2.push(j + 12);
}
if (compboard1[j + 18] == 1) {
compFull2.push(j + 18);
}
if (compboard1[j + 19] == 1) {
compFull2.push(j + 19);
}
if (compboard1[j + 20] == 1) {
compFull2.push(j + 20);
}
if (compboard1[j + 21] == 1) {
compFull2.push(j + 21);
}
if (compboard1[j + 22] == 1) {
compFull2.push(j + 22);
}
pos = compFull2.length - 1;
bestmove2 = myRandom(0, pos);
bestmove2 = compFull2[bestmove2];
trace((bestmove2 + " | ") + compFull2);
bestmove2 = compensateArrays(bestmove2);
gameboard[bestblob2] = 46;
blobToRemove = bestblob2;
computerClicked(name, bestblob2);
gameboard[bestblob2] = 2;
trace((("moves " + bestblob2) + " to ") + bestmove2);
computerDelay2.play();
computerGoDelay.gotoAndStop(1);
}
} else if ((reds + blues) < 64) {
popup.gotoAndPlay("compPass");
}
}
function compensateArrays(move) {
if (move < 19) {
move = move - 11;
} else if (move < 29) {
move = move - 13;
} else if (move < 39) {
move = move - 15;
} else if (move < 49) {
move = move - 17;
} else if (move < 59) {
move = move - 19;
} else if (move < 69) {
move = move - 21;
} else if (move < 79) {
move = move - 23;
} else if (move < 89) {
move = move - 25;
}
return(move);
}
function debugShowBoard() {
trace((((((((((((((compboard1[11] + " | ") + compboard1[12]) + " | ") + compboard1[13]) + " | ") + compboard1[14]) + " | ") + compboard1[15]) + " | ") + compboard1[16]) + " | ") + compboard1[17]) + " | ") + compboard1[18]);
trace((((((((((((((compboard1[21] + " | ") + compboard1[22]) + " | ") + compboard1[23]) + " | ") + compboard1[24]) + " | ") + compboard1[25]) + " | ") + compboard1[26]) + " | ") + compboard1[27]) + " | ") + compboard1[28]);
trace((((((((((((((compboard1[31] + " | ") + compboard1[32]) + " | ") + compboard1[33]) + " | ") + compboard1[34]) + " | ") + compboard1[35]) + " | ") + compboard1[36]) + " | ") + compboard1[37]) + " | ") + compboard1[38]);
trace((((((((((((((compboard1[41] + " | ") + compboard1[42]) + " | ") + compboard1[43]) + " | ") + compboard1[44]) + " | ") + compboard1[45]) + " | ") + compboard1[46]) + " | ") + compboard1[47]) + " | ") + compboard1[48]);
trace((((((((((((((compboard1[51] + " | ") + compboard1[52]) + " | ") + compboard1[53]) + " | ") + compboard1[54]) + " | ") + compboard1[55]) + " | ") + compboard1[56]) + " | ") + compboard1[57]) + " | ") + compboard1[58]);
trace((((((((((((((compboard1[61] + " | ") + compboard1[62]) + " | ") + compboard1[63]) + " | ") + compboard1[64]) + " | ") + compboard1[65]) + " | ") + compboard1[66]) + " | ") + compboard1[67]) + " | ") + compboard1[68]);
trace((((((((((((((compboard1[71] + " | ") + compboard1[72]) + " | ") + compboard1[73]) + " | ") + compboard1[74]) + " | ") + compboard1[75]) + " | ") + compboard1[76]) + " | ") + compboard1[77]) + " | ") + compboard1[78]);
trace((((((((((((((compboard1[81] + " | ") + compboard1[82]) + " | ") + compboard1[83]) + " | ") + compboard1[84]) + " | ") + compboard1[85]) + " | ") + compboard1[86]) + " | ") + compboard1[87]) + " | ") + compboard1[88]);
trace(compFull);
}
function copyArrays() {
i = 0;
while (i < 8) {
compboard1[i + 11] = gameboard[i];
i++;
}
i = 8;
while (i < 16) {
compboard1[i + 13] = gameboard[i];
i++;
}
i = 16;
while (i < 24) {
compboard1[i + 15] = gameboard[i];
i++;
}
i = 24;
while (i < 32) {
compboard1[i + 17] = gameboard[i];
i++;
}
i = 32;
while (i < 40) {
compboard1[i + 19] = gameboard[i];
i++;
}
i = 40;
while (i < 48) {
compboard1[i + 21] = gameboard[i];
i++;
}
i = 48;
while (i < 56) {
compboard1[i + 23] = gameboard[i];
i++;
}
i = 56;
while (i < 64) {
compboard1[i + 25] = gameboard[i];
i++;
}
}
function myRandom(minval, maxval) {
return(minval + Math.floor(Math.random() * ((maxval + 1) - minval)));
}
function attack(pos) {
attacked = 0;
if (playersGo) {
if (((((((((gameboard[pos + 1] == 2) && (pos != 7)) && (pos != 15)) && (pos != 23)) && (pos != 31)) && (pos != 39)) && (pos != 47)) && (pos != 55)) && (pos != 63)) {
gameboard[pos + 1] = 6;
attacked++;
}
if (((((((((gameboard[pos - 1] == 2) && (pos != 0)) && (pos != 8)) && (pos != 16)) && (pos != 24)) && (pos != 32)) && (pos != 40)) && (pos != 48)) && (pos != 56)) {
gameboard[pos - 1] = 6;
attacked++;
}
if (((((((((gameboard[pos + 9] == 2) && (pos != 7)) && (pos != 15)) && (pos != 23)) && (pos != 31)) && (pos != 39)) && (pos != 47)) && (pos != 55)) && (pos != 63)) {
gameboard[pos + 9] = 6;
attacked++;
}
if (((((((((gameboard[pos + 7] == 2) && (pos != 0)) && (pos != 8)) && (pos != 16)) && (pos != 24)) && (pos != 32)) && (pos != 40)) && (pos != 48)) && (pos != 56)) {
gameboard[pos + 7] = 6;
attacked++;
}
if (gameboard[pos + 8] == 2) {
gameboard[pos + 8] = 6;
attacked++;
}
if (((((((((gameboard[pos - 9] == 2) && (pos != 0)) && (pos != 8)) && (pos != 16)) && (pos != 24)) && (pos != 32)) && (pos != 40)) && (pos != 48)) && (pos != 56)) {
gameboard[pos - 9] = 6;
attacked++;
}
if (((((((((gameboard[pos - 7] == 2) && (pos != 7)) && (pos != 15)) && (pos != 23)) && (pos != 31)) && (pos != 39)) && (pos != 47)) && (pos != 55)) && (pos != 63)) {
gameboard[pos - 7] = 6;
attacked++;
}
if (gameboard[pos - 8] == 2) {
gameboard[pos - 8] = 6;
attacked++;
}
} else {
if (((((((((gameboard[pos + 1] == 3) && (pos != 7)) && (pos != 15)) && (pos != 23)) && (pos != 31)) && (pos != 39)) && (pos != 47)) && (pos != 55)) && (pos != 63)) {
gameboard[pos + 1] = 25;
attacked++;
}
if (((((((((gameboard[pos - 1] == 3) && (pos != 0)) && (pos != 8)) && (pos != 16)) && (pos != 24)) && (pos != 32)) && (pos != 40)) && (pos != 48)) && (pos != 56)) {
gameboard[pos - 1] = 25;
attacked++;
}
if (((((((((gameboard[pos + 9] == 3) && (pos != 7)) && (pos != 15)) && (pos != 23)) && (pos != 31)) && (pos != 39)) && (pos != 47)) && (pos != 55)) && (pos != 63)) {
gameboard[pos + 9] = 25;
attacked++;
}
if (((((((((gameboard[pos + 7] == 3) && (pos != 0)) && (pos != 8)) && (pos != 16)) && (pos != 24)) && (pos != 32)) && (pos != 40)) && (pos != 48)) && (pos != 56)) {
gameboard[pos + 7] = 25;
attacked++;
}
if (gameboard[pos + 8] == 3) {
gameboard[pos + 8] = 25;
attacked++;
}
if (((((((((gameboard[pos - 9] == 3) && (pos != 0)) && (pos != 8)) && (pos != 16)) && (pos != 24)) && (pos != 32)) && (pos != 40)) && (pos != 48)) && (pos != 56)) {
gameboard[pos - 9] = 25;
attacked++;
}
if (((((((((gameboard[pos - 7] == 3) && (pos != 7)) && (pos != 15)) && (pos != 23)) && (pos != 31)) && (pos != 39)) && (pos != 47)) && (pos != 55)) && (pos != 63)) {
gameboard[pos - 7] = 25;
attacked++;
}
if (gameboard[pos - 8] == 3) {
gameboard[pos - 8] = 25;
attacked++;
}
}
showBoard(true);
if (_root.muted == false) {
if (attacked >= 7) {
sound_pass.start();
} else if (attacked >= 5) {
sound_attack2.start();
} else if (attacked >= 3) {
sound_attack.start();
} else if (attacked >= 1) {
sound_attack1.start();
}
}
if (playersGo) {
playersGo = false;
playerHL.gotoAndStop(1);
computerLight.gotoAndStop(2);
computerGoDelay.play();
} else {
playersGo = true;
playerHL.gotoAndStop(2);
computerLight.gotoAndStop(1);
}
curGo++;
}
function clearClicked() {
i = 0;
while (i < 64) {
if ((gameboard[i] == 4) || (gameboard[i] == 5)) {
gameboard[i] = 1;
}
i++;
}
}
function placeBlob(pos) {
if (_root.muted == false) {
sound_spawn.start();
}
if (playersGo) {
gameboard[pos] = 3;
} else {
gameboard[pos] = 2;
}
clearClicked();
showBoard(false);
attack(pos);
}
function moveBlob(pos) {
if (_root.muted == false) {
sound_take.start();
}
if (playersGo) {
gameboard[pos] = 3;
} else {
gameboard[pos] = 2;
}
gameboard[selectedpos] = 1;
clearClicked();
showBoard(false);
attack(pos);
}
function blobClicked(blob, pos) {
if (_root.muted == false) {
sound_select.start();
}
selected = blob;
selectedpos = pos;
clearClicked();
if (((((((((gameboard[pos + 1] == 1) && (pos != 7)) && (pos != 15)) && (pos != 23)) && (pos != 31)) && (pos != 39)) && (pos != 47)) && (pos != 55)) && (pos != 63)) {
gameboard[pos + 1] = 4;
}
if (((((((((((((((((gameboard[pos + 2] == 1) && (pos != 7)) && (pos != 15)) && (pos != 23)) && (pos != 31)) && (pos != 39)) && (pos != 47)) && (pos != 55)) && (pos != 63)) && (pos != 6)) && (pos != 14)) && (pos != 22)) && (pos != 30)) && (pos != 38)) && (pos != 46)) && (pos != 54)) && (pos != 62)) {
gameboard[pos + 2] = 5;
}
if (((((((((gameboard[pos + 8] == 1) && (pos != 56)) && (pos != 57)) && (pos != 58)) && (pos != 59)) && (pos != 60)) && (pos != 61)) && (pos != 62)) && (pos != 63)) {
gameboard[pos + 8] = 4;
}
if (((((((((gameboard[pos + 16] == 1) && (pos != 56)) && (pos != 57)) && (pos != 58)) && (pos != 59)) && (pos != 60)) && (pos != 61)) && (pos != 62)) && (pos != 63)) {
gameboard[pos + 16] = 5;
}
if (((((((((gameboard[pos - 1] == 1) && (pos != 0)) && (pos != 8)) && (pos != 16)) && (pos != 24)) && (pos != 32)) && (pos != 40)) && (pos != 48)) && (pos != 56)) {
gameboard[pos - 1] = 4;
}
if (((((((((((((((((gameboard[pos - 2] == 1) && (pos != 0)) && (pos != 8)) && (pos != 16)) && (pos != 24)) && (pos != 32)) && (pos != 40)) && (pos != 48)) && (pos != 56)) && (pos != 1)) && (pos != 9)) && (pos != 17)) && (pos != 25)) && (pos != 33)) && (pos != 41)) && (pos != 49)) && (pos != 57)) {
gameboard[pos - 2] = 5;
}
if (((((((((gameboard[pos - 8] == 1) && (pos != 0)) && (pos != 1)) && (pos != 2)) && (pos != 3)) && (pos != 4)) && (pos != 5)) && (pos != 6)) && (pos != 7)) {
gameboard[pos - 8] = 4;
}
if (((((((((gameboard[pos - 16] == 1) && (pos != 0)) && (pos != 1)) && (pos != 2)) && (pos != 3)) && (pos != 4)) && (pos != 5)) && (pos != 6)) && (pos != 7)) {
gameboard[pos - 16] = 5;
}
if ((((((((((((((((gameboard[pos + 7] == 1) && (pos != 56)) && (pos != 57)) && (pos != 58)) && (pos != 59)) && (pos != 60)) && (pos != 61)) && (pos != 62)) && (pos != 63)) && (pos != 0)) && (pos != 8)) && (pos != 16)) && (pos != 24)) && (pos != 32)) && (pos != 40)) && (pos != 48)) {
gameboard[pos + 7] = 4;
}
if ((((((((((((((((((((((((gameboard[pos + 6] == 1) && (pos != 56)) && (pos != 57)) && (pos != 58)) && (pos != 59)) && (pos != 60)) && (pos != 61)) && (pos != 62)) && (pos != 63)) && (pos != 0)) && (pos != 8)) && (pos != 16)) && (pos != 24)) && (pos != 32)) && (pos != 40)) && (pos != 48)) && (pos != 1)) && (pos != 9)) && (pos != 17)) && (pos != 25)) && (pos != 33)) && (pos != 41)) && (pos != 49)) && (pos != 57)) {
gameboard[pos + 6] = 5;
}
if ((((((((((((((((((((((((gameboard[pos + 14] == 1) && (pos != 56)) && (pos != 57)) && (pos != 58)) && (pos != 59)) && (pos != 60)) && (pos != 61)) && (pos != 62)) && (pos != 63)) && (pos != 0)) && (pos != 8)) && (pos != 16)) && (pos != 24)) && (pos != 32)) && (pos != 40)) && (pos != 48)) && (pos != 1)) && (pos != 9)) && (pos != 17)) && (pos != 25)) && (pos != 33)) && (pos != 41)) && (pos != 49)) && (pos != 57)) {
gameboard[pos + 14] = 5;
}
if ((((((((((((((((gameboard[pos + 15] == 1) && (pos != 56)) && (pos != 57)) && (pos != 58)) && (pos != 59)) && (pos != 60)) && (pos != 61)) && (pos != 62)) && (pos != 63)) && (pos != 0)) && (pos != 8)) && (pos != 16)) && (pos != 24)) && (pos != 32)) && (pos != 40)) && (pos != 48)) {
gameboard[pos + 15] = 5;
}
if ((((((((((((((((gameboard[pos + 9] == 1) && (pos != 56)) && (pos != 57)) && (pos != 58)) && (pos != 59)) && (pos != 60)) && (pos != 61)) && (pos != 62)) && (pos != 63)) && (pos != 7)) && (pos != 15)) && (pos != 23)) && (pos != 31)) && (pos != 39)) && (pos != 47)) && (pos != 55)) {
gameboard[pos + 9] = 4;
}
if ((((((((((((((((((((((((gameboard[pos + 10] == 1) && (pos != 56)) && (pos != 57)) && (pos != 58)) && (pos != 59)) && (pos != 60)) && (pos != 61)) && (pos != 62)) && (pos != 63)) && (pos != 7)) && (pos != 15)) && (pos != 23)) && (pos != 31)) && (pos != 39)) && (pos != 47)) && (pos != 55)) && (pos != 6)) && (pos != 14)) && (pos != 22)) && (pos != 30)) && (pos != 38)) && (pos != 46)) && (pos != 54)) && (pos != 62)) {
gameboard[pos + 10] = 5;
}
if ((((((((((((((((gameboard[pos + 17] == 1) && (pos != 56)) && (pos != 57)) && (pos != 58)) && (pos != 59)) && (pos != 60)) && (pos != 61)) && (pos != 62)) && (pos != 63)) && (pos != 7)) && (pos != 15)) && (pos != 23)) && (pos != 31)) && (pos != 39)) && (pos != 47)) && (pos != 55)) {
gameboard[pos + 17] = 5;
}
if ((((((((((((((((((((((((gameboard[pos + 18] == 1) && (pos != 56)) && (pos != 57)) && (pos != 58)) && (pos != 59)) && (pos != 60)) && (pos != 61)) && (pos != 62)) && (pos != 63)) && (pos != 7)) && (pos != 15)) && (pos != 23)) && (pos != 31)) && (pos != 39)) && (pos != 47)) && (pos != 55)) && (pos != 6)) && (pos != 14)) && (pos != 22)) && (pos != 30)) && (pos != 38)) && (pos != 46)) && (pos != 54)) && (pos != 62)) {
gameboard[pos + 18] = 5;
}
if ((((((((((((((((gameboard[pos - 7] == 1) && (pos != 7)) && (pos != 15)) && (pos != 23)) && (pos != 31)) && (pos != 39)) && (pos != 47)) && (pos != 55)) && (pos != 63)) && (pos != 0)) && (pos != 1)) && (pos != 2)) && (pos != 3)) && (pos != 4)) && (pos != 5)) && (pos != 6)) {
gameboard[pos - 7] = 4;
}
if (((((((((((((((((gameboard[pos - 6] == 1) && (pos != 7)) && (pos != 15)) && (pos != 23)) && (pos != 31)) && (pos != 39)) && (pos != 47)) && (pos != 55)) && (pos != 63)) && (pos != 6)) && (pos != 14)) && (pos != 22)) && (pos != 30)) && (pos != 38)) && (pos != 46)) && (pos != 54)) && (pos != 62)) {
gameboard[pos - 6] = 5;
}
if (((((((((((((((((gameboard[pos - 14] == 1) && (pos != 7)) && (pos != 15)) && (pos != 23)) && (pos != 31)) && (pos != 39)) && (pos != 47)) && (pos != 55)) && (pos != 63)) && (pos != 6)) && (pos != 14)) && (pos != 22)) && (pos != 30)) && (pos != 38)) && (pos != 46)) && (pos != 54)) && (pos != 62)) {
gameboard[pos - 14] = 5;
}
if ((((((((((((((((gameboard[pos - 15] == 1) && (pos != 7)) && (pos != 15)) && (pos != 23)) && (pos != 31)) && (pos != 39)) && (pos != 47)) && (pos != 55)) && (pos != 63)) && (pos != 0)) && (pos != 1)) && (pos != 2)) && (pos != 3)) && (pos != 4)) && (pos != 5)) && (pos != 6)) {
gameboard[pos - 15] = 5;
}
if ((((((((((((((((gameboard[pos - 9] == 1) && (pos != 1)) && (pos != 2)) && (pos != 3)) && (pos != 4)) && (pos != 5)) && (pos != 6)) && (pos != 7)) && (pos != 0)) && (pos != 8)) && (pos != 16)) && (pos != 24)) && (pos != 32)) && (pos != 40)) && (pos != 48)) && (pos != 56)) {
gameboard[pos - 9] = 4;
}
if ((((((((((((((((((((((((gameboard[pos - 10] == 1) && (pos != 1)) && (pos != 2)) && (pos != 3)) && (pos != 4)) && (pos != 5)) && (pos != 6)) && (pos != 7)) && (pos != 0)) && (pos != 8)) && (pos != 16)) && (pos != 24)) && (pos != 32)) && (pos != 40)) && (pos != 48)) && (pos != 56)) && (pos != 1)) && (pos != 9)) && (pos != 17)) && (pos != 25)) && (pos != 33)) && (pos != 41)) && (pos != 49)) && (pos != 57)) {
gameboard[pos - 10] = 5;
}
if ((((((((((((((((gameboard[pos - 17] == 1) && (pos != 1)) && (pos != 2)) && (pos != 3)) && (pos != 4)) && (pos != 5)) && (pos != 6)) && (pos != 7)) && (pos != 0)) && (pos != 8)) && (pos != 16)) && (pos != 24)) && (pos != 32)) && (pos != 40)) && (pos != 48)) && (pos != 56)) {
gameboard[pos - 17] = 5;
}
if ((((((((((((((((((((((((gameboard[pos - 18] == 1) && (pos != 1)) && (pos != 2)) && (pos != 3)) && (pos != 4)) && (pos != 5)) && (pos != 6)) && (pos != 7)) && (pos != 0)) && (pos != 8)) && (pos != 16)) && (pos != 24)) && (pos != 32)) && (pos != 40)) && (pos != 48)) && (pos != 56)) && (pos != 1)) && (pos != 9)) && (pos != 17)) && (pos != 25)) && (pos != 33)) && (pos != 41)) && (pos != 49)) && (pos != 57)) {
gameboard[pos - 18] = 5;
}
gameboard[pos] = 45;
showBoard(false);
gameboard[pos] = 3;
}
function computerClicked(blob, pos) {
selected = blob;
selectedpos = pos;
if (((((((((gameboard[pos + 1] == 1) && (pos != 7)) && (pos != 15)) && (pos != 23)) && (pos != 31)) && (pos != 39)) && (pos != 47)) && (pos != 55)) && (pos != 63)) {
gameboard[pos + 1] = 4;
}
if (((((((((((((((((gameboard[pos + 2] == 1) && (pos != 7)) && (pos != 15)) && (pos != 23)) && (pos != 31)) && (pos != 39)) && (pos != 47)) && (pos != 55)) && (pos != 63)) && (pos != 6)) && (pos != 14)) && (pos != 22)) && (pos != 30)) && (pos != 38)) && (pos != 46)) && (pos != 54)) && (pos != 62)) {
gameboard[pos + 2] = 5;
}
if (((((((((gameboard[pos + 8] == 1) && (pos != 56)) && (pos != 57)) && (pos != 58)) && (pos != 59)) && (pos != 60)) && (pos != 61)) && (pos != 62)) && (pos != 63)) {
gameboard[pos + 8] = 4;
}
if (((((((((gameboard[pos + 16] == 1) && (pos != 56)) && (pos != 57)) && (pos != 58)) && (pos != 59)) && (pos != 60)) && (pos != 61)) && (pos != 62)) && (pos != 63)) {
gameboard[pos + 16] = 5;
}
if (((((((((gameboard[pos - 1] == 1) && (pos != 0)) && (pos != 8)) && (pos != 16)) && (pos != 24)) && (pos != 32)) && (pos != 40)) && (pos != 48)) && (pos != 56)) {
gameboard[pos - 1] = 4;
}
if (((((((((((((((((gameboard[pos - 2] == 1) && (pos != 0)) && (pos != 8)) && (pos != 16)) && (pos != 24)) && (pos != 32)) && (pos != 40)) && (pos != 48)) && (pos != 56)) && (pos != 1)) && (pos != 9)) && (pos != 17)) && (pos != 25)) && (pos != 33)) && (pos != 41)) && (pos != 49)) && (pos != 57)) {
gameboard[pos - 2] = 5;
}
if (((((((((gameboard[pos - 8] == 1) && (pos != 0)) && (pos != 1)) && (pos != 2)) && (pos != 3)) && (pos != 4)) && (pos != 5)) && (pos != 6)) && (pos != 7)) {
gameboard[pos - 8] = 4;
}
if (((((((((gameboard[pos - 16] == 1) && (pos != 0)) && (pos != 1)) && (pos != 2)) && (pos != 3)) && (pos != 4)) && (pos != 5)) && (pos != 6)) && (pos != 7)) {
gameboard[pos - 16] = 5;
}
if ((((((((((((((((gameboard[pos + 7] == 1) && (pos != 56)) && (pos != 57)) && (pos != 58)) && (pos != 59)) && (pos != 60)) && (pos != 61)) && (pos != 62)) && (pos != 63)) && (pos != 0)) && (pos != 8)) && (pos != 16)) && (pos != 24)) && (pos != 32)) && (pos != 40)) && (pos != 48)) {
gameboard[pos + 7] = 4;
}
if ((((((((((((((((((((((((gameboard[pos + 6] == 1) && (pos != 56)) && (pos != 57)) && (pos != 58)) && (pos != 59)) && (pos != 60)) && (pos != 61)) && (pos != 62)) && (pos != 63)) && (pos != 0)) && (pos != 8)) && (pos != 16)) && (pos != 24)) && (pos != 32)) && (pos != 40)) && (pos != 48)) && (pos != 1)) && (pos != 9)) && (pos != 17)) && (pos != 25)) && (pos != 33)) && (pos != 41)) && (pos != 49)) && (pos != 57)) {
gameboard[pos + 6] = 5;
}
if ((((((((((((((((((((((((gameboard[pos + 14] == 1) && (pos != 56)) && (pos != 57)) && (pos != 58)) && (pos != 59)) && (pos != 60)) && (pos != 61)) && (pos != 62)) && (pos != 63)) && (pos != 0)) && (pos != 8)) && (pos != 16)) && (pos != 24)) && (pos != 32)) && (pos != 40)) && (pos != 48)) && (pos != 1)) && (pos != 9)) && (pos != 17)) && (pos != 25)) && (pos != 33)) && (pos != 41)) && (pos != 49)) && (pos != 57)) {
gameboard[pos + 14] = 5;
}
if ((((((((((((((((gameboard[pos + 15] == 1) && (pos != 56)) && (pos != 57)) && (pos != 58)) && (pos != 59)) && (pos != 60)) && (pos != 61)) && (pos != 62)) && (pos != 63)) && (pos != 0)) && (pos != 8)) && (pos != 16)) && (pos != 24)) && (pos != 32)) && (pos != 40)) && (pos != 48)) {
gameboard[pos + 15] = 5;
}
if ((((((((((((((((gameboard[pos + 9] == 1) && (pos != 56)) && (pos != 57)) && (pos != 58)) && (pos != 59)) && (pos != 60)) && (pos != 61)) && (pos != 62)) && (pos != 63)) && (pos != 7)) && (pos != 15)) && (pos != 23)) && (pos != 31)) && (pos != 39)) && (pos != 47)) && (pos != 55)) {
gameboard[pos + 9] = 4;
}
if ((((((((((((((((((((((((gameboard[pos + 10] == 1) && (pos != 56)) && (pos != 57)) && (pos != 58)) && (pos != 59)) && (pos != 60)) && (pos != 61)) && (pos != 62)) && (pos != 63)) && (pos != 7)) && (pos != 15)) && (pos != 23)) && (pos != 31)) && (pos != 39)) && (pos != 47)) && (pos != 55)) && (pos != 6)) && (pos != 14)) && (pos != 22)) && (pos != 30)) && (pos != 38)) && (pos != 46)) && (pos != 54)) && (pos != 62)) {
gameboard[pos + 10] = 5;
}
if ((((((((((((((((gameboard[pos + 17] == 1) && (pos != 56)) && (pos != 57)) && (pos != 58)) && (pos != 59)) && (pos != 60)) && (pos != 61)) && (pos != 62)) && (pos != 63)) && (pos != 7)) && (pos != 15)) && (pos != 23)) && (pos != 31)) && (pos != 39)) && (pos != 47)) && (pos != 55)) {
gameboard[pos + 17] = 5;
}
if ((((((((((((((((((((((((gameboard[pos + 18] == 1) && (pos != 56)) && (pos != 57)) && (pos != 58)) && (pos != 59)) && (pos != 60)) && (pos != 61)) && (pos != 62)) && (pos != 63)) && (pos != 7)) && (pos != 15)) && (pos != 23)) && (pos != 31)) && (pos != 39)) && (pos != 47)) && (pos != 55)) && (pos != 6)) && (pos != 14)) && (pos != 22)) && (pos != 30)) && (pos != 38)) && (pos != 46)) && (pos != 54)) && (pos != 62)) {
gameboard[pos + 18] = 5;
}
if ((((((((((((((((gameboard[pos - 7] == 1) && (pos != 7)) && (pos != 15)) && (pos != 23)) && (pos != 31)) && (pos != 39)) && (pos != 47)) && (pos != 55)) && (pos != 63)) && (pos != 0)) && (pos != 1)) && (pos != 2)) && (pos != 3)) && (pos != 4)) && (pos != 5)) && (pos != 6)) {
gameboard[pos - 7] = 4;
}
if (((((((((((((((((gameboard[pos - 6] == 1) && (pos != 7)) && (pos != 15)) && (pos != 23)) && (pos != 31)) && (pos != 39)) && (pos != 47)) && (pos != 55)) && (pos != 63)) && (pos != 6)) && (pos != 14)) && (pos != 22)) && (pos != 30)) && (pos != 38)) && (pos != 46)) && (pos != 54)) && (pos != 62)) {
gameboard[pos - 6] = 5;
}
if (((((((((((((((((gameboard[pos - 14] == 1) && (pos != 7)) && (pos != 15)) && (pos != 23)) && (pos != 31)) && (pos != 39)) && (pos != 47)) && (pos != 55)) && (pos != 63)) && (pos != 6)) && (pos != 14)) && (pos != 22)) && (pos != 30)) && (pos != 38)) && (pos != 46)) && (pos != 54)) && (pos != 62)) {
gameboard[pos - 14] = 5;
}
if ((((((((((((((((gameboard[pos - 15] == 1) && (pos != 7)) && (pos != 15)) && (pos != 23)) && (pos != 31)) && (pos != 39)) && (pos != 47)) && (pos != 55)) && (pos != 63)) && (pos != 0)) && (pos != 1)) && (pos != 2)) && (pos != 3)) && (pos != 4)) && (pos != 5)) && (pos != 6)) {
gameboard[pos - 15] = 5;
}
if ((((((((((((((((gameboard[pos - 9] == 1) && (pos != 1)) && (pos != 2)) && (pos != 3)) && (pos != 4)) && (pos != 5)) && (pos != 6)) && (pos != 7)) && (pos != 0)) && (pos != 8)) && (pos != 16)) && (pos != 24)) && (pos != 32)) && (pos != 40)) && (pos != 48)) && (pos != 56)) {
gameboard[pos - 9] = 4;
}
if ((((((((((((((((((((((((gameboard[pos - 10] == 1) && (pos != 1)) && (pos != 2)) && (pos != 3)) && (pos != 4)) && (pos != 5)) && (pos != 6)) && (pos != 7)) && (pos != 0)) && (pos != 8)) && (pos != 16)) && (pos != 24)) && (pos != 32)) && (pos != 40)) && (pos != 48)) && (pos != 56)) && (pos != 1)) && (pos != 9)) && (pos != 17)) && (pos != 25)) && (pos != 33)) && (pos != 41)) && (pos != 49)) && (pos != 57)) {
gameboard[pos - 10] = 5;
}
if ((((((((((((((((gameboard[pos - 17] == 1) && (pos != 1)) && (pos != 2)) && (pos != 3)) && (pos != 4)) && (pos != 5)) && (pos != 6)) && (pos != 7)) && (pos != 0)) && (pos != 8)) && (pos != 16)) && (pos != 24)) && (pos != 32)) && (pos != 40)) && (pos != 48)) && (pos != 56)) {
gameboard[pos - 17] = 5;
}
if ((((((((((((((((((((((((gameboard[pos - 18] == 1) && (pos != 1)) && (pos != 2)) && (pos != 3)) && (pos != 4)) && (pos != 5)) && (pos != 6)) && (pos != 7)) && (pos != 0)) && (pos != 8)) && (pos != 16)) && (pos != 24)) && (pos != 32)) && (pos != 40)) && (pos != 48)) && (pos != 56)) && (pos != 1)) && (pos != 9)) && (pos != 17)) && (pos != 25)) && (pos != 33)) && (pos != 41)) && (pos != 49)) && (pos != 57)) {
gameboard[pos - 18] = 5;
}
showBoard(false);
}
function makeBoard() {
var row;
var col;
var name;
var count = 1;
counter = 0;
row = 0;
while (row < 8) {
col = 0;
while (col < 8) {
name = (("board" + row) + "_") + col;
duplicateMovieClip ("piece", name, count++);
eval (name).row = row;
eval (name).col = col;
eval (name).name = name;
eval (name).pos = counter;
counter++;
col++;
}
row++;
}
board0_0._x = 241.6;
board0_0._y = 42.9;
board0_1._x = 275.2;
board0_1._y = 58.5;
board0_2._x = 308.9;
board0_2._y = 74.2;
board0_3._x = 342.5;
board0_3._y = 89.8;
board0_4._x = 376.1;
board0_4._y = 105.4;
board0_5._x = 409.8;
board0_5._y = 121.2;
board0_6._x = 443.4;
board0_6._y = 136.7;
board0_7._x = 477;
board0_7._y = 152.3;
board1_0._x = 207.9;
board1_0._y = 58.8;
board1_1._x = 241.6;
board1_1._y = 74.2;
board1_2._x = 275.2;
board1_2._y = 89.8;
board1_3._x = 308.9;
board1_3._y = 105.2;
board1_4._x = 342.5;
board1_4._y = 121.1;
board1_5._x = 376.1;
board1_5._y = 136.7;
board1_6._x = 409.8;
board1_6._y = 152.3;
board1_7._x = 443.4;
board1_7._y = 167.9;
board2_0._x = 174.3;
board2_0._y = 74.2;
board2_1._x = 207.9;
board2_1._y = 89.8;
board2_2._x = 241.6;
board2_2._y = 105.4;
board2_3._x = 275.2;
board2_3._y = 121.1;
board2_4._x = 308.9;
board2_4._y = 136.7;
board2_5._x = 342.5;
board2_5._y = 152.3;
board2_6._x = 376.1;
board2_6._y = 167.9;
board2_7._x = 409.8;
board2_7._y = 183.6;
board3_0._x = 140.7;
board3_0._y = 89.9;
board3_1._x = 174.3;
board3_1._y = 105.4;
board3_2._x = 207.9;
board3_2._y = 121.1;
board3_3._x = 241.6;
board3_3._y = 136.7;
board3_4._x = 275.2;
board3_4._y = 152.3;
board3_5._x = 308.9;
board3_5._y = 167.9;
board3_6._x = 342.5;
board3_6._y = 183.6;
board3_7._x = 376.1;
board3_7._y = 199.2;
board4_0._x = 107.1;
board4_0._y = 105.4;
board4_1._x = 140.7;
board4_1._y = 121.1;
board4_2._x = 174.3;
board4_2._y = 136.7;
board4_3._x = 207.9;
board4_3._y = 152.3;
board4_4._x = 241.6;
board4_4._y = 167.9;
board4_5._x = 275.2;
board4_5._y = 183.6;
board4_6._x = 308.9;
board4_6._y = 199.2;
board4_7._x = 342.5;
board4_7._y = 214.8;
board5_0._x = 73.4;
board5_0._y = 121.1;
board5_1._x = 107.1;
board5_1._y = 136.7;
board5_2._x = 140.7;
board5_2._y = 152.3;
board5_3._x = 174.3;
board5_3._y = 167.9;
board5_4._x = 208;
board5_4._y = 183.6;
board5_5._x = 241.6;
board5_5._y = 199.2;
board5_6._x = 275.2;
board5_6._y = 214.8;
board5_7._x = 308.9;
board5_7._y = 230.4;
board6_0._x = 39.8;
board6_0._y = 136.7;
board6_1._x = 73.4;
board6_1._y = 152.3;
board6_2._x = 107.1;
board6_2._y = 167.9;
board6_3._x = 140.7;
board6_3._y = 183.6;
board6_4._x = 174.3;
board6_4._y = 199.2;
board6_5._x = 207.9;
board6_5._y = 214.8;
board6_6._x = 242;
board6_6._y = 230.4;
board6_7._x = 275.2;
board6_7._y = 246.1;
board7_0._x = 6.3;
board7_0._y = 152.3;
board7_1._x = 39.8;
board7_1._y = 167.9;
board7_2._x = 73.4;
board7_2._y = 183.6;
board7_3._x = 107.1;
board7_3._y = 199.2;
board7_4._x = 140.7;
board7_4._y = 214.8;
board7_5._x = 174.3;
board7_5._y = 230.4;
board7_6._x = 207.9;
board7_6._y = 246.3;
board7_7._x = 241.6;
board7_7._y = 261.8;
row = 0;
while (row < 8) {
col = 0;
while (col < 8) {
name = (("board" + row) + "_") + col;
eval (name)._x = eval (name)._x + 34;
eval (name)._y = eval (name)._y + 40;
col++;
}
row++;
}
duplicateMovieClip ("message", "popup", count++);
duplicateMovieClip ("message", "popup2", count++);
popup._x = 275;
popup._y = 200;
popup2._x = 275;
popup2._y = 200;
}
function initGame() {
var row;
var col;
var name;
var count = 1;
i = 0;
while (i < 100) {
gameboard[i] = 1;
compboard1[i] = 0;
compboard2[i] = 0;
compboard3[i] = 0;
i++;
}
gameboard[0] = 3;
gameboard[56] = 3;
gameboard[7] = 2;
gameboard[63] = 2;
if (arena == 4) {
gameboard[27] = 65;
gameboard[28] = 65;
gameboard[35] = 65;
gameboard[36] = 65;
gameboard[18] = 65;
gameboard[21] = 65;
gameboard[42] = 65;
gameboard[45] = 65;
} else if (arena == 2) {
gameboard[1] = 65;
gameboard[8] = 65;
gameboard[6] = 65;
gameboard[15] = 65;
gameboard[48] = 65;
gameboard[57] = 65;
gameboard[55] = 65;
gameboard[62] = 65;
} else if (arena == 6) {
gameboard[27] = 65;
gameboard[28] = 65;
gameboard[35] = 65;
gameboard[36] = 65;
gameboard[18] = 65;
gameboard[21] = 65;
gameboard[42] = 65;
gameboard[45] = 65;
gameboard[9] = 65;
gameboard[14] = 65;
gameboard[49] = 65;
gameboard[54] = 65;
} else if (arena == 5) {
gameboard[19] = 65;
gameboard[20] = 65;
gameboard[26] = 65;
gameboard[34] = 65;
gameboard[29] = 65;
gameboard[37] = 65;
gameboard[43] = 65;
gameboard[44] = 65;
gameboard[9] = 65;
gameboard[14] = 65;
gameboard[49] = 65;
gameboard[54] = 65;
} else if (arena == 3) {
gameboard[2] = 65;
gameboard[10] = 65;
gameboard[5] = 65;
gameboard[13] = 65;
gameboard[16] = 65;
gameboard[17] = 65;
gameboard[22] = 65;
gameboard[23] = 65;
gameboard[50] = 65;
gameboard[58] = 65;
gameboard[53] = 65;
gameboard[61] = 65;
gameboard[40] = 65;
gameboard[41] = 65;
gameboard[46] = 65;
gameboard[47] = 65;
}
curGo = 0;
playerHL.gotoAndStop(2);
showBoard();
}
function showBoard(animate) {
bluecount = 0;
redcount = 0;
i = 11;
while (i < 19) {
j = i - 11;
name = "board0_" + j;
if (((((gameboard[i - 11] == 6) || (gameboard[i - 11] == 25)) || (gameboard[i - 11] == 13)) || (gameboard[i - 11] == 32)) && (animate)) {
eval (name).gotoAndPlay(gameboard[i - 11]);
if (playersGo) {
gameboard[i - 11] = 3;
} else {
gameboard[i - 11] = 2;
}
} else {
eval (name).gotoAndStop(gameboard[i - 11]);
}
i++;
}
i = 21;
while (i < 29) {
j = i - 21;
name = "board1_" + j;
if (((((gameboard[i - 13] == 6) || (gameboard[i - 13] == 25)) || (gameboard[i - 13] == 13)) || (gameboard[i - 13] == 32)) && (animate)) {
eval (name).gotoAndPlay(gameboard[i - 13]);
if (playersGo) {
gameboard[i - 13] = 3;
} else {
gameboard[i - 13] = 2;
}
} else {
eval (name).gotoAndStop(gameboard[i - 13]);
}
i++;
}
i = 31;
while (i < 39) {
j = i - 31;
name = "board2_" + j;
if (((((gameboard[i - 15] == 6) || (gameboard[i - 15] == 25)) || (gameboard[i - 15] == 13)) || (gameboard[i - 15] == 32)) && (animate)) {
eval (name).gotoAndPlay(gameboard[i - 15]);
if (playersGo) {
gameboard[i - 15] = 3;
} else {
gameboard[i - 15] = 2;
}
} else {
eval (name).gotoAndStop(gameboard[i - 15]);
}
i++;
}
i = 41;
while (i < 49) {
j = i - 41;
name = "board3_" + j;
if (((((gameboard[i - 17] == 6) || (gameboard[i - 17] == 25)) || (gameboard[i - 17] == 13)) || (gameboard[i - 17] == 32)) && (animate)) {
eval (name).gotoAndPlay(gameboard[i - 17]);
if (playersGo) {
gameboard[i - 17] = 3;
} else {
gameboard[i - 17] = 2;
}
} else {
eval (name).gotoAndStop(gameboard[i - 17]);
}
i++;
}
i = 51;
while (i < 59) {
j = i - 51;
name = "board4_" + j;
if (((((gameboard[i - 19] == 6) || (gameboard[i - 19] == 25)) || (gameboard[i - 19] == 13)) || (gameboard[i - 19] == 32)) && (animate)) {
eval (name).gotoAndPlay(gameboard[i - 19]);
if (playersGo) {
gameboard[i - 19] = 3;
} else {
gameboard[i - 19] = 2;
}
} else {
eval (name).gotoAndStop(gameboard[i - 19]);
}
i++;
}
i = 61;
while (i < 69) {
j = i - 61;
name = "board5_" + j;
if (((((gameboard[i - 21] == 6) || (gameboard[i - 21] == 25)) || (gameboard[i - 21] == 13)) || (gameboard[i - 21] == 32)) && (animate)) {
eval (name).gotoAndPlay(gameboard[i - 21]);
if (playersGo) {
gameboard[i - 21] = 3;
} else {
gameboard[i - 21] = 2;
}
} else {
eval (name).gotoAndStop(gameboard[i - 21]);
}
i++;
}
i = 71;
while (i < 79) {
j = i - 71;
name = "board6_" + j;
if (((((gameboard[i - 23] == 6) || (gameboard[i - 23] == 25)) || (gameboard[i - 23] == 13)) || (gameboard[i - 23] == 32)) && (animate)) {
eval (name).gotoAndPlay(gameboard[i - 23]);
if (playersGo) {
gameboard[i - 23] = 3;
} else {
gameboard[i - 23] = 2;
}
} else {
eval (name).gotoAndStop(gameboard[i - 23]);
}
i++;
}
i = 81;
while (i < 89) {
j = i - 81;
name = "board7_" + j;
if (((((gameboard[i - 25] == 6) || (gameboard[i - 25] == 25)) || (gameboard[i - 25] == 13)) || (gameboard[i - 25] == 32)) && (animate)) {
eval (name).gotoAndPlay(gameboard[i - 25]);
if (playersGo) {
gameboard[i - 25] = 3;
} else {
gameboard[i - 25] = 2;
}
} else {
eval (name).gotoAndStop(gameboard[i - 25]);
}
i++;
}
updateScores();
}
function updateScores() {
redcount = 0;
bluecount = 0;
i = 0;
while (i < 64) {
if ((gameboard[i] == 2) || (gameboard[i] == 46)) {
redcount++;
} else if ((gameboard[i] == 3) || (gameboard[i] == 45)) {
bluecount++;
}
i++;
}
blues = bluecount;
reds = redcount;
if ((((redcount + bluecount) == numTiles) || (redcount == 0)) || (bluecount == 0)) {
endGame(redcount, bluecount);
}
}
function removeMovedBlob() {
trace("remove " + blobToRemove);
if (playersGo) {
eval (blobToRemove).gotoAndPlay(50);
} else {
eval (blobToRemove).gotoAndPlay(57);
}
}
function updateBlob(piece, frame) {
eval (piece).gotoAndPlay(frame);
}
function endGame() {
trace("endgame");
if (reds == bluecount) {
popup2.gotoAndPlay(95);
trace("draw");
} else if (reds > blues) {
popup2.gotoAndPlay(180);
trace("red");
} else if (blues > reds) {
popup2.gotoAndPlay(263);
trace("blue");
} else {
trace("no win");
}
trace(gameboard);
}
function removePieces() {
var row;
var col;
var name;
var count = 1;
counter = 0;
row = 0;
while (row < 8) {
col = 0;
while (col < 8) {
name = (("board" + row) + "_") + col;
removeMovieClip(name);
counter++;
col++;
}
row++;
}
}
function nextRound() {
popup.gotoAndStop(1);
gotoAndPlay (31);
trace("bluewon");
}
function gameOver() {
gotoAndPlay (36);
}
sound_drums.start(0, 999);
numGames++;
bestmove = 0;
bestblob = 0;
PLAYER = 3;
COMPUTER = 2;
OFFBOARD = 4;
jumpMove = false;
blobToRemove = 0;
selected = 0;
selectedpos = 0;
playersGo = true;
flip = new Array(8);
gameboard = new Array(100);
compboard1 = new Array(100);
compboard2 = new Array(100);
compboard3 = new Array(100);
compFull = new Array();
compFull2 = new Array();
board = new Array(64);
cBoard = new Array(64);
pBoard = new Array(64);
makeBoard();
initGame();
trace("-------------------------------------");
debugShowBoard();
stop();
Instance of Symbol 158 MovieClip "playerHL" in Frame 34
onClipEvent (enterFrame) {
if (_root.whoseGo == _root.PLAYER) {
}
}
Instance of Symbol 160 MovieClip "computerLight" in Frame 34
onClipEvent (enterFrame) {
if (_root.whoseGo == _root.PLAYER) {
}
}
Frame 35
gotoAndStop (34);
Frame 36
if (_root.muted == false) {
_root.sound_laugh.start();
}
sound_drums.stop();
stop();
Frame 37
loadMovie ("http://www.kwikgames.com/adverts/blobwars_ad.swf", _root.promo);
sound_drums.stop();
Frame 159
stop();
Frame 160
stop();
Frame 161
stop();
Frame 162
stop();
Frame 189
trace("first scene blink");
Instance of Symbol 158 MovieClip "playerHL" in Frame 189
onClipEvent (enterFrame) {
if (_root.whoseGo == _root.PLAYER) {
}
}
Instance of Symbol 160 MovieClip "computerLight" in Frame 189
onClipEvent (enterFrame) {
if (_root.whoseGo == _root.PLAYER) {
}
}
Frame 191
function delay(length) {
x = getTimer();
do {
y = getTimer();
} while (y < (x + length));
}
function compensateArrays(move) {
if (move < 19) {
move = move - 11;
} else if (move < 29) {
move = move - 13;
} else if (move < 39) {
move = move - 15;
} else if (move < 49) {
move = move - 17;
} else if (move < 59) {
move = move - 19;
} else if (move < 69) {
move = move - 21;
} else if (move < 79) {
move = move - 23;
} else if (move < 89) {
move = move - 25;
}
return(move);
}
function debugShowBoard() {
trace((((((((((((((compboard1[11] + " | ") + compboard1[12]) + " | ") + compboard1[13]) + " | ") + compboard1[14]) + " | ") + compboard1[15]) + " | ") + compboard1[16]) + " | ") + compboard1[17]) + " | ") + compboard1[18]);
trace((((((((((((((compboard1[21] + " | ") + compboard1[22]) + " | ") + compboard1[23]) + " | ") + compboard1[24]) + " | ") + compboard1[25]) + " | ") + compboard1[26]) + " | ") + compboard1[27]) + " | ") + compboard1[28]);
trace((((((((((((((compboard1[31] + " | ") + compboard1[32]) + " | ") + compboard1[33]) + " | ") + compboard1[34]) + " | ") + compboard1[35]) + " | ") + compboard1[36]) + " | ") + compboard1[37]) + " | ") + compboard1[38]);
trace((((((((((((((compboard1[41] + " | ") + compboard1[42]) + " | ") + compboard1[43]) + " | ") + compboard1[44]) + " | ") + compboard1[45]) + " | ") + compboard1[46]) + " | ") + compboard1[47]) + " | ") + compboard1[48]);
trace((((((((((((((compboard1[51] + " | ") + compboard1[52]) + " | ") + compboard1[53]) + " | ") + compboard1[54]) + " | ") + compboard1[55]) + " | ") + compboard1[56]) + " | ") + compboard1[57]) + " | ") + compboard1[58]);
trace((((((((((((((compboard1[61] + " | ") + compboard1[62]) + " | ") + compboard1[63]) + " | ") + compboard1[64]) + " | ") + compboard1[65]) + " | ") + compboard1[66]) + " | ") + compboard1[67]) + " | ") + compboard1[68]);
trace((((((((((((((compboard1[71] + " | ") + compboard1[72]) + " | ") + compboard1[73]) + " | ") + compboard1[74]) + " | ") + compboard1[75]) + " | ") + compboard1[76]) + " | ") + compboard1[77]) + " | ") + compboard1[78]);
trace((((((((((((((compboard1[81] + " | ") + compboard1[82]) + " | ") + compboard1[83]) + " | ") + compboard1[84]) + " | ") + compboard1[85]) + " | ") + compboard1[86]) + " | ") + compboard1[87]) + " | ") + compboard1[88]);
trace(compFull);
}
function copyArrays() {
i = 0;
while (i < 8) {
compboard1[i + 11] = gameboard[i];
i++;
}
i = 8;
while (i < 16) {
compboard1[i + 13] = gameboard[i];
i++;
}
i = 16;
while (i < 24) {
compboard1[i + 15] = gameboard[i];
i++;
}
i = 24;
while (i < 32) {
compboard1[i + 17] = gameboard[i];
i++;
}
i = 32;
while (i < 40) {
compboard1[i + 19] = gameboard[i];
i++;
}
i = 40;
while (i < 48) {
compboard1[i + 21] = gameboard[i];
i++;
}
i = 48;
while (i < 56) {
compboard1[i + 23] = gameboard[i];
i++;
}
i = 56;
while (i < 64) {
compboard1[i + 25] = gameboard[i];
i++;
}
}
function myRandom(minval, maxval) {
return(minval + Math.floor(Math.random() * ((maxval + 1) - minval)));
}
function attack(pos) {
attacked = 0;
if (playersGo) {
if (((((((((gameboard[pos + 1] == 2) && (pos != 7)) && (pos != 15)) && (pos != 23)) && (pos != 31)) && (pos != 39)) && (pos != 47)) && (pos != 55)) && (pos != 63)) {
gameboard[pos + 1] = 6;
attacked++;
}
if (((((((((gameboard[pos - 1] == 2) && (pos != 0)) && (pos != 8)) && (pos != 16)) && (pos != 24)) && (pos != 32)) && (pos != 40)) && (pos != 48)) && (pos != 56)) {
gameboard[pos - 1] = 6;
attacked++;
}
if (((((((((gameboard[pos + 9] == 2) && (pos != 7)) && (pos != 15)) && (pos != 23)) && (pos != 31)) && (pos != 39)) && (pos != 47)) && (pos != 55)) && (pos != 63)) {
gameboard[pos + 9] = 6;
attacked++;
}
if (((((((((gameboard[pos + 7] == 2) && (pos != 0)) && (pos != 8)) && (pos != 16)) && (pos != 24)) && (pos != 32)) && (pos != 40)) && (pos != 48)) && (pos != 56)) {
gameboard[pos + 7] = 6;
attacked++;
}
if (gameboard[pos + 8] == 2) {
gameboard[pos + 8] = 6;
attacked++;
}
if (((((((((gameboard[pos - 9] == 2) && (pos != 0)) && (pos != 8)) && (pos != 16)) && (pos != 24)) && (pos != 32)) && (pos != 40)) && (pos != 48)) && (pos != 56)) {
gameboard[pos - 9] = 6;
attacked++;
}
if (((((((((gameboard[pos - 7] == 2) && (pos != 7)) && (pos != 15)) && (pos != 23)) && (pos != 31)) && (pos != 39)) && (pos != 47)) && (pos != 55)) && (pos != 63)) {
gameboard[pos - 7] = 6;
attacked++;
}
if (gameboard[pos - 8] == 2) {
gameboard[pos - 8] = 6;
attacked++;
}
} else {
if (((((((((gameboard[pos + 1] == 3) && (pos != 7)) && (pos != 15)) && (pos != 23)) && (pos != 31)) && (pos != 39)) && (pos != 47)) && (pos != 55)) && (pos != 63)) {
gameboard[pos + 1] = 25;
attacked++;
}
if (((((((((gameboard[pos - 1] == 3) && (pos != 0)) && (pos != 8)) && (pos != 16)) && (pos != 24)) && (pos != 32)) && (pos != 40)) && (pos != 48)) && (pos != 56)) {
gameboard[pos - 1] = 25;
attacked++;
}
if (((((((((gameboard[pos + 9] == 3) && (pos != 7)) && (pos != 15)) && (pos != 23)) && (pos != 31)) && (pos != 39)) && (pos != 47)) && (pos != 55)) && (pos != 63)) {
gameboard[pos + 9] = 25;
attacked++;
}
if (((((((((gameboard[pos + 7] == 3) && (pos != 0)) && (pos != 8)) && (pos != 16)) && (pos != 24)) && (pos != 32)) && (pos != 40)) && (pos != 48)) && (pos != 56)) {
gameboard[pos + 7] = 25;
attacked++;
}
if (gameboard[pos + 8] == 3) {
gameboard[pos + 8] = 25;
attacked++;
}
if (((((((((gameboard[pos - 9] == 3) && (pos != 0)) && (pos != 8)) && (pos != 16)) && (pos != 24)) && (pos != 32)) && (pos != 40)) && (pos != 48)) && (pos != 56)) {
gameboard[pos - 9] = 25;
attacked++;
}
if (((((((((gameboard[pos - 7] == 3) && (pos != 7)) && (pos != 15)) && (pos != 23)) && (pos != 31)) && (pos != 39)) && (pos != 47)) && (pos != 55)) && (pos != 63)) {
gameboard[pos - 7] = 25;
attacked++;
}
if (gameboard[pos - 8] == 3) {
gameboard[pos - 8] = 25;
attacked++;
}
}
showBoard(true);
if (_root.muted == false) {
if (attacked >= 7) {
sound_pass.start();
} else if (attacked >= 5) {
sound_attack2.start();
} else if (attacked >= 3) {
sound_attack.start();
} else if (attacked >= 1) {
sound_attack1.start();
}
}
if (playersGo) {
playersGo = false;
playerHL.gotoAndStop(1);
computerLight.gotoAndStop(2);
} else {
playersGo = true;
playerHL.gotoAndStop(2);
computerLight.gotoAndStop(1);
}
curGo++;
}
function clearClicked() {
i = 0;
while (i < 64) {
if ((gameboard[i] == 4) || (gameboard[i] == 5)) {
gameboard[i] = 1;
}
i++;
}
}
function placeBlob(pos) {
if (_root.muted == false) {
sound_spawn.start();
}
if (playersGo) {
gameboard[pos] = 3;
} else {
gameboard[pos] = 2;
}
clearClicked();
showBoard(false);
attack(pos);
}
function moveBlob(pos) {
if (_root.muted == false) {
sound_take.start();
}
if (playersGo) {
gameboard[pos] = 3;
} else {
gameboard[pos] = 2;
}
gameboard[selectedpos] = 1;
clearClicked();
showBoard(false);
attack(pos);
}
function blobClicked(blob, pos) {
if (_root.muted == false) {
sound_select.start();
}
selected = blob;
selectedpos = pos;
clearClicked();
if (((((((((gameboard[pos + 1] == 1) && (pos != 7)) && (pos != 15)) && (pos != 23)) && (pos != 31)) && (pos != 39)) && (pos != 47)) && (pos != 55)) && (pos != 63)) {
gameboard[pos + 1] = 4;
}
if (((((((((((((((((gameboard[pos + 2] == 1) && (pos != 7)) && (pos != 15)) && (pos != 23)) && (pos != 31)) && (pos != 39)) && (pos != 47)) && (pos != 55)) && (pos != 63)) && (pos != 6)) && (pos != 14)) && (pos != 22)) && (pos != 30)) && (pos != 38)) && (pos != 46)) && (pos != 54)) && (pos != 62)) {
gameboard[pos + 2] = 5;
}
if (((((((((gameboard[pos + 8] == 1) && (pos != 56)) && (pos != 57)) && (pos != 58)) && (pos != 59)) && (pos != 60)) && (pos != 61)) && (pos != 62)) && (pos != 63)) {
gameboard[pos + 8] = 4;
}
if (((((((((gameboard[pos + 16] == 1) && (pos != 56)) && (pos != 57)) && (pos != 58)) && (pos != 59)) && (pos != 60)) && (pos != 61)) && (pos != 62)) && (pos != 63)) {
gameboard[pos + 16] = 5;
}
if (((((((((gameboard[pos - 1] == 1) && (pos != 0)) && (pos != 8)) && (pos != 16)) && (pos != 24)) && (pos != 32)) && (pos != 40)) && (pos != 48)) && (pos != 56)) {
gameboard[pos - 1] = 4;
}
if (((((((((((((((((gameboard[pos - 2] == 1) && (pos != 0)) && (pos != 8)) && (pos != 16)) && (pos != 24)) && (pos != 32)) && (pos != 40)) && (pos != 48)) && (pos != 56)) && (pos != 1)) && (pos != 9)) && (pos != 17)) && (pos != 25)) && (pos != 33)) && (pos != 41)) && (pos != 49)) && (pos != 57)) {
gameboard[pos - 2] = 5;
}
if (((((((((gameboard[pos - 8] == 1) && (pos != 0)) && (pos != 1)) && (pos != 2)) && (pos != 3)) && (pos != 4)) && (pos != 5)) && (pos != 6)) && (pos != 7)) {
gameboard[pos - 8] = 4;
}
if (((((((((gameboard[pos - 16] == 1) && (pos != 0)) && (pos != 1)) && (pos != 2)) && (pos != 3)) && (pos != 4)) && (pos != 5)) && (pos != 6)) && (pos != 7)) {
gameboard[pos - 16] = 5;
}
if ((((((((((((((((gameboard[pos + 7] == 1) && (pos != 56)) && (pos != 57)) && (pos != 58)) && (pos != 59)) && (pos != 60)) && (pos != 61)) && (pos != 62)) && (pos != 63)) && (pos != 0)) && (pos != 8)) && (pos != 16)) && (pos != 24)) && (pos != 32)) && (pos != 40)) && (pos != 48)) {
gameboard[pos + 7] = 4;
}
if ((((((((((((((((((((((((gameboard[pos + 6] == 1) && (pos != 56)) && (pos != 57)) && (pos != 58)) && (pos != 59)) && (pos != 60)) && (pos != 61)) && (pos != 62)) && (pos != 63)) && (pos != 0)) && (pos != 8)) && (pos != 16)) && (pos != 24)) && (pos != 32)) && (pos != 40)) && (pos != 48)) && (pos != 1)) && (pos != 9)) && (pos != 17)) && (pos != 25)) && (pos != 33)) && (pos != 41)) && (pos != 49)) && (pos != 57)) {
gameboard[pos + 6] = 5;
}
if ((((((((((((((((((((((((gameboard[pos + 14] == 1) && (pos != 56)) && (pos != 57)) && (pos != 58)) && (pos != 59)) && (pos != 60)) && (pos != 61)) && (pos != 62)) && (pos != 63)) && (pos != 0)) && (pos != 8)) && (pos != 16)) && (pos != 24)) && (pos != 32)) && (pos != 40)) && (pos != 48)) && (pos != 1)) && (pos != 9)) && (pos != 17)) && (pos != 25)) && (pos != 33)) && (pos != 41)) && (pos != 49)) && (pos != 57)) {
gameboard[pos + 14] = 5;
}
if ((((((((((((((((gameboard[pos + 15] == 1) && (pos != 56)) && (pos != 57)) && (pos != 58)) && (pos != 59)) && (pos != 60)) && (pos != 61)) && (pos != 62)) && (pos != 63)) && (pos != 0)) && (pos != 8)) && (pos != 16)) && (pos != 24)) && (pos != 32)) && (pos != 40)) && (pos != 48)) {
gameboard[pos + 15] = 5;
}
if ((((((((((((((((gameboard[pos + 9] == 1) && (pos != 56)) && (pos != 57)) && (pos != 58)) && (pos != 59)) && (pos != 60)) && (pos != 61)) && (pos != 62)) && (pos != 63)) && (pos != 7)) && (pos != 15)) && (pos != 23)) && (pos != 31)) && (pos != 39)) && (pos != 47)) && (pos != 55)) {
gameboard[pos + 9] = 4;
}
if ((((((((((((((((((((((((gameboard[pos + 10] == 1) && (pos != 56)) && (pos != 57)) && (pos != 58)) && (pos != 59)) && (pos != 60)) && (pos != 61)) && (pos != 62)) && (pos != 63)) && (pos != 7)) && (pos != 15)) && (pos != 23)) && (pos != 31)) && (pos != 39)) && (pos != 47)) && (pos != 55)) && (pos != 6)) && (pos != 14)) && (pos != 22)) && (pos != 30)) && (pos != 38)) && (pos != 46)) && (pos != 54)) && (pos != 62)) {
gameboard[pos + 10] = 5;
}
if ((((((((((((((((gameboard[pos + 17] == 1) && (pos != 56)) && (pos != 57)) && (pos != 58)) && (pos != 59)) && (pos != 60)) && (pos != 61)) && (pos != 62)) && (pos != 63)) && (pos != 7)) && (pos != 15)) && (pos != 23)) && (pos != 31)) && (pos != 39)) && (pos != 47)) && (pos != 55)) {
gameboard[pos + 17] = 5;
}
if ((((((((((((((((((((((((gameboard[pos + 18] == 1) && (pos != 56)) && (pos != 57)) && (pos != 58)) && (pos != 59)) && (pos != 60)) && (pos != 61)) && (pos != 62)) && (pos != 63)) && (pos != 7)) && (pos != 15)) && (pos != 23)) && (pos != 31)) && (pos != 39)) && (pos != 47)) && (pos != 55)) && (pos != 6)) && (pos != 14)) && (pos != 22)) && (pos != 30)) && (pos != 38)) && (pos != 46)) && (pos != 54)) && (pos != 62)) {
gameboard[pos + 18] = 5;
}
if ((((((((((((((((gameboard[pos - 7] == 1) && (pos != 7)) && (pos != 15)) && (pos != 23)) && (pos != 31)) && (pos != 39)) && (pos != 47)) && (pos != 55)) && (pos != 63)) && (pos != 0)) && (pos != 1)) && (pos != 2)) && (pos != 3)) && (pos != 4)) && (pos != 5)) && (pos != 6)) {
gameboard[pos - 7] = 4;
}
if (((((((((((((((((gameboard[pos - 6] == 1) && (pos != 7)) && (pos != 15)) && (pos != 23)) && (pos != 31)) && (pos != 39)) && (pos != 47)) && (pos != 55)) && (pos != 63)) && (pos != 6)) && (pos != 14)) && (pos != 22)) && (pos != 30)) && (pos != 38)) && (pos != 46)) && (pos != 54)) && (pos != 62)) {
gameboard[pos - 6] = 5;
}
if (((((((((((((((((gameboard[pos - 14] == 1) && (pos != 7)) && (pos != 15)) && (pos != 23)) && (pos != 31)) && (pos != 39)) && (pos != 47)) && (pos != 55)) && (pos != 63)) && (pos != 6)) && (pos != 14)) && (pos != 22)) && (pos != 30)) && (pos != 38)) && (pos != 46)) && (pos != 54)) && (pos != 62)) {
gameboard[pos - 14] = 5;
}
if ((((((((((((((((gameboard[pos - 15] == 1) && (pos != 7)) && (pos != 15)) && (pos != 23)) && (pos != 31)) && (pos != 39)) && (pos != 47)) && (pos != 55)) && (pos != 63)) && (pos != 0)) && (pos != 1)) && (pos != 2)) && (pos != 3)) && (pos != 4)) && (pos != 5)) && (pos != 6)) {
gameboard[pos - 15] = 5;
}
if ((((((((((((((((gameboard[pos - 9] == 1) && (pos != 1)) && (pos != 2)) && (pos != 3)) && (pos != 4)) && (pos != 5)) && (pos != 6)) && (pos != 7)) && (pos != 0)) && (pos != 8)) && (pos != 16)) && (pos != 24)) && (pos != 32)) && (pos != 40)) && (pos != 48)) && (pos != 56)) {
gameboard[pos - 9] = 4;
}
if ((((((((((((((((((((((((gameboard[pos - 10] == 1) && (pos != 1)) && (pos != 2)) && (pos != 3)) && (pos != 4)) && (pos != 5)) && (pos != 6)) && (pos != 7)) && (pos != 0)) && (pos != 8)) && (pos != 16)) && (pos != 24)) && (pos != 32)) && (pos != 40)) && (pos != 48)) && (pos != 56)) && (pos != 1)) && (pos != 9)) && (pos != 17)) && (pos != 25)) && (pos != 33)) && (pos != 41)) && (pos != 49)) && (pos != 57)) {
gameboard[pos - 10] = 5;
}
if ((((((((((((((((gameboard[pos - 17] == 1) && (pos != 1)) && (pos != 2)) && (pos != 3)) && (pos != 4)) && (pos != 5)) && (pos != 6)) && (pos != 7)) && (pos != 0)) && (pos != 8)) && (pos != 16)) && (pos != 24)) && (pos != 32)) && (pos != 40)) && (pos != 48)) && (pos != 56)) {
gameboard[pos - 17] = 5;
}
if ((((((((((((((((((((((((gameboard[pos - 18] == 1) && (pos != 1)) && (pos != 2)) && (pos != 3)) && (pos != 4)) && (pos != 5)) && (pos != 6)) && (pos != 7)) && (pos != 0)) && (pos != 8)) && (pos != 16)) && (pos != 24)) && (pos != 32)) && (pos != 40)) && (pos != 48)) && (pos != 56)) && (pos != 1)) && (pos != 9)) && (pos != 17)) && (pos != 25)) && (pos != 33)) && (pos != 41)) && (pos != 49)) && (pos != 57)) {
gameboard[pos - 18] = 5;
}
gameboard[pos] = 45;
showBoard(false);
gameboard[pos] = 3;
}
function computerClicked(blob, pos) {
selected = blob;
selectedpos = pos;
if (((((((((gameboard[pos + 1] == 1) && (pos != 7)) && (pos != 15)) && (pos != 23)) && (pos != 31)) && (pos != 39)) && (pos != 47)) && (pos != 55)) && (pos != 63)) {
gameboard[pos + 1] = 4;
}
if (((((((((((((((((gameboard[pos + 2] == 1) && (pos != 7)) && (pos != 15)) && (pos != 23)) && (pos != 31)) && (pos != 39)) && (pos != 47)) && (pos != 55)) && (pos != 63)) && (pos != 6)) && (pos != 14)) && (pos != 22)) && (pos != 30)) && (pos != 38)) && (pos != 46)) && (pos != 54)) && (pos != 62)) {
gameboard[pos + 2] = 5;
}
if (((((((((gameboard[pos + 8] == 1) && (pos != 56)) && (pos != 57)) && (pos != 58)) && (pos != 59)) && (pos != 60)) && (pos != 61)) && (pos != 62)) && (pos != 63)) {
gameboard[pos + 8] = 4;
}
if (((((((((gameboard[pos + 16] == 1) && (pos != 56)) && (pos != 57)) && (pos != 58)) && (pos != 59)) && (pos != 60)) && (pos != 61)) && (pos != 62)) && (pos != 63)) {
gameboard[pos + 16] = 5;
}
if (((((((((gameboard[pos - 1] == 1) && (pos != 0)) && (pos != 8)) && (pos != 16)) && (pos != 24)) && (pos != 32)) && (pos != 40)) && (pos != 48)) && (pos != 56)) {
gameboard[pos - 1] = 4;
}
if (((((((((((((((((gameboard[pos - 2] == 1) && (pos != 0)) && (pos != 8)) && (pos != 16)) && (pos != 24)) && (pos != 32)) && (pos != 40)) && (pos != 48)) && (pos != 56)) && (pos != 1)) && (pos != 9)) && (pos != 17)) && (pos != 25)) && (pos != 33)) && (pos != 41)) && (pos != 49)) && (pos != 57)) {
gameboard[pos - 2] = 5;
}
if (((((((((gameboard[pos - 8] == 1) && (pos != 0)) && (pos != 1)) && (pos != 2)) && (pos != 3)) && (pos != 4)) && (pos != 5)) && (pos != 6)) && (pos != 7)) {
gameboard[pos - 8] = 4;
}
if (((((((((gameboard[pos - 16] == 1) && (pos != 0)) && (pos != 1)) && (pos != 2)) && (pos != 3)) && (pos != 4)) && (pos != 5)) && (pos != 6)) && (pos != 7)) {
gameboard[pos - 16] = 5;
}
if ((((((((((((((((gameboard[pos + 7] == 1) && (pos != 56)) && (pos != 57)) && (pos != 58)) && (pos != 59)) && (pos != 60)) && (pos != 61)) && (pos != 62)) && (pos != 63)) && (pos != 0)) && (pos != 8)) && (pos != 16)) && (pos != 24)) && (pos != 32)) && (pos != 40)) && (pos != 48)) {
gameboard[pos + 7] = 4;
}
if ((((((((((((((((((((((((gameboard[pos + 6] == 1) && (pos != 56)) && (pos != 57)) && (pos != 58)) && (pos != 59)) && (pos != 60)) && (pos != 61)) && (pos != 62)) && (pos != 63)) && (pos != 0)) && (pos != 8)) && (pos != 16)) && (pos != 24)) && (pos != 32)) && (pos != 40)) && (pos != 48)) && (pos != 1)) && (pos != 9)) && (pos != 17)) && (pos != 25)) && (pos != 33)) && (pos != 41)) && (pos != 49)) && (pos != 57)) {
gameboard[pos + 6] = 5;
}
if ((((((((((((((((((((((((gameboard[pos + 14] == 1) && (pos != 56)) && (pos != 57)) && (pos != 58)) && (pos != 59)) && (pos != 60)) && (pos != 61)) && (pos != 62)) && (pos != 63)) && (pos != 0)) && (pos != 8)) && (pos != 16)) && (pos != 24)) && (pos != 32)) && (pos != 40)) && (pos != 48)) && (pos != 1)) && (pos != 9)) && (pos != 17)) && (pos != 25)) && (pos != 33)) && (pos != 41)) && (pos != 49)) && (pos != 57)) {
gameboard[pos + 14] = 5;
}
if ((((((((((((((((gameboard[pos + 15] == 1) && (pos != 56)) && (pos != 57)) && (pos != 58)) && (pos != 59)) && (pos != 60)) && (pos != 61)) && (pos != 62)) && (pos != 63)) && (pos != 0)) && (pos != 8)) && (pos != 16)) && (pos != 24)) && (pos != 32)) && (pos != 40)) && (pos != 48)) {
gameboard[pos + 15] = 5;
}
if ((((((((((((((((gameboard[pos + 9] == 1) && (pos != 56)) && (pos != 57)) && (pos != 58)) && (pos != 59)) && (pos != 60)) && (pos != 61)) && (pos != 62)) && (pos != 63)) && (pos != 7)) && (pos != 15)) && (pos != 23)) && (pos != 31)) && (pos != 39)) && (pos != 47)) && (pos != 55)) {
gameboard[pos + 9] = 4;
}
if ((((((((((((((((((((((((gameboard[pos + 10] == 1) && (pos != 56)) && (pos != 57)) && (pos != 58)) && (pos != 59)) && (pos != 60)) && (pos != 61)) && (pos != 62)) && (pos != 63)) && (pos != 7)) && (pos != 15)) && (pos != 23)) && (pos != 31)) && (pos != 39)) && (pos != 47)) && (pos != 55)) && (pos != 6)) && (pos != 14)) && (pos != 22)) && (pos != 30)) && (pos != 38)) && (pos != 46)) && (pos != 54)) && (pos != 62)) {
gameboard[pos + 10] = 5;
}
if ((((((((((((((((gameboard[pos + 17] == 1) && (pos != 56)) && (pos != 57)) && (pos != 58)) && (pos != 59)) && (pos != 60)) && (pos != 61)) && (pos != 62)) && (pos != 63)) && (pos != 7)) && (pos != 15)) && (pos != 23)) && (pos != 31)) && (pos != 39)) && (pos != 47)) && (pos != 55)) {
gameboard[pos + 17] = 5;
}
if ((((((((((((((((((((((((gameboard[pos + 18] == 1) && (pos != 56)) && (pos != 57)) && (pos != 58)) && (pos != 59)) && (pos != 60)) && (pos != 61)) && (pos != 62)) && (pos != 63)) && (pos != 7)) && (pos != 15)) && (pos != 23)) && (pos != 31)) && (pos != 39)) && (pos != 47)) && (pos != 55)) && (pos != 6)) && (pos != 14)) && (pos != 22)) && (pos != 30)) && (pos != 38)) && (pos != 46)) && (pos != 54)) && (pos != 62)) {
gameboard[pos + 18] = 5;
}
if ((((((((((((((((gameboard[pos - 7] == 1) && (pos != 7)) && (pos != 15)) && (pos != 23)) && (pos != 31)) && (pos != 39)) && (pos != 47)) && (pos != 55)) && (pos != 63)) && (pos != 0)) && (pos != 1)) && (pos != 2)) && (pos != 3)) && (pos != 4)) && (pos != 5)) && (pos != 6)) {
gameboard[pos - 7] = 4;
}
if (((((((((((((((((gameboard[pos - 6] == 1) && (pos != 7)) && (pos != 15)) && (pos != 23)) && (pos != 31)) && (pos != 39)) && (pos != 47)) && (pos != 55)) && (pos != 63)) && (pos != 6)) && (pos != 14)) && (pos != 22)) && (pos != 30)) && (pos != 38)) && (pos != 46)) && (pos != 54)) && (pos != 62)) {
gameboard[pos - 6] = 5;
}
if (((((((((((((((((gameboard[pos - 14] == 1) && (pos != 7)) && (pos != 15)) && (pos != 23)) && (pos != 31)) && (pos != 39)) && (pos != 47)) && (pos != 55)) && (pos != 63)) && (pos != 6)) && (pos != 14)) && (pos != 22)) && (pos != 30)) && (pos != 38)) && (pos != 46)) && (pos != 54)) && (pos != 62)) {
gameboard[pos - 14] = 5;
}
if ((((((((((((((((gameboard[pos - 15] == 1) && (pos != 7)) && (pos != 15)) && (pos != 23)) && (pos != 31)) && (pos != 39)) && (pos != 47)) && (pos != 55)) && (pos != 63)) && (pos != 0)) && (pos != 1)) && (pos != 2)) && (pos != 3)) && (pos != 4)) && (pos != 5)) && (pos != 6)) {
gameboard[pos - 15] = 5;
}
if ((((((((((((((((gameboard[pos - 9] == 1) && (pos != 1)) && (pos != 2)) && (pos != 3)) && (pos != 4)) && (pos != 5)) && (pos != 6)) && (pos != 7)) && (pos != 0)) && (pos != 8)) && (pos != 16)) && (pos != 24)) && (pos != 32)) && (pos != 40)) && (pos != 48)) && (pos != 56)) {
gameboard[pos - 9] = 4;
}
if ((((((((((((((((((((((((gameboard[pos - 10] == 1) && (pos != 1)) && (pos != 2)) && (pos != 3)) && (pos != 4)) && (pos != 5)) && (pos != 6)) && (pos != 7)) && (pos != 0)) && (pos != 8)) && (pos != 16)) && (pos != 24)) && (pos != 32)) && (pos != 40)) && (pos != 48)) && (pos != 56)) && (pos != 1)) && (pos != 9)) && (pos != 17)) && (pos != 25)) && (pos != 33)) && (pos != 41)) && (pos != 49)) && (pos != 57)) {
gameboard[pos - 10] = 5;
}
if ((((((((((((((((gameboard[pos - 17] == 1) && (pos != 1)) && (pos != 2)) && (pos != 3)) && (pos != 4)) && (pos != 5)) && (pos != 6)) && (pos != 7)) && (pos != 0)) && (pos != 8)) && (pos != 16)) && (pos != 24)) && (pos != 32)) && (pos != 40)) && (pos != 48)) && (pos != 56)) {
gameboard[pos - 17] = 5;
}
if ((((((((((((((((((((((((gameboard[pos - 18] == 1) && (pos != 1)) && (pos != 2)) && (pos != 3)) && (pos != 4)) && (pos != 5)) && (pos != 6)) && (pos != 7)) && (pos != 0)) && (pos != 8)) && (pos != 16)) && (pos != 24)) && (pos != 32)) && (pos != 40)) && (pos != 48)) && (pos != 56)) && (pos != 1)) && (pos != 9)) && (pos != 17)) && (pos != 25)) && (pos != 33)) && (pos != 41)) && (pos != 49)) && (pos != 57)) {
gameboard[pos - 18] = 5;
}
gameboard[pos] = 46;
showBoard(false);
gameboard[pos] = 2;
}
function makeBoard() {
var row;
var col;
var name;
var count = 1;
counter = 0;
row = 0;
while (row < 8) {
col = 0;
while (col < 8) {
name = (("board" + row) + "_") + col;
duplicateMovieClip ("piece", name, count++);
eval (name).row = row;
eval (name).col = col;
eval (name).name = name;
eval (name).pos = counter;
counter++;
col++;
}
row++;
}
board0_0._x = 241.6;
board0_0._y = 42.9;
board0_1._x = 275.2;
board0_1._y = 58.5;
board0_2._x = 308.9;
board0_2._y = 74.2;
board0_3._x = 342.5;
board0_3._y = 89.8;
board0_4._x = 376.1;
board0_4._y = 105.4;
board0_5._x = 409.8;
board0_5._y = 121.2;
board0_6._x = 443.4;
board0_6._y = 136.7;
board0_7._x = 477;
board0_7._y = 152.3;
board1_0._x = 207.9;
board1_0._y = 58.8;
board1_1._x = 241.6;
board1_1._y = 74.2;
board1_2._x = 275.2;
board1_2._y = 89.8;
board1_3._x = 308.9;
board1_3._y = 105.2;
board1_4._x = 342.5;
board1_4._y = 121.1;
board1_5._x = 376.1;
board1_5._y = 136.7;
board1_6._x = 409.8;
board1_6._y = 152.3;
board1_7._x = 443.4;
board1_7._y = 167.9;
board2_0._x = 174.3;
board2_0._y = 74.2;
board2_1._x = 207.9;
board2_1._y = 89.8;
board2_2._x = 241.6;
board2_2._y = 105.4;
board2_3._x = 275.2;
board2_3._y = 121.1;
board2_4._x = 308.9;
board2_4._y = 136.7;
board2_5._x = 342.5;
board2_5._y = 152.3;
board2_6._x = 376.1;
board2_6._y = 167.9;
board2_7._x = 409.8;
board2_7._y = 183.6;
board3_0._x = 140.7;
board3_0._y = 89.9;
board3_1._x = 174.3;
board3_1._y = 105.4;
board3_2._x = 207.9;
board3_2._y = 121.1;
board3_3._x = 241.6;
board3_3._y = 136.7;
board3_4._x = 275.2;
board3_4._y = 152.3;
board3_5._x = 308.9;
board3_5._y = 167.9;
board3_6._x = 342.5;
board3_6._y = 183.6;
board3_7._x = 376.1;
board3_7._y = 199.2;
board4_0._x = 107.1;
board4_0._y = 105.4;
board4_1._x = 140.7;
board4_1._y = 121.1;
board4_2._x = 174.3;
board4_2._y = 136.7;
board4_3._x = 207.9;
board4_3._y = 152.3;
board4_4._x = 241.6;
board4_4._y = 167.9;
board4_5._x = 275.2;
board4_5._y = 183.6;
board4_6._x = 308.9;
board4_6._y = 199.2;
board4_7._x = 342.5;
board4_7._y = 214.8;
board5_0._x = 73.4;
board5_0._y = 121.1;
board5_1._x = 107.1;
board5_1._y = 136.7;
board5_2._x = 140.7;
board5_2._y = 152.3;
board5_3._x = 174.3;
board5_3._y = 167.9;
board5_4._x = 208;
board5_4._y = 183.6;
board5_5._x = 241.6;
board5_5._y = 199.2;
board5_6._x = 275.2;
board5_6._y = 214.8;
board5_7._x = 308.9;
board5_7._y = 230.4;
board6_0._x = 39.8;
board6_0._y = 136.7;
board6_1._x = 73.4;
board6_1._y = 152.3;
board6_2._x = 107.1;
board6_2._y = 167.9;
board6_3._x = 140.7;
board6_3._y = 183.6;
board6_4._x = 174.3;
board6_4._y = 199.2;
board6_5._x = 207.9;
board6_5._y = 214.8;
board6_6._x = 242;
board6_6._y = 230.4;
board6_7._x = 275.2;
board6_7._y = 246.1;
board7_0._x = 6.3;
board7_0._y = 152.3;
board7_1._x = 39.8;
board7_1._y = 167.9;
board7_2._x = 73.4;
board7_2._y = 183.6;
board7_3._x = 107.1;
board7_3._y = 199.2;
board7_4._x = 140.7;
board7_4._y = 214.8;
board7_5._x = 174.3;
board7_5._y = 230.4;
board7_6._x = 207.9;
board7_6._y = 246.3;
board7_7._x = 241.6;
board7_7._y = 261.8;
row = 0;
while (row < 8) {
col = 0;
while (col < 8) {
name = (("board" + row) + "_") + col;
eval (name)._x = eval (name)._x + 34;
eval (name)._y = eval (name)._y + 40;
col++;
}
row++;
}
duplicateMovieClip ("message", "popup", count++);
duplicateMovieClip ("message", "popup2", count++);
popup._x = 275;
popup._y = 200;
popup2._x = 275;
popup2._y = 200;
}
function initGame() {
var row;
var col;
var name;
var count = 1;
i = 0;
while (i < 100) {
gameboard[i] = 1;
compboard1[i] = 0;
compboard2[i] = 0;
compboard3[i] = 0;
i++;
}
gameboard[0] = 3;
gameboard[56] = 3;
gameboard[7] = 2;
gameboard[63] = 2;
if (arena == 4) {
gameboard[27] = 65;
gameboard[28] = 65;
gameboard[35] = 65;
gameboard[36] = 65;
gameboard[18] = 65;
gameboard[21] = 65;
gameboard[42] = 65;
gameboard[45] = 65;
} else if (arena == 2) {
gameboard[1] = 65;
gameboard[8] = 65;
gameboard[6] = 65;
gameboard[15] = 65;
gameboard[48] = 65;
gameboard[57] = 65;
gameboard[55] = 65;
gameboard[62] = 65;
} else if (arena == 6) {
gameboard[27] = 65;
gameboard[28] = 65;
gameboard[35] = 65;
gameboard[36] = 65;
gameboard[18] = 65;
gameboard[21] = 65;
gameboard[42] = 65;
gameboard[45] = 65;
gameboard[9] = 65;
gameboard[14] = 65;
gameboard[49] = 65;
gameboard[54] = 65;
} else if (arena == 5) {
gameboard[19] = 65;
gameboard[20] = 65;
gameboard[26] = 65;
gameboard[34] = 65;
gameboard[29] = 65;
gameboard[37] = 65;
gameboard[43] = 65;
gameboard[44] = 65;
gameboard[9] = 65;
gameboard[14] = 65;
gameboard[49] = 65;
gameboard[54] = 65;
} else if (arena == 3) {
gameboard[2] = 65;
gameboard[10] = 65;
gameboard[5] = 65;
gameboard[13] = 65;
gameboard[16] = 65;
gameboard[17] = 65;
gameboard[22] = 65;
gameboard[23] = 65;
gameboard[50] = 65;
gameboard[58] = 65;
gameboard[53] = 65;
gameboard[61] = 65;
gameboard[40] = 65;
gameboard[41] = 65;
gameboard[46] = 65;
gameboard[47] = 65;
}
curGo = 0;
playerHL.gotoAndStop(2);
showBoard();
}
function showBoard(animate) {
bluecount = 0;
redcount = 0;
i = 11;
while (i < 19) {
j = i - 11;
name = "board0_" + j;
if (((((gameboard[i - 11] == 6) || (gameboard[i - 11] == 25)) || (gameboard[i - 11] == 13)) || (gameboard[i - 11] == 32)) && (animate)) {
eval (name).gotoAndPlay(gameboard[i - 11]);
if (playersGo) {
gameboard[i - 11] = 3;
} else {
gameboard[i - 11] = 2;
}
} else {
eval (name).gotoAndStop(gameboard[i - 11]);
}
i++;
}
i = 21;
while (i < 29) {
j = i - 21;
name = "board1_" + j;
if (((((gameboard[i - 13] == 6) || (gameboard[i - 13] == 25)) || (gameboard[i - 13] == 13)) || (gameboard[i - 13] == 32)) && (animate)) {
eval (name).gotoAndPlay(gameboard[i - 13]);
if (playersGo) {
gameboard[i - 13] = 3;
} else {
gameboard[i - 13] = 2;
}
} else {
eval (name).gotoAndStop(gameboard[i - 13]);
}
i++;
}
i = 31;
while (i < 39) {
j = i - 31;
name = "board2_" + j;
if (((((gameboard[i - 15] == 6) || (gameboard[i - 15] == 25)) || (gameboard[i - 15] == 13)) || (gameboard[i - 15] == 32)) && (animate)) {
eval (name).gotoAndPlay(gameboard[i - 15]);
if (playersGo) {
gameboard[i - 15] = 3;
} else {
gameboard[i - 15] = 2;
}
} else {
eval (name).gotoAndStop(gameboard[i - 15]);
}
i++;
}
i = 41;
while (i < 49) {
j = i - 41;
name = "board3_" + j;
if (((((gameboard[i - 17] == 6) || (gameboard[i - 17] == 25)) || (gameboard[i - 17] == 13)) || (gameboard[i - 17] == 32)) && (animate)) {
eval (name).gotoAndPlay(gameboard[i - 17]);
if (playersGo) {
gameboard[i - 17] = 3;
} else {
gameboard[i - 17] = 2;
}
} else {
eval (name).gotoAndStop(gameboard[i - 17]);
}
i++;
}
i = 51;
while (i < 59) {
j = i - 51;
name = "board4_" + j;
if (((((gameboard[i - 19] == 6) || (gameboard[i - 19] == 25)) || (gameboard[i - 19] == 13)) || (gameboard[i - 19] == 32)) && (animate)) {
eval (name).gotoAndPlay(gameboard[i - 19]);
if (playersGo) {
gameboard[i - 19] = 3;
} else {
gameboard[i - 19] = 2;
}
} else {
eval (name).gotoAndStop(gameboard[i - 19]);
}
i++;
}
i = 61;
while (i < 69) {
j = i - 61;
name = "board5_" + j;
if (((((gameboard[i - 21] == 6) || (gameboard[i - 21] == 25)) || (gameboard[i - 21] == 13)) || (gameboard[i - 21] == 32)) && (animate)) {
eval (name).gotoAndPlay(gameboard[i - 21]);
if (playersGo) {
gameboard[i - 21] = 3;
} else {
gameboard[i - 21] = 2;
}
} else {
eval (name).gotoAndStop(gameboard[i - 21]);
}
i++;
}
i = 71;
while (i < 79) {
j = i - 71;
name = "board6_" + j;
if (((((gameboard[i - 23] == 6) || (gameboard[i - 23] == 25)) || (gameboard[i - 23] == 13)) || (gameboard[i - 23] == 32)) && (animate)) {
eval (name).gotoAndPlay(gameboard[i - 23]);
if (playersGo) {
gameboard[i - 23] = 3;
} else {
gameboard[i - 23] = 2;
}
} else {
eval (name).gotoAndStop(gameboard[i - 23]);
}
i++;
}
i = 81;
while (i < 89) {
j = i - 81;
name = "board7_" + j;
if (((((gameboard[i - 25] == 6) || (gameboard[i - 25] == 25)) || (gameboard[i - 25] == 13)) || (gameboard[i - 25] == 32)) && (animate)) {
eval (name).gotoAndPlay(gameboard[i - 25]);
if (playersGo) {
gameboard[i - 25] = 3;
} else {
gameboard[i - 25] = 2;
}
} else {
eval (name).gotoAndStop(gameboard[i - 25]);
}
i++;
}
updateScores();
}
function updateScores() {
redcount = 0;
bluecount = 0;
i = 0;
while (i < 64) {
if ((gameboard[i] == 2) || (gameboard[i] == 46)) {
redcount++;
} else if ((gameboard[i] == 3) || (gameboard[i] == 45)) {
bluecount++;
}
i++;
}
blues = bluecount;
reds = redcount;
if ((((redcount + bluecount) == numTiles) || (redcount == 0)) || (bluecount == 0)) {
endGame(redcount, bluecount);
}
}
function removeMovedBlob() {
trace("remove " + blobToRemove);
if (playersGo) {
eval (blobToRemove).gotoAndPlay(50);
} else {
eval (blobToRemove).gotoAndPlay(57);
}
}
function updateBlob(piece, frame) {
eval (piece).gotoAndPlay(frame);
}
function endGame() {
trace("endgame");
if (reds == bluecount) {
popup2.gotoAndPlay(95);
trace("draw");
} else if (reds > blues) {
popup2.gotoAndPlay(180);
trace("red");
} else if (blues > reds) {
popup2.gotoAndPlay(263);
trace("blue");
} else {
trace("no win");
}
trace(gameboard);
}
function removePieces() {
var row;
var col;
var name;
var count = 1;
counter = 0;
row = 0;
while (row < 8) {
col = 0;
while (col < 8) {
name = (("board" + row) + "_") + col;
removeMovieClip(name);
counter++;
col++;
}
row++;
}
}
function nextRound() {
popup.gotoAndStop(1);
gotoAndPlay (189);
trace("bluewon");
}
function gameOver() {
gotoAndPlay (193);
}
sound_drums.start(0, 999);
numGames++;
bestmove = 0;
bestblob = 0;
PLAYER = 3;
COMPUTER = 2;
OFFBOARD = 4;
jumpMove = false;
blobToRemove = 0;
selected = 0;
selectedpos = 0;
playersGo = true;
flip = new Array(8);
gameboard = new Array(100);
compboard1 = new Array(100);
compboard2 = new Array(100);
compboard3 = new Array(100);
compFull = new Array();
compFull2 = new Array();
board = new Array(64);
cBoard = new Array(64);
pBoard = new Array(64);
makeBoard();
initGame();
trace("-------------------------------------");
debugShowBoard();
stop();
Instance of Symbol 158 MovieClip "playerHL" in Frame 191
onClipEvent (enterFrame) {
if (_root.whoseGo == _root.PLAYER) {
}
}
Instance of Symbol 376 MovieClip "computerLight" in Frame 191
onClipEvent (enterFrame) {
if (_root.whoseGo == _root.PLAYER) {
}
}
Frame 192
gotoAndStop (191);
Frame 193
if (_root.muted == false) {
_root.sound_laugh.start();
}
sound_drums.stop();
stop();
Frame 194
loadMovie ("http://www.kwikgames.com/adverts/blobwars_ad.swf", _root.promo);
sound_drums.stop();
Frame 292
stop();
Symbol 13 MovieClip Frame 1
function formatBytes(bytes) {
var kb = 1024;
var mb = (kb * 1024);
var tempNum = 0;
if (bytes >= mb) {
tempNum = String(Math.floor((bytes / mb) * 100) / 100);
if (tempNum.substring(tempNum.indexOf("."), tempNum.length).length == 2) {
tempNum = tempNum + "0";
}
tempNum = tempNum + " MB";
} else if (bytes >= kb) {
tempNum = String(Math.floor((bytes / kb) * 100) / 100);
if (tempNum.substring(tempNum.indexOf("."), tempNum.length).length == 2) {
tempNum = tempNum + "0";
}
tempNum = tempNum + " KB";
} else {
tempNum = bytes + " B";
}
return(tempNum);
}
this._visible = false;
var isLoaded = false;
var totalBytes = _parent.getBytesTotal();
var loadedBytes = _parent.getBytesLoaded();
var totalFrames = _parent._totalFrames();
var loadedFrames = _parent._framesLoaded();
var fractionLoaded = 0;
var percentLoaded = "0%";
var bytesPerSecond = 0;
var sizePerSecond = formatBytes(bytesPerSecond);
var elapsedTime = "0:00";
var estimatedTime = "0:00";
var estimatedTimeLeft = "0:00";
var gStartTime = getTimer();
var gCurrentTime = getTimer();
var gSampleTimer = (gCurrentTime - gStartTime);
var gSizeSample = loadedBytes;
var framesPerSecond = 0;
var frameCounter = 0;
var totalSize = formatBytes(totalBytes);
var loadedSize = formatBytes(loadedBytes);
var loadedBytes = 0;
var gLoading = true;
var gPlaying = false;
_parent.stop();
Symbol 13 MovieClip Frame 2
if (gLoading) {
loadedBytes = _parent.getBytesLoaded();
loadedSize = formatBytes(loadedBytes);
loadedFrames = _parent._framesLoaded;
gCurrentTime = getTimer();
var elapsedMinutes = Math.floor(((gCurrentTime - gStartTime) / 1000) / 60);
var elapsedSeconds = Math.floor(((gCurrentTime - gStartTime) / 1000) % 60);
if (String(elapsedSeconds).length == 1) {
elapsedSeconds = "0" + elapsedSeconds;
}
elapsedTime = (elapsedMinutes + ":") + elapsedSeconds;
frameCounter++;
if ((gCurrentTime - gStartTime) >= (gSampleTimer + 1000)) {
framesPerSecond = frameCounter;
frameCounter = 0;
bytesPerSecond = loadedBytes - gSizeSample;
sizePerSecond = formatBytes(bytesPerSecond);
if (STREAM && (PLAY_TYPE == "auto")) {
if ((loadedFrames / framesPerSecond) > ((totalBytes - loadedBytes) / bytesPerSecond)) {
_parent.play();
}
}
var estimatedMinutes = Math.floor((totalBytes / bytesPerSecond) / 60);
var estimatedSeconds = Math.floor((totalBytes / bytesPerSecond) % 60);
if (String(estimatedSeconds).length == 1) {
estimatedSeconds = "0" + estimatedSeconds;
}
estimatedTime = (estimatedMinutes + ":") + estimatedSeconds;
var estimatedMinutesLeft = Math.floor(((totalBytes - loadedBytes) / bytesPerSecond) / 60);
var estimatedSecondsLeft = Math.floor(((totalBytes - loadedBytes) / bytesPerSecond) % 60);
if (String(estimatedSecondsLeft).length == 1) {
estimatedSecondsLeft = "0" + estimatedSecondsLeft;
}
estimatedTimeLeft = (estimatedMinutesLeft + ":") + estimatedSecondsLeft;
gSizeSample = loadedBytes;
gSampleTimer = gCurrentTime - gStartTime;
}
fractionLoaded = loadedBytes / totalBytes;
percentLoaded = Math.floor(fractionLoaded * 100) + "%";
if (STREAM) {
switch (PLAY_TYPE) {
case "bytes" :
if (loadedBytes >= PLAY_BYTES) {
if (!gPlaying) {
_parent.play();
gPlaying = true;
}
}
break;
case "frames" :
if (loadedFrames >= PLAY_FRAMES) {
if (!gPlaying) {
_parent.play();
gPlaying = true;
}
}
break;
case "percent" :
if ((fractionLoaded * 100) < PLAY_PERCENT) {
break;
}
if (gPlaying) {
break;
}
_parent.play();
gPlaying = true;
}
}
if (loadedBytes == totalBytes) {
isLoaded = true;
}
if (isLoaded) {
if (!STREAM) {
_parent.play();
}
gLoading = false;
stop();
}
}
Symbol 13 MovieClip Frame 3
gotoAndPlay (2);
Symbol 32 Button
on (release) {
getURL ("http://www.kwikgames.com", _blank);
}
Symbol 37 Button
on (release) {
gotoAndStop (6);
}
Symbol 41 Button
on (release) {
gotoAndStop (7);
}
Symbol 45 Button
on (release) {
nextFrame();
}
Symbol 49 Button
on (release) {
gotoAndStop (160);
twoUpGame = true;
}
Symbol 50 Button
on (release) {
getURL ("http://www.kwikgames.com", _blank);
}
Symbol 63 MovieClip Frame 1
gotoAndPlay(Math.floor(Math.random() * 1000));
Symbol 73 MovieClip Frame 1
gotoAndPlay(Math.floor(Math.random() * 1000));
Symbol 80 Button
on (release) {
rounds = 1;
numRounds = 1;
nextFrame();
}
Symbol 84 Button
on (release) {
rounds = 2;
numRounds = 3;
nextFrame();
}
Symbol 88 Button
on (release) {
rounds = 3;
numRounds = 5;
nextFrame();
}
Symbol 92 Button
on (release) {
gotoAndStop (2);
}
Symbol 99 Button
on (release) {
arena = 1;
numTiles = 64;
gotoAndPlay (34);
}
Symbol 103 Button
on (release) {
nextFrame();
}
Symbol 107 Button
on (release) {
arena = 1;
numTiles = 64;
gotoAndPlay (34);
}
Symbol 109 Button
on (release) {
arena = 2;
numTiles = 56;
gotoAndPlay (34);
}
Symbol 111 Button
on (release) {
arena = 3;
numTiles = 48;
gotoAndPlay (34);
}
Symbol 113 Button
on (release) {
arena = 4;
numTiles = 56;
gotoAndPlay (34);
}
Symbol 115 Button
on (release) {
arena = 5;
numTiles = 52;
gotoAndPlay (34);
}
Symbol 117 Button
on (release) {
arena = 6;
numTiles = 52;
gotoAndPlay (34);
}
Symbol 157 Button
on (release) {
_root.clearClicked();
_root.showBoard(false);
_root.popup.gotoAndPlay("playerPass");
}
Symbol 158 MovieClip Frame 1
stop();
Symbol 160 MovieClip Frame 1
stop();
Symbol 197 Button
on (release) {
initGame();
}
Symbol 198 Button
on (release) {
gotoAndPlay (31);
}
Symbol 199 Button
on (release) {
debugShowBoard();
}
Symbol 205 MovieClip Frame 1
stop();
Symbol 205 MovieClip Frame 22
stop();
_root.computerGo();
Symbol 205 MovieClip Frame 30
if (_root.bestmove < 8) {
j = _root.bestmove;
name = "board0_" + j;
} else if (_root.bestmove < 16) {
j = _root.bestmove - 8;
name = "board1_" + j;
} else if (_root.bestmove < 24) {
j = _root.bestmove - 16;
name = "board2_" + j;
} else if (_root.bestmove < 32) {
j = _root.bestmove - 24;
name = "board3_" + j;
} else if (_root.bestmove < 40) {
j = _root.bestmove - 32;
name = "board4_" + j;
} else if (_root.bestmove < 48) {
j = _root.bestmove - 40;
name = "board5_" + j;
} else if (_root.bestmove < 56) {
j = _root.bestmove - 48;
name = "board6_" + j;
} else if (_root.bestmove < 64) {
j = _root.bestmove - 56;
name = "board7_" + j;
}
_root.updateBlob(name, 32);
Symbol 205 MovieClip Frame 36
_root.placeBlob(_root.bestmove);
_root.playersGo = true;
Symbol 237 Button
on (release) {
if ((_root.playersGo == false) && (_root.twoUpGame)) {
_root.computerClicked(this.name, this.pos);
_root.blobToRemove = this.name;
}
}
Symbol 238 Button
on (release) {
if (_root.playersGo == true) {
_root.blobClicked(this.name, this.pos);
_root.blobToRemove = this.name;
}
}
Symbol 242 Button
on (release) {
if (_root.playersGo) {
_root.updateBlob(this.name, 13);
} else {
_root.updateBlob(this.name, 32);
}
_root.bestmove = this.pos;
_root.playerDelay.play();
}
Symbol 246 Button
on (release) {
if (_root.playersGo) {
_root.updateBlob(this.name, 13);
} else {
_root.updateBlob(this.name, 32);
}
_root.bestmove = this.pos;
_root.playerDelay2.play();
}
Symbol 255 MovieClip Frame 1
stop();
Symbol 255 MovieClip Frame 4
stop();
Symbol 255 MovieClip Frame 5
stop();
Symbol 255 MovieClip Frame 19
gotoAndStop (3);
Symbol 255 MovieClip Frame 38
gotoAndStop (2);
Symbol 255 MovieClip Frame 45
stop();
Symbol 255 MovieClip Frame 46
if (_root.muted == false) {
_root.sound_select.start();
}
stop();
Symbol 255 MovieClip Frame 47
stop();
Symbol 255 MovieClip Frame 56
gotoAndStop (1);
Symbol 255 MovieClip Frame 63
gotoAndStop (1);
Symbol 257 MovieClip Frame 1
stop();
Symbol 257 MovieClip Frame 16
if (_root.bestmove < 8) {
j = _root.bestmove;
name = "board0_" + j;
} else if (_root.bestmove < 16) {
j = _root.bestmove - 8;
name = "board1_" + j;
} else if (_root.bestmove < 24) {
j = _root.bestmove - 16;
name = "board2_" + j;
} else if (_root.bestmove < 32) {
j = _root.bestmove - 24;
name = "board3_" + j;
} else if (_root.bestmove < 40) {
j = _root.bestmove - 32;
name = "board4_" + j;
} else if (_root.bestmove < 48) {
j = _root.bestmove - 40;
name = "board5_" + j;
} else if (_root.bestmove < 56) {
j = _root.bestmove - 48;
name = "board6_" + j;
} else if (_root.bestmove < 64) {
j = _root.bestmove - 56;
name = "board7_" + j;
}
_root.updateBlob(name, 32);
Symbol 257 MovieClip Frame 22
_root.placeBlob(_root.bestmove);
Symbol 257 MovieClip Frame 23
gotoAndStop (1);
playersGo = true;
Symbol 279 Button
on (release) {
if (_root.numGames == 0) {
_root.gotoAndPlay("splash", 1);
} else {
trace("reset");
_this.gotoAndStop(1);
_root.removePieces();
_root.gotoAndPlay("1up", 2);
}
}
Symbol 280 MovieClip Frame 1
stop();
Symbol 280 MovieClip Frame 45
if (_root.muted == false) {
_root.sound_pass.start();
}
_root.playersGo = true;
i = 0;
while (i < 64) {
if (_root.gameboard[i] == 1) {
_root.gameboard[i] = 13;
}
i++;
}
_root.showboard(true);
gotoAndStop (1);
Symbol 280 MovieClip Frame 88
if (_root.muted == false) {
_root.sound_pass.start();
}
if (_root.playersGo == true) {
i = 0;
while (i < 64) {
if (_root.gameboard[i] == 1) {
_root.gameboard[i] = 32;
}
i++;
}
trace("p1 pass");
} else {
i = 0;
while (i < 64) {
if (_root.gameboard[i] == 1) {
_root.gameboard[i] = 13;
}
i++;
}
trace("p1 pass");
}
if (_root.playersGo) {
_root.playersGo = false;
} else {
_root.playersGo = true;
}
_root.showboard(true);
gotoAndStop (1);
Symbol 280 MovieClip Frame 95
if (_root.muted == false) {
_root.sound_end.start();
}
Symbol 280 MovieClip Frame 163
if (_root.numGames == 0) {
gotoAndStop (1);
_root.removePieces();
_root.gameOver();
} else {
_root.removePieces();
_root.nextRound();
}
_root.sound_drums.stop();
Symbol 280 MovieClip Frame 180
if (_root.muted == false) {
_root.sound_end.start();
}
Symbol 280 MovieClip Frame 188
_root.redwins++;
Symbol 280 MovieClip Frame 248
if ((_root.redwins == _root.rounds) || (_root.bluewins == _root.rounds)) {
gotoAndStop (1);
_root.removePieces();
_root.gameOver();
} else {
_root.removePieces();
_root.nextRound();
}
Symbol 280 MovieClip Frame 257
_root.sound_drums.stop();
Symbol 280 MovieClip Frame 263
if (_root.muted == false) {
_root.sound_end.start();
}
Symbol 280 MovieClip Frame 271
_root.bluewins++;
Symbol 280 MovieClip Frame 331
_root.sound_drums.stop();
Symbol 280 MovieClip Frame 340
if ((_root.redwins == _root.rounds) || (_root.bluewins == _root.rounds)) {
gotoAndStop (1);
_root.removePieces();
_root.gameOver();
} else {
_root.removePieces();
_root.nextRound();
}
Symbol 282 MovieClip Frame 1
stop();
Symbol 282 MovieClip Frame 9
_root.placeBlob(_root.bestmove);
trace("bestmove player = " + _root.bestmove);
gotoAndStop (1);
Symbol 283 MovieClip Frame 1
stop();
Symbol 283 MovieClip Frame 2
_root.removeMovedBlob();
Symbol 283 MovieClip Frame 9
_root.moveBlob(_root.bestmove);
trace("bestmove player = " + _root.bestmove);
gotoAndStop (1);
Symbol 294 Button
on (release) {
_root.muted = true;
_root.sound_take.setVolume(0);
nextFrame();
}
Symbol 295 Button
on (release) {
_root.sound_take.setVolume(0);
_root.muted = true;
nextFrame();
}
Symbol 298 Button
on (release) {
_root.sound_take.setVolume(20);
_root.muted = false;
nextFrame();
}
Symbol 299 MovieClip Frame 1
stop();
Symbol 299 MovieClip Frame 2
stop();
Symbol 299 MovieClip Frame 3
gotoAndStop (1);
Symbol 302 Button
on (release) {
removePieces();
gotoAndPlay (37);
}
Symbol 309 Button
on (release) {
nextFrame();
play();
}
Symbol 323 Button
on (release) {
gotoAndStop (2);
}
Symbol 328 Button
on (release) {
gotoAndStop (160);
}
Symbol 332 Button
on (release) {
arena = 1;
numTiles = 64;
gotoAndPlay (191);
}
Symbol 335 Button
on (release) {
arena = 1;
numTiles = 64;
gotoAndPlay (191);
}
Symbol 336 Button
on (release) {
arena = 2;
numTiles = 56;
gotoAndPlay (191);
}
Symbol 337 Button
on (release) {
arena = 3;
numTiles = 48;
gotoAndPlay (191);
}
Symbol 338 Button
on (release) {
arena = 4;
numTiles = 56;
gotoAndPlay (191);
}
Symbol 339 Button
on (release) {
arena = 5;
numTiles = 52;
gotoAndPlay (191);
}
Symbol 340 Button
on (release) {
arena = 6;
numTiles = 52;
gotoAndPlay (191);
}
Symbol 375 Button
on (release) {
_root.clearClicked();
_root.showBoard(false);
_root.popup.gotoAndPlay("playerPass");
}
Symbol 376 MovieClip Frame 1
stop();