Frame 1
this._lockroot = true;
loadSprite = function () {
_root.tvc_media = "351";
_root.createEmptyMovieClip("TVC_mc", 0);
System.security.allowDomain("http://www.viralchart.com");
TVC_mc.loadMovie("http://www.viralchart.com/tvc_tracker.swf");
};
loadSprite();
System.security.allowDomain("http://www.tamba.co.uk");
System.security.allowDomain("http://www.newgrounds.com");
preLoad = function () {
loaderBar_mc._width = (getBytesLoaded() / getBytesTotal()) * 300;
if (getBytesLoaded() == getBytesTotal()) {
clearInterval(preloadINT);
gotoAndStop ("TAMBAInternet");
}
};
preloadINT = setInterval(preLoad, 40);
stop();
Frame 5
stop();
Frame 6
function NetServiceProxy(nc, serviceName, client) {
if (nc != null) {
this.nc = nc;
this.serviceName = serviceName;
this.client = client;
}
}
function addScore() {
_root.updating = "UPDATING SCORES PLEASE WAIT";
_root.bt1._visible = false;
_root.bt2._visible = false;
_root.bt3._visible = false;
gameService.updatePoints(updatePoints_responder, strUniqueID, _root.points);
}
trace("***** running NetServices");
load("RecordSet.as");
_global.NetServiceProxyResponder = function (service, methodName) {
this.service = service;
this.methodName = methodName;
};
NetServiceProxyResponder = _global.NetServiceProxyResponder;
NetServiceProxyResponder.prototype.onResult = function (result) {
var _local2 = this.service.client;
result._setParentService(this.service);
var _local3 = this.methodName + "_Result";
if (typeof(_local2[_local3]) == "function") {
_local2[_local3](result);
} else if (typeof(_local2.onResult) == "function") {
_local2.onResult(result);
} else {
NetServices.trace("NetServices", "info", 1, (_local3 + " was received from server: ") + result);
}
};
NetServiceProxyResponder.prototype.onStatus = function (result) {
var _local5 = this.service.client;
var _local6 = this.methodName + "_Status";
if (typeof(_local5[_local6]) == "function") {
_local5[_local6](result);
} else if (typeof(_local5.onStatus) == "function") {
_local5.onStatus(result);
} else if (typeof(_root.onStatus) == "function") {
_root.onStatus(result);
} else if (typeof(_global.System.onStatus) == "function") {
_global.System.onStatus(result);
} else {
NetServices.trace("NetServices", "info", 2, (((_local6 + " was received from server: ") + result.level) + " ") + result.description);
}
};
_global.NetServiceProxy = NetServiceProxy;
Object.registerClass("NetServiceProxy", NetServiceProxy);
NetServiceProxy.prototype._setParentService = function (service) {
this.nc = service.nc;
this.client = service.client;
};
NetServiceProxy.prototype.__resolve = function (methodName) {
var _local3 = function () {
if (this.client != null) {
arguments.unshift(new NetServiceProxyResponder(this, methodName));
} else if (typeof(arguments[0].onResult) != "function") {
NetServices.trace("NetServices", "warning", 3, "There is no defaultResponder, but no responder was given in call to " + methodName);
arguments.unshift(new NetServiceProxyResponder(this, methodName));
}
arguments.unshift((this.serviceName + ".") + methodName);
return(this.nc.call.apply(this.nc, arguments));
};
return(_local3);
};
NetConnection.prototype.getService = function (serviceName, client) {
var _local2 = new NetServiceProxy(this, serviceName, client);
return(_local2);
};
NetConnection.prototype.setCredentials = function (userid, password) {
this.addHeader("Credentials", false, {userid:userid, password:password});
};
NetConnection.prototype.RequestPersistentHeader = function (info) {
this.addHeader(info.name, info.mustUnderstand, info.data);
};
NetConnection.prototype.RequestUrlRewrite = function (urlSuffix) {
this.__urlSuffix = urlSuffix;
if (this.__originalUrl == null) {
this.__originalUrl = this.uri;
}
var _local2 = this.__originalUrl + urlSuffix;
this.connect(_local2);
};
NetConnection.prototype.clone = function () {
var _local2 = new NetConnection();
_local2.connect(((this.__originalUrl == null) ? (this.uri) : (this.__originalUrl)));
if (this.__urlSuffix != null) {
_local2.RequestUrlRewrite(this.__urlSuffix);
}
return(_local2);
};
if (_global.NetServices == null) {
_global.NetServices = new Object();
NetServices = _global.NetServices;
NetServices.gatewayUrl = gatewayUrl;
NetServices.urlSuffix = urlSuffix;
}
NetServices.setDefaultGatewayUrl = function (url) {
NetServices.defaultGatewayUrl = url;
};
NetServices.setGatewayUrl = function (url) {
NetServices.gatewayUrl = url;
};
NetServices.createGatewayConnection = function (url) {
if (url == undefined) {
if (NetServices.isHttpUrl(_root._url)) {
url = NetServices.gatewayUrl;
if (url == undefined) {
url = NetServices.defaultGatewayUrl;
if (url != undefined) {
if (NetServices.isHttpUrl(url)) {
var _local6 = url.indexOf("/", 8);
if (_local6 >= 0) {
url = url.substring(_local6);
}
}
var _local4 = NetServices.getHostUrl();
if (_local4 != null) {
url = _local4 + url;
}
}
}
} else {
url = NetServices.defaultGatewayUrl;
}
}
if (url == undefined) {
NetServices.trace("NetServices", "warning", 4, "createGatewayConnection - gateway url is undefined");
return(null);
}
var _local5 = new NetConnection();
_local5.connect(url);
if (NetServices.urlSuffix != null) {
this.RequestUrlRewrite(NetServices.urlSuffix);
}
return(_local5);
};
NetServices.getHostUrl = function () {
if (!NetServices.isHttpUrl(_root._url)) {
return(null);
}
var _local2 = _root._url.indexOf("/", 8);
if (_local2 < 0) {
return(null);
}
return(_root._url.substring(0, _local2));
};
NetServices.isHttpUrl = function (url) {
return((url.indexOf("http://") == 0) || (url.indexOf("https://") == 0));
};
NetServices.trace = function (who, severity, number, message) {
var _local1 = (((((who + " ") + severity) + " ") + number) + ": ") + message;
trace(_local1);
NetDebug.traceNetServices(who, severity, number, message);
};
NetServices.getVersion = function () {
return(1);
};
strTicketID = s;
intSpinLocked = 0;
_global.strRootURL = "http://www.tamba.co.uk/tim-ball";
NetServices.setDefaultGatewayUrl(_global.strRootURL + "/gateway.php");
conn = NetServices.createGatewayConnection();
checkTicket_responder = new Object();
checkTicket_responder.onResult = function (arrUserInfo) {
_level0.currentPoints = arrUserInfo.points * 1;
strUniqueID = arrUserInfo.uniqueid;
strName = arrUserInfo.fullname;
};
updatePoints_responder = new Object();
updatePoints_responder.onResult = function () {
_root.updating = "";
_root.bt1._visible = true;
_root.bt2._visible = true;
_root.bt3._visible = true;
_root.dbstatus.text = "DB Updated!";
};
gameService = conn.getService("services");
gameService.checkTicket(checkTicket_responder, strTicketID);
Frame 25
function updateVector(v, frompoints) {
if (frompoints) {
v.vx = v.p1.x - v.p0.x;
v.vy = v.p1.y - v.p0.y;
} else {
v.p1.x = v.p0.x + v.vx;
v.p1.y = v.p0.y + v.vy;
}
v.len = Math.sqrt((v.vx * v.vx) + (v.vy * v.vy));
if (v.len > 0) {
v.dx = v.vx / v.len;
v.dy = v.vy / v.len;
} else {
v.dx = 0;
v.dy = 0;
}
v.rx = -v.dy;
v.ry = v.dx;
v.lx = v.dy;
v.ly = -v.dx;
return(v);
}
function findIntersection(v1, v2) {
var _local2 = {};
_local2.vx = v1.p1.x - v2.p0.x;
_local2.vy = v1.p1.y - v2.p0.y;
var _local6 = (_local2.vx * v2.dx) + (_local2.vy * v2.dy);
if (_local6 < 0) {
var _local5 = _local2;
} else {
var _local3 = {};
_local3.vx = v1.p1.x - v2.p1.x;
_local3.vy = v1.p1.y - v2.p1.y;
_local6 = (_local3.vx * v2.dx) + (_local3.vy * v2.dy);
if (_local6 > 0) {
var _local5 = _local3;
} else {
var _local5 = projectVector(_local2, v2.lx, v2.ly);
}
}
return(_local5);
}
function projectVector(v1, dx, dy) {
var _local2 = (v1.vx * dx) + (v1.vy * dy);
var _local1 = {};
_local1.vx = _local2 * dx;
_local1.vy = _local2 * dy;
return(_local1);
}
function bounce(v1, v2) {
var _local5 = projectVector(v1, v2.dx, v2.dy);
var _local1 = projectVector(v1, v2.lx, v2.ly);
var _local4 = {};
_local1.len = Math.sqrt((_local1.vx * _local1.vx) + (_local1.vy * _local1.vy));
if (v1.vy < 0) {
_local1.len = _local1.len * lineDecay;
}
_local1.vx = v2.lx * _local1.len;
_local1.vy = v2.ly * _local1.len;
_local4.vx = ((v1.f * v2.f) * _local5.vx) + ((v1.b * v2.b) * _local1.vx);
_local4.vy = ((v1.f * v2.f) * _local5.vy) + ((v1.b * v2.b) * _local1.vy);
return(_local4);
}
function controlBoard(ob) {
var _local3 = {x:ob.p0.x, y:ob.p0.y};
_root.board_mc.localToGlobal(_local3);
if ((((_local3.y <= 100) && (_root.board_mc._y < -15)) && (ob.vy < 0)) && (!multiball)) {
_root.board_mc._y = _root.board_mc._y - ob.vy;
}
if ((((_local3.y >= 300) && (_root.board_mc._y > -585)) && (ob.vy > 0)) && (!multiball)) {
_root.board_mc._y = _root.board_mc._y - ob.vy;
}
if (multiball) {
_root.board_mc._y = -585;
}
}
stopAllSounds();
_root.soundHolder_mc.theme_snd.start(0, 9000);
_root.soundHolder_mc.createMuteButton();
_quality = "MEDIUM";
ballsPlayed = 1;
endGame = false;
gameStarted = false;
multiball = false;
multiplier = 1;
addMultiply = false;
addUmpire = false;
_root.lives = 3;
_root.livesLeft = "BALLS - " + _root.lives;
newBall();
bottomy = 1110;
points = 0;
airDecay = 0.99;
gravity = 0.3;
lineDecay = 0.4;
maxSpeed = 35;
bouncey = 115;
ballArray = [];
restx = 580;
resty = 1150;
startx = 580;
starty = 1075;
resetBall = function (ball) {
ball.p0 = {};
ball.p0.x = ball.clip._x;
ball.p0.y = ball.clip._y;
ball.p1 = {};
ball.p1.x = ball.p0.x + ball.vx;
ball.p1.y = ball.p0.y + ball.vy;
};
i = 1;
while (i <= 3) {
name = "ball" + i;
this[name] = {};
ball = this[name];
ball.clip = _root.board_mc["pb" + i];
ball.f = 1;
ball.b = 1;
if (i > 1) {
ball.activate = false;
ball.clip._x = restx;
ball.clip._y = resty;
} else {
ball.activate = true;
ball.clip._x = startx;
ball.clip._y = starty;
}
ball.radius = ball.clip._width / 2;
ball.vx = 0;
ball.vy = 0;
resetBall(ball);
ballArray.push(ball);
i++;
}
lineArray = [];
sections = new Array(0, 39, 24, 16, 13, 24, 10, 10, 8, 7, 7);
s = 1;
while (s <= 10) {
var startPoint = (("dot" + s) + "_1");
i = 1;
while (i <= sections[s]) {
var firstDot = ((("dot" + s) + "_") + i);
var secondDot = ((("dot" + s) + "_") + (i + 1));
if (i == sections[s]) {
var secondDot = startPoint;
}
_root.board_mc[firstDot]._visible = false;
var fdx = _root.board_mc[firstDot]._x;
var fdy = _root.board_mc[firstDot]._y;
var sdx = _root.board_mc[secondDot]._x;
var sdy = _root.board_mc[secondDot]._y;
name = "v" + i;
this[name] = {};
clip = this[name];
clip.b = 1;
clip.f = 1;
clip.p0 = {};
clip.p0.x = fdx;
clip.p0.y = fdy;
clip.p1 = {};
clip.p1.x = sdx;
clip.p1.y = sdy;
clip.lineDecay = 0.09;
clip.allowed = true;
updateVector(clip, true);
lineArray.push(clip);
i++;
}
s++;
}
collisionBank = function (ob) {
if ((Math.abs(ob.vx) > ob.radius) || (Math.abs(ob.vy) > ob.radius)) {
if ((Math.abs(ob.vx) > 30) || (Math.abs(ob.vy) > 30)) {
checkAmount = 5;
} else {
checkAmount = 3;
}
} else {
checkAmount = 2;
}
s = 1;
while (s < checkAmount) {
var _local17 = ob.vx / s;
var _local16 = ob.vy / s;
ob.p1.x = ob.p0.x + _local17;
ob.p1.y = ob.p0.y + _local16;
i = 0;
while (i < lineArray.length) {
var _local6 = lineArray[i];
var _local3 = findIntersection(ob, _local6);
_local3 = updateVector(_local3, false);
var _local5 = ob.radius - _local3.len;
if ((_local5 >= 0) && (_local6.allowed)) {
ob.p1.x = ob.p1.x + (_local3.dx * _local5);
ob.p1.y = ob.p1.y + (_local3.dy * _local5);
var _local8 = {dx:_local3.lx, dy:_local3.ly, lx:_local3.dx, ly:_local3.dy, b:1, f:1};
var _local7 = bounce(ob, _local8);
ob.vx = _local7.vx;
ob.vy = _local7.vy;
}
i++;
}
t = 0;
while (t < 4) {
var _local6 = bumperArray[t];
var _local3 = ball2ball(ob, _local6);
var _local4 = (ob.radius + _local6.radius) - _local3.len;
if (_local4 >= 0) {
_root.soundHolder_mc.bumper_snd.start();
_local6.animation.play();
ob.p1.x = ob.p1.x + (_local3.dx * _local4);
ob.p1.y = ob.p1.y + (_local3.dy * _local4);
var _local8 = {dx:_local3.dy, dy:-_local3.dx, lx:_local3.dx, ly:_local3.dy, b:1, f:1};
var _local7 = bounce(ob, _local8);
ob.vx = (_local7.vx / 100) * bouncey;
ob.vy = (_local7.vy / 100) * bouncey;
_root.points = _root.points + (200 * multiplier);
}
t++;
}
i = 0;
while (i < sideBumperArray.length) {
var _local6 = sideBumperArray[i];
var _local3 = findIntersection(ob, _local6);
_local3 = updateVector(_local3, false);
var _local9 = ob.radius - _local3.len;
if (_local9 >= 0) {
if ((Math.random() * 2) > 1) {
_root.soundHolder_mc.net1.start();
} else {
_root.soundHolder_mc.net2.start();
}
_local6.animation.play();
ob.p1.x = ob.p1.x + (_local3.dx * _local9);
ob.p1.y = ob.p1.y + (_local3.dy * _local9);
var _local8 = {dx:_local3.lx, dy:_local3.ly, lx:_local3.dx, ly:_local3.dy, b:5, f:1};
var _local7 = bounce(ob, _local8);
ob.vx = _local7.vx;
ob.vy = _local7.vy;
_root.points = _root.points + (150 * multiplier);
}
i++;
}
i = 0;
while (i < flipperArray.length) {
var _local6 = flipperArray[i];
var _local3 = findIntersection(ob, _local6);
_local3 = updateVector(_local3, false);
var _local9 = ob.radius - _local3.len;
if (_local9 >= 0) {
_local6.animation.play();
ob.p1.x = ob.p1.x + (_local3.dx * _local9);
ob.p1.y = ob.p1.y + (_local3.dy * _local9);
var _local8 = {dx:_local3.lx, dy:_local3.ly, lx:_local3.dx, ly:_local3.dy, b:1, f:1};
var _local7 = bounce(ob, _local8);
ob.vx = _local7.vx;
ob.vy = _local7.vy;
}
i++;
}
i = 0;
while (i < sideRampArray.length) {
var _local6 = sideRampArray[i];
var _local3 = findIntersection(ob, _local6);
_local3 = updateVector(_local3, false);
var _local9 = ob.radius - _local3.len;
if ((_local9 >= 0) && (ob.vy < 0)) {
_root.soundHolder_mc.vroom_snd.start();
trace("PLAY ANimatioN");
_local6.animation.play();
_root.points = _root.points + (200 * multiplier);
}
i++;
}
i = 0;
while (i < MBallArray.length) {
var _local6 = MBallArray[i];
var _local3 = findIntersection(ob, _local6);
_local3 = updateVector(_local3, false);
var _local9 = ob.radius - _local3.len;
if ((_local9 >= 0) && (ob.vy < 0)) {
_root.soundHolder_mc.mBallHit_snd.start();
if (_local6.animation._currentframe == 1) {
_local6.animation.play();
}
_root.points = _root.points + (50 * multiplier);
checkMultiBallStatus();
trace("MBALL HIT");
}
i++;
}
checkUmpire(ob);
checkMultiplier(ob);
s++;
}
};
getTempPositions = function (ob) {
if (ob.vx > maxSpeed) {
ob.vx = maxSpeed;
}
if (ob.vx < (-maxSpeed)) {
ob.vx = -maxSpeed;
}
if (ob.vy > maxSpeed) {
ob.vy = maxSpeed;
}
if (ob.vy < (-maxSpeed)) {
ob.vy = -maxSpeed;
}
ob.vx = ob.vx * airDecay;
ob.vy = ob.vy * airDecay;
ob.vy = ob.vy + gravity;
ob.p1.x = ob.p0.x + ob.vx;
ob.p1.y = ob.p0.y + ob.vy;
ob.vel = Math.sqrt((ob.vx * ob.vx) + (ob.vy * ob.vy));
};
render = function (ob) {
ob.p0.x = ob.p1.x;
ob.p0.y = ob.p1.y;
ob.clip._x = ob.p0.x;
ob.clip._y = ob.p0.y;
};
controlGame = function () {
mb = 0;
while (mb <= 1) {
var _local2 = ballArray[mb];
if ((_local2.p0.y > bottomy) && (_local2.activate)) {
_local2.activate = false;
ballsPlayed = ballsPlayed + -1;
if ((ballsPlayed == 1) && (multiball)) {
multiball = false;
}
}
if (((_local2.p0.y < 575) && (_local2.clip._visible)) && (multiball)) {
_local2.clip._visible = false;
} else if (!_local2.clip._visible) {
_local2.clip._visible = true;
}
if (_local2.activate && (shot)) {
getTempPositions(_local2);
render(_local2);
collisionBank(_local2);
controlBoard(_local2);
}
mb++;
}
if (((ballsPlayed == 0) && (!endGame)) && (gameStarted)) {
_root.soundHolder_mc.loseBall_snd.start();
_root.lives = _root.lives + -1;
_root.livesLeft = "BALLS - " + _root.lives;
newBall();
}
};
_root.onEnterFrame = function () {
controlGame();
captureKeys();
updatePoints();
};
function ball2ball(b1, b2) {
var _local1 = {};
_local1.vx = b1.p1.x - b2.p0.x;
_local1.vy = b1.p1.y - b2.p0.y;
_local1.len = Math.sqrt((_local1.vx * _local1.vx) + (_local1.vy * _local1.vy));
_local1.dx = _local1.vx / _local1.len;
_local1.dy = _local1.vy / _local1.len;
return(_local1);
}
function captureKeys() {
if (Key.isDown(37) && (!leftUP)) {
leftUP = true;
_root.board_mc.leftFlipper.gotoAndStop(2);
flipper2Ball(flipper1, "up");
} else if ((!Key.isDown(37)) && (leftUP)) {
leftUP = false;
_root.board_mc.leftFlipper.gotoAndStop(1);
flipper2Ball(flipper1, "down");
}
if (Key.isDown(39) && (!rightUP)) {
rightUP = true;
_root.board_mc.rightFlipper.gotoAndStop(2);
flipper2Ball(flipper2, "up");
trace("FLIP");
} else if ((!Key.isDown(39)) && (rightUP)) {
rightUP = false;
_root.board_mc.rightFlipper.gotoAndStop(1);
flipper2Ball(flipper2, "down");
trace("DOWN");
}
if (Key.isDown(32) && (!shot)) {
_root.board_mc.launcher_mc.gotoAndPlay(2);
checkLaunchWallINT = setInterval(checkLaunchWall, 40, ball1);
shot = true;
ball1.vy = -50;
gameStarted = true;
resetBall(ball1);
}
}
bumperArray = [];
sideBumperArray = [];
i = 1;
while (i <= 4) {
var bumperName = ("bumper" + i);
_root.board_mc[bumperName]._visible = false;
var bx = _root.board_mc[bumperName]._x;
var by = _root.board_mc[bumperName]._y;
name = "v_bumper" + i;
this[name] = {};
clip = this[name];
clip.animation = _root.board_mc["ani" + bumperName];
clip.p0 = {};
clip.p0.x = bx;
clip.p0.y = by;
clip.radius = _root.board_mc[bumperName]._width / 2;
trace(clip.radius);
bumperArray.push(clip);
i++;
}
b = 1;
while (b <= 2) {
i = 1;
while (i < 3) {
var sideBumper = b;
var sideBumperName = ((("sb" + b) + "_") + i);
var sideBumperName1 = ((("sb" + b) + "_") + (i + 1));
var fdx = _root.board_mc[sideBumperName]._x;
var fdy = _root.board_mc[sideBumperName]._y;
var sdx = _root.board_mc[sideBumperName1]._x;
var sdy = _root.board_mc[sideBumperName1]._y;
name = (("v_sideBumper" + b) + "_") + i;
this[name] = {};
clip = this[name];
clip.animation = _root.board_mc["anisb" + sideBumper];
clip.b = 3;
clip.f = 1;
clip.p0 = {};
clip.p0.x = fdx;
clip.p0.y = fdy;
clip.p1 = {};
clip.p1.x = sdx;
clip.p1.y = sdy;
clip.lineDecay = 0.09;
updateVector(clip, true);
sideBumperArray.push(clip);
i++;
}
b++;
}
flipperArray = [];
b = 1;
while (b <= 2) {
var flipper = (("flip" + b) + "_");
var f1dx = _root.board_mc[flipper + "1"]._x;
var f1dy = _root.board_mc[flipper + "1"]._y;
_root.board_mc[flipper + "1"]._visible = false;
var f2dx = _root.board_mc[flipper + "2"]._x;
var f2dy = _root.board_mc[flipper + "2"]._y;
_root.board_mc[flipper + "2"]._visible = false;
var f3dx = _root.board_mc[flipper + "3"]._x;
var f3dy = _root.board_mc[flipper + "3"]._y;
_root.board_mc[flipper + "3"]._visible = false;
var f4dx = _root.board_mc[flipper + "4"]._x;
var f4dy = _root.board_mc[flipper + "4"]._y;
_root.board_mc[flipper + "4"]._visible = false;
var f5dx = _root.board_mc[flipper + "5"]._x;
var f5dy = _root.board_mc[flipper + "5"]._y;
_root.board_mc[flipper + "5"]._visible = false;
var f6dx = _root.board_mc[flipper + "6"]._x;
var f6dy = _root.board_mc[flipper + "6"]._y;
_root.board_mc[flipper + "6"]._visible = false;
name = "flipper" + b;
this[name] = {};
clip = this[name];
clip.b = 1;
clip.f = 1;
clip.p0 = {};
clip.p0.x = f1dx;
clip.p0.y = f1dy;
clip.p1 = {};
clip.p1.x = f2dx;
clip.p1.y = f2dy;
clip.p2 = {};
clip.p2.x = f3dx;
clip.p2.y = f3dy;
clip.p3 = {};
clip.p3.x = f4dx;
clip.p3.y = f4dy;
clip.p4 = {};
clip.p4.x = f5dx;
clip.p4.y = f5dy;
clip.p5 = {};
clip.p5.x = f6dx;
clip.p5.y = f6dy;
trace(clip.p5.y);
clip.p6 = {};
clip.p6.x = f2dx;
clip.p6.y = f2dy;
clip.lineDecay = 0.09;
updateVector(clip, true);
flipperArray.push(clip);
b++;
}
flipper2Ball = function (w, dir) {
if (dir == "up") {
fb = 0;
while (fb <= 2) {
var _local4 = ballArray[fb];
fc = 1;
while (fc <= 5) {
if (fc != 1) {
var _local6 = w["p" + fc].x;
var _local5 = w["p" + fc].y;
} else {
var _local6 = w.p6.x;
var _local5 = w.p6.y;
}
w.p1.x = _local6;
w.p1.y = _local5;
updateVector(w, true);
var _local3 = findIntersection(_local4, w);
_local3 = updateVector(_local3, false);
var _local8 = _local4.radius - _local3.len;
if (_local8 >= 0) {
if (fb == 0) {
_root.soundHolder_mc.hit1_snd.start();
} else {
_root.soundHolder_mc.hit2_snd.start();
}
trace("FLIP COLL");
_local4.p1.x = _local4.p1.x + _local3.dx;
_local4.p1.y = _local4.p1.y + _local3.dy;
var _local9 = {dx:_local3.lx, dy:_local3.ly, lx:_local3.dx, ly:_local3.dy, b:7, f:1};
var _local7 = bounce(_local4, _local9);
_local4.vx = _local7.vx;
_local4.vy = -30;
w.p1.x = w.p5.x;
w.p1.y = w.p5.y;
updateVector(w, true);
addMultiply = false;
addUmpire = false;
}
fc++;
}
fb++;
}
}
if (dir == "down") {
trace("DOWN DOWN");
w.p1.x = w.p6.x;
w.p1.y = w.p6.y;
updateVector(w, true);
trace(w.p1.y);
}
};
multiballActivated = true;
releaseBalls = function () {
ballCountDown = ballCountDown - 1;
if (ballCountDown <= 0) {
launchWallOb.allowed = false;
ballsPlayed = ballsPlayed + 1;
if (ball1.activate) {
name = "ball2";
} else {
name = "ball1";
}
whatBall = _root[name];
var _local2 = _root.board_mc["pb" + ballsPlayed];
_local2._x = startx;
_local2._y = starty;
trace(ballsPlayed);
trace(whatBall.clip);
whatBall.activate = true;
whatBall.vy = -40;
resetBall(whatBall);
ballCountDown = 50;
checkLaunchWallINT = setInterval(checkLaunchWall, 40, whatBall);
}
if (ballsPlayed >= 2) {
trace("CLEAR");
clearInterval(releaseBallsINT);
}
};
startMultiBall = function () {
_root.multiballTitle.play();
releaseBallsINT = setInterval(releaseBalls, 40);
ballCountDown = 0;
multiballActivated = false;
multiball = true;
_root.points = _root.points + 1500;
};
updatePoints = function () {
if (!endGame) {
_root.points1 = _root.points1 + Math.round(((_root.points - _root.points1) / 100) * 10);
if (_root.points1 >= (_root.points - 10)) {
_root.points1 = _root.points;
}
if (_root.points1 == 0) {
_root.points2 = "0000000";
}
if (_root.points1 >= 10) {
_root.points2 = "00000" + _root.points1;
}
if (_root.points1 >= 100) {
_root.points2 = "0000" + _root.points1;
}
if (_root.points1 >= 1000) {
_root.points2 = "000" + _root.points1;
}
if (_root.points1 >= 10000) {
_root.points2 = "00" + _root.points1;
}
if (_root.points1 >= 100000) {
_root.points2 = "0" + _root.points1;
}
if (_root.points1 >= 1000000) {
_root.points2 = _root.points1;
}
}
};
newBall = function () {
if (_root.lives >= 0) {
launchWallOb.allowed = false;
ballsPlayed = 1;
var _local2 = _root.board_mc.pb1;
_local2._x = startx;
_local2._y = starty;
resetBall(ball1);
ball1.activate = true;
shot = false;
} else if (!endGame) {
_root.soundHolder_mc.gameset_snd.start();
_root.gotoAndPlay("GameOver");
endGame = true;
gameStarted = false;
}
};
checkLaunchWall = function (ob) {
if (ob.p0.y < 340) {
launchWallOb.allowed = true;
trace("ACTIVATE LAUNCH WALL");
clearInterval(checkLaunchWallINT);
}
};
sideRampArray = [];
buildSideRamps = function () {
sr = 1;
while (sr <= 2) {
var _local4 = ("sRamp" + sr) + "_1";
var _local3 = ("sRamp" + sr) + "_2";
var _local5 = _root.board_mc[_local4]._x;
var _local8 = _root.board_mc[_local4]._y;
var _local7 = _root.board_mc[_local3]._x;
var _local6 = _root.board_mc[_local3]._y;
name = "v_sideRamp" + sr;
this[name] = {};
clip = this[name];
clip.animation = _root.board_mc["aniRamp" + sr];
clip.p0 = {};
clip.p0.x = _local5;
clip.p0.y = _local8;
clip.p1 = {};
clip.p1.x = _local7;
clip.p1.y = _local6;
updateVector(clip, true);
sideRampArray.push(clip);
sr++;
}
};
buildSideRamps();
buildLongRamps = function () {
sr = 1;
while (sr <= 2) {
var _local4 = ("bigRamp" + sr) + "_1";
var _local3 = ("bigRamp" + sr) + "_2";
var _local5 = _root.board_mc[_local4]._x;
var _local8 = _root.board_mc[_local4]._y;
var _local7 = _root.board_mc[_local3]._x;
var _local6 = _root.board_mc[_local3]._y;
name = "v_sideRamp" + sr;
this[name] = {};
clip = this[name];
clip.animation = _root.board_mc["aniBigRamp" + sr];
clip.p0 = {};
clip.p0.x = _local5;
clip.p0.y = _local8;
clip.p1 = {};
clip.p1.x = _local7;
clip.p1.y = _local6;
updateVector(clip, true);
sr++;
}
};
buildLongRamps();
MBallArray = [];
buildMBall = function () {
m = 1;
while (m <= 4) {
var _local3 = ("MBall" + m) + "_1";
var _local4 = ("MBall" + m) + "_2";
var _local5 = _root.board_mc[_local3]._x;
var _local8 = _root.board_mc[_local3]._y;
var _local7 = _root.board_mc[_local4]._x;
var _local6 = _root.board_mc[_local4]._y;
name = "v_MBall" + m;
this[name] = {};
clip = this[name];
clip.animation = _root.board_mc["MBallBar" + m];
clip.p0 = {};
clip.p0.x = _local5;
clip.p0.y = _local8;
clip.p1 = {};
clip.p1.x = _local7;
clip.p1.y = _local6;
updateVector(clip, true);
MBallArray.push(clip);
m++;
}
};
buildMBall();
checkMultiBallStatus = function () {
if (((((_root.board_mc.MBallBar1._currentframe >= 2) && (_root.board_mc.MBallBar2._currentframe >= 2)) && (_root.board_mc.MBallBar3._currentframe >= 2)) && (_root.board_mc.MBallBar4._currentframe >= 2)) && (!multiball)) {
_root.board_mc.MBallBar1.gotoAndStop(1);
_root.board_mc.MBallBar2.gotoAndStop(1);
_root.board_mc.MBallBar3.gotoAndStop(1);
_root.board_mc.MBallBar4.gotoAndStop(1);
startMultiBall();
}
};
launchWall = function () {
var _local3 = _root.board_mc.lWall1._x;
var _local6 = _root.board_mc.lWall1._y;
var _local5 = _root.board_mc.lWall2._x;
var _local4 = _root.board_mc.lWall2._y;
name = "launchWallOb";
this[name] = {};
clip = this[name];
clip.p0 = {};
clip.p0.x = _local3;
clip.p0.y = _local6;
clip.p1 = {};
clip.p1.x = _local5;
clip.p1.y = _local4;
clip.allowed = false;
updateVector(clip, true);
lineArray.push(clip);
};
launchWall();
umpireWall = function () {
var _local3 = _root.board_mc.uWall1._x;
var _local6 = _root.board_mc.uWall1._y;
var _local5 = _root.board_mc.uWall2._x;
var _local4 = _root.board_mc.uWall2._y;
name = "umpireWallOb";
this[name] = {};
clip = this[name];
clip.p0 = {};
clip.p0.x = _local3;
clip.p0.y = _local6;
clip.p1 = {};
clip.p1.x = _local5;
clip.p1.y = _local4;
clip.allowed = true;
updateVector(clip, true);
};
umpireWall();
checkUmpire = function (ob) {
var _local5 = umpireWallOb;
var _local2 = findIntersection(ob, _local5);
_local2 = updateVector(_local2, false);
var _local4 = ob.radius - _local2.len;
if (((_local4 >= 0) && (ob.vy < 0)) && (!addUmpire)) {
_root.soundHolder_mc.umpire_snd.start();
_root.points = _root.points + (1000 * multiplier);
trace("UMPIRE");
addUmpire = true;
}
};
multiplierWall = function () {
var _local3 = _root.board_mc.mulWall1._x;
var _local6 = _root.board_mc.mulWall1._y;
var _local5 = _root.board_mc.mulWall2._x;
var _local4 = _root.board_mc.mulWall2._y;
name = "multiplierWallOb";
this[name] = {};
clip = this[name];
clip.p0 = {};
clip.p0.x = _local3;
clip.p0.y = _local6;
clip.p1 = {};
clip.p1.x = _local5;
clip.p1.y = _local4;
updateVector(clip, true);
};
multiplierWall();
checkMultiplier = function (ob) {
var _local5 = multiplierWallOb;
var _local2 = findIntersection(ob, _local5);
_local2 = updateVector(_local2, false);
var _local4 = ob.radius - _local2.len;
if (((_local4 >= 0) && (ob.vy < 0)) && (!addMultiply)) {
_root.board_mc.multiplyFlash.play();
_root.soundHolder_mc.spaceship_snd.start();
if (multiplier < 4) {
multiplier++;
multiplyTitle.gotoAndStop(multiplier);
_root.board_mc["star" + multiplier].gotoAndStop(2);
} else {
multiplyTitle.gotoAndStop(5);
_root.lives = _root.lives + 1;
_root.livesLeft = "BALLS - " + _root.lives;
_root.board_mc.star2.gotoAndStop(1);
_root.board_mc.star3.gotoAndStop(1);
_root.board_mc.star4.gotoAndStop(1);
multiplier = 0;
}
addMultiply = true;
trace("Multiply");
}
};
Frame 35
_quality = "HIGH";
_root.points3 = _root.points;
if (_root.points1 >= (_root.points - 10)) {
_root.points2 = _root.points;
}
if (_root.points == 0) {
_root.points2 = "0000000";
}
if (_root.points >= 10) {
_root.points2 = "00000" + _root.points;
}
if (_root.points >= 100) {
_root.points2 = "0000" + _root.points;
}
if (_root.points >= 1000) {
_root.points2 = "000" + _root.points;
}
if (_root.points >= 10000) {
_root.points2 = "00" + _root.points;
}
if (_root.points >= 100000) {
_root.points2 = "0" + _root.points;
}
if (_root.points >= 1000000) {
_root.points2 = _root.points;
}
_root.livesLeft = "";
stop();
Frame 45
stop();
Frame 65
scrollFace_mc._y = upArrow_mc._y + upArrow_mc._height;
scoreList_mc.startPos = scoreList_mc._y;
scrollUp = function () {
if (scoreList_mc._y < scoreList_mc.startPos) {
scoreList_mc._y = scoreList_mc._y + 6;
moveScrollBar();
}
};
scrollDown = function () {
var _local1 = scoreList_mc._height - scrollMask_mc._height;
trace(_local1);
if (scoreList_mc._y > (scoreList_mc.startPos - _local1)) {
scoreList_mc._y = scoreList_mc._y + -6;
moveScrollBar();
}
};
moveScrollBar = function () {
var _local4 = upArrow_mc._y + upArrow_mc._height;
var _local7 = scrollTrack_mc._height - scrollFace_mc._height;
var _local1 = scoreList_mc.startPos;
var _local8 = scoreList_mc._y;
var _local3 = _local1 - _local8;
var _local2 = scoreList_mc._height - scrollMask_mc._height;
var _local5 = (_local3 / _local2) * 100;
var _local6 = _local4 + ((_local7 / 100) * _local5);
scrollFace_mc._y = _local6;
};
dragScrollBar = function () {
var _local4 = upArrow_mc._y + upArrow_mc._height;
var _local6 = scrollTrack_mc._height - scrollFace_mc._height;
var _local1 = scrollFace_mc._y;
var _local5 = ((_local1 - _local4) / _local6) * 100;
var _local2 = scoreList_mc.startPos;
var _local3 = (scoreList_mc._height - scrollMask_mc._height) - 4;
var _local7 = _local2 - ((_local3 / 100) * _local5);
scoreList_mc._y = _local7;
};
scrollFace_mc.onPress = function () {
var _local1 = upArrow_mc._y + upArrow_mc._height;
var _local4 = scrollTrack_mc._height - scrollFace_mc._height;
var _local3 = _local1 + _local4;
var _local2 = scrollFace_mc._x;
startDrag (scrollFace_mc, true, _local2, _local1, _local2, _local3);
dragScrollBarInt = setInterval(dragScrollBar, 40);
};
scrollFace_mc.onRelease = function () {
scrollFace_mc.stopDrag();
clearInterval(dragScrollBarInt);
};
scrollFace_mc.onReleaseOutside = function () {
scrollFace_mc.stopDrag();
clearInterval(dragScrollBarInt);
};
upArrow_mc.onPress = function () {
scrollUpInt = setInterval(scrollUp, 40);
};
upArrow_mc.onRelease = function () {
clearInterval(scrollUpInt);
};
upArrow_mc.onReleaseOutside = function () {
clearInterval(scrollUpInt);
};
downArrow_mc.onPress = function () {
scrollDownInt = setInterval(scrollDown, 40);
};
downArrow_mc.onRelease = function () {
clearInterval(scrollDownInt);
};
downArrow_mc.onReleaseOutside = function () {
clearInterval(scrollDownInt);
};
score_responder = new Object();
score_responder.onResult = function (arrScores) {
i = 0;
while (i <= (arrScores.length - 1)) {
var _local5 = i + 10000;
var _local4 = ("scoreLine" + (i + 1)) + "_mc";
duplicateMovieClip (scoreList_mc.scoreLine_mc, _local4, _local5);
var _local2 = scoreList_mc[("scoreLine" + (i + 1)) + "_mc"];
_local2._y = 26 * i;
_local2.pos.text = i + 1;
_local2.playerName.text = arrScores[i].name;
_local2.score.text = arrScores[i].score;
nextScorePos = this.scoreList_mc.scoreLine_mc._height;
i++;
}
};
gameService.getHighScores(score_responder, 50);
this.scoreList_mc.scoreLine_mc._visible = false;
Symbol 15 MovieClip [circle_clip2] Frame 10
stop();
Symbol 59 MovieClip Frame 153
_root.gotoAndStop("main");
Symbol 60 MovieClip [bank] Frame 1
theme_snd = new Sound(this);
theme_snd.attachSound("themeMusic.mp3");
hit1_snd = new Sound(this);
hit1_snd.attachSound("ballHit1");
hit2_snd = new Sound(this);
hit2_snd.attachSound("ballHit2");
net1 = new Sound(this);
net1.attachSound("ug1");
net2 = new Sound(this);
net2.attachSound("ug2");
loseBall_snd = new Sound(this);
loseBall_snd.attachSound("disappointed");
bumper_snd = new Sound(this);
bumper_snd.attachSound("beep");
umpire_snd = new Sound(this);
umpire_snd.attachSound("quiet");
gameset_snd = new Sound(this);
gameset_snd.attachSound("gameSet");
mBallHit_snd = new Sound(this);
mBallHit_snd.attachSound("MBALLHit");
vroom_snd = new Sound(this);
vroom_snd.attachSound("vroom");
spaceship_snd = new Sound(this);
spaceship_snd.attachSound("spaceship");
createMuteButton = function () {
_level0.volume_mc.onRelease = function () {
if (_level0.volume_mc._currentframe == 1) {
theme_snd.setVolume(0);
_level0.volume_mc.gotoAndStop(2);
} else {
theme_snd.setVolume(100);
_level0.volume_mc.gotoAndStop(1);
}
};
};
Symbol 80 Button
on (release) {
gotoAndStop ("tamba");
}
Symbol 166 MovieClip Frame 280
_root.gotoAndStop("PlayGame");
Symbol 170 MovieClip Frame 1
stop();
Symbol 171 MovieClip Frame 15
stop();
Symbol 175 MovieClip Frame 63
stop();
Symbol 177 MovieClip Frame 63
stop();
Symbol 179 MovieClip Frame 63
stop();
Symbol 182 MovieClip Frame 63
_parent.gotoAndStop(1);
Symbol 183 MovieClip Frame 1
stop();
Symbol 191 MovieClip Frame 1
stop();
Symbol 202 MovieClip Frame 1
stop();
Symbol 205 MovieClip Frame 1
stop();
Symbol 210 MovieClip Frame 1
stop();
Symbol 213 MovieClip Frame 1
stop();
Symbol 216 MovieClip Frame 1
stop();
Symbol 221 MovieClip Frame 1
stop();
Symbol 225 MovieClip Frame 1
stop();
Symbol 225 MovieClip Frame 10
stop();
Symbol 230 MovieClip Frame 1
stop();
Symbol 233 MovieClip Frame 1
stop();
Symbol 245 MovieClip Frame 1
stop();
Symbol 254 MovieClip Frame 1
stop();
Symbol 267 Button
on (release) {
gotoAndStop ("lastScreen");
}
Symbol 269 Button
on (release) {
submit_responder = new Object();
doNotSend = false;
strName = userName.text;
strEmail = userEmail.text;
indexOfAt = strEmail.indexOf("@");
lastIndexOfDot = strEmail.lastIndexOf(".");
if (((!strEmail) || (indexOfAt == -1)) || (lastIndexOfDot == -1)) {
doNotSend = true;
errorMsg.text = "PLEASE ENTER A VALID EMAIL ADDRESS";
}
if (!strName) {
doNotSend = true;
errorMsg.text = "PLEASE ENTER YOUR NAME";
}
if (!doNotSend) {
trace("SENDING");
errorMsg.text = "SUBMITTING SCORE PLEASE WAIT";
submit_responder.onResult = function (arrScores) {
gotoAndStop ("lastScreen");
};
gameService.setHighScores(submit_responder, userName.text, userEmail.text, _root.points3);
}
}
Symbol 278 Button
on (release) {
gotoAndStop ("PlayGame");
}
Symbol 280 Button
on (release) {
gotoAndStop ("GameOver");
}
Symbol 282 Button
on (release) {
gotoAndStop ("highscoreScreen");
}
Symbol 284 Button
on (release) {
gotoAndStop ("recommendScreen");
}
Symbol 293 Button
on (release) {
gotoAndStop ("lastScreen");
}
Symbol 295 Button
on (release) {
send_responder = new Object();
doNotSend = false;
strUserName = userName.text;
strUserEmail = userEmail.text;
userIndexOfAt = strUserEmail.indexOf("@");
userLastIndexOfDot = strUserEmail.lastIndexOf(".");
strFriendName = friendName.text;
strFriendEmail = friendEmail.text;
friendIndexOfAt = strFriendEmail.indexOf("@");
friendLastIndexOfDot = strFriendEmail.lastIndexOf(".");
if (((!strFriendEmail) || (friendIndexOfAt == -1)) || (friendLastIndexOfDot == -1)) {
doNotSend = true;
errorMsg.text = "YOUR FRIENDS EMAIL ADDRESS IS NOT VALID";
}
if (!strFriendName) {
doNotSend = true;
errorMsg.text = "PLEASE ENTER YOUR FRIENDS NAME";
}
if (((!strUserEmail) || (userIndexOfAt == -1)) || (userLastIndexOfDot == -1)) {
doNotSend = true;
errorMsg.text = "YOUR EMAIL ADDRESS IS NOT VALID";
}
if (!strUserName) {
doNotSend = true;
errorMsg.text = "PLEASE ENTER YOUR NAME";
}
if (!doNotSend) {
trace("SENDING");
errorMsg.text = "SENDING";
send_responder.onResult = function () {
friendName.text = "";
friendEmail.text = "";
errorMsg.text = "SENT - IF YOU WOULD LIKE TO CHALLENGE ANOTHER FRIEND ENTER THEIR DETAILS BELOW";
};
gameService.sendToFriend(send_responder, userName.text, userEmail.text, friendName.text, friendEmail.text, _level0.points3);
}
}