Frame 3
stop();
Frame 4
function checkEmail(email) {
var _local2 = email;
var _local3 = _local2.indexOf("@");
var atLast = _local2.lastIndexOf("@");
var L = _local2.length;
if (((_local3 != atLast) || (_local3 < 1)) || (_local3 > (L - 4))) {
return(false);
}
var lastDot = _local2.lastIndexOf(".");
if (((L - lastDot) < 3) || ((L - lastDot) > 5)) {
return(false);
}
var _local1 = new Array(32, 126, 33, 35, 36, 37, 94, 38, 42, 40, 41, 43, 124, 61, 96, 91, 93, 123, 125, 59, 58, 60, 62, 44, 63, 47, 92, 34, 39, 13, 10);
i = 0;
while (i < _local1.length) {
if (_local2.indexOf(chr(_local1[i])) >= 0) {
return(false);
}
i++;
}
return(true);
}
botQuotes = [];
botQuotes.push({quote:"'I'm not a believer in luck but I do believe you need it'", from:"ALAN BALL"});
botQuotes.push({quote:"'I've never wanted to leave. I'm here for the rest of my life, and hopefully after that as well", from:"ALAN SHEARER"});
botQuotes.push({quote:"'The lads ran their socks into the ground.'", from:"ALEX FERGUSON"});
botQuotes.push({quote:"'I was saying the other day, how often the most vulnerable area for goalies is between their legs.'", from:"ANDY GRAY"});
botQuotes.push({quote:"'A game is not won until it is lost.'", from:"BARRY DAVIES"});
botQuotes.push({quote:"'I always used to put my right boot on first, and then obviously my right sock.'", from:"BARRY VENISON"});
botQuotes.push({quote:"'We're flying on Concorde. That'll shorten the distance. That's self-explanatory.'", from:"BOBBY ROBSON"});
botQuotes.push({quote:"'The first ninety minutes of a football match are the most important.'", from:"BOBBY ROBSON"});
botQuotes.push({quote:"'We didn't underestimate them. They were just a lot better than we thought.'", from:"BOBBY ROBSON"});
botQuotes.push({quote:"'If you count your chickens before they've hatched, they won't lay an egg.'", from:"BOBBY ROBSON"});
botQuotes.push({quote:"'This is going to be a very long 30 minutes with 26 minutes left.'", from:"BRIAN MOORE"});
botQuotes.push({quote:"'He went through a non-existant gap'", from:"CLIVE TYLDESLEY"});
botQuotes.push({quote:"'And I honestly believe we can go all the way to Wembley unless somebody knocks us out.'", from:"DAVE BASSETT "});
botQuotes.push({quote:"'You weigh up the pros and cons and put them in chronological order.'", from:"DAVE BASSETT"});
botQuotes.push({quote:"'My parents have been there for me, ever since I was about 7'", from:"DAVID BECKHAM"});
botQuotes.push({quote:"'Alex Ferguson is the best manager I've ever had at this level. Well, he's the only manager I've actually had at this level. But he's the best manager I've ever had.'", from:"DAVID BECKHAM"});
botQuotes.push({quote:"'The new West Stand casts a giant shadow over the pitch, even on a sunny day.'", from:"EVENING STANDARD"});
botQuotes.push({quote:"'There's no in between - you're either good or bad. We were in between.'", from:"GARY LINEKER"});
botQuotes.push({quote:"'What I said to them at half time would be unprintable on the radio.'", from:"GERRY FRANCIS"});
botQuotes.push({quote:"'Okay, so we lost, but good things can come from it - negative and positive.'", from:"GLENN HODDLE"});
botQuotes.push({quote:"'I never heard a minute's silence like that.'", from:"GLENN HODDLE"});
botQuotes.push({quote:"'Sampdoria are real, but they can't play in the Spanish league with the other Real's.", from:"GRAHAM JOFFE"});
botQuotes.push({quote:"'Do I not like that.'", from:"GRAHAM TAYLOR"});
botQuotes.push({quote:"'To be really happy, we must throw our hearts over the bar and hope that our bodies will follow.'", from:"GRAHAM TAYLOR"});
botQuotes.push({quote:"'Shearer could be at 100 per cent fitness, but not peak fitness.' ", from:"GRAHAM TAYLOR"});
botQuotes.push({quote:"'I'm not a betting man\u2026 but I bet you Italy will win the game.'", from:"GRAHAM TAYLOR"});
botQuotes.push({quote:"'Never go for a 50-50 ball unless you're 80-20, sure of winning it.'", from:"IAN DARKE"});
botQuotes.push({quote:"'I couldn't settle in Italy - it was like living in a foreign country.'", from:"IAN RUSH"});
botQuotes.push({quote:"'England now have three fresh men, with three fresh legs.'", from:"JIMMY HILL"});
botQuotes.push({quote:"'Brazil - they're so good it's like they are running around the pitch playing with themselves.'", from:"JIMMY MAGEES"});
botQuotes.push({quote:"'It's only at the point of climax that there's a ripple of noise.'", from:"JOHN CHAMPION"});
botQuotes.push({quote:"'The World Cup is a truly international event.'", from:"JOHN MOTSON"});
botQuotes.push({quote:"'For those of you watching in black and white, Spurs are in the yellow strip.'", from:"JOHN MOTSON"});
botQuotes.push({quote:"'It's like a toaster, the ref's shirt pocket. Every time there's a tackle, up pops a yellow card.'", from:"KEVIN KEEGAN"});
botQuotes.push({quote:"'Gary (Linekar) always weighed up his options, especially when he had no choice.'", from:"KEVIN KEEGAN"});
botQuotes.push({quote:"'Goalkeepers aren't born today until they're in their late twenties or thirties.'", from:"KEVIN KEEGAN"});
botQuotes.push({quote:"'I'd like to play for an Italian club, like Barcelona.'", from:"MARK DRAPER"});
botQuotes.push({quote:"'I would not be bothered if we lost every game as long as we won the league.' ", from:"MARK VIDUKA"});
botQuotes.push({quote:"'All that remains is for a few dots and commas to be crossed'", from:"MITCHELL THOMAS"});
botQuotes.push({quote:"'I never predict anything, and I never will.'", from:"PAUL GASCOIGNE"});
botQuotes.push({quote:"'I've had 14 bookings this season - 8 of which were my fault, but 7 of which were disputable.' ", from:"PAUL GASCOIGNE"});
botQuotes.push({quote:"'And Arsenal now have plenty of time to dictate the last few seconds.'", from:"PETER JONES"});
botQuotes.push({quote:"'You've got to believe that you're going to win, and I believe we'll win the World Cup until the final whistle blows and we're knocked out.'", from:"PETER SHILTON"});
botQuotes.push({quote:"'It's now 1-1, an exact reversal of the score on Saturday.'", from:"RADIO 5 LIVE"});
botQuotes.push({quote:"'Wimbledon are putting balls into the blender.'", from:"RODNEY MARSH"});
botQuotes.push({quote:"'They've come out at half time and gone bang.'", from:"RON ATKINSON"});
botQuotes.push({quote:"'If Glenn Hoddle said one word to his team at half time, it was concentration and focus.'", from:"RON ATKINSON"});
botQuotes.push({quote:"'Giving the ball away doesn't seem to work in international football.'", from:"RON ATKINSON"});
botQuotes.push({quote:"'They've certainly grown, the Japanese. I mean grown in stature, playing-wise.'", from:"RON ATKINSON"});
botQuotes.push({quote:"'They only thought the shirts had to go out to get a win.'", from:"RON ATKINSON"});
botQuotes.push({quote:"'To play Holland, you have to play the Dutch.'", from:"RUUD GULLIT"});
botQuotes.push({quote:"'Germany are a very difficult team to play...they had 11 internationals out there today.' ", from:"STEVE LOMAS"});
botQuotes.push({quote:"'I can see the carrot at the end of the tunnel.'", from:"STUART PEARCE "});
botQuotes.push({quote:"'No-one hands you cups on a plate'", from:"TERRY MCDERMOTT"});
botQuotes.push({quote:"'If you can't stand the heat in the dressing room, get out of the kitchen.'", from:"TERRY VENABLES"});
botQuotes.push({quote:"'There are two ways of getting the ball. One is from your own team-mates, and that's the only way.' ", from:"TERRY VENABLES"});
botQuotes.push({quote:"'Sometimes in football you have to score goals.'", from:"THIERRY HENRY"});
botQuotes.push({quote:"'Dumbarton player Steve McCahill has limped off with a badly cut forehead.'", from:"TOM FERRIE"});
botQuotes.push({quote:"Merseyside derbies usually last 90 minutes and I'm sure today's won't be any different.", from:"TREVOR BROOKING"});
botQuotes.push({quote:"'If you count your chickens before they've hatched, they won't lay an egg.'", from:"BOBBY ROBSON"});
botQuotes.push({quote:"'If you count your chickens before they've hatched, they won't lay an egg.'", from:"BOBBY ROBSON"});
botQuotes.push({quote:"'If you count your chickens before they've hatched, they won't lay an egg.'", from:"BOBBY ROBSON"});
botQuotes.push({quote:"'If you count your chickens before they've hatched, they won't lay an egg.'", from:"BOBBY ROBSON"});
_global.tDebug.prototype.dumpMC = function (mc) {
trace("------------------------------------------------------");
for (var i in mc) {
trace((i + ": ") + typeof(eval (i)));
}
trace("------------------------------------------------------");
};
_global.displayFPS = function () {
fps = Math.round(10000 / (getTimer() - st)) / 10;
totalFps = totalFps + fps;
count++;
avgFps = totalFps / (++_global.count);
debugTxt.text = avgFps.toString();
st = getTimer();
};
_global.debug = {};
_global.debug.showWalls = false;
_global.debug.showBumpers = false;
_global.debug.showHitZone = false;
_global.debug.launcher = false;
_global.debug.showFPS = false;
_global.debug.showBallStatus = false;
_global.debug.ballStaysUp = false;
_global.debugTrace = function (str) {
debugTxtBig.text = debugTxtBig.text + str;
debugTxtBig.text = debugTxtBig.text + newline;
debugTxtBig.scroll = debugTxtBig.maxscroll;
};
_quality = "HIGH";
dispBallStaysUp = debug.ballStaysUp;
fscommand ("fullScreen", true);
fscommand ("allowScale", false);
fscommand ("showMenu", false);
function initSounds() {
_root.soundOn = true;
_root.createEmptyMovieClip("soundHolder", 25000);
soundDepth = 0;
createSound("ballThud.wav", "ballThud_snd");
createSound("bumper.wav", "bumper_snd");
createSound("canon.wav", "canon_snd");
createSound("ding.wav", "ding_snd");
createSound("extraBall.wav", "extraBall_snd");
createSound("flipper.wav", "flipper_snd");
createSound("launchNewBall.wav", "launchNewBall_snd");
createSound("mainRamp.wav", "mainRamp_snd");
createSound("rampBallKicked.wav", "rampBallKicked_snd");
createSound("rampThud.wav", "rampThud_snd");
ballThud_snd.setVolume(50);
bumper_snd.setVolume(50);
canon_snd.setVolume(80);
ding_snd.setVolume(80);
extraBall_snd.setVolume(80);
flipper_snd.setVolume(50);
launchNewBall_snd.setVolume(60);
mainRamp_snd.setVolume(60);
rampBallKicked_snd.setVolume(60);
rampThud_snd.setVolume(80);
cartSoundArr = new Array(M_cart1_snd, M_cart2_snd, M_cart3_snd, M_cart4_snd, M_cart5_snd);
}
function createSound(id, name) {
soundDepth++;
instName = ("sound" + soundDepth) + "_mc";
soundHolder.createEmptyMovieClip(instName, soundDepth);
var _local1 = soundHolder[instName];
_root[name] = new Sound(_local1);
_root[name].attachSound(id);
}
function playSound(snd) {
if (soundOn) {
snd.start();
}
}
function playSoundLoop(snd) {
if (soundOn) {
snd.start(0, 5000);
}
}
function playSoundVolume(snd, volume) {
if (soundOn) {
snd.setVolume(volume);
snd.start();
}
}
function stopSound(snd) {
snd.stop();
}
function fadeSound(snd) {
fader.snd = snd;
fader.gotoAndPlay("start");
}
function calculateVolume(velocity) {
var _local1 = Math.floor((dist(0, 0, velocity.x, velocity.y) * 100) / maxSpeed);
if (_local1 > 100) {
_local1 = 100;
}
return(_local1);
}
initSounds();
_global.tPhysic = function () {
this.reset();
};
_global.tPhysic.prototype.reset = function (newVect) {
var _local1 = this;
_local1.gravity = new Vector2d(0, 0.27);
_local1.bounce = 0.2;
_local1.friction = 0.998;
};
_global.tPhysic.prototype.changeGravity = function (newVect) {
this.gravity = newVect;
};
_global.Position = function (x, y) {
this.x = x;
this.y = y;
};
_global.Position.prototype.toString = function () {
return((("x: " + this.x) + " , y: ") + this.y);
};
_global.Vector2d = function (x, y) {
this.x = x;
this.y = y;
};
_global.Vector2d.prototype.toString = function () {
return((("x: " + this.x) + " , y: ") + this.y);
};
_global.tVector = function (x, y) {
var _local1 = this;
var _local2 = y;
var _local3 = x;
_local1.x = _local3;
_local1.y = _local2;
_local1.norm = dist(0, 0, _local3, _local2);
_local1.phiRad = Math.atan2(_local2, _local3);
_local1.phiDeg = _local1.phiRad * toDeg;
};
_global.tVector.prototype.toString = function () {
var _local2 = this;
var _local1 = (("x: " + _local2.x) + " , y: ") + _local2.y;
_local1 = _local1 + ("\nnorm: " + _local2.norm);
_local1 = _local1 + ("\nphiRad: " + _local2.phiRad);
_local1 = _local1 + ("\nphiDeg: " + _local2.phiDeg);
return(_local1);
};
_global.tBall = function (where, pos, vel) {
var _local1 = this;
_local1.mc = _local1.createBall(where);
_local1.hitZone = _local1.mc.hitZone;
_local1.pos = pos;
_local1.vel = vel;
_local1.physic = new tPhysic();
_local1.oldPos = new Position();
_local1.mode = undefined;
_local1.collision = 0;
_local1.gravityWellTimeOut = false;
};
_global.tBall.prototype.nextDepth = function () {
_global.tBall.nextDepthCounter++;
return(_global.tBall.nextDepthCounter);
};
_global.tBall.prototype.createBall = function (where) {
_global.tBall.numBallInPlay++;
var _local1 = this.nextDepth();
var _local2 = where.attachMovie("ball", (str = "ball" + _local1), _local1);
return(_local2);
};
_global.tBall.prototype.changeHolder = function (where) {
var _local1 = this;
if (_local1.mc._parent != where) {
var _local2 = _local1.mc.getDepth();
var _local3 = where.attachMovie("ball", (str = "ball" + _local2), _local2);
_local1.mc.removeMovieClip();
_local1.mc = _local3;
_local1.hitZone = _local3.hitZone;
}
};
_global.tBall.prototype.changeMode = function (mode) {
var _local1 = this;
_local1.mode = mode;
_local1.physic.reset();
switch (mode) {
case "mainTable" :
_local1.changeHolder(ballMainTable);
return;
case "gravityWell" :
_local1.changeHolder(ballGravityWell);
_local1.physic.friction = 0.975;
return;
case "launchRamp" :
_local1.physic.friction = 1.1;
return;
case "pause" :
}
};
_global.tBall.prototype.teleport = function (pos, vel, mode) {
var _local1 = this;
_local1.pos = pos;
_local1.vel = vel;
_local1.changeMode(mode);
refreshBallPos(pos, _local1);
};
_global.tBall.prototype.reset = function () {
_global.tBall.nextDepthCounter = 0;
};
_global.tBall.prototype.toString = function (mode) {
return(this.mc._name);
};
_global.tWall = function (mc, angle, pos, strength) {
var _local1 = this;
_local1.mc = mc;
_local1.angle = angle;
_local1.pos = pos;
if (strength == undefined) {
_local1.strength = 1;
} else {
_local1.strength = strength;
}
};
_global.tFlipper = function (mc, angle, length, pos) {
var _local1 = this;
_local1.mc = mc;
_local1.angle = angle;
_local1.moving = 0;
_local1.length = length;
_local1.pos = pos;
};
_global.tBumper = function (mc, strength, pos, clip) {
var _local1 = this;
var _local2 = mc;
_local1.mc = _local2;
_local1.radius = _local2._width / 2;
_local1.strength = strength;
if (pos == undefined) {
_local1.pos = new Position(_local2._x, _local2._y);
} else {
_local1.pos = pos;
}
_local1.clip = clip;
};
_global.tActiveBumper = function (mc, bumperArr, wallArr) {
var _local1 = this;
var _local2 = mc;
_local1.mc = _local2;
_local1.pos = new Position(_local2._x, _local2._y);
_local1.bumperArr = bumperArr;
_local1.wallArr = wallArr;
};
_global.tGravityWell = function (mc, wallArr, clip) {
var _local1 = this;
_local1.mc = mc;
_local1.hitZone = mc.hitZone;
_local1.wallArr = wallArr;
_local1.clip = clip;
_local1.setOff();
};
_global.tGravityWell.prototype.setOn = function () {
this.clip.gotoAndStop("on");
this.open = true;
};
_global.tGravityWell.prototype.setOff = function () {
this.clip.gotoAndStop("off");
this.open = false;
};
_global.tTarget = function (mc, radius, strength, pos, hitStatus) {
var _local1 = this;
_global.tTarget.prototype.numTargets++;
_local1.mc = mc;
_local1.radius = radius;
_local1.strength = strength;
_local1.pos = pos;
_local1.hitStatus = hitStatus;
_local1.pos = pos;
};
_global.tTarget.prototype.initialise = function () {
_global.tTarget.prototype.numTargets = 0;
tTarget.prototype.reset();
};
_global.tTarget.prototype.reset = function () {
_global.tTarget.prototype.numHits = 0;
_global.tTarget.prototype.allTargetsHit = false;
for (var _local1 in target) {
target[_local1].setOn();
}
};
_global.tTarget.prototype.setOn = function () {
this.mc.gotoAndStop("on");
this.hitStatus = true;
};
_global.tTarget.prototype.setOff = function () {
this.mc.gotoAndStop("off");
this.hitStatus = false;
mainScore.addPts("target");
_global.tTarget.prototype.numHits++;
if (tTarget.prototype.numHits == tTarget.prototype.numTargets) {
_global.tTarget.prototype.allTargetsHit = true;
mainScore.addPts("target9");
}
};
_global.tClusterWall = function (mc, wallArr) {
var _local1 = mc;
var _local2 = this;
_local2.mc = _local1;
_local2.wallArr = wallArr;
_local2.pos = new Position(_local1._x, _local1._y);
};
_global.tLockBall = function (mc, lockTime, clip) {
var _local1 = this;
var _local2 = mc;
_local1.lockTime = lockTime;
_local1.mc = _local2;
_local1.pos = new Position(_local2._x, _local2._y);
_local1.hitZone = _local2.hitZone;
_local1.clip = clip;
_local1.ballIn = false;
_local1.setOn();
};
_global.tLockBall.prototype.setLock = function () {
this.setOff();
this.ballIn = true;
};
_global.tLockBall.prototype.setUnlock = function () {
this.ballIn = false;
};
_global.tLockBall.prototype.setOn = function () {
this.enabled = true;
this.clip.gotoAndStop("on");
};
_global.tLockBall.prototype.setOff = function () {
this.enabled = false;
this.clip.gotoAndStop("off");
};
_global.tKickback = function (mc, nVel, clip, anim) {
var _local1 = this;
var _local2 = mc;
_local1.mc = _local2;
_local1.nVel = nVel;
_local1.clip = clip;
_local1.anim = anim;
_local1.pos = new Position(_local2._x, _local2._y);
_local1.numKick = 0;
_local1.setOn();
};
_global.tKickback.prototype.setOn = function () {
this.status = true;
this.clip.gotoAndStop("on");
};
_global.tKickback.prototype.setOff = function () {
this.status = false;
this.clip.gotoAndStop("off");
};
_global.tKickback.prototype.reset = function () {
this.numKick = 0;
this.setOn();
};
_global.tKickback.prototype.kick = function (b) {
var _local1 = this;
var _local2 = b;
if (NUM_KICKBACK == -1) {
_local2.vel.x = _local1.nVel.x;
_local2.vel.y = _local1.nVel.y;
_local1.anim.gotoAndPlay("play");
} else if (_local1.numKick < NUM_KICKBACK) {
_local1.numKick++;
_local2.vel.x = _local1.nVel.x;
_local2.vel.y = _local1.nVel.y;
_local1.anim.gotoAndPlay("play");
if (_local1.numKick == NUM_KICKBACK) {
_local1.setOff();
}
}
};
_global.tCanon = function (mc, wallArr, clip) {
var _local1 = this;
_local1.ballIn = false;
_local1.mc = mc;
_local1.hitZone = mc.hitZone;
_local1.wallArr = wallArr;
_local1.clip = clip;
_local1.setOn();
};
_global.tCanon.prototype.setOn = function () {
this.clip.gotoAndStop("on");
};
_global.tCanon.prototype.setOff = function () {
this.clip.gotoAndStop("off");
};
_global.tSwitch = function (mc, clip) {
var _local1 = this;
_local1.mc = mc;
_local1.clip = clip;
_local1.hitStatus = false;
_local1.flag = false;
_local1.hitFlag = false;
_local1.setOff();
};
_global.tSwitch.prototype.setOn = function () {
this.clip.gotoAndStop("on");
this.hitStatus = true;
};
_global.tSwitch.prototype.setOff = function () {
var _local1 = this;
_local1.clip.gotoAndStop("off");
_local1.hitStatus = false;
_local1.hitFlag = false;
};
_global.tSwitch.prototype.resetAll = function () {
for (var _local1 in gateSwitch) {
gateSwitch[_local1].setOff();
}
};
_global.tbonus = function (mc, label) {
var _local1 = this;
_local1.mc = mc;
_local1.label = label;
_local1.setOff();
};
_global.tbonus.prototype.initialise = function (total) {
tbonus.prototype.multiplier = [1, 2, 4, 6, 8, 10];
tbonus.prototype.hold = false;
tbonus.prototype.total = total;
tbonus.prototype.currBonusLevel = 0;
};
_global.tbonus.prototype.reset = function () {
if (!_global.tbonus.prototype.hold) {
_global.tbonus.prototype.currBonusLevel = 0;
for (var _local1 in bonus) {
bonus[_local1].setOff();
}
}
};
_global.tbonus.prototype.resetHold = function () {
_global.tbonus.prototype.hold = false;
_global.tbonus.prototype.reset();
};
_global.tbonus.prototype.getMultiplier = function () {
return(tbonus.prototype.multiplier[tbonus.prototype.currBonusLevel]);
};
_global.tbonus.prototype.increment = function () {
if (tbonus.prototype.currBonusLevel < (tbonus.prototype.total - 1)) {
bonus[tbonus.prototype.currBonusLevel++].setOn();
debugTrace(("bonusLevel +1 (x" + tbonus.prototype.multiplier[tbonus.prototype.currBonusLevel]) + ")");
} else if (tbonus.prototype.currBonusLevel == (tbonus.prototype.total - 1)) {
bonus[tbonus.prototype.currBonusLevel++].setOn();
tbonus.prototype.hold = true;
debugTrace("bonusLevel +1 (HOLD)");
}
};
_global.tbonus.prototype.setOn = function () {
var _local1 = this;
_local1.mc.gotoAndStop("on");
_local1.mc.labelTxt.text = _local1.label;
};
_global.tbonus.prototype.setOff = function () {
var _local1 = this;
_local1.mc.gotoAndStop("off");
_local1.mc.labelTxt.text = _local1.label;
};
_global.tScore = function () {
var _local1 = this;
_local1.mainPts = 0;
_local1.bonusPts = 0;
_local1.numCanonHit = 0;
_local1.refreshMainDisplay();
};
_global.tScore.prototype.refreshMainDisplay = function () {
var _local1 = this;
displayTxtMain.text = _local1.mainPts;
displayTxtBonus.text = _local1.bonusPts;
displayTxtBonusMult.text = tBonus.prototype.multiplier[tbonus.prototype.currBonusLevel];
displayTxtMainEventLevel.text = _local1.mainEventLevel;
scoreBoard.display(_local1.mainPts);
};
_global.tScore.prototype.calculateScore = function (type) {
var _local1 = this;
var _local3 = tBonus.prototype.multiplier[tbonus.prototype.currBonusLevel];
var _local2 = _local1.mainPts + (_local1.bonusPts * _local3);
debugTrace((((((("finale score = " + _local1.mainPts) + " + (") + _local1.bonusPts) + " * ") + _local3) + ") = ") + _local2);
_local1.bonusPts = 0;
_local1.mainPts = _local2;
return(_local2);
};
_global.tScore.prototype.addPts = function (type) {
var _local1 = this;
switch (type) {
case "gateSwitch" :
debugTrace("add points: gateSwitch");
_local1.mainPts = _local1.mainPts + (2126 * MAIN_SCORE_MULT);
break;
case "gateSwitchAll" :
debugTrace("add points: gateSwitchAll");
_local1.bonusPts = _local1.bonusPts + (10000 * MAIN_SCORE_MULT);
break;
case "bumperTop" :
debugTrace("add points: bumperTop");
_local1.mainPts = _local1.mainPts + (532 * MAIN_SCORE_MULT);
break;
case "bumperBot" :
debugTrace("add points: bumperBot");
_local1.mainPts = _local1.mainPts + (2500 * MAIN_SCORE_MULT);
break;
case "target" :
debugTrace("add points: target");
_local1.mainPts = _local1.mainPts + (1000 * MAIN_SCORE_MULT);
break;
case "ramp" :
debugTrace("add points: ramp");
_local1.mainPts = _local1.mainPts + (10000 * MAIN_SCORE_MULT);
break;
case "target3" :
debugTrace("add points: target3");
_local1.bonusPts = _local1.bonusPts + (3000 * MAIN_SCORE_MULT);
break;
case "target9" :
debugTrace("add points: target9");
_local1.bonusPts = _local1.bonusPts + (50000 * MAIN_SCORE_MULT);
break;
case "lockBall" :
debugTrace("add points: lockBall");
_local1.mainPts = _local1.mainPts + (12225 * MAIN_SCORE_MULT);
break;
case "canon" :
debugTrace("add points: canon");
_local1.bonusPts = _local1.bonusPts + (((_local1.numCanonHit * 5000) + 10000) * MAIN_SCORE_MULT);
_local1.numCanonHit++;
myQuotes.incQuote();
break;
case "gravityWell" :
debugTrace("add points: gravityWell");
_local1.mainPts = _local1.mainPts + (37000 * MAIN_SCORE_MULT);
if (!gravityWell.open) {
break;
}
debugTrace("add points: gravityWell + allTargetsHit");
_local1.bonusPts = _local1.bonusPts + (50000 * MAIN_SCORE_MULT);
}
_local1.refreshMainDisplay();
};
_global.tRamp = function (mc) {
this.mc = mc;
this.hitStatus = false;
};
_global.tQuote = function () {
var _local1 = this;
_local1.topQuote_mc = topQuote_mc;
_local1.botQuote_quote_txt = botQuote_quote_txt;
_local1.botQuote_from_txt = botQuote_from_txt;
_local1.botQuotesArr = _root.botQuotes;
};
_global.tQuote.prototype.reset = function () {
var _local1 = this;
_local1.currTopQuote = 1;
_local1.currBotQuote = 1;
_local1.displayQuotes();
};
_global.tQuote.prototype.incQuote = function () {
var _local1 = this;
playSound(quote_snd);
_local1.currBotQuote++;
_local1.currTopQuote = _local1.currTopQuote + 0.2;
if (_local1.currBotQuote > _local1.botQuotesArr.length) {
_local1.currBotQuote = 1;
}
if (_local1.currTopQuote > (_local1.topQuote_mc._totalframes + 1)) {
_local1.currTopQuote = 1;
}
_local1.displayQuotes();
};
_global.tQuote.prototype.displayQuotes = function () {
var _local1 = this;
_local1.topQuote_mc.gotoAndStop(_local1.currTopQuote);
_local1.botQuote_quote_txt.text = _local1.botQuotesArr[_local1.currBotQuote - 1].quote;
_local1.botQuote_from_txt.text = _local1.botQuotesArr[_local1.currBotQuote - 1].from;
var _local2 = new TextFormat();
_local2.size = 21;
do {
_local2.size--;
_local1.botQuote_quote_txt.setTextFormat(_local2);
} while (_local1.botQuote_quote_txt.maxscroll != 1);
};
function dist(x1, y1, x2, y2) {
return(Math.sqrt(((x2 - x1) * (x2 - x1)) + ((y2 - y1) * (y2 - y1))));
}
function squareDist(x1, y1, x2, y2) {
return(((x2 - x1) * (x2 - x1)) + ((y2 - y1) * (y2 - y1)));
}
function normalizeVect(v) {
var _local1 = v;
var _local3 = _local1.x / _local1.norm;
var _local2 = _local1.y / _local1.norm;
return(new tVector(_local3, _local2));
}
function NormalizeVector(v) {
var _local2 = v;
var _local1 = dist(0, 0, _local2.x, _local2.y);
if (_local1 != 0) {
_local2.x = _local2.x / _local1;
_local2.y = _local2.y / _local1;
_local2.z = _local2.z / _local1;
}
}
function DotProduct(v1, v2) {
var _local1 = v2;
var _local2 = v1;
return(((_local2.x * _local1.x) + (_local2.y * _local1.y)) + (_local2.z * _local1.z));
}
function ScaleVector(v, scale) {
var _local2 = v;
var _local3 = scale;
var _local1 = new tVector();
_local1.x = _local2.x * _local3;
_local1.y = _local2.y * _local3;
_local1.z = _local2.z * _local3;
return(_local1);
}
function VectorSum(v1, v2) {
var _local2 = v2;
var _local3 = v1;
var _local1 = new tVector();
_local1.x = _local3.x + _local2.x;
_local1.y = _local3.y + _local2.y;
_local1.z = _local3.z + _local2.z;
return(_local1);
}
function VectorDifference(v1, v2) {
var _local2 = v2;
var _local3 = v1;
var _local1 = new tVector();
_local1.x = _local3.x - _local2.x;
_local1.y = _local3.y - _local2.y;
_local1.z = _local3.z - _local2.z;
return(_local1);
}
function sumVect(v1, v2, v3) {
var _local2 = (v1.x + v2.x) + v3.x;
var _local1 = (v1.y + v2.y) + v3.y;
return(new tVector(_local2, _local1));
}
function count(str, root) {
var _local2 = str;
var num;
var _local1;
var _local3;
if (root == undefined) {
root = _root;
}
num = 0;
for (_local1 in root) {
if (_local1.substr(0, _local2.length) == _local2) {
_local3 = _local1.substr(_local2.length, 1);
if (!isNaN(_local3)) {
num++;
}
}
}
return(num);
}
function addSpace(str) {
var newStr;
var _local3;
var _local1;
var _local2;
str = str.toString();
newStr = "";
_local3 = 0;
_local1 = str.length - 1;
while (_local1 >= 0) {
_local2 = str.charAt(_local1);
_local3++;
if ((_local3 == 3) && (_local1 != 0)) {
_local3 = 0;
_local2 = "," + _local2;
}
newStr = _local2 + newStr;
_local1--;
}
return(newStr);
}
function randomVelocity(norm, angle, range) {
var _local2 = angle + ((Math.random() * range) - (range / 2));
var _local1 = _local2 * toRad;
return(new Position(norm * Math.cos(_local1), norm * Math.sin(_local1)));
}
function centerGravity(i, x, y) {
var _local3 = i;
var _local2 = new tVector(x - ball[_local3].pos.x, y - ball[_local3].pos.y);
var _local1 = normalizeVect(_local2);
_local1.x = _local1.x * 0.75;
_local1.y = _local1.y * 0.75;
ball[_local3].physic.changeGravity(_local1);
}
function doWallCollision(wall, ball) {
var _local1 = ball;
var x = (_local1.pos.x - wall.pos.x);
var y = (_local1.pos.y - wall.pos.y);
var dx = (_local1.pos.x - _local1.oldPos.x);
var dy = (_local1.pos.y - _local1.oldPos.y);
var angleRad = wall.angle;
var _local3 = Math.cos(angleRad);
var _local2 = Math.sin(angleRad);
var x1 = ((_local3 * x) + (_local2 * y));
var y1 = ((_local3 * y) - (_local2 * x));
var dx1 = ((_local3 * dx) + (_local2 * dy));
var dy1 = ((_local3 * dy) - (_local2 * dx));
var vx1 = ((_local3 * _local1.vel.x) + (_local2 * _local1.vel.y));
var vy1 = ((_local3 * _local1.vel.y) - (_local2 * _local1.vel.x));
if (((Math.abs(y1) < radius) && (dy1 > 0)) && (!_local1.collision)) {
trace(wall.mc);
_local1.collision++;
y1 = -radius;
vy1 = vy1 * (-_local1.physic.bounce);
vy1 = vy1 * wall.strength;
x = (_local3 * x1) - (_local2 * y1);
y = (_local3 * y1) + (_local2 * x1);
_local1.vel.x = (_local3 * vx1) - (_local2 * vy1);
_local1.vel.y = (_local3 * vy1) + (_local2 * vx1);
_local1.pos.x = x + wall.pos.x;
_local1.pos.y = y + wall.pos.y;
refreshBallPos(_local1.pos, _local1);
if (wall.strength == activeWallStrength) {
mainScore.addPts("bumperBot");
playSound(bumper_snd);
}
} else {
_local1.collision = 0;
}
}
function doPointCollision(point, ball, clip) {
var _local2 = point;
var distBallPoint = dist(ball.pos.x, ball.pos.y, _local2.pos.x, _local2.pos.y);
if ((distBallPoint < (radius + _local2.radius)) && (!ball.collision)) {
ball.collision++;
var dl = (radius + _local2.radius);
var _local1 = ball;
var ma = new tVector(_local1.oldPos.x - _local1.pos.x, _local1.oldPos.y - _local1.pos.y);
var _local3 = normalizeVect(ma);
do {
var d = dist(_local1.pos.x, _local1.pos.y, _local2.pos.x, _local2.pos.y);
_local1.pos.x = _local1.pos.x + (_local3.x * 2);
_local1.pos.y = _local1.pos.y + (_local3.y * 2);
} while (d < dl);
var p = new Position((_local2.pos.x + _local1.pos.x) / 2, (_local2.pos.y + _local1.pos.y) / 2);
var pb = new tVector(_local1.pos.x - p.x, _local1.pos.y - p.y);
var cosAngle = Math.cos(pb.phiRad);
var sinAngle = Math.sin(pb.phiRad);
var v1x = ((cosAngle * _local1.vel.x) + (sinAngle * _local1.vel.y));
var v1y = ((cosAngle * _local1.vel.y) - (sinAngle * _local1.vel.x));
var v2x = (-v1x);
var v2y = v1y;
var v3x = ((cosAngle * v2x) - (sinAngle * v2y));
var v3y = ((cosAngle * v2y) + (sinAngle * v2x));
_local1.vel.x = v3x * _local2.strength;
_local1.vel.y = v3y * _local2.strength;
refreshBallPos(_local1.pos, _local1);
clip.gotoAndPlay("start");
if (((clip == clipBumper0) || (clip == clipBumper1)) || (clip == clipBumper2)) {
mainScore.addPts("bumperTop");
playSound(bumper_snd);
}
} else {
ball.collision = 0;
}
}
function doBallCollision(b1, b2) {
var _local1 = b1;
var _local3 = b2;
var _local2 = VectorDifference(_local1.pos, _local3.pos);
var distBall = dist(_local1.pos.x, _local1.pos.y, _local3.pos.x, _local3.pos.y);
if (distBall < (2 * radius)) {
normalizeVector(_local2);
var relativeVelocity = DotProduct(_local2, _local1.vel);
if (relativeVelocity < 0) {
var VdotN = DotProduct(_local2, _local1.vel);
var Vn = ScaleVector(_local2, VdotN);
var Vn1 = ScaleVector(Vn, _local1.physic.bounce);
var Vt = VectorDifference(_local1.vel, Vn1);
_local1.vel = VectorDifference(Vt, Vn1);
_local3.vel = VectorSum(Vn, _local3.vel);
}
}
}
function checkFlippers(i) {
var _local2 = i;
var _local1 = ball[_local2];
for (_local2 in flipper) {
if (flipper[_local2].mc.hitTest(_local1.hitZone)) {
if (flipper[_local2].mc.hitZoneInf.hitTest(_local1.pos.x, _local1.pos.y, true)) {
var angleSurf = (flipper[_local2].angle + flipper[_local2].angleInf);
var angleVel = (Math.atan2(_local1.vel.y, _local1.vel.x) * toDeg);
var normVel = dist(0, 0, _local1.vel.x, _local1.vel.y);
normVel = normVel * flipperBounce;
do {
_local1.pos.y = _local1.pos.y + 0.25;
} while (flipper[_local2].mc.hitZoneInf.hitTest(_local1.pos.x, _local1.pos.y, true));
var newAngleVel = ((-angleVel) + angleSurf);
if (flipper[_local2].moving) {
var fl = new tVector();
var fSpeed = ((Math.abs(_local1.pos.x - flipper[_local2].pos.x) / 55) * flipper[_local2].strength);
fl.x = fSpeed * Math.sin(angleSurf * toRad);
fl.y = (-fSpeed) * Math.cos(angleSurf * toRad);
}
_local1.vel.x = (normVel * Math.cos(newAngleVel * toRad)) + fl.x;
_local1.vel.y = (normVel * Math.sin(newAngleVel * toRad)) + fl.y;
refreshBallPos(_local1.pos, _local1);
}
if (flipper[_local2].mc.hitZoneSup.hitTest(_local1.pos.x, _local1.pos.y, true)) {
var angleSurf = (flipper[_local2].angle + flipper[_local2].angleSup);
var angleVel = (Math.atan2(_local1.vel.y, _local1.vel.x) * toDeg);
var normVel = dist(0, 0, _local1.vel.x, _local1.vel.y);
normVel = normVel * flipperBounce;
do {
_local1.pos.y = _local1.pos.y - 0.25;
} while (flipper[_local2].mc.hitZoneSup.hitTest(_local1.pos.x, _local1.pos.y, true));
var newAngleVel = ((-angleVel) + angleSurf);
if (flipper[_local2].moving) {
var fl = new tVector();
var fSpeed = ((Math.abs(_local1.pos.x - flipper[_local2].pos.x) / 42) * flipper[_local2].strength);
fl.x = fSpeed * Math.sin(angleSurf * toRad);
fl.y = (-fSpeed) * Math.cos(angleSurf * toRad);
}
_local1.vel.x = (normVel * Math.cos(newAngleVel * toRad)) + fl.x;
_local1.vel.y = (normVel * Math.sin(newAngleVel * toRad)) + fl.y;
refreshBallPos(_local1.pos, _local1);
}
if (flipper[_local2].mc.endHitZone.hitTest(_local1.pos.x, _local1.pos.y, true)) {
var end = new Position(flipper[_local2].mc._x, flipper[_local2].mc._y);
if (flipper[_local2].mc.type == "left") {
end.x = end.x + (42 * Math.cos(flipper[_local2].angle * toRad));
end.y = end.y + (42 * Math.sin(flipper[_local2].angle * toRad));
} else {
end.x = end.x + (-42 * Math.cos(flipper[_local2].angle * toRad));
end.y = end.y + (-42 * Math.sin(flipper[_local2].angle * toRad));
}
var bv = new tVector(_local1.vel.x, _local1.vel.y);
var _local3 = new tVector(_local1.pos.x - end.x, _local1.pos.y - end.y);
_local3 = normalizeVect(_local3);
_local3 = new tVector((_local3.x * bv.norm) * flipperBounce, (_local3.y * bv.norm) * flipperBounce);
var fl = new tVector();
var fSpeed = flipper[_local2].strength;
fl.x = (fSpeed * Math.sin(flipper[_local2].angle * toRad)) * flipper[_local2].moving;
fl.y = ((-fSpeed) * Math.cos(flipper[_local2].angle * toRad)) * flipper[_local2].moving;
var sum = sumVect(bv, _local3, fl);
_local1.vel.x = sum.x;
_local1.vel.y = sum.y;
refreshBallPos(_local1.pos, _local1);
}
}
}
}
function initMain() {
_global.toRad = (Math.PI/180);
_global.toDeg = 57.2957795130823;
activeBumperStrength = 2;
passiveBumperStrength = 0.5;
activeWallStrength = 10;
flipperStrength = 16;
flipperBounce = 0.8;
TOTAL_BALLS = 5;
NUM_KICKBACK = 4;
NUM_MAINEVENTLEVEL = 3;
MAIN_SCORE_MULT = 10;
Y_SEPARATION = 330;
X_SEPARATION = 485;
GRAVITYWELL_TIMER = 5000;
pauseFlag = false;
}
function initBall() {
tBall.prototype.reset();
ball = [];
numBallInPlay = 0;
currBall = 0;
lastBall = TOTAL_BALLS;
radius = 10;
maxSpeed = 16;
TOP = 0;
BOTTOM = 560;
LEFT = 0;
RIGHT = 750;
}
function initWalls() {
var _local1;
var _local2;
var _local3;
var end;
var angleRad;
var angleDeg;
numWalls = count("dot");
numWalls--;
wall = [];
_local1 = 0;
while (_local1 < numWalls) {
_local2 = attachMovie("wall", "wall" + _local1, 1000 + _local1);
_local2._visible = debug.showWalls;
_local2.n = _local1;
_local2._x = _root["dot" + _local1]._x;
_local2._y = _root["dot" + _local1]._y;
_local3 = new Position(_local2._x, _local2._y);
end = new Position(_root["dot" + (_local1 + 1)]._x, _root["dot" + (_local1 + 1)]._y);
_local2._width = dist(_local3.x, _local3.y, end.x, end.y);
angleRad = Math.atan2(end.y - _local3.y, end.x - _local3.x);
angleDeg = (_local2._rotation = angleRad * toDeg);
wall.push(new tWall(_local2, angleRad, _local3));
_local1++;
}
wallZoneA = [];
wallZoneB = [];
wallZoneC = [];
wallZoneD = [];
_local1 = 0;
while (_local1 <= 5) {
wallZoneA.push((temp = wall[_local1]));
_local1++;
}
_local1 = 5;
while (_local1 <= 17) {
wallZoneB.push((temp = wall[_local1]));
_local1++;
}
_local1 = 17;
while (_local1 <= 29) {
wallZoneC.push((temp = wall[_local1]));
_local1++;
}
_local1 = 29;
while (_local1 <= 34) {
wallZoneD.push((temp = wall[_local1]));
_local1++;
}
delete wall;
removeSingleWall(wallZoneC, "wall27");
}
function initClusterWalls() {
var _local3 = count("clusterWall");
clusterWallTop = [];
clusterWallBot = [];
i = 1;
while (i <= _local3) {
var _local1 = _root["clusterWall" + i];
var _local2 = createWallArr(_local1);
if (_local1._y < 332) {
clusterWallTop.push(new tClusterWall(_local1, _local2));
} else {
clusterWallBot.push(new tClusterWall(_local1, _local2));
}
i++;
}
}
function createWallArr(root) {
var _local1 = root;
var numWalls = count("dot", _local1);
var wallArr = [];
var _local2 = 1;
while (_local2 <= numWalls) {
var _local3 = _local1.attachMovie("wall", "wall" + _local2, 1000 + _local2);
_local3._visible = debug.showWalls;
_local3._x = _local1["dot" + _local2]._x;
_local3._y = _local1["dot" + _local2]._y;
_local3.n = _local2;
if (_local2 == numWalls) {
var end = new Position(_local1.dot1._x + _local1._x, _local1.dot1._y + _local1._y);
} else {
var end = new Position(_local1["dot" + (_local2 + 1)]._x + _local1._x, _local1["dot" + (_local2 + 1)]._y + _local1._y);
}
var pos = new Position(_local3._x + _local1._x, _local3._y + _local1._y);
_local3._width = dist(pos.x, pos.y, end.x, end.y);
angleRad = Math.atan2(end.y - pos.y, end.x - pos.x);
angleDeg = (_local3._rotation = angleRad * toDeg);
wallArr.push(new tWall(_local3, angleRad, pos));
_local2++;
}
return(wallArr);
}
function initSingleWalls() {
var _local1 = _root;
wallZoneD.push(createSingleWall(_local1, "singleWallDot", 0, 1, 1));
wallZoneD.push(createSingleWall(_local1, "singleWallDot", 2, 3, activeWallStrength));
wallZoneA.push(createSingleWall(_local1, "singleWallDot", 4, 5, activeWallStrength));
wallZoneA.push(createSingleWall(_local1, "singleWallDot", 6, 7, 1));
gravityWell.wallArr.push(createSingleWall(gravityWell_mc, "singleWallDot", 1, 2, 1));
gravityWell.wallArr.push(createSingleWall(gravityWell_mc, "singleWallDot", 2, 3, 1));
gravityWell.wallArr.push(createSingleWall(gravityWell_mc, "singleWallDot", 3, 4, 1));
gravityWell.wallArr.push(createSingleWall(gravityWell_mc, "singleWallDot", 4, 5, 1));
}
function createSingleWall(root, str, iStart, iEnd, strength) {
var _local2 = root;
var i = iStart;
var _local1 = _local2.attachMovie("wall", "singleWall" + i, 2000 + i);
_local1._visible = debug.showWalls;
_local1._x = _local2[str + i]._x;
_local1._y = _local2[str + i]._y;
_local1.n = i;
var end = new Position(_local2[str + iEnd]._x + _local2._x, _local2[str + iEnd]._y + _local2._y);
var _local3 = new Position(_local1._x + _local2._x, _local1._y + _local2._y);
_local1._width = dist(_local3.x, _local3.y, end.x, end.y);
angleRad = Math.atan2(end.y - _local3.y, end.x - _local3.x);
angleDeg = (_local1._rotation = angleRad * toDeg);
return(new tWall(_local1, angleRad, _local3, strength));
}
function removeSingleWall(root, name) {
var _local1 = root;
var _local2 = name;
for (var _local3 in _local1) {
if (_local1[_local3].mc._name == _local2) {
_local1[_local3].mc.removeMovieClip();
_local1.splice(_local3, 1);
break;
}
}
}
function initBumpers() {
var numBumpers = count("bumper");
bumperTop = [];
bumperBot = [];
var _local1 = 0;
while (_local1 < numBumpers) {
var _local2 = _root["bumper" + _local1];
var _local3 = _root["clipBumper" + _local1];
var strength = ((_local1 < 3) ? (activeBumperStrength) : (passiveBumperStrength));
if (_local2._y < Y_SEPARATION) {
bumperTop[_local1] = new tBumper(_local2, strength, undefined, _local3);
} else {
bumperBot[_local1] = new tBumper(_local2, strength, undefined, _local3);
}
_local1++;
}
}
function initFlippers() {
var numFlippers = count("flipper");
flipper = [];
i = 0;
while (i < numFlippers) {
var _local1 = _root["flipper" + i];
var _local3 = new Position(_local1._x, _local1._y);
var _local2 = _local1._width;
var angle = _local1._rotation;
flipper[i] = new tFlipper(_local1, angle, _local2, _local3);
flipper[i].type = flipper[i].mc.type;
flipper[i].strength = flipperStrength;
flipper[i].angleSup = -5.22;
flipper[i].angleInf = 5.22;
i++;
}
}
function initGravityWell() {
var _local1 = createWallArr(gravityWell_mc);
gravityWell = new tgravityWell(gravityWell_mc, _local1, clipGravityWell);
gravityWell.inPos = new Position(X_SEPARATION - 151, Y_SEPARATION - 168);
gravityWell.outPos = new Position(X_SEPARATION, Y_SEPARATION - 248);
clipIris.ballIn = false;
gravityWell.setOn();
}
function initLaunchRamp() {
launchRamp = {};
launchRamp.mc = launchRamp_mc;
launchRamp.exitClose = true;
launchRamp.wallArr = createWallArr(launchRamp_mc);
removeSingleWall(launchRamp.wallArr, "wall20");
resetLaunchRamp();
}
function initTargets() {
tTarget.prototype.initialise();
var numTargets = count("target", _root);
target = [];
var _local2 = 0;
while (_local2 < numTargets) {
var _local1 = _root["target" + _local2];
_local1.gotoAndStop("on");
var x = (_local1._x + _local1.bumper0._x);
var y = (_local1._y + _local1.bumper0._y);
var pos = new Position(x, y);
var _local3 = _local1.bumper0._width;
var hitStatus = true;
target[_local2] = new tTarget(_local1, _local3, passiveBumperStrength, pos, hitStatus);
_local2++;
}
}
function initLockBall() {
lockBall = new tLockBall(lockBall_mc, 2000, clipLockBall);
}
function initKickback() {
kickback = [];
var _local1 = kickback_mc0;
var _local3 = randomVelocity(15, -100, 0);
var _local2 = clipKickback0;
var anim = animKickback0;
kickback.push(new tKickBack(_local1, _local3, _local2, anim));
_local1 = kickback_mc1;
_local3 = randomVelocity(15, -80, 0);
_local2 = clipKickback1;
var anim = animKickback1;
kickback.push(new tKickBack(_local1, _local3, _local2, anim));
}
function resetKickBack() {
for (i in kickBack) {
kickBack[i].reset();
}
}
function initCanon() {
var _local1 = createWallArr(canon_mc);
canon = new tCanon(canon_mc, _local1, clipCanon);
removeSingleWall(clusterWallTop[2].wallArr, "wall9");
}
function initSwitches() {
var _local3 = count("switch", switches_mc);
validatingGate = undefined;
gateSwitch = [];
i = 0;
while (i < _local3) {
var _local1 = switches_mc["switch" + i];
var _local2 = _root["switch_clip" + i];
gateSwitch.push(new tSwitch(_local1, _local2));
i++;
}
}
function initBonuses() {
var _local3 = count("bonus_mc", _root);
var bonusLabel = ["X2", "X4", "X6", "X8", "H"];
tBonus.prototype.initialise(_local3);
bonus = [];
var _local1 = 0;
while (_local1 < _local3) {
var _local2 = _root["bonus_mc" + _local1];
bonus.push(new tBonus(_local2, bonusLabel[_local1]));
_local1++;
}
}
function initMainDisplay() {
mainScore = new tScore();
}
function initRamps() {
var _local3 = count("ramp_mc", _root);
ramp = [];
var _local1 = 0;
while (_local1 < _local3) {
var _local2 = _root["ramp_mc" + _local1];
ramp.push(new tRamp(_local2));
_local1++;
}
}
function initQuotes() {
myQuotes = new tQuote();
myQuotes.reset();
}
function checkWallZoneTop(i) {
var _local1 = i;
var _local2 = ball[_local1];
if (_local2.pos.x > X_SEPARATION) {
for (_local1 in wallZoneB) {
if (wallZoneB[_local1].mc.hitTest(_local2.hitZone)) {
doWallCollision(wallZoneB[_local1], _local2);
}
}
} else {
for (_local1 in wallZoneC) {
if (wallZoneC[_local1].mc.hitTest(_local2.hitZone)) {
doWallCollision(wallZoneC[_local1], _local2);
}
}
}
}
function checkWallZoneBot(i) {
var _local1 = i;
var _local2 = ball[_local1];
if (_local2.pos.x > X_SEPARATION) {
for (_local1 in wallZoneA) {
if (wallZoneA[_local1].mc.hitTest(_local2.hitZone)) {
doWallCollision(wallZoneA[_local1], _local2);
}
}
} else {
for (_local1 in wallZoneD) {
if (wallZoneD[_local1].mc.hitTest(_local2.hitZone)) {
doWallCollision(wallZoneD[_local1], _local2);
}
}
}
}
function checkBalls(i) {
var _local2 = i;
var _local1 = ball[_local2];
for (j in Ball) {
if (j == _local2) {
continue;
}
if (Ball[j].hitZone.hitTest(_local1.hitZone)) {
trace("multiball collision detected");
doBallCollision(_local1, ball[j]);
}
}
}
function checkHole(i) {
var _local1 = ball[i];
if (_local1.pos.y > (Y_SEPARATION + 188)) {
if ((_local1.pos.x > (X_SEPARATION - 43)) && (_local1.pos.x < (X_SEPARATION + 43))) {
_local1.changeMode("out");
mainScore.calculateScore();
mainScore.refreshMainDisplay();
tBonus.prototype.reset();
resetkickBack();
clipBallLost.gotoAndPlay("on");
if (tTarget.prototype.allTargetsHit) {
tTarget.prototype.reset();
}
playSound(ballLost_snd);
}
}
}
function checkClusterWallTop(i) {
var _local1 = ball[i];
for (j in clusterWallTop) {
if (clusterWallTop[j].mc.hitTest(_local1.hitZone)) {
for (k in clusterWallTop[j].wallArr) {
if (clusterWallTop[j].wallArr[k].mc.hitTest(_local1.hitZone)) {
doWallCollision(clusterWallTop[j].wallArr[k], _local1);
}
}
}
}
}
function checkClusterWallBot(i) {
var _local1 = ball[i];
for (j in clusterWallBot) {
if (clusterWallBot[j].mc.hitTest(_local1.hitZone)) {
for (k in clusterWallBot[j].wallArr) {
if (clusterWallBot[j].wallArr[k].mc.hitTest(_local1.hitZone)) {
doWallCollision(clusterWallBot[j].wallArr[k], _local1);
}
}
}
}
}
function checkBumpersTop(i) {
var _local1 = i;
var _local2 = ball[_local1];
for (_local1 in bumperTop) {
if (bumperTop[_local1].mc.hitTest(_local2.hitZone)) {
doPointCollision(bumperTop[_local1], _local2, bumperTop[_local1].clip);
}
}
}
function checkBumpersBot(i) {
var _local1 = i;
var _local2 = ball[_local1];
for (_local1 in bumperBot) {
if (bumperBot[_local1].mc.hitTest(_local2.hitZone)) {
doPointCollision(bumperBot[_local1], _local2, bumperTop[_local1].clip);
}
}
}
function checkGravityWell(i) {
var _local1 = ball[i];
if (gravityWell.hitZone.hitTest(_local1.pos.x, _local1.pos.y, false)) {
_local1.changeMode("gravityWell");
}
}
function checkGravityWellWalls(i) {
var _local1 = i;
var _local2 = ball[_local1];
for (_local1 in gravityWell.WallArr) {
if (gravityWell.WallArr[_local1].mc.hitTest(_local2.hitZone)) {
doWallCollision(gravityWell.WallArr[_local1], _local2);
}
}
}
function checkGravityWellHole(i) {
var b = ball[i];
var _local2 = squareDist(gravityWell.inPos.x, gravityWell.inPos.y, b.pos.x, b.pos.y);
var _local1 = squareDist(gravityWell.inPos.x, gravityWell.inPos.y, b.oldPos.x, b.oldPos.y);
if ((!clipIris.ballIn) && ((_local2 + _local1) < 5)) {
clipIris.ballIn = true;
clipIris.open();
b.changeMode("pause");
b.mc._visible = false;
mainScore.addPts("gravityWell");
playSound(strip_snd);
clipIris.callBack = function () {
trace("release ball: " + b.mc);
b.teleport(new Position(gravityWell.outPos.x, gravityWell.outPos.y), randomVelocity(2, 0, 360), "mainTable");
b.mc._visible = true;
clipIris.close();
clipIris.ballIn = false;
};
}
}
function checkLaunchRampWalls(i) {
var _local1 = i;
var _local2 = ball[_local1];
for (_local1 in launchRamp.wallArr) {
if (launchRamp.wallArr[_local1].mc.hitTest(_local2.hitZone)) {
if ((_local1 == 7) || (_local1 == 8)) {
if (launchRamp.exitClose) {
doWallCollision(launchRamp.wallArr[_local1], _local2);
}
} else {
doWallCollision(launchRamp.wallArr[_local1], _local2);
}
}
}
if (launchRamp.exitClose) {
if (launchRamp.mc.hitZone1.hitTest(_local2.hitZone)) {
launchRamp.exitClose = false;
_local2.physic.reset();
}
}
if (_local2.pos.x < (X_SEPARATION + 2)) {
launchRamp.exitClose = true;
_local2.teleport(_local2.pos, randomVelocity(exitRampSpeed(), -164, 0), "mainTable");
stopSound(mainRamp_snd);
}
}
function checkTargets(i) {
var _local2 = i;
var _local1 = ball[_local2];
for (_local2 in target) {
if (target[_local2].hitStatus && (target[_local2].mc.bumper0.hitTest(_local1.hitZone))) {
target[_local2].setOff();
playSound(ding_snd);
}
}
}
function checkLockBall(i) {
var b = ball[i];
if ((lockBall.enabled && (lockBall.mc.hitTest(b.hitZone))) && (lockBall.hitZone.hitTest(b.pos.x, b.pos.y, true))) {
lockBall.setLock();
lastBall++;
mainScore.addPts("lockBall");
lockInt = setInterval(function () {
lockBall.setUnlock();
b.vel = randomVelocity(15, 145, 0);
b.changeMode("mainTable");
clearInterval(lockInt);
}, 2000);
refreshBallPos(lockBall.pos, b);
b.changeMode("pause");
launcherGun.autoFire = true;
launchNewBall();
}
}
function checkKickback(i) {
var _local1 = i;
var _local2 = ball[_local1];
for (_local1 in kickback) {
if (kickback[_local1].status && (kickback[_local1].mc.hitTest(_local2.hitZone))) {
if (kickback[_local1].mc.hitTest(_local2.pos.x, _local2.pos.y, false)) {
kickback[_local1].kick(_local2);
playSound(canon_snd);
}
}
}
}
function checkCanon(i) {
var _local1 = i;
var b = ball[_local1];
for (_local1 in canon.wallArr) {
if (canon.wallArr[_local1].mc.hitTest(b.hitZone)) {
doWallCollision(canon.wallArr[_local1], b);
if ((!canon.ballIn) && (canon.hitZone.hitTest(b.pos.x, b.pos.y, false))) {
canon.ballIn = true;
canon.setOff();
refreshBallPos(new Position(X_SEPARATION, Y_SEPARATION - 26), b);
b.changeMode("pause");
mainScore.addPts("canon");
canonInt = setInterval(function () {
canon.ballIn = false;
canon.setOn();
var _local1 = ((random(2) == 0) ? (randomVelocity(15, 96, 0)) : (randomVelocity(15, 83, 0)));
b.teleport(b.pos, _local1, "mainTable");
playSound(canon_snd);
clearInterval(canonInt);
}, 1000);
}
}
}
}
function checkSwitches(i) {
var _local1 = i;
b = ball[_local1];
if (switches_mc.hitTest(b.hitZone)) {
for (_local1 in gateSwitch) {
if ((!gateSwitch[_local1].hitFlag) && (gateSwitch[_local1].mc.hitTest(b.pos.x, b.pos.y, false))) {
if (!gateSwitch[validatingGate].flag) {
trace("gateSwitch" + _local1);
gateSwitch[_local1].setOn();
validatingGate = _local1;
gateSwitch[validatingGate].flag = true;
gateSwitch[_local1].hitFlag = true;
mainScore.addPts("gateSwitch");
if ((gateSwitch[0].hitStatus && (gateSwitch[1].hitStatus)) && (gateSwitch[2].hitStatus)) {
trace("all switches on");
tBonus.prototype.increment();
tSwitch.prototype.resetAll();
mainScore.addPts("gateSwitchAll");
}
}
} else if (_local1 == validatingGate) {
gateSwitch[validatingGate].flag = false;
}
}
}
}
function checkRamps(i) {
var _local1 = i;
b = ball[_local1];
for (_local1 in ramp) {
if ((!ramp[_local1].hitStatus) && (ramp[_local1].mc.hitTest(b.hitZone))) {
if (ramp[_local1].mc.hitTest(b.pos.x, b.pos.y, false)) {
ramp[_local1].hitStatus = true;
mainScore.addPts("ramp");
} else {
ramp[_local1].hitStatus = false;
}
}
}
}
function checkKeyPressed() {
}
function initAllObjects() {
initMain();
initWalls();
initBumpers();
initBall();
initClusterWalls();
initFlippers();
initGravityWell();
initLaunchRamp();
initSingleWalls();
initTargets();
initLockBall();
initKickback();
initCanon();
initSwitches();
initBonuses();
initMainDisplay();
initRamps();
initQuotes();
launcherGun.init();
clipMainEvent.init();
}
function startMainEngine() {
_root.onEnterFrame = function () {
checkKeyPressed();
if (debug.showFPS) {
displayFPS();
}
if (debug.showBallStatus) {
debugTxt0.text = "M: " + ball[0].mode;
debugTxt1.text = "F: " + ball[0].physic.friction;
debugTxt2.text = "B: " + ball[0].physic.bounce;
debugTxt3.text = "Gy: " + ball[0].physic.gravity.y;
debugTxt4.text = "M: " + ball[1].mode;
debugTxt5.text = "F: " + ball[1].physic.friction;
debugTxt6.text = "B: " + ball[1].physic.bounce;
debugTxt7.text = "Gy: " + ball[1].physic.gravity.y;
debugTxt8.text = "numBall: " + numBallInPlay;
debugTxt9.text = "ballIn: " + lockBall.ballIn;
debugTxt10.text = "collision: " + ball[0].collision;
debugTxt11.text = "ramp[0].HitStatus: " + ramp[0].HitStatus;
debugTxt12.text = "ramp[1].HitStatus: " + ramp[0].HitStatus;
}
for (i in ball) {
ball[i].collision = 0;
switch (ball[i].mode) {
case "mainTable" :
moveBall(i);
checkBalls(i);
if (ball[i].pos.y < Y_SEPARATION) {
checkWallZoneTop(i);
checkClusterWallTop(i);
checkBumpersTop(i);
checkGravityWell(i);
checkTargets(i);
checkLockBall(i);
checkCanon(i);
checkSwitches(i);
checkRamps(i);
} else {
if (debug.ballStaysUp) {
ball[i].vel.y = -15;
}
checkBumpersBot(i);
checkWallZoneBot(i);
checkClusterWallBot(i);
checkHole(i);
checkFlippers(i);
checkKickback(i);
}
break;
case "out" :
removeBall(i);
launchNewBall();
break;
case "gravityWell" :
moveBall(i);
checkGravityWellWalls(i);
centerGravity(i, X_SEPARATION - 151, Y_SEPARATION - 168);
checkGravityWellHole(i);
break;
case "launchRamp" :
moveBall(i);
checkLaunchRampWalls(i);
break;
case "pause" :
}
}
};
}
function stopMainEngine() {
delete _root.onEnterFrame;
}
function launchNewBall() {
if (currBall < lastBall) {
if ((numBallInPlay < 1) || (lockBall.ballIn && (numBallInPlay < 2))) {
numBallInPlay++;
currBall++;
ballLeft = (lastBall - currBall) + 1;
debugTrace("ballLeft: " + ballLeft);
launcherGun.cock();
launcherGun.callBack = function () {
if (debug.launcher) {
var _local1 = new Position(launcher._x, launcher._y);
var _local2 = randomVelocity(15, -120, 0);
ball.push((newBall = new tBall(ballMainTable, _local1, _local2)));
newBall.changeMode("mainTable");
} else {
var _local1 = new Position(X_SEPARATION + 186.5, Y_SEPARATION + 91.5);
trace(_local1);
var _local2 = randomVelocity(16, -90, 0);
ball.push((newBall = new tBall(ballLaunchRamp, _local1, _local2)));
newBall.changeMode("launchRamp");
}
};
}
} else if (numBallInPlay == 0) {
_root.attachMovie("popup_gameOver", "popup", 1);
}
}
function exitRampSpeed() {
var _local1 = random(3);
switch (_local1) {
case 0 :
return(((Math.random() * 0.3) - 0.015) + 7.15);
case 1 :
return(((Math.random() * 0.1) - 0.005) + 6.65);
case 2 :
return(((Math.random() * 0.2) - 0.1) + 4.9);
}
return(undefined);
}
function resetAllBall() {
for (var _local1 in ball) {
removeBall(_local1);
}
tBall.prototype.reset();
}
function removeBall(i) {
numBallInPlay--;
if (numBallInPlay < 2) {
lockBall.setOn();
}
ball[i].mc.removeMovieClip();
ball.splice(i, 1);
}
function moveBall(i) {
var _local1 = ball[i];
_local1.oldPos.x = _local1.pos.x;
_local1.oldPos.y = _local1.pos.y;
_local1.vel.x = _local1.vel.x + _local1.physic.gravity.x;
_local1.vel.y = _local1.vel.y + _local1.physic.gravity.y;
_local1.vel.x = _local1.vel.x * _local1.physic.friction;
_local1.vel.y = _local1.vel.y * _local1.physic.friction;
var _local2 = new tVector(_local1.vel.x, _local1.vel.y);
if (_local2.norm > maxSpeed) {
_local1.vel.x = maxSpeed * Math.cos(_local2.phiRad);
_local1.vel.y = maxSpeed * Math.sin(_local2.phiRad);
}
_local1.pos.x = _local1.pos.x + _local1.vel.x;
_local1.pos.y = _local1.pos.y + _local1.vel.y;
_local1.mc._x = _local1.pos.x;
_local1.mc._y = _local1.pos.y;
}
function refreshBallPos(pos, ball) {
var _local1 = ball;
_local1.mc._x = (_local1.pos.x = pos.x);
_local1.mc._y = (_local1.pos.y = pos.y);
}
function stopBall(ball) {
var _local1 = ball;
trace(((("V = (" + _local1.vel.x) + ", ") + _local1.vel.y) + ")");
_local1.vel.x = 0;
_local1.vel.y = 0;
_local1.physic.changeGravity(new Vector2d(0, 0));
}
function keyPressed_start() {
launchNewBall();
startMainEngine();
}
function keyPressed_restart() {
resetAllBall();
stopMainEngine();
initAllObjects();
launchNewBall();
startMainEngine();
}
function keyPressed_pause() {
if (!pauseFlag) {
setPause();
} else {
setUnpause();
}
}
function setPause() {
if (!popupMode) {
pauseFlag = true;
ballMode = [];
for (var _local1 in ball) {
if (ball[_local1].mode == "pause") {
ballMode[_local1] = "mainTable";
} else {
ballMode[_local1] = ball[_local1].mode;
}
ball[_local1].changeMode("pause");
}
}
}
function setUnpause() {
if (!popupMode) {
pauseFlag = false;
for (var _local1 in ball) {
ball[_local1].changeMode(ballMode[_local1]);
}
}
}
function keyPressed_fire() {
if (!pauseFlag) {
launcherGun.fire();
}
}
function openStartPopup() {
initQuotes();
if (debugUser) {
keyPressed_restart();
} else {
_root.attachMovie("popup_startGame", "popup_startGame", 5);
popup_startGame.dispMsg.text = user.gamesLeft;
}
}
function openHighScoreWindow() {
if (_root.highScoreTable == undefined) {
_root.attachMovie("highScoreTable", "highScoreTable", 2);
if (pauseFlag) {
alreadyPaused = true;
} else {
alreadyPaused = false;
setPause();
}
if (popup_startGame != undefined) {
openStartScreenFlag = true;
}
}
}
gotoAndStop ("init");
FREEGAME = true;
buttonEnabled = true;
linkBtn.onRelease = function () {
getURL ("http://www.thinkclear.co.uk", "_blank");
};
Instance of Symbol 184 MovieClip "flipper0" in Frame 4
onClipEvent (load) {
startAngle = 25;
endAngle = -25;
inc = -10;
angle = startAngle;
type = "left";
this.attachMovie("flipperBolt", "bolt", 1);
}
onClipEvent (enterFrame) {
if (!_root.pauseFlag) {
_root.flipper[0].moving = 1;
if (Key.isDown(37)) {
if (!soundFlag) {
soundFlag = true;
_root.playSound(_root.flipper_snd);
}
angle = angle + inc;
if (angle < endAngle) {
_root.flipper[0].moving = 0;
angle = endAngle;
}
} else {
soundFlag = false;
angle = angle - inc;
if (angle > startAngle) {
_root.flipper[0].moving = 0;
angle = startAngle;
}
}
_root.flipper[0].angle = angle;
_rotation = angle;
bolt._rotation = -angle;
}
}
Instance of Symbol 186 MovieClip "flipper1" in Frame 4
onClipEvent (load) {
startAngle = -25;
endAngle = 25;
inc = 10;
angle = startAngle;
type = "right";
this.attachMovie("flipperBolt", "bolt", 1);
}
onClipEvent (enterFrame) {
if (!_root.pauseFlag) {
_root.flipper[1].moving = 1;
if (Key.isDown(39)) {
if (!soundFlag) {
soundFlag = true;
_root.playSound(_root.flipper_snd);
}
angle = angle + inc;
if (angle >= endAngle) {
_root.flipper[1].moving = 0;
angle = endAngle;
}
} else {
soundFlag = false;
angle = angle - inc;
if (angle <= startAngle) {
_root.flipper[1].moving = 0;
angle = startAngle;
}
}
_root.flipper[1].angle = angle;
_rotation = angle;
bolt._rotation = -angle;
}
}
Frame 8
startBtn.onRelease = keyPressed_start;
reStartBtn.onRelease = keyPressed_restart;
PauseBtn.onRelease = keyPressed_pause;
FireBtn.onRelease = keyPressed_fire;
openStartPopup();
Symbol 89 MovieClip Frame 1
startPos = 293;
endPos = 463;
d = endPos - startPos;
this.onEnterFrame = function () {
var _local1 = _root;
percent = Math.round((_local1.getBytesLoaded() / _local1.getBytesTotal()) * 100);
percentTxt.text = percent + " %";
this._x = ((percent / 100) * d) + startPos;
if (percent == 100) {
_local1.gotoAndStop(4);
delete this.onEnterFrame;
}
};
Symbol 287 MovieClip Frame 1
if (this.sessionstarted != 1) {
this.arcade = new LoadVars();
this.sessionvars = new LoadVars();
this.arcade.gamename = "pinballsm";
this.arcade.sessdo = "sessionstart";
this.arcade.sendAndLoad("arcade.php", sessionvars, "POST");
if (this.sessionvars.sessiontype == 2) {
_root.is_a_challenge = 1;
} else {
_root.is_a_challenge = 0;
}
this.sessionstarted = 1;
}
if (_root.gameover == 1) {
if ((this.askpermission != 1) && (this.sessionvars.connStatus == 1)) {
this.prequestvars = new LoadVars();
this.pranswer = new LoadVars();
this.prequestvars.gametime = this.sessionvars.gametime;
this.prequestvars.fakekey = this.sessionvars.initbar;
_root.score = int(Number(_root.score));
if (_root.score == 0) {
this.prequestvars.score = -1;
} else {
this.prequestvars.score = _root.score;
}
this.prequestvars.id = this.sessionvars.lastid;
this.prequestvars.sessdo = "permrequest";
this.prequestvars.note = (this.prequestvars.id * this.prequestvars.score) * this.prequestvars.fakekey;
this.prequestvars.sendAndLoad("./arcade.php", this.pranswer, "POST");
this.askpermission = 1;
}
if ((this.pranswer.validate == 1) && (this.finalsent != 1)) {
this.burnscore = new LoadVars();
this.burnscore.microone = this.pranswer.microone;
this.burnscore.gametime = this.prequestvars.gametime;
this.burnscore.id = this.prequestvars.id;
if (_root.score == 0) {
this.burnscore.noscore = 1;
}
this.burnscore.sessdo = "burn";
this.burnscore.send("./arcade.php", "_self", "POST");
this.finalsent = 1;
}
}
Symbol 18 Button
on (release) {
play();
}
Symbol 19 MovieClip [popup_startGame] Frame 1
_x = 485;
_y = 306;
Symbol 19 MovieClip [popup_startGame] Frame 15
stop();
Symbol 19 MovieClip [popup_startGame] Frame 31
_root.keyPressed_restart();
this.removeMovieClip();
Symbol 26 Button
on (release) {
_root.score = _root.mainScore.mainPts;
_root.gameover = 1;
}
Symbol 34 MovieClip [popup_gameOver] Frame 1
_x = 485;
_y = 306;
Symbol 34 MovieClip [popup_gameOver] Frame 15
stop();
Symbol 34 MovieClip [popup_gameOver] Frame 30
_root.openStartPopup();
this.removeMovieClip();
Symbol 41 Button
on (release) {
closeWindow();
}
Symbol 48 MovieClip Frame 1
function reset(quantityInPage) {
if (quantityInPage > VISIBLE_CELL) {
this._visible = true;
}
dTop = (drag._y = 0);
dBot = dTop + DELTA_SLIDER;
dDelta = dBot - dTop;
lStep = _parent.yStep;
lVisible = VISIBLE_CELL * lStep;
lBot = (_parent.lHolder._y = 0);
lDelta = quantityInPage * lStep;
lTop = lBot - lDelta;
}
function findDragPos() {
dragPercent = (drag._y - dTop) / dDelta;
}
function updateListPos() {
_parent.lHolder._y = (-(lDelta - lVisible)) * dragPercent;
}
VISIBLE_CELL = 25;
DELTA_SLIDER = 341;
drag.onPress = function () {
drag.startDrag(false, 0, dTop, 0, dBot);
drag.onEnterFrame = function () {
findDragPos();
updateListPos();
};
};
drag.onRelease = function () {
drag.stopDrag();
delete drag.onEnterFrame;
};
Symbol 54 Button
on (release) {
if (currPageButtonOffset > 0) {
currPageButtonOffset--;
displayPageButton();
}
}
Symbol 57 Button
on (release) {
if (currPageButtonOffset < pageButtonOffsetMax) {
currPageButtonOffset++;
displayPageButton();
}
}
Symbol 58 MovieClip [highScoreTable] Frame 1
function EntryTable(rank, name, score) {
var _local1 = this;
_local1.rank = rank;
_local1.name = name;
_local1.score = score;
}
function closeWindow() {
var _local1 = _root;
if (!_local1.FREEGAME_GAMEFINISHED) {
gotoAndPlay ("exit");
deleteList();
_local1.buttonEnabled = true;
_local1.popupMsg.removeMovieClip();
delete this.onEnterFrame;
if (_local1.openStartScreenFlag) {
_local1.openStartPopup();
_local1.openStartScreenFlag = false;
}
}
}
function initTable() {
quantity = 50;
pageQuantity = 11;
currPageButtonOffset = 0;
currPage = 1;
highScores = [];
}
function loadPage(newPage) {
var _local1 = this;
scroller._visible = false;
currPage = newPage;
success = false;
fileToLoad = "functions.asp?action=getscores";
fileToLoad = fileToLoad + ("&page=" + currPage);
fileToLoad = fileToLoad + ("&quantity=" + quantity);
fileToLoad = fileToLoad + "&sort=desc";
loadVariables (fileToLoad, _local1);
trace(URL);
_root.popupMessage(false, "LOADING TABLE...", -1, 458, 200);
_local1.onEnterFrame = function () {
if (success) {
trace("high scores loaded");
parseHighScores();
buildList(currPage);
buildPageButton();
_root.popupMsg.removeMovieClip();
delete this.onEnterFrame;
} else {
trace("submitting");
}
};
}
function displayPageButton() {
totalEntries = Number(total);
totalPages = Math.ceil(totalEntries / quantity);
pageButtonOffsetMax = totalPages - pageQuantity;
iStart = 1 + currPageButtonOffset;
iStop = (iStart + pageQuantity) - 1;
if (iStop > totalPages) {
iStop = totalPages;
}
sp = "<FONT SIZE='9' COLOR='#000000'>-</FONT>";
str = "<FONT COLOR='#31953A'>Page</FONT>";
i = iStart;
while (i <= iStop) {
if (i < 10) {
i = "0" + i;
}
if (i == currPage) {
link = ((("<FONT COLOR='#31953A'>" + sp) + i) + sp) + "</FONT>";
} else {
link = ((((("<A HREF='asfunction:loadPage," + i) + "'>") + sp) + i) + sp) + "</A>";
}
str = str + link;
i++;
}
dispPageButton.htmlText = str;
trace(str);
displayButtons();
}
function parseHighScores() {
displayPageButton();
highScores[currPage] = [];
i = 1;
while (i <= quantity) {
rank = ((currPage - 1) * quantity) + i;
highScores[currPage][i] = new EntryTable(rank, eval ("name" + i), eval ("score" + i));
i++;
}
}
function displayButtons() {
prevPageButton._visible = true;
nextPageButton._visible = true;
if (currPageButtonOffset == 0) {
prevPageButton._visible = false;
}
if (currPageButtonOffset >= pageButtonOffsetMax) {
nextPageButton._visible = false;
}
}
function deleteList() {
i = 0;
while (i < quantity) {
str = "cell" + i;
lHolder[str].removeMovieClip();
i++;
}
}
function buildList() {
xStart = -147;
yStart = 13;
yStep = 16;
deleteList();
quantityInPage = ((currPage == totalPages) ? (total % quantity) : (quantity));
if (quantityInPage == 0) {
quantityInPage = quantity;
}
i = 0;
while (i < quantityInPage) {
lHolder.attachMovie("highScoreCell", (str = "cell" + i), i);
lHolder[str]._x = xStart;
lHolder[str]._y = (i * yStep) + yStart;
lHolder[str].dispRank.text = highScores[currPage][i + 1].rank + ".";
lHolder[str].dispName.text = highScores[currPage][i + 1].name;
lHolder[str].dispScore.text = highScores[currPage][i + 1].score;
i++;
}
scroller.reset(quantityInPage);
}
_x = 485;
_y = 74;
initTable();
Symbol 58 MovieClip [highScoreTable] Frame 25
stop();
loader._visible = false;
prevPageButton._visible = false;
nextPageButton._visible = false;
loadPage(currPage);
Symbol 58 MovieClip [highScoreTable] Frame 54
if (!_root.alreadyPaused) {
_root.setUnpause();
}
this.removeMovieClip();
Symbol 65 Button
on (release) {
submitScore();
}
Symbol 73 MovieClip Frame 1
stop();
status = false;
Symbol 73 MovieClip Frame 2
status = true;
Symbol 79 Button
on (release) {
gotoAndStop (25);
}
Symbol 80 MovieClip [submitForm] Frame 1
function submitScore() {
var f = firstName_txt.text;
var _local3 = lastName_txt.text;
var _local2 = email_txt.text;
var _local1 = false;
if (f == "") {
_local1 = true;
trace("f");
}
if (_local3 == "") {
_local1 = true;
trace("l");
}
if (_local2 == "") {
_local1 = true;
trace("e1");
}
if (!_root.checkEmail(_local2)) {
_local1 = true;
trace("e2");
}
if (!_local1) {
delete myVar;
myVar = new LoadVars();
myVar.email = _local2;
myVar.firstname = f;
myVar.lastname = _local3;
myVar.checkbox1 = checkbox1_mc.status;
myVar.checkbox2 = checkbox2_mc.status;
myVar.score = _root.mainScore.mainPts;
var strToSend = myVar.toString();
myVar.onLoad = function (success) {
if (success) {
gotoAndStop(myVar.result);
}
};
trace("SENDING");
myVar.load("submitscore.asp?" + strToSend);
} else {
trace("ERROR");
}
}
function closeWindow() {
gotoAndPlay ("exit");
_root.buttonEnabled = true;
_root.popupMsg.removeMovieClip();
delete this.onEnterFrame;
}
function initCheckbox() {
checkbox1_mc.gotoAndStop("on");
checkbox2_mc.gotoAndStop("off");
checkbox1_mc.onRelease = function () {
onReleaseCheckbox(checkbox1_mc);
};
checkbox2_mc.onRelease = function () {
onReleaseCheckbox(checkbox2_mc);
};
}
function onReleaseCheckbox(mc) {
var _local1 = mc;
switch (_local1.status) {
case true :
_local1.status = false;
_local1.gotoAndStop("off");
return;
case false :
_local1.status = true;
_local1.gotoAndStop("on");
}
}
_x = 485;
_y = 74;
Symbol 80 MovieClip [submitForm] Frame 25
stop();
_root.buttonEnabled = false;
initCheckbox();
Symbol 80 MovieClip [submitForm] Frame 53
this.removeMovieClip();
Symbol 85 MovieClip Frame 1
this._visible = debug.showHitZone;
Symbol 86 MovieClip [ball] Frame 1
if (_name.substr(0, 4) == "ball") {
dispN.text = _name.substr(4);
} else {
dispN.text = "R";
}
Symbol 117 MovieClip Frame 1
stop();
Symbol 119 MovieClip [dot] Frame 1
this._visible = debug.showWalls;
Symbol 121 MovieClip Frame 1
this._visible = debug.showBumpers;
Symbol 128 MovieClip Frame 1
stop();
Symbol 131 MovieClip Frame 1
stop();
Symbol 133 MovieClip Frame 1
this._visible = debug.showHitZone;
Symbol 137 MovieClip Frame 1
stop();
Symbol 142 MovieClip Frame 1
stop();
Symbol 148 MovieClip Frame 1
stop();
Symbol 152 MovieClip Frame 1
stop();
Symbol 160 MovieClip Frame 1
stop();
Symbol 167 MovieClip Frame 1
stop();
Symbol 172 MovieClip Frame 1
stop();
Symbol 177 MovieClip Frame 1
stop();
Instance of Symbol 179 MovieClip "hitZoneSup" in Symbol 184 MovieClip Frame 1
onClipEvent (load) {
_visible = debug.showHitZone;
}
Instance of Symbol 181 MovieClip "endHitZone" in Symbol 184 MovieClip Frame 1
onClipEvent (load) {
_visible = debug.showHitZone;
}
Instance of Symbol 179 MovieClip "hitZoneInf" in Symbol 184 MovieClip Frame 1
onClipEvent (load) {
_visible = debug.showHitZone;
}
Instance of Symbol 179 MovieClip "hitZoneSup" in Symbol 186 MovieClip Frame 1
onClipEvent (load) {
_visible = debug.showHitZone;
}
Instance of Symbol 181 MovieClip "endHitZone" in Symbol 186 MovieClip Frame 1
onClipEvent (load) {
_visible = debug.showHitZone;
}
Instance of Symbol 179 MovieClip "hitZoneInf" in Symbol 186 MovieClip Frame 1
onClipEvent (load) {
_visible = debug.showHitZone;
}
Symbol 190 MovieClip Frame 1
function open() {
delete this.onEnterFrame;
gotoAndPlay ("play");
}
function close() {
gotoAndStop ("open");
this.onEnterFrame = function () {
gotoAndPlay(_currentframe - 2);
};
}
gotoAndStop ("stop");
Symbol 190 MovieClip Frame 6
stop();
delete this.onEnterFrame;
Symbol 190 MovieClip Frame 35
stop();
callBack();
Symbol 200 MovieClip Frame 1
stop();
Symbol 200 MovieClip Frame 15
stop();
_parent.ballInPosition();
Symbol 201 MovieClip Frame 1
stop();
Symbol 201 MovieClip Frame 17
stop();
Symbol 202 MovieClip Frame 1
stop();
Symbol 202 MovieClip Frame 15
stop();
Symbol 203 MovieClip Frame 1
function init() {
var _local2 = this;
duration = 30;
rotInc = 60 / duration;
posInc = 21 / duration;
scaleInc = -99 / duration;
autoFire = false;
var _local1 = 1;
while (_local1 <= 5) {
_local2["ball" + _local1]._visible = true;
_local1++;
}
reset();
resetBalls(_root.TOTAL_BALLS + 1);
}
function reset() {
lever._rotation = -30;
pusher._y = 0;
spring._yscale = 100;
cocked = false;
delete this.onEnterFrame;
}
function cock() {
this.onEnterFrame = function () {
lever._rotation = lever._rotation + rotInc;
pusher._y = pusher._y + posInc;
spring._yscale = spring._yscale + scaleInc;
if (pusher._y > 21) {
lever._rotation = 30;
pusher._y = 21;
spring._yscale = -1;
moveBalls();
delete this.onEnterFrame;
}
};
}
function fire() {
var _local1 = _root;
if (cocked) {
resetBalls(_local1.ballLeft);
cocked = false;
callBack();
_local1.playSound(_local1.rampBallKicked_snd);
_local1.playSound(_local1.mainRamp_snd);
this.onEnterFrame = function () {
pusher._y = pusher._y + ((-pusher._y) / 2);
lever._rotation = lever._rotation + ((-30 - lever._rotation) / 2);
spring._yscale = spring._yscale + ((100 - spring._yscale) / 2);
if (pusher._y == 0) {
reset();
}
};
}
}
function moveBalls() {
var _local2 = this;
var _local1 = 1;
while (_local1 <= 5) {
_local2["ball" + _local1].play();
_local1++;
}
}
function resetBalls(num) {
var _local2 = this;
var _local3 = num;
var _local1 = 1;
while (_local1 <= 5) {
_local2["ball" + _local1].gotoAndStop(1);
if (_local1 >= _local3) {
_local2["ball" + _local1]._visible = false;
} else {
_local2["ball" + _local1]._visible = true;
}
_local1++;
}
}
function ballInPosition() {
_root.playSound(_root.rampThud_snd);
cocked = true;
if (autoFire) {
fire();
autoFire = false;
}
}
Symbol 229 MovieClip Frame 1
function init() {
var _local1 = this;
i = 1;
while (i <= 12) {
_local1["digit" + i] = "0";
i++;
}
}
function display(num) {
var _local1 = this;
str = "000000000000" + num.toString();
i = 1;
while (i <= str.length) {
char = str.substr(str.length - i, 1);
_local1["digit" + i] = char;
i++;
}
}
init();
Symbol 230 MovieClip Frame 1
this.onEnterFrame = function () {
if (Key.isDown(32)) {
_root.keyPressed_fire();
}
if (Key.isDown(80) && (!flag)) {
_root.keyPressed_pause();
flag = true;
}
if (!Key.isDown(80)) {
flag = false;
}
};
Symbol 238 Button
on (release) {
nextFrame();
}
Symbol 242 Button
on (release) {
gotoAndStop (1);
}
Symbol 243 MovieClip Frame 1
stop();
_quality = "HIGH";
Symbol 243 MovieClip Frame 2
_quality = "MEDIUM";
Symbol 243 MovieClip Frame 3
_quality = "LOW";
Symbol 248 Button
on (release) {
prevFrame();
}
Symbol 249 MovieClip Frame 1
stop();
_root.soundOn = true;
_root.stopSound(_root.music_snd);
_root.playSoundLoop(_root.music_snd);
Symbol 249 MovieClip Frame 2
_root.soundOn = false;
_root.stopSound(_root.music_snd);
Symbol 252 Button
on (release) {
getURL ("mailto:?subject=Pinball with a nice twist!&body=Hi, I just found Fido's 7UP pinball game. It is fantastic, by just playing you are in with the chance of winning a pinball table for yourself.%0D%0DCheck it out here: http://www.thinkclear.co.uk");
}
Symbol 255 Button
on (release) {
openHighScoreWindow();
}
Symbol 258 Button
on (release) {
getURL ("http://www.graphico.co.uk/", "_blank");
}
Symbol 281 Button
on (release) {
if (!debug.ballStaysUp) {
debug.ballStaysUp = true;
dispBallStaysUp = true;
} else {
debug.ballStaysUp = false;
dispBallStaysUp = false;
}
}
Symbol 284 Button
on (release) {
myQuotes.incQuote();
}