Frame 1
function myOnLoad() {
scoreUrl = doc.firstChild.childNodes[0].firstChild;
sendUrl = doc.firstChild.childNodes[1].firstChild;
gameID = doc.firstChild.childNodes[2].firstChild;
dataReceived++;
}
dataReceived = 0;
System.security.allowDomain("makaimedia.com");
System.security.allowDomain("*.makaimedia.com");
doc = new XML();
doc.ignoreWhite = true;
doc.load("config.xml");
doc.onLoad = myOnLoad;
Frame 2
if (dataReceived > 0) {
ifFrameLoaded (4) {
gotoAndStop (4);
}
}
Frame 3
gotoAndPlay (2);
Frame 4
_quality = "BEST";
Symbol 8 MovieClip Frame 1
total = _root.getBytesTotal();
Symbol 8 MovieClip Frame 2
percent = _root.getBytesLoaded() / total;
bar._xscale = percent * 100;
Symbol 8 MovieClip Frame 3
gotoAndPlay (2);
Symbol 37 MovieClip Frame 11
stop();
Symbol 41 MovieClip Frame 1
stop();
Symbol 41 MovieClip Frame 2
_root.sounds.splash.start();
Symbol 41 MovieClip Frame 6
stop();
Symbol 58 MovieClip Frame 1
stop();
Symbol 58 MovieClip Frame 2
play();
Symbol 58 MovieClip Frame 12
removeMovieClip(this);
Symbol 63 MovieClip Frame 1
stop();
Symbol 64 MovieClip Frame 1
spacing = 600;
var i = 0;
while (i < 15) {
duplicateMovieClip (treeKing, "tree" + i, i);
t = eval ("tree" + i);
r = random(2);
t.gotoAndStop(r + 1);
t._x = ((treeKing._x + (spacing * i)) + random(spacing)) - (spacing * 0.5);
t._y = (treeKing._y - 50) + random(100);
i++;
}
Symbol 65 MovieClip Frame 1
init = function () {
jimbob = "hmmmm";
gameStarted = false;
dirt._alpha = 0;
best = 0;
displayScore = "0.00";
displayBest = "0.00";
scenery.offsetx = scenery._x - dirt._x;
scenery.offsety = scenery._y - dirt._y;
cycle.startx = cycle._x;
cycle.starty = cycle._y;
startx = _x;
starty = _y;
skyStartx = sky._x;
skyStarty = sky._y;
dirt.startx = dirt._x;
dirt.starty = dirt._y;
gravity = 1.2;
radius = 13.5;
rad = 57.2957795130823;
trees.swapDepths(12000);
cycle.swapDepths(10000);
reflection.swapDepths(11000);
reset();
};
reset = function () {
assessedDistance = false;
firstJumpDone = false;
fading = false;
_root.sounds.rev.gotoAndPlay(2);
cycle.gotoAndStop(1);
_parent.playAgain._visible = false;
cycle._x = cycle.startx;
cycle._y = cycle.starty;
_x = startx;
_y = starty;
sky._x = skyStartx;
sky._y = skyStarty;
dirt._x = dirt.startx;
dirt._y = dirt.starty;
score = 0;
gameOver = false;
camGoal = _y;
direction = 1;
maxSpeed = 25;
speedx = 0;
speedy = 0;
airborn = true;
countingDistance = false;
jumpDistance = 0;
powering = false;
power._visible = false;
hitMud = false;
dustCount = 0;
started = false;
reflection._visible = false;
};
showPlayAgain = function () {
_parent.unlockChooser();
_parent.playAgain._visible = true;
};
distance = function (x1, y1, x2, y2) {
xdist = x1 - x2;
ydist = y1 - y2;
return(Math.sqrt((xdist * xdist) + (ydist * ydist)));
};
convertSpeed = function () {
var _local1 = distance(0, 0, speedx, speedy);
if (!airborn) {
speedy = yoff * _local1;
}
speedx = xoff * _local1;
};
makeDust = function () {
if (((speedx > 15) and (jumpDist < 1)) and (dirt._x > -2500)) {
dustCount++;
duplicateMovieClip (dustKing, "dust" + dustCount, dustCount);
d = eval ("dust" + dustCount);
d._x = cycle._x;
d._y = cycle._y;
d._rotation = cycle._rotation;
d.gotoAndPlay(2);
}
};
getGlobalPoint = function (x, y) {
var _local1 = new Object();
_local1.x = x;
_local1.y = y;
localToGlobal(_local1);
return(_local1);
};
findElevation = function () {
var _local2 = int(cycle._y - 50);
var _local3 = cycle._x;
choice = 500;
j = _local2;
while (j <= (_local2 + 100)) {
var _local1 = getGlobalPoint(_local3, j);
if (dirt.hitTest(_local1.x, _local1.y, true)) {
choice = j;
break;
}
j++;
}
if (choice <= (cycle._y + 13.5)) {
airborn = false;
cycle._y = choice - 13.5;
convertSpeed();
} else {
airborn = true;
}
};
accelerate = function (a) {
speedx = speedx + (xoff * a);
speedy = speedy + (yoff * a);
var _local1 = distance(0, 0, speedx, speedy);
if (_local1 > maxSpeed) {
speedx = maxSpeed * xoff;
if (!airborn) {
speedy = maxSpeed * yoff;
}
}
};
doKeys = function () {
if ((!_parent.shower._visible) and gameStarted) {
if ((Key.isDown(32) and (!airborn)) and (!hitMud)) {
if ((_root.sounds.racing._currentframe == 1) and (!fading)) {
_root.sounds.racing.start();
}
if (!started) {
_parent.title._visible = false;
_parent.lockChooser();
}
started = true;
accelerate(5);
}
if (((Key.isDown(38) and (!airborn)) and (!powering)) and (!hitMud)) {
power._visible = true;
powering = true;
power.bar._xscale = 0;
}
if ((!Key.isDown(38)) and powering) {
power._visible = false;
powering = false;
if ((jumpDist < 10) and (dirt._x > -2650)) {
_root.sounds.jump.start();
if (firstJumpDone) {
speedy = speedy - (power.bar._xscale / 7);
} else {
speedy = speedy - (power.bar._xscale / 8.2);
firstJumpDone = true;
}
}
}
}
};
doGravity = function () {
if (airborn) {
speedy = speedy + gravity;
} else {
ratio = yoff / (xoff + 0.01);
speedx = speedx + ((xoff * ratio) * gravity);
speedy = speedy + ((yoff * ratio) * gravity);
if (speedy == undefined) {
}
}
if (speedx < 0) {
}
};
moveCycle = function () {
if (!gameOver) {
var _local2 = int(cycle._y - 50);
var _local5 = cycle._x - 20;
j = _local2;
while (j <= (_local2 + 125)) {
var _local6 = getGlobalPoint(_local5, j);
if (dirt.hitTest(_local6.x, _local6.y, true)) {
var _local4 = j;
break;
}
j++;
}
_local5 = cycle._x + 20;
j = _local2;
while (j <= (_local2 + 125)) {
var _local6 = getGlobalPoint(_local5, j);
if (dirt.hitTest(_local6.x, _local6.y, true)) {
var _local3 = j;
break;
}
j++;
}
if ((_local4 == undefined) or (_local3 == undefined)) {
var _local4 = 100;
var _local3 = 130;
}
var _local9 = _local3 - _local4;
var _local8 = -40;
ang = (Math.atan(_local8 / (_local9 + 0.01)) * rad) - 90;
xoff = Math.abs(Math.cos(ang / rad));
yoff = Math.sin(ang / rad);
if (_local3 > _local4) {
yoff = yoff * -1;
}
if (_local4 <= _local3) {
ang = ang + 180;
}
if (!airborn) {
oldAng = cycle._rotation;
cycle._rotation = ang;
var _local7 = 1 - (Math.abs(oldAng - ang) * 0.02);
if (_local7 < 0.95) {
}
speedx = speedx * _local7;
} else {
cycle._rotation = cycle._rotation + 1;
}
doGravity();
if (started and (!gameOver)) {
if (((!Key.isDown(32)) and (speedx < 20)) and (!airborn)) {
speedx = speedx - 1;
speedx = Math.max(0, speedx);
}
if ((dirt._x < -2000) and (speedx < 2)) {
speedx = 3;
}
if ((dirt._x < -2300) and (speedx < 4)) {
speedx = 5;
}
dirt._x = dirt._x - speedx;
sky._x = sky._x - (speedx * 0.5);
trees._x = trees._x - (speedx * 1.5);
}
if (dirt._x < -1500) {
cycle._x = cycle._x + 1;
reflection._x = reflection._x + 1;
}
if (((dirt._x < -2600) and (!airborn)) and (!gameOver)) {
trace("GAME OVER!!!! = " + dirt._x);
gameOver = true;
cycle._rotation = 0;
reflection._visible = true;
cycle.gotoAndPlay(2);
trace("dirty = " + cycle._y);
doScore();
if (score > best) {
best = score;
displayBest = best;
}
_root.scores.test(score, showPlayAgain);
}
if (sky._x < (skyStartx - 624)) {
sky._x = sky._x + 624;
}
cycle._y = cycle._y + speedy;
if (!airborn) {
speedx = speedx * 0.99;
speedy = speedy * 0.99;
}
var _local6 = getGlobalPoint(cycle._x, cycle._y + 13);
if (dirt.mud.hitTest(_local6.x, _local6.y, true)) {
hitMud = true;
}
if ((dirt._x < -2600) and (!fading)) {
fading = true;
_root.sounds.racing.fade();
}
}
};
doPower = function () {
power._x = cycle._x;
power._y = cycle._y - 60;
if (powering) {
power.bar._xscale = power.bar._xscale + (10 * direction);
power.bar._xscale = Math.min(100, power.bar._xscale);
power.bar._xscale = Math.max(0, power.bar._xscale);
if (power.bar._xscale == 100) {
direction = direction * -1;
}
if (power.bar._xscale == 0) {
direction = direction * -1;
}
}
};
findDistance = function () {
if (airborn and (!countingDistance)) {
countingDistance = true;
jumpStart = dirt._x;
}
if (countingDistance) {
jumpDist = (jumpStart - dirt._x) / 25;
} else {
jumpDist = 0;
}
if ((!airborn) and countingDistance) {
countingDistance = false;
maxSpeed = Math.max(maxSpeed, jumpDist);
}
if (hitMud) {
speedx = 0;
maxSpeed = 2;
}
};
moveSetting = function () {
var _local1 = cycle.starty - cycle._y;
camGoal = starty + _local1;
var _local2 = ((_y * 5) + camGoal) / 6;
_y = ((starty + (_local2 * 18)) / 19);
};
doAssess = function () {
if ((!assessedDistance) and (dirt._x < -2600)) {
var _local3 = 0;
var _local1 = cycle._y;
var _local4 = speedx;
var _local2 = speedy;
trace(_local1);
trace(_local2);
assessedDistance = true;
while (_local1 < 360) {
_local1 = _local1 + _local2;
_local2 = _local2 + gravity;
_local3 = _local3 + speedx;
}
trace("flingDist = " + _local3);
}
};
doScore = function () {
if (!gameOver) {
score = (Math.round(Math.max(0, (-dirt._x) - 2600) * 200) / 1000) + (random(10) / 1000);
if (score > 0.1) {
displayScore = score;
} else {
displayScore = "0.00";
}
}
};
onEnterFrame = function () {
doKeys();
moveCycle();
findElevation();
doPower();
findDistance();
moveSetting();
makeDust();
doScore();
scenery._x = dirt._x + scenery.offsetx;
scenery._y = dist._y + scenery.offsety;
doAssess();
jimbob = airborn;
};
init();
Symbol 76 Button
on (release) {
inside.reset();
}
Symbol 82 Button
on (release) {
if (!_parent.locked) {
_parent._parent.doInstructions();
}
}
Symbol 85 Button
on (release) {
if (!_parent.locked) {
_parent._parent.doSend();
}
}
Symbol 87 MovieClip Frame 11
stop();
Symbol 87 MovieClip Frame 21
stop();
Symbol 91 Button
on (press) {
_parent.inside.gameStarted = true;
_visible = false;
}
Symbol 100 Button
on (release) {
_parent.closeInstructions();
}
Symbol 115 Button
on (release) {
closeMailer();
}
Symbol 119 Button
on (release, keyPress "<Left>") {
submit();
}
Symbol 125 Button
on (release) {
closeMailer();
}
Symbol 128 Button
on (release, keyPress "<Enter>") {
gotoAndStop ("begin");
}
Symbol 130 Button
on (release, keyPress "<Enter>") {
gotoAndStop ("begin");
}
Symbol 132 Button
on (release) {
closeMailer();
}
Symbol 136 Button
on (release, keyPress "<Left>") {
sendAnother();
}
Symbol 137 MovieClip Frame 1
var counter = 0;
var wait = 200;
closeMailer = function () {
_parent._parent.closeSend();
friends_email = "";
friends_name = "";
your_email = "";
your_name = "";
info = "";
gotoAndStop ("begin");
};
sendAnother = function () {
gotoAndStop ("begin");
friends_email = "";
friends_name = "";
};
submit = function () {
if ((((your_name.length < 1) or (your_email.length < 1)) or (friends_name.length < 1)) or (friends_email.length < 1)) {
info = "incomplete form";
} else if ((((your_email.indexOf("@") < 0) or (your_email.indexOf(".") < 0)) or (friends_email.indexOf("@") < 0)) or (friends_email.text.indexOf(".") < 0)) {
info = "invalid email";
} else {
var _local3 = new LoadVars();
_local3.onLoad = function () {
gotoAndStop ("sent");
};
_local3.friendsEmail = friends_email;
_local3.friendsName = friends_name;
_local3.yourEmail = your_email;
_local3.yourName = your_name;
_local3.res = _parent.result;
_local3.onLoad = function (success) {
if ((!success) or (this.error == 1)) {
gotoAndStop ("error");
} else {
gotoAndStop ("sent");
}
};
gotoAndStop ("sending");
_local3.sendAndLoad("nancy_sendgame.aspx", _local3, "POST");
counter = 0;
}
};
if (firstTime == undefined) {
friends_email = "";
friends_name = "";
your_email = "";
your_name = "";
firstTime = 1;
}
sentAlready = false;
Selection.setFocus("a");
a.tabIndex = 1;
b.tabIndex = 2;
c.tabIndex = 3;
d.tabIndex = 4;
stop();
Symbol 137 MovieClip Frame 22
sentAlready = true;
Symbol 140 MovieClip Frame 1
stop();
Symbol 141 MovieClip Frame 1
lockChooser = function () {
if (playAgain._visible) {
playAgain._visible = false;
showingPlayAgain = true;
} else {
showingPlayAgain = false;
}
if (title._visible) {
title._visible = false;
showingTitle = true;
} else {
showingTitle = false;
}
chooser.locked = true;
chooser.gotoAndPlay("out");
};
unlockChooser = function () {
if (showingPlayAgain) {
playAgain._visible = true;
}
showingPlayAgain = false;
if (showingTitle) {
title._visible = true;
}
showingPlayAgain = false;
chooser.locked = false;
chooser.gotoAndPlay("in");
};
doInstructions = function () {
lockChooser();
shower.gotoAndStop("instructions");
shower._visible = true;
};
closeInstructions = function () {
unlockChooser();
shower.gotoAndStop("idle");
shower._visible = false;
};
doSend = function () {
lockChooser();
shower.gotoAndStop("send");
shower._visible = true;
};
closeSend = function () {
unlockChooser();
shower.gotoAndStop("idle");
shower._visible = false;
};
showingTitle = true;
showingPlayAgain = false;
shower._visible = false;
Symbol 147 Button
on (release) {
_parent.submitScore(namer.text);
}
Symbol 157 MovieClip Frame 1
init = function () {
nameEnter._visible = false;
box = [unit0, unit1, unit2, unit3, unit4, unit5, unit6, unit7, unit8, unit9];
testing = false;
display();
};
scoresLoaded = function (success) {
showPage(this);
this.onLoad = null;
};
submitLoaded = function (success) {
showPage(this);
this.onLoad = null;
_parent.game.inside.showPlayAgain();
};
submitScore = function (myName) {
if (myName.length > 0) {
nameEnter._visible = false;
scores = new LoadVars();
scores.newScore = newScore;
scores.newName = myName;
scores.gameID = _root.gameID;
scores.action = "insert";
scores.onLoad = submitLoaded;
scores.sendAndLoad(_root.scoreUrl, scores, "POST");
}
};
showPage = function (scores) {
gamesPlayed = scores.gameCount;
i = 0;
while (i < box.length) {
j = i + 1;
box[i].name = eval ("scores.tn" + j);
box[i].score = eval ("scores.ts" + j);
box[i].displayScore = box[i].score;
i++;
}
};
display = function () {
scores = new LoadVars();
scores.action = "read";
scores.gameID = _root.gameID;
scores.sendAndLoad(_root.scoreUrl, scores, "POST");
scores.onLoad = scoresLoaded;
};
showNameEnter = function () {
Selection.setFocus("nameEnter.namer");
nameEnter._visible = true;
};
test = function (testScore, callBack) {
myCallBack = _parent.game.inside.showPlayAgain;
newScore = testScore;
if (Number(newScore) >= box[9].score) {
showNameEnter();
} else {
display();
myCallBack();
}
};
init();
Symbol 161 MovieClip Frame 1
stop();
Symbol 163 Button
on (release) {
if (goals[0] == 100) {
goals[0] = 0;
} else {
goals[0] = 100;
}
}
Symbol 168 MovieClip Frame 1
function start() {
_parent.volumes[1] = 100;
_parent.goals[1] = 100;
gotoAndPlay (2);
}
function fade() {
_parent.goals[1] = 0;
gotoAndPlay ("fade");
}
stop();
Symbol 168 MovieClip Frame 15
stop();
Symbol 168 MovieClip Frame 45
gotoAndStop (1);
Symbol 170 MovieClip Frame 1
function start() {
gotoAndPlay (2);
}
stop();
Symbol 172 MovieClip Frame 1
function start() {
if (_currentframe == 1) {
gotoAndPlay (2);
}
}
stop();
Symbol 174 MovieClip Frame 1
function start() {
gotoAndPlay (2);
}
stop();
Symbol 174 MovieClip Frame 2
trace("beeping");
Symbol 174 MovieClip Frame 3
stop();
Symbol 177 MovieClip Frame 1
function start() {
gotoAndPlay (2);
}
stop();
Symbol 177 MovieClip Frame 5
stop();
Symbol 178 MovieClip Frame 1
function start() {
gotoAndPlay (2);
}
stop();
Symbol 178 MovieClip Frame 2
play();
Symbol 179 MovieClip Frame 1
instance = new Array();
names = ["this", "racing", "crowd", "theme", "trumpet"];
goals = [100, 100, 100, 100, 100, 0];
volumes = [100, 100, 100, 100, 100, 0];
adjustments = [20, 5, 4, 5, 10, 10];
i = 0;
while (i < names.length) {
instance[i] = new Sound(eval (names[i]));
instance[i].setVolume(volumes[i]);
i++;
}
onEnterFrame = function () {
i = 0;
while (i < names.length) {
if (goals[i] < volumes[i]) {
volumes[i] = volumes[i] - adjustments[i];
} else if (goals[i] > volumes[i]) {
volumes[i] = volumes[i] + adjustments[i];
}
if (Math.abs(goals[i] - volumes[i]) < adjustments[i]) {
volumes[i] - goals[i];
}
instance[i].setVolume(volumes[i]);
i++;
}
frame = int(volumes[0] / 10) + 1;
speaker.gotoAndStop(frame);
if (volumes[0] < 25) {
speaker.blocker._visible = true;
speaker.message = "SOUND OFF";
} else {
speaker.blocker._visible = false;
speaker.message = "SOUND ON";
}
};
Symbol 179 MovieClip Frame 2
swamp.start();
stop();