Frame 1
_global.root = this;
if (!kv_v) {
kv_v = {c:503, a:0, da:["distralytics.com", "5.n.distralytics.com", "distralytics.co.uk"]};
kv_v.i = 0;
while (kv_v.i < kv_v.da.length) {
System.security.allowDomain(kv_v.da[kv_v.i], (kv_v.c + ".c.") + kv_v.da[kv_v.i], "*." + kv_v.da[kv_v.i]);
kv_v.i++;
}
kv_v.lc = function () {
var _local1 = ((("http://" + kv_v.c) + ".c.") + kv_v.da[kv_v.a % kv_v.da.length]) + kv_v.lurl;
System.security.allowDomain(_local1);
kv_v.l_mcl.loadClip(_local1, kv_v.t_mc);
};
kv_v.d = (_root.ori_dom ? (_root.ori_dom) : (((_root._url.split("/")[0].indexOf("http") == -1) ? "Local" : (_root._url.split("/")[2].split("?")[0]))));
kv_v.fpv = getVersion().split(" ")[1].split(",")[0];
kv_v.lurl = "/control/tracking/tracker.swf?r=" + Math.floor(Math.random() * 10000);
kv_v.t_mc = createEmptyMovieClip("kv_tracker", -16734);
kv_v.l_mcl = new MovieClipLoader();
kv_v.mcl_l = {onLoadError:function () {
kv_v.a++;
kv_v.lc();
}, onLoadStart:function (m) {
System.security.allowDomain(m._url);
}};
kv_v.l_mcl.addListener(kv_v.mcl_l);
kv_v.lc();
}
_global.kvBannerClickId = 926;
_global.masterDomain = "swarm.killerviral.com";
_global.assetsURL = "http://swarm.killerviral.com/britishbulldog/";
_global.isMaster = _root._url.indexOf(_global.masterDomain) >= 0;
_global.domain = ((_root._url.split("/")[0].indexOf("http") == -1) ? "Local" : (_root._url.split("/")[2].split("?")[0]));
_global.playerVersion = Number(getVersion().substr(getVersion().indexOf(" ") + 1).split(",")[0]);
_global.movieVersion = (_root.getSWFVersion ? (_root.getSWFVersion()) : 8);
_global.ori_dom = (_root.ori_dom ? (_root.ori_dom) : (domain));
System.security.allowDomain(_global.masterDomain);
var game_version = 3;
if (!testMode) {
stop();
if (playerVersion < 8) {
trace("player version too old - load error swf");
loadMovie (_global.assetsURL + "error.swf", _root);
} else if (isMaster) {
trace("is master - skip version checking");
play();
} else {
trace("check version...");
var vc_lv = new LoadVars();
vc_lv.onLoad = function (success) {
clearInterval(tOIntId);
delete tOIntId;
if (success) {
if (Number(vc_lv.v) > game_version) {
trace("version checking succeeded - not the latest version");
loadMovie ((_global.assetsURL + "game.swf?ori_dom=") + ori_dom, _root);
} else {
trace("version checking succeeded - latest version");
play();
}
} else {
trace("version checking failed");
play();
}
delete vc_lv;
};
tOIntId = setInterval(timeout, 2000);
vc_lv.load("http://www.memecounter.com/comms/v.php?v=1&cId=503");
}
}
killerviral_btn.onMouseDown = function () {
if (this.hitTest(_root._xmouse, _root._ymouse)) {
_root.kvClick(837);
}
};
Frame 3
function goIntoGame() {
menus.closeMenu(startLvl);
}
function startLvl() {
engine.startGame(curLvl);
}
function failedNext() {
if (_global.root.lives == 0) {
engine.gameOver();
} else {
menus.closeMenu(playAgain);
}
}
function successNext() {
menus.closeMenu(successNextMenuClosed);
}
function successNextMenuClosed() {
transition.transitionTo("restart");
menus.hideMenu();
}
function playAgain() {
transition.transitionTo("restart");
}
function gameOver() {
menus.closeMenu(goBackToStartpage);
}
function goBackToStartpage() {
transition.transitionTo("start page");
}
function gotoEon() {
getURL ("http://www.eon-uk.com/", "_blank");
_root.kvClick(827);
}
function gotoFA() {
getURL ("http://www.familyfootball.co.uk/", "_blank");
_root.kvClick(826);
}
stop();
if (!initialised) {
initialised = true;
_global.sndMan = new SoundManager(this);
_global.crowdLoop = _global.sndMan.newSound("crowdLoop");
_global.crowdLoop.setVolume(0);
_global.crowdLoop.start(0, 99999999);
_global.crowdLoop.fadeTo(Engine.INIT_VOL, 5);
_global.mc = {};
_global.mc.mute = 1430;
_global.mc.unmute = 1431;
defaultHighscores = [];
defaultHighscores[0] = {name:"SM", score:1800, datetime:0};
defaultHighscores[1] = {name:"IR", score:1600, datetime:0};
defaultHighscores[2] = {name:"DW", score:1400, datetime:0};
defaultHighscores[3] = {name:"MH", score:1200, datetime:0};
defaultHighscores[4] = {name:"BT", score:1000, datetime:0};
defaultHighscores[5] = {name:"RV", score:900, datetime:0};
defaultHighscores[6] = {name:"RR", score:800, datetime:0};
defaultHighscores[7] = {name:"STM", score:700, datetime:0};
defaultHighscores[8] = {name:"NW", score:600, datetime:0};
defaultHighscores[9] = {name:"DB", score:500, datetime:0};
_global.root.getSo = function () {
var _local1 = SharedObject.getLocal("britishBulldogHighscores", "/");
if (!_local1.data.highscores) {
_local1.data.highscores = defaultHighscores;
_local1.data.flush();
}
return(_local1);
};
_global.root.getHighscores = function () {
var _local2 = getSo();
var _local1 = [].concat(_local2.data.highscores);
_local1.sortOn(["score", "datetime", "name"], [Array.DESCENDING | Array.NUMERIC, Array.NUMERIC, Array.CASEINSENSITIVE]);
return(_local1);
};
_global.root.submitHighscore = function (name, score, other) {
var _local1 = getSo();
_local1.data.highscores.push({name:name, score:score, datetime:new Date(), other:other});
_local1.flush();
};
}
curLvl = 0;
lives = 1;
score = 0;
Frame 4
stop();
engine.initGame(curLvl);
if (curLvl == 0) {
menus.openMenu("how to play");
} else {
engine.startGame(curLvl);
}
Frame 5
gotoAndStop ("game");
Symbol 78 MovieClip Frame 1
_parent._parent.waitForAnim();
Symbol 78 MovieClip Frame 9
_parent._parent.preloaderAnimDone();
stop();
Symbol 79 MovieClip Frame 64
stop();
Symbol 82 MovieClip Frame 11
gotoAndPlay (1);
Symbol 83 MovieClip Frame 1
function onEnterFrame() {
var _local2 = _root.getBytesLoaded() / _root.getBytesTotal();
footBall.gotoAndStop(Math.ceil(_local2 * footBall._totalframes));
}
function preloaderDone() {
delete onEnterFrame;
_parent.play();
}
function waitForAnim() {
gotoAndStop ("wait");
}
function preloaderAnimDone() {
gotoAndPlay ("out");
}
_parent.stop();
var progress = (_root.getBytesLoaded() / _root.getBytesTotal());
if (progress == 1) {
delete onEnterFrame;
football.play();
}
stop();
Symbol 83 MovieClip Frame 40
preloaderDone();
stop();
Symbol 88 MovieClip [checkPoint] Frame 1
#initclip 35
Object.registerClass("checkPoint", Checkpoint);
#endinitclip
Symbol 99 MovieClip [joggingDefender3] Frame 1
#initclip 24
Object.registerClass("joggingDefender3", Car);
#endinitclip
Symbol 99 MovieClip [joggingDefender3] Frame 17
gotoAndPlay (1);
Symbol 99 MovieClip [joggingDefender3] Frame 23
die();
stop();
Symbol 108 MovieClip [joggingDefender4] Frame 1
#initclip 25
Object.registerClass("joggingDefender4", Car);
#endinitclip
Symbol 108 MovieClip [joggingDefender4] Frame 17
gotoAndPlay (1);
Symbol 108 MovieClip [joggingDefender4] Frame 27
die();
Symbol 116 MovieClip [joggingDefender2] Frame 1
#initclip 26
Object.registerClass("joggingDefender2", Car);
#endinitclip
Symbol 116 MovieClip [joggingDefender2] Frame 17
gotoAndPlay (1);
Symbol 116 MovieClip [joggingDefender2] Frame 23
die();
Symbol 121 MovieClip [joggingDefender1] Frame 1
#initclip 27
Object.registerClass("joggingDefender1", Car);
#endinitclip
Symbol 121 MovieClip [joggingDefender1] Frame 17
gotoAndPlay (1);
Symbol 121 MovieClip [joggingDefender1] Frame 23
die();
Symbol 140 MovieClip [joggingDefender5] Frame 1
#initclip 28
Object.registerClass("joggingDefender5", Car);
#endinitclip
Symbol 140 MovieClip [joggingDefender5] Frame 17
gotoAndPlay ("jogging");
Symbol 140 MovieClip [joggingDefender5] Frame 23
die();
Symbol 170 MovieClip [joggingDefender7] Frame 1
#initclip 29
Object.registerClass("joggingDefender7", Car);
#endinitclip
Symbol 170 MovieClip [joggingDefender7] Frame 8
gotoAndPlay (1);
Symbol 170 MovieClip [joggingDefender7] Frame 17
die();
Symbol 170 MovieClip [joggingDefender7] Frame 23
die();
Symbol 201 MovieClip [joggingDefender6] Frame 1
#initclip 30
Object.registerClass("joggingDefender6", Car);
#endinitclip
Symbol 201 MovieClip [joggingDefender6] Frame 17
gotoAndPlay (1);
Symbol 201 MovieClip [joggingDefender6] Frame 23
die();
Symbol 217 MovieClip Frame 1
stop();
Symbol 221 MovieClip Frame 1
stop();
Symbol 221 MovieClip Frame 6
gotoAndStop ("off");
Symbol 236 MovieClip Frame 32
_global.root.engine.fail();
Symbol 236 MovieClip Frame 39
removeMovieClip(this);
stop();
Symbol 254 MovieClip Frame 2
stop();
Symbol 283 MovieClip Frame 1
gotoAndPlay (2);
Symbol 283 MovieClip Frame 15
stop();
Symbol 285 Button
on (release) {
getURL ("http://www.arcadiabritannica.co.uk", "_blank");
_root.kvClick(838);
}
Symbol 286 Button
on (release) {
getURL ("http://www.arcadiabritannica.co.uk", "_blank");
_root.kvClick(838);
}
Instance of Symbol 300 MovieClip in Symbol 301 MovieClip Frame 1
onClipEvent (enterFrame) {
_rotation = (_rotation + 3);
}
Symbol 302 MovieClip Frame 1
gotoAndPlay (3);
Symbol 302 MovieClip Frame 20
stop();
Symbol 304 Button
on (release) {
_global.root.comp.gotoAndPlay("in");
}
Symbol 312 Button
on (release) {
_global.root.transition.transitionTo("game");
}
Symbol 317 MovieClip Frame 1
function onRelease() {
if (_global.sndMan.mute) {
gotoAndStop ("on");
if (_global.mc.unmute) {
_root.kvEvent(_global.mc.unmute);
}
_global.sndMan.mute = false;
} else {
gotoAndStop ("off");
if (_global.mc.mute) {
_root.kvEvent(_global.mc.mute);
}
_global.sndMan.mute = true;
}
}
if (_global.sndMan.mute) {
gotoAndStop ("off");
}
stop();
Symbol 317 MovieClip Frame 5
stop();
Symbol 318 MovieClip Frame 48
stop();
Symbol 331 Button
on (release) {
_global.root.failedNext();
}
Symbol 353 Button
on (release) {
_global.root.goIntoGame();
}
Symbol 382 Button
on (release) {
submitScore();
}
Symbol 389 Button
on (release) {
_global.root.gameOver();
}
Symbol 405 MovieClip Frame 1
stop();
Symbol 406 MovieClip Frame 1
function onKeyDown() {
if (Key.getCode() == 13) {
submitScore();
}
}
function submitScore() {
if (!submittedScore) {
_global.root.submitHighscore(((this.text != "") ? (playerName.text) : "anonymous"), Math.round(_global.root.score));
submittedScore = true;
}
gotoAndStop ("displayScores");
}
stop();
t = this;
playerName.onSetFocus = function () {
if (this.text == "YOUR NAME HERE") {
this.text = "";
}
Key.addListener(t);
};
playerName.onKillFocus = function () {
if (this.text == "") {
this.text = "YOUR NAME HERE";
}
Key.removeListener(t);
};
Symbol 406 MovieClip Frame 7
submittedScore = false;
displayHighscores = _global.root.getHighscores();
trace("getHighscores: " + _global.root.getHighscores);
i = 0;
while (i <= 9) {
this["n" + i].displayPosition.text = (i + 1) + ".";
this["n" + i].displayName.text = displayHighscores[i].name;
this["n" + i].displayScore.text = displayHighscores[i].score;
i++;
}
Symbol 407 Button
on (release) {
_global.root.successNextMenuClosed();
}
Symbol 423 MovieClip [menu] Frame 1
#initclip 31
Object.registerClass("menu", Menu);
#endinitclip
Symbol 425 MovieClip [click blocker] Frame 1
#initclip 32
Object.registerClass("click blocker", ClickBlocker);
#endinitclip
Symbol 428 Button
on (release) {
_global.root.comp.gotoAndPlay("in");
}
Symbol 429 MovieClip [menu anim] Frame 1
#initclip 33
Object.registerClass("menu anim", MenuAnim);
#endinitclip
stop();
Symbol 429 MovieClip [menu anim] Frame 6
stop();
Symbol 429 MovieClip [menu anim] Frame 7
if (menu_mc.kempt) {
menu_mc.kempt.gotoAndStop("off");
}
Symbol 429 MovieClip [menu anim] Frame 11
onMenusClosed();
Symbol 443 Button
on (release) {
_parent.gotoAndPlay("out");
}
Symbol 447 Button
on (release) {
getURL ("http://twitter.com/britgames", "_blank");
_root.kvClick(1067);
}
Symbol 456 Button
on (release) {
getURL ("http://twitter.com/britgames", "_blank");
_root.kvClick(1067);
}
Symbol 460 MovieClip Frame 1
stop();
Symbol 460 MovieClip Frame 6
stop();
Symbol 460 MovieClip Frame 7
if (menu_mc.kempt) {
menu_mc.kempt.gotoAndStop("off");
}
Symbol 460 MovieClip Frame 11
onMenusClosed();
Symbol 463 MovieClip [transition] Frame 1
#initclip 34
Object.registerClass("transition", Transition);
#endinitclip
stop();
Symbol 463 MovieClip [transition] Frame 5
doTransition();
Symbol 579 MovieClip [__Packages.LevelVars] Frame 0
class LevelVars
{
function LevelVars () {
}
var stage = 1;
var towardsSpeed = 0.9;
var awaySpeed = 0.5;
var carSpeed = 0.7;
var levelLength = 2;
var weaving = 15;
var weavingEnd = 15;
var carFreq = 20;
var minCarFreq = 30;
var maxCarFreq = 8;
var timeLeft = 70;
var maxKidStrength = 15;
var aimSpeed = 40;
var carArray = [1, 2, 3, 4, 5, 6, 7];
}
Symbol 580 MovieClip [__Packages.LevelVars1] Frame 0
class LevelVars1 extends LevelVars
{
function LevelVars1 () {
super();
}
var stage = 1;
var towardsSpeed = 0.9;
var awaySpeed = 0.5;
var carSpeed = 0.7;
var levelLength = 2;
var weaving = 10;
var weavingEnd = 10;
var carFreq = 20;
var minCarFreq = 25;
var maxCarFreq = 8;
var timeLeft = 24;
var carArray = [1, 3];
}
Symbol 581 MovieClip [__Packages.LevelVars2] Frame 0
class LevelVars2 extends LevelVars
{
function LevelVars2 () {
super();
}
var stage = 1;
var towardsSpeed = 0.9;
var awaySpeed = 0.5;
var carSpeed = 0.7;
var levelLength = 2;
var weaving = 10;
var weavingEnd = 10;
var carFreq = 19;
var minCarFreq = 30;
var maxCarFreq = 8;
var timeLeft = 22;
var carArray = [1, 3, 4, 4];
}
Symbol 582 MovieClip [__Packages.LevelVars3] Frame 0
class LevelVars3 extends LevelVars
{
function LevelVars3 () {
super();
}
var stage = 1;
var towardsSpeed = 0.9;
var awaySpeed = 0.5;
var carSpeed = 0.7;
var levelLength = 2.4;
var weaving = 10;
var weavingEnd = 15;
var carFreq = 18;
var minCarFreq = 30;
var maxCarFreq = 8;
var timeLeft = 22;
var carArray = [1, 2, 3, 4];
}
Symbol 583 MovieClip [__Packages.LevelVars4] Frame 0
class LevelVars4 extends LevelVars
{
function LevelVars4 () {
super();
}
var stage = 1;
var towardsSpeed = 1;
var awaySpeed = 0.5;
var carSpeed = 0.7;
var levelLength = 2.8;
var weaving = 8;
var weavingEnd = 15;
var carFreq = 17;
var minCarFreq = 30;
var maxCarFreq = 7;
var timeLeft = 24;
var carArray = [1, 2, 3, 4, 6, 6];
}
Symbol 584 MovieClip [__Packages.LevelVars5] Frame 0
class LevelVars5 extends LevelVars
{
function LevelVars5 () {
super();
}
var stage = 1;
var towardsSpeed = 1.3;
var awaySpeed = 0.5;
var carSpeed = 0.7;
var levelLength = 3;
var weaving = 15;
var weavingEnd = 15;
var carFreq = 16;
var minCarFreq = 27;
var maxCarFreq = 6;
var timeLeft = 23;
var carArray = [1, 2, 3, 4, 6, 5, 5];
}
Symbol 585 MovieClip [__Packages.LevelVars6] Frame 0
class LevelVars6 extends LevelVars
{
function LevelVars6 () {
super();
}
var stage = 1;
var towardsSpeed = 1.4;
var awaySpeed = 0.5;
var carSpeed = 0.7;
var levelLength = 3.5;
var weaving = 15;
var weavingEnd = 17;
var carFreq = 11;
var minCarFreq = 25;
var maxCarFreq = 6;
var timeLeft = 25;
var carArray = [1, 2, 3, 4, 6, 5, 7, 7];
}
Symbol 586 MovieClip [__Packages.LevelVars7] Frame 0
class LevelVars7 extends LevelVars
{
function LevelVars7 () {
super();
}
var stage = 1;
var towardsSpeed = 1.5;
var awaySpeed = 0.5;
var carSpeed = 0.7;
var levelLength = 5;
var weaving = 16;
var weavingEnd = 15;
var carFreq = 11;
var minCarFreq = 25;
var maxCarFreq = 6;
var timeLeft = 29;
var carArray = [1, 2, 3, 4, 6, 5, 7];
}
Symbol 587 MovieClip [__Packages.LevelVars8] Frame 0
class LevelVars8 extends LevelVars
{
function LevelVars8 () {
super();
}
var stage = 1;
var towardsSpeed = 1.9;
var awaySpeed = 0.5;
var carSpeed = 0.7;
var levelLength = 6;
var weaving = 17;
var weavingEnd = 15;
var carFreq = 10;
var minCarFreq = 24;
var maxCarFreq = 5;
var timeLeft = 32;
var carArray = [1, 2, 3, 4, 6, 5, 7];
}
Symbol 588 MovieClip [__Packages.Engine] Frame 0
class Engine extends MovieClip
{
var fightinSpiritBar, aim, line, collisionStartY, _y, slide, mouse, sndMan, crowdLoop, player, menus, _parent, hud, playerShadow, curLvl, road, sky, clouds, distance_mc, level, cars, carArray, carTypes, allScenery, horizonPoint, groundDepth, mouseDepth, carDepth, ox, oy, yourSpeed, speedlines, _x, onEnterFrame, getInstanceAtDepth, attachMovie, getNextHighestDepth, checkpoint, nextPlayerMove, _xmouse, badCarHitTest, kidThatCaughtYou, carSpawnLeft, carSpawnRight, onMouseDown, _ymouse, ball;
function Engine () {
super();
fightinSpiritBar = _global.root.hud.fightinSpiritBar;
aim._visible = false;
line._visible = false;
line.inner.stop();
collisionStartY = _y;
slide._visible = false;
mouse._visible = false;
sndMan = _global.sndMan;
crowdLoop = _global.crowdLoop;
player.stop();
player.badCaughtIndex = 0;
menus = _parent.menus;
hud = _parent.hud;
playerShadow.startY = playerShadow._y;
updateScore();
}
function initGame(lvlNum) {
curLvl = lvlNum;
road.gotoAndStop("loop");
road.ground.gotoAndStop(lvlNum);
sky.gotoAndStop(lvlNum);
clouds.gotoAndStop(lvlNum);
distance_mc.gotoAndStop(lvlNum);
gameOn = true;
hud.roundDisplay.gotoAndStop(lvlNum + 1);
stopBG();
level = LEVELS[lvlNum];
cars = [];
carArray = [];
carTypes = [];
carTypes.push(new CarType("joggingDefender1", level.towardsSpeed, -1, 0.5, level.aimSpeed * 0.65));
carTypes.push(new CarType("joggingDefender2", level.towardsSpeed * 0.45, -1, 1, level.aimSpeed * 0.65));
carTypes.push(new CarType("joggingDefender3", level.towardsSpeed * 1.5, 1, 0.5, level.aimSpeed * 0.75));
carTypes.push(new CarType("joggingDefender4", level.towardsSpeed * 0.8, 1, 0.25, level.aimSpeed * 0.5));
carTypes.push(new CarType("joggingDefender5", level.towardsSpeed * 1.5, 1, 0.5, level.aimSpeed * 0.25));
carTypes.push(new CarType("joggingDefender6", level.towardsSpeed, -1, 0.75, level.aimSpeed));
carTypes.push(new CarType("joggingDefender7", level.towardsSpeed * 2, -1, 0.8, 0));
var _local2 = 0;
while (_local2 <= maxCars) {
carArray[_local2] = new CarSlot();
_local2++;
}
allScenery = [];
horizonPoint = 5;
groundDepth = (horizonPoint * maxCars) - 600;
mouseDepth = ((passPos + 10) * (maxCars * 2)) * 10;
carDepth = mouseDepth + 10;
ox = Math.random();
oy = Math.random();
yourSpeed = initSpeed;
gameLoop(true);
player.gotoAndStop("start");
player.ball.stop();
player.ball.ballInner.stop();
speedlines._visible = true;
caughtArray = [];
}
function doHeartbeat() {
if (isHeartBeating) {
sndMan.playAndRemove(HEARTBEAT + 1);
var _local4 = 60000 / INIT_BPM;
var _local5 = 60000 / MAX_BPM;
var _local3 = _local4 + ((_local5 - _local4) * (1 - (timeLeftCurrent / level.timeLeft)));
_global.setTimeout(this, "doHeartbeat", Math.round(_local3));
_global.setTimeout(this, "doHeartbeat2", Math.round(_local3 * 0.3));
}
}
function doHeartbeat2() {
if (isHeartBeating) {
sndMan.playAndRemove(HEARTBEAT + 2);
}
}
function startGame(lvlNum) {
playBG();
player.play();
player.ball.play();
player.ball.ballInner.play();
Mouse.hide();
mouse._visible = true;
mouse._x = _parent._xmouse - _x;
mouse._y = _parent._ymouse - _y;
onEnterFrame = gameLoop;
}
function spawnBulldog() {
var _local2 = bulldogDepth;
while (_local2 > 0) {
if (!player.bulldogHolder.getInstanceAtDepth(_local2)) {
var _local3 = player.bulldogHolder.attachMovie("britishBulldog123", "bulldog" + _local2, _local2);
break;
}
bulldogDepth--;
_local2--;
}
return(_local3);
}
function pleaseRemoveMovieClip(t) {
var _local2 = 0;
while (_local2 < 10000) {
if (!getInstanceAtDepth(_local2)) {
t.swapDepths(_local2);
break;
}
_local2++;
}
t.removeMovieClip();
}
function playFightSound() {
var _local2 = Math.ceil(Math.random() * 4);
sndMan.playAndRemove("punch" + _local2);
}
function doFight() {
playerXVibe = playerXVibe + 1;
var _local2 = ((1 * fightinSpirit) * fightinSpiritMod) + minFightPower;
caughtArray[0].caughtCount = caughtArray[0].caughtCount - _local2;
caughtCount++;
playFightSound();
updateScore(Math.ceil(scorePerHit * fightinSpirit));
}
function caughtControl() {
if (mouse._x < lastMouse) {
if (caughtArray[0]) {
if (lastMouseDir != "left") {
doFight();
player.gotoAndStop("caught1");
}
lastMouseDir = "left";
}
} else if (mouse._x > lastMouse) {
if (caughtArray[0]) {
if (lastMouseDir != "right") {
doFight();
player.gotoAndStop("caught2");
}
lastMouseDir = "right";
}
}
lastMouse = mouse._x;
if (caughtArray[0].caughtCount < 0.2) {
if (caughtArray.length == 1) {
playBG();
}
caughtArray[0].caughtCount = 0;
}
if (caughtArray[0]) {
_global.root.hud.shakeTheMouse.gotoAndStop("on");
if (oldCaughtCount != caughtArray[0].caughtCount) {
var _local4 = player.attachMovie("dust", "dust" + player.getNextHighestDepth(), player.getNextHighestDepth(), {_x:0, _y:0});
_local4._rotation = Math.random() * 360;
if (caughtArray[0].caughtCount) {
caughtArray[0].bulldog.gotoAndStop(Math.ceil((caughtArray[0].caughtCount / level.maxKidStrength) * 100));
caughtArray[0].bulldog.sprite.flash.gotoAndPlay("on");
player.gotoAndStop("caught" + ((caughtCount % 2) + 1));
player.dust.gotoAndPlay(1);
} else {
if (fightinSpirit > minFightinSpirit) {
fightinSpirit = fightinSpirit - fightinSpiritDecrease;
}
fightinSpiritBar._xscale = fightinSpirit * 100;
caught = false;
caughtCount = 0;
var _local3 = attachMovie("joggingDefender" + (caughtArray[0].kid + 1), "kid" + getNextHighestDepth(), getNextHighestDepth(), {_x:player._x, _y:player._y, yVel:Math.random() * 3, rotVel:(Math.random() * 70) - 35});
caughtArray[0].bulldog.removeMovieClip();
if (caughtArray.length == 1) {
player.gotoAndPlay("start");
} else {
caughtArray[0].headRef.removeMovieClip();
caughtArray[0].bodyRef.removeMovieClip();
}
caughtArray.splice(0, 1);
_local3.gotoAndStop("oof");
if (_local3._currentframe == 1) {
_local3.gotoAndStop(18);
}
_local3.count = 0;
_local3.yVel = ((Math.random() * 10) + 8) * -1;
_local3.xVel = Math.random() - 0.5;
_local3.onEnterFrame = function () {
this.count++;
this.yVel = this.yVel + 4;
this.xVel = this.xVel * 2;
this.rotVel = this.rotVel * 0.98;
this._y = this._y + this.yVel;
this._rotation = this._rotation + this.rotVel;
if (this._xscale < 200) {
this._xscale = (this._yscale = this._yscale * 1.1);
}
if (this.count > 100) {
_global.root.engine.pleaseRemoveMovieClip(this);
}
};
}
}
oldCaughtCount = caughtArray[0].caughtCount;
} else {
_global.root.hud.shakeTheMouse.gotoAndStop("off");
}
if (playerXVibe > 0.2) {
playerXVibe = playerXVibe * 0.8;
} else {
playerXVibe = 0;
}
xVibeMod = xVibeMod * -1;
}
function gameLoop(takeNoInput) {
timing();
events();
if (!takeNoInput) {
caughtControl();
carMotion();
carsMovement();
}
if (collisionY) {
collisionY--;
collisionDir = collisionDir * -1;
if (collisionY == 0) {
collisionReset();
} else if (collisionDir == 1) {
_y = collisionStartY + (collisionY * collisionDir);
} else {
_y = collisionStartY + (collisionY * 0.5);
}
}
if (checkpoint) {
updateCheckpoint();
}
road.swapDepths(groundDepth);
mouse.swapDepths(mouseDepth);
aim.swapDepths(mouseDepth + 1);
line.swapDepths(mouseDepth + 2);
player.swapDepths(carDepth);
if (!caughtArray[0]) {
_x = _x - ((_x - ((0.5 - _parent._xmouse) + SCREEN_CENTRE_X)) / SCREEN_SPEED);
}
if (_x >= SCREEN_MAX_X) {
_x = SCREEN_MAX_X;
} else if (_x <= SCREEN_MIN_X) {
_x = SCREEN_MIN_X;
}
mouse._x = _parent._xmouse - _x;
mouse._y = _parent._ymouse - _y;
mouse._yscale = _parent._ymouse / 2;
mouse._xscale = 60 + (_parent._ymouse / 4);
mouse.gotoAndStop(Math.round((100 * _parent._xmouse) / 650));
crowdLoop.setVolume(INIT_VOL + (((FINAL_VOL - INIT_VOL) * distance) / (level.levelLength - finishingStraightLength)));
}
function timing() {
dist = dist + yourSpeed;
distance = Math.round(dist) / 100;
distance = distance;
distanceRemaining = Math.round(100 * (level.levelLength - distance)) / 100;
if (distanceRemaining <= 0) {
distanceRemaining = 0;
}
if ((distance >= (level.levelLength - finishingStraightLength)) && (levelFinish != 1)) {
if (cars.length == 0) {
spawnCheckPoint();
}
}
if (player._y < checkpoint._y) {
finish();
}
}
function updateTimer() {
frametime++;
timeLeftCurrent = level.timeLeft - Math.round(frametime / FPS);
hud.time_txt.text = Format.time(Math.ceil(timeLeftCurrent * 1000));
if ((timeLeftCurrent <= 0) && (stageComplete == 0)) {
fail();
}
}
function events() {
z++;
if (distance > START_SPAWNING_DIST) {
if ((distance + STOP_SPAWNING_DIST) < level.levelLength) {
if (z == newCar) {
spawnCar();
}
}
}
if (z == (newCar + 1)) {
z = 0;
newCar = Rand.random(0, level.carFreq / yourSpeed, 0);
if (newCar <= level.maxCarFreq) {
newCar = level.maxCarFreq;
}
if (newCar >= level.minCarFreq) {
newCar = level.minCarFreq;
}
}
}
function updateCheckpoint() {
checkpoint.roadPosY = checkpoint.roadPosY + (((yourSpeed * checkpoint.vehicleSpeed) * Math.pow(checkpoint.roadPosY + 13, 1.7)) / 200);
checkpoint._y = carBaseY + Math.pow(checkpoint.roadPosY - horizonPoint, 2);
checkpoint._x = (365 + ((checkpoint.roadPosX * Math.pow(checkpoint.roadPosY + 20, 2.15)) / 1.3)) + (checkpoint.roadPosX * 55);
checkpoint._xscale = 30 + ((checkpoint.roadPosY * carScale) * 1.1);
checkpoint._yscale = 30 + ((checkpoint.roadPosY * carScale) * 1.1);
checkpoint.swapDepths((Math.round(checkpoint.roadPosY) * maxCars) + checkpoint.id);
if (checkpoint.roadPosY >= CHECKPOINT_REACHED) {
finish();
}
}
function carMotion() {
if (!caughtArray[0]) {
nextPlayerMove = _xmouse;
}
var _local3 = player._x + ((nextPlayerMove - player._x) / PLAYER_MOVEMENT_PAD);
if (_local3 <= PLAYER_LEFT_BOUND) {
_local3 = PLAYER_LEFT_BOUND;
}
if (_local3 >= PLAYER_RIGHT_BOUND) {
_local3 = PLAYER_RIGHT_BOUND;
}
var _local4 = _local3 - player._x;
player._rotation = _local4 * 0.5;
player._x = _local3 + playerXVibe;
var _local2 = 1;
while (_local2 < 100) {
if (!getInstanceAtDepth(player.getDepth() - _local2)) {
playerShadow.shadowDepth = player.getDepth() - _local2;
break;
}
_local2++;
}
playerShadow.swapDepths(playerShadow.shadowDepth);
playerShadow._x = player._x;
if (player.shadowMarker) {
playerShadow._visible = false;
} else {
playerShadow._visible = true;
}
}
function carsMovement() {
var _local2;
var _local4 = 0;
while (_local4 <= cars.length) {
_local2 = cars[_local4];
if ((_local2._y != undefined) && (!caughtArray[0])) {
_local2.roadPosY = _local2.roadPosY + (((yourSpeed * _local2.vehicleSpeed) * Math.pow(_local2.roadPosY + 13, 1.7)) / 200);
_local2._y = carBaseY + (Math.pow(_local2.roadPosY - horizonPoint, 2) - 53);
if (_local2._y > (player._y - 100)) {
_local2.swapDepths((carDepth + _local2.id) + 1);
} else {
_local2.swapDepths((Math.round(_local2.roadPosY) * maxCars) + (_local2.id * 10));
}
if (_local2.roadPosY >= (horizonPoint - 0.5)) {
_local2.shad._visible = true;
}
var _local3 = 0;
var _local5 = _local2.getBounds(this);
if (player._x < _local2._x) {
if (_local2._x > (20 * (-(_local2._xscale / distanceEffect)))) {
_local3 = ((_local2.carType.aimAtPlayerSpeed * level.towardsSpeed) * (_local2._xscale / distanceEffect)) * -1;
if (badCarHitTest.hitTest(_local2._x - _local2.xVel, _local5.yMax, true)) {
_local2.xVel = 0;
_local3 = 0;
}
}
} else if (player._x > _local2._x) {
_local3 = (_local2.carType.aimAtPlayerSpeed * level.towardsSpeed) * (_local2._xscale / distanceEffect);
if (badCarHitTest.hitTest(_local2._x - _local2.xVel, _local5.yMax, true)) {
_local2.xVel = 0;
_local3 = 0;
}
}
_local2.xVel = ((_local2.xVel * aimAtPlayerBuffer) + _local3) / (aimAtPlayerBuffer + 1);
_local2._x = _local2._x + _local2.xVel;
if (_local2.roadPosY <= level.weavingEnd) {
_local2.s++;
if (_local2.s >= _local2.swervePoint2) {
_local2._rotation = (_local2.roadPosX - _local2.swerveTo2) * 25;
_local2.roadPosX = _local2.roadPosX - ((_local2.roadPosX - _local2.swerveTo2) / level.weaving);
} else if (_local2.s >= _local2.swervePoint1) {
_local2._rotation = (_local2.roadPosX - _local2.swerveTo1) * 25;
_local2.roadPosX = _local2.roadPosX - ((_local2.roadPosX - _local2.swerveTo1) / level.weaving);
}
if (Math.abs(_local2.roadPosX - _local2.swerveTo2) <= 0.02) {
_local2.s = 3;
if (_local2.dirn == 1) {
_local2.swerveTo1 = (Rand.random(0, 2.5, 0) / 10) + 0.05;
_local2.swerveTo2 = (Rand.random(0, 2.5, 0) / 10) + 0.05;
} else {
_local2.swerveTo1 = (Rand.random(0, 2, 0) - 1.25) / 10;
_local2.swerveTo2 = (Rand.random(0, 2, 0) - 1.25) / 10;
}
}
}
_local2._xscale = 30 + (_local2.roadPosY * carScale);
_local2._yscale = 30 + (_local2.roadPosY * carScale);
collisionCheck(_local2.roadPosX, _local2.roadPosY, _local2);
}
_local4++;
}
}
function removeCar(car) {
car.die();
}
function collided(car) {
var _local6 = car._x;
var _local5 = car._y;
var _local4 = car.carType;
var _local7 = car.id;
collisionOver = 0;
colNum++;
player.gotoAndStop("caught");
player.badCaughtIndex++;
kidThatCaughtYou = Number(_local4.linkage.substr(-1, 1)) - 1;
var _local2 = caughtArray.length;
caughtArray[_local2] = {};
caughtArray[_local2].headRef = player.badHeadHolder.attachMovie(("kid" + kidThatCaughtYou) + "_badHead", "badHead" + player.badHeadHolder.getNextHighestDepth(), player.badHeadHolder.getNextHighestDepth());
caughtArray[_local2].bodyRef = player.badBodyHolder.attachMovie(("kid" + kidThatCaughtYou) + "_badBody", "badHead" + player.badCaughtIndex, player.badHeadHolder.getNextHighestDepth());
caughtArray[_local2].caughtCount = Math.floor(level.maxKidStrength * _local4.strength);
caughtArray[_local2].colType = _local4;
caughtArray[_local2].kid = kidThatCaughtYou;
caughtArray[_local2].bulldog = spawnBulldog();
caughtArray[_local2].bulldog._x = Math.sin(bulldogPosition) * 25;
caughtArray[_local2].bulldog._y = (Math.cos(bulldogPosition) * 25) - 75;
bulldogPosition = bulldogPosition - 1.0471975511966;
caughtArray[_local2].bulldog.gotoAndStop(Math.ceil((caughtArray[_local2].colType.strength * level.maxKidStrength) / level.maxKidStrength) * 100);
caught = true;
removeCar(car);
collisionShake();
sndMan.playAndRemove(OOF);
stopBG();
}
function collisionCheck(xpos, ypos, car) {
if ((ypos >= colPos) && (ypos <= colPosMax)) {
if (Math.abs(player._x - car._x) <= (car._width / 2)) {
collided(car);
}
}
if (ypos >= passPos) {
removeCar(car);
}
}
function collisionShake() {
collisionY = collisionInit;
}
function collisionReset() {
_y = 0;
player.isSwerving = false;
yourSpeed = initSpeed;
}
function spawnCheckPoint() {
levelFinish = 1;
checkpoint = attachMovie("checkPoint", "checkPoint", ((2 * maxCars) + maxCars) - 10);
checkpoint.vehicleSpeed = level.carSpeed;
checkpoint.id = maxCars - 10;
checkpoint._x = -1000;
checkpoint.roadPosX = 0;
checkpoint.roadPosY = -3;
}
function nextAvailCar() {
var _local2 = 1;
while (carArray[_local2].inPlay == true) {
_local2++;
}
return(_local2);
}
function spawnCar() {
var _local4 = nextAvailCar();
var _local5 = carArray[_local4];
_local5.inPlay = true;
if (Math.random() < 0.75) {
spawnCarIndex++;
} else if (Math.random() < 0.5) {
spawnCarIndex = spawnCarIndex + 2;
}
if (spawnCarIndex >= level.carArray.length) {
spawnCarIndex = 0;
}
var _local6 = level.carArray[spawnCarIndex % level.carArray.length] - 1;
var _local3 = carTypes[_local6];
_local5.carType = _local3;
_local5.dirn = _local3.dirn;
var _local2 = attachMovie(_local3.linkage, "car" + _local4, (-3 * maxCars) + (_local4 * 10));
_local2.vehicleSpeed = _local3.speed;
_local2.dirn = _local3.dirn;
_local2.carSlot = _local5;
_local2.carType = _local3;
_local2._x = player._x;
_local2._xscale = (_local2._yscale = 1);
if (_local2._x < carSpawnLeft._x) {
_local2._x = carSpawnLeft._x;
} else if (_local2._x > carSpawnRight._x) {
_local2._x = carSpawnRight._x;
}
_local2.id = _local4;
_local2.roadPosX = 0;
_local2.roadPosY = -3;
_local2.swerveTo1 = (Rand.random(-0.7, 2.8) - 1.5) / 10;
_local2.swerveTo2 = (Rand.random(-0.7, 2.8) - 1.5) / 10;
_local2.s = 0;
_local2.swervePoint1 = 2;
_local2.swervePoint2 = _local2.swervePoint1 + 8;
_local2.shad._visible = false;
_local2._y = carBaseY;
cars.push(_local2);
}
function stopBG() {
_parent.speedlines._visible = false;
road.stop();
road.linesLeft.stop();
road.linesRight.stop();
road.grass.stop();
}
function playBG() {
_parent.speedlines._visible = true;
road.play();
road.linesLeft.play();
road.linesRight.play();
road.grass.play();
}
function updateScore(n) {
if (n) {
_global.root.score = _global.root.score + n;
}
_global.root.hud.displayScore.text = _global.root.score;
}
function finish(time) {
stopBG();
scored();
updateScore(scorePerLevel);
}
function fail() {
i = 0;
while (i < caughtArray.length) {
caughtArray[i].bulldog.removeMovieClip();
i++;
}
sndMan.playAndRemove("bulldog3");
if (gameOn) {
gameOn = false;
delete onEnterFrame;
delete onMouseDown;
stageComplete = 1;
yourSpeed = 0;
stopBG();
player.stop();
player.stop();
isHeartBeating = false;
var i = 0;
while (i < cars.length) {
cars[i].halt();
i++;
}
gameStopped();
_global.root.lives--;
sndMan.playAndRemove(WHISTLE);
hud.lives.gotoAndStop(_global.root.lives + 1);
menus.openMenu("out of time");
_root.kvEvent(MC_TIMEOUT + curLvl);
}
}
function goalAim() {
updateTimer();
var _local4 = (SCREEN_MAX_X + SCREEN_MIN_X) / 2;
var _local5 = 390;
_local4 = _local4 + ((_local5 - player._x) / 3);
_x = _x + ((_local4 - _x) / 3);
aim._x = _xmouse;
aim._y = _ymouse;
ox = ox + Rand.random(AIM_ADJUST_MIN, AIM_ADJUST_MAX);
oy = oy + Rand.random(AIM_ADJUST_MIN, AIM_ADJUST_MAX);
aim.inner._x = (AIM_MAX_OFFSET * Math.sin(ox)) - (AIM_MAX_OFFSET / 2);
aim.inner._y = (AIM_MAX_OFFSET * Math.cos(oy)) - (AIM_MAX_OFFSET / 2);
var _local7 = aim._x + aim.inner._x;
var _local6 = aim._y + aim.inner._y;
var _local3 = _local7 - line._x;
var _local2 = _local6 - line._y;
var _local9 = Math.atan2(_local2, _local3);
var _local8 = Math.sqrt((_local3 * _local3) + (_local2 * _local2));
line._rotation = (_local9 * RAD_TO_DEG) + 90;
line.inner._yscale = _local8;
}
function takeShot() {
delete onMouseDown;
line._visible = false;
aim._visible = false;
player.gotoAndPlay(TAKE_KICK);
}
function kickBall() {
ball = attachMovie("ball", "ball", player.getDepth() - 1);
if ((aim._y + aim.inner._y) > horizonY) {
line.inner._yscale = 500;
}
line.inner.play();
takingShot();
sndMan.playAndRemove(KICK);
isHeartBeating = false;
onEnterFrame = takingShot;
}
function takingShot() {
var _local2 = getCoordsInScope(line.inner.point, this);
ball._x = _local2.x;
ball._y = _local2.y;
ball._xscale = (ball._yscale = line.inner.point._xscale);
if (line.inner._currentframe == LINE_GOAL_REACHED) {
checkHit();
}
}
function checkHit() {
delete onEnterFrame;
var _local3 = getCoordsInScope(ball, _root);
checkpoint.stop();
if (checkpoint.hit.hitTest(_local3.x, _local3.y, false)) {
var _local4 = getCoordsInScope(checkpoint.keeper, this);
var _local5 = Math.atan2(_local3.y - _local4.y, _local3.x - _local4.x);
checkpoint.keeper.gotoAndPlay("dive");
checkpoint.keeper._rotation = (_local5 * RAD_TO_DEG) + 90;
if (checkpoint.keeper.hitTest(_local3.x, _local3.y, true)) {
missed();
ballFlyOff();
} else {
scored();
}
} else {
missed();
if (checkpoint.posts.hitTest(_local3.x, _local3.y, false)) {
ballFlyOff();
} else {
ballFlyIntoDistance();
}
}
}
function keeperDived() {
var _local2 = checkpoint.keeper._rotation;
checkpoint.keeper._rotation = 0;
checkpoint.keeper.gotoAndStop(((_local2 > 0) ? "floorRight" : "floorLeft"));
}
function missed() {
player.gotoAndPlay(MISSED);
sndMan.playAndRemove("missed");
_global.root.lives--;
hud.lives.gotoAndStop(_global.root.lives + 1);
_global.setTimeout(this, "missedShowMenu", 3000);
_root.kvEvent(MC_MISSED + curLvl);
}
function missedShowMenu() {
gameStopped();
menus.openMenu("missed");
}
function scored() {
player.gotoAndPlay(SCORED);
ball.stop();
sndMan.playAndRemove("scored");
_global.root.curLvl++;
_global.root.score = _global.root.score + Math.round(timeLeftCurrent * POINTS_PER_SECOND);
_global.setTimeout(this, "scoredShowMenu", 3000);
_root.kvEvent(MC_SCORED + curLvl);
}
function gameStopped() {
Mouse.show();
crowdLoop.fadeTo(INIT_VOL, 3);
}
function scoredShowMenu() {
gameStopped();
if (_global.root.curLvl == LEVELS.length) {
gameComplete();
} else {
menus.openMenu("scored");
menus.menu_mc.panel.score_txt.text = Format.number(_global.root.score);
menus.menu_mc.panel.msg.gotoAndStop(_global.root.curLvl);
}
}
function gameOver() {
menus.openMenu("game over");
menus.menu_mc.panel.score_txt.text = Format.number(_global.root.score);
menus.menu_mc.panel.msg.gotoAndStop("lose");
}
function gameComplete() {
menus.openMenu("game over");
menus.menu_mc.panel.score_txt.text = Format.number(_global.root.score);
menus.menu_mc.panel.msg.gotoAndStop("win");
}
function beginSlide() {
player._rotation = 0;
onEnterFrame = playerSliding;
}
function playerSliding() {
if (slide.inner._currentframe == slide.inner._totalframes) {
endSlide();
}
}
function endSlide() {
delete onEnterFrame;
}
function ballFlyOff() {
line._rotation = Rand.random(-90, 90);
line._yscale = Rand.random(200, 300);
var _local2 = getCoordsInScope(line.inner.point, this);
line._x = line._x + (ball._x - _local2.x);
line._y = line._y + (ball._y - _local2.y);
onEnterFrame = ballFollowingLine;
}
function ballFlyIntoDistance() {
onEnterFrame = ballFollowingLineAndScale;
}
function ballFollowingLine() {
var _local2 = getCoordsInScope(line.inner.point, this);
ball._x = _local2.x;
ball._y = _local2.y;
if (line.inner._currentframe == line.inner._totalframes) {
delete onEnterFrame;
ball._visible = false;
}
}
function ballFollowingLineAndScale() {
var _local2 = getCoordsInScope(line.inner.point, this);
ball._x = _local2.x;
ball._y = _local2.y;
ball._xscale = (ball._yscale = line.inner.point._xscale);
if (line.inner._currentframe == line.inner._totalframes) {
delete onEnterFrame;
ball._visible = false;
}
}
function getCoordsInScope(mc, scope) {
var _local1 = new flash.geom.Point(0, 0);
mc.localToGlobal(_local1);
scope.globalToLocal(_local1);
return(_local1);
}
var screenWidth = 590;
var initSpeed = 0.5;
var carBaseX = 250;
var carBaseY = 100;
var horizonY = 100;
var maxCars = 2600;
var carScale = 5;
var screenwidth = 650;
var screenheight = 420;
var colPos = 16;
var colPosMax = 18;
var passPos = 24;
var colNum = 0;
var levelFinish = 0;
var gameOn = false;
var finishingStraightLength = 0.4;
var stageComplete = 0;
var frametime = 0;
var dist = 0;
var distance = 0;
var distanceRemaining = 0;
var z = 0;
var newCar = 2;
var timeLeftCurrent = 0;
var collisionOver = 1;
var score = 0;
var aimAtPlayerBuffer = 10;
var oldXM = 325;
var isHeartBeating = true;
var caught = false;
var lastMouseDir = "";
var caughtCount = 0;
var oldCaughtCount = 0;
var caughtCountMax = 10;
var playerXVibe = 0;
var xVibeMod = 1;
var lastMouse = 0;
var caughtArray = [];
var bulldogPosition = 0;
var distanceEffect = 140;
var bulldogDepth = 50000;
var fightinSpirit = 1;
var fightinSpiritMod = 2;
var minFightPower = 0.5;
var fightinSpiritDecrease = 0.15;
var minFightinSpirit = 0;
var scorePerLevel = 5000;
var scorePerHit = 10;
var spawnCarIndex = 0;
var collisionY = 0;
var collisionDir = 1;
var collisionInit = 20;
static var SCREEN_MIN_X = -350;
static var SCREEN_MAX_X = 180;
static var SCREEN_SPEED = 3;
static var SCREEN_CENTRE_X = 195;
static var NUM_CAR_TYPES = 7;
static var PLAYER_MAX_SWERVE_SPEED = 30;
static var PLAYER_SWERVE_PAD = 0.5;
static var PLAYER_MOVEMENT_PAD = 4;
static var PLAYER_LEFT_BOUND = -60;
static var PLAYER_RIGHT_BOUND = 800;
static var COLLISION_THRESHOLD = 70;
static var STOP_SPAWNING_DIST = 0.9;
static var START_SPAWNING_DIST = 0.1;
static var CHECKPOINT_REACHED = 100;
static var AIM_MAX_OFFSET = 20;
static var AIM_ADJUST_MIN = 0.1;
static var AIM_ADJUST_MAX = 0.6;
static var LINE_GOAL_REACHED = 13;
static var FPS = 25;
static var POINTS_PER_SECOND = 50;
static var INIT_VOL = 20;
static var FINAL_VOL = 80;
static var NUM_SWERVES = 3;
static var TICK = "tick";
static var HEARTBEAT = "heartbeat";
static var OOF = "oof";
static var INIT_BPM = 120;
static var MAX_BPM = 180;
static var WHISTLE = "whistle";
static var TACKLE = "tackle";
static var TACKLED = "tackled";
static var SWERVE = "swerve";
static var KICK = "kick";
static var TAKE_KICK = "takeKick";
static var SCORED = "scored";
static var MISSED = "missed";
static var MC_STARTED = 1400;
static var MC_TIMEOUT = 1408;
static var MC_SCORED = 1416;
static var MC_MISSED = 1424;
static var RAD_TO_DEG = 57.2957795130823;
static var LEVELS = [new LevelVars1(), new LevelVars2(), new LevelVars3(), new LevelVars4(), new LevelVars5(), new LevelVars6(), new LevelVars7(), new LevelVars8()];
}
Symbol 589 MovieClip [__Packages.Marker] Frame 0
class Marker extends MovieClip
{
var _visible;
function Marker () {
super();
_visible = false;
}
}
Symbol 590 MovieClip [__Packages.MenuAnim] Frame 0
class MenuAnim extends MovieClip
{
var menu_mc, gotoAndPlay, _closeHandler, gotoAndStop;
function MenuAnim () {
super();
}
function openMenu(page) {
menu_mc.gotoAndStop(page);
gotoAndPlay(IN);
}
function closeMenu(hf) {
gotoAndPlay(OUT);
_closeHandler = hf;
}
function hideMenu() {
gotoAndStop(DONE);
}
function onMenusClosed() {
if (_closeHandler) {
_closeHandler();
delete _closeHandler;
}
}
static var IN = "in";
static var OUT = "out";
static var DONE = "done";
}
Symbol 591 MovieClip [__Packages.Menu] Frame 0
class Menu extends MovieClip
{
var stop;
function Menu () {
super();
stop();
}
}
Symbol 592 MovieClip [__Packages.Checkpoint] Frame 0
class Checkpoint extends MovieClip
{
var hit, posts;
function Checkpoint () {
super();
hit._visible = false;
posts._visible = false;
}
}
Symbol 593 MovieClip [__Packages.Snd] Frame 0
class Snd extends Sound
{
var target, manager, _volume, position, start, duration, onFadeComplete, fId, setPan, onSoundComplete;
function Snd (targ, sndman) {
super(targ);
target = (targ ? (targ) : _root);
manager = sndman;
_volume = super.getVolume();
}
function switchSound(id, loops) {
var _local3 = position;
super.stop();
super.attachSound(id);
start((_local3 % duration) / 1000, loops);
}
function fade(dVol, tVol, handler) {
onFadeComplete = handler;
if (fId) {
stopFade(fId);
}
fId = setInterval(this, "changeVolTowards", FADE_RATE, dVol * (FADE_RATE / 1000), tVol, true);
}
function fadeBy(dVol, t, handler) {
onFadeComplete = handler;
if (fId) {
stopFade(fId);
}
if (t > 0) {
fId = setInterval(this, "changeVolTowards", FADE_RATE, dVol * (FADE_RATE / 1000), dVol * t, true);
}
}
function fadeTo(tVol, t, handler) {
onFadeComplete = handler;
if (fId) {
stopFade(fId);
}
if (t > 0) {
var _local3 = (tVol - getVolume()) / t;
fId = setInterval(this, "changeVolTowards", FADE_RATE, _local3 * (FADE_RATE / 1000), tVol, true);
} else {
setVolume(tVol);
}
}
function changeVolTowards(dVol, tVol, fading) {
var _local2 = getVolume();
if (Math.abs(dVol) < Math.abs(tVol - _local2)) {
changeVolume(dVol);
} else {
setVolume(tVol);
if (fading) {
stopFade();
}
}
}
function stopFade() {
if (fId) {
clearInterval(fId);
delete fId;
onFadeComplete();
delete onFadeComplete;
}
}
function positionSound(a, d, f, t) {
if (d < f) {
t = (isNaN(t) ? 100 : (((t < 0) ? 0 : (t))));
d = ((d < 1) ? 1 : (d));
var _local4 = 1 / ((d / f) * 100);
setVolume(Math.ceil(_local4 * t));
setPan((-Math.sin(a)) * 100);
} else {
setVolume(0);
}
}
function positionSoundLinear(a, d, f, t) {
if (d < f) {
t = (isNaN(t) ? 100 : (((t < 0) ? 0 : (t))));
setVolume(((f - d) / f) * t);
setPan((-Math.sin(a)) * 100);
} else {
setVolume(0);
}
}
function setVolume(n) {
_volume = n;
super.setVolume(n);
}
function getVolume() {
return(_volume);
}
function changeVolume(n) {
setVolume(getVolume() + n);
}
function remove() {
super.stop();
delete onSoundComplete;
stopFade();
delete manager.sounds[target.getDepth()];
target.removeMovieClip();
}
function toString() {
return(("(target=" + target) + ")");
}
function get volume() {
return(getVolume());
}
function set volume(n) {
setVolume(n);
//return(volume);
}
static var FADE_RATE = 100;
}
Symbol 594 MovieClip [__Packages.SoundManager] Frame 0
class SoundManager extends Snd
{
var sounds, mc_holder, getVolume;
function SoundManager (hld_mc) {
super();
sounds = new Object();
mc_holder = (hld_mc ? (hld_mc) : _root);
}
function playAndRemove(snd_id, offset, loops) {
offset = (isNaN(offset) ? 0 : (offset));
loops = (isNaN(loops) ? 0 : (loops));
var _local2 = newSound(snd_id);
_local2.start(offset, loops);
_local2.onSoundComplete = _local2.remove;
return(_local2);
}
function clearAllSounds() {
for (var _local2 in sounds) {
sounds[_local2].remove();
}
}
function newSound() {
var _local5 = mc_holder.getNextHighestDepth();
var _local6 = mc_holder.createEmptyMovieClip("sh_mc" + _local5, _local5);
var _local4 = new Snd(_local6, this);
var _local3 = 0;
while (_local3 < arguments.length) {
if (arguments[_local3] != undefined) {
_local4.attachSound(arguments[_local3]);
}
_local3++;
}
sounds[_local5] = _local4;
return(_local4);
}
function deleteSound(snd) {
snd.remove();
}
function setVolume(vol) {
if (muted) {
curVol = vol;
} else {
super.setVolume(vol);
}
}
function get mute() {
return(muted);
}
function set mute(b) {
muted = b;
if (b) {
curVol = getVolume();
super.setVolume(0);
} else {
super.setVolume(curVol);
}
//return(mute);
}
var muted = false;
var curVol = 100;
}
Symbol 595 MovieClip [__Packages.CarType] Frame 0
class CarType
{
var speed, dirn, linkage, strength;
function CarType (il, is, id, caught, aaps) {
speed = is;
dirn = id;
linkage = il;
strength = caught;
aimAtPlayerSpeed = aaps;
}
var aimAtPlayerSpeed = 20;
}
Symbol 596 MovieClip [__Packages.CarSlot] Frame 0
class CarSlot
{
function CarSlot () {
}
var inPlay = false;
var dirn = 0;
}
Symbol 597 MovieClip [__Packages.Format] Frame 0
class Format
{
function Format () {
}
static function zerofill(n, z) {
var _local2 = String(n);
var _local1 = _local2.length;
while (_local1 < z) {
_local2 = "0" + _local2;
_local1++;
}
return(_local2);
}
static function time(t, minp, maxp) {
var _local1 = Math.round(Math.floor(t / 1000) % 60);
var _local2 = Math.floor(t / 60000);
var _local3 = (_local2 + ":") + ((_local1 < 10) ? ("0" + _local1) : (_local1));
return(_local3);
}
static function number(n, d, c, l) {
d = (isNaN(d) ? undefined : (d));
c = ((c == undefined) ? "," : (c));
var _local1 = String(n).split(".");
if (!(d === undefined)) {
if (_local1[1]) {
var _local3 = String(Math.round(Number("." + _local1[1]) * Math.pow(10, d)) * Math.pow(10, -d));
_local3 = ((_local3.indexOf(".") < 0) ? (_local3) : (_local3.split(".")[1]));
} else {
var _local3 = "";
}
var _local2 = 0;
while (_local3.length < d) {
var _local3 = _local3 + "0";
_local2++;
}
_local1[1] = _local3;
}
var _local2 = 3;
while (_local1[0].length > _local2) {
_local1[0] = (_local1[0].substring(0, _local1[0].length - _local2) + c) + _local1[0].substring(_local1[0].length - _local2);
_local2 = _local2 + 4;
}
if (!isNaN(l)) {
_local1[0] = zerofill(_local1[0], l);
}
if ((_local1.length > 1) && (d > 0)) {
return((_local1[0] + ".") + _local1[1]);
}
return(_local1[0]);
}
static function ordinal(n) {
if (((n % 100) >= 11) && ((n % 100) <= 13)) {
return("th");
}
if ((n % 10) == 1) {
return("st");
}
if ((n % 10) == 2) {
return("nd");
}
if ((n % 10) == 3) {
return("rd");
}
return("th");
}
static function truncate(s, l, r) {
l = (isNaN(l) ? 20 : (l));
r = ((r == undefined) ? "..." : (r));
if (s.length > l) {
s = s.substr(0, l - r.length);
s = s + r;
}
return(s);
}
}
Symbol 598 MovieClip [__Packages.Rand] Frame 0
class Rand
{
function Rand () {
}
static function midBias(min, max, i, p) {
min = (isNaN(min) ? 0 : (min));
max = (isNaN(max) ? 1 : (max));
i = (isNaN(i) ? 2 : (i + 1));
var _local3 = 0;
var _local1 = 0;
while (_local1 < i) {
_local3 = _local3 + ((v() * (max - min)) + min);
_local1++;
}
_local3 = _local3 / i;
if (p != undefined) {
p = 1 / Math.pow(10, p);
var _local7 = _local3 % p;
if (_local7 <= (p / 2)) {
_local3 = _local3 - _local7;
} else {
_local3 = _local3 + (p - _local7);
}
}
return(_local3);
}
static function minBias(min, max, i, p) {
min = (isNaN(min) ? 0 : (min));
max = (isNaN(max) ? 1 : (max));
i = (isNaN(i) ? 1 : (i));
var _local1 = ((1 - Math.pow(v(), 1 / (i + 1))) * (max - min)) + min;
if (p != undefined) {
p = 1 / Math.pow(10, p);
var _local3 = _local1 % p;
if (_local3 <= (p / 2)) {
_local1 = _local1 - _local3;
} else {
_local1 = _local1 + (p - _local3);
}
}
return(_local1);
}
static function maxBias(min, max, i, p) {
min = (isNaN(min) ? 0 : (min));
max = (isNaN(max) ? 1 : (max));
i = (isNaN(i) ? 1 : (i));
var _local1 = (Math.pow(v(), 1 / (i + 1)) * (max - min)) + min;
if (p != undefined) {
p = 1 / Math.pow(10, p);
var _local3 = _local1 % p;
if (_local3 <= (p / 2)) {
_local1 = _local1 - _local3;
} else {
_local1 = _local1 + (p - _local3);
}
}
return(_local1);
}
static function value() {
if (arguments.length > 0) {
var _local2 = v() * arguments.length;
_local2 = _local2 - (_local2 % 1);
return(arguments[_local2]);
}
}
static function get number() {
return(v());
}
static function random(min, max, p) {
min = (isNaN(min) ? 0 : (min));
max = (isNaN(max) ? 1 : (max));
if (!isNaN(p)) {
p = 1 / Math.pow(10, p);
max = max + p;
} else {
}
var _local3 = (v() * (max - min)) + min;
if (p) {
_local3 = _local3 - (_local3 % p);
}
return(_local3);
}
static var v = Math.random;
}
Symbol 599 MovieClip [__Packages.Car] Frame 0
class Car extends MovieClip
{
var carSlot, carType, removeMovieClip, stop, shad;
function Car () {
super();
}
function die() {
var _local3 = 0;
while (_local3 < _global.root.engine.cars.length) {
if (_global.root.engine.cars[_local3] == this) {
_global.root.engine.cars.splice(_local3, 1);
}
_local3++;
}
carSlot.inPlay = true;
delete carType;
delete carSlot;
removeMovieClip();
_global.root.engine.pleaseRemoveMovieClip(this);
}
function halt() {
stop();
shad.stop();
}
var xVel = 0;
var aimAtPlayerSpeed = 20;
}
Symbol 600 MovieClip [__Packages.ClickBlocker] Frame 0
class ClickBlocker extends MovieClip
{
function ClickBlocker () {
super();
}
function onPress() {
}
var useHandCursor = false;
}
Symbol 601 MovieClip [__Packages.Transition] Frame 0
class Transition extends MovieClip
{
var _nextPage, gotoAndPlay, _prevPage, _curPage, _parent;
function Transition () {
super();
}
function transitionTo(frame) {
_nextPage = frame;
gotoAndPlay(START);
}
function doTransition() {
_prevPage = _curPage;
_curPage = _nextPage;
_parent.gotoAndStop(_nextPage);
delete _nextPage;
}
function get curPage() {
return(curPage);
}
function get prevPage() {
return(prevPage);
}
static var START = "start";
}
Symbol 473 MovieClip Frame 1
stop();
Symbol 473 MovieClip Frame 2
stop();
Symbol 473 MovieClip Frame 3
stop();
Symbol 473 MovieClip Frame 4
stop();
Symbol 473 MovieClip Frame 5
stop();
Symbol 473 MovieClip Frame 6
stop();
Symbol 473 MovieClip Frame 7
stop();
Symbol 473 MovieClip Frame 8
stop();
Symbol 473 MovieClip Frame 9
stop();
Symbol 479 MovieClip Frame 1
stop();
Symbol 479 MovieClip Frame 2
stop();
Symbol 479 MovieClip Frame 3
stop();
Symbol 479 MovieClip Frame 4
stop();
Symbol 479 MovieClip Frame 5
stop();
Symbol 479 MovieClip Frame 6
stop();
Symbol 479 MovieClip Frame 7
stop();
Symbol 479 MovieClip Frame 8
stop();
Symbol 479 MovieClip Frame 9
stop();
Symbol 501 MovieClip Frame 4
gotoAndPlay (1);
Symbol 504 MovieClip Frame 45
gotoAndPlay ("loop");
Symbol 508 MovieClip [ball] Frame 16
gotoAndPlay (1);
Symbol 509 MovieClip Frame 1
_visible = false;
Symbol 516 MovieClip [marker] Frame 1
#initclip 37
Object.registerClass("marker", Marker);
#endinitclip
Symbol 519 MovieClip Frame 1
stop();
Symbol 523 MovieClip Frame 1
stop();
Symbol 525 MovieClip Frame 25
gotoAndPlay (1);
Symbol 532 MovieClip Frame 5
stop();
Symbol 538 MovieClip Frame 6
stop();
Symbol 550 MovieClip Frame 1
Symbol 550 MovieClip Frame 10
gotoAndPlay (1);
Symbol 550 MovieClip Frame 12
stop();
Symbol 550 MovieClip Frame 17
_parent.beginSlide();
Symbol 550 MovieClip Frame 31
stop();
Symbol 550 MovieClip Frame 49
isSwerving = false;
gotoAndPlay ("start");
Symbol 550 MovieClip Frame 53
stop();
Symbol 550 MovieClip Frame 60
_parent.kickBall();
Symbol 550 MovieClip Frame 63
stop();
Symbol 550 MovieClip Frame 64
_parent.beginSlide();
Symbol 550 MovieClip Frame 81
stop();
Symbol 550 MovieClip Frame 96
stop();
Symbol 550 MovieClip Frame 108
stop();
Symbol 553 MovieClip Frame 1
stop();
Symbol 553 MovieClip Frame 2
play();
_parent._y = _parent._y + 20;
Symbol 553 MovieClip Frame 3
_parent._y = _parent._y - 20;
Symbol 553 MovieClip Frame 4
_parent._y = _parent._y + 20;
Symbol 553 MovieClip Frame 5
_parent._y = _parent._y - 20;
Symbol 553 MovieClip Frame 6
_parent._y = _parent._y + 20;
Symbol 553 MovieClip Frame 7
_parent._y = _parent._y - 10;
Symbol 553 MovieClip Frame 13
_parent.collisionReset();
Symbol 556 MovieClip [engine] Frame 1
#initclip 36
Object.registerClass("engine", Engine);
#endinitclip
Instance of Symbol 479 MovieClip "clouds" in Symbol 556 MovieClip [engine] Frame 1
onClipEvent (enterFrame) {
this._x = this._x + 0.5;
if (this._x >= 835) {
this._x = -195;
}
}
Symbol 569 MovieClip Frame 1
stop();
Symbol 577 MovieClip Frame 2
stop();
Symbol 577 MovieClip Frame 8
stop();