Frame 1
ifFrameLoaded (9) {
gotoAndPlay (4);
}
loaded = int(getBytesLoaded() / 460) + "%";
Frame 3
gotoAndPlay (1);
Frame 4
Sel1.gotoAndStop(2);
compPlay = true;
Mouse.show();
stop();
Frame 6
Mouse.hide();
double = new Array(10, 11, 1, -10, -11, -1);
jump = new Array(9, 20, 21, 22, 12, 2, -9, -20, -21, -22, -12, -2);
all = jump.concat(double);
Winner._visible = false;
Mute._visible = false;
attack = false;
compAttack = false;
remove = false;
notRev = true;
player = 4;
computer = 6;
score4 = 3;
score6 = 3;
unselect = 0;
hexx = 0;
lastHexx = 0;
animPos = 1;
Hexx22.gotoAndStop("On1");
Hexx70.gotoAndStop("On1");
Hexx106.gotoAndStop("On1");
Hexx26.gotoAndStop("On2");
Hexx62.gotoAndStop("On2");
Hexx110.gotoAndStop("On2");
Hexx26.HexxButtonP2._visible = false;
Hexx62.HexxButtonP2._visible = false;
Hexx110.HexxButtonP2._visible = false;
var i = 1;
while (i < 133) {
duplicateMovieClip ("Hexx0", "Hexx" + i, i);
i++;
}
s = new Sound();
startDrag ("Turn", true);
Turn.gotoAndStop(3);
Frame 7
function updateGame(newPlayer) {
if (newPlayer) {
score4 = 0;
score6 = 0;
}
var nextPlayer = (((player - 5) < 0) ? 6 : 4);
var noMoves = true;
var i = 22;
while (i < 111) {
if ((newPlayer && (noMoves)) && (eval ("Hexx" + i)._currentframe == nextPlayer)) {
var j = 0;
while (j < 18) {
if (eval ("Hexx" + Number(i + all[j]))._currentframe == 1) {
noMoves = false;
j = 18;
}
j++;
}
}
tellTarget ("Hexx" + i) {
if (3 < _currentframe) {
if ((_currentframe == 5) || (_currentframe == 7)) {
prevFrame();
}
if (newPlayer) {
Set("_root.score" + _currentframe, eval ("_root.score" + _currentframe) + 1);
if ((_root.player == 4) && (!_root.compPlay)) {
HexxButtonP1._visible = false;
HexxButtonP2._visible = true;
} else if (_root.player == 6) {
HexxButtonP1._visible = true;
HexxButtonP2._visible = false;
}
}
} else {
gotoAndStop ("Off");
}
};
i++;
}
if (newPlayer) {
if (noMoves) {
score4 = 0;
score6 = 0;
var i = 22;
while (i < 111) {
tellTarget ("Hexx" + i) {
if (_currentframe == 1) {
gotoAndStop(_root.player);
}
Set("_root.score" + _currentframe, eval ("_root.score" + _currentframe) + 1);
HexxButtonP1._visible = false;
HexxButtonP2._visible = false;
};
i++;
}
Winner._visible = true;
if (score4 == score6) {
Winner.gotoAndStop("Tie");
} else if (score6 < score4) {
Winner.gotoAndPlay("Win4");
player = 6;
} else {
Winner.gotoAndPlay("Win6");
player = 4;
}
}
var b = 4;
while (b < 8) {
tellTarget ("Bar" + b) {
_width = eval ("_root.score" + b);
_x = (357 - (_width / 2));
};
b = b + 2;
}
if (compAttack) {
compAttack = false;
Bulb.play();
}
if (((compPlay && (!noMoves)) && (attack)) && (player != computer)) {
compAttack = true;
} else {
Turn.gotoAndStop(player / 2);
startDrag ("Turn", true);
}
}
}
Frame 8
function playAnim(plyr) {
Turn.gotoAndStop(1);
stopDrag();
if (remove) {
tellTarget ("Hexx" + unselect) {
gotoAndStop ("Off");
};
remove = false;
lastHexx = hexx;
}
notRev = true;
tellTarget ("P" + plyr) {
dirn = _root.hexx - _root.unselect;
mover = _root.unselect;
if ((plyr == 4) && (dirn < 0)) {
mover = _root.hexx;
}
_x = eval (("_root.Hexx" + mover) + "._x");
_y = eval (("_root.Hexx" + mover) + "._y");
var d = 0;
while (d < 6) {
if (dirn == _root.double[d]) {
if (plyr == 6) {
_root.Snd.gotoAndPlay("P2Double");
gotoAndPlay((7 * d) + 9);
} else {
if (0 < dirn) {
gotoAndPlay((17 * d) + 2);
} else {
_root.notRev = false;
gotoAndPlay((17 * d) - 33);
Rewinder.gotoAndPlay(2);
}
_root.Snd.gotoAndPlay("P1Move");
}
}
d++;
}
var d = 0;
while (d < 12) {
if (dirn == _root.jump[d]) {
if (plyr == 6) {
_root.animPos = (7 * d) + 51;
gotoAndPlay (2);
} else {
if (0 < dirn) {
gotoAndPlay((17 * d) + 53);
} else {
_root.notRev = false;
gotoAndPlay((17 * d) - 33);
Rewinder.gotoAndPlay(2);
}
_root.Snd.gotoAndPlay("P1Move");
}
}
d++;
}
};
if (compAttack) {
Bulb.gotoAndStop(1);
}
}
Frame 9
function moveAnim(dest, plyr) {
setProperty("P" + plyr, _x , eval (("Hexx" + dest) + "._x"));
setProperty("P" + plyr, _y , eval (("Hexx" + dest) + "._y"));
}
function attackHexx(dest, plyr) {
tellTarget ("Hexx" + dest) {
gotoAndStop(plyr);
};
tellTarget ("P" + plyr) {
gotoAndStop ("Zap");
};
var noAttack = true;
var i = 0;
while (i < 6) {
var toZap = false;
tellTarget ("Hexx" + Number(dest + double[i])) {
if ((3 < _currentframe) && (_currentframe != plyr)) {
noAttack = false;
toZap = true;
gotoAndStop(plyr);
Wobble.gotoAndStop("Morph");
}
};
setProperty((("P" + plyr) + ".Zap") + double[i], _visible , toZap);
i++;
}
if (noAttack) {
tellTarget ("P" + plyr) {
gotoAndStop (1);
};
tellTarget (("Hexx" + dest) + ".Wobble") {
gotoAndStop ("Sparkle");
};
}
}
Frame 10
function playerSelect(hexx) {
if (compAttack || (attack && (player == eval ("Hexx" + hexx)._currentframe))) {
return(undefined);
}
_root.hexx = hexx;
attack = false;
remove = false;
tellTarget ("Hexx" + hexx) {
if ((_currentframe == 4) || (_currentframe == 6)) {
_root.player = _currentframe;
_root.unselect = hexx;
nextFrame();
} else if (_currentframe == 2) {
_root.attack = true;
_root.lastHexx = hexx;
} else if (_currentframe == 3) {
_root.remove = true;
_root.attack = true;
_root.lastHexx = hexx;
}
};
updateGame(false);
if (attack) {
playAnim(player);
} else {
Snd.gotoAndPlay("Select");
}
if (lastHexx != hexx) {
lastHexx = hexx;
tellTarget ("Hexx" + hexx) {
nextFrame();
};
var i = 0;
while (i < 6) {
tellTarget ("Hexx" + Number(hexx + double[i])) {
if (_currentframe < 4) {
gotoAndStop ("Double");
}
};
tellTarget ("Hexx" + Number(hexx + jump[i])) {
if (_currentframe < 4) {
gotoAndStop ("Jump");
}
};
tellTarget ("Hexx" + Number(hexx + jump[i + 6])) {
if (_currentframe < 4) {
gotoAndStop ("Jump");
}
};
i++;
}
} else {
lastHexx = 0;
}
}
Frame 11
function findBestMove(compHexx) {
highestRanking = 0;
hexxOrig = 0;
hexxDest = 0;
eqCount = 0;
var check = 0;
while (check < 3) {
var j = 0;
while (j < 6) {
attackCount = 0;
if (check == 0) {
hexxCheck = double[j];
if (Math.round(1.5 * Math.random())) {
attackCount = 0.5;
} else {
attackCount = 1.5;
}
}
if (check == 1) {
hexxCheck = jump[j];
}
if (check == 2) {
hexxCheck = jump[j + 6];
}
var k = 0;
while (k < 6) {
tryDest = compHexx + hexxCheck;
if (eval ("Hexx" + tryDest)._currentframe == 1) {
if (eval ("Hexx" + Number(tryDest + double[k]))._currentframe == player) {
this.attackCount++;
}
}
k++;
}
if (attackCount >= highestRanking) {
if (eval ("Hexx" + tryDest)._currentframe == 1) {
highestRanking = attackCount;
hexxDest = tryDest;
}
}
if (attackCount == highestRanking) {
eqCount = 0;
var k = 0;
while (k < 6) {
if (eval ("Hexx" + Number(compHexx + double[k]))._currentframe == computer) {
eqCount++;
} else {
eqCount--;
}
k++;
}
}
j++;
}
check++;
}
return([highestRanking, compHexx, hexxDest, eqCount]);
}
Frame 12
function computerSelect() {
thisBest = new Array(0, 0, 0, 0);
bestMove = new Array(0, 0, 0, 0);
i = 22;
while (i < 111) {
compHexx = 0;
tellTarget ("Hexx" + i) {
if (_currentframe == _root.computer) {
this.compHexx = this.i;
}
};
if (compHexx != 0) {
thisBest = findBestMove(compHexx);
if (bestMove[0] < thisBest[0]) {
bestMove = thisBest;
} else if (thisBest[0] == bestMove[0]) {
if (thisBest[3] < bestMove[3]) {
bestMove = thisBest;
}
}
}
i++;
}
if (bestMove[0] != 0) {
if ((bestMove[0] - int(bestMove[0])) != 0.5) {
remove = true;
}
unselect = bestMove[1];
hexx = bestMove[2];
player = computer;
playAnim(computer);
}
}
Frame 13
stop();
Symbol 10 Button
on (release) {
getURL ("http://www.neave.com/webgames/", "_blank");
}
Symbol 14 MovieClip Frame 1
stop();
Symbol 26 Button
on (release) {
Sel1.gotoAndStop(2);
Sel2.gotoAndStop(1);
compPlay = true;
}
Symbol 27 Button
on (release) {
Sel1.gotoAndStop(1);
Sel2.gotoAndStop(2);
compPlay = false;
}
Symbol 30 Button
on (release) {
gotoAndPlay (6);
}
Symbol 32 Button
on (release) {
fscommand ("quit");
}
Symbol 34 Button
on (release) {
nextFrame();
}
Symbol 39 Button
on (release) {
gotoAndStop (4);
}
Symbol 42 MovieClip Frame 2
stop();
Symbol 54 MovieClip Frame 1
stop();
Symbol 54 MovieClip Frame 3
stop();
Symbol 54 MovieClip Frame 5
stop();
Symbol 54 MovieClip Frame 7
stop();
Symbol 54 MovieClip Frame 9
stop();
Symbol 54 MovieClip Frame 11
stop();
Symbol 54 MovieClip Frame 13
stop();
Symbol 54 MovieClip Frame 15
stop();
Symbol 54 MovieClip Frame 17
stop();
Symbol 54 MovieClip Frame 19
stop();
Symbol 54 MovieClip Frame 21
stop();
Symbol 56 Button
on (release) {
if (s.getVolume() == 0) {
s.setVolume(100);
Mute._visible = false;
} else {
s.setVolume(0);
Mute._visible = true;
}
}
Symbol 63 Button
on (release) {
_root.playerSelect(Number(_parent._name.substr(4)));
}
Symbol 66 MovieClip Frame 1
_root.Snd.gotoAndPlay("Ding");
Symbol 66 MovieClip Frame 11
stop();
if (_parent._parent._name == ("Hexx" + _root.hexx)) {
_root.updateGame(true);
}
Symbol 67 MovieClip Frame 1
stop();
Symbol 67 MovieClip Frame 2
play();
Symbol 67 MovieClip Frame 18
tellTarget (("_root.Hexx" + _root.hexx) + ".Wobble") {
if (_currentframe < 2) {
gotoAndStop ("Sparkle");
}
};
play();
Symbol 69 MovieClip Frame 1
stop();
Symbol 69 MovieClip Frame 2
play();
Symbol 69 MovieClip Frame 9
gotoAndStop (1);
Symbol 69 MovieClip Frame 10
play();
Symbol 69 MovieClip Frame 23
tellTarget (("_root.Hexx" + _root.hexx) + ".Wobble") {
if (_currentframe < 10) {
gotoAndStop ("Attacked");
}
};
play();
Symbol 69 MovieClip Frame 30
_root.Snd.gotoAndPlay("P2Wobble");
Symbol 69 MovieClip Frame 39
play();
Symbol 71 MovieClip Frame 1
stop();
Symbol 74 Button
on (release) {
gotoAndPlay (42);
}
Symbol 76 Button
on (release) {
tellTarget ("_root") {
gotoAndStop (4);
};
}
Symbol 77 MovieClip Frame 1
stop();
Symbol 77 MovieClip Frame 21
stop();
Symbol 77 MovieClip Frame 41
stop();
Symbol 77 MovieClip Frame 47
stop();
Symbol 78 MovieClip Frame 1
stop();
Symbol 78 MovieClip Frame 2
tellTarget (_parent) {
gotoAndStop(_currentframe - 1);
};
Symbol 78 MovieClip Frame 3
if (_parent._currentframe == 1) {
_root.notRev = true;
gotoAndStop (1);
} else {
gotoAndPlay (2);
}
Symbol 95 MovieClip Frame 1
stop();
Symbol 95 MovieClip Frame 2
if (_root.notRev) {
play();
} else {
gotoAndPlay (155);
}
Symbol 95 MovieClip Frame 18
if (_root.notRev) {
gotoAndPlay (155);
}
Symbol 95 MovieClip Frame 19
if (_root.notRev) {
play();
} else {
gotoAndPlay (155);
}
Symbol 95 MovieClip Frame 35
if (_root.notRev) {
gotoAndPlay (155);
}
Symbol 95 MovieClip Frame 36
if (_root.notRev) {
play();
} else {
gotoAndPlay (155);
}
Symbol 95 MovieClip Frame 52
if (_root.notRev) {
gotoAndPlay (155);
}
Symbol 95 MovieClip Frame 53
if (_root.notRev) {
gotoAndPlay (54);
} else {
gotoAndPlay (155);
}
Symbol 95 MovieClip Frame 69
if (_root.notRev) {
gotoAndPlay (155);
}
Symbol 95 MovieClip Frame 70
if (_root.notRev) {
gotoAndPlay (71);
} else {
gotoAndPlay (155);
}
Symbol 95 MovieClip Frame 86
if (_root.notRev) {
gotoAndPlay (155);
}
Symbol 95 MovieClip Frame 87
if (_root.notRev) {
gotoAndPlay (88);
} else {
gotoAndPlay (155);
}
Symbol 95 MovieClip Frame 103
if (_root.notRev) {
gotoAndPlay (155);
}
Symbol 95 MovieClip Frame 104
if (_root.notRev) {
gotoAndPlay (105);
} else {
gotoAndPlay (155);
}
Symbol 95 MovieClip Frame 120
if (_root.notRev) {
gotoAndPlay (155);
}
Symbol 95 MovieClip Frame 121
if (_root.notRev) {
gotoAndPlay (122);
} else {
gotoAndPlay (155);
}
Symbol 95 MovieClip Frame 137
if (_root.notRev) {
gotoAndPlay (155);
}
Symbol 95 MovieClip Frame 138
if (_root.notRev) {
gotoAndPlay (139);
} else {
gotoAndPlay (155);
}
Symbol 95 MovieClip Frame 154
if (_root.notRev) {
gotoAndPlay (155);
}
Symbol 95 MovieClip Frame 155
_root.moveAnim(_root.hexx, _root.player);
Symbol 95 MovieClip Frame 156
_root.attackHexx(_root.hexx, _root.player);
stop();
Symbol 95 MovieClip Frame 157
play();
Symbol 95 MovieClip Frame 158
_root.Snd.gotoAndPlay("P1PreZap");
Symbol 95 MovieClip Frame 165
_root.Snd.gotoAndPlay("P1Zap");
Symbol 98 MovieClip Frame 1
stop();
Symbol 98 MovieClip Frame 6
_root.Snd.gotoAndPlay("P2PreJump");
Symbol 98 MovieClip Frame 8
gotoAndPlay(_root.animPos);
Symbol 98 MovieClip Frame 13
tellTarget (("_root.Hexx" + _root.unselect) + ".Wobble") {
gotoAndPlay (2);
};
Symbol 98 MovieClip Frame 15
gotoAndPlay (134);
Symbol 98 MovieClip Frame 20
tellTarget (("_root.Hexx" + _root.unselect) + ".Wobble") {
gotoAndPlay (2);
};
Symbol 98 MovieClip Frame 22
gotoAndPlay (134);
Symbol 98 MovieClip Frame 27
tellTarget (("_root.Hexx" + _root.unselect) + ".Wobble") {
gotoAndPlay (2);
};
Symbol 98 MovieClip Frame 29
gotoAndPlay (134);
Symbol 98 MovieClip Frame 34
tellTarget (("_root.Hexx" + _root.unselect) + ".Wobble") {
gotoAndPlay (2);
};
Symbol 98 MovieClip Frame 36
gotoAndPlay (134);
Symbol 98 MovieClip Frame 41
tellTarget (("_root.Hexx" + _root.unselect) + ".Wobble") {
gotoAndPlay (2);
};
Symbol 98 MovieClip Frame 43
gotoAndPlay (134);
Symbol 98 MovieClip Frame 48
tellTarget (("_root.Hexx" + _root.unselect) + ".Wobble") {
gotoAndPlay (2);
};
Symbol 98 MovieClip Frame 50
gotoAndPlay (134);
Symbol 98 MovieClip Frame 57
gotoAndPlay (134);
Symbol 98 MovieClip Frame 64
gotoAndPlay (134);
Symbol 98 MovieClip Frame 71
gotoAndPlay (134);
Symbol 98 MovieClip Frame 78
gotoAndPlay (134);
Symbol 98 MovieClip Frame 85
gotoAndPlay (134);
Symbol 98 MovieClip Frame 92
gotoAndPlay (134);
Symbol 98 MovieClip Frame 99
gotoAndPlay (134);
Symbol 98 MovieClip Frame 106
gotoAndPlay (134);
Symbol 98 MovieClip Frame 113
gotoAndPlay (134);
Symbol 98 MovieClip Frame 120
gotoAndPlay (134);
Symbol 98 MovieClip Frame 127
gotoAndPlay (134);
Symbol 98 MovieClip Frame 134
Wobble.gotoAndPlay(2);
_root.moveAnim(_root.hexx, _root.player);
if (50 < _root.animPos) {
_root.Snd.gotoAndPlay("P2LandJump");
}
_root.animPos = 1;
Symbol 98 MovieClip Frame 142
_root.attackHexx(_root.hexx, _root.player);
stop();
Symbol 98 MovieClip Frame 143
play();
Symbol 98 MovieClip Frame 144
_root.Snd.gotoAndPlay("P2Zap");
Symbol 100 MovieClip Frame 2
if (!_root.compAttack) {
gotoAndPlay (1);
}
Symbol 100 MovieClip Frame 5
stop();
_root.computerSelect();
Symbol 103 MovieClip Frame 1
stop();