Frame 1
level = 3;
walls = true;
tWalls = "on";
wormtype.gotoAndStop(3);
stop();
Frame 2
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 3
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 (10);
}
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 4
if (level == 5) {
gotoAndPlay (3);
}
Frame 5
if (level == 4) {
gotoAndPlay (3);
}
Frame 6
if (level == 3) {
gotoAndPlay (3);
}
Frame 7
if (level == 2) {
gotoAndPlay (3);
}
Frame 8
gotoAndPlay (3);
Frame 10
temp = head;
while (tail < (temp + 1)) {
setProperty(temp, _alpha , 33);
temp--;
}
Symbol 38 Button
on (release) {
_root.play();
}
Symbol 39 MovieClip Frame 1
_root.stop();
PercentLoaded = (_root.getBytesLoaded() / _root.getBytesTotal()) * 100;
if (PercentLoaded != 100) {
setProperty(bar, _xscale , PercentLoaded);
} else {
gotoAndStop (3);
}
Symbol 39 MovieClip Frame 2
gotoAndPlay (1);
Symbol 42 Button
on (release) {
_root.gotoAndPlay("Init");
}
Symbol 45 Button
on (release) {
if (1 < level) {
level--;
wormtype.gotoAndStop(level);
}
}
Symbol 47 Button
on (release) {
if (level < 5) {
level++;
_root.wormtype.gotoAndStop(level);
}
}
Symbol 53 MovieClip Frame 1
stop();
Symbol 55 Button
on (release) {
if (walls) {
walls = false;
tWalls = "off";
barrier._visible = false;
}
}
Symbol 56 Button
on (release) {
if (!walls) {
walls = true;
tWalls = "on";
barrier._visible = true;
}
}
Symbol 57 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 (9);
}
Symbol 69 Button
on (press) {
stopAllSounds();
}
Symbol 89 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 (3);
}
Symbol 97 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 100 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");
}
Symbol 101 Button
on (release) {
getURL ("http://www.shellsuit.pwp.blueyonder.co.uk", "_blank");
}