Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Action script...
- // [onClipEvent of sprite 13 in frame 1]
- onClipEvent (initialize)
- {
- STREAM = true;
- PLAY_TYPE = "bytes";
- PLAY_BYTES = 10000;
- PLAY_FRAMES = 0;
- PLAY_PERCENTAGE = 0;
- }
- // [onClipEvent of sprite 18 in frame 1]
- onClipEvent (load)
- {
- var myStartWidth = this._width;
- this._width = 0;
- }
- // [onClipEvent of sprite 18 in frame 1]
- onClipEvent (enterFrame)
- {
- this._width = myStartWidth * _root.mc_load_info.fractionLoaded;
- }
- // [onClipEvent of sprite 134 in frame 6]
- onClipEvent (load)
- {
- function updateScrollbar()
- {
- content._y = -(scroller._y - top) / diff_y * (content._height - bound_box._height);
- } // End of the function
- 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 of sprite 134 in frame 6]
- onClipEvent (mouseDown)
- {
- if (scroller.hitTest(_root._xmouse, _root._ymouse))
- {
- startDrag ("scroller", false, scroller._x, top, scroller._x, bottom);
- scrolling = true;
- } // end if
- }
- // [onClipEvent of sprite 134 in frame 6]
- onClipEvent (mouseUp)
- {
- stopDrag ();
- scrolling = false;
- }
- // [onClipEvent of sprite 134 in frame 6]
- onClipEvent (enterFrame)
- {
- if (scrolling)
- {
- updateScrollbar();
- newY = scroller._y;
- yspeed = (newY - oldY) * 0.500000;
- oldY = newY;
- done = false;
- }
- else if (!done)
- {
- oldypos = scroller._y;
- newypos = oldypos + yspeed;
- if (yspeed < -0.200000 || yspeed > 0.200000)
- {
- yspeed = yspeed * friction;
- }
- else
- {
- yspeed = 0;
- done = true;
- } // end else if
- if (newypos < top)
- {
- yspeed = -1 * yspeed * friction;
- newypos = top;
- } // end if
- if (newypos > bottom)
- {
- yspeed = -1 * yspeed * friction;
- newypos = bottom;
- } // end if
- scroller._y = newypos;
- updateScrollbar();
- } // end else if
- }
- // [onClipEvent of sprite 158 in frame 33]
- onClipEvent (enterFrame)
- {
- if (_root.whoseGo == _root.PLAYER)
- {
- } // end if
- }
- // [onClipEvent of sprite 160 in frame 33]
- onClipEvent (enterFrame)
- {
- if (_root.whoseGo == _root.PLAYER)
- {
- } // end if
- }
- // [onClipEvent of sprite 158 in frame 34]
- onClipEvent (enterFrame)
- {
- if (_root.whoseGo == _root.PLAYER)
- {
- } // end if
- }
- // [onClipEvent of sprite 160 in frame 34]
- onClipEvent (enterFrame)
- {
- if (_root.whoseGo == _root.PLAYER)
- {
- } // end if
- }
- // [onClipEvent of sprite 158 in frame 189]
- onClipEvent (enterFrame)
- {
- if (_root.whoseGo == _root.PLAYER)
- {
- } // end if
- }
- // [onClipEvent of sprite 160 in frame 189]
- onClipEvent (enterFrame)
- {
- if (_root.whoseGo == _root.PLAYER)
- {
- } // end if
- }
- // [onClipEvent of sprite 158 in frame 191]
- onClipEvent (enterFrame)
- {
- if (_root.whoseGo == _root.PLAYER)
- {
- } // end if
- }
- // [onClipEvent of sprite 376 in frame 191]
- onClipEvent (enterFrame)
- {
- if (_root.whoseGo == _root.PLAYER)
- {
- } // end if
- }
- // [Action in 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;
- // [Action in Frame 3]
- stop ();
- // [Action in Frame 4]
- stop ();
- // [Action in Frame 5]
- stop ();
- // [Action in Frame 6]
- stop ();
- // [Action in 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;
- } // end if
- 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();
- } // end if
- };
- Key.addListener(ok_btn);
- // [Action in Frame 8]
- stop ();
- // [Action in Frame 33]
- trace ("first scene blink");
- // [Action in Frame 34]
- function delay(length)
- {
- x = getTimer();
- do
- {
- y = getTimer();
- } while (y < x + length)
- } // End of the function
- 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();
- for (i = 0; i < 100; i++)
- {
- 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;
- } // end if
- if (compboard1[j - 10] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j - 9] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j - 1] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j + 1] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j + 11] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j + 10] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j + 9] == 3)
- {
- ++score;
- } // end if
- if (score > highscore)
- {
- highscore = score;
- if (highscore > highestscore)
- {
- highestscore = score;
- bestmove = i;
- bestblob = j;
- direction = 1;
- canTake = true;
- } // end if
- } // end if
- score = 0;
- } // end if
- if (compboard1[i - 1] == 1)
- {
- canMove = true;
- j = i - 1;
- if (compboard1[j - 11] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j - 10] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j - 9] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j - 1] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j + 1] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j + 11] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j + 10] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j + 9] == 3)
- {
- ++score;
- } // end if
- if (score > highscore)
- {
- highscore = score;
- if (highscore > highestscore)
- {
- highestscore = score;
- bestmove = i;
- bestblob = j;
- direction = -1;
- canTake = true;
- } // end if
- } // end if
- score = 0;
- } // end if
- if (compboard1[i + 9] == 1)
- {
- canMove = true;
- j = i + 9;
- if (compboard1[j - 11] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j - 10] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j - 9] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j - 1] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j + 1] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j + 11] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j + 10] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j + 9] == 3)
- {
- ++score;
- } // end if
- if (score > highscore)
- {
- highscore = score;
- if (highscore > highestscore)
- {
- highestscore = score;
- bestmove = i;
- bestblob = j;
- direction = 9;
- canTake = true;
- } // end if
- } // end if
- score = 0;
- } // end if
- if (compboard1[i + 10] == 1)
- {
- canMove = true;
- j = i + 10;
- if (compboard1[j - 11] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j - 10] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j - 9] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j - 1] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j + 1] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j + 11] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j + 10] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j + 9] == 3)
- {
- ++score;
- } // end if
- if (score > highscore)
- {
- highscore = score;
- if (highscore > highestscore)
- {
- highestscore = score;
- bestmove = i;
- bestblob = j;
- direction = 10;
- canTake = true;
- } // end if
- } // end if
- score = 0;
- } // end if
- if (compboard1[i + 11] == 1)
- {
- canMove = true;
- j = i + 11;
- if (compboard1[j - 11] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j - 10] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j - 9] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j - 1] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j + 1] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j + 11] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j + 10] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j + 9] == 3)
- {
- ++score;
- } // end if
- if (score > highscore)
- {
- highscore = score;
- if (highscore > highestscore)
- {
- highestscore = score;
- bestmove = i;
- bestblob = j;
- direction = 11;
- canTake = true;
- } // end if
- } // end if
- score = 0;
- } // end if
- if (compboard1[i - 9] == 1)
- {
- canMove = true;
- j = i - 9;
- if (compboard1[j - 11] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j - 10] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j - 9] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j - 1] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j + 1] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j + 11] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j + 10] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j + 9] == 3)
- {
- ++score;
- } // end if
- if (score > highscore)
- {
- highscore = score;
- if (highscore > highestscore)
- {
- highestscore = score;
- bestmove = i;
- bestblob = j;
- direction = -9;
- canTake = true;
- } // end if
- } // end if
- score = 0;
- } // end if
- if (compboard1[i - 10] == 1)
- {
- canMove = true;
- j = i - 10;
- if (compboard1[j - 11] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j - 10] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j - 9] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j - 1] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j + 1] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j + 11] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j + 10] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j + 9] == 3)
- {
- ++score;
- } // end if
- if (score > highscore)
- {
- highscore = score;
- if (highscore > highestscore)
- {
- highestscore = score;
- bestmove = i;
- bestblob = j;
- direction = -10;
- canTake = true;
- } // end if
- } // end if
- score = 0;
- } // end if
- if (compboard1[i - 11] == 1)
- {
- canMove = true;
- j = i - 11;
- if (compboard1[j - 11] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j - 10] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j - 9] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j - 1] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j + 1] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j + 11] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j + 10] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j + 9] == 3)
- {
- ++score;
- } // end if
- if (score > highscore)
- {
- highscore = score;
- if (highscore > highestscore)
- {
- highestscore = score;
- bestmove = i;
- bestblob = j;
- direction = -11;
- canTake = true;
- } // end if
- } // end if
- score = 0;
- } // end if
- if (compboard1[i + 2] == 1)
- {
- canMove2 = true;
- j = i + 2;
- if (compboard1[j - 11] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j - 10] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j - 9] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j - 1] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j + 1] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j + 11] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j + 10] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j + 9] == 3)
- {
- ++score;
- } // end if
- if (score > highscore2)
- {
- highscore2 = score;
- if (highscore2 > highestscore2)
- {
- highestscore2 = score;
- bestmove2 = i;
- bestblob2 = j;
- direction2 = 2;
- canTake2 = true;
- } // end if
- } // end if
- score = 0;
- } // end if
- if (compboard1[i - 2] == 1)
- {
- canMove2 = true;
- j = i - 2;
- if (compboard1[j - 11] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j - 10] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j - 9] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j - 1] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j + 1] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j + 11] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j + 10] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j + 9] == 3)
- {
- ++score;
- } // end if
- if (score > highscore2)
- {
- highscore2 = score;
- if (highscore2 > highestscore2)
- {
- highestscore2 = score;
- bestmove2 = i;
- bestblob2 = j;
- direction2 = -2;
- canTake2 = true;
- } // end if
- } // end if
- score = 0;
- } // end if
- if (compboard1[i + 8] == 1)
- {
- canMove2 = true;
- j = i + 8;
- if (compboard1[j - 11] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j - 10] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j - 9] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j - 1] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j + 1] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j + 11] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j + 10] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j + 9] == 3)
- {
- ++score;
- } // end if
- if (score > highscore2)
- {
- highscore2 = score;
- if (highscore2 > highestscore2)
- {
- highestscore2 = score;
- bestmove2 = i;
- bestblob2 = j;
- direction2 = 8;
- canTake2 = true;
- } // end if
- } // end if
- score = 0;
- } // end if
- if (compboard1[i + 10] == 1)
- {
- canMove2 = true;
- j = i + 10;
- if (compboard1[j - 11] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j - 10] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j - 9] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j - 1] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j + 1] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j + 11] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j + 10] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j + 9] == 3)
- {
- ++score;
- } // end if
- if (score > highscore2)
- {
- highscore2 = score;
- if (highscore2 > highestscore2)
- {
- highestscore2 = score;
- bestmove2 = i;
- bestblob2 = j;
- direction2 = 10;
- canTake2 = true;
- } // end if
- } // end if
- score = 0;
- } // end if
- if (compboard1[i + 12] == 1)
- {
- canMove2 = true;
- j = i + 12;
- if (compboard1[j - 11] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j - 10] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j - 9] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j - 1] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j + 1] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j + 11] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j + 10] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j + 9] == 3)
- {
- ++score;
- } // end if
- if (score > highscore2)
- {
- highscore2 = score;
- if (highscore2 > highestscore2)
- {
- highestscore2 = score;
- bestmove2 = i;
- bestblob2 = j;
- direction2 = 12;
- canTake2 = true;
- } // end if
- } // end if
- score = 0;
- } // end if
- if (compboard1[i + 18] == 1)
- {
- canMove2 = true;
- j = i + 18;
- if (compboard1[j - 11] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j - 10] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j - 9] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j - 1] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j + 1] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j + 11] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j + 10] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j + 9] == 3)
- {
- ++score;
- } // end if
- if (score > highscore2)
- {
- highscore2 = score;
- if (highscore2 > highestscore2)
- {
- highestscore2 = score;
- bestmove2 = i;
- bestblob2 = j;
- direction2 = 18;
- canTake2 = true;
- } // end if
- } // end if
- score = 0;
- } // end if
- if (compboard1[i + 19] == 1)
- {
- canMove2 = true;
- j = i + 19;
- if (compboard1[j - 11] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j - 10] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j - 9] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j - 1] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j + 1] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j + 11] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j + 10] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j + 9] == 3)
- {
- ++score;
- } // end if
- if (score > highscore2)
- {
- highscore2 = score;
- if (highscore2 > highestscore2)
- {
- highestscore2 = score;
- bestmove2 = i;
- bestblob2 = j;
- direction2 = 19;
- canTake2 = true;
- } // end if
- } // end if
- score = 0;
- } // end if
- if (compboard1[i + 20] == 1)
- {
- canMove2 = true;
- j = i + 20;
- if (compboard1[j - 11] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j - 10] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j - 9] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j - 1] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j + 1] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j + 11] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j + 10] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j + 9] == 3)
- {
- ++score;
- } // end if
- if (score > highscore2)
- {
- highscore2 = score;
- if (highscore2 > highestscore2)
- {
- highestscore2 = score;
- bestmove2 = i;
- bestblob2 = j;
- direction2 = 20;
- canTake2 = true;
- } // end if
- } // end if
- score = 0;
- } // end if
- if (compboard1[i + 21] == 1)
- {
- canMove2 = true;
- j = i + 21;
- if (compboard1[j - 11] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j - 10] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j - 9] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j - 1] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j + 1] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j + 11] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j + 10] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j + 9] == 3)
- {
- ++score;
- } // end if
- if (score > highscore2)
- {
- highscore2 = score;
- if (highscore2 > highestscore2)
- {
- highestscore2 = score;
- bestmove2 = i;
- bestblob2 = j;
- direction2 = 21;
- canTake2 = true;
- } // end if
- } // end if
- score = 0;
- } // end if
- if (compboard1[i + 22] == 1)
- {
- canMove2 = true;
- j = i + 22;
- if (compboard1[j - 11] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j - 10] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j - 9] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j - 1] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j + 1] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j + 11] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j + 10] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j + 9] == 3)
- {
- ++score;
- } // end if
- if (score > highscore2)
- {
- highscore2 = score;
- if (highscore2 > highestscore2)
- {
- highestscore2 = score;
- bestmove2 = i;
- bestblob2 = j;
- direction2 = 22;
- canTake2 = true;
- } // end if
- } // end if
- score = 0;
- } // end if
- if (compboard1[i - 8] == 1)
- {
- canMove2 = true;
- j = i - 8;
- if (compboard1[j - 11] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j - 10] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j - 9] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j - 1] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j + 1] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j + 11] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j + 10] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j + 9] == 3)
- {
- ++score;
- } // end if
- if (score > highscore2)
- {
- highscore2 = score;
- if (highscore2 > highestscore2)
- {
- highestscore2 = score;
- bestmove2 = i;
- bestblob2 = j;
- direction2 = -8;
- canTake2 = true;
- } // end if
- } // end if
- score = 0;
- } // end if
- if (compboard1[i - 10] == 1)
- {
- canMove2 = true;
- j = i - 10;
- if (compboard1[j - 11] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j - 10] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j - 9] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j - 1] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j + 1] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j + 11] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j + 10] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j + 9] == 3)
- {
- ++score;
- } // end if
- if (score > highscore2)
- {
- highscore2 = score;
- if (highscore2 > highestscore2)
- {
- highestscore2 = score;
- bestmove2 = i;
- bestblob2 = j;
- direction2 = -10;
- canTake2 = true;
- } // end if
- } // end if
- score = 0;
- } // end if
- if (compboard1[i - 12] == 1)
- {
- canMove2 = true;
- j = i - 12;
- if (compboard1[j - 11] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j - 10] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j - 9] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j - 1] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j + 1] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j + 11] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j + 10] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j + 9] == 3)
- {
- ++score;
- } // end if
- if (score > highscore2)
- {
- highscore2 = score;
- if (highscore2 > highestscore2)
- {
- highestscore2 = score;
- bestmove2 = i;
- bestblob2 = j;
- direction2 = -12;
- canTake2 = true;
- } // end if
- } // end if
- score = 0;
- } // end if
- if (compboard1[i - 18] == 1)
- {
- canMove2 = true;
- j = i - 18;
- if (compboard1[j - 11] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j - 10] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j - 9] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j - 1] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j + 1] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j + 11] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j + 10] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j + 9] == 3)
- {
- ++score;
- } // end if
- if (score > highscore2)
- {
- highscore2 = score;
- if (highscore2 > highestscore2)
- {
- highestscore2 = score;
- bestmove2 = i;
- bestblob2 = j;
- direction2 = -18;
- canTake2 = true;
- } // end if
- } // end if
- score = 0;
- } // end if
- if (compboard1[i - 19] == 1)
- {
- canMove2 = true;
- j = i - 19;
- if (compboard1[j - 11] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j - 10] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j - 9] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j - 1] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j + 1] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j + 11] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j + 10] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j + 9] == 3)
- {
- ++score;
- } // end if
- if (score > highscore2)
- {
- highscore2 = score;
- if (highscore2 > highestscore2)
- {
- highestscore2 = score;
- bestmove2 = i;
- bestblob2 = j;
- direction2 = -19;
- canTake2 = true;
- } // end if
- } // end if
- score = 0;
- } // end if
- if (compboard1[i - 20] == 1)
- {
- canMove2 = true;
- j = i - 20;
- if (compboard1[j - 11] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j - 10] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j - 9] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j - 1] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j + 1] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j + 11] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j + 10] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j + 9] == 3)
- {
- ++score;
- } // end if
- if (score > highscore2)
- {
- highscore2 = score;
- if (highscore2 > highestscore2)
- {
- highestscore2 = score;
- bestmove2 = i;
- bestblob2 = j;
- direction2 = -20;
- canTake2 = true;
- } // end if
- } // end if
- score = 0;
- } // end if
- if (compboard1[i - 21] == 1)
- {
- canMove2 = true;
- j = i - 21;
- if (compboard1[j - 11] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j - 10] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j - 9] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j - 1] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j + 1] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j + 11] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j + 10] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j + 9] == 3)
- {
- ++score;
- } // end if
- if (score > highscore2)
- {
- highscore2 = score;
- if (highscore2 > highestscore2)
- {
- highestscore2 = score;
- bestmove2 = i;
- bestblob2 = j;
- direction2 = -21;
- canTake2 = true;
- } // end if
- } // end if
- score = 0;
- } // end if
- if (compboard1[i - 22] == 1)
- {
- canMove2 = true;
- j = i - 22;
- if (compboard1[j - 11] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j - 10] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j - 9] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j - 1] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j + 1] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j + 11] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j + 10] == 3)
- {
- ++score;
- } // end if
- if (compboard1[j + 9] == 3)
- {
- ++score;
- } // end if
- if (score > highscore2)
- {
- highscore2 = score;
- if (highscore2 > highestscore2)
- {
- highestscore2 = score;
- bestmove2 = i;
- bestblob2 = j;
- direction2 = -22;
- canTake2 = true;
- } // end if
- } // end if
- score = 0;
- } // end if
- if (canMove)
- {
- compFull.push(i);
- canGo = true;
- } // end if
- if (canMove2)
- {
- compFull2.push(i);
- canGo2 = true;
- } // end if
- compboard2[i] = highscore;
- compboard3[i] = highscore2;
- trace (highscore);
- trace ("jump " + highscore2);
- trace (compboard3);
- trace ("jump moves" + compFull2);
- highscore = 0;
- highscore2 = 0;
- } // end if
- } // end of for
- if (highestscore == 0)
- {
- bestmove = backupmove;
- trace ("backup move");
- } // end if
- 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;
- } // end if
- }
- else if (highestscore2 == 8)
- {
- canGo = false;
- }
- else if (highestscore2 < highestscore + 6)
- {
- newRandom = myRandom(0, 5);
- if (newRandom < 2)
- {
- canGo = false;
- } // end if
- }
- else if (highestscore2 < highestscore + 5)
- {
- newRandom = myRandom(0, 6);
- if (newRandom < 2)
- {
- canGo = false;
- } // end if
- }
- else if (highestscore2 < highestscore + 3)
- {
- newRandom = myRandom(0, 6);
- if (newRandom < 1)
- {
- canGo = false;
- } // end if
- }
- else
- {
- newRandom = myRandom(0, 12);
- if (newRandom < 1)
- {
- canGo = false;
- } // end else if
- } // end else if
- } // end else if
- 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);
- } // end if
- if (compboard1[j - 10] == 1)
- {
- compFull.push(j - 10);
- } // end if
- if (compboard1[j - 9] == 1)
- {
- compFull.push(j - 9);
- } // end if
- if (compboard1[j - 1] == 1)
- {
- compFull.push(j - 1);
- } // end if
- if (compboard1[j + 1] == 1)
- {
- compFull.push(j + 1);
- } // end if
- if (compboard1[j + 11] == 1)
- {
- compFull.push(j + 11);
- } // end if
- if (compboard1[j + 10] == 1)
- {
- compFull.push(j + 10);
- } // end if
- if (compboard1[j + 9] == 1)
- {
- compFull.push(j + 9);
- } // end if
- 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);
- } // end else if
- }
- 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);
- } // end if
- if (compboard1[j - 21] == 1)
- {
- compFull2.push(j - 21);
- } // end if
- if (compboard1[j - 20] == 1)
- {
- compFull2.push(j - 20);
- } // end if
- if (compboard1[j - 19] == 1)
- {
- compFull2.push(j - 19);
- } // end if
- if (compboard1[j - 18] == 1)
- {
- compFull2.push(j - 18);
- } // end if
- if (compboard1[j - 12] == 1)
- {
- compFull2.push(j - 12);
- } // end if
- if (compboard1[j - 8] == 1)
- {
- compFull2.push(j - 8);
- } // end if
- if (compboard1[j - 2] == 1)
- {
- compFull2.push(j - 2);
- } // end if
- if (compboard1[j + 2] == 1)
- {
- compFull2.push(j + 2);
- } // end if
- if (compboard1[j + 8] == 1)
- {
- compFull2.push(j + 8);
- } // end if
- if (compboard1[j + 10] == 1)
- {
- compFull2.push(j + 10);
- } // end if
- if (compboard1[j + 12] == 1)
- {
- compFull2.push(j + 12);
- } // end if
- if (compboard1[j + 18] == 1)
- {
- compFull2.push(j + 18);
- } // end if
- if (compboard1[j + 19] == 1)
- {
- compFull2.push(j + 19);
- } // end if
- if (compboard1[j + 20] == 1)
- {
- compFull2.push(j + 20);
- } // end if
- if (compboard1[j + 21] == 1)
- {
- compFull2.push(j + 21);
- } // end if
- if (compboard1[j + 22] == 1)
- {
- compFull2.push(j + 22);
- } // end if
- 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);
- } // end else if
- }
- else if (reds + blues < 64)
- {
- popup.gotoAndPlay("compPass");
- } // end else if
- } // End of the function
- 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;
- } // end else if
- return (move);
- } // End of the function
- 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);
- } // End of the function
- function copyArrays()
- {
- for (i = 0; i < 8; i++)
- {
- compboard1[i + 11] = gameboard[i];
- } // end of for
- for (i = 8; i < 16; i++)
- {
- compboard1[i + 13] = gameboard[i];
- } // end of for
- for (i = 16; i < 24; i++)
- {
- compboard1[i + 15] = gameboard[i];
- } // end of for
- for (i = 24; i < 32; i++)
- {
- compboard1[i + 17] = gameboard[i];
- } // end of for
- for (i = 32; i < 40; i++)
- {
- compboard1[i + 19] = gameboard[i];
- } // end of for
- for (i = 40; i < 48; i++)
- {
- compboard1[i + 21] = gameboard[i];
- } // end of for
- for (i = 48; i < 56; i++)
- {
- compboard1[i + 23] = gameboard[i];
- } // end of for
- for (i = 56; i < 64; i++)
- {
- compboard1[i + 25] = gameboard[i];
- } // end of for
- } // End of the function
- function myRandom(minval, maxval)
- {
- return (minval + Math.floor(Math.random() * (maxval + 1 - minval)));
- } // End of the function
- 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;
- } // end if
- 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;
- } // end if
- 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;
- } // end if
- 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;
- } // end if
- if (gameboard[pos + 8] == 2)
- {
- gameboard[pos + 8] = 6;
- ++attacked;
- } // end if
- 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;
- } // end if
- 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;
- } // end if
- if (gameboard[pos - 8] == 2)
- {
- gameboard[pos - 8] = 6;
- ++attacked;
- } // end if
- }
- 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;
- } // end if
- 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;
- } // end if
- 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;
- } // end if
- 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;
- } // end if
- if (gameboard[pos + 8] == 3)
- {
- gameboard[pos + 8] = 25;
- ++attacked;
- } // end if
- 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;
- } // end if
- 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;
- } // end if
- if (gameboard[pos - 8] == 3)
- {
- gameboard[pos - 8] = 25;
- ++attacked;
- } // end if
- } // end else if
- 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();
- } // end else if
- } // end else if
- if (playersGo)
- {
- playersGo = false;
- playerHL.gotoAndStop(1);
- computerLight.gotoAndStop(2);
- computerGoDelay.play();
- }
- else
- {
- playersGo = true;
- playerHL.gotoAndStop(2);
- computerLight.gotoAndStop(1);
- } // end else if
- ++curGo;
- } // End of the function
- function clearClicked()
- {
- for (i = 0; i < 64; i++)
- {
- if (gameboard[i] == 4 || gameboard[i] == 5)
- {
- gameboard[i] = 1;
- } // end if
- } // end of for
- } // End of the function
- function placeBlob(pos)
- {
- if (_root.muted == false)
- {
- sound_spawn.start();
- } // end if
- if (playersGo)
- {
- gameboard[pos] = 3;
- }
- else
- {
- gameboard[pos] = 2;
- } // end else if
- clearClicked();
- showBoard(false);
- attack(pos);
- } // End of the function
- function moveBlob(pos)
- {
- if (_root.muted == false)
- {
- sound_take.start();
- } // end if
- if (playersGo)
- {
- gameboard[pos] = 3;
- }
- else
- {
- gameboard[pos] = 2;
- } // end else if
- gameboard[selectedpos] = 1;
- clearClicked();
- showBoard(false);
- attack(pos);
- } // End of the function
- function blobClicked(blob, pos)
- {
- if (_root.muted == false)
- {
- sound_select.start();
- } // end if
- 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;
- } // end if
- 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;
- } // end if
- 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;
- } // end if
- 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;
- } // end if
- 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;
- } // end if
- 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;
- } // end if
- 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;
- } // end if
- 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;
- } // end if
- 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;
- } // end if
- 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;
- } // end if
- 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;
- } // end if
- 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;
- } // end if
- 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;
- } // end if
- 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;
- } // end if
- 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;
- } // end if
- 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;
- } // end if
- 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;
- } // end if
- 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;
- } // end if
- 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;
- } // end if
- 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;
- } // end if
- 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;
- } // end if
- 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;
- } // end if
- 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;
- } // end if
- 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;
- } // end if
- gameboard[pos] = 45;
- showBoard(false);
- gameboard[pos] = 3;
- } // End of the function
- 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;
- } // end if
- 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;
- } // end if
- 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;
- } // end if
- 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;
- } // end if
- 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;
- } // end if
- 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;
- } // end if
- 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;
- } // end if
- 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;
- } // end if
- 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;
- } // end if
- 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;
- } // end if
- 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;
- } // end if
- 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;
- } // end if
- 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;
- } // end if
- 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;
- } // end if
- 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;
- } // end if
- 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;
- } // end if
- 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;
- } // end if
- 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;
- } // end if
- 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;
- } // end if
- 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;
- } // end if
- 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;
- } // end if
- 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;
- } // end if
- 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;
- } // end if
- 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;
- } // end if
- showBoard(false);
- } // End of the function
- function makeBoard()
- {
- var row;
- var col;
- var name;
- var count = 1;
- counter = 0;
- for (row = 0; row < 8; row++)
- {
- for (col = 0; col < 8; col++)
- {
- 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;
- } // end of for
- } // end of for
- board0_0._x = 241.600000;
- board0_0._y = 42.900000;
- board0_1._x = 275.200000;
- board0_1._y = 58.500000;
- board0_2._x = 308.900000;
- board0_2._y = 74.200000;
- board0_3._x = 342.500000;
- board0_3._y = 89.800000;
- board0_4._x = 376.100000;
- board0_4._y = 105.400000;
- board0_5._x = 409.800000;
- board0_5._y = 121.200000;
- board0_6._x = 443.400000;
- board0_6._y = 136.700000;
- board0_7._x = 477;
- board0_7._y = 152.300000;
- board1_0._x = 207.900000;
- board1_0._y = 58.800000;
- board1_1._x = 241.600000;
- board1_1._y = 74.200000;
- board1_2._x = 275.200000;
- board1_2._y = 89.800000;
- board1_3._x = 308.900000;
- board1_3._y = 105.200000;
- board1_4._x = 342.500000;
- board1_4._y = 121.100000;
- board1_5._x = 376.100000;
- board1_5._y = 136.700000;
- board1_6._x = 409.800000;
- board1_6._y = 152.300000;
- board1_7._x = 443.400000;
- board1_7._y = 167.900000;
- board2_0._x = 174.300000;
- board2_0._y = 74.200000;
- board2_1._x = 207.900000;
- board2_1._y = 89.800000;
- board2_2._x = 241.600000;
- board2_2._y = 105.400000;
- board2_3._x = 275.200000;
- board2_3._y = 121.100000;
- board2_4._x = 308.900000;
- board2_4._y = 136.700000;
- board2_5._x = 342.500000;
- board2_5._y = 152.300000;
- board2_6._x = 376.100000;
- board2_6._y = 167.900000;
- board2_7._x = 409.800000;
- board2_7._y = 183.600000;
- board3_0._x = 140.700000;
- board3_0._y = 89.900000;
- board3_1._x = 174.300000;
- board3_1._y = 105.400000;
- board3_2._x = 207.900000;
- board3_2._y = 121.100000;
- board3_3._x = 241.600000;
- board3_3._y = 136.700000;
- board3_4._x = 275.200000;
- board3_4._y = 152.300000;
- board3_5._x = 308.900000;
- board3_5._y = 167.900000;
- board3_6._x = 342.500000;
- board3_6._y = 183.600000;
- board3_7._x = 376.100000;
- board3_7._y = 199.200000;
- board4_0._x = 107.100000;
- board4_0._y = 105.400000;
- board4_1._x = 140.700000;
- board4_1._y = 121.100000;
- board4_2._x = 174.300000;
- board4_2._y = 136.700000;
- board4_3._x = 207.900000;
- board4_3._y = 152.300000;
- board4_4._x = 241.600000;
- board4_4._y = 167.900000;
- board4_5._x = 275.200000;
- board4_5._y = 183.600000;
- board4_6._x = 308.900000;
- board4_6._y = 199.200000;
- board4_7._x = 342.500000;
- board4_7._y = 214.800000;
- board5_0._x = 73.400000;
- board5_0._y = 121.100000;
- board5_1._x = 107.100000;
- board5_1._y = 136.700000;
- board5_2._x = 140.700000;
- board5_2._y = 152.300000;
- board5_3._x = 174.300000;
- board5_3._y = 167.900000;
- board5_4._x = 208;
- board5_4._y = 183.600000;
- board5_5._x = 241.600000;
- board5_5._y = 199.200000;
- board5_6._x = 275.200000;
- board5_6._y = 214.800000;
- board5_7._x = 308.900000;
- board5_7._y = 230.400000;
- board6_0._x = 39.800000;
- board6_0._y = 136.700000;
- board6_1._x = 73.400000;
- board6_1._y = 152.300000;
- board6_2._x = 107.100000;
- board6_2._y = 167.900000;
- board6_3._x = 140.700000;
- board6_3._y = 183.600000;
- board6_4._x = 174.300000;
- board6_4._y = 199.200000;
- board6_5._x = 207.900000;
- board6_5._y = 214.800000;
- board6_6._x = 242;
- board6_6._y = 230.400000;
- board6_7._x = 275.200000;
- board6_7._y = 246.100000;
- board7_0._x = 6.300000;
- board7_0._y = 152.300000;
- board7_1._x = 39.800000;
- board7_1._y = 167.900000;
- board7_2._x = 73.400000;
- board7_2._y = 183.600000;
- board7_3._x = 107.100000;
- board7_3._y = 199.200000;
- board7_4._x = 140.700000;
- board7_4._y = 214.800000;
- board7_5._x = 174.300000;
- board7_5._y = 230.400000;
- board7_6._x = 207.900000;
- board7_6._y = 246.300000;
- board7_7._x = 241.600000;
- board7_7._y = 261.800000;
- for (row = 0; row < 8; row++)
- {
- for (col = 0; col < 8; col++)
- {
- name = "board" + row + "_" + col;
- eval(name)._x = eval(name)._x + 34;
- eval(name)._y = eval(name)._y + 40;
- } // end of for
- } // end of for
- duplicateMovieClip("message", "popup", count++);
- duplicateMovieClip("message", "popup2", count++);
- popup._x = 275;
- popup._y = 200;
- popup2._x = 275;
- popup2._y = 200;
- } // End of the function
- function initGame()
- {
- var row;
- var col;
- var name;
- var count = 1;
- for (i = 0; i < 100; i++)
- {
- gameboard[i] = 1;
- compboard1[i] = 0;
- compboard2[i] = 0;
- compboard3[i] = 0;
- } // end of for
- 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;
- } // end else if
- curGo = 0;
- playerHL.gotoAndStop(2);
- showBoard();
- } // End of the function
- function showBoard(animate)
- {
- bluecount = 0;
- redcount = 0;
- for (i = 11; i < 19; i++)
- {
- 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;
- } // end else if
- continue;
- } // end if
- eval(name).gotoAndStop(gameboard[i - 11]);
- } // end of for
- for (i = 21; i < 29; i++)
- {
- 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;
- } // end else if
- continue;
- } // end if
- eval(name).gotoAndStop(gameboard[i - 13]);
- } // end of for
- for (i = 31; i < 39; i++)
- {
- 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;
- } // end else if
- continue;
- } // end if
- eval(name).gotoAndStop(gameboard[i - 15]);
- } // end of for
- for (i = 41; i < 49; i++)
- {
- 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;
- } // end else if
- continue;
- } // end if
- eval(name).gotoAndStop(gameboard[i - 17]);
- } // end of for
- for (i = 51; i < 59; i++)
- {
- 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;
- } // end else if
- continue;
- } // end if
- eval(name).gotoAndStop(gameboard[i - 19]);
- } // end of for
- for (i = 61; i < 69; i++)
- {
- 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;
- } // end else if
- continue;
- } // end if
- eval(name).gotoAndStop(gameboard[i - 21]);
- } // end of for
- for (i = 71; i < 79; i++)
- {
- 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;
- } // end else if
- continue;
- } // end if
- eval(name).gotoAndStop(gameboard[i - 23]);
- } // end of for
- for (i = 81; i < 89; i++)
- {
- 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;
- } // end else if
- continue;
- } // end if
- eval(name).gotoAndStop(gameboard[i - 25]);
- } // end of for
- updateScores();
- } // End of the function
- function updateScores()
- {
- redcount = 0;
- bluecount = 0;
- for (i = 0; i < 64; i++)
- {
- if (gameboard[i] == 2 || gameboard[i] == 46)
- {
- ++redcount;
- continue;
- } // end if
- if (gameboard[i] == 3 || gameboard[i] == 45)
- {
- ++bluecount;
- } // end if
- } // end of for
- blues = bluecount;
- reds = redcount;
- if (redcount + bluecount == numTiles || redcount == 0 || bluecount == 0)
- {
- endGame(redcount, bluecount);
- } // end if
- } // End of the function
- function removeMovedBlob()
- {
- trace ("remove " + blobToRemove);
- if (playersGo)
- {
- eval(blobToRemove).gotoAndPlay(50);
- }
- else
- {
- eval(blobToRemove).gotoAndPlay(57);
- } // end else if
- } // End of the function
- function updateBlob(piece, frame)
- {
- eval(piece).gotoAndPlay(frame);
- } // End of the function
- 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");
- } // end else if
- trace (gameboard);
- } // End of the function
- function removePieces()
- {
- var row;
- var col;
- var name;
- var count = 1;
- counter = 0;
- for (row = 0; row < 8; row++)
- {
- for (col = 0; col < 8; col++)
- {
- name = "board" + row + "_" + col;
- removeMovieClip (name);
- ++counter;
- } // end of for
- } // end of for
- } // End of the function
- function nextRound()
- {
- popup.gotoAndStop(1);
- gotoAndPlay(31);
- trace ("bluewon");
- } // End of the function
- function gameOver()
- {
- gotoAndPlay(36);
- } // End of the function
- 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 ();
- // [Action in Frame 35]
- gotoAndStop(34);
- // [Action in Frame 36]
- if (_root.muted == false)
- {
- _root.sound_laugh.start();
- } // end if
- sound_drums.stop();
- stop ();
- // [Action in Frame 37]
- loadMovie("http://www.kwikgames.com/adverts/blobwars_ad.swf", _root.promo);
- sound_drums.stop();
- // [Action in Frame 159]
- stop ();
- // [Action in Frame 160]
- stop ();
- // [Action in Frame 161]
- stop ();
- // [Action in Frame 162]
- stop ();
- // [Action in Frame 189]
- trace ("first scene blink");
- // [Action in Frame 191]
- function delay(length)
- {
- x = getTimer();
- do
- {
- y = getTimer();
- } while (y < x + length)
- } // End of the function
- 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;
- } // end else if
- return (move);
- } // End of the function
- 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);
- } // End of the function
- function copyArrays()
- {
- for (i = 0; i < 8; i++)
- {
- compboard1[i + 11] = gameboard[i];
- } // end of for
- for (i = 8; i < 16; i++)
- {
- compboard1[i + 13] = gameboard[i];
- } // end of for
- for (i = 16; i < 24; i++)
- {
- compboard1[i + 15] = gameboard[i];
- } // end of for
- for (i = 24; i < 32; i++)
- {
- compboard1[i + 17] = gameboard[i];
- } // end of for
- for (i = 32; i < 40; i++)
- {
- compboard1[i + 19] = gameboard[i];
- } // end of for
- for (i = 40; i < 48; i++)
- {
- compboard1[i + 21] = gameboard[i];
- } // end of for
- for (i = 48; i < 56; i++)
- {
- compboard1[i + 23] = gameboard[i];
- } // end of for
- for (i = 56; i < 64; i++)
- {
- compboard1[i + 25] = gameboard[i];
- } // end of for
- } // End of the function
- function myRandom(minval, maxval)
- {
- return (minval + Math.floor(Math.random() * (maxval + 1 - minval)));
- } // End of the function
- 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;
- } // end if
- 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;
- } // end if
- 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;
- } // end if
- 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;
- } // end if
- if (gameboard[pos + 8] == 2)
- {
- gameboard[pos + 8] = 6;
- ++attacked;
- } // end if
- 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;
- } // end if
- 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;
- } // end if
- if (gameboard[pos - 8] == 2)
- {
- gameboard[pos - 8] = 6;
- ++attacked;
- } // end if
- }
- 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;
- } // end if
- 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;
- } // end if
- 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;
- } // end if
- 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;
- } // end if
- if (gameboard[pos + 8] == 3)
- {
- gameboard[pos + 8] = 25;
- ++attacked;
- } // end if
- 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;
- } // end if
- 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;
- } // end if
- if (gameboard[pos - 8] == 3)
- {
- gameboard[pos - 8] = 25;
- ++attacked;
- } // end if
- } // end else if
- 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();
- } // end else if
- } // end else if
- if (playersGo)
- {
- playersGo = false;
- playerHL.gotoAndStop(1);
- computerLight.gotoAndStop(2);
- }
- else
- {
- playersGo = true;
- playerHL.gotoAndStop(2);
- computerLight.gotoAndStop(1);
- } // end else if
- ++curGo;
- } // End of the function
- function clearClicked()
- {
- for (i = 0; i < 64; i++)
- {
- if (gameboard[i] == 4 || gameboard[i] == 5)
- {
- gameboard[i] = 1;
- } // end if
- } // end of for
- } // End of the function
- function placeBlob(pos)
- {
- if (_root.muted == false)
- {
- sound_spawn.start();
- } // end if
- if (playersGo)
- {
- gameboard[pos] = 3;
- }
- else
- {
- gameboard[pos] = 2;
- } // end else if
- clearClicked();
- showBoard(false);
- attack(pos);
- } // End of the function
- function moveBlob(pos)
- {
- if (_root.muted == false)
- {
- sound_take.start();
- } // end if
- if (playersGo)
- {
- gameboard[pos] = 3;
- }
- else
- {
- gameboard[pos] = 2;
- } // end else if
- gameboard[selectedpos] = 1;
- clearClicked();
- showBoard(false);
- attack(pos);
- } // End of the function
- function blobClicked(blob, pos)
- {
- if (_root.muted == false)
- {
- sound_select.start();
- } // end if
- 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;
- } // end if
- 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;
- } // end if
- 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;
- } // end if
- 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;
- } // end if
- 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;
- } // end if
- 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;
- } // end if
- 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;
- } // end if
- 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;
- } // end if
- 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;
- } // end if
- 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;
- } // end if
- 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;
- } // end if
- 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;
- } // end if
- 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;
- } // end if
- 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;
- } // end if
- 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;
- } // end if
- 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;
- } // end if
- 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;
- } // end if
- 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;
- } // end if
- 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;
- } // end if
- 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;
- } // end if
- 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;
- } // end if
- 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;
- } // end if
- 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;
- } // end if
- 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;
- } // end if
- gameboard[pos] = 45;
- showBoard(false);
- gameboard[pos] = 3;
- } // End of the function
- 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;
- } // end if
- 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;
- } // end if
- 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;
- } // end if
- 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;
- } // end if
- 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;
- } // end if
- 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;
- } // end if
- 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;
- } // end if
- 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;
- } // end if
- 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;
- } // end if
- 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;
- } // end if
- 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;
- } // end if
- 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;
- } // end if
- 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;
- } // end if
- 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;
- } // end if
- 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;
- } // end if
- 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;
- } // end if
- 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;
- } // end if
- 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;
- } // end if
- 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;
- } // end if
- 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;
- } // end if
- 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;
- } // end if
- 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;
- } // end if
- 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;
- } // end if
- 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;
- } // end if
- gameboard[pos] = 46;
- showBoard(false);
- gameboard[pos] = 2;
- } // End of the function
- function makeBoard()
- {
- var row;
- var col;
- var name;
- var count = 1;
- counter = 0;
- for (row = 0; row < 8; row++)
- {
- for (col = 0; col < 8; col++)
- {
- 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;
- } // end of for
- } // end of for
- board0_0._x = 241.600000;
- board0_0._y = 42.900000;
- board0_1._x = 275.200000;
- board0_1._y = 58.500000;
- board0_2._x = 308.900000;
- board0_2._y = 74.200000;
- board0_3._x = 342.500000;
- board0_3._y = 89.800000;
- board0_4._x = 376.100000;
- board0_4._y = 105.400000;
- board0_5._x = 409.800000;
- board0_5._y = 121.200000;
- board0_6._x = 443.400000;
- board0_6._y = 136.700000;
- board0_7._x = 477;
- board0_7._y = 152.300000;
- board1_0._x = 207.900000;
- board1_0._y = 58.800000;
- board1_1._x = 241.600000;
- board1_1._y = 74.200000;
- board1_2._x = 275.200000;
- board1_2._y = 89.800000;
- board1_3._x = 308.900000;
- board1_3._y = 105.200000;
- board1_4._x = 342.500000;
- board1_4._y = 121.100000;
- board1_5._x = 376.100000;
- board1_5._y = 136.700000;
- board1_6._x = 409.800000;
- board1_6._y = 152.300000;
- board1_7._x = 443.400000;
- board1_7._y = 167.900000;
- board2_0._x = 174.300000;
- board2_0._y = 74.200000;
- board2_1._x = 207.900000;
- board2_1._y = 89.800000;
- board2_2._x = 241.600000;
- board2_2._y = 105.400000;
- board2_3._x = 275.200000;
- board2_3._y = 121.100000;
- board2_4._x = 308.900000;
- board2_4._y = 136.700000;
- board2_5._x = 342.500000;
- board2_5._y = 152.300000;
- board2_6._x = 376.100000;
- board2_6._y = 167.900000;
- board2_7._x = 409.800000;
- board2_7._y = 183.600000;
- board3_0._x = 140.700000;
- board3_0._y = 89.900000;
- board3_1._x = 174.300000;
- board3_1._y = 105.400000;
- board3_2._x = 207.900000;
- board3_2._y = 121.100000;
- board3_3._x = 241.600000;
- board3_3._y = 136.700000;
- board3_4._x = 275.200000;
- board3_4._y = 152.300000;
- board3_5._x = 308.900000;
- board3_5._y = 167.900000;
- board3_6._x = 342.500000;
- board3_6._y = 183.600000;
- board3_7._x = 376.100000;
- board3_7._y = 199.200000;
- board4_0._x = 107.100000;
- board4_0._y = 105.400000;
- board4_1._x = 140.700000;
- board4_1._y = 121.100000;
- board4_2._x = 174.300000;
- board4_2._y = 136.700000;
- board4_3._x = 207.900000;
- board4_3._y = 152.300000;
- board4_4._x = 241.600000;
- board4_4._y = 167.900000;
- board4_5._x = 275.200000;
- board4_5._y = 183.600000;
- board4_6._x = 308.900000;
- board4_6._y = 199.200000;
- board4_7._x = 342.500000;
- board4_7._y = 214.800000;
- board5_0._x = 73.400000;
- board5_0._y = 121.100000;
- board5_1._x = 107.100000;
- board5_1._y = 136.700000;
- board5_2._x = 140.700000;
- board5_2._y = 152.300000;
- board5_3._x = 174.300000;
- board5_3._y = 167.900000;
- board5_4._x = 208;
- board5_4._y = 183.600000;
- board5_5._x = 241.600000;
- board5_5._y = 199.200000;
- board5_6._x = 275.200000;
- board5_6._y = 214.800000;
- board5_7._x = 308.900000;
- board5_7._y = 230.400000;
- board6_0._x = 39.800000;
- board6_0._y = 136.700000;
- board6_1._x = 73.400000;
- board6_1._y = 152.300000;
- board6_2._x = 107.100000;
- board6_2._y = 167.900000;
- board6_3._x = 140.700000;
- board6_3._y = 183.600000;
- board6_4._x = 174.300000;
- board6_4._y = 199.200000;
- board6_5._x = 207.900000;
- board6_5._y = 214.800000;
- board6_6._x = 242;
- board6_6._y = 230.400000;
- board6_7._x = 275.200000;
- board6_7._y = 246.100000;
- board7_0._x = 6.300000;
- board7_0._y = 152.300000;
- board7_1._x = 39.800000;
- board7_1._y = 167.900000;
- board7_2._x = 73.400000;
- board7_2._y = 183.600000;
- board7_3._x = 107.100000;
- board7_3._y = 199.200000;
- board7_4._x = 140.700000;
- board7_4._y = 214.800000;
- board7_5._x = 174.300000;
- board7_5._y = 230.400000;
- board7_6._x = 207.900000;
- board7_6._y = 246.300000;
- board7_7._x = 241.600000;
- board7_7._y = 261.800000;
- for (row = 0; row < 8; row++)
- {
- for (col = 0; col < 8; col++)
- {
- name = "board" + row + "_" + col;
- eval(name)._x = eval(name)._x + 34;
- eval(name)._y = eval(name)._y + 40;
- } // end of for
- } // end of for
- duplicateMovieClip("message", "popup", count++);
- duplicateMovieClip("message", "popup2", count++);
- popup._x = 275;
- popup._y = 200;
- popup2._x = 275;
- popup2._y = 200;
- } // End of the function
- function initGame()
- {
- var row;
- var col;
- var name;
- var count = 1;
- for (i = 0; i < 100; i++)
- {
- gameboard[i] = 1;
- compboard1[i] = 0;
- compboard2[i] = 0;
- compboard3[i] = 0;
- } // end of for
- 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;
- } // end else if
- curGo = 0;
- playerHL.gotoAndStop(2);
- showBoard();
- } // End of the function
- function showBoard(animate)
- {
- bluecount = 0;
- redcount = 0;
- for (i = 11; i < 19; i++)
- {
- 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;
- } // end else if
- continue;
- } // end if
- eval(name).gotoAndStop(gameboard[i - 11]);
- } // end of for
- for (i = 21; i < 29; i++)
- {
- 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;
- } // end else if
- continue;
- } // end if
- eval(name).gotoAndStop(gameboard[i - 13]);
- } // end of for
- for (i = 31; i < 39; i++)
- {
- 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;
- } // end else if
- continue;
- } // end if
- eval(name).gotoAndStop(gameboard[i - 15]);
- } // end of for
- for (i = 41; i < 49; i++)
- {
- 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;
- } // end else if
- continue;
- } // end if
- eval(name).gotoAndStop(gameboard[i - 17]);
- } // end of for
- for (i = 51; i < 59; i++)
- {
- 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;
- } // end else if
- continue;
- } // end if
- eval(name).gotoAndStop(gameboard[i - 19]);
- } // end of for
- for (i = 61; i < 69; i++)
- {
- 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;
- } // end else if
- continue;
- } // end if
- eval(name).gotoAndStop(gameboard[i - 21]);
- } // end of for
- for (i = 71; i < 79; i++)
- {
- 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;
- } // end else if
- continue;
- } // end if
- eval(name).gotoAndStop(gameboard[i - 23]);
- } // end of for
- for (i = 81; i < 89; i++)
- {
- 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;
- } // end else if
- continue;
- } // end if
- eval(name).gotoAndStop(gameboard[i - 25]);
- } // end of for
- updateScores();
- } // End of the function
- function updateScores()
- {
- redcount = 0;
- bluecount = 0;
- for (i = 0; i < 64; i++)
- {
- if (gameboard[i] == 2 || gameboard[i] == 46)
- {
- ++redcount;
- continue;
- } // end if
- if (gameboard[i] == 3 || gameboard[i] == 45)
- {
- ++bluecount;
- } // end if
- } // end of for
- blues = bluecount;
- reds = redcount;
- if (redcount + bluecount == numTiles || redcount == 0 || bluecount == 0)
- {
- endGame(redcount, bluecount);
- } // end if
- } // End of the function
- function removeMovedBlob()
- {
- trace ("remove " + blobToRemove);
- if (playersGo)
- {
- eval(blobToRemove).gotoAndPlay(50);
- }
- else
- {
- eval(blobToRemove).gotoAndPlay(57);
- } // end else if
- } // End of the function
- function updateBlob(piece, frame)
- {
- eval(piece).gotoAndPlay(frame);
- } // End of the function
- 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");
- } // end else if
- trace (gameboard);
- } // End of the function
- function removePieces()
- {
- var row;
- var col;
- var name;
- var count = 1;
- counter = 0;
- for (row = 0; row < 8; row++)
- {
- for (col = 0; col < 8; col++)
- {
- name = "board" + row + "_" + col;
- removeMovieClip (name);
- ++counter;
- } // end of for
- } // end of for
- } // End of the function
- function nextRound()
- {
- popup.gotoAndStop(1);
- gotoAndPlay(189);
- trace ("bluewon");
- } // End of the function
- function gameOver()
- {
- gotoAndPlay(193);
- } // End of the function
- 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 ();
- // [Action in Frame 192]
- gotoAndStop(191);
- // [Action in Frame 193]
- if (_root.muted == false)
- {
- _root.sound_laugh.start();
- } // end if
- sound_drums.stop();
- stop ();
- // [Action in Frame 194]
- loadMovie("http://www.kwikgames.com/adverts/blobwars_ad.swf", _root.promo);
- sound_drums.stop();
- // [Action in Frame 292]
- stop ();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement