Frame 1
function menuHandler(o, item) {
Mouse.show();
item.customItems[1].caption = ((s.getVolume() == 0) ? "Unmute sound" : "Mute sound");
item.customItems[2].caption = (Stars._visible ? "Hide background stars" : "Show background stars");
}
function quitGame() {
gotoAndStop ("Loaded");
}
function muteSound() {
if (s.getVolume() == 0) {
s.setVolume(100);
Mute._visible = false;
} else {
s.setVolume(0);
Mute._visible = true;
}
}
function toggleStars() {
if (Stars._visible) {
Stars._visible = false;
delete Stars.onEnterFrame;
} else {
Stars._visible = true;
Stars.onEnterFrame = updateStars;
}
}
function newStar(mc) {
mc._xscale = (mc._yscale = Math.max((Math.exp(Math.random() * 3) * Math.random()) * 5, 15));
mc.dx = mc._xscale * 0.05;
mc._y = (Math.random() * 280) + 10;
}
function updateStars() {
var _local3 = 80;
while (_local3--) {
var _local2 = this[_local3];
_local2._x = _local2._x - _local2.dx;
if (_local2._x < -120) {
_local2._x = 500;
newStar(_local2);
}
}
}
stop();
compPlay = true;
this.onEnterFrame = function () {
sofar = this.getBytesLoaded();
total = this.getBytesTotal();
if (sofar == total) {
delete this.onEnterFrame;
nextFrame();
}
};
Stage.showMenu = true;
fs_cm = new ContextMenu(menuHandler);
fs_cm.hideBuiltInItems();
fs_cm.customItems.push(new ContextMenuItem("Quit game", quitGame, false, true, false), new ContextMenuItem("Mute sound", muteSound, false, true, false), new ContextMenuItem("Hide background stars", toggleStars, false, true, true));
_root.menu = fs_cm;
var i = 0;
while (i < 80) {
var mc = Stars.attachMovie("Star", i, i);
mc.cacheAsBitmap = true;
newStar(mc);
mc._x = (Math.random() * 620) - 120;
i++;
}
Stars.onEnterFrame = updateStars;
this.onKeyUp = function () {
if (Key.getCode() == 32) {
toggleStars();
}
};
Key.addListener(this);
Frame 2
stop();
if (compPlay) {
Sel1.gotoAndStop(2);
P1._alpha = 100;
P2._alpha = 50;
} else {
Sel2.gotoAndStop(2);
P1._alpha = 50;
P2._alpha = 100;
}
delete this.onMouseMove;
Mouse.show();
_root.menu.customItems[0].visible = (_root.menu.customItems[1].visible = false);
neave_btn._visible = ((((_url.indexOf("file:///") == -1) && (_url.indexOf("http://localhost") == -1)) && (_url.indexOf("http://72.10.34.191") == -1)) && (_url.indexOf("http://neave.com") == -1)) && (_url.indexOf("http://www.neave.com") == -1);
Frame 3
function updateGame(newPlayer) {
if (newPlayer) {
score4 = (score6 = 0);
}
var _local7 = ((player < 5) ? 6 : 4);
var _local5 = true;
var _local4 = 22;
while (_local4 < 111) {
if ((newPlayer && (_local5)) && (_root["Hexx" + _local4]._currentframe == _local7)) {
var _local2 = 0;
while (_local2 < 18) {
if (_root["Hexx" + (all[_local2] + _local4)]._currentframe == 1) {
_local5 = false;
_local2 = 18;
}
_local2++;
}
}
tellTarget ("Hexx" + _local4) {
if (_currentframe > 3) {
if ((_currentframe == 5) || (_currentframe == 7)) {
prevFrame();
}
if (newPlayer) {
_root["score" + _currentframe]++;
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");
}
};
_local4++;
}
if (newPlayer) {
if (_local5) {
score4 = (score6 = 0);
_local4 = 22;
while (_local4 < 111) {
tellTarget ("Hexx" + _local4) {
if (_currentframe == 1) {
gotoAndStop(_root.player);
}
_root["score" + _currentframe]++;
HexxButtonP1._visible = (HexxButtonP2._visible = false);
};
_local4++;
}
if (score4 == score6) {
Winner.gotoAndStop("Tie");
} else if (score4 > score6) {
Winner.gotoAndPlay("Win4");
player = 6;
} else {
Winner.gotoAndPlay("Win6");
player = 4;
}
Winner._visible = true;
}
var _local3 = 4;
while (_local3 < 8) {
tellTarget ("Bar" + _local3) {
_width = _root["score" + _local3];
};
_local3 = _local3 + 2;
}
updateScoreText();
if (compAttack) {
Bulb.play();
}
compAttack = false;
if (((compPlay && (!_local5)) && (attack)) && (player != computer)) {
compAttack = true;
} else {
Turn.gotoAndStop(player / 2);
}
}
}
function playAnim(plyr) {
Turn.gotoAndStop(1);
if (remove) {
_root["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 = _root["Hexx" + mover]._x;
_y = _root["Hexx" + mover]._y;
var _local2 = 0;
while (_local2 < 6) {
if (dirn == _root.double[_local2]) {
if (plyr == 6) {
_root.Snd.gotoAndPlay("P2Double");
gotoAndPlay((7 * _local2) + 9);
} else {
if (dirn > 0) {
gotoAndPlay((17 * _local2) + 2);
} else {
_root.notRev = false;
gotoAndPlay((17 * _local2) - 33);
Rewinder.gotoAndPlay(2);
}
_root.Snd.gotoAndPlay("P1Move");
}
}
_local2++;
}
_local2 = 0;
while (_local2 < 12) {
if (dirn == _root.jump[_local2]) {
if (plyr == 6) {
_root.animPos = (7 * _local2) + 51;
gotoAndPlay (2);
} else {
if (dirn > 0) {
gotoAndPlay((17 * _local2) + 53);
} else {
_root.notRev = false;
gotoAndPlay((17 * _local2) - 33);
Rewinder.gotoAndPlay(2);
}
_root.Snd.gotoAndPlay("P1Move");
}
}
_local2++;
}
};
if (compAttack) {
Bulb.gotoAndStop(1);
}
}
function moveAnim(dest, plyr) {
_root["P" + plyr]._x = _root["Hexx" + dest]._x;
_root["P" + plyr]._y = _root["Hexx" + dest]._y;
}
function attackHexx(dest, plyr) {
_root["Hexx" + dest].gotoAndStop(plyr);
_root["P" + plyr].gotoAndStop("Zap");
var _local5 = true;
var _local2 = 0;
while (_local2 < 6) {
var _local3 = false;
tellTarget ("Hexx" + (dest + double[_local2])) {
if ((_currentframe > 3) && (_currentframe != plyr)) {
_local5 = false;
_local3 = true;
gotoAndStop(plyr);
Wobble.gotoAndStop("Morph");
}
};
_root["P" + plyr]["Zap" + double[_local2]]._visible = _local3;
_local2++;
}
if (_local5) {
_root["P" + plyr].gotoAndStop(1);
_root["Hexx" + dest].Wobble.gotoAndStop("Sparkle");
}
}
function playerSelect(hexx) {
if (compAttack || (attack && (player == _root["Hexx" + hexx]._currentframe))) {
return(undefined);
}
_root.hexx = hexx;
attack = (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.attack = (_root.remove = true);
_root.lastHexx = hexx;
}
};
updateGame(false);
if (attack) {
playAnim(player);
} else {
Snd.gotoAndPlay("Select");
}
if (lastHexx != hexx) {
lastHexx = hexx;
_root["Hexx" + hexx].nextFrame();
var _local2 = 0;
while (_local2 < 6) {
tellTarget ("Hexx" + (hexx + double[_local2])) {
if (_currentframe < 4) {
gotoAndStop ("Double");
}
};
tellTarget ("Hexx" + (hexx + jump[_local2])) {
if (_currentframe < 4) {
gotoAndStop ("Jump");
}
};
tellTarget ("Hexx" + (hexx + jump[_local2 + 6])) {
if (_currentframe < 4) {
gotoAndStop ("Jump");
}
};
_local2++;
}
} else {
lastHexx = 0;
}
}
function findBestMove(compHexx) {
highestRanking = (hexxOrig = (hexxDest = (eqCount = 0)));
var _local5 = 0;
while (_local5 < 3) {
var _local4 = 0;
while (_local4 < 6) {
attackCount = 0;
if (_local5 == 0) {
hexxCheck = double[_local4];
if (Math.round(Math.random() * 1.5)) {
attackCount = 0.5;
} else {
attackCount = 1.5;
}
} else if (_local5 == 1) {
hexxCheck = jump[_local4];
} else if (_local5 == 2) {
hexxCheck = jump[_local4 + 6];
}
var _local3 = 0;
while (_local3 < 6) {
tryDest = compHexx + hexxCheck;
if (_root["Hexx" + tryDest]._currentframe == 1) {
if (_root["Hexx" + (tryDest + double[_local3])]._currentframe == player) {
this.attackCount++;
}
}
_local3++;
}
if (attackCount >= highestRanking) {
if (_root["Hexx" + tryDest]._currentframe == 1) {
highestRanking = attackCount;
hexxDest = tryDest;
}
}
if (attackCount == highestRanking) {
eqCount = 0;
_local3 = 0;
while (_local3 < 6) {
if (_root["Hexx" + (compHexx + double[_local3])]._currentframe == computer) {
eqCount++;
} else {
eqCount--;
}
_local3++;
}
}
_local4++;
}
_local5++;
}
return([highestRanking, compHexx, hexxDest, eqCount]);
}
function computerSelect() {
thisBest = new Array(0, 0, 0, 0);
bestMove = new Array(0, 0, 0, 0);
var _local2 = 22;
while (_local2 < 111) {
compHexx = 0;
if (_root["Hexx" + _local2]._currentframe == computer) {
compHexx = _local2;
}
if (compHexx) {
thisBest = findBestMove(compHexx);
if (thisBest[0] > bestMove[0]) {
bestMove = thisBest;
} else if ((thisBest[0] == bestMove[0]) && (thisBest[3] < bestMove[3])) {
bestMove = thisBest;
}
}
_local2++;
}
if (bestMove[0]) {
if ((bestMove[0] - int(bestMove[0])) != 0.5) {
remove = true;
}
unselect = bestMove[1];
hexx = bestMove[2];
player = computer;
playAnim(computer);
}
}
function updateScoreText() {
p1_txt.text = score4;
p2_txt.text = score6;
}
stop();
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);
attack = (compAttack = (remove = false));
notRev = true;
player = 4;
computer = 6;
score4 = (score6 = 3);
updateScoreText();
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 = (Hexx62.HexxButtonP2._visible = (Hexx110.HexxButtonP2._visible = false));
var i = 1;
while (i < 133) {
duplicateMovieClip ("Hexx0", "Hexx" + i, i);
i++;
}
s = new Sound();
this.onMouseMove = function () {
Turn._x = _xmouse;
Turn._y = _ymouse;
Mouse.hide();
updateAfterEvent();
};
this.onMouseMove();
Turn.gotoAndStop(3);
Instance of Symbol 57 MovieClip "Mute" in Frame 3
onClipEvent (load) {
_visible = (_parent.s.getVolume() == 0);
}
Instance of Symbol 111 MovieClip "Winner" in Frame 3
onClipEvent (load) {
_visible = false;
}
Symbol 13 Button
on (release) {
getURL ("http://neave.com/games/", "_top");
}
Symbol 17 MovieClip Frame 1
stop();
Symbol 29 Button
on (release) {
Sel1.gotoAndStop(2);
Sel2.gotoAndStop(1);
P2._alpha = 50;
compPlay = true;
}
on (rollOver) {
if (Sel1._currentframe == 1) {
P1._alpha = 100;
}
}
on (rollOut, dragOut) {
if (Sel1._currentframe == 1) {
P1._alpha = 50;
}
}
Symbol 30 Button
on (release) {
Sel1.gotoAndStop(1);
Sel2.gotoAndStop(2);
P1._alpha = 50;
compPlay = false;
}
on (rollOver) {
if (Sel2._currentframe == 1) {
P2._alpha = 100;
}
}
on (rollOut, dragOut) {
if (Sel2._currentframe == 1) {
P2._alpha = 50;
}
}
Symbol 35 Button
on (release) {
_root.menu.customItems[0].visible = (_root.menu.customItems[1].visible = true);
play();
}
Symbol 37 MovieClip Frame 2
stop();
Symbol 43 Button
on (release, keyPress "q") {
Winner.gotoAndStop(1);
Winner._visible = true;
}
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 56 Button
on (release, keyPress "m") {
muteSound();
}
Symbol 66 Button
on (release) {
_root.playerSelect(Number(_parent._name.substr(4)));
}
Symbol 69 MovieClip Frame 1
_root.Snd.gotoAndPlay("Ding");
Symbol 69 MovieClip Frame 11
stop();
if (_parent._parent._name == ("Hexx" + _root.hexx)) {
_root.updateGame(true);
}
Symbol 70 MovieClip Frame 1
stop();
Symbol 70 MovieClip Frame 2
play();
Symbol 70 MovieClip Frame 18
tellTarget (("_root.Hexx" + _root.hexx) + ".Wobble") {
if (_currentframe < 2) {
gotoAndStop ("Sparkle");
}
};
play();
Symbol 72 MovieClip Frame 1
stop();
Symbol 72 MovieClip Frame 2
play();
Symbol 72 MovieClip Frame 9
gotoAndStop (1);
Symbol 72 MovieClip Frame 10
play();
Symbol 72 MovieClip Frame 23
tellTarget (("_root.Hexx" + _root.hexx) + ".Wobble") {
if (_currentframe < 10) {
gotoAndStop ("Attacked");
}
};
play();
Symbol 72 MovieClip Frame 30
_root.Snd.gotoAndPlay("P2Wobble");
Symbol 72 MovieClip Frame 39
play();
Symbol 74 MovieClip Frame 1
stop();
Symbol 75 MovieClip Frame 1
stop();
Symbol 75 MovieClip Frame 2
tellTarget (_parent) {
gotoAndStop(_currentframe - 1);
};
Symbol 75 MovieClip Frame 3
if (_parent._currentframe == 1) {
_root.notRev = true;
gotoAndStop (1);
} else {
gotoAndPlay (2);
}
Symbol 91 MovieClip Frame 1
stop();
Symbol 91 MovieClip Frame 2
if (_root.notRev) {
play();
} else {
gotoAndPlay ("Wobble");
}
Symbol 91 MovieClip Frame 18
if (_root.notRev) {
gotoAndPlay ("Wobble");
}
Symbol 91 MovieClip Frame 19
if (_root.notRev) {
play();
} else {
gotoAndPlay ("Wobble");
}
Symbol 91 MovieClip Frame 35
if (_root.notRev) {
gotoAndPlay ("Wobble");
}
Symbol 91 MovieClip Frame 36
if (_root.notRev) {
play();
} else {
gotoAndPlay ("Wobble");
}
Symbol 91 MovieClip Frame 52
if (_root.notRev) {
gotoAndPlay ("Wobble");
}
Symbol 91 MovieClip Frame 53
if (_root.notRev) {
gotoAndPlay (54);
} else {
gotoAndPlay ("Wobble");
}
Symbol 91 MovieClip Frame 69
if (_root.notRev) {
gotoAndPlay ("Wobble");
}
Symbol 91 MovieClip Frame 70
if (_root.notRev) {
gotoAndPlay (71);
} else {
gotoAndPlay ("Wobble");
}
Symbol 91 MovieClip Frame 86
if (_root.notRev) {
gotoAndPlay ("Wobble");
}
Symbol 91 MovieClip Frame 87
if (_root.notRev) {
gotoAndPlay (88);
} else {
gotoAndPlay ("Wobble");
}
Symbol 91 MovieClip Frame 103
if (_root.notRev) {
gotoAndPlay ("Wobble");
}
Symbol 91 MovieClip Frame 104
if (_root.notRev) {
gotoAndPlay (105);
} else {
gotoAndPlay ("Wobble");
}
Symbol 91 MovieClip Frame 120
if (_root.notRev) {
gotoAndPlay ("Wobble");
}
Symbol 91 MovieClip Frame 121
if (_root.notRev) {
gotoAndPlay (122);
} else {
gotoAndPlay ("Wobble");
}
Symbol 91 MovieClip Frame 137
if (_root.notRev) {
gotoAndPlay ("Wobble");
}
Symbol 91 MovieClip Frame 138
if (_root.notRev) {
gotoAndPlay (139);
} else {
gotoAndPlay ("Wobble");
}
Symbol 91 MovieClip Frame 154
if (_root.notRev) {
gotoAndPlay ("Wobble");
}
Symbol 91 MovieClip Frame 155
_root.moveAnim(_root.hexx, _root.player);
Symbol 91 MovieClip Frame 156
_root.attackHexx(_root.hexx, _root.player);
stop();
Symbol 91 MovieClip Frame 157
play();
Symbol 91 MovieClip Frame 158
_root.Snd.gotoAndPlay("P1PreZap");
Symbol 91 MovieClip Frame 165
_root.Snd.gotoAndPlay("P1Zap");
Symbol 94 MovieClip Frame 1
stop();
Symbol 94 MovieClip Frame 6
_root.Snd.gotoAndPlay("P2PreJump");
Symbol 94 MovieClip Frame 8
gotoAndPlay(_root.animPos);
Symbol 94 MovieClip Frame 13
tellTarget (("_root.Hexx" + _root.unselect) + ".Wobble") {
gotoAndPlay (2);
};
Symbol 94 MovieClip Frame 15
gotoAndPlay ("Wobble");
Symbol 94 MovieClip Frame 20
tellTarget (("_root.Hexx" + _root.unselect) + ".Wobble") {
gotoAndPlay (2);
};
Symbol 94 MovieClip Frame 22
gotoAndPlay ("Wobble");
Symbol 94 MovieClip Frame 27
tellTarget (("_root.Hexx" + _root.unselect) + ".Wobble") {
gotoAndPlay (2);
};
Symbol 94 MovieClip Frame 29
gotoAndPlay ("Wobble");
Symbol 94 MovieClip Frame 34
tellTarget (("_root.Hexx" + _root.unselect) + ".Wobble") {
gotoAndPlay (2);
};
Symbol 94 MovieClip Frame 36
gotoAndPlay ("Wobble");
Symbol 94 MovieClip Frame 41
tellTarget (("_root.Hexx" + _root.unselect) + ".Wobble") {
gotoAndPlay (2);
};
Symbol 94 MovieClip Frame 43
gotoAndPlay ("Wobble");
Symbol 94 MovieClip Frame 48
tellTarget (("_root.Hexx" + _root.unselect) + ".Wobble") {
gotoAndPlay (2);
};
Symbol 94 MovieClip Frame 50
gotoAndPlay ("Wobble");
Symbol 94 MovieClip Frame 57
gotoAndPlay ("Wobble");
Symbol 94 MovieClip Frame 64
gotoAndPlay ("Wobble");
Symbol 94 MovieClip Frame 71
gotoAndPlay ("Wobble");
Symbol 94 MovieClip Frame 78
gotoAndPlay ("Wobble");
Symbol 94 MovieClip Frame 85
gotoAndPlay ("Wobble");
Symbol 94 MovieClip Frame 92
gotoAndPlay ("Wobble");
Symbol 94 MovieClip Frame 99
gotoAndPlay ("Wobble");
Symbol 94 MovieClip Frame 106
gotoAndPlay ("Wobble");
Symbol 94 MovieClip Frame 113
gotoAndPlay ("Wobble");
Symbol 94 MovieClip Frame 120
gotoAndPlay ("Wobble");
Symbol 94 MovieClip Frame 127
gotoAndPlay ("Wobble");
Symbol 94 MovieClip Frame 134
Wobble.gotoAndPlay(2);
_root.moveAnim(_root.hexx, _root.player);
if (_root.animPos > 50) {
_root.Snd.gotoAndPlay("P2LandJump");
}
_root.animPos = 1;
Symbol 94 MovieClip Frame 142
_root.attackHexx(_root.hexx, _root.player);
stop();
Symbol 94 MovieClip Frame 143
play();
Symbol 94 MovieClip Frame 144
_root.Snd.gotoAndPlay("P2Zap");
Symbol 96 MovieClip Frame 2
if (!_root.compAttack) {
gotoAndPlay (1);
}
Symbol 96 MovieClip Frame 10
stop();
_root.computerSelect();
Symbol 102 Button
on (release, keyPress "y") {
_root.gotoAndStop("Loaded");
}
Symbol 105 Button
on (release, keyPress "n") {
_visible = false;
}
Symbol 107 Button
on (release) {
gotoAndPlay ("GoBack");
}
Symbol 110 Button
on (release) {
_root.gotoAndStop("Loaded");
}
Symbol 111 MovieClip Frame 1
stop();
Symbol 111 MovieClip Frame 22
stop();
Symbol 111 MovieClip Frame 42
stop();
Symbol 111 MovieClip Frame 48
stop();
Symbol 114 MovieClip Frame 1
stop();