Frame 1
_root.lineStyle(1, 4539717, 100);
var i = 0;
i = 0;
while (i < 27) {
_root.moveTo(0, 15 * i);
_root.lineTo(555, 15 * i);
i++;
}
var i = 0;
i = 0;
while (i < 37) {
_root.moveTo(15 * i, 0);
_root.lineTo(15 * i, 405);
i++;
}
Frame 2
function protectMovie() {
Stage.showMenu = false;
this_url = _root._url;
good_url = new String("lethalgfx.rendot");
if (this_url.indexOf(good_url) == -1) {
gotoAndStop ("bad");
}
}
stop();
Frame 3
function onEnterFrame() {
if (Key.isDown(38)) {
dir = 1;
} else if (Key.isDown(40)) {
dir = 2;
} else if (Key.isDown(37)) {
dir = 3;
} else if (Key.isDown(39)) {
dir = 4;
}
timer++;
if (timer == doMove) {
timer = 0;
move();
}
}
function move() {
if (endGame == false) {
ui._visible = true;
if (ui.getDepth() != (_root.getNextHighestDepth() - 1)) {
_root.ui.swapDepths(_root.getNextHighestDepth());
}
var _local2 = 0;
_local2 = snakeArray.length;
while (_local2 > 0) {
snakeArray[_local2]._x = snakeArray[_local2 - 1]._x;
snakeArray[_local2]._y = snakeArray[_local2 - 1]._y;
snakeArray[_local2]._alpha = 100 - (100 * (_local2 / snakeArray.length));
if ((snakeArray[_local2]._x == head._x) && (snakeArray[_local2]._y == head._y)) {
endGame = true;
}
_local2--;
}
snakeArray[0]._x = head._x;
snakeArray[0]._y = head._y;
if (dir == 1) {
head._y = head._y - 15;
} else if (dir == 2) {
head._y = head._y + 15;
} else if (dir == 3) {
head._x = head._x - 15;
} else if (dir == 4) {
head._x = head._x + 15;
}
if ((((head._x >= 555) || (head._x <= 0)) || (head._y >= 405)) || (head._y <= 0)) {
endGame = true;
}
var _local3 = false;
if ((head._x == food._x) && (head._y == food._y)) {
_local3 = true;
}
if (_local3 == true) {
if (food._currentframe == 2) {
score = score + 5;
} else {
score++;
}
var _local5 = head.duplicateMovieClip("snakepart" + snakeArray.length, _root.getNextHighestDepth());
snakeArray.push(_local5);
food._x = Math.round(Math.random() * 37) * 15;
food._y = Math.round(Math.random() * 27) * 15;
var _local4 = Math.round(Math.random() * 6);
if (_local4 == 0) {
food.gotoAndStop(2);
} else {
food.gotoAndStop(1);
}
while ((((food._x >= 555) || (food._x <= 0)) || (food._y >= 405)) || (food._y <= 0)) {
food._x = Math.round(Math.random() * 37) * 15;
food._y = Math.round(Math.random() * 27) * 15;
}
chain++;
}
} else {
dir = 0;
if (chain <= -1) {
if (chain == -2) {
removeMovieClip(food);
removeMovieClip(head);
var _local2 = 0;
while (_local2 < snakeArray.length) {
removeMovieClip(snakeArray[_local2]);
_local2++;
}
snakeArray.splice(0, snakeArray.length);
_root.onEnterFrame = null;
ui._visible = false;
_root.gotoAndStop("gameover");
} else {
head.play();
}
} else {
snakeArray[chain].play();
}
}
}
dir = 2;
snakeArray = [];
speed = 15;
timer = 0;
doMove = 2;
chain = -1;
score = 0;
gamemode = "freeplay";
endGame = false;
_root.attachMovie("snakefood", "food", _root.getNextHighestDepth());
food._x = Math.round(Math.random() * 37) * 15;
food._y = Math.round(Math.random() * 27) * 15;
_root.attachMovie("snakebit", "head", _root.getNextHighestDepth());
ui.removeMovieClip();
_root.attachMovie("freeplay_ui", "ui", _root.getNextHighestDepth());
ui._x = 270;
ui._y = 65;
head._x = 15;
head._y = 15;
stop();
Frame 4
function onEnterFrame() {
if (Key.isDown(38)) {
dir = 1;
} else if (Key.isDown(40)) {
dir = 2;
} else if (Key.isDown(37)) {
dir = 3;
} else if (Key.isDown(39)) {
dir = 4;
}
timer++;
if (timer == doMove) {
timer = 0;
move();
}
}
function move() {
if (endGame == false) {
ui._visible = true;
if (ui.getDepth() != (_root.getNextHighestDepth() - 1)) {
_root.ui.swapDepths(_root.getNextHighestDepth());
}
timeToLive--;
var _local2 = 0;
_local2 = snakeArray.length;
while (_local2 > 0) {
snakeArray[_local2]._x = snakeArray[_local2 - 1]._x;
snakeArray[_local2]._y = snakeArray[_local2 - 1]._y;
snakeArray[_local2]._alpha = 100 - (100 * (_local2 / snakeArray.length));
if ((snakeArray[_local2]._x == head._x) && (snakeArray[_local2]._y == head._y)) {
endGame = true;
}
_local2--;
}
snakeArray[0]._x = head._x;
snakeArray[0]._y = head._y;
if (dir == 1) {
head._y = head._y - 15;
} else if (dir == 2) {
head._y = head._y + 15;
} else if (dir == 3) {
head._x = head._x - 15;
} else if (dir == 4) {
head._x = head._x + 15;
}
if ((((head._x >= 555) || (head._x <= 0)) || (head._y >= 405)) || (head._y <= 0)) {
endGame = true;
}
var _local3 = false;
if ((head._x == food._x) && (head._y == food._y)) {
_local3 = true;
}
if (_local3 == true) {
if (food._currentframe == 2) {
score = score + 5;
timeToLive = timeToLive + 60;
} else {
score++;
timeToLive = timeToLive + 30;
}
var _local5 = head.duplicateMovieClip("snakepart" + snakeArray.length, _root.getNextHighestDepth());
snakeArray.push(_local5);
food._x = Math.round(Math.random() * 37) * 15;
food._y = Math.round(Math.random() * 27) * 15;
var _local4 = Math.round(Math.random() * 6);
if (_local4 == 0) {
food.gotoAndStop(2);
} else {
food.gotoAndStop(1);
}
while ((((food._x >= 555) || (food._x <= 0)) || (food._y >= 405)) || (food._y <= 0)) {
food._x = Math.round(Math.random() * 37) * 15;
food._y = Math.round(Math.random() * 27) * 15;
}
chain++;
}
if (timeToLive <= 0) {
timeToLive = 0;
endGame = true;
}
} else {
dir = 0;
if (chain <= 0) {
if (chain == -1) {
removeMovieClip(food);
removeMovieClip(head);
var _local2 = 0;
while (_local2 < snakeArray.length) {
removeMovieClip(snakeArray[_local2]);
_local2++;
}
snakeArray.splice(0, snakeArray.length);
_root.onEnterFrame = null;
ui._visible = false;
_root.gotoAndStop("gameover");
} else {
head.play();
}
} else {
snakeArray[chain].play();
}
}
}
dir = 2;
snakeArray = [];
speed = 15;
timer = 0;
doMove = 2;
chain = -1;
score = 0;
gamemode = "survival";
timeToLive = 90;
endGame = false;
_root.attachMovie("snakefood", "food", _root.getNextHighestDepth());
food._x = Math.round(Math.random() * 37) * 15;
food._y = Math.round(Math.random() * 27) * 15;
_root.attachMovie("snakebit", "head", _root.getNextHighestDepth());
ui.removeMovieClip();
_root.attachMovie("survival_ui", "ui", _root.getNextHighestDepth());
ui._x = 270;
ui._y = 65;
head._x = 15;
head._y = 15;
stop();
Frame 5
stop();
Frame 6
function onEnterFrame() {
getURL ("http://lethalgfx.rendot.com");
}
stop();
Symbol 4 MovieClip [snakebit] Frame 1
stop();
Symbol 4 MovieClip [snakebit] Frame 5
_root.chain--;
stop();
Symbol 15 MovieClip [snakefood] Frame 1
stop();
Symbol 15 MovieClip [snakefood] Frame 2
stop();
Symbol 25 MovieClip Frame 1
function timerHandler() {
if (!loadingComplete) {
var _local4 = _root.getBytesLoaded() / _root.getBytesTotal();
bar._xscale = 100 * _local4;
if (_local4 == 1) {
loadingComplete = true;
if (AUTO_PLAY) {
startMovie();
} else {
gotoAndStop ("loaded");
}
return(undefined);
}
}
dt = getTimer() - time;
time = time + dt;
frameAccum = frameAccum + dt;
var _local3 = 0;
while ((frameAccum >= FRAME_TIME) && (_local3 < MAX_FRAME_SKIP)) {
advanceFrame(tankLogo, true, true);
advanceFrame(loadingText, false, true);
advanceFrame(barGfx, false, true);
if (loadingComplete) {
advanceFrame(this, false, false);
}
(frameAccum = frameAccum - FRAME_TIME);
_local3++;
}
updateAfterEvent();
}
function advanceFrame(clip, recurse, loop) {
if (!clip) {
return(undefined);
}
clip.stop();
if (clip._currentframe == clip._totalframes) {
if (loop) {
clip.gotoAndStop(1);
}
} else {
clip.nextFrame();
}
if (recurse) {
for (childName in clip) {
if (typeof(clip[childName]) == "movieclip") {
advanceFrame(clip[childName], recurse, loop);
}
}
}
}
function startMovie() {
clearInterval(intervalId);
_root.play();
}
_root.stop();
stop();
var FRAME_TIME = 33.3333333333333;
var AUTO_PLAY = false;
var MAX_FRAME_SKIP = 5;
var loadingComplete;
var intervalId;
var time;
var frameAccum;
loadingComplete = false;
intervalId = setInterval(this, "timerHandler", FRAME_TIME / 2);
frameAccum = 0;
time = getTimer();
timerHandler();
Symbol 25 MovieClip Frame 37
startMovie();
Symbol 41 Button
on (release) {
_root.gotoAndStop("freeplay");
}
Symbol 43 Button
on (release) {
_root.gotoAndStop("survival");
}
Symbol 47 Button
on (release) {
_root.gotoAndStop(gamemode);
}
Symbol 49 Button
on (release) {
_root.gotoAndStop("menu");
}