Frame 1
function myOnLoad() {
trace("on load");
scoreUrl = doc.firstChild.childNodes[0].firstChild;
sendUrl = doc.firstChild.childNodes[1].firstChild;
gameID = doc.firstChild.childNodes[2].firstChild;
dataReceived++;
}
dataReceived = 0;
_quality = "BEST";
System.security.allowDomain("makaimedia.com");
System.security.allowDomain("*.makaimedia.com");
System.security.allowDomain("*.capitalent.com");
doc = new XML();
doc.ignoreWhite = true;
dataReceived++;
scoreUrl = "scripts/highscore_engine.php";
sendUrl = "scripts/sender.php";
gameID = 2;
doc.onLoad = myOnLoad;
myColor = new Color(this);
myTransform = new Object();
Frame 2
if (dataReceived > 0) {
ifFrameLoaded (22) {
gotoAndStop ("login");
}
}
Frame 3
gotoAndPlay (2);
Frame 7
Selection.setFocus(login);
doLogin = function () {
if ((loginname.length > 0) and (passwd.length > 0)) {
good = true;
if ((loginname.length < 4) or (passwd.length < 4)) {
message = "Minimum of 4 characters";
good = false;
}
if ((loginname.length == 0) or (passwd.length == 0)) {
errorMessage = "Please fill in all fields";
good = false;
}
if (good) {
tracer = "";
objLogin = new LoadVars();
objLogin.uid = 0;
objLogin.loginname = loginname;
objLogin.passwd = passwd;
objLogin.sendAndLoad("http://www.capitalent.com/beckham/games/scripts/loginFromFlash.php", objLogin, "GET");
objLogin.onLoad = function (success) {
for (prop in objLogin) {
trace((prop + "=") + objLogin[prop]);
tracer = tracer + (((prop + "=") + objLogin[prop]) + "\r");
}
if (Number(objLogin.uid) > 0) {
_root.guest = false;
_root.memberName = objLogin.loginname;
_root.loginName = objLogin.loginname;
_root.memberID = objLogin.uid;
uid = objLogin.uid;
welcomeMessage = ("Welcome,\r" + loginname) + "!";
welcomeMessage = welcomeMessage.toUpperCase();
gotoAndStop ("title");
} else {
message = "That username and password does not exist";
gotoAndStop ("splash");
}
};
}
} else {
message = "Please enter your username and password.";
}
trace(message);
};
testScoring = function () {
};
Frame 15
fade = function (destination) {
fader.destination = destination;
fader.gotoAndPlay(2);
};
_root.sounds.idle.gotoAndPlay("start");
Frame 22
bogus = false;
_root.sounds.game.start();
Frame 24
gotoAndStop (23);
Frame 30
score = int(score * 1000) / 1000;
displayScore = "TIME: " + score;
title.playAgain._visible = false;
title.instructions._visible = false;
reset = function () {
title.playAgain._visible = true;
title.instructions._visible = true;
};
_root.sounds.idle.start();
play();
Frame 31
trace("test");
if ((!bogus) and scoreCounts) {
scores.test(score);
} else {
reset();
}
stop();
Symbol 4 MovieClip Frame 1
total = _root.getBytesTotal();
Symbol 4 MovieClip Frame 2
percent = _root.getBytesLoaded() / total;
bar._xscale = percent * 100;
Symbol 4 MovieClip Frame 3
gotoAndPlay (2);
Symbol 13 Button
on (press) {
doLogin();
}
Symbol 21 Button
on (press) {
getURL ("http://www.capitalent.com/users.php?mode=new");
}
Symbol 28 Button
on (press) {
gotoAndStop ("title");
}
Symbol 38 Button
on (release) {
if (!frozen) {
doInstructions();
}
}
Symbol 41 Button
on (release) {
_root.sounds.select.start();
_parent.fade("game");
}
Symbol 44 MovieClip Frame 1
stop();
Symbol 44 MovieClip Frame 13
stop();
Symbol 45 MovieClip Frame 1
frozen = false;
doInstructions = function () {
frozen = true;
instr.gotoAndPlay("open");
};
closeInstructions = function () {
instr.gotoAndPlay("close");
frozen = false;
};
Symbol 45 MovieClip Frame 47
stop();
Symbol 51 Button
on (release) {
getURL ("http://www.amazon.com/gp/product/B0007LXP2C/qid=1139436097/sr=1-1/ref=pd_bbs_1/103-4900851-3578246?%5Fencoding=UTF8&v=glance&n=130", "_blank");
}
Symbol 55 Button
on (release) {
this._visible = false;
_parent._parent.reset();
}
Symbol 64 MovieClip Frame 1
function liveTrace(what) {
trace(what);
}
init = function () {
nameEnter._visible = false;
box = [unit0, unit1, unit2, unit3, unit4, unit5, unit6, unit7, unit8, unit9];
testing = false;
display();
_parent.testScoring();
};
scoresLoaded = function (success) {
showPage(this);
this.onLoad = null;
};
submitLoaded = function (success) {
showPage(this);
this.onLoad = null;
_parent.reset();
};
submitScore = function (myName) {
if (myName.length > 0) {
nameEnter._visible = false;
scores = new LoadVars();
scores.newScore = newScore;
scores.newName = myName;
scores.gameID = _root.gameID;
scores.action = "insert";
scores.onLoad = submitLoaded;
scores.sendAndLoad(_root.scoreUrl, scores, "GET");
}
};
showPage = function (scores) {
i = 0;
while (i < box.length) {
j = i + 1;
box[i].name = eval ("scores.tn" + j);
box[i].score = eval ("scores.ts" + j);
if (box[i].score == undefined) {
box[i].score = 10000;
box[i].name = "--";
}
box[i].displayScore = box[i].score;
i++;
}
gamesPlayed = "GAMES PLAYED: " + scores.gamecount;
};
display = function () {
scores = new LoadVars();
scores.action = "read";
scores.gid = _root.gameID;
scores.sendAndLoad(_root.scoreUrl, scores, "GET");
scores.onLoad = scoresLoaded;
};
showNameEnter = function () {
Selection.setFocus("nameEnter.namer");
nameEnter._visible = true;
};
test = function (newScore) {
trace(_root.loginName);
if (((_root.loginName.length > 0) and (!entered)) and (_root.memberID > 0)) {
alreadyListed = false;
i = 9;
while (i >= 0) {
if (Number(newScore) <= box[i].score) {
myPosition = i;
}
i = i - 1;
}
i = 9;
while (i >= 0) {
if (_root.loginName == box[i].name) {
liveTrace("found the name");
if (Number(newScore) >= box[i].score) {
alreadyListed = true;
}
}
i = i - 1;
}
if (alreadyListed) {
liveTrace("This name is already listed so a new score cannot be posted that is not better than the existing score.");
display();
_parent.reset();
} else {
scores = new LoadVars();
scores.newscore = newScore;
scores.newname = _root.memberName;
scores.gid = _root.gameID;
scores.action = "insert";
entered = true;
scores.sendAndLoad(_root.scoreUrl, scores, "GET");
scores.onLoad = function (success) {
for (prop in scores) {
liveTrace((prop + "=") + scores[prop]);
}
display();
showNameEnter();
liveTrace("App has submitted the high score with success: " + success);
};
}
} else {
liveTrace("no name");
display();
_parent.reset();
}
entered = false;
};
init();
Symbol 68 MovieClip Frame 1
stop();
Symbol 70 Button
on (release) {
if (goals[0] == 100) {
goals[0] = 0;
} else {
goals[0] = 100;
}
}
Symbol 73 MovieClip Frame 1
start = function () {
trace("start function");
_parent.game.gotoAndPlay("stop");
gotoAndPlay ("start");
};
stop();
Symbol 73 MovieClip Frame 2
trace("on frame");
Symbol 73 MovieClip Frame 3
stop();
Symbol 73 MovieClip Frame 15
stop();
Symbol 73 MovieClip Frame 18
play();
Symbol 76 MovieClip Frame 1
function start() {
trace("start function");
_parent.idle.gotoAndPlay("stop");
gotoAndPlay ("start");
}
function stop() {
gotoAndPlay ("stop");
}
stop();
Symbol 76 MovieClip Frame 4
stop();
Symbol 76 MovieClip Frame 15
stop();
Symbol 76 MovieClip Frame 18
play();
Symbol 78 MovieClip Frame 1
function start() {
gotoAndPlay (2);
}
stop();
Symbol 78 MovieClip Frame 2
trace("sound:shoot");
trace("sound:shoot");
Symbol 79 MovieClip Frame 1
start = function () {
trace("start function");
_parent.game.gotoAndPlay("stop");
gotoAndPlay ("start");
};
stop();
Symbol 79 MovieClip Frame 2
trace("on frame");
Symbol 79 MovieClip Frame 3
stop();
Symbol 79 MovieClip Frame 15
stop();
Symbol 79 MovieClip Frame 18
play();
Symbol 84 MovieClip Frame 1
function start() {
gotoAndPlay (2);
}
caller = 0;
stop();
Symbol 84 MovieClip Frame 2
play();
Symbol 84 MovieClip Frame 3
caller++;
if (caller > 3) {
caller = 1;
}
gotoAndStop("call" + caller);
Symbol 84 MovieClip Frame 9
stop();
Symbol 84 MovieClip Frame 14
stop();
Symbol 84 MovieClip Frame 20
stop();
Symbol 86 MovieClip Frame 1
function start() {
gotoAndPlay (2);
}
stop();
Symbol 87 MovieClip Frame 1
function start() {
gotoAndPlay (2);
}
stop();
Symbol 87 MovieClip Frame 2
trace("sound:shoot");
Symbol 88 MovieClip Frame 1
function start() {
gotoAndPlay (2);
}
stop();
Symbol 88 MovieClip Frame 2
trace("sound:select");
Symbol 88 MovieClip Frame 4
play();
Symbol 89 MovieClip Frame 1
instance = new Array();
soundbutton.tabEnabled = false;
names = ["this", "music", "drop", "buzzer"];
goals = [100, 100, 100, 100, 100, 0];
volumes = [100, 100, 100, 100, 100, 0];
adjustments = [5, 5, 4, 5, 10, 10];
i = 0;
while (i < names.length) {
instance[i] = new Sound(eval (names[i]));
instance[i].setVolume(volumes[i]);
i++;
}
onEnterFrame = function () {
i = 0;
while (i < names.length) {
if (goals[i] < volumes[i]) {
volumes[i] = volumes[i] - adjustments[i];
} else if (goals[i] > volumes[i]) {
volumes[i] = volumes[i] + adjustments[i];
}
if (Math.abs(goals[i] - volumes[i]) < adjustments[i]) {
volumes[i] - goals[i];
}
instance[i].setVolume(volumes[i]);
i++;
}
frame = int(volumes[0] / 10) + 1;
speaker.gotoAndStop(frame);
};
Symbol 89 MovieClip Frame 2
stop();
Symbol 91 MovieClip Frame 1
changeColor = function (percent) {
_parent.myTransform.rb = 3 * percent;
_parent.myTransform.gb = 3 * percent;
_parent.myTransform.bb = 2.55 * percent;
_parent.myColor.setTransform(_parent.myTransform);
};
changeColor(0);
stop();
Symbol 91 MovieClip Frame 2
changeColor(10);
Symbol 91 MovieClip Frame 3
changeColor(20);
Symbol 91 MovieClip Frame 4
changeColor(30);
Symbol 91 MovieClip Frame 5
changeColor(40);
Symbol 91 MovieClip Frame 6
changeColor(50);
Symbol 91 MovieClip Frame 7
changeColor(60);
Symbol 91 MovieClip Frame 8
changeColor(80);
Symbol 91 MovieClip Frame 9
changeColor(100);
if (destination == "nextShot") {
_parent.game.nextShot();
} else if (destination == "resetGame") {
_parent.game.init();
} else {
_parent.gotoAndStop(destination);
}
Symbol 91 MovieClip Frame 10
changeColor(80);
Symbol 91 MovieClip Frame 11
changeColor(60);
Symbol 91 MovieClip Frame 12
changeColor(40);
Symbol 91 MovieClip Frame 13
changeColor(30);
Symbol 91 MovieClip Frame 14
changeColor(20);
Symbol 91 MovieClip Frame 15
changeColor(10);
Symbol 95 MovieClip Frame 1
_visible = false;
Symbol 99 MovieClip Frame 1
stop();
Symbol 99 MovieClip Frame 2
playing = true;
_root.sounds.sfx.gotoAndStop("flashBulb");
Symbol 100 MovieClip Frame 1
stop();
Symbol 100 MovieClip Frame 2
playing = true;
_root.sounds.sfx.gotoAndStop("flashBulb");
Symbol 101 MovieClip Frame 1
stop();
Symbol 101 MovieClip Frame 2
playing = true;
_root.sounds.sfx.gotoAndStop("flashBulb");
Symbol 102 MovieClip Frame 1
stop();
Symbol 102 MovieClip Frame 2
playing = true;
_root.sounds.sfx.gotoAndStop("flashBulb");
Symbol 103 MovieClip Frame 1
stop();
Symbol 103 MovieClip Frame 2
playing = true;
_root.sounds.sfx.gotoAndStop("flashBulb");
Symbol 104 MovieClip Frame 1
stop();
Symbol 104 MovieClip Frame 2
playing = true;
_root.sounds.sfx.gotoAndStop("flashBulb");
Symbol 109 MovieClip Frame 1
stop();
Instance of Symbol 99 MovieClip "flash4" in Symbol 109 MovieClip Frame 1
onClipEvent (load) {
spread = 70;
wide = spread / 2;
initx = _x;
inity = _y;
}
onClipEvent (enterFrame) {
if (!playing) {
r = random(_parent.flash_frequency);
if (r == 1) {
_x = ((initx + random(spread)) - wide);
s = random(spread) - wide;
_y = (inity + s);
_xscale = (100 + s);
_yscale = (100 + s);
play();
}
}
}
Instance of Symbol 100 MovieClip "flash0" in Symbol 109 MovieClip Frame 1
onClipEvent (load) {
spread = 70;
wide = spread / 2;
initx = _x;
inity = _y;
}
onClipEvent (enterFrame) {
if (!playing) {
r = random(_parent.flash_frequency);
if (r == 1) {
_x = ((initx + random(spread)) - wide);
s = random(spread) - wide;
_y = (inity + s);
_xscale = (100 + s);
_yscale = (100 + s);
play();
}
}
}
Instance of Symbol 101 MovieClip "flash2" in Symbol 109 MovieClip Frame 1
onClipEvent (load) {
spread = 70;
wide = spread / 2;
initx = _x;
inity = _y;
}
onClipEvent (enterFrame) {
if (!playing) {
r = random(_parent.flash_frequency);
if (r == 1) {
_x = ((initx + random(spread)) - wide);
s = random(spread) - wide;
_y = (inity + s);
_xscale = (100 + s);
_yscale = (100 + s);
play();
}
}
}
Instance of Symbol 102 MovieClip "flash3" in Symbol 109 MovieClip Frame 1
onClipEvent (load) {
spread = 70;
wide = spread / 2;
initx = _x;
inity = _y;
}
onClipEvent (enterFrame) {
if (!playing) {
r = random(_parent.flash_frequency);
if (r == 1) {
_x = ((initx + random(spread)) - wide);
s = random(spread) - wide;
_y = (inity + s);
_xscale = (100 + s);
_yscale = (100 + s);
play();
}
}
}
Instance of Symbol 103 MovieClip "flash5" in Symbol 109 MovieClip Frame 1
onClipEvent (load) {
spread = 70;
wide = spread / 2;
initx = _x;
inity = _y;
}
onClipEvent (enterFrame) {
if (!playing) {
r = random(_parent.flash_frequency);
if (r == 1) {
_x = ((initx + random(spread)) - wide);
s = random(spread) - wide;
_y = (inity + s);
_xscale = (100 + s);
_yscale = (100 + s);
play();
}
}
}
Instance of Symbol 104 MovieClip "flash1" in Symbol 109 MovieClip Frame 1
onClipEvent (load) {
spread = 70;
wide = spread / 2;
initx = _x;
inity = _y;
}
onClipEvent (enterFrame) {
if (!playing) {
r = random(_parent.flash_frequency);
if (r == 1) {
_x = ((initx + random(spread)) - wide);
s = random(spread) - wide;
_y = (inity + s);
_xscale = (100 + s);
_yscale = (100 + s);
play();
}
}
}
Symbol 116 MovieClip Frame 1
stop();
Symbol 120 MovieClip Frame 1
stop();
Symbol 128 MovieClip Frame 1
stop();
Symbol 132 MovieClip Frame 1
stop();
Symbol 136 MovieClip Frame 1
stop();
Symbol 143 MovieClip Frame 1
stop();
Symbol 146 MovieClip Frame 1
stop();
Symbol 149 MovieClip Frame 1
stop();
Symbol 152 MovieClip Frame 1
stop();
Symbol 163 MovieClip Frame 1
stop();
Symbol 163 MovieClip Frame 40
stop();
Symbol 163 MovieClip Frame 41
play();
Symbol 164 MovieClip Frame 1
stop();
Symbol 534 MovieClip Frame 1
stop();
Symbol 534 MovieClip Frame 2
stop();
Symbol 534 MovieClip Frame 14
_parent.bouncePower = 7;
Symbol 534 MovieClip Frame 33
stop();
Symbol 534 MovieClip Frame 37
_parent.bouncePower = 5.5;
Symbol 534 MovieClip Frame 58
stop();
Symbol 534 MovieClip Frame 60
_parent.bouncePower = 5;
Symbol 534 MovieClip Frame 88
stop();
Symbol 534 MovieClip Frame 90
_parent.bouncePower = 5;
diving = true;
Symbol 534 MovieClip Frame 115
stop();
Symbol 534 MovieClip Frame 116
_parent.bouncePower = 7;
diving = true;
Symbol 534 MovieClip Frame 147
stop();
Symbol 534 MovieClip Frame 151
_parent.bouncePower = 5;
diving = true;
Symbol 534 MovieClip Frame 183
stop();
Symbol 534 MovieClip Frame 184
_parent.bouncePower = 5;
diving = true;
Symbol 534 MovieClip Frame 216
stop();
Symbol 534 MovieClip Frame 217
_parent.bouncePower = 5;
diving = true;
Symbol 534 MovieClip Frame 245
stop();
Symbol 534 MovieClip Frame 246
_parent.bouncePower = 5;
diving = true;
Symbol 534 MovieClip Frame 274
stop();
Symbol 534 MovieClip Frame 276
_parent.bouncePower = 5;
diving = true;
Symbol 534 MovieClip Frame 290
stop();
Symbol 534 MovieClip Frame 291
_parent.bouncePower = 5;
diving = true;
Symbol 534 MovieClip Frame 306
stop();
Symbol 534 MovieClip Frame 307
_parent.bouncePower = 5;
diving = true;
Symbol 534 MovieClip Frame 323
stop();
Symbol 534 MovieClip Frame 324
_parent.bouncePower = 5;
diving = true;
Symbol 534 MovieClip Frame 335
stop();
Symbol 534 MovieClip Frame 336
_parent.bouncePower = 5;
diving = true;
Symbol 534 MovieClip Frame 366
stop();
Symbol 534 MovieClip Frame 367
_parent.bouncePower = 3;
diving = true;
Symbol 534 MovieClip Frame 397
stop();
Symbol 536 Button
on (press) {
doAim();
}
on (release, releaseOutside) {
doShoot();
}
Symbol 545 MovieClip Frame 1
stop();
Symbol 548 MovieClip Frame 1
stop();
Symbol 554 MovieClip Frame 1
_visible = false;
Symbol 564 Button
on (release) {
_root.scores.display();
_parent.fade("resetGame");
}
Symbol 565 MovieClip Frame 1
distance = function (x1, y1, x2, y2) {
var _local2 = x1 - x2;
var _local1 = y1 - y2;
return(Math.sqrt((_local2 * _local2) + (_local1 * _local1)));
};
magnitude = function (s1, s2, s3) {
var _local1 = distance(0, s1, 0, s2);
return(distance(0, _local1, 0, s3));
};
findDeflect = function (m1, m2) {
var _local3 = Math.atan(m1) * rad;
var _local5 = Math.atan(m2) * rad;
var _local1 = _local5 - _local3;
if (_local1 < 0) {
_local1 = _local1 + 180;
}
var _local4 = (_local3 - _local1) + 180;
var _local2 = new Object();
_local2.x = Math.cos(_local4 / rad);
_local2.z = Math.sin(_local4 / rad);
return(_local2);
};
doBounce = function (sx, sz, px, pz, slope, bounce) {
m1 = slope;
m2 = sz / sx;
p = findDeflect(m1, m2);
b1 = pz - (m1 * px);
b2 = (pz - sz) - (m1 * (px - sx));
if (b2 < b1) {
p.x = p.x * -1;
p.z = p.z * -1;
}
var _local1 = distance(0, 0, sx, sz);
ball.speed.x = (p.x * bounce) * _local1;
ball.speed.z = (p.z * bounce) * _local1;
ball.speed.y = ball.speed.y * bounce;
};
convert = function (pos) {
var _local1 = new Object();
var _local2 = (1 / (pos.z * 0.1)) * dim;
_local1.yscale = _local2 * size;
_local1.xscale = _local2 * size;
var _local5 = (pos.x - vanx) * (_local2 / (dim / inc));
var _local4 = (-(pos.y - vany)) * (_local2 / (dim / inc));
_local1.x = vanx + _local5;
_local1.y = vany + _local4;
return(_local1);
};
redraw = function (object) {
if (object.shadow != undefined) {
object.shadow.position.x = object.position.x;
object.shadow.position.y = floor;
object.shadow.position.z = object.position.z;
var _local2 = convert(object.shadow.position);
object.shadow._x = _local2.x;
object.shadow._y = _local2.y;
object.shadow._xscale = _local2.xscale;
object.shadow._yscale = _local2.yscale;
}
var _local2 = convert(object.position);
object._x = _local2.x;
object._y = _local2.y;
object._xscale = _local2.xscale + 1;
object._yscale = _local2.yscale + 1;
if (object == ball) {
if ((object.position.z < 100) or (!ball.gravity)) {
object._visible = false;
object.shadow._visible = false;
} else {
object._visible = true;
object.shadow._visible = true;
}
}
};
translate = function (object) {
if (object.gravity) {
object.speed.y = object.speed.y - gravity;
if (bounces == 0) {
object.speed.x = object.speed.x - (gravity * bendFactor);
}
}
object.position.x = object.position.x + object.speed.x;
object.position.y = object.position.y + object.speed.y;
object.position.z = object.position.z + object.speed.z;
if (object.position.y <= floor) {
object.position.y = floor;
object.speed.x = object.speed.x * 0.97;
object.speed.y = object.speed.y * -0.5;
object.speed.z = object.speed.z * 0.97;
if (!object.ready) {
bounces++;
if (bounces >= 10) {
}
}
}
object.magnitude = magnitude(object.speed.x, object.speed.y, object.speed.z);
mag = object.magnitude;
};
pipeline = function (who) {
translate(who);
redraw(who);
};
doKeys = function () {
if (Key.isDown(37)) {
ball.position.x = ball.position.x - 25;
}
if (Key.isDown(39)) {
ball.position.x = ball.position.x + 25;
}
if (Key.isDown(38)) {
ball.position.z = ball.position.z + 25;
}
if (Key.isDown(40)) {
ball.position.z = ball.position.z - 25;
}
};
doHit = function (who) {
var _local8 = who._width;
var _local7 = ball._x - who.left;
var _local6 = _local7 / _local8;
var _local5 = Math.abs(who.farEdge - who.nearEdge);
if (who.nearEdge < who.farEdge) {
var _local3 = who.nearEdge + (_local5 * _local6);
} else {
var _local3 = who.farEdge + (_local5 * _local6);
}
if (!who.hitAlready) {
if (((ball.position.z > (_local3 - ball.speed.z)) and (ball.position.z < (_local3 + ball.speed.z))) and who.hitTest(ball._x + _x, ball._y + _y, true)) {
who.hitAlready = true;
who.mySound.start();
bounces = 1;
doBounce(ball.speed.x, ball.speed.z, ball.position.x, ball.position.z, who.slope, who.bounce);
trace("Hit: " + who._name);
for (var _local4 in makeSurface[shot]) {
if (who == makeSurface[shot][_local4]) {
_root.sounds.goal.start();
doFlash();
madeGoal = true;
if (shot == 2) {
timing = false;
}
}
}
}
}
if ((ball.position.z >= (_local3 + ball.speed.z)) and (ball.getDepth() > who.pic.getDepth())) {
ball.swapDepths(who.pic.getDepth() - 1);
}
if ((ball.position.z < (_local3 + ball.speed.z)) and (ball.getDepth() < who.pic.getDepth())) {
ball.swapDepths(who.pic.getDepth() + 1);
}
jimbo = ball.getDepth();
};
checkCollisions = function () {
for (var _local1 in agent) {
doHit(agent[_local1].clip);
}
};
doAim = function () {
if (((!aiming) and (!gameOver)) and (!flying)) {
timing = true;
dir = 1;
arrow.inside.gotoAndStop(21);
guage._visible = true;
arrow._visible = true;
aiming = true;
aimx = _xmouse;
aimy = _ymouse;
Mouse.hide();
}
};
doShoot = function () {
if (!flying) {
_root.sounds.kick.start();
bendFactor = (-guage.bender._x) / 50;
count = 0;
flying = true;
var _local2 = (arrow.inside._yscale - 100) * 0.2;
rad = 57.2957795130823;
var _local5 = (arrow.inside._currentframe - 41) * 1.5;
Mouse.show();
arrow._visible = false;
guage._visible = false;
aiming = false;
powers = [600, 800, 800];
var _local4 = powers[shot];
ball.gravity = true;
ball.ready = false;
ball.speed.z = Math.cos(_local5 / rad) * _local4;
ball.speed.x = (-Math.sin(_local5 / rad)) * _local4;
var _local3 = ball.speed.z;
ball.speed.z = Math.cos(_local2 / rad) * _local3;
ball.speed.y = 50 + (Math.sin(_local2 / rad) * _local3);
shootBall._visible = false;
ball._visible = true;
shadow._visible = true;
mySector = findSector();
wait = setInterval(doNextShot, 2000);
}
};
moveArrow = function () {
if (aiming) {
guage.bender._x = guage.bender._x + (8 * dir);
if ((guage.bender._x >= 64) or (guage.bender._x <= -64)) {
dir = dir * -1;
}
var _local1 = 41 + Math.floor((aimx - _xmouse) * 0.15);
_local1 = Math.max(_local1, 1);
_local1 = Math.min(_local1, 81);
arrow.inside.gotoAndStop(_local1);
var _local2 = -(aimy - _ymouse);
arrow.inside._yscale = Math.max(120, 100 + _local2);
arrow.inside._yscale = Math.min(250, 100 + _local2);
arrow.inside._yscale = Math.max(arrow.inside._yscale, 120);
trace(arrow.inside._yscale);
}
};
findSector = function () {
ob = testBall;
ob.gravity = true;
ob.speed = new Object();
ob.speed.x = ball.speed.x;
ob.speed.y = ball.speed.y;
ob.speed.z = ball.speed.z;
ob.position = new Object();
ob.position.x = ball.position.x;
ob.position.y = ball.position.y;
ob.position.z = ball.position.z;
var _local7 = (goalFace.nearEdge + goalFace.farEdge) / 2;
var _local6 = 0;
while ((ob.position.z < _local7) and (_local6 < 50)) {
_local6++;
translate(ob);
redraw(ob);
}
bounces = 0;
var _local4 = "";
tags = ["left", "left", "s_left_", "middle", "s_right_", "right", "right"];
var _local3 = bg.corner0._x;
var _local9 = bg.corner1._x;
var _local5 = (_local9 - _local3) / tags.length;
var _local8 = bg.corner0._y;
var _local11 = bg.corner1._y;
var _local10 = _local11 - _local8;
var _local1 = [];
var _local2 = 0;
while (_local2 < tags.length) {
_local1[_local2] = new Object();
_local1[_local2].tag = tags[_local2];
_local1[_local2].left = _local3 + (_local5 * _local2);
_local1[_local2].right = _local3 + (_local5 * (_local2 + 1));
_local2++;
}
var _local13 = _local8 + (_local10 / 3);
var _local12 = _local8 + ((_local10 / 3) * 2);
_local4 = "left";
_local2 = 0;
while (_local2 < tags.length) {
if ((ob._x >= _local1[_local2].left) and (ob._x < _local1[_local2].right)) {
_local4 = _local1[_local2].tag;
}
_local2++;
}
if (ob._x >= _local9) {
_local4 = "right";
}
if (ob._y < _local13) {
_local4 = _local4 + "high";
} else if (ob._y > _local12) {
_local4 = _local4 + "low";
} else {
_local4 = _local4 + "middle";
}
return(_local4);
};
hideWall = function () {
if (ball.speed.z >= 0) {
var _local1 = ball.position.z - wall.nearEdge;
_local1 = Math.max(0, _local1);
_local1 = _local1 * 0.015;
_local1 = Math.max(0, 100 - _local1);
wallPic._alpha = _local1;
}
};
checkGoalie = function () {
if (flying) {
count++;
if ((count == goalie.goFrame) and (ball.speed.z > 0)) {
goalie.gotoAndPlay(mySector);
}
if ((count == goalie.testFrame) and (ball.speed.z > 0)) {
if (goalie.hitter.hitTest(ball._x + _x, ball._y + _y, true)) {
_root.sounds.kick.start();
blocked = true;
bounces = 1;
ball.speed.z = ball.speed.z * -0.1;
}
}
if ((count <= goalie.testFrame) or blocked) {
goalie.swapDepths(Math.min(ball.getDepth() - 10, wallPic.getDepth() - 10));
} else {
goalie.swapDepths(Math.min(ball.getDepth() + 10, wallPic.getDepth() - 10));
}
}
goalie.hitter._visible = false;
goalie.hitter.gotoAndStop(goalie._currentframe);
};
onEnterFrame = function () {
goalie.hitter.gotoAndStop(goalie._currentframe);
doKeys();
pipeline(ball);
checkCollisions();
moveArrow();
hideWall();
checkGoalie();
doTime();
resetGame._visible = time > 0.1;
clickAndHold._visible = time < 0.01;
};
Obstacle = function (clip, nearEdge, farEdge, pic, bounce, depth, slope, mySound) {
clip.hitAlready = false;
clip.left = clip._x - (clip._width / 2);
clip.right = clip._x + (clip._width / 2);
clip.nearEdge = nearEdge;
clip.farEdge = farEdge;
clip.bounce = bounce;
clip.pic = pic;
clip.gotoAndStop(shot + 1);
clip.pic.gotoAndStop(shot + 1);
clip.slope = slope;
clip.pic.swapDepths(depth);
clip._visible = false;
clip.mySound = mySound;
this.clip = clip;
};
setUpBall = function (shot) {
ball.ready = true;
ball.gravity = false;
ball.shadow = shadow;
ball.position = new Object();
ball.speed = new Object();
ball.position.x = 0;
ball.position.y = floor;
ball.position.z = 1000;
ball.speed.x = 0;
ball.speed.z = 0;
ball.speed.y = 0;
wall.swapDepths(8000);
ball.swapDepths(10000);
shootBall.swapDepths(9300);
shadow.position = new Object();
shadow.speed = new Object();
ball._visible = false;
shadow._visible = false;
shootBall._visible = true;
bounces = 0;
pipeline(ball);
};
setUpGoalie = function (shot) {
var _local4 = [4.8, 11.9, -6.2];
var _local3 = [12.7, 12.1, 4.1];
var _local2 = [67.7, 44, 25];
goalie._xscale = _local2[shot];
goalie._yscale = _local2[shot];
goalie._x = _local4[shot];
goalie._y = _local3[shot];
goalie.swapDepths(6000);
goalie.hitter._visible = false;
tests = [7, 12, 12];
goes = [1, 8, 8];
goalie.goFrame = goes[shot];
goalie.testFrame = tests[shot];
goalie.gotoAndStop("idle");
};
setUpField = function (shot) {
agent = [];
makeSurface = [[netBack, netSide1, netSide2], [netBack, netSide1], [netBack, netSide2]];
if (shot == 0) {
agent[0] = new Obstacle(goalFace, 6125, 6125, goalFacePic, 0.2, 5000, 1, _root.sounds.bonk);
agent[1] = new Obstacle(netBack, 7900, 7900, netBackPic, 0.04, 3000, 1, null);
agent[2] = new Obstacle(netSide1, 6125, 7900, netSide1Pic, 0.001, 3500, 100, null);
agent[3] = new Obstacle(netSide2, 7900, 6125, netSide2Pic, 0.001, 4000, 100, null);
agent[4] = new Obstacle(signs, 9200, 9200, signsPic, 0.1, 2000, 1, _root.sounds.bounce);
agent[5] = new Obstacle(wall, 4500, 4500, wallPic, 0.25, 7000, 0, _root.sounds.kick);
}
if (shot == 1) {
agent[0] = new Obstacle(goalFace, 9525, 12825, goalFacePic, 0.7, 5000, 1, _root.sounds.bonk);
agent[1] = new Obstacle(netBack, 10600, 13900, netBackPic, 0.1, 3000, 1);
agent[2] = new Obstacle(netSide1, 13900, 13000, netSide1Pic, 0.1, 2900, -1);
agent[3] = new Obstacle(netSide2, 10600, 9525, netSide2Pic, 0.1, 4000, -1);
agent[4] = new Obstacle(signs, 7375, 18000, signsPic, 0.6, 2000, 1, _root.sounds.bounce);
agent[5] = new Obstacle(wall, 4500, 4500, wallPic, 0.25, 7000, 0, _root.sounds.kick);
}
if (shot == 2) {
agent[0] = new Obstacle(goalFace, 14275, 15050, goalFacePic, 0.3, 5000, 0, _root.sounds.bonk);
agent[1] = new Obstacle(netBack, 15300, 16000, netBackPic, 0.15, 3000, 0, null);
agent[2] = new Obstacle(netSide1, 15050, 16000, netSide1Pic, 0.15, 3500, 100, null);
agent[3] = new Obstacle(netSide2, 14275, 15300, netSide2Pic, 0.15, 4000, 100, null);
agent[4] = new Obstacle(signs, 17000, 18000, signsPic, 0.2, 2000, 0, _root.sounds.bounce);
agent[5] = new Obstacle(wall, 5200, 5200, wallPic, 0.25, 7000, 0, _root.sounds.kick);
}
bg.gotoAndStop(shot + 1);
};
setUpGuage = function (shot) {
flying = false;
aiming = false;
arrow._visible = false;
arrow.swapDepths(9000);
guage.swapDepths(9500);
guage._visible = false;
guage.bender._x = 0;
bendFactor = 1.5;
};
doFlash = function () {
bg.flash0.gotoAndPlay(2);
bg.flash1.gotoAndPlay(2);
bg.flash2.gotoAndPlay(2);
bg.flash3.gotoAndPlay(2);
bg.flash4.gotoAndPlay(2);
bg.flash5.gotoAndPlay(2);
};
doTime = function () {
if (timing) {
framecount++;
time = (framecount / 24) + (random(10) / 1000);
time = int(time * 1000) / 1000;
displayTime = "TIME: " + time;
}
if (time < 0.2) {
displayTime = "TIME: 0.00";
} else if (timing) {
time = (framecount / 24) + (random(10) / 1000);
time = int(time * 1000) / 1000;
displayTime = "TIME: " + time;
}
};
doNextShot = function () {
clearInterval(wait);
if (time < 0.5) {
_parent.bogus = true;
}
_parent.fade("nextShot");
};
nextShot = function () {
if (madeGoal) {
shot++;
}
if (shot < 3) {
blocked = false;
madeGoal = false;
floor = -1000;
inc = 20;
vanx = 0;
vanys = [-30, -15, -15];
vany = vanys[shot];
dim = 14000;
gravity = 17;
size = 0.4;
rad = 57.2957795130823;
setUpGuage(shot);
setUpGoalie(shot);
setUpField(shot);
setUpBall(shot);
} else {
_root.sounds.idle.start();
timing = false;
gameOver = true;
_parent.score = time;
_parent.scoreCounts = true;
_parent.gotoAndStop("results");
}
};
init = function () {
_root.scoreCounts = false;
time = 0;
clearInterval(wait);
displayTime = "TIME: 0.00";
timing = false;
framecount = 0;
gameOver = false;
madeGoal = false;
shot = 0;
nextShot();
};
init();
Instance of Symbol 164 MovieClip "arrow" in Symbol 565 MovieClip Frame 1
/* no clip actions */