Frame 1
function setGuy() {
Level++;
var _local2 = Level;
var _local1 = robot_mc.duplicateMovieClip("r" + _local2, _local2);
var _local3 = random(2);
if (_local3 == 1) {
_local1._y = 400;
} else {
_local1._y = 0;
}
var _local4 = random(501);
_local1._x = _local4;
}
function findDegree(a, b) {
var _local2 = Math.atan2(b, a);
var _local1 = _local2 / (Math.PI/180);
return(_local1);
}
function destroy(x, y) {
Level++;
var _local2 = Level;
var _local1 = dead_mc.duplicateMovieClip("r" + _local2, _local2);
_local1._x = x;
_local1._y = y;
_local1.play();
}
function loadScore() {
var _local2 = SharedObject.getLocal("robots");
i = 0;
while (i < 3) {
if (_local2.data.obj[i] == undefined) {
if (i == 0) {
_root.highestEasy = 0;
} else if (i == 1) {
_root.highestMedium = 0;
} else if (i == 2) {
_root.highestHard = 0;
}
} else if (i == 0) {
_root.highestEasy = _local2.data.obj[0];
} else if (i == 1) {
_root.highestMedium = _local2.data.obj[1];
} else if (i == 2) {
_root.highestHard = _local2.data.obj[2];
}
i++;
}
if (_local2.data.obj == undefined) {
_root.highestEasy = (_root.highestMedium = (_root.highestHard = 0));
}
}
function saveScore(changed) {
var _local3 = SharedObject.getLocal("robots");
var _local2 = new Array();
i = 0;
while (i < 3) {
if (i == changed) {
_local2[i] = _root.Destroyed;
} else {
_local2[i] = _local3.data.obj[i];
}
i++;
}
_local3.data.obj = _local2;
}
function clearScores() {
var _local2 = SharedObject.getLocal("robots");
var _local1 = new Array();
i = 0;
while (i < 3) {
_local1[i] = 0;
i++;
}
_local2.data.obj = _local1;
}
function blankFunction() {
}
function setLow() {
_quality = "LOW";
}
function setMed() {
_quality = "MEDIUM";
}
function setHigh() {
_quality = "HIGH";
}
function quit() {
if (_root._currentframe == 3) {
_root.gotoAndStop("Over");
}
}
stop();
fscommand ("allowscale", true);
Level = 0;
NumCheese = 1;
Wall = true;
maxRobots = 10;
robotDamage = 0.1;
robotSpeed = 5;
difficulty = "Easy";
MENU = new ContextMenu();
MENU.hideBuiltInItems();
Quality = new ContextMenuItem("Quality:", blankFunction);
Low = new ContextMenuItem("Low", setLow, true);
Medium = new ContextMenuItem("Medium", setMed);
High = new ContextMenuItem("High", setHigh);
Quit = new ContextMenuItem("Quit", quit, true);
MENU.customItems.push(Quality);
MENU.customItems.push(Low);
MENU.customItems.push(Medium);
MENU.customItems.push(High);
MENU.customItems.push(Quit);
_root.menu = MENU;
Instance of Symbol 27 MovieClip "loading" in Frame 1
onClipEvent (enterFrame) {
loaded = _root.getBytesLoaded();
total = _root.getBytesTotal();
decimal = loaded / total;
bar._x = (decimal * 420) - 420;
if (decimal == 1) {
_root.loadingWords.gotoAndStop(20);
}
}
Frame 2
stop();
loadScore();
Instance of Symbol 99 MovieClip "highScoreMenu" in Frame 2
onClipEvent (enterFrame) {
HIGHSCORE_EASY = _root.highestEasy;
HIGHSCORE_MEDIUM = _root.highestMedium;
HIGHSCORE_HARD = _root.highestHard;
}
Frame 3
stop();
Robots = 0;
Destroyed = 0;
Instance of Symbol 134 MovieClip "robot_mc" in Frame 3
onClipEvent (load) {
soundTime = 0;
damage = 1;
hit = false;
goCheese = true;
if (_root.NumCheese == 1) {
Cheese = 1;
} else {
d = random(2);
if (d == 1) {
Cheese = 1;
} else {
Cheese = 2;
}
}
}
onClipEvent (enterFrame) {
soundTime--;
cheese = _root["Cheese" + Cheese];
if (this._name != "robot_mc") {
if (_root._currentframe != 3) {
this.removeMovieClip();
}
if (damage > 7) {
damage = 7;
}
body.gotoAndStop(Math.floor(damage));
head.gotoAndStop(Math.floor(damage));
m = _root.Mace;
if (this.hitTest(m)) {
this.gotoAndStop("standing");
a = m._x - m.oldX;
b = m._y - m.oldY;
c = Math.sqrt((a * a) + (b * b));
degree = _root.findDegree(a, b);
rotation = degree + 90;
if (c > 10) {
hit = true;
speed = c;
if (soundTime < 0) {
sound = new Sound(_root);
sound.attachSound("hit");
sound.start();
soundTime = 10;
}
}
i = 9;
while (i > 1) {
if (speed > (i * 10)) {
damage = damage + ((i / 10) + 0.1);
break;
}
i--;
}
}
if (damage == 7) {
_root.Robots--;
_root.Destroyed++;
_root.destroy(this._x, this._y);
sound = new Sound(_root);
sound.attachSound("boom");
sound.start();
this.removeMovieClip();
}
if (hit) {
if (speed < 1) {
hit = false;
}
} else {
a = this._x - cheese._x;
b = this._y - cheese._y;
c2 = Math.sqrt((a * a) + (b * b));
degree = _root.findDegree(a, b) - 90;
if (c2 > 40) {
if (this._rotation < (degree - 18)) {
this._rotation = this._rotation + 9;
} else if (this._rotation > (degree + 18)) {
this._rotation = this._rotation - 9;
}
rotation = this._rotation;
}
speed = _root.robotSpeed;
}
if ((c2 > 40) or hit) {
this.gotoAndStop("standing");
this._x = this._x + (Math.sin(rotation * (Math.PI/180)) * speed);
this._y = this._y + (Math.cos(rotation * (Math.PI/180)) * (-speed));
} else {
this.gotoAndStop("munching");
cheese.damage = cheese.damage + _root.robotDamage;
}
if (_root.Wall) {
if (this._x > 500) {
if (Math.abs(speed) >= 20) {
damage = damage + (speed / 10);
}
this._x = 500;
speed = speed * -1;
this._rotation = this._rotation + 180;
} else if (this._x < 0) {
if (Math.abs(speed) >= 20) {
damage = damage + (speed / 10);
}
this._x = 0;
speed = speed * -1;
this._rotation = this._rotation + 180;
}
if (this._y > 400) {
if (Math.abs(speed) >= 20) {
damage = damage + (speed / 10);
}
this._y = 400;
speed = speed * -1;
this._rotation = this._rotation + 180;
} else if (this._y < 0) {
if (Math.abs(speed) >= 20) {
damage = damage + (speed / 10);
}
this._y = 0;
speed = speed * -1;
this._rotation = this._rotation + 180;
}
} else {
if (this._x > 500) {
this._x = 0;
} else if (this._x < 0) {
this._x = 500;
}
if (this._y > 400) {
this._y = 0;
} else if (this._y < 0) {
this._y = 400;
}
}
speed = speed * 0.8;
}
}
Instance of Symbol 140 MovieClip "elasticChain" in Frame 3
onClipEvent (enterFrame) {
if (_root.Robots < _root.maxRobots) {
_root.Robots++;
_root.setGuy();
}
_root.RobDestroyed = _root.Destroyed;
}
Instance of Symbol 142 MovieClip "Mace" in Frame 3
onClipEvent (load) {
k = 0.1;
damp = 0.78;
vx = 0;
vy = 0;
chainLength = _root.chain._height;
}
onClipEvent (enterFrame) {
oldX = this._x;
oldY = this._y;
ax = (_root._xmouse - this._x) * k;
ay = (_root._ymouse - this._y) * k;
vx = vx + ax;
vy = vy + ay;
vx = vx * damp;
vy = vy * damp;
x = this._x + vx;
y = this._y + vy;
this._x = x;
this._y = y;
if (_root.Wall) {
if (this._x > 465) {
this._x = 465;
vx = vx * (-damp);
} else if (this._x < 35) {
this._x = 35;
vx = vx * (-damp);
}
if (this._y > 365) {
this._y = 365;
vy = vy * (-damp);
} else if (this._y < 35) {
this._y = 35;
vy = vy * (-damp);
}
}
_root.elasticChain.clear();
_root.elasticChain.lineStyle(2, 0, 100);
_root.elasticChain.moveTo(this._x, this._y);
_root.elasticChain.lineTo(_root._xmouse, _root._ymouse);
}
Instance of Symbol 155 MovieClip "Cheese1" in Frame 3
onClipEvent (load) {
if (_root.NumCheese == 1) {
this._x = 250;
this._y = 200;
} else {
this._x = 180;
this._y = 200;
}
damage = 1;
}
onClipEvent (enterFrame) {
if (damage > 13) {
damage = 13;
}
this.gotoAndStop(Math.floor(damage));
}
Instance of Symbol 155 MovieClip "Cheese2" in Frame 3
onClipEvent (load) {
if (_root.NumCheese == 1) {
this._x = 1000;
this._y = 200;
} else {
this._x = 320;
this._y = 200;
}
damage = 1;
}
onClipEvent (enterFrame) {
if (damage > 13) {
damage = 13;
}
this.gotoAndStop(Math.floor(damage));
}
Frame 4
stop();
Name = "";
Message = ("You destroyed " + Destroyed) + " robots";
if ((Destroyed > _root.highestEasy) && (difficulty == "Easy")) {
gotHighScore._x = 250;
gotHighScore._y = 145;
saveScore(0);
} else if ((Destroyed > highestMedium) && (difficulty == "Medium")) {
gotHighScore._x = 250;
gotHighScore._y = 145;
saveScore(1);
} else if ((Destroyed > highestHard) && (difficulty == "Hard")) {
gotHighScore._x = 250;
gotHighScore._y = 145;
saveScore(2);
}
Symbol 14 MovieClip Frame 42
if (_root.loading.decimal < 0.75) {
this.gotoAndPlay(1);
}
Symbol 14 MovieClip Frame 65
stop();
Symbol 22 Button
on (release) {
_root.gotoAndStop("Menu");
}
Symbol 23 MovieClip Frame 19
this.gotoAndPlay(1);
Symbol 23 MovieClip Frame 20
stop();
Symbol 39 Button
on (release) {
_root.NumCheese = 1;
_root.maxRobots = 10;
_root.Wall = true;
_root.robotDamage = 0.01;
_root.robotSpeed = 5;
_root.difficulty = "Easy";
}
Symbol 40 Button
on (release) {
_root.NumCheese = 2;
_root.maxRobots = 20;
_root.Wall = false;
_root.robotDamage = 0.05;
_root.robotSpeed = 5;
_root.difficulty = "Medium";
}
Symbol 41 Button
on (release) {
_root.NumCheese = 2;
_root.maxRobots = 10;
_root.Wall = false;
_root.robotDamage = 1;
_root.robotSpeed = 4;
_root.difficulty = "Hard";
}
Symbol 45 Button
on (release) {
_x = 1000;
}
Symbol 46 Button
on (release) {
_root.CustomMenu._x = 90;
_root.CustomMenu._y = 265;
_root.highScoreMenu._x = 1000;
_root.InstructionsMenu._x = 1000;
}
Instance of Symbol 48 MovieClip in Symbol 49 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_root.difficulty == "Easy") {
_alpha = 50;
} else {
_alpha = 0;
}
}
Instance of Symbol 48 MovieClip in Symbol 49 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_root.difficulty == "Hard") {
_alpha = 50;
} else {
_alpha = 0;
}
}
Instance of Symbol 48 MovieClip in Symbol 49 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_root.difficulty == "Medium") {
_alpha = 50;
} else {
_alpha = 0;
}
}
Instance of Symbol 48 MovieClip in Symbol 49 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_root.difficulty == "Custom") {
_alpha = 50;
} else {
_alpha = 0;
}
}
Symbol 65 Button
on (release) {
wall = false;
}
Symbol 66 Button
on (release) {
wall = true;
}
Symbol 67 Button
on (release) {
cheese = 2;
}
Symbol 68 Button
on (release) {
cheese = 1;
}
Symbol 69 Button
on (release) {
if (((MaxRob != "") && (MaxRob >= 1)) && (MaxRob <= 150)) {
if (((RobSpeed != "") && (RobSpeed >= 2)) && (RobSpeed <= 15)) {
if (((RobDamage != "") && (RobDamage >= 0.01)) && (RobDamage <= 1)) {
_root.NumCheese = cheese;
_root.Wall = wall;
_root.maxRobots = Number(MaxRob);
_root.robotSpeed = Number(RobSpeed);
_root.robotDamage = Number(RobDamage);
_root.difficulty = "Custom";
MaxRob = (RobSpeed = (RobDamage = ""));
_x = 1000;
}
}
}
}
Symbol 70 Button
on (release) {
MaxRob = (RobSpeed = (RobDamage = ""));
_x = 1000;
}
Symbol 71 MovieClip Frame 1
MaxRob = (RobSpeed = (RobDamage = ""));
cheese = 1;
wall = true;
Instance of Symbol 48 MovieClip in Symbol 71 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_parent.cheese == 2) {
_alpha = 50;
} else {
_alpha = 0;
}
}
Instance of Symbol 48 MovieClip in Symbol 71 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_parent.cheese == 1) {
_alpha = 50;
} else {
_alpha = 0;
}
}
Instance of Symbol 48 MovieClip in Symbol 71 MovieClip Frame 1
onClipEvent (enterFrame) {
if (!_parent.wall) {
_alpha = 50;
} else {
_alpha = 0;
}
}
Instance of Symbol 48 MovieClip in Symbol 71 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_parent.wall) {
_alpha = 50;
} else {
_alpha = 0;
}
}
Symbol 74 Button
on (release) {
_root.gotoAndStop("Game");
}
Symbol 77 Button
on (release) {
if ((_root.CustomMenu._x != 90) && (_root.highScoreMenu._x != 70)) {
_root.InstructionsMenu._x = 90;
_root.InstructionsMenu._y = 330;
}
}
Symbol 80 Button
on (release) {
_root.DifficultyMenu._x = 400;
_root.DifficultyMenu._y = 140;
}
Symbol 83 Button
on (release) {
if ((_root.CustomMenu._x != 90) && (_root.InstructionsMenu._x != 90)) {
_root.highScoreMenu._x = 70;
_root.highScoreMenu._y = 160;
}
}
Symbol 86 Button
on (release) {
_root.InformationMenu._x = 400;
_root.InformationMenu._y = 335;
}
Symbol 93 Button
on (release) {
_root.clearScores();
}
Symbol 114 Button
on (release) {
getURL ("http://www.albinoblacksheep.com");
}
Symbol 123 MovieClip Frame 1
stop();
Symbol 123 MovieClip Frame 2
stop();
Symbol 123 MovieClip Frame 3
stop();
Symbol 123 MovieClip Frame 4
stop();
Symbol 123 MovieClip Frame 5
stop();
Symbol 123 MovieClip Frame 6
stop();
Symbol 123 MovieClip Frame 7
stop();
Symbol 131 MovieClip Frame 1
stop();
Symbol 131 MovieClip Frame 2
stop();
Symbol 131 MovieClip Frame 3
stop();
Symbol 131 MovieClip Frame 4
stop();
Symbol 131 MovieClip Frame 5
stop();
Symbol 131 MovieClip Frame 6
stop();
Symbol 131 MovieClip Frame 7
stop();
Symbol 134 MovieClip Frame 1
stop();
Symbol 134 MovieClip Frame 2
stop();
Symbol 139 MovieClip Frame 16
this.removeMovieClip();
Symbol 155 MovieClip Frame 1
stop();
Symbol 155 MovieClip Frame 2
stop();
Symbol 155 MovieClip Frame 3
stop();
Symbol 155 MovieClip Frame 4
stop();
Symbol 155 MovieClip Frame 5
stop();
Symbol 155 MovieClip Frame 6
stop();
Symbol 155 MovieClip Frame 7
stop();
Symbol 155 MovieClip Frame 8
stop();
Symbol 155 MovieClip Frame 9
stop();
Symbol 155 MovieClip Frame 10
stop();
Symbol 155 MovieClip Frame 11
stop();
Symbol 155 MovieClip Frame 12
stop();
Symbol 155 MovieClip Frame 13
_root.gotoAndStop("Over");
Symbol 162 Button
on (release) {
if ((_root.NAME != "") && (_root.Difficulty != "Custom")) {
_root.filename = "scores2/highscores.sco";
_root.scoresize = 10;
_root.action = "INSERT";
_root.viewtype = "FLASH";
_root.winname = _root.NAME;
_root.winscore = _root.Destroyed;
_root.loadVariables("http://www.steven-s.us/scores.php", "GET");
}
_root.gotoAndStop("Menu");
}