Frame 1
posX = 1120;
posY = 1168;
vars = new LoadVars();
vars.load("http://flash.jr.naver.com/event/2004/11/shark/game/game01/tuning.txt");
myraceName = ["Halibut Handicap", "Mackeral Stakes", "Flounder Derby", "Carp Classic", "Minnow Cup", "Guppy Stakes", "Hammerhead Handicap"];
race = 1;
chits = [0, 0, 0];
newChits = 10;
mail = new LoadVars();
mail.load("http://flash.jr.naver.com/event/2004/11/shark/game/game01/mailUrl.txt");
Frame 2
ifFrameLoaded (22) {
gotoAndStop ("title");
}
Frame 3
gotoAndPlay (3);
Frame 7
stop();
Frame 22
trace("chits:" + chits[1]);
fence.cSpeed = chits[0];
fence.cQuickness = chits[1];
fence.cToughness = chits[2];
you.gotoAndStop(4 + (racer * 7));
you.inside.gotoAndStop(3);
if (racer == 0) {
fence.possible = [1, 2];
}
if (racer == 1) {
fence.possible = [0, 2];
}
if (racer == 2) {
fence.possible = [0, 1];
}
stop();
Frame 34
fence.racing = true;
you.inside.gotoAndStop(3);
play();
Frame 35
stop();
Frame 41
stop();
Frame 52
function doNext() {
if (added > 0) {
gotoAndStop ("title");
} else {
gotoAndStop ("title");
}
}
_root.sounds.music.fade();
framecount = framecount + (random(100) / 100);
time = int((framecount * 100) / 15) / 100;
displayTime = "Time: " + time;
stop();
added = Math.max(0, 4 - place);
if (added > 0) {
subhead = added + " points earned";
newChits = newChits + added;
btnGoAgain.label = "Next Race";
race++;
} else {
subHead = "Time for you to retire";
btnGoAgain.label = "Start Over";
race = 1;
}
challenge = function () {
gotoAndStop ("challenge");
};
Symbol 9 MovieClip Frame 1
total = _root.getBytesTotal();
Symbol 9 MovieClip Frame 2
percent = _root.getBytesLoaded() / total;
setProperty("bar", _xscale , (percent * 100) * 1.25);
bar._xscale = Math.min(100, bar._xscale);
Symbol 9 MovieClip Frame 3
gotoAndPlay (2);
Symbol 14 Button
on (release) {
_root.sounds.theme.fade();
play();
}
Symbol 31 MovieClip Frame 1
if (_parent.race > 1) {
gotoAndPlay (7);
} else {
trace("title page");
_root.sounds.theme.gotoAndPlay(2);
stop();
}
Symbol 31 MovieClip Frame 7
startTime = getTimer();
raceNum = "RACE " + _parent.race;
raceName = _parent.myraceName[_parent.race - 1];
_root.raceName = raceName;
Symbol 31 MovieClip Frame 13
_root.sounds.trumpet.start();
Symbol 31 MovieClip Frame 65
elapsed = (getTimer() - startTime) / 1000;
_root.framerate = 58 / elapsed;
_parent.gotoAndStop("setup");
Symbol 35 MovieClip Frame 1
stop();
Symbol 37 Button
on (release) {
if (goal == 100) {
goal = 0;
} else {
goal = 100;
}
}
Symbol 40 MovieClip Frame 1
function start() {
_parent.volumes[2] = 100;
_parent.goals[2] = 100;
gotoAndPlay (2);
}
function fade() {
_parent.goals[2] = 0;
gotoAndPlay ("fade");
}
stop();
Symbol 40 MovieClip Frame 15
stop();
Symbol 40 MovieClip Frame 45
gotoAndStop (1);
Symbol 40 MovieClip Frame 46
trace("roaring");
Symbol 42 MovieClip Frame 1
function start() {
gotoAndPlay (2);
}
stop();
Symbol 42 MovieClip Frame 2
trace("playing");
Symbol 44 MovieClip Frame 1
function start() {
gotoAndPlay (2);
}
stop();
Symbol 47 MovieClip Frame 1
function start() {
if (_currentframe == 1) {
gotoAndPlay (2);
}
}
stop();
Symbol 47 MovieClip Frame 6
trace("roaring");
Symbol 48 MovieClip Frame 1
function start() {
if (_root.fence.racing) {
gotoAndPlay (2);
}
}
stop();
Symbol 52 MovieClip Frame 1
function start(which) {
var _local1 = which;
if (_local1 == "gate") {
gotoAndPlay ("gate");
}
if (_local1 == "off") {
gotoAndPlay ("off");
}
if (_local1 == "winner") {
gotoAndPlay ("winner");
}
}
stop();
Symbol 52 MovieClip Frame 7
stop();
Symbol 52 MovieClip Frame 15
stop();
Symbol 52 MovieClip Frame 23
_root.sounds.crowd.gotoAndPlay("roar");
Symbol 52 MovieClip Frame 26
stop();
Symbol 53 MovieClip Frame 1
function start() {
if (_currentframe == 1) {
gotoAndPlay (2);
}
}
stop();
Symbol 55 MovieClip Frame 1
function start() {
gotoAndPlay (2);
}
stop();
Symbol 56 MovieClip Frame 1
function start() {
gotoAndPlay (2);
}
stop();
Symbol 56 MovieClip Frame 2
trace("playing");
Symbol 58 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 58 MovieClip Frame 15
stop();
Symbol 58 MovieClip Frame 45
gotoAndStop (1);
Symbol 60 MovieClip Frame 1
function start() {
trace("doing the start");
_parent.volumes[3] = 100;
_parent.goals[3] = 100;
gotoAndPlay (2);
}
function fade() {
_parent.goals[3] = 0;
gotoAndPlay ("fade");
}
stop();
Symbol 60 MovieClip Frame 2
play();
Symbol 60 MovieClip Frame 3
trace("playing sounds");
Symbol 60 MovieClip Frame 15
stop();
Symbol 60 MovieClip Frame 45
gotoAndStop (1);
Symbol 61 MovieClip Frame 1
instance = new Array();
names = ["this", "music", "crowd", "theme", "trumpet"];
goals = [100, 100, 100, 100, 100, 0];
volumes = [100, 100, 100, 100, 100, 0];
adjustments = [5, 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);
};
Symbol 61 MovieClip Frame 2
crowd.start();
stop();
Symbol 78 MovieClip Frame 1
_parent._parent.chits[0] = 4.4;
_parent._parent.chits[1] = 2.5;
_parent._parent.chits[2] = 1;
stop();
Symbol 78 MovieClip Frame 2
_parent._parent.chits[0] = 3;
_parent._parent.chits[1] = 6;
_parent._parent.chits[2] = 3;
Symbol 78 MovieClip Frame 3
_parent._parent.chits[0] = 2;
_parent._parent.chits[1] = 3;
_parent._parent.chits[2] = 8;
Symbol 85 Button
on (release) {
play();
}
Symbol 92 Button
on (release) {
cycleRacers(-1);
}
Symbol 95 Button
on (release) {
cycleRacers(1);
}
Symbol 104 MovieClip Frame 1
function doStart() {
_parent.racer = racers._currentframe - 1;
_parent.gotoAndStop("raceAnim");
}
cycleRacers = function (dir) {
racerFrame = racerFrame + dir;
if (racerFrame > 3) {
racerFrame = 1;
}
if (racerFrame < 1) {
racerFrame = 3;
}
racers.gotoAndStop(racerFrame);
};
if (_parent.racer != undefined) {
racerFrame = _parent.racer;
} else {
racerFrame = 1;
}
Symbol 104 MovieClip Frame 7
stop();
Symbol 104 MovieClip Frame 14
doStart();
Symbol 108 MovieClip Frame 1
stop();
Symbol 126 MovieClip Frame 1
stop();
Symbol 159 MovieClip Frame 3
if (_parent._name == "you") {
_root.sounds.run.start();
}
Symbol 174 MovieClip Frame 3
if (_parent._name == "you") {
_root.sounds.run.start();
}
Symbol 187 MovieClip Frame 3
if (_parent._name == "you") {
_root.sounds.run.start();
}
Symbol 200 MovieClip Frame 3
if (_parent._name == "you") {
_root.sounds.run.start();
}
Symbol 207 MovieClip Frame 3
if (_parent._name == "you") {
_root.sounds.run.start();
}
Symbol 214 MovieClip Frame 3
if (_parent._name == "you") {
_root.sounds.run.start();
}
Symbol 221 MovieClip Frame 3
if (_parent._name == "you") {
_root.sounds.run.start();
}
Symbol 234 MovieClip Frame 3
if (_parent._name == "you") {
_root.sounds.run.start();
}
Symbol 247 MovieClip Frame 3
if (_parent._name == "you") {
_root.sounds.run.start();
}
Symbol 260 MovieClip Frame 3
if (_parent._name == "you") {
_root.sounds.run.start();
}
Symbol 273 MovieClip Frame 3
if (_parent._name == "you") {
_root.sounds.run.start();
}
Symbol 286 MovieClip Frame 3
if (_parent._name == "you") {
_root.sounds.run.start();
}
Symbol 299 MovieClip Frame 3
if (_parent._name == "you") {
_root.sounds.run.start();
}
Symbol 312 MovieClip Frame 3
if (_parent._name == "you") {
_root.sounds.run.start();
}
Symbol 325 MovieClip Frame 3
if (_parent._name == "you") {
_root.sounds.run.start();
}
Symbol 338 MovieClip Frame 3
if (_parent._name == "you") {
_root.sounds.run.start();
}
Symbol 351 MovieClip Frame 3
if (_parent._name == "you") {
_root.sounds.run.start();
}
Symbol 364 MovieClip Frame 3
if (_parent._name == "you") {
_root.sounds.run.start();
}
Symbol 377 MovieClip Frame 3
if (_parent._name == "you") {
_root.sounds.run.start();
}
Symbol 378 MovieClip Frame 1
hitter._visible = false;
stop();
Symbol 378 MovieClip Frame 8
hitter._visible = false;
stop();
Symbol 378 MovieClip Frame 15
hitter._visible = false;
stop();
Symbol 379 MovieClip Frame 1
function init() {
leftTop = new Object();
leftTop.x = -5;
leftTop.y = 155;
leftBottom = new Object();
leftBottom.x = -5;
leftBottom.y = 360;
rightTop = new Object();
rightTop.x = 505;
rightTop.y = 155;
rightBottom = new Object();
rightBottom.x = 505;
rightBottom.y = 360;
racing = false;
cToughness = Math.min(5, cToughness);
rad = 57.2957795130823;
speed = new Object();
speed.x = 0;
speed.y = 0.8;
trackwidth = 1.3;
birthrate = 2;
poleLimit = 9;
poles = 0;
bads = 0;
drewFinish = false;
pole = new Array();
rail1 = new Array();
rail2 = new Array();
fringe1 = new Array();
fringe2 = new Array();
bad = new Array();
frame = 0;
startPos = _x;
lastCreated = -1;
turnSpeed = 2;
turnMag = 1000;
turnFrame = 4;
insideFrame = 2;
offset = 0;
tick = 0;
gidyapp = 1;
tooFarLeft = false;
tooFarRight = false;
distance = -90 / turnSpeed;
turnDistance = distance;
vanx = 0;
vany = 0;
dim = 800;
inc = 20;
size = 0.4;
frameCount = 0;
curve = new Array();
curve[0] = new Object();
curve[1] = new Object();
curve[2] = new Object();
curve[3] = new Object();
curve[0].start = 80;
curve[0].stop = 120;
curve[1].start = 150;
curve[1].stop = 190;
curve[2].start = 290;
curve[2].stop = 330;
curve[3].start = 360;
curve[3].stop = 400;
i = 0;
while (i < curve.length) {
curve[i].id = i;
curve[i].span = curve[i].stop - curve[i].start;
curve[i].dRatio = 180 / curve[i].span;
i++;
}
setUpTrack();
}
function doDistance(x1, y1, x2, y2) {
xdist = x1 - x2;
ydist = y1 - y2;
return(Math.sqrt((xdist * xdist) + (ydist * ydist)));
}
function setUpTrack() {
speed.y = 1;
var _local1 = 0;
while (_local1 < 21) {
distance = distance + speed.y;
createPole();
movePoles();
drawRails();
removePole();
removeBad();
findPosition();
_local1++;
}
}
function spawn() {
spawntime = false;
duplicateMovieClip ("badking1", "bad" + poles, 20100 - poles);
bad.push(eval ("bad" + poles));
var b = (bad.length - 1);
bad[b].speed = 0.05;
bad[b].id = b + 1;
bad[b].gotoAndStop(4);
bad[b]._x = pole[i]._x;
bad[b]._y = 0;
bad[b]._xscale = 2;
bad[b]._yscale = 2;
bad[b].color = possible[random(2)];
bads++;
bad[b].distanceAway = 12 + (poles * 4);
bad[b].insideFrame = random(6) + 1;
bad[b].startPos = bad[b]._x;
bad[b].xpos = (random(8) * 0.1) - 0.35;
bad[b].vel = ((0.63 + (poles * 0.017)) + (0.01 * _parent.race)) + (_parent.vars.difficulty * 0.01);
}
function determineCurve(x) {
var _local1 = x;
var y;
var _local3 = 800;
var _local2 = 0;
inCurve = false;
i = 0;
while (i < curve.length) {
if (_local1 >= curve[i - 1].stop) {
_local2 = i;
}
if ((_local1 >= curve[i].start) and (_local1 < curve[i].stop)) {
inCurve = true;
}
i++;
}
if (_local1 >= curve[curve.length - 1].stop) {
_local2 = 4;
}
if (!inCurve) {
y = (-_local2) * _local3;
} else {
y = ((-(((_local2 * 2) + 1) - Math.cos(((_local1 - curve[_local2].start) * curve[_local2].dRatio) / rad))) * 0.5) * _local3;
}
return(y);
}
function createPole() {
if (((int(distance) % birthRate) == 0) and (int(distance) != lastCreated)) {
lastCreated = int(distance);
duplicateMovieClip ("poleking", "pole" + poles, 20025 - poles);
duplicateMovieClip ("railking", "rail1" + poles, 20050 - poles);
duplicateMovieClip ("railking2", "rail2" + poles, 20075 - poles);
duplicateMovieClip ("fringeking", "fringe1" + poles, 19100 - poles);
duplicateMovieClip ("fringeking2", "fringe2" + poles, 19500 - poles);
pole.push(eval ("pole" + poles));
rail1.push(eval ("rail1" + poles));
rail2.push(eval ("rail2" + poles));
if (_parent.frameRate > _parent.vars.framerateCutoff) {
fringe1.push(eval ("fringe1" + poles));
fringe2.push(eval ("fringe2" + poles));
}
var i = (pole.length - 1);
pole[i]._x = determineCurve(distance);
pole[i].turn = pole[i]._x - pole[i - 1]._x;
pole[i]._y = 0;
pole[i]._xscale = 2;
pole[i]._yscale = 2;
pole[i].p = new Object();
pole[i].speed = 1;
if (_parent.frameRate > _parent.vars.framerateCutoff) {
if ((poles % 10) == 3) {
pole[i].sign1._visible = true;
} else {
pole[i].sign1._visible = false;
}
if (poles == 7) {
pole[i].sign2._visible = true;
} else {
pole[i].sign2._visible = false;
}
if (poles == 3) {
pole[i].boards._visible = true;
} else {
pole[i].boards._visible = false;
}
} else {
pole[i].boards._visible = false;
pole[i].sign1._visible = false;
pole[i].sign2._visible = false;
}
poles++;
jimbo = Number(_parent.vars.opponents) + 2;
trace(jimbo);
if ((poles < jimbo) and (poles > 1)) {
spawn();
}
if ((distance > 490) and (!drewFinish)) {
pole[i].sign2._visible = true;
drewFinish = true;
} else {
pole[i].finish._visible = false;
}
if (_parent.frameRate > _parent.vars.framerateCutoff) {
if (((poles % 6) == 0) and (poles > 13)) {
pole[i].billboard1._visible = true;
} else {
pole[i].billboard1._visible = false;
}
if (((poles % 6) == 3) and (poles > 13)) {
pole[i].billboard2._visible = true;
} else {
pole[i].billboard2._visible = false;
}
pole[i].billboard1.gotoAndStop(random(2) + 1);
pole[i].billboard2.gotoAndStop(random(2) + 1);
} else {
pole[i].billboard1._visible = false;
pole[i].billboard2._visible = false;
}
}
}
function removePole() {
if (pole.length > poleLimit) {
removeMovieClip(pole[0]);
pole.shift();
removeMovieClip(rail1[0]);
rail1.shift();
removeMovieClip(rail2[0]);
rail2.shift();
removeMovieClip(fringe1[0]);
fringe1.shift();
removeMovieClip(fringe2[0]);
fringe2.shift();
}
}
function removeBad() {
i = 0;
while (i < bad.length) {
if ((bad[i]._xscale > 180) or (bad[i]._xscale < 0)) {
bad[i]._visible = false;
} else {
bad[i]._visible = true;
}
i++;
}
}
function convert(pos) {
var _local1 = pos;
mytrans = new Object();
where = (1 / _local1.z) * dim;
mytrans.yscale = where * size;
mytrans.xscale = where * size;
distx = (_local1.x - vanx) * (where / (dim / inc));
disty = (-(_local1.y - vany)) * (where / (dim / inc));
mytrans.x = vanx + distx;
mytrans.y = vany + disty;
return(mytrans);
}
function blockHero(who) {
var _local1 = who;
var _local2 = 0.0025 * _local1.id;
if (_local1.distanceAway < 10) {
if (location > _local1.xpos) {
_local1.xpos = _local1.xpos + _local2;
}
if (location < _local1.xpos) {
_local1.xpos = _local1.xpos - _local2;
}
}
}
function centerBad(who) {
var _local1 = who;
i = 0;
while (i < pole.length) {
if ((pole[i]._y < _local1._y) and (pole[i - 1]._y > _local1._y)) {
var r1 = rail1[i];
var r2 = rail2[i];
var d1 = rail1[i - 1];
var d2 = rail2[i - 1];
var _local3 = pole[i];
var _local2 = pole[i - 1];
}
i++;
}
var ratio = ((_local1._y - _local2._y) / (_local3._y - _local2._y));
var left = ((r1._x * ratio) + (d1._x * (1 - ratio)));
var right = ((r2._x * ratio) + (d2._x * (1 - ratio)));
var span = (right - left);
_local1.offDist = int(Math.abs(((((left + right) / 2) - _local1._x) / span) * 4));
if (_local1.distanceAway > 40) {
_local1.offdist = int(_local1.offdist * 0.2);
}
if ((((left + right) / 2) - _local1._x) < 0) {
_local1.offDist = _local1.offDist * -1;
}
_local1.pdiff = 4 - int((-_local3.turn) * 0.052);
blockHero(_local1);
return(((left + right) / 2) + (span * _local1.xpos));
}
function centerYou(who) {
var _local1 = who;
i = 0;
while (i < pole.length) {
if ((pole[i]._y < _local1._y) and (pole[i - 1]._y > _local1._y)) {
var r1 = rail1[i];
var _local3 = rail2[i];
var d1 = rail1[i - 1];
var d2 = rail2[i - 1];
var p1 = pole[i];
var _local2 = pole[i - 1];
}
i++;
}
var ratio = ((_local1._y - _local2._y) / (p1._y - _local2._y));
var left = ((r1._x * ratio) + (d1._x * (1 - ratio)));
var right = ((_local3._x * ratio) + (d2._x * (1 - ratio)));
var span = (right - left);
_local1.location = (-((((left + right) / 2) + _local1._x) - _local1.startPos)) / span;
_local1.offDist = int(Math.abs((((((left + right) / 2) + _local1._x) - _local1.startPos) / span) * 7.4));
if (((((left + right) / 2) + _local1._x) - _local1.startPos) < 0) {
_local1.offDist = _local1.offDist * -1;
}
return((left + right) / 2);
}
function movePoles() {
var _local1 = 0;
while (_local1 < pole.length) {
var _local3 = pole[_local1].speed * speed.y;
pole[_local1]._y = pole[_local1]._y + _local3;
pole[_local1]._xscale = pole[_local1]._xscale + (_local3 * trackWidth);
pole[_local1]._yscale = pole[_local1]._yscale + (_local3 * trackWidth);
pole[_local1].speed = pole[_local1].speed * (1 + (speed.y * 0.3));
_local1++;
}
_local1 = 0;
while (_local1 < bad.length) {
bad[_local1].distanceAway = bad[_local1].distanceAway - (speed.y - bad[_local1].vel);
var _local2 = new Object();
_local2.x = 0;
_local2.y = -19;
_local2.z = bad[_local1].distanceAway;
mytrans = convert(_local2);
bad[_local1]._xscale = mytrans.xscale;
bad[_local1]._yscale = mytrans.yscale;
bad[_local1]._y = mytrans.y;
bad[_local1]._x = centerBad(bad[_local1]);
_local1++;
}
}
function doSpeed() {
var _local1 = _parent;
frameCount++;
if (Key.isDown(32)) {
speed.y = speed.y + 0.1;
speed.y = Math.min(speed.y, 0.92 + (cSpeed * 0.02));
insideframe++;
} else {
speed.y = speed.y - 0.2;
speed.y = Math.max(speed.y, 0);
if (_local1.you.inside._currentframe != 1) {
insideframe++;
}
}
if (Key.isDown(39)) {
turnFrame = Math.min(7, turnFrame + 1);
if (!tooFarRight) {
speed.x = speed.x + 0.4;
speed.x = Math.min(speed.x, 0.75 + (cQuickness * 0.08));
}
} else if (Key.isDown(37)) {
turnFrame = Math.max(1, turnFrame - 1);
if (!tooFarLeft) {
speed.x = speed.x - 0.4;
speed.x = Math.max(speed.x, -0.75 - (cQuickness * 0.08));
}
} else {
if (turnFrame < (4 + offDist)) {
turnframe++;
} else if (turnFrame > (4 + offdist)) {
turnframe--;
}
speed.x = speed.x * 0.5;
if (Math.abs(speed.x) < 0.1) {
speed.x = 0;
}
}
if (insideFrame > 6) {
insideframe = 1;
}
_local1.you.gotoAndStop(turnFrame + (_local1.racer * 7));
_local1.you.inside.gotoAndStop(insideFrame);
distance = distance + speed.y;
turnDistance = turnDistance + (speed.y * gidyapp);
_x = (_x - (speed.x * 30));
centerYou(this);
if (_local1.framerate > _local1.vars.frameRateCutoff) {
_local1.mountains._x = _local1.mountains._x - (speed.x * 10);
}
if ((distance > 495) and (!raceOver)) {
var _local2 = 1;
var _local3 = ["th", "st", "nd", "rd", "th", "th", "th", "th", "th"];
i = 0;
while (i < bad.length) {
if (bad[i].distanceAway > 2.5) {
_local2++;
}
i++;
}
_local1.framecount = framecount;
_local1.place = _local2;
_local1.result = _local2 + _local3[_local2];
if (_local2 < 4) {
_local1.sounds.voice.start("winner");
raceOver = true;
_local1.blocker.gotoAndPlay("over");
} else {
_local1.gotoAndStop("fall");
}
}
}
function drawRails() {
i = 0;
while (i < pole.length) {
pole[i].p1 = new Object();
pole[i].p1.x = pole[i].rail1._x;
pole[i].p1.y = pole[i].rail1._y;
pole[i].localToGlobal(pole[i].p1);
pole[i].p2 = new Object();
pole[i].p2.x = pole[i].rail2._x;
pole[i].p2.y = pole[i].rail2._y;
pole[i].localToGlobal(pole[i].p2);
pole[i].f1 = new Object();
pole[i].f1.x = pole[i].fringe1._x;
pole[i].f1.y = pole[i].fringe1._y;
pole[i].localToGlobal(pole[i].f1);
pole[i].f2 = new Object();
pole[i].f2.x = pole[i].fringe2._x;
pole[i].f2.y = pole[i].fringe2._y;
pole[i].localToGlobal(pole[i].f2);
i++;
}
i = 1;
while (i < pole.length) {
rail1[i]._x = pole[i].p1.x - _x;
rail1[i]._y = pole[i].p1.y - _y;
var _local2 = pole[i - 1].p1.x - pole[i].p1.x;
var _local1 = pole[i - 1].p1.y - pole[i].p1.y;
d = Math.sqrt((_local2 * _local2) + (_local1 * _local1));
rail1[i]._xscale = -d;
rail1[i]._yscale = _local1 * 3;
var _local3 = Math.atan(_local1 / _local2) * rad;
if (_local2 > 0) {
_local3 = _local3 + 180;
}
rail1[i]._rotation = _local3;
rail2[i]._x = pole[i].p2.x - _x;
rail2[i]._y = pole[i].p2.y - _y;
_local2 = pole[i - 1].p2.x - pole[i].p2.x;
_local1 = pole[i - 1].p2.y - pole[i].p2.y;
d = Math.sqrt((_local2 * _local2) + (_local1 * _local1));
rail2[i]._xscale = -d;
rail2[i]._yscale = _local1 * 3;
_local3 = Math.atan(_local1 / _local2) * rad;
if (_local2 > 0) {
_local3 = _local3 + 180;
}
rail2[i]._rotation = _local3;
fringe1[i]._x = pole[i].f1.x - _x;
fringe1[i]._y = pole[i].f1.y - _y;
_local2 = pole[i - 1].f1.x - pole[i].f1.x;
_local1 = pole[i - 1].f1.y - pole[i].f1.y;
d = Math.sqrt((_local2 * _local2) + (_local1 * _local1));
fringe1[i]._xscale = -d;
fringe1[i]._yscale = _local1 * 3;
_local3 = Math.atan(_local1 / _local2) * rad;
if (_local2 > 0) {
_local3 = _local3 + 180;
}
fringe1[i]._rotation = _local3;
fringe2[i]._x = pole[i].f2.x - _x;
fringe2[i]._y = pole[i].f2.y - _y;
_local2 = pole[i - 1].f2.x - pole[i].f2.x;
_local1 = pole[i - 1].f2.y - pole[i].f2.y;
d = Math.sqrt((_local2 * _local2) + (_local1 * _local1));
fringe2[i]._xscale = -d;
fringe2[i]._yscale = _local1 * 3;
_local3 = Math.atan(_local1 / _local2) * rad;
if (_local2 > 0) {
_local3 = _local3 + 180;
}
fringe2[i]._rotation = _local3;
i++;
}
}
function findPosition() {
var _local1 = _parent;
i = 0;
while (i < pole.length) {
if (((_y + pole[i]._y) < _local1.you._y) and ((_y + pole[i - 1]._y) > _local1.you._y)) {
var _local3 = rail1[i];
var _local2 = rail2[i];
}
i++;
}
if (_local3.hitTest(_local1.you._x, _local1.you._y - 90, true)) {
_local1.sounds.wallhit.start();
tooFarLeft = true;
speed.x = 0.5;
speed.y = speed.y * 0.1;
} else {
tooFarLeft = false;
}
if (_local2.hitTest(_local1.you._x, _local1.you._y - 90, true)) {
_local1.sounds.wallhit.start();
tooFarRight = true;
speed.x = -0.5;
speed.y = speed.y * 0.1;
} else {
tooFarRight = false;
}
}
function moveDirt() {
}
function handleOtherRacers() {
var _local2 = _parent;
i = 0;
while (i < bad.length) {
var _local1 = bad[i].offDist + bad[i].pdiff;
_local1 = Math.min(7, _local1);
_local1 = Math.max(1, _local1);
bad[i].gotoAndStop(_local1 + (bad[i].color * 7));
bad[i].insideFrame++;
if (bad[i].insideFrame > 6) {
bad[i].insideframe = 1;
}
bad[i].inside.gotoAndStop(bad[i].insideFrame);
if ((bad[i].distanceAway < 7) and (bad[i].distanceAway > 0)) {
if (bad[i].hitter.hitTest(_local2.you.hitter)) {
_local2.sounds.crash.start();
myDist = 1 / doDistance(_local2.you._x, _local2.you._y, _x + bad[i]._x, _y + bad[i]._y);
speed.y = 1 - (((ydist * myDist) * 0.25) * (6.5 - cToughness));
speed.y = Math.min(1, speed.y);
speed.y = Math.max(0.1, speed.y);
speed.x = (xdist * myDist) * 3;
_local2.you.smacker.gotoAndPlay(2);
}
}
if (i == 0) {
_local2.da = bad[i].distanceAway;
}
i++;
}
}
function doResults() {
var _local2 = _parent;
var _local1 = 1;
var _local3 = ["th", "st", "nd", "rd", "th", "th", "th", "th", "th"];
i = 0;
while (i < bad.length) {
if (bad[i].distanceAway > 2.5) {
_local1++;
}
i++;
}
_local2.framecount = framecount;
_local2.place = _local1;
_local2.result = _local1 + _local3[_local1];
_local2.gotoAndStop("results");
}
drawShape = function () {
var _local2 = _parent;
createEmptyMovieClip("grassLeft", 1);
vertex = [leftTop, leftBottom];
var _local1 = 0;
while (_local1 < pole.length) {
vertex.push(pole[_local1].f1);
_local1++;
}
grassLeft.beginFill(2868090);
grassLeft.lineStyle(0, 2868090, 100);
grassLeft.moveTo((vertex[vertex.length - 1].x - _x) + _local2.posX, (leftTop.y - _y) + _local2.posY);
_local1 = 0;
while (_local1 < vertex.length) {
grassLeft.lineTo((vertex[_local1].x - _x) + _local2.posX, (vertex[_local1].y - _y) + _local2.posY);
_local1++;
}
grassLeft.endFill();
createEmptyMovieClip("grassRight", 2);
vertex = [rightTop, rightBottom];
_local1 = 0;
while (_local1 < pole.length) {
vertex.push(pole[_local1].f2);
_local1++;
}
grassRight.beginFill(2868090);
grassRight.lineStyle(0, 2868090, 100);
grassRight.moveTo((vertex[vertex.length - 1].x - _x) + _local2.posX, (rightTop.y - _y) + _local2.posY);
_local1 = 0;
while (_local1 < vertex.length) {
grassRight.lineTo((vertex[_local1].x - _x) + _local2.posX, (vertex[_local1].y - _y) + _local2.posX);
_local1++;
}
grassRight.endFill();
};
doTimeAndPlace = function () {
time = int((framecount * 100) / 15) / 100;
_parent.displayTime = "Time: " + time;
var _local1 = 1;
var _local2 = ["th", "st", "nd", "rd", "th", "th", "th", "th", "th"];
i = 0;
while (i < bad.length) {
if (bad[i].distanceAway > 2.5) {
_local1++;
}
i++;
}
_parent.place = (_local1 + _local2[_local1]) + " Place";
};
pole[0]._visible = false;
onEnterFrame = function () {
if (racing) {
moveDirt();
doSpeed();
createPole();
movePoles();
drawRails();
if (_parent.frameRate > _parent.vars.framerateCutoff) {
drawShape();
}
removePole();
removeBad();
findPosition();
handleOtherRacers();
doTimeAndPlace();
pole[0]._visible = false;
}
};
init();
Symbol 408 MovieClip Frame 1
stop();
Symbol 408 MovieClip Frame 3
stop();
Symbol 408 MovieClip Frame 10
stop();
Symbol 415 MovieClip Frame 5
_root.sounds.voice.start("gate");
Symbol 415 MovieClip Frame 30
gate.play();
Symbol 415 MovieClip Frame 32
Symbol 415 MovieClip Frame 33
_root.sounds.crowd.gotoAndPlay("roar");
Symbol 415 MovieClip Frame 36
_root.sounds.voice.start("off");
Symbol 415 MovieClip Frame 55
_root.sounds.music.start();
Symbol 415 MovieClip Frame 61
gate.play();
Symbol 415 MovieClip Frame 67
_root.sounds.crowd.gotoAndPlay("roar");
Symbol 415 MovieClip Frame 68
_parent.gotoAndStop("game");
stop();
Symbol 417 MovieClip Frame 1
stop();
Symbol 417 MovieClip Frame 22
_parent.fence.doResults();
Symbol 422 MovieClip Frame 57
stop();
Symbol 457 MovieClip Frame 1
_root.sounds.crash.start();
Symbol 457 MovieClip Frame 2
_root.sounds.crown.gotoAndPlay("roar");
Symbol 457 MovieClip Frame 10
_root.sounds.passby.start();
Symbol 457 MovieClip Frame 32
_parent.place = 5;
_parent.gotoAndStop("results");
stop();
Symbol 465 MovieClip Frame 1
if (_parent._parent.added > 0) {
stop();
} else {
nextFrame();
}
Symbol 471 Button
on (release) {
_parent.doNext();
}
Symbol 475 MovieClip Frame 31
stop();
Symbol 484 MovieClip Frame 1
this._visible = false;
Symbol 491 Button
on (release) {
_root.doNext();
}
Symbol 498 Button
on (release, keyPress "<Enter>") {
submit();
}
Symbol 500 MovieClip Frame 1
function SendEmail(a, b, c, d, e) {
your_name = a;
your_email = b;
friends_name = c;
friends_email = d;
message = e;
dl = "5ds";
getURL (_root.emailURL, "_blank", "GET");
gotoAndStop ("sending");
}
Symbol 510 Button
on (rollOver) {
forw();
}
on (rollOut) {
rev();
}
on (release, keyPress "<Enter>") {
_parent.sendPressed();
}
Symbol 511 MovieClip Frame 4
allStop();
nextFrame();
Symbol 511 MovieClip Frame 20
allStop();
prevFrame();
Symbol 514 Button
on (rollOver) {
forw();
}
on (rollOut) {
rev();
}
on (release, keyPress "<Enter>") {
_parent.gotoAndForw("close");
}
Symbol 515 MovieClip Frame 4
allStop();
nextFrame();
Symbol 515 MovieClip Frame 20
allStop();
prevFrame();
Symbol 538 Button
on (release) {
gotoAndStop ("begin");
}
Symbol 542 Button
on (release) {
gotoAndStop ("begin");
}
Symbol 548 Button
on (release, keyPress "<Enter>") {
gotoAndStop ("close");
}
Symbol 552 Button
on (release, keyPress "<Enter>") {
_root.doNext();
}
Symbol 553 MovieClip Frame 1
function submit() {
var _local2 = _root;
var _local3 = this;
trace("ho");
if ((((your_name.length < 1) || (your_email.length < 1)) || (friends_name.length < 1)) || (friends_email.length < 1)) {
info = "incomplete forms";
} else if ((((your_email.indexOf("@") < 0) || (your_email.indexOf(".") < 0)) || (friends_email.indexOf("@") < 0)) || (friends_email.text.indexOf(".") < 0)) {
info = "invalid email";
} else {
var _local1 = new LoadVars();
_local1.onLoad = function () {
gotoAndStop ("sent");
};
_local1.link = _local2.mail.url;
_local1.friendsEmail = friends_email;
_local1.friendsName = friends_name;
_local1.yourEmail = your_email;
_local1.yourName = your_name;
_local1.race = _local2.raceName;
_local1.timeToBeat = _local2.time;
_local1.position = _local2.result;
_local1.sendAndLoad("challenge.php", _local1, "POST");
counter = 0;
gotoAndStop ("sending");
_local3.onEnterFrame = function () {
counter++;
info("script_message: " + script_message);
if ((script_message == "error") || (counter >= wait)) {
this.onEnterFrame = false;
gotoAndStop ("error");
} else if (script_message == "ok") {
this.onEnterFrame = false;
gotoAndStop ("sent");
} else {
info("checking for script_message");
}
};
}
}
var counter = 0;
var wait = 200;
url = _root.mail.url;
trace("the Url is " + url);
Symbol 553 MovieClip Frame 5
gotoAndStop (21);
Symbol 553 MovieClip Frame 11
button.useHandCursor = false;
Symbol 553 MovieClip Frame 18
init();
Symbol 553 MovieClip Frame 32
stop();
Symbol 553 MovieClip Frame 46
stop();
Symbol 553 MovieClip Frame 61
stop();
Symbol 553 MovieClip Frame 73
_root.doBlocker(_root.goBack);
stop();
Symbol 553 MovieClip Frame 85
gotoAndPlay (1);