Frame 1
stop();
done = 0;
Instance of Symbol 4 MovieClip "box" in Frame 1
onClipEvent (enterFrame) {
_root.done = (_root.getBytesLoaded() / _root.getBytesTotal()) * 100;
trace(_root.done);
}
Instance of Symbol 7 MovieClip in Frame 1
onClipEvent (load) {
this.gotoAndStop(Math.round(_root.done));
}
Frame 2
loop = new Sound();
loop.attachSound("loop1");
loop.setVolume(100);
loop.start(0, 999);
farge = new Color(bg);
setRGB = "0x006600";
Instance of Symbol 4 MovieClip "box" in Frame 2
onClipEvent (load) {
this.swapDepths(999999);
}
onClipEvent (enterFrame) {
if (Key.isDown(77)) {
_root.loop.setVolume(0);
}
if (Key.isDown(78)) {
_root.loop.setVolume(100);
}
}
Frame 3
trace(setRGB);
lvlNum = 1;
_quality = "HIGH";
stop();
color = new Color(background);
color.setRGB(setRGB);
Instance of Symbol 18 MovieClip in Frame 3
onClipEvent (enterFrame) {
this.swapDepths(10000);
}
Instance of Symbol 45 MovieClip in Frame 3
onClipEvent (load) {
if (_root.lvlNum == 1) {
this.play();
_root.target = "";
}
}
Frame 4
color = new Color(background);
health = 100;
color.setRGB(setRGB);
stop();
target = "lvlDone";
kills = 0;
difficulty = 10;
go = true;
percent = 100;
partNum = 1;
shoot = false;
lvlNum2 = lvlNum + 1;
o = 0;
while (o < lvlNum) {
_root.mainPart.duplicateMovieClip("part" + _root.partNum, _root.partNum);
_root["part" + _root.partNum].prevName = "part" + (_root.partNum - 1);
_root.partNum = _root.partNum + 1;
o++;
}
Instance of Symbol 51 MovieClip "head" in Frame 4
onClipEvent (enterFrame) {
x = Math.sin(_rotation * (Math.PI/180)) * speed;
y = (Math.cos(_rotation * (Math.PI/180)) * speed) * -1;
_x = (_x + x);
_y = (_y + y);
if (Key.isDown(39)) {
_rotation = (_rotation + 10);
}
if (Key.isDown(37)) {
_rotation = (_rotation - 10);
}
if (_root.go) {
speed = 5;
} else {
speed = 0;
}
if (_root.wall._yscale < 1) {
_root.nextFrame();
_root.wall._yscale = 100;
_root.percent = 100;
}
}
onClipEvent (enterFrame) {
if ((Key.isDown(32) && (_root.shoot == false)) && (time < 0)) {
_root.bullet.duplicateMovieClip("bullet2", 1000);
_root.bullet2._x = _x;
_root.bullet2._y = _y;
_root.bullet2._rotation = _rotation;
time = 25;
}
trace((_root.kills + "/") + _root.box.maxEnem);
time--;
}
onClipEvent (load) {
i = 1000;
time = 0;
}
onClipEvent (enterFrame) {
if (_x > 800) {
_root.health = _root.health - 15;
_x = 400;
}
if (_x < 0) {
_root.health = _root.health - 15;
_x = 400;
}
if (_y > 600) {
_root.health = _root.health - 15;
_y = 300;
}
if (_y < 0) {
_root.health = _root.health - 15;
_y = 300;
}
}
Instance of Symbol 54 MovieClip "part1" in Frame 4
onClipEvent (enterFrame) {
_x = (_x - ((_x - _root.head._x) / speed));
_y = (_y - ((_y - _root.head._y) / speed));
_rotation = (57.3 * Math.atan2(_root.head._y - _y, _root.head._x - _x));
_root.mainPart._x = _root["part" + (_root.partNum - 1)]._x;
_root.mainPart._y = _root["part" + (_root.partNum - 1)]._y;
}
onClipEvent (load) {
speed = 3;
}
Instance of Symbol 54 MovieClip "mainPart" in Frame 4
onClipEvent (load) {
trace(_name);
cFrame = _root._currentframe;
speed = 3;
}
onClipEvent (enterFrame) {
_x = (_x - ((_x - _root[prevName]._x) / speed));
_y = (_y - ((_y - _root[prevName]._y) / speed));
_rotation = (57.3 * Math.atan2(_root[prevName]._y - _y, _root[prevName]._x - _x));
if (_root.head.hitTest(_x, _y, true)) {
_root.health = _root.health - 1;
}
if (_root.wall._yscale < 1) {
this.removeMovieClip();
}
if (_root._currentframe != cFrame) {
this.removeMovieClip();
}
}
Instance of Symbol 57 MovieClip "enemy" in Frame 4
onClipEvent (load) {
cFrame = _root._currentframe;
dead = false;
speed = random(40) + 30;
pos = random(4) + 1;
if (pos == 1) {
_x = -20;
_y = random(600);
}
if (pos == 2) {
_y = -20;
_x = random(800);
}
if (pos == 3) {
_x = 820;
_y = random(600);
}
if (pos == 4) {
_y = 620;
_x = random(800);
}
}
onClipEvent (enterFrame) {
_x = (_x - ((_x - _root.head._x) / speed));
_y = (_y - ((_y - _root.head._y) / speed));
if (this.hitTest(_root.bullet2) && (!dead)) {
_root.kills = _root.kills + 1;
_root.health = _root.health + 2;
this.removeMovieClip();
gotoAndStop (6);
_root.head.time = 0;
dead = true;
}
if (this.hitTest(_root.head) && (!dead)) {
_root.health = _root.health - 1;
}
if (_root._currentframe != cFrame) {
this.removeMovieClip();
this.gotoAndStop(2);
}
_rotation = (_rotation + (speed / 2));
}
Instance of Symbol 63 MovieClip "bullet" in Frame 4
onClipEvent (enterFrame) {
x = Math.sin(_rotation * (Math.PI/180)) * speed;
y = (Math.cos(_rotation * (Math.PI/180)) * speed) * -1;
_x = (_x + x);
_y = (_y + y);
speed = 20;
if (_y < 0) {
_root.shoot = false;
this.removeMovieClip();
}
if (_y > 620) {
_root.shoot = false;
this.removeMovieClip();
}
if (_x < 0) {
_root.shoot = false;
this.removeMovieClip();
}
if (_x > 820) {
_root.shoot = false;
this.removeMovieClip();
}
}
Instance of Symbol 4 MovieClip "box" in Frame 4
onClipEvent (load) {
enemNum = 0;
maxEnem = _root.lvlNum * 2;
time = 2;
i = 500;
trace(timeSet);
}
onClipEvent (enterFrame) {
if ((enemNum < maxEnem) && (time < 0)) {
_root.enemy.duplicateMovieClip("enemy" + i, i);
i++;
enemNum++;
time = timeSet;
}
if (_root.kills == maxEnem) {
_root.lvlUp.play();
}
_root.enemy._x = 1000;
time--;
}
onClipEvent (load) {
if (_root.lvlNum > 0) {
timeSet = 30;
_quality = "HIGH";
}
if (_root.lvlNum > 10) {
timeSet = 25;
}
if (_root.lvlNum > 20) {
timeSet = 20;
}
if (_root.lvlNum > 30) {
_quality = "MEDIUM";
timeSet = 15;
}
if (_root.lvlNum > 40) {
timeSet = 10;
}
if (_root.lvlNum > 50) {
timeSet = 8;
}
if (_root.lvlNum > 60) {
_quality = "LOW ";
timeSet = 6;
}
if (_root.lvlNum > 70) {
timeSet = 5;
}
if (_root.lvlNum > 80) {
timeSet = 4;
}
if (_root.lvlNum > 90) {
timeSet = 3;
}
if (_root.lvlNum > 100) {
timeSet = 2;
}
if (_root.lvlDone) {
enemNum = 0;
time = 3;
maxEnem = _root.lvlNum * 2;
}
}
Instance of Symbol 66 MovieClip in Frame 4
onClipEvent (enterFrame) {
_xscale = (_xscale - ((_xscale - _root.health) / 4));
if (_xscale < 0) {
_root.fade2.play();
}
if (_root.health > 100) {
_root.health = 100;
}
}
Instance of Symbol 45 MovieClip in Frame 4
onClipEvent (load) {
if (_root.lvlNum == 1) {
this.play();
_root.target = "";
}
}
Frame 5
color = new Color(background);
color.setRGB(setRGB);
stop();
lvlNum = lvlNum + 1;
Instance of Symbol 45 MovieClip in Frame 5
onClipEvent (load) {
if (_root.lvlNum == 1) {
this.play();
_root.target = "";
}
}
Frame 6
color = new Color(background);
color.setRGB(setRGB);
stop();
name = "";
message = "Congratulations, you got to level " + lvlNum;
Instance of Symbol 45 MovieClip in Frame 6
onClipEvent (load) {
if (_root.lvlNum == 1) {
this.play();
_root.target = "";
}
}
Frame 7
onEnterFrame = function () {
Rv = Math.round(R.knob._x);
Gv = Math.round(G.knob._x);
Bv = Math.round(B.knob._x);
farge.setRGB(((Rv << 16) | (Gv << 8)) | Bv);
RGB = farge.getRGB();
};
stop();
Instance of Symbol 109 MovieClip "R" in Frame 7
onClipEvent (load) {
this.knob._x = _root.lastR;
}
Instance of Symbol 109 MovieClip "G" in Frame 7
onClipEvent (load) {
this.knob._x = 90;
}
Frame 8
color = new Color(background);
color.setRGB(setRGB);
stop();
target = "lvlDone";
kills = 0;
difficulty = 10;
go = true;
percent = 100;
partNum = 1;
_root.mainPart.duplicateMovieClip("part" + _root.partNum, _root.partNum);
_root["part" + _root.partNum].prevName = "part" + (_root.partNum - 1);
_root.partNum = _root.partNum + 1;
Instance of Symbol 112 MovieClip "head" in Frame 8
onClipEvent (enterFrame) {
x = Math.sin(_rotation * (Math.PI/180)) * speed;
y = (Math.cos(_rotation * (Math.PI/180)) * speed) * -1;
_x = (_x + x);
_y = (_y + y);
if (Key.isDown(39)) {
_rotation = (_rotation + 10);
}
if (Key.isDown(37)) {
_rotation = (_rotation - 10);
}
if (_root.go) {
speed = 3;
} else {
speed = 0;
}
if (_root.wall._yscale < 1) {
_root.nextFrame();
_root.wall._yscale = 100;
_root.percent = 100;
}
}
onClipEvent (enterFrame) {
if ((Key.isDown(32) && (_root.shoot == false)) && (time < 0)) {
_root.bullet.duplicateMovieClip("bullet2", 1000);
_root.bullet2._x = _x;
_root.bullet2._y = _y;
_root.bullet2._rotation = _rotation;
time = 25;
}
trace((_root.kills + "/") + _root.box.maxEnem);
time--;
}
onClipEvent (load) {
i = 1000;
time = 0;
}
Instance of Symbol 54 MovieClip "part1" in Frame 8
onClipEvent (enterFrame) {
_x = (_x - ((_x - _root.head._x) / speed));
_y = (_y - ((_y - _root.head._y) / speed));
_rotation = (57.3 * Math.atan2(_root.head._y - _y, _root.head._x - _x));
_root.mainPart._x = _root["part" + (_root.partNum - 1)]._x;
_root.mainPart._y = _root["part" + (_root.partNum - 1)]._y;
}
onClipEvent (load) {
speed = 5;
}
Instance of Symbol 54 MovieClip "mainPart" in Frame 8
onClipEvent (load) {
trace(_name);
speed = 5;
}
onClipEvent (enterFrame) {
_x = (_x - ((_x - _root[prevName]._x) / speed));
_y = (_y - ((_y - _root[prevName]._y) / speed));
_rotation = (57.3 * Math.atan2(_root[prevName]._y - _y, _root[prevName]._x - _x));
if (_root.head.hitTest(_x, _y, true)) {
_root.gotoAndStop("extras");
}
if (_root.wall._yscale < 1) {
this.removeMovieClip();
}
}
Instance of Symbol 114 MovieClip in Frame 8
onClipEvent (enterFrame) {
if (this.hitTest(_root.head)) {
_root.mainPart.duplicateMovieClip("part" + _root.partNum, _root.partNum);
_root["part" + _root.partNum].prevName = "part" + (_root.partNum - 1);
_root.partNum = _root.partNum + 1;
_root.percent = _root.percent - _root.difficulty;
_x = random(800);
_y = random(600);
}
}
Symbol 7 MovieClip Frame 100
_root.play();
Symbol 16 Button
on (release) {
getURL ("http://www.nbstuff.com", "_blank");
}
Symbol 29 Button
on (release) {
fade.play();
_root.target = "game";
}
Symbol 33 Button
on (release) {
getURL ("http://www.nbstuff.com/highscores/snake", "_blank");
}
Symbol 37 Button
on (release) {
getURL ("http://www.nbstuff.com", "_blank");
}
Symbol 43 Button
on (release) {
gotoAndStop ("extras");
}
Symbol 44 MovieClip Frame 1
stop();
Symbol 44 MovieClip Frame 30
stop();
_root.gotoAndStop(_root.target);
Symbol 45 MovieClip Frame 30
stop();
Symbol 54 MovieClip Frame 1
stop();
Symbol 57 MovieClip Frame 1
stop();
Symbol 71 Button
on (release) {
fade2.play();
}
Symbol 74 MovieClip Frame 1
stop();
Symbol 74 MovieClip Frame 2
_root.mainPart.duplicateMovieClip("part" + _root.partNum, _root.partNum);
_root["part" + _root.partNum].prevName = "part" + (_root.partNum - 1);
_root.partNum = _root.partNum + 1;
_root.lvlNum = _root.lvlNum + 1;
_root.lvlDone = true;
Symbol 74 MovieClip Frame 41
_root.box.maxEnem = _root.lvlNum * 2;
_root.box.enemNum = 0;
_root.kills = 0;
Symbol 74 MovieClip Frame 42
gotoAndStop (1);
_root.lvlDone = false;
Symbol 75 MovieClip Frame 1
stop();
Symbol 75 MovieClip Frame 30
stop();
_root.gotoAndStop("lvlDone");
Symbol 76 MovieClip Frame 1
stop();
Symbol 76 MovieClip Frame 30
stop();
_root.gotoAndStop("gameOver");
Symbol 82 Button
on (release, keyPress "<Space>") {
fade.play();
}
Symbol 84 MovieClip Frame 1
stop();
Symbol 84 MovieClip Frame 30
stop();
_root.gotoAndStop("game");
Symbol 91 Button
on (release) {
fade.play();
target = "menu";
}
Symbol 95 Button
on (release) {
fade2.play();
lvlNum = 1;
}
Symbol 99 Button
on (release) {
if (name != "") {
score = _root.lvlNum;
name = _root.name;
_root.game_id = "snak";
_root.getURL("http://www.nbstuff.com/highscores/snake/addscore.php", "_blank", "POST");
_root.button._visible = false;
}
}
Symbol 103 Button
on (release) {
fade.play();
setRGB = RGB;
target = "original";
}
Symbol 104 Button
on (release) {
fade.play();
target = "menu";
setRGB = RGB;
}
Instance of Symbol 108 MovieClip "knob" in Symbol 109 MovieClip Frame 1
on (press) {
this.startDrag(true, 0, 0, 255, 0);
}
on (release) {
this.stopDrag();
}
Symbol 116 Button
on (release) {
fade.play();
target = "extras";
}