Frame 1
stop();
_root.onEnterFrame = function () {
if (_root.getBytesLoaded() >= _root.getBytesTotal()) {
gotoAndStop ("splash");
delete _root.onEnterFrame;
}
};
Frame 10
maintm = this;
stop();
Frame 19
stop();
Frame 30
function newGame() {
startZorchers();
startTime = getTimer();
dead = false;
game.score = 0;
game.ball.clip = maintm.ball;
game.ball.x = 200;
game.ball.y = 200;
game.ball.health = 100;
game.ball.speed = 8;
game.ball.clip.gotoAndStop("norm");
maintm.popup.gotoAndStop("hidden");
game.zorch1.clip = maintm.zorch1;
game.zorch2.clip = maintm.zorch2;
maintm.onEnterFrame = function () {
if (!dead) {
renderScreen();
listenForKeys();
displayInfo();
collisionDetect();
}
};
}
function renderScreen() {
game.ball.clip._x = game.ball.x;
game.ball.clip._y = game.ball.y;
if ((game.ball.health <= 0) && (!dead)) {
dead = true;
game.ball.health = 0;
game.ball.clip.gotoAndPlay("die");
}
}
function listenForKeys() {
ob = game.ball;
maskmc = _root.maintm.mask;
if (Key.isDown(37) && (maskmc.hitTest(ob.x - ob.speed, ob.y, true))) {
ob.x = ob.x - ob.speed;
} else if (Key.isDown(39) && (maskmc.hitTest(ob.x + ob.speed, ob.y, true))) {
ob.x = ob.x + ob.speed;
}
if (Key.isDown(38) && (maskmc.hitTest(ob.x, ob.y - ob.speed, true))) {
ob.y = ob.y - ob.speed;
} else if (Key.isDown(40) && (maskmc.hitTest(ob.x, ob.y + ob.speed, true))) {
ob.y = ob.y + ob.speed;
}
if (ob.x < 40) {
ob.x = 40;
}
if (ob.x > 360) {
ob.x = 360;
}
if (ob.y < 40) {
ob.y = 40;
}
if (ob.y > 360) {
ob.y = 360;
}
if (Key.isDown(81)) {
if (_quality == "HIGH") {
_quality = "MEDIUM";
} else if (_quality == "MEDIUM") {
_quality = "LOW";
} else {
_quality = "HIGH";
}
}
}
function startZorchers() {
maintm.zorch1.speed = 5;
maintm.zorch1.frame = 0;
maintm.zorch1.neededframes = 24;
maintm.zorch1.onEnterFrame = function () {
this.frame++;
if (this.frame >= this.neededframes) {
this.gotoAndPlay("zorch");
this.noise.start();
this.frame = 0;
this.neededframes = random(100) + 24;
this.speed = this.speed + 0.1;
}
if (this.moving) {
if (this.targ > this._y) {
this._y = this._y + this.speed;
} else {
this._y = this._y - this.speed;
}
if (Math.abs(this._y - this.targ) < (this.speed + 1)) {
this.moving = false;
}
} else {
this.targ = random(360);
this.moving = true;
}
};
maintm.zorch2.speed = 5;
maintm.zorch2.frame = 0;
maintm.zorch2.neededframes = 24;
maintm.zorch2.onEnterFrame = function () {
this.frame++;
if (this.frame >= this.neededframes) {
this.gotoAndPlay("zorch");
this.frame = 0;
this.neededframes = random(100) + 24;
this.speed = this.speed + 0.1;
}
if (this.moving) {
if (this.targ > this._x) {
this._x = this._x + this.speed;
} else {
this._x = this._x - this.speed;
}
if (Math.abs(this._x - this.targ) < (this.speed + 1)) {
this.moving = false;
}
} else {
this.targ = random(360);
this.moving = true;
}
};
}
function displayInfo() {
maintm.health.text = game.ball.health;
maintm.score.text = getTimer() - startTime;
}
function collisionDetect() {
if (game.ball.clip.hitTest(maintm.zorch1) && (maintm.zorch1._currentframe > 1)) {
game.ball.health--;
}
if (game.ball.clip.hitTest(maintm.zorch2) && (maintm.zorch2._currentframe > 1)) {
game.ball.health--;
}
}
game = {};
game.ball = {};
game.zorch1 = {};
game.zorch2 = {};
newGame();
Symbol 8 Button
on (release) {
_root.maintm.gotoAndStop("game");
}
Symbol 12 Button
on (release) {
_root.maintm.gotoAndStop("instructions");
}
Symbol 16 Button
on (release) {
getURL ("http://browncowinternational.com/", _blank);
}
Symbol 22 Button
on (release) {
_root.maintm.gotoAndStop("splash");
}
Symbol 43 MovieClip Frame 1
stop();
Symbol 43 MovieClip Frame 20
_root.maintm.popup.gotoAndStop("gameover");
stop();
Symbol 52 MovieClip Frame 1
stop();
Symbol 56 Button
on (release) {
_root.maintm.newGame();
}
Symbol 57 MovieClip Frame 1
stop();