Frame 1
_global.root = this;
kv_v = {c:517, a:0, da:["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.masterDomain = "swarm.killerviral.com";
_global.assetsURL = "http://swarm.killerviral.com/bodyswerve/";
_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 = 2;
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=475");
}
}
trace(_global.root);
killerviral_btn.onMouseDown = function () {
if (this.hitTest(_root._xmouse, _root._ymouse)) {
_root.kvClick(847);
}
};
Frame 2
trace(_global.root);
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");
}
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 = 1356;
_global.mc.unmute = 1357;
defaultHighscores = [];
defaultHighscores[0] = {name:"MF", score:1800, datetime:0};
defaultHighscores[1] = {name:"TB", score:1600, datetime:0};
defaultHighscores[2] = {name:"PM", score:1400, datetime:0};
defaultHighscores[3] = {name:"MH", score:1200, datetime:0};
defaultHighscores[4] = {name:"DS", score:1000, datetime:0};
defaultHighscores[5] = {name:"SA", score:900, datetime:0};
defaultHighscores[6] = {name:"KTB", score:800, datetime:0};
defaultHighscores[7] = {name:"LD", score:700, datetime:0};
defaultHighscores[8] = {name:"DF", score:600, datetime:0};
defaultHighscores[9] = {name:"JG", score:500, datetime:0};
_global.root.getSo = function () {
var _local1 = SharedObject.getLocal("backAttackHighscores", "/");
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 = 3;
score = 0;
trace(_global.root);
Frame 4
stop();
engine.initGame(curLvl);
if (curLvl == 0) {
menus.openMenu("how to play");
} else {
engine.startGame(curLvl);
}
trace(_global.root);
Frame 5
gotoAndStop ("game");
trace(_global.root);
Symbol 8 MovieClip [kvSpark] Frame 70
stop();
Symbol 11 MovieClip Frame 11
gotoAndPlay (1);
Symbol 15 MovieClip Frame 100
ball.stop();
Symbol 17 MovieClip Frame 1
function onEnterFrame() {
var _local2 = _root.getBytesLoaded() / _root.getBytesTotal();
footBall.gotoAndStop(Math.ceil(_local2 * footBall._totalframes));
if (_local2 == 1) {
gotoAndPlay ("out");
delete onEnterFrame;
}
}
_parent.stop();
var progress = (_root.getBytesLoaded() / _root.getBytesTotal());
if (progress == 1) {
gotoAndPlay ("done");
delete onEnterFrame;
} else {
stop();
}
Symbol 17 MovieClip Frame 40
stop();
_parent.play();
Symbol 26 MovieClip Frame 1
stop();
Symbol 26 MovieClip Frame 10
stop();
Symbol 27 MovieClip [checkPoint] Frame 1
#initclip 35
Object.registerClass("checkPoint", Checkpoint);
#endinitclip
Symbol 53 MovieClip [joggingDefender1] Frame 1
#initclip 25
Object.registerClass("joggingDefender1", Car);
#endinitclip
Symbol 53 MovieClip [joggingDefender1] Frame 9
gotoAndPlay ("jogging");
Instance of Symbol 47 MovieClip in Symbol 53 MovieClip [joggingDefender1] Frame 9
onClipEvent (load) {
yVel = 0;
_rotation = ((Math.random() * 100) - 50);
}
onClipEvent (enterFrame) {
yVel = yVel + 1;
_y = (_y + yVel);
}
Symbol 53 MovieClip [joggingDefender1] Frame 21
die();
Symbol 61 MovieClip Frame 1
stop();
Symbol 67 MovieClip Frame 1
stop();
Symbol 87 MovieClip [joggingDefender2] Frame 1
#initclip 26
Object.registerClass("joggingDefender2", Car);
#endinitclip
Symbol 87 MovieClip [joggingDefender2] Frame 14
gotoAndPlay ("jogging");
Symbol 87 MovieClip [joggingDefender2] Frame 23
die();
Symbol 106 MovieClip [joggingDefender3] Frame 1
#initclip 27
Object.registerClass("joggingDefender3", Car);
#endinitclip
Symbol 106 MovieClip [joggingDefender3] Frame 14
gotoAndPlay ("jogging");
Symbol 106 MovieClip [joggingDefender3] Frame 24
die();
Symbol 125 MovieClip [joggingDefender4] Frame 1
#initclip 28
Object.registerClass("joggingDefender4", Car);
#endinitclip
Symbol 125 MovieClip [joggingDefender4] Frame 14
gotoAndPlay ("jogging");
Symbol 125 MovieClip [joggingDefender4] Frame 23
die();
Symbol 145 MovieClip [joggingDefender5] Frame 1
#initclip 29
Object.registerClass("joggingDefender5", Car);
#endinitclip
Symbol 145 MovieClip [joggingDefender5] Frame 14
gotoAndPlay ("jogging");
Symbol 145 MovieClip [joggingDefender5] Frame 23
die();
Symbol 147 MovieClip [checkPoint2] Frame 1
#initclip 30
Object.registerClass("checkPoint2", Checkpoint2);
#endinitclip
Symbol 162 MovieClip Frame 2
stop();
Symbol 169 MovieClip Frame 14
stop();
Symbol 178 Button
on (release) {
_global.root.failedNext();
}
Symbol 200 Button
on (release) {
_global.root.goIntoGame();
}
Symbol 213 MovieClip Frame 2
if (Math.random() < 0.99) {
gotoAndPlay (1);
}
Symbol 223 Button
on (release) {
submitScore();
}
Symbol 228 Button
on (release) {
_global.root.gameOver();
}
Symbol 243 MovieClip Frame 1
stop();
Symbol 244 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 244 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 250 MovieClip Frame 15
kBtn.onRelease = function () {
getURL ("http://www.kempt.co.uk", "_blank");
_root.kvClick(828);
};
Symbol 250 MovieClip Frame 29
stop();
Symbol 251 Button
on (release) {
_global.root.successNext();
}
Symbol 271 MovieClip [menu] Frame 1
#initclip 31
Object.registerClass("menu", Menu);
#endinitclip
Symbol 274 MovieClip [click blocker] Frame 1
#initclip 32
Object.registerClass("click blocker", ClickBlocker);
#endinitclip
Symbol 277 MovieClip [menu anim] Frame 1
#initclip 33
Object.registerClass("menu anim", MenuAnim);
#endinitclip
stop();
Symbol 277 MovieClip [menu anim] Frame 6
stop();
Symbol 277 MovieClip [menu anim] Frame 7
if (menu_mc.kempt) {
menu_mc.kempt.gotoAndStop("off");
}
Symbol 277 MovieClip [menu anim] Frame 11
onMenusClosed();
Symbol 300 MovieClip Frame 7
stop();
Symbol 302 Button
on (release) {
getURL ("http://www.memecounter.com/redir.php?urlId=922", "_blank");
}
Symbol 303 MovieClip Frame 1
function onLoadError(t, err) {
gotoAndPlay ("in");
}
function onLoadComplete(t) {
}
b_mcl = new MovieClipLoader();
if (_root.kvBannerURL) {
url = _root.kvBannerURL;
} else {
url = "http://projects.kempt.co.uk/adnet/?";
urlArgs = "";
urlArgs = urlArgs + (("w=" + _width) + "&");
urlArgs = urlArgs + (("h=" + _height) + "&");
urlArgs = urlArgs + (("sw=" + Stage.width) + "&");
urlArgs = urlArgs + (("sh=" + Stage.height) + "&");
urlArgs = urlArgs + (("x=" + _x) + "&");
urlArgs = urlArgs + (("y=" + _y) + "&");
urlArgs = urlArgs + "as=2&";
urlArgs = urlArgs + (("f=" + escape(getVersion())) + "&");
urlArgs = urlArgs + (("d=" + escape(new LocalConnection().domain())) + "&");
urlArgs = urlArgs + (("t=" + Math.floor(getTimer() / 1000)) + "&");
if (_root.kv_v.c) {
urlArgs = urlArgs + (("mc=" + _root.kv_v.c) + "&");
}
url = url + ((urlArgs + "r=") + Math.floor(Math.random() * 1000));
}
b_mcl.loadClip(url, createEmptyMovieClip("bannerHolder", 0));
b_mcl.addListener(this);
gotoAndStop ("hide");
Symbol 303 MovieClip Frame 10
stop();
Symbol 309 Button
on (release) {
_global.root.transition.transitionTo("game");
}
Symbol 315 Button
on (release) {
getURL ("http://www.killerviral.com", "_blank");
_root.kvClick(413);
}
Symbol 319 Button
on (release) {
getURL ("http://www.killerviral.com", "_blank");
_root.kvClick(848);
}
Symbol 323 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 323 MovieClip Frame 5
stop();
Symbol 328 MovieClip Frame 60
stop();
Symbol 331 MovieClip [transition] Frame 1
#initclip 34
Object.registerClass("transition", Transition);
#endinitclip
stop();
Symbol 331 MovieClip [transition] Frame 5
doTransition();
Symbol 497 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;
}
Symbol 498 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 = 1.8;
var weaving = 10;
var weavingEnd = 10;
var carFreq = 20;
var minCarFreq = 30;
var maxCarFreq = 8;
var timeLeft = 24;
}
Symbol 499 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;
}
Symbol 500 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;
}
Symbol 501 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;
}
Symbol 502 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 = 2;
var weaving = 15;
var weavingEnd = 15;
var carFreq = 16;
var minCarFreq = 27;
var maxCarFreq = 6;
var timeLeft = 23;
}
Symbol 503 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 = 2.9;
var weaving = 15;
var weavingEnd = 17;
var carFreq = 11;
var minCarFreq = 25;
var maxCarFreq = 6;
var timeLeft = 25;
}
Symbol 504 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 = 3.5;
var weaving = 16;
var weavingEnd = 15;
var carFreq = 11;
var minCarFreq = 25;
var maxCarFreq = 6;
var timeLeft = 29;
}
Symbol 505 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 = 3.8;
var weaving = 17;
var weavingEnd = 15;
var carFreq = 10;
var minCarFreq = 24;
var maxCarFreq = 5;
var timeLeft = 32;
}
Symbol 506 MovieClip [__Packages.Engine] Frame 0
class Engine extends MovieClip
{
var aim, line, collisionStartY, _y, endZoneMask, slide, mouse, sndMan, crowdLoop, player, menus, _parent, hud, curLvl, road, sky, clouds, distance_mc, level, cars, carArray, carTypes, allScenery, groundDepth, mouseDepth, carDepth, ox, oy, yourSpeed, _x, onEnterFrame, checkpoint, _xmouse, attachMovie, checkpoint2, roadPosY, vehicleSpeed, roadPosX, _xscale, _yscale, swapDepths, id, removeMovieClip, onMouseDown, _ymouse, ball, celebration_aim;
function Engine () {
super();
aim._visible = false;
line._visible = false;
line.inner.stop();
collisionStartY = _y;
endZoneMask.gotoAndStop("off");
slide._visible = false;
mouse._visible = false;
sndMan = _global.sndMan;
crowdLoop = _global.crowdLoop;
player.stop();
menus = _parent.menus;
hud = _parent.hud;
hud.lives.gotoAndStop(_global.root.lives + 1);
}
function initGame(lvlNum) {
curLvl = lvlNum;
aimVarianceIncrease = aimVarianceIncrease * (curLvl + 1);
road.gotoAndStop("loop");
road.ground.gotoAndStop(lvlNum);
sky.gotoAndStop(lvlNum);
clouds.gotoAndStop(lvlNum);
distance_mc.gotoAndStop(lvlNum);
hud.roundDisplay.gotoAndStop(lvlNum + 1);
stopBG();
level = LEVELS[lvlNum];
cars = [];
carArray = [];
carTypes = [];
var _local3 = 1;
while (_local3 <= NUM_CAR_TYPES) {
carTypes.push(new CarType(((_local3 % 2) ? (level.towardsSpeed) : (level.awaySpeed)), ((_local3 % 2) ? -1 : 1), "joggingDefender" + _local3));
_local3++;
}
_local3 = 0;
while (_local3 <= maxCars) {
carArray[_local3] = new CarSlot();
_local3++;
}
allScenery = [];
groundDepth = (horizonPoint * maxCars) - 600;
mouseDepth = ((passPos + 10) * (maxCars * 2)) * 10;
carDepth = mouseDepth + 10;
ox = Math.random();
oy = Math.random();
yourSpeed = initSpeed;
gameLoop(true);
player.stop();
player.ball.stop();
player.ball.ballInner.stop();
_root.kvEvent(MC_STARTED + lvlNum);
}
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;
doHeartbeat();
}
function gameLoop(takeNoInput) {
timing();
events();
if (!takeNoInput) {
carMotion();
}
collisionLoop();
carsMovement();
if (checkpoint) {
updateCheckpoint();
}
road.swapDepths(groundDepth);
mouse.swapDepths(mouseDepth);
aim.swapDepths(mouseDepth + 1);
line.swapDepths(mouseDepth + 2);
player.swapDepths(carDepth);
_x = _x - ((_x - ((0.5 - _parent._xmouse) + 250)) / 3);
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 startCrosshair() {
_global.root.hud.crosshair.gotoAndPlay("on");
_global.root.hud.crosshair._visible = true;
_global.root.hud.crosshair.onEnterFrame = function () {
this._x = this._parent._xmouse;
this._y = this._parent._ymouse;
updateAfterEvent();
};
}
function stopCrosshair() {
_global.root.hud.crosshair.gotoAndStop("off");
_global.root.hud.crosshair._visible = false;
delete _global.root.hud.crosshair.onEnterFrame;
}
function timing() {
updateTimer();
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)) {
spawnCheckPoint();
}
if ((distance >= (level.levelLength + 0.2)) && (stageComplete == 0)) {
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)) {
trace("Time up!!");
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 carMotion() {
var _local2 = player._x + ((_xmouse - player._x) / PLAYER_MOVEMENT_PAD);
if (_local2 <= PLAYER_LEFT_BOUND) {
_local2 = PLAYER_LEFT_BOUND;
}
if (_local2 >= PLAYER_RIGHT_BOUND) {
_local2 = PLAYER_RIGHT_BOUND;
}
var _local3 = _local2 - player._x;
player._rotation = _local3 * 0.25;
player._x = _local2;
}
function carsMovement() {
var _local2;
var _local3 = 0;
while (_local3 <= cars.length) {
_local2 = cars[_local3];
if ((_local2._y != undefined) && (_local2.id != 50)) {
_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);
_local2.swapDepths((Math.round(_local2.roadPosY) * maxCars) + (_local2.id * 10));
if (_local2.roadPosY >= (horizonPoint - 0.5)) {
_local2.shad._visible = true;
}
_local2._x = carBaseX + (((_local2.roadPosX * Math.pow(_local2.roadPosY + 20, 2.15)) / 1.3) + (_local2.roadPosX * 55));
_local2._xscale = 30 + (_local2.roadPosY * carScale);
_local2._yscale = 30 + (_local2.roadPosY * carScale);
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;
}
}
}
collisionCheck(_local2.roadPosX, _local2.roadPosY, _local2);
}
_local3++;
}
}
function removeCar(car) {
var _local2 = 0;
while (_local2 < cars.length) {
if (cars[_local2] == car) {
delete cars[_local2];
}
_local2++;
}
car.die();
}
function collided(car) {
var _local5 = car._x;
var _local4 = car._y;
var _local6 = car.carType;
var _local7 = car.id;
removeCar(car);
yourSpeed = 0.4;
collisionOver = 0;
colNum++;
var _local2 = attachMovie("joggingDefender1", "collision" + colNum, (maxCars * 30) + colNum);
_local2._x = _local5;
_local2._xscale = 110;
_local2._yscale = 110;
_local2._y = _local4;
collisionShake();
_local2.gotoAndPlay(TACKLE);
player.gotoAndPlay(TACKLED);
sndMan.playAndRemove(OOF);
stopBG();
yourSpeed = 0;
}
function collisionCheck(xpos, ypos, car) {
if (ypos >= colPos) {
if (Math.abs(player._x - car._x) <= COLLISION_THRESHOLD) {
collided(car);
}
}
if (ypos >= passPos) {
removeCar(car);
}
}
function collisionShake() {
collisionY = collisionInit;
}
function collisionLoop() {
if (collisionY) {
collisionY = collisionY - collisionDecay;
collisionDir = collisionDir * -1;
if (collisionY == 0) {
collisionReset();
} else {
_y = collisionStartY + (collisionY * collisionDir);
}
}
}
function collisionReset() {
_y = collisionStartY;
playBG();
player.gotoAndPlay("start");
player.isSwerving = false;
yourSpeed = initSpeed;
}
function spawnCheckPoint2() {
checkpoint2 = attachMovie("checkPoint2", "checkPoint2", ((2 * maxCars) + maxCars) - 9);
checkpoint2.vehicleSpeed = level.carSpeed;
checkpoint2.id = maxCars - 9;
checkpoint2._x = -1000;
checkpoint2.roadPosX = 0;
checkpoint2.roadPosY = 1;
checkpoint2.setMask(endZoneMask);
endZoneMask.gotoAndStop("on");
}
function spawnCheckPoint() {
levelFinish = 1;
checkpoint = attachMovie("checkPoint", "checkPoint", ((2 * maxCars) + maxCars) - 10);
checkpoint.vehicleSpeed = level.carSpeed;
checkpoint.id = maxCars - 10;
checkpoint._x = -600;
checkpoint.roadPosX = 0;
checkpoint.roadPosY = -4.65;
spawnCheckPoint2();
}
function spawnScenery() {
var _local2 = attachMovie("scenery" + sceneryIndex, "scenery" + sceneryCount, ((2 * maxCars) + 1000) + (sceneryCount * 10));
sceneryIndex++;
if (sceneryIndex > sceneryMax) {
sceneryIndex = 1;
}
_local2.vehicleSpeed = level.carSpeed;
_local2.id = maxCars - 10;
_local2._x = -600;
_local2.roadPosX = 0;
_local2.roadPosY = -4.65;
_local2.onEnterFrame = sceneryEnterFrame;
}
function sceneryEnterFrame() {
if (!_global.root.engine.stageComplete) {
roadPosY = roadPosY + (((_global.root.engine.yourSpeed * vehicleSpeed) * Math.pow(roadPosY + 13, 1.7)) / 200);
_y = _global.root.engine.carBaseY + (Math.pow(roadPosY - _global.root.engine.horizonPoint, 2) - 53);
_x = (385 + ((roadPosX * Math.pow(roadPosY + 20, 2.15)) / 1.3)) + (roadPosX * 55);
_xscale = 50 + (roadPosY * _global.root.engine.carScale);
_yscale = 50 + (roadPosY * _global.root.engine.carScale);
swapDepths(((Math.round(roadPosY) + 3) * _global.root.engine.maxCars) + id);
if (_y > 500) {
removeMovieClip();
}
}
}
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) - 53);
checkpoint._x = (385 + ((checkpoint.roadPosX * Math.pow(checkpoint.roadPosY + 20, 2.15)) / 1.3)) + (checkpoint.roadPosX * 55);
checkpoint._xscale = 50 + (checkpoint.roadPosY * carScale);
checkpoint._yscale = 50 + (checkpoint.roadPosY * carScale);
checkpoint.swapDepths(((Math.round(checkpoint.roadPosY) + 3) * maxCars) + checkpoint.id);
if (checkpoint.roadPosY >= CHECKPOINT_REACHED) {
finish();
}
updateCheckpoint2();
}
function updateCheckpoint2() {
if (checkpoint2._y < 400) {
checkpoint2.roadPosY = checkpoint2.roadPosY + (((yourSpeed * checkpoint2.vehicleSpeed) * Math.pow(checkpoint2.roadPosY + 13, 1.7)) / 200);
checkpoint2._y = carBaseY + (Math.pow(checkpoint2.roadPosY - horizonPoint, 2) - 53);
checkpoint2._x = (365 + ((checkpoint2.roadPosX * Math.pow(checkpoint2.roadPosY + 20, 2.15)) / 1.3)) + (checkpoint2.roadPosX * 55);
checkpoint2._xscale = 50 + (checkpoint2.roadPosY * carScale);
checkpoint2._yscale = 50 + (checkpoint2.roadPosY * carScale);
checkpoint2.swapDepths(((Math.round(checkpoint2.roadPosY) + 3) * maxCars) + checkpoint2.id);
}
}
function updateCheckpointAfterTouchdown() {
checkpoint.roadPosY = 0;
checkpoint2.roadPosY = 10;
checkpoint._y = carBaseY + (Math.pow(checkpoint.roadPosY - horizonPoint, 2) - 53);
checkpoint._x = (365 + ((checkpoint.roadPosX * Math.pow(checkpoint.roadPosY + 20, 2.15)) / 1.3)) + (checkpoint.roadPosX * 55);
checkpoint._xscale = 50 + (checkpoint.roadPosY * carScale);
checkpoint._yscale = 50 + (checkpoint.roadPosY * carScale);
checkpoint.swapDepths(((Math.round(checkpoint.roadPosY) + 3) * maxCars) + checkpoint.id);
checkpoint2._y = carBaseY + (Math.pow(checkpoint2.roadPosY - horizonPoint, 2) - 53);
checkpoint2._x = (365 + ((checkpoint2.roadPosX * Math.pow(checkpoint2.roadPosY + 20, 2.15)) / 1.3)) + (checkpoint2.roadPosX * 55);
checkpoint2._xscale = 50 + (checkpoint2.roadPosY * carScale);
checkpoint2._yscale = 50 + (checkpoint2.roadPosY * carScale);
checkpoint2.swapDepths(((Math.round(checkpoint2.roadPosY) + 3) * maxCars) + checkpoint2.id);
}
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;
var _local6 = Rand.random(0, carTypes.length - 1, 0);
var _local3 = carTypes[_local6];
_local5.carType = _local3;
_local5.dirn = _local3.dirn;
var _local2 = attachMovie("joggingDefender1", "car" + _local4, (-3 * maxCars) + (_local4 * 10));
_local2.vehicleSpeed = _local3.speed;
_local2.dirn = _local3.dirn;
_local2.carSlot = _local5;
_local2.carType = _local3;
_local2._x = -1000;
_local2.id = _local4;
if (_local3.dirn == 1) {
_local2.roadPosX = (Rand.random(-0.7, 2.8) / 9) + 0.05;
_local2.swerveTo1 = (Rand.random(-0.7, 2.8) / 9) + 0.05;
_local2.swerveTo2 = (Rand.random(-0.7, 2.8) / 9) + 0.05;
} else {
_local2.roadPosX = (Rand.random(-0.7, 2.8) - 1.5) / 10;
_local2.swerveTo1 = (Rand.random(-0.7, 2.8) - 1.5) / 10;
_local2.swerveTo2 = (Rand.random(-0.7, 2.8) - 1.5) / 10;
}
_local2.roadPosY = -3;
_local2.s = 0;
_local2.swervePoint1 = 2;
_local2.swervePoint2 = _local2.swervePoint1 + 8;
_local2.shad._visible = false;
_local2._y = carBaseY;
cars.push(_local2);
}
function stopBG() {
road.stop();
road.linesLeft.stop();
road.linesRight.stop();
road.grass.stop();
}
function playBG() {
road.play();
road.linesLeft.play();
road.linesRight.play();
road.grass.play();
}
function finish(time) {
delete onEnterFrame;
sndMan.playAndRemove("scored").setVolume(50);
hud.messageMC.gotoAndPlay("touchDown");
mouse._visible = false;
trace("finish=" + this);
player._rotation = 0;
player.gotoAndPlay("touchDown");
player.ball.stop();
stopBG();
}
function prepareForKick() {
updateCheckpointAfterTouchdown();
startCrosshair();
aim._visible = true;
line._visible = true;
var _local4 = getCoordsInScope(player.ball, this);
player.gotoAndPlay("kick");
line._x = _local4.x;
line._y = _local4.y;
var _local3 = getCoordsInScope(player.crosshairStart, this);
aim._x = _local3.x;
aim._y = _local3.y;
_global.root.score = _global.root.score + Math.round(timeLeftCurrent * POINTS_PER_SECOND);
frametime = 0;
onEnterFrame = goalAim;
goalAim();
onMouseDown = takeShot;
}
function updateGoalTimer() {
frametime++;
timeLeftCurrent = goalTime - Math.round(frametime / FPS);
hud.time_txt.text = Format.time(Math.ceil(timeLeftCurrent * 1000));
if ((timeLeftCurrent <= 0) && (stageComplete == 0)) {
trace("Time up!!");
fail();
}
}
function fail() {
delete onEnterFrame;
delete onMouseDown;
stageComplete = 1;
yourSpeed = 0;
stopBG();
player.stop();
player.stop();
isHeartBeating = false;
var _local4 = 0;
while (_local4 < cars.length) {
cars[_local4].halt();
_local4++;
}
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() {
updateGoalTimer();
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._x * aimBufferSize)) / (aimBufferSize + 1);
aim._y = (_ymouse + (aim._y * aimBufferSize)) / (aimBufferSize + 1);
ox = ox + Rand.random(AIM_ADJUST_MIN, AIM_ADJUST_MAX);
oy = oy + Rand.random(AIM_ADJUST_MIN, AIM_ADJUST_MAX);
if (aimVariance < AIM_MAX_OFFSET) {
aimVariance = aimVariance + aimVarianceIncrease;
}
aim.inner._x = (aimVariance * Math.sin(ox)) - (AIM_MAX_OFFSET / 2);
aim.inner._y = (aimVariance * 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;
delete onEnterFrame;
stopCrosshair();
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)) {
scored();
ballFlyIntoDistance();
} 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.curLvl++;
_global.setTimeout(this, "missedShowMenu", 3000);
_root.kvEvent(MC_MISSED + curLvl);
}
function missedShowMenu() {
gameStopped();
menus.openMenu("missed");
menus.menu_mc.panel.score_txt.text = Format.number(_global.root.score);
}
function scored() {
player.gotoAndPlay(SCORED);
sndMan.playAndRemove("scored");
checkpoint.ref.gotoAndStop("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() {
slide._x = player._x;
slide._y = player._y + 95;
var _local2 = Math.atan2(celebration_aim._y - line._y, celebration_aim._x - line._x);
slide._rotation = (_local2 * RAD_TO_DEG) + 90;
slide.inner.gotoAndPlay(1);
onEnterFrame = playerSliding;
}
function playerSliding() {
var _local2 = getCoordsInScope(slide.inner.point, this);
player._x = _local2.x;
player._y = _local2.y - 95;
player._xscale = (player._yscale = slide.inner.point._xscale);
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) {
ball._visible = false;
delete onEnterFrame;
}
}
function getCoordsInScope(mc, scope) {
var _local1 = new flash.geom.Point(0, 0);
mc.localToGlobal(_local1);
scope.globalToLocal(_local1);
return(_local1);
}
var sceneryCount = 1;
var sceneryOftenness = 120;
var sceneryIndex = 1;
var sceneryMax = 2;
var collisionY = 0;
var collisionDir = 1;
var collisionInit = 24;
var collisionDecay = 1.5;
var initSpeed = 0.5;
var carBaseX = 250;
var carBaseY = 100;
var horizonY = 100;
var horizonPoint = 5;
var maxCars = 2600;
var carScale = 5;
var screenwidth = 650;
var screenheight = 420;
var colPos = 17;
var passPos = 22;
var colNum = 0;
var levelFinish = 0;
var goalTime = 8;
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 oldXM = 325;
var isHeartBeating = false;
static var SCREEN_MIN_X = -250;
static var SCREEN_MAX_X = 100;
static var NUM_CAR_TYPES = 5;
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 = 1;
static var AIM_MAX_OFFSET = 60;
var aimVariance = 0;
var aimVarianceIncrease = 0.25;
var aimBufferSize = 40;
var aimBufferX = 0;
var aimBufferY = 0;
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 = 1324;
static var MC_TIMEOUT = 13323;
static var MC_SCORED = 1340;
static var MC_MISSED = 1348;
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 507 MovieClip [__Packages.Marker] Frame 0
class Marker extends MovieClip
{
var _visible;
function Marker () {
super();
_visible = false;
}
}
Symbol 508 MovieClip [__Packages.MenuAnim] Frame 0
class MenuAnim extends MovieClip
{
var menu_mc, gotoAndPlay, _closeHandler;
function MenuAnim () {
super();
}
function openMenu(page) {
menu_mc.gotoAndStop(page);
gotoAndPlay(IN);
}
function closeMenu(hf) {
gotoAndPlay(OUT);
_closeHandler = hf;
}
function onMenusClosed() {
if (_closeHandler) {
_closeHandler();
delete _closeHandler;
}
}
static var IN = "in";
static var OUT = "out";
}
Symbol 509 MovieClip [__Packages.Menu] Frame 0
class Menu extends MovieClip
{
var stop;
function Menu () {
super();
stop();
}
}
Symbol 510 MovieClip [__Packages.Checkpoint] Frame 0
class Checkpoint extends MovieClip
{
var hit, posts;
function Checkpoint () {
super();
hit._visible = false;
posts._visible = false;
}
}
Symbol 511 MovieClip [__Packages.Checkpoint2] Frame 0
class Checkpoint2 extends MovieClip
{
var hit, posts;
function Checkpoint2 () {
super();
hit._visible = false;
posts._visible = false;
}
}
Symbol 512 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 513 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 514 MovieClip [__Packages.CarType] Frame 0
class CarType
{
var speed, dirn, linkage;
function CarType (is, id, il) {
speed = is;
dirn = id;
linkage = il;
}
}
Symbol 515 MovieClip [__Packages.CarSlot] Frame 0
class CarSlot
{
function CarSlot () {
}
var inPlay = false;
var dirn = 0;
}
Symbol 516 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 517 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 518 MovieClip [__Packages.Car] Frame 0
class Car extends MovieClip
{
var carSlot, carType, removeMovieClip, stop, shad;
function Car () {
super();
}
function die() {
carSlot.inPlay = true;
delete carType;
delete carSlot;
removeMovieClip();
}
function halt() {
stop();
shad.stop();
}
}
Symbol 519 MovieClip [__Packages.ClickBlocker] Frame 0
class ClickBlocker extends MovieClip
{
function ClickBlocker () {
super();
}
function onPress() {
}
var useHandCursor = false;
}
Symbol 520 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 333 MovieClip Frame 1
stop();
Symbol 335 MovieClip Frame 1
stop();
Symbol 345 MovieClip Frame 1
stop();
Symbol 366 MovieClip Frame 4
gotoAndPlay (1);
Symbol 369 MovieClip Frame 45
gotoAndPlay ("loop");
Symbol 371 MovieClip [ball] Frame 3
gotoAndPlay (1);
Symbol 372 MovieClip Frame 1
_visible = false;
Symbol 381 MovieClip Frame 1
stop();
Symbol 384 MovieClip Frame 25
gotoAndPlay (1);
Symbol 456 MovieClip Frame 1
Symbol 456 MovieClip Frame 9
gotoAndPlay ("start");
Symbol 456 MovieClip Frame 19
isSwerving = false;
gotoAndPlay ("start");
Symbol 456 MovieClip Frame 26
stop();
Symbol 456 MovieClip Frame 33
stop();
Symbol 456 MovieClip Frame 40
_parent.kickBall();
Symbol 456 MovieClip Frame 43
stop();
Symbol 456 MovieClip Frame 44
Symbol 456 MovieClip Frame 69
stop();
_global.root.hud.messageMC.gotoAndPlay("won");
Symbol 456 MovieClip Frame 84
stop();
_global.root.hud.messageMC.gotoAndPlay("lost");
Symbol 456 MovieClip Frame 94
stop();
Symbol 458 MovieClip [marker] Frame 1
#initclip 37
Object.registerClass("marker", Marker);
#endinitclip
Symbol 461 MovieClip Frame 1
stop();
Symbol 461 MovieClip Frame 2
play();
_parent._y = _parent._y + 20;
Symbol 461 MovieClip Frame 3
_parent._y = _parent._y - 20;
Symbol 461 MovieClip Frame 4
_parent._y = _parent._y + 20;
Symbol 461 MovieClip Frame 5
_parent._y = _parent._y - 20;
Symbol 461 MovieClip Frame 6
_parent._y = _parent._y + 20;
Symbol 461 MovieClip Frame 7
_parent._y = _parent._y - 10;
Symbol 461 MovieClip Frame 13
_parent.collisionReset();
Symbol 463 MovieClip [endZoneMask] Frame 1
stop();
Symbol 464 MovieClip [engine] Frame 1
#initclip 36
Object.registerClass("engine", Engine);
#endinitclip
Instance of Symbol 335 MovieClip "clouds" in Symbol 464 MovieClip [engine] Frame 1
onClipEvent (load) {
startX = _x;
}
onClipEvent (enterFrame) {
this._x = this._x + 0.4;
if (this._x >= (startX + (_width / 2))) {
this._x = startX;
}
}
Instance of Symbol 335 MovieClip "clouds" in Symbol 464 MovieClip [engine] Frame 1
onClipEvent (load) {
startX = _x;
}
onClipEvent (enterFrame) {
this._x = this._x + 0.4;
if (this._x >= (startX + (_width / 2))) {
this._x = startX;
}
}
Symbol 472 MovieClip Frame 1
stop();
_visible = false;
Symbol 472 MovieClip Frame 8
gotoAndPlay (2);
Symbol 486 MovieClip Frame 1
stop();
Symbol 495 MovieClip Frame 1
stop();
Symbol 495 MovieClip Frame 2
play();
Symbol 495 MovieClip Frame 29
_global.root.engine.prepareForKick();
Symbol 495 MovieClip Frame 38
gotoAndStop ("off");
Symbol 495 MovieClip Frame 39
stop();
Symbol 495 MovieClip Frame 40
play();
Symbol 495 MovieClip Frame 96
gotoAndStop ("off");
Symbol 495 MovieClip Frame 97
stop();
Symbol 495 MovieClip Frame 98
play();
Symbol 495 MovieClip Frame 153
gotoAndStop ("off");