Frame 1
function PointInPoly(x, y, PolyX, PolyY) {
var Count = 0;
var n = PolyX.length;
var i = 0;
while (i < n) {
var j = ((i + 1) % n);
if (PolyY[i] == PolyY[j]) {
} else if ((y < PolyY[i]) and (y < PolyY[j])) {
} else if ((PolyY[i] < y) and (PolyY[j] < y)) {
} else if (Math.max(PolyY[i], PolyY[j]) == y) {
Count++;
} else if (Math.min(PolyY[i], PolyY[j]) == y) {
} else {
var t = ((y - PolyY[i]) / (PolyY[j] - PolyY[i]));
if (((0 < t) and (t < 1)) and ((PolyX[i] + (t * (PolyX[j] - PolyX[i]))) >= x)) {
Count++;
}
}
i++;
}
return((Count & 1) == 1);
}
function Crypto(st) {
var sum1 = 0;
var sum2 = 0;
var i = 0;
while (i < st.length) {
sum1 = sum1 + st.charCodeAt(i);
sum2 = sum2 + (st.charCodeAt(i) ^ 175);
i++;
}
sum1 = sum1 % 256;
sum2 = sum2 % 256;
st = (String.fromCharCode(sum1) + String.fromCharCode(sum2)) + st;
var cryptSt = "";
var b0 = 193;
var i = 0;
while (i < st.length) {
var b = st.charCodeAt(i);
var CryptB = (b ^ b0);
CryptB = CryptB.toString();
var len = CryptB.length;
var j = 0;
while (j < (3 - len)) {
CryptB = "0" + CryptB;
j++;
}
cryptSt = cryptSt + CryptB;
b0 = b;
i++;
}
return(cryptSt);
}
if (!initialized) {
initialized = true;
} else {
return(undefined);
}
fscommand ("showmenu", false);
stOut = "!";
MarioFriend = false;
MarioRight = true;
MarioMail = "";
opLevel = 0;
opSound = 0;
opAutoClear = 0;
Instance of Symbol 218 MovieClip "Form" in Frame 1
onClipEvent (mouseDown) {
if (!hitTest(_root._xmouse, _root._ymouse, false)) {
return(undefined);
}
var d = 50;
var dx = (d / 2);
var dy = (0.866 * d);
if (_root.PointInPoly(_root._xmouse, _root._ymouse, [_width / 4, (3 * _width) / 4, _width, (3 * _width) / 4, _width / 4, 0], [0, 0, _height / 2, _height, _height, _height / 2]) and (!_root.PointInPoly(_root._xmouse, _root._ymouse, [(_width / 4) + dx, ((3 * _width) / 4) - dx, _width - d, ((3 * _width) / 4) - dx, (_width / 4) + dx, d], [dy, dy, _height / 2, _height - dy, _height - dy, _height / 2]))) {
fscommand ("1");
}
}
onClipEvent (mouseUp) {
fscommand ("2");
}
Symbol 52 Button
on (release) {
if (!_root.MarioFriend) {
_root.HexBoard.ShowBuyMeWnd();
}
removeMovieClip("");
}
Symbol 54 Button
on (release) {
var Level = (_parent._parent.opLevel + 1);
var stSend = ((((((((stScore1 + "\t") + Level) + "\t") + stName1) + "\t") + "mbl") + "\t") + "exe");
getURL ("http://absolutist.com/cgi-bin/gameres.pl?e=" + _root.Crypto(stSend), "_top");
if (!_root.MarioFriend) {
_root.HexBoard.ShowBuyMeWnd();
}
removeMovieClip("");
}
Symbol 56 Button
on (release) {
getURL ("http://absolutist.com/cgi-bin/screen.pl/games.shtml?r=m&c=b");
if (!_root.MarioFriend) {
_root.HexBoard.ShowBuyMeWnd();
}
}
Symbol 71 Button
on (release) {
fscommand ("110", (stMail + "\t") + stKey);
if (!_root.MarioRight) {
_root.HexBoard.ShowHelpWnd();
}
removeMovieClip("");
}
Symbol 73 Button
on (release) {
if (!_root.MarioRight) {
_root.HexBoard.ShowHelpWnd();
}
removeMovieClip("");
}
Symbol 93 Button
on (release) {
getURL ("http://absolutist.com/mlines/index.shtml#register", "_top");
if (!_root.MarioRight) {
_root.HexBoard.ShowHelpWnd();
}
removeMovieClip("");
}
Symbol 95 Button
on (release) {
if (!_root.MarioRight) {
_root.HexBoard.ShowHelpWnd();
}
removeMovieClip("");
}
Symbol 97 Button
on (release) {
_root.HexBoard.ShowKeyWnd();
}
Symbol 101 Button
on (release) {
fscommand ("exit");
fscommand ("quit");
removeMovieClip("");
}
Symbol 102 Button
on (release) {
if (!_root.MarioFriend) {
_root.HexBoard.ShowBuyMeWnd();
}
removeMovieClip("");
}
Symbol 106 Button
on (release) {
if (_parent._parent.opLevel == 0) {
stLevel = "Level Novice";
_parent._parent.stLevel = "Level Novice";
}
if (_parent._parent.opLevel == 1) {
stLevel = "Level Expert";
_parent._parent.stLevel = "Level Expert";
}
if (_parent._parent.opLevel == 2) {
stLevel = "Level Master";
_parent._parent.stLevel = "Level Master";
}
if (oldLevel != _parent._parent.opLevel) {
_parent.Init();
}
if (!_root.MarioFriend) {
_root.HexBoard.ShowBuyMeWnd();
}
removeMovieClip("");
}
Symbol 110 Button
on (release) {
_parent._parent.opLevel++;
if (2 < _parent._parent.opLevel) {
_parent._parent.opLevel = 0;
}
if (_parent._parent.opLevel == 0) {
stLevel = "Level Novice";
}
if (_parent._parent.opLevel == 1) {
stLevel = "Level Expert";
}
if (_parent._parent.opLevel == 2) {
stLevel = "Level Master";
}
}
Symbol 113 Button
on (release) {
_parent._parent.opSound++;
if (1 < _parent._parent.opSound) {
_parent._parent.opSound = 0;
}
if (_parent._parent.opSound == 0) {
stSound = "Sound On";
}
if (_parent._parent.opSound == 1) {
stSound = "Sound Off";
}
}
Symbol 116 Button
on (release) {
_parent._parent.opAutoClear++;
if (1 < _parent._parent.opAutoClear) {
_parent._parent.opAutoClear = 0;
}
if (_parent._parent.opAutoClear == 0) {
stClear = "Auto Clear On";
}
if (_parent._parent.opAutoClear == 1) {
stClear = "Auto Clear Off";
}
}
Symbol 117 MovieClip [wndOptions] Frame 1
if (_parent._parent.opLevel == 0) {
stLevel = "Level Novice";
_parent._parent.stLevel = "Level Novice";
}
if (_parent._parent.opLevel == 1) {
stLevel = "Level Expert";
_parent._parent.stLevel = "Level Expert";
}
if (_parent._parent.opLevel == 2) {
stLevel = "Level Master";
_parent._parent.stLevel = "Level Master";
}
oldLevel = _parent._parent.opLevel;
if (_parent._parent.opSound == 0) {
stSound = "Sound On";
}
if (_parent._parent.opSound == 1) {
stSound = "Sound Off";
}
if (_parent._parent.opAutoClear == 0) {
stClear = "Auto Clear On";
}
if (_parent._parent.opAutoClear == 1) {
stClear = "Auto Clear Off";
}
Symbol 123 Button
on (release) {
var month = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
var now = new Date();
var dt = (((((1900 + now.getYear()) + "-") + month[now.getMonth()]) + "-") + now.getDate());
var kind = "(n) ";
if (_root.opLevel == 1) {
kind = "(e) ";
}
if (_root.opLevel == 2) {
kind = "(m) ";
}
fscommand ("score", ((((dt + "\t") + kind) + stName) + "\t") + _root.stScore);
_parent.Init();
if (!_root.MarioFriend) {
_root.HexBoard.ShowBuyMeWnd();
}
removeMovieClip("");
}
Symbol 124 Button
on (release) {
_parent.Init();
if (!_root.MarioFriend) {
_root.HexBoard.ShowBuyMeWnd();
}
removeMovieClip("");
}
Symbol 127 Button
on (release) {
if (!_root.MarioFriend) {
_root.HexBoard.ShowBuyMeWnd();
}
removeMovieClip("");
}
Instance of Symbol 136 MovieClip in Symbol 139 MovieClip Frame 1
onClipEvent (mouseDown) {
if ((!hitTest(_root._xmouse, _root._ymouse, false)) or _parent._parent.Moving) {
return(undefined);
}
if ((_ymouse >= ((3 * _height) / 8)) or (_height < ((-3 * _height) / 8))) {
return(undefined);
}
if (_parent._parent.Checked == _parent) {
return(undefined);
}
if (_parent.isBall) {
if (4 < _parent.Ball._currentframe) {
return(undefined);
}
_parent._parent.StartK = _parent;
_parent._parent.Checked.Ball.gotoAndStop("Stand");
_parent._parent.Checked = _parent;
var b = _parent.Ball;
b.gotoAndPlay("Jump");
return(undefined);
}
_parent._parent.FinishK = _parent;
if (_parent._parent.Checked) {
_parent._parent.CreateParh();
}
}
Instance of Symbol 136 MovieClip in Symbol 142 MovieClip Frame 1
onClipEvent (mouseDown) {
if ((!hitTest(_root._xmouse, _root._ymouse, false)) or _parent._parent.Moving) {
return(undefined);
}
if ((_ymouse >= ((3 * _height) / 8)) or (_height < ((-3 * _height) / 8))) {
return(undefined);
}
if (_parent._parent.Checked == _parent) {
return(undefined);
}
if (_parent.isBall) {
if (4 < _parent.Ball._currentframe) {
return(undefined);
}
_parent._parent.StartK = _parent;
_parent._parent.Checked.Ball.gotoAndStop("Stand");
_parent._parent.Checked = _parent;
var b = _parent.Ball;
b.gotoAndPlay("Jump");
return(undefined);
}
_parent._parent.FinishK = _parent;
if (_parent._parent.Checked) {
_parent._parent.CreateParh();
}
}
Symbol 156 Button
on (release) {
getURL ("http://absolutist.com/cgi-bin/screen.pl/games.shtml?r=l&c=b");
if (!_root.MarioRight) {
_root.HexBoard.ShowHelpWnd();
}
}
Symbol 160 Button
on (release) {
getURL ("http://absolutist.com/cgi-bin/screen.pl/ssaver?r=l&c=b");
if (!_root.MarioRight) {
_root.HexBoard.ShowHelpWnd();
}
}
Symbol 164 Button
on (release) {
getURL ("http://absolutist.com/cgi-bin/screen.pl/online?r=l&c=b");
if (!_root.MarioRight) {
_root.HexBoard.ShowHelpWnd();
}
}
Symbol 179 MovieClip [HexBall4] Frame 5
stop();
Symbol 179 MovieClip [HexBall4] Frame 24
gotoAndPlay (6);
Symbol 179 MovieClip [HexBall4] Frame 30
removeMovieClip("");
stop();
Symbol 181 MovieClip [HexBall5] Frame 5
stop();
Symbol 181 MovieClip [HexBall5] Frame 24
gotoAndPlay (6);
Symbol 181 MovieClip [HexBall5] Frame 30
removeMovieClip("");
stop();
Symbol 183 MovieClip [HexBall9] Frame 5
stop();
Symbol 183 MovieClip [HexBall9] Frame 24
gotoAndPlay (6);
Symbol 183 MovieClip [HexBall9] Frame 30
removeMovieClip("");
stop();
Symbol 185 MovieClip [HexBall1] Frame 5
stop();
Symbol 185 MovieClip [HexBall1] Frame 24
gotoAndPlay (6);
Symbol 185 MovieClip [HexBall1] Frame 30
removeMovieClip("");
stop();
Symbol 187 MovieClip [HexBall6] Frame 5
stop();
Symbol 187 MovieClip [HexBall6] Frame 24
gotoAndPlay (6);
Symbol 187 MovieClip [HexBall6] Frame 30
removeMovieClip("");
stop();
Symbol 189 MovieClip [HexBall8] Frame 5
stop();
Symbol 189 MovieClip [HexBall8] Frame 24
gotoAndPlay (6);
Symbol 189 MovieClip [HexBall8] Frame 30
removeMovieClip("");
stop();
Symbol 191 MovieClip [HexBall3] Frame 5
stop();
Symbol 191 MovieClip [HexBall3] Frame 24
gotoAndPlay (6);
Symbol 191 MovieClip [HexBall3] Frame 30
removeMovieClip("");
stop();
Symbol 192 MovieClip [HexBall2] Frame 5
stop();
Symbol 192 MovieClip [HexBall2] Frame 24
gotoAndPlay (6);
Symbol 192 MovieClip [HexBall2] Frame 30
removeMovieClip("");
stop();
Symbol 194 MovieClip [HexBall7] Frame 5
stop();
Symbol 194 MovieClip [HexBall7] Frame 24
gotoAndPlay (6);
Symbol 194 MovieClip [HexBall7] Frame 30
removeMovieClip("");
stop();
Instance of Symbol 221 MovieClip in Symbol 223 MovieClip Frame 1
onClipEvent (mouseDown) {
if ((!hitTest(_root._xmouse, _root._ymouse, false)) or _parent._parent.Moving) {
return(undefined);
}
if ((_ymouse >= ((3 * _height) / 8)) or (_height < ((-3 * _height) / 8))) {
return(undefined);
}
if (_parent._parent.Checked == _parent) {
return(undefined);
}
if ((!_parent._parent.Checked) and (!_parent.isBall)) {
return(undefined);
}
if ((((((_parent._parent.wndScoreSaveUp or _parent._parent.wndHelpUp) or _parent._parent.wndScoreTableUp) or _parent._parent.wndExitUp) or _parent._parent.wndBuyMeUp) or _parent._parent.wndOptionsUp) or _parent._parent.wndKeyUp) {
return(undefined);
}
if (_parent.isBall) {
if (5 < _parent.Ball._currentframe) {
return(undefined);
}
_parent._parent.StartK = _parent;
_parent._parent.Checked.Ball.gotoAndStop("Stand");
_parent._parent.Checked = _parent;
var b = _parent.Ball;
b.gotoAndPlay("Jump");
return(undefined);
}
_parent._parent.FinishK = _parent;
if (_parent._parent.Checked) {
_parent._parent.CreateParh();
}
_parent._parent.MarioFrame = 1;
}
onClipEvent (keyDown) {
if (Key.isDown(Key.DOWN)) {
trace(_parent._parent.Checked);
}
}
Symbol 224 MovieClip Frame 1
function Init() {
var i = 0;
while (i < NumCells) {
var cell = eval ("c" + i);
if (cell.isBall) {
cell.Ball.color = 0;
cell.Ball.gotoAndPlay("Die");
}
cell.isBall = false;
i++;
}
BallsOnBoard = 0;
_parent.stScore = "0";
Moving = false;
AddNew = false;
TimeLast = getTimer();
TimeLastNew = getTimer();
TimeNewDelay = 5000;
addNewBalls(AddNum);
}
function AddNewBalls() {
var Num = 1;
if (_parent.opLevel == 0) {
if (BallsOnBoard < 1) {
Num = 10;
} else if (BallsOnBoard < 10) {
Num = 5;
} else if (BallsOnBoard < 20) {
Num = 3;
} else if (BallsOnBoard < 25) {
Num = 3;
} else if (BallsOnBoard < 30) {
Num = 2;
} else if (BallsOnBoard < 40) {
Num = 2;
} else if (BallsOnBoard < 50) {
Num = 1;
}
} else if (_parent.opLevel == 1) {
if (BallsOnBoard < 1) {
Num = 20;
} else if (BallsOnBoard < 10) {
Num = 15;
} else if (BallsOnBoard < 20) {
Num = 10;
} else if (BallsOnBoard < 25) {
Num = 5;
} else if (BallsOnBoard < 30) {
Num = 3;
} else if (BallsOnBoard < 40) {
Num = 2;
} else if (BallsOnBoard < 50) {
Num = 1;
}
} else if (_parent.opLevel == 2) {
if (BallsOnBoard < 1) {
Num = 30;
} else if (BallsOnBoard < 10) {
Num = 20;
} else if (BallsOnBoard < 20) {
Num = 15;
} else if (BallsOnBoard < 25) {
Num = 10;
} else if (BallsOnBoard < 30) {
Num = 7;
} else if (BallsOnBoard < 40) {
Num = 5;
} else if (BallsOnBoard < 50) {
Num = 3;
}
}
if (1000 < Number(_parent.stScore)) {
NumColors = 9;
Num = int(Num * 3.5);
} else if (900 < Number(_parent.stScore)) {
NumColors = 9;
Num = Num * 3;
} else if (800 < Number(_parent.stScore)) {
NumColors = 9;
Num = int(Num * 3.5);
} else if (700 < Number(_parent.stScore)) {
NumColors = 9;
Num = Num * 3;
} else if (600 < Number(_parent.stScore)) {
NumColors = 9;
Num = int(Num * 2.5);
} else if (500 < Number(_parent.stScore)) {
NumColors = 9;
Num = Num * 2;
} else if (400 < Number(_parent.stScore)) {
NumColors = 9;
Num = int(Num * 1.5);
} else if (300 < Number(_parent.stScore)) {
NumColors = 9;
} else if (200 < Number(_parent.stScore)) {
NumColors = 8;
} else if (100 < Number(_parent.stScore)) {
NumColors = 7;
} else if (50 < Number(_parent.stScore)) {
NumColors = 6;
} else {
NumColors = 5;
}
var i = 0;
while (i < Num) {
var n = 0;
var k = 0;
while (k < NumCells) {
if (!eval ("c" + k).isBall) {
FreeK[n++] = "c" + k;
}
k++;
}
if (n == 0) {
var j = 0;
while (j < i) {
ClearLines(BallsK[j]);
j++;
}
if (i == 0) {
ShowScoreSaveWnd(Number(_parent.stScore));
if (Checked) {
Checked.gotoAndStop("Stand");
}
}
return(undefined);
}
var color = (random(NumColors) + 1);
var k = FreeK[random(n)];
var cell = eval (k);
cell.attachMovie("HexBall" + color, "Ball", 1);
cell.Ball._width = cell._width * 0.4;
cell.Ball._height = cell._height * 0.4;
cell.Ball.color = color;
cell.isBall = true;
BallsK[i] = eval (k);
BallsOnBoard++;
i++;
}
if (_parent.opAutoClear == 0) {
var i = 0;
while (i < Num) {
ClearLines(BallsK[i]);
i++;
}
}
TimeLastNew = getTimer();
_parent.stBalls = BallsOnBoard;
}
function CreateParh() {
var k = 0;
while (k < NumCells) {
var cell = eval ("c" + k);
if (cell.isBall) {
cell.Dist = -1;
} else {
cell.Dist = 0;
}
k++;
}
StartK.Dist = 0;
FinishK.Dist = 1;
var Path = [FinishK];
var Depth = 2;
while (Depth < 100) {
var len = Path.length;
var j = 0;
while (j < len) {
var k = Path.shift();
var i = 0;
while (i < k.Near.length) {
if (k.Near[i].Dist != 0) {
} else {
k.Near[i].Dist = Depth;
if (k.Near[i] == StartK) {
Moving = true;
MarioStep = 99;
return(undefined);
}
Path.push(k.Near[i]);
}
i++;
}
j++;
}
if (Path.length == 0) {
Moving = false;
return(undefined);
}
Depth++;
}
trace("Path found error!");
}
function gotoNextCell(k) {
MarioStep++;
MarioStepMax = 5;
if (MarioStep < MarioStepMax) {
Mario._x = MarioX1 + (MarioDx * MarioStep);
Mario._y = MarioY1 + (MarioDy * MarioStep);
MBall._x = (MarioX1 + (MarioDx * MarioStep)) + dMBallX;
MBall._y = (MarioY1 + (MarioDy * MarioStep)) + dMBallY;
} else {
if (isSound._visible) {
SoundJump.start();
}
if (StartK == FinishK) {
removeMovieClip("Mario");
removeMovieClip("MBall");
StartK.attachMovie("HexBall" + colorMovingBall, "Ball", 1);
StartK.Ball._width = StartK._width * 0.4;
StartK.Ball._height = StartK._height * 0.4;
StartK.Ball.color = colorMovingBall;
StartK.Ball.gotoAndPlay("Stand");
Checked = null;
StartK.isBall = true;
return(undefined);
}
var Kmin = FinishK;
var Min = 1000000;
var Imin = 0;
var i = 0;
while (i < k.Near.length) {
if ((k.Near[i].Dist < Min) and (0 < k.Near[i].Dist)) {
Min = k.Near[i].Dist;
Kmin = k.Near[i];
Imin = i;
}
i++;
}
if (MarioStep == 100) {
colorMovingBall = StartK.Ball.color;
StartK.Ball.gotoAndPlay("End");
StartK.isBall = false;
ShowMario(Imin);
}
MarioX1 = StartK._x;
MarioY1 = StartK._y;
StartK = Kmin;
if ((Imin == 0) or (Imin == 3)) {
NewMarioKind = 1;
} else if ((Imin == 4) or (Imin == 5)) {
NewMarioKind = 2;
} else if ((Imin == 1) or (Imin == 2)) {
NewMarioKind = 3;
}
if (NewMarioKind != MarioKind) {
removeMovieClip("Mario");
removeMovieClip("MBall");
ShowMario(Imin);
}
if (((Imin == 0) or (Imin == 1)) or (Imin == 5)) {
Mario._xscale = Math.abs(Mario._xscale);
dMBallX = Math.abs(dMBallX);
} else {
Mario._xscale = -Math.abs(Mario._xscale);
dMBallX = -Math.abs(dMBallX);
}
MarioX2 = StartK._x;
MarioY2 = StartK._y;
MarioDx = (MarioX2 - MarioX1) / MarioStepMax;
MarioDy = (MarioY2 - MarioY1) / MarioStepMax;
Mario._x = MarioX1;
Mario._y = MarioY1;
MBall._x = MarioX1 + dMBallX;
MBall._y = MarioY1 + dMBallY;
MarioStep = 0;
}
}
function ShowMario(Imin) {
if (!Checked) {
return(undefined);
}
if ((Imin == 0) or (Imin == 3)) {
attachMovie("HexBall" + colorMovingBall, "MBall", 1000);
attachMovie("MarioGoRight", "Mario", 1001);
dMBallX = 25;
dMBallY = -10;
MarioKind = 1;
} else if ((Imin == 4) or (Imin == 5)) {
attachMovie("HexBall" + colorMovingBall, "MBall", 1000);
attachMovie("MarioGoUp", "Mario", 1001);
dMBallX = 15;
dMBallY = -15;
MarioKind = 2;
} else if ((Imin == 1) or (Imin == 2)) {
attachMovie("HexBall" + colorMovingBall, "MBall", 1000);
attachMovie("MarioGoRight", "Mario", 1001);
dMBallX = 25;
dMBallY = -10;
MarioKind = 3;
}
MBall.gotoAndStop("Stand");
Mario._xscale = (Mario._yscale = 40);
MBall._xscale = (MBall._yscale = 40);
}
function ClearTriangle(cell1, cell2, color) {
var n = 1;
if ((cell1.Ball.color == color) and (cell2.Ball.color == color)) {
DelK[n++] = cell1;
DelK[n++] = cell2;
Score = Score + 1;
DelBalls(1, n);
}
}
function ClearFour(cell1, cell2, cell3, color) {
var n = 1;
if (((cell1.Ball.color == color) and (cell2.Ball.color == color)) and (cell3.Ball.color == color)) {
DelK[n++] = cell1;
DelK[n++] = cell2;
DelK[n++] = cell3;
Score = Score + 2;
DelBalls(1, n);
}
}
function ClearCircle(k, color) {
var i = 0;
while (i < 6) {
var n = 1;
var cur = k.Near[i];
if (((cur == null) or (!cur.isBall)) or (cur.Ball.color != color)) {
} else {
DelK[n++] = cur;
var j = 1;
while (j < 5) {
cur = cur.Near[(i + j) % 6];
if ((cur == null) or (!cur.isBall)) {
break;
}
if (cur.Ball.color == color) {
DelK[n++] = cur;
}
j++;
}
if (n == 6) {
var center = k.Near[(i + 1) % 6];
if (center.isBall) {
DelK[n++] = center;
Score = Score + 32;
} else {
Score = Score + 8;
}
DelBalls(1, n);
}
}
i++;
}
}
function ClearLine(k, direction, color) {
var n = 1;
var j = 0;
while (j < 2) {
var cur = k;
var i = 0;
while (i < MaxNumLine) {
cur = cur.Near[direction[j]];
if (((cur == null) or (!cur.isBall)) or (cur.Ball.color != color)) {
break;
}
DelK[n++] = cur;
i++;
}
j++;
}
if (n == 5) {
Score = Score + 4;
DelBalls(1, n);
return(undefined);
}
if (n == 6) {
Score = Score + 16;
DelBalls(1, n);
return(undefined);
}
if (n == 7) {
Score = Score + 64;
DelBalls(1, n);
return(undefined);
}
if (n == 8) {
Score = Score + 128;
DelBalls(1, n);
return(undefined);
}
if (n == 9) {
Score = Score + 256;
DelBalls(1, n);
return(undefined);
}
}
function ClearLines(k) {
var color = k.Ball.color;
if (!k.isBall) {
return(0);
}
DelK[0] = k;
totN = 0;
Score = 0;
ClearCircle(k, color);
ClearLine(k, [0, 3], color);
ClearLine(k, [1, 4], color);
ClearLine(k, [5, 2], color);
ClearFour(k.Near[0], k.Near[2], k.Near[4], color);
ClearFour(k.Near[1], k.Near[1].Near[0], k.Near[1].Near[2], color);
ClearFour(k.Near[3], k.Near[3].Near[2], k.Near[3].Near[4], color);
ClearFour(k.Near[5], k.Near[5].Near[0], k.Near[5].Near[4], color);
ClearFour(k.Near[1], k.Near[3], k.Near[5], color);
ClearFour(k.Near[0], k.Near[0].Near[1], k.Near[0].Near[5], color);
ClearFour(k.Near[2], k.Near[2].Near[1], k.Near[2].Near[3], color);
ClearFour(k.Near[4], k.Near[4].Near[3], k.Near[4].Near[5], color);
ClearFour(k.Near[2], k.Near[3], k.Near[4], color);
ClearFour(k.Near[0], k.Near[1], k.Near[5], color);
ClearFour(k.Near[1], k.Near[2], k.Near[1].Near[2], color);
ClearFour(k.Near[4], k.Near[5], k.Near[4].Near[5], color);
ClearFour(k.Near[0], k.Near[1], k.Near[2], color);
ClearFour(k.Near[3], k.Near[4], k.Near[5], color);
ClearFour(k.Near[2], k.Near[3], k.Near[2].Near[3], color);
ClearFour(k.Near[0], k.Near[5], k.Near[0].Near[5], color);
ClearFour(k.Near[1], k.Near[2], k.Near[3], color);
ClearFour(k.Near[4], k.Near[5], k.Near[0], color);
ClearFour(k.Near[3], k.Near[4], k.Near[3].Near[4], color);
ClearFour(k.Near[0], k.Near[1], k.Near[0].Near[1], color);
if (0 < totN) {
if (isSound._visible) {
SoundDie.start();
}
DelBalls(0, 1);
_parent.stScore = Number(_parent.stScore) + Score;
if (((!_root.MarioFriend) and (250 < Number(_parent.stScore))) and ((Number(_parent.stScore) % 50) == 0)) {
_root.HexBoard.ShowBuyMeWnd();
}
}
_parent.stBalls = BallsOnBoard;
return(totN);
}
function DelBalls(i0, n) {
var i = i0;
while (i < n) {
var b = DelK[i];
b.isBall = false;
b.Ball.color = 0;
b.Ball.gotoAndPlay("Die");
if (Checked == b) {
Checked = null;
}
BallsOnBoard--;
i++;
}
totN = totN + n;
if (_parent.opSound == 0) {
SoundDie.start();
}
}
function ShowOptionsWnd(Score) {
if (wndOptionsUp) {
HideOptionsWnd();
return(undefined);
}
attachMovie("wndOptions", "wndOptionsUp", 1000000);
wndOptionsUp._x = 0;
wndOptionsUp._y = 0;
fscommand ("names");
Checked.Ball.gotoAndStop("Stand");
fscommand ("paint");
}
function HideOptionsWnd() {
removeMovieClip("wndOptionsUp");
fscommand ("paint");
}
function ShowScoreSaveWnd(Score) {
if (wndScoreSaveUp) {
HideScoreSaveWnd();
return(undefined);
}
attachMovie("wndScoreSave", "wndScoreSaveUp", 1000000);
wndScoreSaveUp.stYourScore = "Your score is " + Score;
wndScoreSaveUp._x = 0;
wndScoreSaveUp._y = 0;
if (_parent.opLevel == 0) {
fscommand ("names", "n");
}
if (_parent.opLevel == 1) {
fscommand ("names", "e");
}
if (_parent.opLevel == 2) {
fscommand ("names", "m");
}
Checked.Ball.gotoAndStop("Stand");
fscommand ("paint");
}
function HideScoreSaveWnd() {
removeMovieClip("wndScoreSaveUp");
fscommand ("paint");
}
function ShowScoreTableWnd() {
if (wndScoreTableUp) {
HideScoreTableWnd();
return(undefined);
}
attachMovie("wndScoreTable", "wndScoreTableUp", 1000000);
wndScoreTableUp._x = 0;
wndScoreTableUp._y = 0;
Checked.Ball.gotoAndStop("Stand");
if (_parent.opLevel == 0) {
fscommand ("getscore", "n");
}
if (_parent.opLevel == 1) {
fscommand ("getscore", "e");
}
if (_parent.opLevel == 2) {
fscommand ("getscore", "m");
}
fscommand ("paint");
}
function HideScoreTableWnd() {
removeMovieClip("wndScoreTableUp");
fscommand ("paint");
}
function ShowExitWnd() {
if (wndExitUp) {
HideExitWnd();
return(undefined);
}
attachMovie("wndExit", "wndExitUp", 1000000);
wndExitUp._x = 0;
wndExitUp._y = 0;
Checked.Ball.gotoAndStop("Stand");
fscommand ("paint");
}
function HideExitWnd() {
removeMovieClip("wndExitUp");
fscommand ("paint");
}
function ShowHelpWnd() {
if (wndHelpUp) {
HideHelpWnd();
return(undefined);
}
attachMovie("wndHelp", "wndHelpUp", 1000000);
wndHelpUp._x = 0;
wndHelpUp._y = 0;
if (_parent.MarioFriend) {
wndHelpUp.stReg = "Registered to\n" + _parent.MarioMail;
} else {
wndHelpUp.stReg = "Unregistered";
}
fscommand ("paint");
}
function HideHelpWnd() {
removeMovieClip("wndHelpUp");
fscommand ("paint");
}
function ShowBuyMeWnd() {
if (wndBuyMeUp) {
HideBuyMeWnd();
return(undefined);
}
attachMovie("wndBuyMe", "wndBuyMeUp", 1000000);
wndBuyMeUp._x = 0;
wndBuyMeUp._y = 0;
fscommand ("paint");
}
function HideBuyMeWnd() {
removeMovieClip("wndBuyMeUp");
fscommand ("paint");
}
function ShowKeyWnd() {
if (wndKeyUp) {
HideKeyWnd();
return(undefined);
}
attachMovie("wndKey", "wndKeyUp", 1000000);
wndKeyUp._x = 0;
wndKeyUp._y = 0;
fscommand ("paint");
}
function HideKeyWnd() {
removeMovieClip("wndKeyUp");
fscommand ("paint");
}
function ShowBoard() {
var k = 0;
while (k < NumCells) {
var cell = eval ("c" + k);
cell.stNum = cell.Dist;
k++;
}
}
if (!initialized) {
initialized = true;
} else {
return(undefined);
}
DelNum = 5;
NumColors = 5;
AddNum = 2;
NumCells = 61;
MaxNumLine = 9;
MaxNumColors = 7;
MaxNumCells = 100;
TimeNewDelay = 5000;
FreeK = new Array(MaxNumCells);
DelK = new Array(MaxNumCells);
BallsK = new Array(10);
PlayerName = "";
NumOjects = 0;
StartBanerTime = getTimer();
SoundJump = new Sound();
SoundJump.attachSound("WavJump");
SoundJump.stop();
SoundDie = new Sound();
SoundDie.attachSound("WavDie");
SoundDie.stop();
c0.Near = [c1, c2, c3, c4, c5, c6];
c1.Near = [c7, c8, c2, c0, c6, c18];
c2.Near = [c8, c9, c10, c3, c0, c1];
c3.Near = [c2, c10, c11, c12, c4, c0];
c4.Near = [c0, c3, c12, c13, c14, c5];
c5.Near = [c6, c0, c4, c14, c15, c16];
c6.Near = [c18, c1, c0, c5, c16, c17];
c7.Near = [c19, c20, c8, c1, c18, c36];
c8.Near = [c20, c21, c9, c2, c1, c7];
c9.Near = [c21, c22, c23, c10, c2, c8];
c10.Near = [c9, c23, c24, c11, c3, c2];
c11.Near = [c10, c24, c25, c26, c12, c3];
c12.Near = [c3, c11, c26, c27, c13, c4];
c13.Near = [c4, c12, c27, c28, c29, c14];
c14.Near = [c5, c4, c13, c29, c30, c15];
c15.Near = [c16, c5, c14, c30, c31, c32];
c16.Near = [c17, c6, c5, c15, c32, c33];
c17.Near = [c35, c18, c6, c16, c33, c34];
c18.Near = [c36, c7, c1, c6, c17, c35];
c19.Near = [c37, c38, c20, c7, c36, c60];
c20.Near = [c38, c39, c21, c8, c7, c19];
c21.Near = [c39, c40, c22, c9, c8, c20];
c22.Near = [c40, c41, c42, c23, c9, c21];
c23.Near = [c22, c42, c43, c24, c10, c9];
c24.Near = [c23, c43, c44, c25, c11, c10];
c25.Near = [c24, c44, c45, c46, c26, c11];
c26.Near = [c11, c25, c46, c47, c27, c12];
c27.Near = [c12, c26, c47, c48, c28, c13];
c28.Near = [c13, c27, c48, c49, c50, c29];
c29.Near = [c14, c13, c28, c50, c51, c30];
c30.Near = [c15, c14, c29, c51, c52, c31];
c31.Near = [c32, c15, c30, c52, c53, c54];
c32.Near = [c33, c16, c15, c31, c54, c55];
c33.Near = [c34, c17, c16, c32, c55, c56];
c34.Near = [c58, c35, c17, c33, c56, c57];
c35.Near = [c59, c36, c18, c17, c34, c58];
c36.Near = [c60, c19, c7, c18, c35, c59];
c37.Near = [null, null, c38, c19, c60, null];
c38.Near = [null, null, c39, c20, c19, c37];
c39.Near = [null, null, c40, c21, c20, c38];
c40.Near = [null, null, c41, c22, c21, c39];
c41.Near = [null, null, null, c42, c22, c40];
c42.Near = [c41, null, null, c43, c23, c22];
c43.Near = [c42, null, null, c44, c24, c23];
c44.Near = [c43, null, null, c45, c25, c24];
c45.Near = [c44, null, null, null, c46, c25];
c46.Near = [c25, c45, null, null, c47, c26];
c47.Near = [c26, c46, null, null, c48, c27];
c48.Near = [c27, c47, null, null, c49, c28];
c49.Near = [c28, c48, null, null, null, c50];
c50.Near = [c29, c28, c49, null, null, c51];
c51.Near = [c30, c29, c50, null, null, c52];
c52.Near = [c31, c30, c51, null, null, c53];
c53.Near = [c54, c31, c52, null, null, null];
c54.Near = [c55, c32, c31, c53, null, null];
c55.Near = [c56, c33, c32, c54, null, null];
c56.Near = [c57, c34, c33, c55, null, null];
c57.Near = [null, c58, c34, c56, null, null];
c58.Near = [null, c59, c35, c34, c57, null];
c59.Near = [null, c60, c36, c35, c58, null];
c60.Near = [null, c37, c19, c36, c59, null];
fscommand ("par");
Init();
ShowHelpWnd();
Symbol 224 MovieClip Frame 3
if (wndHelpUp) {
if (_parent.MarioFriend and (wndHelpUp.stReg == "Unregistered")) {
wndHelpUp.stReg = "Registered to\n" + _parent.MarioMail;
}
}
if ((Moving and (StartK == FinishK)) and (MarioStep >= MarioStepMax)) {
if (ClearLines(FinishK) == 0) {
AddNew = true;
}
TimeLastNew = getTimer();
Checked = null;
Moving = false;
}
if (Moving) {
gotoNextCell(StartK);
}
if (AddNew and (!Moving)) {
AddNewBalls(AddNum);
AddNew = false;
TimeLastNew = (TimeLast = getTimer());
}
if (((1000 < (getTimer() - TimeLast)) and (!Moving)) and (!wndScoreSaveUp)) {
var n = 0;
var k = 0;
while (k < NumCells) {
if (!eval ("c" + k).isBall) {
n++;
}
k++;
}
if (n == 0) {
AddNewBalls(AddNum);
Score = Number(Score) + 100;
} else if (n == NumCells) {
ShowScoreSaveWnd(Number(_parent.Score));
if (Checked) {
Checked.gotoAndStop("Stand");
}
}
TimeLast = getTimer();
}
prevFrame();
play();
Symbol 233 Button
on (release) {
HexBoard.ShowExitWnd();
}
Symbol 237 Button
on (release) {
if (!_root.MarioRight) {
return(undefined);
}
HexBoard.ShowHelpWnd();
}
Symbol 241 Button
on (release) {
HexBoard.ShowScoreTableWnd();
}
Symbol 246 Button
on (release) {
fscommand ("down");
}
Symbol 248 Button
on (release) {
fscommand ("small");
}
Symbol 255 Button
on (release) {
HexBoard.ShowOptionsWnd();
}
Symbol 259 Button
on (release) {
HexBoard.Init();
}