Frame 1
stop();
Instance of Symbol 5 MovieClip in Frame 1
onClipEvent (load) {
totalb = _root.getBytesTotal();
totalkb = int(totalb / 1024);
}
onClipEvent (enterFrame) {
var loadedb = _root.getBytesLoaded();
if (loadedb == totalb) {
_root.gotoAndStop(2);
} else {
loadedkb = int(loadedb / 1024);
percent = (loadedb / totalb) * 100;
_root.planimation.gotoAndStop(int(percent));
pl1 = ("" + int(percent)) + "%";
pl2 = ((("" + loadedkb) + " / ") + totalkb) + " kb";
}
}
Frame 2
level = 3;
walls = true;
tWalls = "on";
wormtype.gotoAndStop(3);
stop();
Frame 3
score = -level;
tail = 1;
head = 5;
xv = 0;
yv = 1;
x = 160;
y = 100;
eaten = true;
eatenb = true;
extend = false;
makeMove = false;
bonus = 0;
abonus = 0;
Frame 4
x = x + (10 * xv);
y = y + (10 * yv);
if (!walls) {
if (x < 30) {
x = 290;
}
if (290 < x) {
x = 30;
}
if (y < 30) {
y = 280;
}
if (280 < y) {
y = 30;
}
}
head++;
duplicateMovieClip ("Snake", head, head);
setProperty(head, _x , x);
setProperty(head, _y , y);
if ((((eval ((("s_" + x) + "_") + y) || (x < 30)) || (290 < x)) || (y < 30)) || (280 < y)) {
gotoAndStop ("Game Over");
}
Set((("s_" + x) + "_") + y, true);
if (extend) {
extend = false;
} else {
Set((("s_" + eval (tail)._x) + "_") + eval (tail)._y, false);
removeMovieClip(tail);
tail++;
}
if ((Food._x == x) && (Food._y == y)) {
eaten = true;
abonus++;
extend = true;
duplicateMovieClip ("spark", "s_" + head, head + 10);
setProperty("s_" + head, _x , x);
setProperty("s_" + head, _y , y);
}
if (((bFood._x == x) && (bFood._y == y)) && (bFood._visible == true)) {
eatenb = true;
extend = true;
duplicateMovieClip ("spark", "s_" + head, head + 10);
setProperty("s_" + head, _x , x);
setProperty("s_" + head, _y , y);
}
if (abonus == 5) {
bonus = level * 20;
bFood.gotoAndPlay(1);
bFood._visible = true;
abonus = 0;
}
if (eaten) {
eaten = false;
score = score + level;
tellTarget ("Food") {
_x = (10 * (random(26) + 3));
_y = (10 * (random(25) + 3));
};
while (eval ((("s_" + food._x) + "_") + food._y)) {
tellTarget ("Food") {
_x = (10 * (random(26) + 3));
_y = (10 * (random(25) + 3));
};
}
}
if (eatenb) {
eatenb = false;
score = score + bonus;
bonus = 0;
tellTarget ("bFood") {
_visible = false;
_x = (10 * (random(26) + 3));
_y = (10 * (random(25) + 3));
};
}
makeMove = false;
if (0 < bonus) {
bonus = bonus - (level / 5);
bonus = int(bonus);
} else {
bonus = "";
tellTarget ("bFood") {
_visible = false;
_x = (10 * (random(26) + 3));
_y = (10 * (random(25) + 3));
};
}
if (yv == -1) {
tellTarget (head) {
gotoAndStop ("HeadUp");
};
}
if (yv == 1) {
tellTarget (head) {
gotoAndStop ("HeadDown");
};
}
if (xv == -1) {
tellTarget (head) {
gotoAndStop ("HeadLeft");
};
}
if (xv == 1) {
tellTarget (head) {
gotoAndStop ("HeadRight");
};
}
if (dir == 1) {
tellTarget (head - 1) {
gotoAndStop ("TopLeft");
};
}
if (dir == 2) {
tellTarget (head - 1) {
gotoAndStop ("Left");
};
}
if (dir == 3) {
tellTarget (head - 1) {
gotoAndStop ("TopRight");
};
}
if (dir == 4) {
tellTarget (head - 1) {
gotoAndStop ("Up");
};
}
if (dir == 5) {
tellTarget (head - 1) {
gotoAndStop ("BottomRight");
};
}
if (dir == 6) {
tellTarget (head - 1) {
gotoAndStop ("Right");
};
}
if (dir == 7) {
tellTarget (head - 1) {
gotoAndStop ("BottomLeft");
};
}
if (dir == 8) {
tellTarget (head - 1) {
gotoAndStop ("Down");
};
}
if (2 < (head - tail)) {
if (getProperty(tail + 1, _currentframe) == 11) {
wTail = 1;
}
if (getProperty(tail + 1, _currentframe) == 12) {
wTail = 2;
}
if (getProperty(tail + 1, _currentframe) == 6) {
wTail = 3;
}
if (getProperty(tail + 1, _currentframe) == 7) {
wTail = 4;
}
if (getProperty(tail + 1, _currentframe) == 5) {
if (getProperty(tail + 2, _currentframe) == 12) {
wTail = 3;
}
if (getProperty(tail + 2, _currentframe) == 7) {
wTail = 1;
}
}
if (getProperty(tail + 1, _currentframe) == 8) {
if (getProperty(tail + 2, _currentframe) == 12) {
wTail = 4;
}
if (getProperty(tail + 2, _currentframe) == 6) {
wTail = 1;
}
}
if (getProperty(tail + 1, _currentframe) == 9) {
if (getProperty(tail + 2, _currentframe) == 11) {
wTail = 4;
}
if (getProperty(tail + 2, _currentframe) == 6) {
wTail = 2;
}
}
if (getProperty(tail + 1, _currentframe) == 10) {
if (getProperty(tail + 2, _currentframe) == 11) {
wTail = 3;
}
if (getProperty(tail + 2, _currentframe) == 7) {
wTail = 2;
}
}
if (wTail == 1) {
tellTarget (tail) {
gotoAndStop ("TailUp");
};
}
if (wTail == 2) {
tellTarget (tail) {
gotoAndStop ("TailDown");
};
}
if (wTail == 3) {
tellTarget (tail) {
gotoAndStop ("TailLeft");
};
}
if (wTail == 4) {
tellTarget (tail) {
gotoAndStop ("TailRight");
};
}
}
if (xv == 1) {
dir = 6;
}
if (xv == -1) {
dir = 2;
}
if (yv == 1) {
dir = 8;
}
if (yv == -1) {
dir = 4;
}
Frame 5
if (level == 5) {
gotoAndPlay ("GameAction");
}
Frame 6
if (level == 4) {
gotoAndPlay ("GameAction");
}
Frame 7
if (level == 3) {
gotoAndPlay ("GameAction");
}
Frame 8
if (level == 2) {
gotoAndPlay ("GameAction");
}
Frame 9
gotoAndPlay ("GameAction");
Frame 11
temp = head;
while (tail < (temp + 1)) {
setProperty(temp, _alpha , 33);
temp--;
}
Symbol 29 Button
on (release) {
if (1 < level) {
level--;
wormtype.gotoAndStop(level);
}
}
Symbol 31 Button
on (release) {
if (level < 5) {
level++;
_root.wormtype.gotoAndStop(level);
}
}
Symbol 37 MovieClip Frame 1
stop();
Symbol 41 Button
on (release) {
_root.gotoAndPlay("Init");
}
Symbol 45 Button
on (release) {
if (walls) {
walls = false;
tWalls = "off";
barrier._visible = false;
}
}
Symbol 46 Button
on (release) {
if (!walls) {
walls = true;
tWalls = "on";
barrier._visible = true;
}
}
Symbol 51 MovieClip Frame 37
stop();
Symbol 54 Button
on (keyPress "<Up>") {
if ((yv == 0) && (!makeMove)) {
if (xv == -1) {
dir = 7;
}
if (xv == 1) {
dir = 5;
}
yv = -1;
xv = 0;
makeMove = true;
}
}
on (keyPress "<Left>") {
if ((xv == 0) && (!makeMove)) {
if (yv == -1) {
dir = 3;
}
if (yv == 1) {
dir = 5;
}
yv = 0;
xv = -1;
makeMove = true;
}
}
on (keyPress "<Down>") {
if ((yv == 0) && (!makeMove)) {
if (xv == -1) {
dir = 1;
}
if (xv == 1) {
dir = 3;
}
yv = 1;
xv = 0;
makeMove = true;
}
}
on (keyPress "<Right>") {
if ((xv == 0) && (!makeMove)) {
if (yv == -1) {
dir = 1;
}
if (yv == 1) {
dir = 7;
}
yv = 0;
xv = 1;
makeMove = true;
}
}
on (keyPress "<Space>") {
temp = head;
while (tail < (temp + 1)) {
setProperty(temp, _alpha , 33);
temp--;
}
setProperty("Food", _alpha , 33);
gotoAndStop ("Paused");
}
Symbol 55 Button
on (keyPress "<Space>") {
temp = head;
while (Number(tail) < Number(Number(temp) + 1)) {
setProperty(temp, _alpha , 100);
temp = temp - 1;
}
setProperty("/Food", _alpha , 100);
gotoAndPlay ("GameAction");
}
Symbol 62 Button
on (release) {
temp = head;
while (tail < (temp + 1)) {
Set((("s_" add getProperty(temp, _x)) add "_") add getProperty(temp, _y), false);
removeMovieClip(temp);
temp--;
}
_root.gotoAndPlay("Init");
}
Symbol 64 Button
on (release) {
temp = head;
while (tail < (temp + 1)) {
Set((("s_" add getProperty(temp, _x)) add "_") add getProperty(temp, _y), false);
removeMovieClip(temp);
temp--;
}
_root.gotoAndPlay("menu");
}