Frame 1
a = this.getBytesLoaded();
b = this.getBytesTotal();
percent = (100 * a) / b;
if (5 < b) {
preloader = ("LOADING..." + Math.floor(percent)) + "%";
}
Stage.scaleMode = "noScale";
Frame 2
if ((percent < 100) || (b < 5)) {
gotoAndPlay(_currentframe - 1);
}
Frame 3
stop();
Stage.scaleMode = "noScale";
Frame 4
stop();
Frame 5
stop();
Frame 6
function displayTricks() {
attachMovie("trickFlick", "tr", _parent.getNextHighestDepth());
tr.count = 0;
}
trickCombo = [];
stop();
Instance of Symbol 332 MovieClip "main" in Frame 6
onClipEvent (load) {
x0 = _x;
y0 = _y;
}
onClipEvent (enterFrame) {
var ux = units(rider.x);
var uz = units(rider.z);
actions();
terrain[ux].action();
trees[uz][ux].action();
if (!rocks[uz][ux].action()) {
rider.hOffset = 0;
}
gates[ux].action();
rider.render();
shadow.render();
drawTrail();
drawParticles();
pan();
}
onClipEvent (keyUp) {
rider["keyUp" + Key.getCode()]();
}
Instance of Symbol 336 MovieClip "timer" in Frame 6
onClipEvent (load) {
time = 0;
frames = 0;
stop();
}
Frame 7
mouse.show();
Symbol 10 MovieClip [RED] Frame 16
this.removeMovieClip();
Symbol 15 MovieClip [GREEN] Frame 20
this.removeMovieClip();
Symbol 19 MovieClip Frame 1
stop();
Symbol 28 MovieClip [rock] Frame 1
h = 30;
stop();
Symbol 33 MovieClip Frame 1
stop();
Symbol 44 MovieClip [tree] Frame 1
gotoAndStop(Math.floor(_totalframes * Math.random()));
Symbol 72 MovieClip [line1] Frame 1
if (this.old) {
this.removeMovieClip();
}
this.old = true;
Symbol 74 MovieClip [line0] Frame 1
if (this.old) {
this.removeMovieClip();
}
this.old = true;
Symbol 78 MovieClip [cluster] Frame 1
this._rotation = 360 * Math.random();
function render() {
_x = (0.707 * (x + z));
_y = ((0.866 * y) + ((0.707 * (x - z)) / 2));
}
Instance of Symbol 77 MovieClip [blank] in Symbol 78 MovieClip [cluster] Frame 1
onClipEvent (enterFrame) {
with (_parent) {
_xscale = _xscale * 1.1;
_yscale = _xscale;
}
}
Instance of Symbol 77 MovieClip [blank] in Symbol 78 MovieClip [cluster] Frame 1
onClipEvent (enterFrame) {
with (_parent) {
Vy = Vy + 0.5;
Vx = Vx * 0.7;
Vz = Vz * 0.7;
x = x + Vx;
y = y + Vy;
z = z + Vz;
render();
}
}
Instance of Symbol 77 MovieClip [blank] in Symbol 78 MovieClip [cluster] Frame 6
onClipEvent (enterFrame) {
with (_parent) {
_xscale = _xscale * 0.8;
_yscale = _xscale;
}
}
Symbol 78 MovieClip [cluster] Frame 16
this.removeMovieClip();
Symbol 79 MovieClip [trickFlick] Frame 1
tmpArr = [];
var count;
_parent.trickAlert.gotoAndPlay(_parent.trickCombo[count].trick);
_parent.trickAlert.points = "+ " + _parent.trickCombo[count].point;
Symbol 79 MovieClip [trickFlick] Frame 40
count++;
if (count >= _parent.trickCombo.length) {
_parent.trickCombo = [];
this.removeMovieClip();
}
Symbol 86 MovieClip [alertGrab] Frame 1
function trickFailed(trick) {
gotoAndPlay(trick + "Failed");
}
stop();
Symbol 86 MovieClip [alertGrab] Frame 40
gotoAndStop (1);
Symbol 86 MovieClip [alertGrab] Frame 80
gotoAndStop (1);
Symbol 86 MovieClip [alertGrab] Frame 120
gotoAndStop (1);
Symbol 86 MovieClip [alertGrab] Frame 160
gotoAndStop (1);
Symbol 86 MovieClip [alertGrab] Frame 200
gotoAndStop (1);
Symbol 96 MovieClip [girlFall] Frame 1
this.onEnterFrame = function () {
trace("e");
};
trace("girlFall");
Symbol 101 MovieClip [bubble] Frame 1
stop();
Symbol 101 MovieClip [bubble] Frame 15
gotoAndStop (1);
Symbol 101 MovieClip [bubble] Frame 31
gotoAndStop (1);
Symbol 101 MovieClip [bubble] Frame 47
gotoAndStop (1);
Symbol 101 MovieClip [bubble] Frame 63
gotoAndStop (1);
Symbol 101 MovieClip [bubble] Frame 64
stop();
Symbol 143 MovieClip Frame 60
_parent.gotoAndStop("midlift");
Symbol 147 Button
on (release) {
stopAllSounds();
gotoAndStop ("runSelect");
}
Symbol 160 MovieClip Frame 204
_parent.gotoAndStop("runSelect");
Symbol 168 Button
on (release) {
stopAllSounds();
_parent.selectedRun = "hard";
_root.level = 3;
_root.playedGameId = _root.gameIds[3];
runLabel._alpha = 0;
countdown.play();
mouse.hide();
gotoAndStop (95);
}
on (rollOver) {
runLabel.gotoAndStop(_root.characterSkin + "3");
runLabel._alpha = 100;
}
on (rollOut) {
runLabel._alpha = 0;
}
Symbol 173 Button
on (release) {
stopAllSounds();
_parent.selectedRun = "med";
_root.level = 2;
runLabel._alpha = 0;
countdown.play();
mouse.hide();
gotoAndStop (95);
}
on (rollOver) {
runLabel.gotoAndStop(_root.characterSkin + "2");
runLabel._alpha = 100;
}
on (rollOut) {
runLabel._alpha = 0;
}
Symbol 178 Button
on (release) {
stopAllSounds();
_parent.selectedRun = "easy";
_root.level = 1;
runLabel._alpha = 0;
countdown.play();
mouse.hide();
gotoAndStop (95);
}
on (rollOver) {
runLabel.gotoAndStop(_root.characterSkin + "1");
runLabel._alpha = 100;
}
on (rollOut) {
runLabel._alpha = 0;
}
Symbol 184 MovieClip Frame 1
stop();
Symbol 184 MovieClip Frame 82
_parent._parent.selectFade.gotoAndPlay(2);
Symbol 199 Button
on (release) {
stopAllSounds();
_parent.selectedRun = "hard";
_root.level = 3;
_root.playedGameId = _root.gameIds[3];
runLabel._alpha = 0;
countdown.play();
mouse.hide();
gotoAndStop (95);
}
on (rollOver) {
choose._visible = false;
runLabel.gotoAndStop(_root.characterSkin + "3");
runLabel._alpha = 100;
}
on (rollOut) {
runLabel._alpha = 0;
}
Symbol 200 Button
on (release) {
stopAllSounds();
_parent.selectedRun = "med";
_root.level = 2;
runLabel._alpha = 0;
countdown.play();
mouse.hide();
gotoAndStop (95);
}
on (rollOver) {
choose._visible = false;
runLabel.gotoAndStop(_root.characterSkin + "2");
runLabel._alpha = 100;
}
on (rollOut) {
runLabel._alpha = 0;
}
Symbol 202 Button
on (release) {
stopAllSounds();
_parent.selectedRun = "easy";
_root.level = 1;
runLabel._alpha = 0;
countdown.play();
mouse.hide();
gotoAndStop (95);
}
on (rollOver) {
choose._visible = false;
runLabel.gotoAndStop(_root.characterSkin + "1");
runLabel._alpha = 100;
}
on (rollOut) {
runLabel._alpha = 0;
}
Symbol 206 Button
on (release) {
stopAllSounds();
_parent.selectedRun = "hard";
_root.playedGameId = _root.gameIds[3];
_root.level = 3;
runLabel._alpha = 0;
countdown.play();
mouse.hide();
gotoAndStop (95);
}
on (rollOver) {
runLabel.gotoAndStop(_root.characterSkin + "3");
runLabel._alpha = 100;
}
on (rollOut) {
runLabel._alpha = 0;
}
Symbol 207 Button
on (release) {
stopAllSounds();
_parent.selectedRun = "hard";
_root.playedGameId = _root.gameIds[3];
_root.level = 3;
runLabel._alpha = 0;
countdown.play();
mouse.hide();
gotoAndStop (95);
}
on (rollOver) {
choose._visible = false;
runLabel.gotoAndStop(_root.characterSkin + "3");
runLabel._alpha = 100;
}
on (rollOut) {
runLabel._alpha = 0;
}
Symbol 214 MovieClip Frame 1
stop();
Symbol 214 MovieClip Frame 2
stop();
Symbol 214 MovieClip Frame 3
stop();
Symbol 214 MovieClip Frame 4
stop();
Symbol 214 MovieClip Frame 5
stop();
Symbol 214 MovieClip Frame 6
stop();
Symbol 215 MovieClip Frame 95
stop();
Symbol 216 MovieClip Frame 1
stop();
Symbol 216 MovieClip Frame 10
_parent.gotoAndStop("game");
Symbol 222 MovieClip Frame 1
stop();
Symbol 328 MovieClip Frame 28
_parent.state = null;
Symbol 328 MovieClip Frame 40
_parent._parent._parent.trickCombo = [];
stop();
Symbol 328 MovieClip Frame 50
stop();
Symbol 328 MovieClip Frame 55
fb._alpha = 100;
_parent.bubble.gotoAndPlay(_root.characterSkin + "Fall");
_parent._parent._parent.trickCombo = [];
_parent._parent._parent.tr.removeMovieClip();
Symbol 328 MovieClip Frame 79
if ((!_parent.onGround) || (3 < _parent.Vx)) {
gotoAndPlay ("wait");
}
Symbol 328 MovieClip Frame 80
with (_parent) {
_parent.shadow._visible = true;
_parent.drawImprint((("slope" + dx) + "_") + dy);
trailWidth = 5;
state = null;
}
stop();
Symbol 328 MovieClip Frame 99
_parent.state = null;
stop();
Symbol 328 MovieClip Frame 116
_parent.state = null;
stop();
Symbol 328 MovieClip Frame 126
if (Key.isDown(40)) {
stop();
}
Symbol 328 MovieClip Frame 129
_parent.state = null;
stop();
Symbol 328 MovieClip Frame 139
if (Key.isDown(37)) {
stop();
}
Symbol 328 MovieClip Frame 142
_parent.state = null;
stop();
Symbol 328 MovieClip Frame 154
if (Key.isDown(16)) {
stop();
}
Symbol 328 MovieClip Frame 163
_parent.state = null;
stop();
Symbol 329 MovieClip Frame 1
fall._visible = false;
firstframe = 1;
stop();
Symbol 329 MovieClip Frame 2
firstframe = 1;
Symbol 329 MovieClip Frame 3
firstframe = 2;
Symbol 329 MovieClip Frame 4
firstframe = 3;
Symbol 331 MovieClip Frame 1
stop();
Symbol 332 MovieClip Frame 1
cell = 100;
clip = rider;
main = this;
gravity = 1.2;
frmin = 0.88;
frmax = 0.975;
turning = 4;
z_max = 800;
z_min = 0;
Vnmax = 20;
hillFrame = 3;
trickValue = 0;
function radians(degrees) {
return((degrees * Math.PI) / 180);
}
function degrees(radians) {
return((radians * 180) / Math.PI);
}
function pixels(units) {
return(units * cell);
}
function units(pixels) {
return(Math.floor(pixels / cell));
}
rider.radians = radians;
rider.degrees = degrees;
function render() {
_x = (0.707 * (x + z));
_y = ((0.866 * y) + ((0.707 * (x - z)) / 2));
}
rider.render = function () {
if (z < _parent.z_min) {
Vz = 0;
z = _parent.z_min + 10;
} else if (_parent.z_max < z) {
Vz = 0;
z = _parent.z_max - 10;
}
_x = (0.707 * (x + z));
_y = ((0.866 * y) + ((0.707 * (x - z)) / 2));
var ux = _parent.units(x);
var uz = (_parent.units(_parent.z_max) - _parent.units(z));
depth = (100 * ux) + (10 * uz);
this.swapDepths(depth);
};
shadow.render = function () {
var clip = _parent.clip;
x = clip.x;
y = clip.ground;
z = clip.z;
gotoAndStop(clip._currentframe);
var frameLabel = ((("slope" + clip.dx) + "_") + clip.dy);
gotoAndStop(frameLabel);
board.board._rotation = (180 * clip.rotation) / Math.PI;
_x = (0.707 * (x + z));
_y = ((0.866 * y) + ((0.707 * (x - z)) / 2));
};
function Incline(dx, dy, x0, y0, depth) {
this.dx = dx;
this.dy = dy;
this.R = Math.sqrt((dx * dx) + (dy * dy));
this.x0 = x0;
this.y0 = y0;
this.x_int = cell * (x0 - (y0 / (dy / dx)));
hill.attachMovie((("incline" + dx) + "_") + dy, "incline" + x0, x0);
hillFrame++;
if (4 < hillFrame) {
hillFrame = 1;
}
with (hill["incline" + x0]) {
x = x0 * cell;
y = y0 * cell;
_x = 0.707 * (x + z);
_y = (0.866 * y) + ((0.707 * (x - z)) / 2);
gotoAndStop(hillFrame);
}
}
Incline.prototype.ground = function (x) {
var ground = (((x - this.x_int) * (this.dy / this.dx)) - rider.hOffset);
clip.ground = ground;
return(ground);
};
Incline.prototype.onGround = function () {
if ((clip.y - this.ground(clip.x)) < -1) {
return(false);
}
shadow._visible = false;
clip.y = this.ground(clip.x);
var slope = ((("slope" + this.dx) + "_") + this.dy);
clip.gotoAndStop(slope);
if (!clip.onGround) {
clip.land();
if (Vnmax < Math.abs(Vnormal())) {
clip.fall();
}
}
var V0 = Math.sqrt((clip.Vx * clip.Vx) + (clip.Vy * clip.Vy));
var dotProduct = (((clip.Vx / V0) * (this.dx / this.R)) + ((clip.Vy / V0) * (this.dy / this.R)));
if (V0 == 0) {
dotProduct = 0;
}
var V1 = (V0 * dotProduct);
clip.Vx = (V1 * this.dx) / this.R;
clip.Vy = (V1 * this.dy) / this.R;
return(true);
};
Incline.prototype.applyA = function (A) {
shadow._visible = true;
clip.Vy = clip.Vy + A;
};
Incline.prototype.applyAplane = function (A, rotation) {
var Aplane = (((A * Math.cos(rotation)) * this.dy) / this.R);
var Az = (((-Aplane) * turning) * Math.atan(rotation));
var Ay = ((Aplane * this.dy) / this.R);
var Ax = ((Aplane * this.dx) / this.R);
clip.Vy = clip.Vy + Ay;
clip.Vx = clip.Vx + Ax;
if (clip.state == "FALL") {
clip.Vz = clip.Vz * frmin;
return(undefined);
}
clip.Vz = clip.Vz + Az;
};
Incline.prototype.applyfriction = function (rotation) {
var fn = (frmin + ((frmax - frmin) * Math.abs(Math.cos(rotation))));
var ft = (frmin + ((frmax - frmin) * Math.abs(Math.sin(rotation))));
clip.Vx = clip.Vx * fn;
clip.Vy = clip.Vy * fn;
clip.Vz = clip.Vz * ft;
};
Incline.prototype.applyV = function () {
clip.y = clip.y + clip.Vy;
clip.x = clip.x + clip.Vx;
clip.z = clip.z + clip.Vz;
};
Incline.prototype.inclineRider = function () {
clip.dx = this.dx;
clip.dy = this.dy;
};
Incline.prototype.action = function () {
this.applyV();
this.inclineRider();
if (this.onGround()) {
clip.onGround = true;
this.applyAplane(gravity, clip.rotation);
this.applyfriction(clip.rotation);
} else {
clip.onGround = false;
this.applyA(gravity);
}
};
function Rock(uz, ux, frame) {
this.x = cell * ux;
this.z = cell * uz;
this.y = terrain[ux].ground(this.x);
this.depth = ((100 * ux) + (10 * (units(z_max) - uz))) - 3;
this.dx = terrain[ux].dx;
this.dy = terrain[ux].dy;
attachMovie("rock", (("rock" + ux) + "_") + uz, this.depth);
this.pointer = eval ((("rock" + ux) + "_") + uz);
with (this.pointer) {
gotoAndStop(frame);
child.gotoAndStop((("slope" + this.dx) + "_") + this.dy);
_x = 0.707 * (this.x + this.z);
_y = (0.866 * this.y) + ((0.707 * (this.x - this.z)) / 2);
}
}
Rock.prototype.action = function () {
var height = this.pointer.h;
rider.hOffset = height;
if (clip.onGround) {
clip.fall();
clip.Vx = Math.max(clip.Vx, 5);
}
return(true);
};
function Tree(uz, ux) {
this.x = (cell * ux) + cell;
this.z = (cell * uz) + cell;
this.y = terrain[ux].ground(this.x);
this.depth = ((100 * ux) + (10 * (units(z_max) - uz))) + 5;
this.slope = (("slope" + terrain[ux + 1].dx) + "_") + terrain[ux + 1].dy;
attachMovie("tree", (("tree" + ux) + "_") + uz, this.depth);
with (eval ((("tree" + ux) + "_") + uz)) {
_x = 0.707 * (this.x + this.z);
_y = (0.866 * this.y) + ((0.707 * (this.x - this.z)) / 2);
shadow.gotoAndStop(this.slope);
}
}
Tree.prototype.action = function () {
var dx = (this.x - clip.x);
var dz = (this.z - clip.z);
var R = Math.sqrt((dx * dx) + (dz * dz));
var dy = (this.y - clip.y);
var width = 30;
var height = 150;
if ((R < width) && (height >= dy)) {
clip.fall();
}
};
function Gate(z_left, z_right, gateType) {
this.z_left = z_left;
this.z_right = z_right;
this.active = true;
this.cleared = true;
this.gateType = gateType;
}
Gate.prototype.action = function () {
if (!this.active) {
return(undefined);
}
this.active = false;
if (this.gateType == "start") {
_parent.timer.play();
return(undefined);
}
if (this.gateType == "finish") {
_parent.timer.stop();
_parent.nextFrame();
return(undefined);
}
if (this.gateType == "tricks") {
display("GREEN", "TRICK AREA", 256, 192);
return(undefined);
}
if ((rider.z < pixels(this.z_left)) || (pixels(this.z_right) < rider.z)) {
this.cleared = false;
display("RED", "MISSED GATE : + 5 seconds", 256, 192);
_parent.timer.frames = _parent.timer.frames + 100;
return(undefined);
}
display("GREEN", "CLEAR", 55, 25);
};
function setMedTerrain() {
terrain = new Array();
x_int = 0;
y_int = 0;
var i = 0;
while (i < 11) {
newIncline(2, 1);
i++;
}
var i = 0;
while (i < 3) {
newIncline(1, 2);
i++;
}
var i = 0;
while (i < 10) {
newIncline(2, 1);
i++;
}
var i = 0;
while (i < 1) {
newIncline(1, 1);
i++;
}
var i = 0;
while (i < 1) {
newIncline(1, 2);
i++;
}
var i = 0;
while (i < 3) {
newIncline(1, 1);
i++;
}
var i = 0;
while (i < 3) {
newIncline(2, 1);
i++;
}
var i = 0;
while (i < 5) {
newIncline(2, 1);
i++;
}
var i = 0;
while (i < 10) {
newIncline(1, 1);
i++;
}
var i = 0;
while (i < 3) {
newIncline(1, 1);
i++;
}
var i = 0;
while (i < 4) {
newIncline(2, 1);
i++;
}
var i = 0;
while (i < 5) {
newIncline(1, 2);
i++;
}
var i = 0;
while (i < 20) {
newIncline(2, 1);
i++;
}
var i = 0;
while (i < 2) {
newIncline(2, 1);
i++;
}
var i = 0;
while (i < 10) {
newIncline(1, 1);
i++;
}
var i = 0;
while (i < 4) {
newIncline(2, 1);
i++;
}
var i = 0;
while (i < 6) {
newIncline(1, 2);
i++;
}
var i = 0;
while (i < 7) {
newIncline(2, 1);
i++;
}
var i = 0;
while (i < 10) {
newIncline(2, 1);
i++;
}
var i = 0;
while (i < 7) {
newIncline(1, 1);
i++;
}
var i = 0;
while (i < 8) {
newIncline(4, 1);
i++;
}
}
function setEasyTerrain() {
terrain = new Array();
x_int = 0;
y_int = 0;
var i = 0;
while (i < 2) {
newIncline(2, 1);
i++;
}
var i = 0;
while (i < 5) {
newIncline(2, 1);
i++;
}
var i = 0;
while (i < 1) {
newIncline(2, 1);
i++;
}
var i = 0;
while (i < 10) {
newIncline(1, 1);
i++;
}
var i = 0;
while (i < 1) {
newIncline(2, 1);
i++;
}
var i = 0;
while (i < 1) {
newIncline(4, 1);
i++;
}
var i = 0;
while (i < 1) {
newIncline(1, 2);
i++;
}
var i = 0;
while (i < 6) {
newIncline(2, 1);
i++;
}
var i = 0;
while (i < 3) {
newIncline(1, 2);
i++;
}
var i = 0;
while (i < 17) {
newIncline(2, 1);
i++;
}
var i = 0;
while (i < 5) {
newIncline(1, 2);
i++;
}
var i = 0;
while (i < 12) {
newIncline(2, 1);
i++;
}
var i = 0;
while (i < 2) {
newIncline(1, 2);
i++;
}
var i = 0;
while (i < 12) {
newIncline(2, 1);
i++;
}
var i = 0;
while (i < 15) {
newIncline(1, 1);
i++;
}
var i = 0;
while (i < 1) {
newIncline(2, 1);
i++;
}
var i = 0;
while (i < 2) {
newIncline(4, 1);
i++;
}
var i = 0;
while (i < 6) {
newIncline(1, 2);
i++;
}
var i = 0;
while (i < 1) {
newIncline(1, 1);
i++;
}
var i = 0;
while (i < 1) {
newIncline(2, 1);
i++;
}
var i = 0;
while (i < 8) {
newIncline(2, 1);
i++;
}
var i = 0;
while (i < 8) {
newIncline(2, 1);
i++;
}
var i = 0;
while (i < 2) {
newIncline(2, 1);
i++;
}
var i = 0;
while (i < 8) {
newIncline(4, 1);
i++;
}
}
function setTerrain() {
terrain = new Array();
x_int = 0;
y_int = 0;
var i = 0;
while (i < 2) {
newIncline(2, 1);
i++;
}
var i = 0;
while (i < 25) {
newIncline(1, 1);
i++;
}
var i = 0;
while (i < 29) {
newIncline(1, 2);
i++;
}
var i = 0;
while (i < 26) {
newIncline(1, 1);
i++;
}
var i = 0;
while (i < 1) {
newIncline(1, 1);
i++;
}
var i = 0;
while (i < 1) {
newIncline(2, 1);
i++;
}
var i = 0;
while (i < 1) {
newIncline(4, 1);
i++;
}
var i = 0;
while (i < 1) {
newIncline(1, 2);
i++;
}
var i = 0;
while (i < 12) {
newIncline(1, 1);
i++;
}
var i = 0;
while (i < 12) {
newIncline(1, 2);
i++;
}
var i = 0;
while (i < 10) {
newIncline(1, 1);
i++;
}
var i = 0;
while (i < 1) {
newIncline(2, 1);
i++;
}
var i = 0;
while (i < 5) {
newIncline(1, 2);
i++;
}
var i = 0;
while (i < 1) {
newIncline(1, 1);
i++;
}
var i = 0;
while (i < 1) {
newIncline(2, 1);
i++;
}
var i = 0;
while (i < 15) {
newIncline(1, 1);
i++;
}
}
function newIncline(dx, dy) {
terrain[x_int] = new Incline(dx, dy, x_int, y_int);
if (dx == dy) {
dx = 2;
dy = 2;
}
var i = (x_int + 1);
while (i < (x_int + dx)) {
terrain[i] = terrain[x_int];
i++;
}
x_int = x_int + dx;
y_int = y_int + dy;
}
gravity = 1.2;
function setTrees() {
trees = [[], [], [], [], [], [], [], []];
}
function newTree(z, x) {
trees[z][x] = (trees[z + 1][x] = new Tree(z, x));
}
function setMedGates() {
gates = new Array();
newGate(0, 6, 3, "start");
var i = 5;
while (i < 20) {
newGate(0, 3, i);
newGate(3, 6, i + 4);
i = i + 10;
}
var i = 30;
while (i < 45) {
newGate(0, 3, i);
newGate(3, 6, i + 4);
i = i + 8;
}
var i = 60;
while (i < 95) {
newGate(0, 3, i);
newGate(3, 6, i + 4);
i = i + 8;
}
var i = 120;
while (i < 150) {
newGate(0, 3, i);
newGate(3, 6, i + 5);
i = i + 10;
}
var i = 160;
while (i < 176) {
newGate(0, 3, i);
newGate(3, 6, i + 4);
i = i + 8;
}
var i = 202;
while (i < 216) {
newGate(0, 3, i);
newGate(3, 6, i + 4);
i = i + 8;
}
newGate(0, 6, 230, "finish");
}
function setEasyGates() {
gates = new Array();
newGate(0, 6, 3, "start");
var i = 6;
while (i < 10) {
newGate(0, 3, i);
newGate(3, 6, i + 4);
i = i + 8;
}
var i = 20;
while (i < 32) {
newGate(0, 3, i);
newGate(3, 6, i + 4);
i = i + 8;
}
var i = 72;
while (i < 85) {
newGate(0, 4, i);
newGate(2, 6, i + 6);
i = i + 12;
}
var i = 105;
while (i < 120) {
newGate(0, 4, i);
newGate(2, 6, i + 5);
i = i + 10;
}
var i = 132;
while (i < 180) {
newGate(0, 3, i);
newGate(3, 6, i + 6);
i = i + 12;
}
var i = 210;
while (i < 220) {
newGate(0, 3, i);
newGate(3, 6, i + 4);
i = i + 8;
}
newGate(0, 6, 230, "finish");
}
function setGates() {
gates = new Array();
newGate(0, 6, 3, "start");
var i = 5;
while (i < 51) {
newGate(0, 3, i);
newGate(3, 6, i + 5);
i = i + 8;
}
var i = 60;
while (i < 80) {
newGate(0, 3, i);
newGate(3, 6, i + 3);
i = i + 6;
}
var i = 95;
while (i < 135) {
newGate(0, 3, i);
newGate(3, 6, i + 3);
i = i + 6;
}
var i = 145;
while (i < 195) {
newGate(0, 3, i);
newGate(3, 6, i + 3);
i = i + 6;
}
newGate(0, 6, 230, "finish");
}
function newGate(z_left, z_right, x, gateType) {
gates[x + 1] = new Gate(z_left + 1, z_right + 1, gateType);
if ((gateType == null) || (gateType == "tricks")) {
newTree(z_left, x);
newTree(z_right, x);
}
}
function setMedRocks() {
rocks = [[], [], [], [], [], [], [], []];
newRock(2, 8);
newRock(5, 14);
newRock(0, 21);
newRock(2, 21);
newRock(4, 50);
newRock(6, 49);
newRock(2, 99);
newRock(1, 100);
newRock(6, 101);
newRock(2, 150);
newRock(1, 151);
newRock(6, 149);
newRock(1, 220);
newRock(6, 219);
}
function setEasyRocks() {
rocks = [[], [], [], [], [], [], [], []];
newRock(4, 15);
newRock(0, 15);
newRock(5, 41);
newRock(7, 41);
newRock(4, 61);
newRock(1, 63);
newRock(0, 93);
}
function setRocks() {
rocks = [[], [], [], [], [], [], [], []];
newRock(3, 90);
newRock(6, 89);
newRock(0, 93);
newRock(2, 92);
newRock(4, 91);
newRock(2, 110);
newRock(3, 117);
newRock(1, 116);
newRock(6, 128);
newRock(2, 129);
newRock(2, 153);
newRock(0, 180);
newRock(1, 180);
}
function newRock(z, x) {
rockCount++;
var incline = terrain[x];
var slope = (incline.dy / incline.dx);
if (1 < slope) {
return(undefined);
}
rocks[z][x] = new Rock(z, x, (rockCount % 4) + 1);
}
function pan() {
if (END0 < rider.x) {
if (end == null) {
end = rider.x;
}
x = 100 - ((end * _xscale) / 100);
} else {
x = 100 - ((rider.x * _xscale) / 100);
y = 200 - ((rider.y * _yscale) / 100);
}
z = (((-rider.z) / 5) * _xscale) / 100;
render();
}
var END0 = pixels(227);
var end = null;
function display(colour, label, x, y) {
if (colour == "RED") {
_root.bb.gotoAndPlay(_root.characterSkin + "Bubble");
_root.bb.sb.trick = "MISSED";
_root.bb.sb.score = "+ 5s";
_parent.attachMovie(colour, colour, 10);
_parent.RED._x = 80;
_parent.RED._y = 25;
} else if ((colour == "GREEN") && (label != "TRICK AREA")) {
_parent.attachMovie(colour, colour, 10);
_parent[colour]._x = x;
_parent[colour]._y = y;
_parent[colour].label = label;
}
}
missedSound = new Sound();
missedSound.attachSound("buzzer");
clearedSound = new Sound();
clearedSound.attachSound("cleared");
function Vparallel() {
var theta = rider.rotation;
var Vp = ((clip.Vx * Math.cos(theta)) - (clip.Vz * Math.sin(theta)));
return(Vp);
}
function Vnormal() {
var theta = rider.rotation;
var Vn = ((clip.Vx * Math.sin(theta)) + (clip.Vz * Math.cos(theta)));
return(Vn);
}
function drawTrail() {
if (!clip.onGround) {
return(undefined);
}
tracks.N = tracks.N + 2;
tracks.attachMovie("line0", "line" + tracks.N, tracks.N);
tracks.attachMovie("line1", "line" + (tracks.N + 1), tracks.N + 1);
var line0 = tracks["line" + tracks.N];
var line1 = tracks["line" + (tracks.N + 1)];
line0._x = clip._x + clip.trailWidth;
line0._y = clip._y - clip.trailWidth;
line1._x = clip._x - clip.trailWidth;
line1._y = clip._y + clip.trailWidth;
var dx = (0.707 * (clip.Vx + clip.Vz));
var dy = ((0.866 * clip.Vy) + ((0.707 * (clip.Vx - clip.Vz)) / 2));
line0._xscale = (line1._xscale = dx);
line0._yscale = (line1._yscale = dy);
}
function drawParticles() {
if ((rider.state == "FALL") && (rider.onGround)) {
drawFallSnow();
return(undefined);
}
var Vn = Vnormal();
if ((!rider.onGround) || (Math.abs(Vn) < particle.Vn)) {
carveSound.gotoAndStop(1);
return(undefined);
}
particle.setDepth();
particle.N = particle.setN();
snow.attachMovie("cluster", "cluster" + particle.N, particle.N);
var thisParticle = snow["cluster" + particle.N];
thisParticle.Vx = (2 * Vn) * Math.abs(Math.sin(rider.rotation));
thisParticle.Vz = rider.Vz + (Vn / 2);
thisParticle.Vy = 0;
thisParticle.x = (rider.x + (15 * Math.cos(rider.rotation))) + (5 * Math.random());
thisParticle.z = ((rider.z - (15 * Math.sin(rider.rotation))) + (6 * Math.random())) - 3;
thisParticle.y = rider.y + rider.Vy;
thisParticle._xscale = 90 + (2 * Math.abs(thisParticle.Vx));
thisParticle._yscale = thisParticle._xscale;
carveSound.play();
}
function drawFallSnow() {
carveSound.gotoAndStop(1);
var V = (((rider.Vx * rider.Vx) + (rider.Vy * rider.Vy)) + (rider.Vz * rider.Vz));
if (V < 25) {
return(undefined);
}
snow.swapDepths(rider.depth + 1);
particle.N = particle.setN();
snow.attachMovie("cluster", "cluster" + particle.N, particle.N);
var thisSnow = snow["cluster" + particle.N];
var R = Math.sqrt((rider.dx * rider.dx) + (rider.dy * rider.dy));
thisSnow.x = rider.x + 30;
thisSnow.y = rider.y + 30;
thisSnow.z = rider.z;
}
attachMovie("blank", "snow", rider.depth + 1);
particle = new Object();
particle.active = false;
particle.N = 0;
particle.M = 100;
particle.Vn = 6;
particle.setDepth = function () {
var depth;
depth = rider.depth + 1;
snow.swapDepths(depth);
};
particle.setN = function () {
var nextN = ((this.N % this.M) + 1);
return(nextN);
};
function init() {
setTrees();
if (_parent.selectedRun == "easy") {
setEasyTerrain();
setEasyGates();
setEasyRocks();
} else if (_parent.selectedRun == "med") {
setMedTerrain();
setMedGates();
setMedRocks();
} else {
setTerrain();
setGates();
setRocks();
}
clip.x = 0;
clip.y = 2 * clip.x;
clip.z = 400;
clip.Vx = 0;
clip.Vy = 0;
clip.Vz = 0;
clip.rotation = 0;
clip.trailWidth = 5;
clip.onGround = true;
_parent.timer.stop();
_parent.timer.frames = 0;
_parent.timer.time = "00:00:00";
end = null;
}
init();
function alertTrick(trick) {
_parent.trickAlert.gotoAndPlay(trick);
}
function drawImprint(frameLabel) {
tracks.N++;
tracks.attachMovie("imprint", "imprint" + tracks.N, tracks.N);
var pointer = tracks["imprint" + tracks.N];
pointer._x = rider._x;
pointer._y = rider._y;
pointer.gotoAndStop(frameLabel);
}
function actions() {
var actionCode;
if (rider.state == "FALL") {
return(undefined);
}
if (rider.onGround) {
actionCode = "G" + keys();
} else {
actionCode = "A" + keys();
}
rider[actionCode]();
}
function keys() {
var keyCode;
keyCode = "";
if (Key.isDown(32)) {
keyCode = keyCode + 32;
}
if (Key.isDown(16)) {
keyCode = keyCode + 16;
}
var i = 37;
while (i < 41) {
if (Key.isDown(i)) {
keyCode = keyCode + i;
}
i++;
}
return(keyCode);
}
function increaseTrickValue(value) {
trickValue = (trickValue * 2) + value;
}
function addTrickPoints(currentState) {
_parent.displayTricks();
_parent.timer.frames = Math.max(0, _parent.timer.frames - (20 * trickValue));
}
rider.rotate = function (angle, delay) {
var da;
da = radians(angle) - rotation;
rotation = rotation + (da / delay);
pos();
};
rider.pos = function () {
var angle;
var frame;
angle = Math.round((rotation * 19) / Math.PI);
frame = 10 - angle;
frame = Math.max(frame, firstframe);
body.gotoAndStop(frame);
};
rider.fall = function () {
if (state == "FALL") {
return(undefined);
}
state = "FALL";
trailWidth = 12;
shadow._visible = false;
rotation = radians(90);
body.gotoAndPlay("fall");
};
rider.bend = function () {
if (state == "BEND") {
return(undefined);
}
rotate(0, 3);
if (Math.abs(rotation) < radians(5)) {
state = "BEND";
rotation = 0;
body.gotoAndPlay("bend");
}
};
rider.extend = function () {
if (state != "BEND") {
return(undefined);
}
state = null;
rotation = 0;
body.gotoAndPlay("EXTEND");
if (onGround) {
Vy = Vy - 10;
}
};
rider.land = function () {
if (state != null) {
_parent.trickValue = 0;
fall();
}
if (state == "FALL") {
_parent.trickValue = 0;
_parent.trickCombo = [];
body.gotoAndPlay("snap");
return(undefined);
}
if (0 < _parent.trickValue) {
_parent.addTrickPoints(currState);
}
_parent.trickValue = 0;
if (Math.abs(rotation) < radians(5)) {
state = "LAND";
rotation = 0;
body.gotoAndPlay("land");
return(undefined);
}
state = null;
};
rider.flip = function () {
if (onGround || (state != null)) {
return(undefined);
}
state = "FLIP";
currState = state;
rotation = 0;
body.gotoAndPlay("flip");
_parent._parent.trickCombo.push({trick:"FLIP", point:2});
_parent.increaseTrickValue(2);
};
rider.method = function () {
if (onGround || (state != null)) {
return(undefined);
}
state = "METHOD";
currState = state;
rotation = 0;
body.gotoAndPlay("method");
_parent.increaseTrickValue(1);
_parent._parent.trickCombo.push({trick:"METHOD", point:1});
};
rider.spin = function () {
if (onGround || (state != null)) {
return(undefined);
}
state = "SPIN";
currState = state;
rotation = 0;
body.gotoAndPlay("spin");
_parent.increaseTrickValue(2);
_parent._parent.trickCombo.push({trick:"SPIN", point:2});
};
rider.grab = function () {
if (onGround || (state != null)) {
return(undefined);
}
state = "GRAB";
currState = state;
rotation = 0;
body.gotoAndPlay("grab");
_parent.increaseTrickValue(1);
_parent._parent.trickCombo.push({trick:"GRAB", point:1});
};
rider.shifty = function () {
if (onGround || (state != null)) {
return(undefined);
}
state = "SHIFTY";
currState = state;
rotation = 0;
body.gotoAndPlay("shifty");
_parent.increaseTrickValue(2);
_parent._parent.trickCombo.push({trick:"SHIFTY", point:2});
};
rider.carve = function () {
if (onGround || (state != null)) {
return(undefined);
}
state = "CARVE";
currState = state;
rotation = 0;
body.gotoAndPlay("CARVE");
_parent.increaseTrickValue(2);
};
rider.unMethod = function () {
if (state == "METHOD") {
body.play();
}
};
rider.unGrab = function () {
if (state == "GRAB") {
body.play();
}
};
rider.unShifty = function () {
if (state == "SHIFTY") {
body.play();
}
};
rider.G37 = (rider.A37 = function () {
if (state == null) {
rotate(90, 10);
}
});
rider.G39 = (rider.A39 = function () {
if (state == null) {
rotate(-90, 10);
}
});
rider.G = function () {
if (state == null) {
rotate(0, 10);
}
};
rider.G32 = rider.bend;
rider.A3237 = rider.grab;
rider.A3238 = rider.flip;
rider.A3239 = rider.spin;
rider.A3240 = rider.method;
rider.A3216 = rider.shifty;
rider.keyUp32 = rider.extend;
rider.keyUp40 = rider.unMethod;
rider.keyUp37 = rider.unGrab;
Symbol 336 MovieClip Frame 1
ms = (5 * frames) % 100;
if (ms == 0) {
ms = ms + "0";
} else if (ms < 10) {
ms = "0" + ms;
}
s = Math.floor(frames / 20) % 60;
if (s < 10) {
s = "0" + s;
}
m = Math.floor(frames / 1200);
if (m < 10) {
m = "0" + m;
}
time = (((m + ":") + s) + ":") + ms;
frames++;
trickTotal = 0;
Symbol 349 Button
on (release) {
if ((txt_username != null) && (txt_username != "")) {
_root.actualTime = time;
_root.finalTime = _parent.timer.frames * 5;
_root.txt_username = txt_username;
_root.gotoAndPlay("postScore");
}
}
Symbol 353 Button
on (release) {
_parent.gotoAndStop("runSelect");
}
Symbol 354 MovieClip Frame 1
time = _parent.timer.time;
Symbol 354 MovieClip Frame 89
_parent.nextFrame();
stop();