Frame 1
protect = 0;
function collectKeys() {
k1 = (k2 = (kUp = (kDown = (kLeft = (kRight = (kSpace = false))))));
if (Key.isDown(38)) {
kUp = true;
}
if (Key.isDown(40)) {
kDown = true;
}
if (Key.isDown(39)) {
kRight = true;
}
if (Key.isDown(37)) {
kLeft = true;
}
if (Key.isDown(32)) {
kSpace = true;
}
if (Key.isDown(90) || (Key.isDown(122))) {
k1 = true;
}
if (Key.isDown(88) || (Key.isDown(120))) {
k2 = true;
}
}
function quit(_frame) {
music.stop();
_root.gotoAndPlay("charSelect");
}
function toggleMusic() {
if (musicFlag) {
music.stop();
} else {
music.start(0, 999);
}
musicFlag = musicFlag == false;
}
function keyActions() {
var character = 1;
var jumpAmt = (Math.round(Math.abs(speed) / 10) + 10);
if (state == "crash") {
slowDown(1);
} else if (state == "ground") {
if (k1 && (k2)) {
doMove("seatSpin");
slowDown(6);
} else if (kSpace) {
putInAir(jumpAmt);
if (landRotation != 0) {
if ((tileNum == 2) || (tileNum == 3)) {
speed = Math.round(speed * 0.8);
} else if ((tileNum == 6) || (tileNum == 7)) {
if (Math.abs(landRotation) <= 20) {
speed = Math.round(speed * 0.8);
} else if (((speed < 0) && (tileNum == 7)) || ((speed > 0) && (tileNum == 6))) {
speed = 0;
}
}
}
} else if (kRight) {
if ((biker._currentframe != 20) && (((biker._xscale > 0) && (speed <= speedLimit)) || (speed < 0))) {
speedUp(1);
} else if ((speed == 0) && (biker._xscale < 0)) {
putInAir(jumpAmt);
doMove("spin");
} else {
slowDown(6);
}
} else if (kLeft) {
if ((biker._currentframe != 20) && (((biker._xscale < 0) && (speed >= (-1 * speedLimit))) || (speed > 0))) {
speedUp(-1);
} else if ((speed == 0) && (biker._xscale > 0)) {
putInAir(jumpAmt);
doMove("spin");
} else {
slowDown(6);
}
} else {
slowDown(6);
}
} else if ((state == "air") && (biker._currentframe < 300)) {
slowDown(24);
if (k1 && (k2)) {
doMove("seatSpin", "Seat Spin", 10);
} else if (k1) {
if (kUp) {
doMove("noHander");
} else if (kDown) {
doMove("tomahawk");
} else if (bikerDirection(1)) {
keyHoldCheck(1, 1);
doMove("peacock");
} else if (bikerDirection(-1)) {
keyHoldCheck(1, -1);
doMove("noFooter");
}
} else if (k2 && (status.life._currentframe == 1)) {
if (kUp) {
doMove(("_" add character) add "_trick1");
} else if (kDown) {
doMove(("_" add character) add "_trick2");
} else if (bikerDirection(1)) {
keyHoldCheck(2, 1);
doMove(("_" add character) add "_trick3");
} else if (bikerDirection(-1)) {
keyHoldCheck(2, -1);
doMove(("_" add character) add "_trick4");
}
} else if (kUp) {
doMove("spin");
} else if (kDown) {
doMove("barSpin");
}
var _keyHold = "";
if ((k1 && (keyHold[0] == 1)) || (k2 && (keyHold[0] == 2))) {
_keyHold = keyHold[1];
}
if (kRight && (_keyHold != "right")) {
rotation = rotation + spinFactor;
biker._rotation = biker._rotation + spinFactor;
} else if (kLeft && (_keyHold != "left")) {
rotation = rotation - spinFactor;
biker._rotation = biker._rotation - spinFactor;
}
}
return(true);
}
function bikerDirection(_dir) {
if (_dir > 0) {
if (kRight && (biker._xscale > 0)) {
return(true);
}
if (kLeft && (biker._xscale < 0)) {
return(true);
}
return(false);
}
if (kLeft && (biker._xscale > 0)) {
return(true);
}
if (kRight && (biker._xscale < 0)) {
return(true);
}
return(false);
}
function keyHoldCheck(_key, _dir) {
var _keyHold = "";
if (biker._currentframe != 15) {
return(undefined);
}
if (_dir > 0) {
if (biker._xscale > 0) {
_keyHold = "right";
} else {
_keyHold = "left";
}
} else if (biker._xscale < 0) {
_keyHold = "right";
} else {
_keyHold = "left";
}
keyHold = new Array(_key, _keyHold);
}
Frame 2
function slowDown(_when) {
var test = ((landRotation != 0) && ((state != "crash") || ((tileNum != 8) && (tileNum != 9))));
if (((((frameCounter % 2) == 0) && (state != "air")) && (overSomething == false)) && (test)) {
if ((landRotation < 0) && (Math.abs(speed) < speedLimit)) {
speed--;
return(undefined);
}
if ((landRotation > 0) && (speed < speedLimit)) {
speed++;
return(undefined);
}
}
if (((frameCounter % _when) == 0) && (!test)) {
if (speed > 0) {
speed--;
} else if (speed < 0) {
speed++;
}
}
}
function speedUp(_amt) {
if (((((Math.abs(speed) < 20) && ((frameCounter % 4) == 0)) || ((Math.abs(speed) >= 20) && ((frameCounter % 2) == 0))) || ((speed > 0) && (_amt < 0))) || ((speed < 0) && (_amt > 0))) {
if ((landRotation != 0) && (speed == 0)) {
speed = speed + (landRotation / Math.abs(landRotation));
} else if ((!(((_amt < 0) && (landRotation > 0)) || ((_amt > 0) && (landRotation < 0)))) || (overSomething)) {
if (((speed + _amt) >= (-1 * speedLimit)) && ((speed + _amt) <= speedLimit)) {
speed = speed + _amt;
}
}
}
}
function putInAir(_air) {
if (state == "crash") {
biker.gotoAndStop("flail");
biker.player.gotoAndPlay(1);
} else if (biker._currentframe != 20) {
biker.gotoAndStop("fast");
}
air = _air;
state = "air";
if (_air > 0) {
landSound.start();
}
spinFactor = (Math.floor(Math.abs(speed) / 10) + 1) * 5;
if (spinFactor > 15) {
spinFactor = 15;
}
}
function handleAir() {
land = getLand();
if (((overSomething == true) && (state != "air")) && (biker._y < land)) {
putInAir(0);
overSomething = false;
}
if (state == "air") {
air = air - 1;
if (air <= 0) {
halfPipeLaunch = false;
}
if ((((biker._y - moveY) - air) > land) && (halfPipeLaunch == false)) {
if (biker._currentframe >= 300) {
state = "crash";
if (Math.abs(biker._rotation - landRotation) >= 90) {
goCrash(3, false, 0);
} else if (biker._currentframe == 300) {
if (landRotation != 0) {
biker.gotoAndStop("crash2");
} else {
biker.gotoAndStop("crash1");
}
affectLife(-2);
} else if (biker._currentframe == 330) {
biker.player.gotoAndPlay("crash");
affectLife(-2);
}
} else {
state = "ground";
if (Math.abs(biker._rotation - landRotation) >= 90) {
goCrash(3, false, 0);
} else if ((Math.abs(biker._rotation - landRotation) > 30) || ((biker._currentframe != 15) && (biker._currentframe != 20))) {
goCrash(2, false, 0);
}
if (state == "ground") {
landSound.start();
var _rot = Math.round(Math.abs(rotation) / 180);
if (_rot > 0) {
addTrick(multiple(_rot / 2) add "Flip", _rot * 100);
}
if ((biker._currentframe != 20) && ((((speed > 0) && (biker._xscale > 0)) || ((speed < 0) && (biker._xscale < 0))) || ((speed == 0) && (landRotation == 0)))) {
newMessage(message);
}
}
}
if (landRotation != 0) {
speed = speed + Math.round(air * (landRotation / -90));
if ((tileNum == 6) || (tileNum == 7)) {
halfPipeAmt = Math.round((landRotation * CONVERSION) * -70);
}
}
rotation = (air = (spinFactor = 0));
halfPipeLaunch = false;
bankHop = (hop = "");
} else {
moveY = moveY + air;
}
}
if (state != "air") {
biker._rotation = landRotation;
moveY = biker._y - land;
}
}
function getLand() {
var _land = (eval ("tile" add tile)._y - 30);
landRotation = 0;
onBuilding = false;
if (tileNum == 8) {
_land = _land + (tileOffset * 0.2);
landRotation = 10;
} else if (tileNum == 9) {
_land = _land - (tileOffset * 0.2);
landRotation = -10;
}
clouds._y = _land - 1200;
if (state == "air") {
overSomething = false;
}
var _buildLand = Math.round((eval ("tile" add tile)._y + eval ("tile" add tile).building._y) - 30);
var _busyCheck = (((((biker._currentframe == 15) || (biker._currentframe == 20)) || (biker._currentframe >= 300)) || (state != "air")) && (Math.abs(biker._rotation) <= 30));
if (((_busyCheck && (Math.abs(biker._rotation) <= 30)) && (biker._y <= _buildLand)) && (eval ("tile" add tile).building._currentframe != 1)) {
_land = _buildLand;
overSomething = (onBuilding = true);
landRotation = 0;
} else if ((((tileNum == 6) || (tileNum == 7)) && (tileOffset >= 15)) && (tileOffset <= 185)) {
_land = _land - getHalfPipeLand();
} else if ((((tileNum == 6) && (tileOffset > 185)) && (level[eval ("tile" add tile).number + 1] == 7)) || (((tileNum == 7) && (tileOffset < 15)) && (level[eval ("tile" add tile).number - 1] == 6))) {
overSomething = true;
_land = _land - 100;
} else if (((tileNum == 4) && (tileOffset >= 50)) && (tileOffset <= 150)) {
_land = _land - 70;
overSomething = true;
} else if (((tileNum == 5) && (tileOffset >= 65)) && (tileOffset <= 135)) {
_land = _land - 40;
overSomething = true;
} else if ((tileNum == 3) && (tileOffset > 75)) {
_land = _land - ((200 - tileOffset) * 0.2);
landRotation = 10;
} else if ((tileNum == 2) && (tileOffset < 125)) {
_land = _land - (tileOffset * 0.2);
landRotation = -10;
}
return(_land);
}
function getHalfPipeLand() {
var xValue = (tileOffset - 40);
if (tileNum == 6) {
if (xValue > 70) {
overSomething = true;
if (halfPipeLaunch == true) {
return(70);
}
return(100);
}
if (xValue <= 0) {
return(0);
}
landRotation = Math.round((-1 * Math.asin(xValue / 70)) / CONVERSION);
return(70 - Math.round(Math.sqrt(4900 - Math.pow(xValue, 2))));
}
if (tileNum == 7) {
if (xValue < 50) {
overSomething = true;
if (halfPipeLaunch == true) {
return(70);
}
return(100);
}
if (xValue >= 120) {
return(0);
}
xValue = 120 - xValue;
landRotation = Math.round(Math.asin(xValue / 70) / CONVERSION);
if (xValue == 0) {
return(0);
}
return(70 - Math.round(Math.sqrt(4900 - Math.pow(xValue, 2))));
}
}
Frame 3
function getMoveX() {
var enterFlag = false;
var futureTileNum = 0;
if ((state != "air") && (overSomething == false)) {
moveX = speed;
if (thruPoint(40, 1) && (tileNum == 6)) {
halfPipeAmt = (tileOffset - 40) + speed;
enterFlag = true;
} else if (thruPoint(160, -1) && (tileNum == 7)) {
halfPipeAmt = (tileOffset - 160) + speed;
enterFlag = true;
} else if ((level[eval ("tile" add tileLoop(1, tile)).number] == 6) && (thruPoint(240, 1))) {
futureTileNum = 6;
halfPipeAmt = (tileOffset + speed) - 240;
enterFlag = true;
} else if ((level[eval ("tile" add tileLoop(-1, tile)).number] == 7) && (thruPoint(-40, -1))) {
futureTileNum = 7;
halfPipeAmt = (tileOffset - -40) + speed;
enterFlag = true;
}
}
if (((state != "air") && (overSomething == false)) && (((((tileNum == 6) && (tileOffset >= 40)) && (tileOffset <= 110)) || (((tileNum == 7) && (tileOffset >= 90)) && (tileOffset <= 160))) || (enterFlag == true))) {
if (speed == 0) {
moveX = 0;
return(undefined);
}
if (enterFlag == false) {
halfPipeAmt = halfPipeAmt + speed;
}
var angle = ((halfPipeAmt / CONVERSION) / 70);
if (angle <= -90) {
moveX = 90 - tileOffset;
putInAir(Math.abs(speed));
biker._rotation = 90;
if (kLeft && (speed <= -10)) {
speed = -10;
rotation = 90;
} else {
speed = 0;
}
halfPipeLaunch = true;
return(undefined);
}
if (angle >= 90) {
moveX = 110 - tileOffset;
putInAir(Math.abs(speed));
biker._rotation = -90;
if (kRight && (speed >= 10)) {
speed = 10;
rotation = -90;
} else {
speed = 0;
}
halfPipeLaunch = true;
return(undefined);
}
var xVal = (Math.round((Math.sin(angle * CONVERSION) * 70) * 10) / 10);
if (futureTileNum == 6) {
moveX = (240 + xVal) - tileOffset;
} else if (futureTileNum == 7) {
moveX = (-40 + xVal) - tileOffset;
} else if (tileNum == 6) {
moveX = (40 + xVal) - tileOffset;
} else {
moveX = (160 + xVal) - tileOffset;
}
moveX = roundTenthsToFive(moveX);
if (((moveX / Math.abs(moveX)) != (speed / Math.abs(speed))) && (moveX != 0)) {
moveX = 0;
}
if ((tileNum == 6) && ((moveX + tileOffset) > 110)) {
moveX = 110 - tileOffset;
} else if ((tileNum == 7) && ((moveX + tileOffset) < 90)) {
moveX = 90 - tileOffset;
}
} else {
moveX = speed;
halfPipeAmt = 0;
}
}
function roundTenthsToFive(_initial) {
if (_initial == 0) {
return(0);
}
var tenths = Math.abs((_initial * 10) % 10);
var roundedTenths;
var initialWhole;
var finalAbsolute;
if ((tenths >= 0) && (tenths <= 2)) {
roundedTenths = 0;
} else if ((tenths > 2) && (tenths <= 7)) {
roundedTenths = 0.5;
} else if ((tenths > 7) && (tenths < 10)) {
roundedTenths = 1;
}
if (_initial > 0) {
initialWhole = Math.floor(_initial);
} else {
initialWhole = Math.ceil(_initial);
}
finalAbsolute = Math.abs(initialWhole) + roundedTenths;
if (finalAbsolute == undefined) {
}
return(finalAbsolute * (_initial / Math.abs(_initial)));
}
Frame 4
function moveVert(_amt) {
var endLoop = 4;
bg._y = bg._y + (_amt / 4);
if (bg._y >= 0) {
background.gotoAndStop(1);
} else if (bg._y <= -80) {
background.gotoAndStop(2);
}
var i = 0;
while (i < endLoop) {
eval ("tile" + i)._y = eval ("tile" + i)._y + _amt;
i++;
}
}
function moveHor(_amt) {
var leftBound = 0;
var leftBoundNumber;
var rightBound;
var rightBoundNumber;
var leftTile;
var rightTile;
var tileAmount;
var xAdjust;
var yAdjust;
leftBoundNumber = -20;
rightBoundNumber = level.length + 19;
rightBound = 199;
tileAmount = 4;
xAdjust = 1;
yAdjust = 1;
leftTile = (rightTile = tile);
if ((eval ("tile" add leftTile).number <= leftBoundNumber) && ((_amt + tileOffset) < leftBound)) {
_amt = -tileOffset;
speed = 0;
} else if ((eval ("tile" add rightTile).number >= rightBoundNumber) && ((_amt + tileOffset) > rightBound)) {
_amt = rightBound - tileOffset;
speed = 0;
}
leftBound = -260;
rightBound = 0;
if ((eval ("tile" add firstTile)._x - _amt) > rightBound) {
drawTile(tileLoop(-1, firstTile, tileAmount), eval ("tile" + tileLoop(-1, firstTile, tileAmount)).number - tileAmount, -1);
eval ("tile" add tileLoop(-1, firstTile, tileAmount))._x = eval ("tile" add firstTile)._x - (200 / xAdjust);
eval ("tile" add tileLoop(-1, firstTile, tileAmount))._y = eval ("tile" add firstTile)._y;
firstTile = tileLoop(-1, firstTile, tileAmount);
if (level[eval ("tile" add firstTile).number] == 8) {
eval ("tile" add firstTile)._y = eval ("tile" add firstTile)._y - (40 / yAdjust);
} else if (level[eval ("tile" add firstTile).number] == 9) {
eval ("tile" add firstTile)._y = eval ("tile" add firstTile)._y + (40 / yAdjust);
}
} else if ((eval ("tile" add firstTile)._x - _amt) <= leftBound) {
firstTile = tileLoop(1, firstTile, tileAmount);
drawTile(tileLoop(-1, firstTile, tileAmount), eval ("tile" + tileLoop(-1, firstTile, tileAmount)).number + tileAmount, 1);
eval ("tile" + tileLoop(-1, firstTile, tileAmount))._x = eval ("tile" + tileLoop(-1, firstTile, tileAmount))._x + ((200 / xAdjust) * tileAmount);
eval ("tile" + tileLoop(-1, firstTile, tileAmount))._y = eval ("tile" + tileLoop(-2, firstTile, tileAmount))._y;
if (level[eval ("tile" add tileLoop(-2, firstTile, tileAmount)).number] == 8) {
eval ("tile" add tileLoop(-1, firstTile, tileAmount))._y = eval ("tile" add tileLoop(-1, firstTile, tileAmount))._y + (40 / yAdjust);
} else if (level[eval ("tile" add tileLoop(-2, firstTile, tileAmount)).number] == 9) {
eval ("tile" add tileLoop(-1, firstTile, tileAmount))._y = eval ("tile" add tileLoop(-1, firstTile, tileAmount))._y - (40 / yAdjust);
}
}
eval ("tile" add firstTile)._x = eval ("tile" add firstTile)._x - _amt;
var looper = 1;
while (looper < tileAmount) {
eval ("tile" add tileLoop(looper, firstTile, tileAmount))._x = eval ("tile" add firstTile)._x + ((200 / xAdjust) * looper);
looper++;
}
setTileOffset(_amt);
var pos = (bg._x - (_amt / 10));
var width = (bg._width / 2);
if (pos < (-width)) {
bg._x = pos + width;
} else if (pos > 0) {
bg._x = pos - width;
} else {
bg._x = pos;
}
pos = clouds._x - _amt;
width = clouds._width / 2;
if (pos < (-width)) {
clouds._x = pos + width;
} else if (pos > 0) {
clouds._x = pos - width;
} else {
clouds._x = pos;
}
}
function setTileOffset(_move) {
var xAdjust = 1;
var tileAmount = 4;
tileOffset = tileOffset + _move;
var flag = true;
while (flag) {
flag = false;
if (tileOffset >= (200 / xAdjust)) {
tile = tileLoop(1, tile, tileAmount);
tileOffset = tileOffset - (200 / xAdjust);
flag = true;
} else if (tileOffset < 0) {
tile = tileLoop(-1, tile, tileAmount);
tileOffset = tileOffset + (200 / xAdjust);
flag = true;
}
}
tileNum = level[eval ("tile" add tile).number];
}
function tileLoop(_num, _from, _howMany) {
if (_howMany == undefined) {
_howMany = 4;
}
_num = _num + _from;
if (_num > (_howMany - 1)) {
_num = _num - _howMany;
} else if (_num < 0) {
_num = _num + _howMany;
}
return(_num);
}
Frame 5
function drawTile(_number, _index, _position) {
var frame;
var tileAmount = 4;
if (((level.length - 1) < _index) || (_index < 0)) {
frame = 1;
} else {
frame = level[_index];
}
if ((frame == 6) && (level[_index + 1] == 7)) {
frame = 10;
} else if ((frame == 7) && (level[_index - 1] == 6)) {
frame = 11;
}
eval ("tile" add _number).gotoAndStop(frame);
eval ("tile" add _number).number = _index;
frame = buildFrame(_index);
eval (("tile" add _number) add ".building").gotoAndStop(frame);
if (frame == "none") {
eval ("tile" add _number).building._y = 0;
} else {
eval ("tile" add _number).building._y = -180 - (build[_index] * 20);
}
if (level[_index] == 8) {
eval ("tile" add _number).building._y = eval ("tile" add _number).building._y + 40;
}
var _color = 0;
if (_index == 0) {
_position = 0;
}
if (_position > 0) {
_color = eval ("tile" add tileLoop(-1, _number, tileAmount)).color;
if ((frame == "left") || (frame == "single")) {
_color = tileLoop(1, _color, 4);
}
} else if (_position < 0) {
_color = eval ("tile" add tileLoop(1, _number, tileAmount)).color;
var nextBuildFrame = eval ("tile" add tileLoop(1, _number, tileAmount)).building._currentframe;
if ((nextBuildFrame == 2) || (nextBuildFrame == 5)) {
_color = tileLoop(-1, _color, 4);
}
}
eval ("tile" add _number).color = _color;
if (frame != "none") {
eval ("tile" add _number).building.b.gotoAndStop(_color + 1);
}
eval ("tile" add _number).door._y = 20;
if ((((((level[_index] != 4) && (level[_index] != 5)) && ((_index % 4) == 0)) && (frame != "none")) && ((_color != 3) || (frame == "single"))) && ((build[_index] != 1) || (level[_index] != 9))) {
if ((level[_index] == 9) || ((build[_index] >= 3) && (level[_index] != 8))) {
eval (("tile" add _number) add ".door")._y = eval (("tile" add _number) add ".door")._y - 40;
}
eval ("tile" add _number).door.gotoAndStop(3);
} else {
eval ("tile" add _number).door.gotoAndStop(1);
}
}
function buildFrame(_index) {
var frame;
var left_b;
var right_b;
if ((((build.length - 1) < _index) || (_index < 0)) || (build[_index] == 0)) {
frame = "none";
} else {
left_b = build[_index - 1];
if (left_b != 0) {
if (level[_index] == 8) {
left_b = left_b + 2;
}
if (level[_index - 1] == 9) {
left_b = left_b - 2;
}
}
right_b = build[_index + 1];
if (right_b != 0) {
if (level[_index + 1] == 8) {
right_b = right_b - 2;
}
if (level[_index] == 9) {
right_b = right_b + 2;
}
}
if ((right_b == build[_index]) && (left_b == build[_index])) {
frame = "middle";
} else if (right_b == build[_index]) {
frame = "left";
} else if (left_b == build[_index]) {
frame = "right";
} else {
frame = "single";
}
}
return(frame);
}
function goCrash(_num, _wall, _xPos) {
var _crash = 0;
if (_wall == true) {
if ((state == "ground") && (Math.abs(speed) >= 20)) {
state = "crash";
biker.gotoAndStop("crash" add _num);
_crash = -1;
} else if (((state == "air") && (Math.abs(speed) >= 15)) && (biker._currentframe < 300)) {
biker.gotoAndStop("wallcrash");
_crash = -1;
}
moveX = _xpos - tileOffset;
((speed < 0) ? ((moveX = moveX + 1)) : ((moveX = moveX - 1)));
air = (speed = 0);
} else {
state = "crash";
biker.gotoAndStop("crash" add _num);
_crash = -2;
}
if (_crash < 0) {
message = new Array();
trickScore = 0;
affectLife(_crash);
}
}
function peddle() {
if (biker._currentframe != 20) {
if (state == "ground") {
if (Math.abs(speed) >= 20) {
biker.gotoAndStop("fast");
} else if ((((Math.abs(speed) > 0) || (landRotation != 0)) || (kRight)) || (kLeft)) {
biker.gotoAndStop("slow");
} else {
biker.gotoAndStop("stopped");
}
if (((biker._xscale > 0) && (kRight)) || (kLeft && (biker._xscale < 0))) {
biker.ani.play();
} else {
biker.ani.stop();
}
} else {
biker.ani.stop();
}
}
}
function doMove(_move, _trickName, _score) {
if ((biker._currentframe == 15) || ((_move == "seatSpin") && (state == "ground"))) {
biker.gotoAndStop(_move);
if (_trickName != undefined) {
addTrick(_trickName, _score);
}
}
}
Frame 6
function handleObstacles() {
var _bankHop = bankHop;
var groundLand = (eval ("tile" add tile)._y - 30);
var nextLand = (eval ("tile" add tileLoop(1, tile))._y - 30);
var prevLand = (eval ("tile" add tileLoop(-1, tile))._y - 30);
var nextBuildLand = (nextLand + eval ("tile" add tileLoop(1, tile)).building._y);
var prevBuildLand = (prevLand + eval ("tile" add tileLoop(-1, tile)).building._y);
var nextBuild = eval ("tile" add tileLoop(1, tile)).building._currentframe;
var prevBuild = eval ("tile" add tileLoop(-1, tile)).building._currentframe;
if (state == "air") {
if ((thruPoint(0, -1) && ((eval ("tile" add tile).building._currentframe == 2) || (eval ("tile" add tile).building._currentframe == 5))) || (thruPoint(200, 1) && ((eval ("tile" add tile).building._currentframe == 4) || (eval ("tile" add tile).building._currentframe == 5)))) {
checkHop("");
}
if ((thruPoint(200, 1) && ((nextBuild == 2) || (nextBuild == 5))) && (biker._y < nextBuildLand)) {
checkHop("left");
} else if ((thruPoint(0, -1) && ((prevBuild == 4) || (prevBuild == 5))) && (biker._y < prevBuildLand)) {
checkHop("right");
}
}
if (onBuilding) {
return(undefined);
}
var landAllowance = 10;
if (tileNum == 2) {
if (thruPoint(125, -1)) {
if (biker._y > (groundLand - 25)) {
goCrash(1, true, 125);
} else {
_bankHop = "";
}
} else if (thruPoint(125, 1) && (biker._currentframe < 300)) {
_bankHop = "left";
}
} else if (tileNum == 3) {
if (thruPoint(75, 1)) {
if (biker._y > (land - 25)) {
goCrash(1, true, 75);
} else {
_bankHop = "";
}
} else if (thruPoint(75, -1) && (biker._currentframe < 300)) {
_bankHop = "right";
}
} else if (tileNum == 4) {
if (biker._y > (groundLand - 65)) {
if (thruPoint(50, 1)) {
goCrash(1, true, 50);
} else if (thruPoint(150, -1)) {
goCrash(1, true, 150);
}
} else if (thruPoint(50, 1) || (thruPoint(150, -1))) {
checkHop("mailbox");
} else if (thruPoint(50, -1) || (thruPoint(150, 1))) {
checkHop("");
}
} else if (tileNum == 5) {
if (biker._y > (groundLand - 35)) {
if (thruPoint(65, 1)) {
goCrash(1, true, 65);
} else if (thruPoint(135, -1)) {
goCrash(1, true, 135);
}
} else if (thruPoint(65, 1) || (thruPoint(135, -1))) {
checkHop("hydrant");
} else if (thruPoint(65, -1) || (thruPoint(135, 1))) {
checkHop("");
}
} else if ((tileNum == 6) && (biker._y > (groundLand - 100))) {
if ((thruPoint(110, 1) && (halfPipeLaunch == false)) && (state == "air")) {
goCrash(2, true, 110);
} else if (thruPoint(185, -1) && (biker._y > ((groundLand - 100) + landAllowance))) {
goCrash(1, true, 185);
}
} else if ((tileNum == 7) && (biker._y > (groundLand - 100))) {
if ((thruPoint(90, -1) && (halfPipeLaunch == false)) && (state == "air")) {
goCrash(2, true, 90);
} else if (thruPoint(15, 1) && (biker._y > ((groundLand - 100) + landAllowance))) {
goCrash(1, true, 15);
}
} else if ((level[eval ("tile" add tileLoop(1, tile)).number] == 7) && (biker._y > ((nextLand - 100) + landAllowance))) {
if (thruPoint(215, 1)) {
goCrash(1, true, 215);
}
} else if ((level[eval ("tile" add tileLoop(-1, tile)).number] == 6) && (biker._y > ((prevLand - 100) + landAllowance))) {
if (thruPoint(-15, -1)) {
goCrash(1, true, -15);
}
}
if (((bankHop == "left") || (bankHop == "right")) && (_bankHop == "")) {
addTrick("Bank2Bank", 500);
}
bankHop = _bankHop;
}
function thruPoint(_point, _dir) {
if (_dir < 0) {
return((tileOffset > _point) && ((tileOffset + moveX) <= _point));
}
if (_dir > 0) {
return((tileOffset < _point) && ((tileOffset + moveX) >= _point));
}
}
function launch() {
if ((state != "air") && (overSomething == false)) {
if ((thruPoint(75, -1) && (tileNum == 3)) || (thruPoint(125, 1) && (tileNum == 2))) {
putInAir(Math.round(Math.abs(speed) / 3));
}
}
}
Frame 7
function speedToMPH(_speed) {
ret = _speed / 2;
((ret < 0) ? ((ret = Math.floor(ret))) : ((ret = Math.ceil(ret))));
return(Math.abs(ret));
}
function addTrick(_msg, _score, _times) {
var extra;
if (_times != undefined) {
extra = Math.round(_times / 8) + 1;
if (extra > 1) {
_score = _score * extra;
} else {
extra = 1;
}
} else {
extra = 1;
}
var i = 0;
while (i < extra) {
message.push(_msg);
i++;
}
trickScore = trickScore + _score;
}
function checkHop(_hop) {
if (biker._currentframe > 300) {
return(undefined);
}
if ((hop == "hydrant") && (_hop != "hydrant")) {
addTrick("Hydrant Hop", 100);
} else if ((hop == "mailbox") && (_hop != "mailbox")) {
addTrick("Postal Hop", 500);
} else if (((hop == "left") && (_hop != "left")) || ((hop == "right") && (_hop != "right"))) {
addTrick("Building Hop", 2000);
}
hop = _hop;
}
function affectLife(_amt) {
if ((status.life._currentframe - _amt) < 1) {
status.life.gotoAndStop(1);
} else if ((status.life._currentframe - _amt) > 5) {
status.life.gotoAndStop(5);
} else {
status.life.gotoAndStop(status.life._currentframe - _amt);
}
}
function multiple(_amt) {
switch (_amt) {
case 0.5 :
return("Half ");
case 1 :
return("");
case 2 :
return("Double ");
case 3 :
return("Triple ");
case 4 :
return("Quad ");
case 5 :
return("Quint ");
}
return((_amt * 180) add " ");
}
function newMessage(_msg) {
if (message.length != 0) {
var i = 0;
while (i < (message.length - 1)) {
var j = (i + 1);
while (j < message.length) {
if (message[j] != message[i]) {
break;
}
j++;
}
if ((j - 1) > i) {
message.splice(i, j - i, ((j - i) add "x ") add message[i]);
}
i++;
}
var _msg;
var _bonus = ((message.length - 1) * 1000);
if (_bonus > trickScore) {
_bonus = Math.floor(trickScore / 1000) * 1000;
}
_msg = (message.join(" + ") add newline) add trickScore;
if (_bonus > 0) {
_msg = _msg + (" + " add _bonus);
}
_msg = _msg + " points";
trickScore = trickScore + _bonus;
if (trickScore >= 20000) {
status.trickCombos.gotoAndPlay("highscore");
_msg = _msg + "!!!";
} else {
status.trickCombos.gotoAndPlay(2);
}
status.trickCombos.message = _msg;
if (status.timeDisplay._currentframe == 1) {
score = score + trickScore;
if (((score > 100000) && (secrets[5 + levelNumber] == 0)) && (levelNumber != 0)) {
if (maxLevel < 5) {
status.unlockLevel.gotoAndPlay(2);
} else {
status.unlock.gotoAndPlay(2);
}
secrets[5 + levelNumber] = 1;
}
}
trickScore = 0;
message = new Array();
affectLife(1);
}
}
Frame 8
function init(_mode) {
level = new Array(6, 7, 1, 1, 1, 8, 8, 1, 1, 1, 1, 2, 5, 3, 1, 1, 1, 8, 8, 1, 1, 1, 1, 6, 7);
build = new Array(5, 5, 5, 5, 5, 0, 0, 7, 7, 7, 0, 5, 5, 5, 0, 2, 2, 4, 6, 0, 7, 7, 7, 7, 7);
gameMode = "platform";
air = (speed = (spinFactor = (moveX = (moveY = 0))));
state = "ground";
firstTile = 0;
frameCounter = 0;
overSomething = (onBuilding = false);
landRotation = 0;
halfPipeLaunch = false;
halfPipeAmt = 0;
rotation = (trickScore = (score = 0));
bankHop = (hop = "");
keyHold = new Array(0, "");
minutes = 3;
seconds = 0;
tileOffset = 70;
tile = 1;
speedLimit = 35;
message = new Array();
status.life.gotoAndStop(3);
repaint(true);
if (musicFlag) {
music.start(0, 999);
}
}
function repaint(_firstTime) {
var tileAmount = 4;
var draw_y = 0;
var thisTile = 0;
var yAdjust = 1;
var xAdjust = 1;
var xStart = 0;
var yStart = 230;
while (true) {
if (((level[thisTile + tile] == 1) || (level[thisTile + tile] == 8)) || (level[thisTile + tile] == 9)) {
break;
}
thisTile = thisTile + 1;
}
var i = 0;
while (i < tileAmount) {
if (_firstTime) {
eval ("tile" + i).pill = new Array();
drawTile(i, thisTile + i, i);
eval ("tile" add i)._x = xStart + ((i * 200) / xAdjust);
} else {
drawTile(tileLoop(i, firstTile, tileAmount), eval ("tile" + tileLoop(i, firstTile, tileAmount)).number, 1);
}
eval ("tile" add tileLoop(i, firstTile, tileAmount))._y = yStart - ((40 / yAdjust) * draw_y);
if (level[eval ("tile" add tileLoop(thisTile + i, firstTile, tileAmount)).number] == 8) {
draw_y--;
} else if (level[eval ("tile" add tileLoop(thisTile + i, firstTile, tileAmount)).number] == 9) {
draw_y++;
}
i++;
}
}
maxCharacter = 1;
REGULAR_TRICK = 10;
SPECIAL_TRICK = 100;
CONVERSION = 0.017453;
MAX_COPIES = 500;
MAX_SPEED = 50;
landSound = new Sound();
landSound.attachSound("scuff");
landSound.setVolume(50);
music = new Sound();
music.attachSound("song");
music.setVolume(40);
musicFlag = true;
kM_hold = false;
Frame 9
stop();
Frame 12
if ((((substring(_root._url, 12, 13)) != "entropicorder") && ((substring(_root._url, 12, 10)) != "newgrounds")) && (_root.protect)) {
gotoAndStop (27);
} else {
stop();
}
Frame 20
init();
gotoAndPlay(_currentframe + 1);
Frame 21
collectKeys();
if (keyActions()) {
if (((state == "ground") && (biker._currentframe != 20)) && (((speed == 0) || ((speed > 0) && (biker._xscale > 0))) || ((speed < 0) && (biker._xscale < 0)))) {
newMessage(message);
}
moveY = (moveX = 0);
getMoveX();
launch();
handleObstacles();
moveHor(moveX);
peddle();
handleAir();
moveVert(moveY);
if (frameCounter < 24) {
frameCounter++;
} else {
frameCounter = 1;
if (seconds > 0) {
seconds--;
} else if (minutes > 0) {
seconds = 59;
minutes--;
}
}
if (((((minutes == 0) && (seconds == 0)) && (status.timeDisplay._currentframe == 1)) && (state != "air")) && (message.length == 0)) {
status.timeDisplay.gotoAndPlay(2);
}
status.speed = speedtoMPH(speed);
status.time = (minutes add ":") add ((seconds < 10) ? ("0" add seconds) : (seconds));
}
Frame 22
gotoAndPlay(_currentframe - 1);
Frame 26
gotoAndStop(_currentframe + 1);
Frame 27
stop();
Frame 28
gotoAndStop(_currentframe - 1);
Symbol 16 Button
on (release) {
getURL ("http://www.entropicorder.net", "_blank");
}
Symbol 21 MovieClip Frame 1
function onEnterFrame() {
if (!loaded) {
var percentLoaded = (_root.getBytesLoaded() / _root.getBytesTotal());
var loaderPlayed = (_currentframe / (_totalframes - 30));
if ((percentLoaded >= 1) && (loaderPlayed >= 1)) {
loaded = true;
loadingText.gotoAndStop(2);
bar._width = initW;
} else if (loaderPlayed < percentLoaded) {
bar._width = loaderPlayed * initW;
} else {
bar._width = percentLoaded * initW;
}
}
var dt = (getTimer() - time);
timeAccum = timeAccum + dt;
while (timeAccum >= FRAME_TIME) {
if ((loaderPlayed < 1) || ((_currentframe < _totalframes) && (loaded))) {
nextFrame();
}
timeAccum = timeAccum - FRAME_TIME;
}
time = time + dt;
}
stop();
var initW = bar._width;
bar._width = 0.5;
var time = getTimer();
var FRAME_TIME = 83.3333333333333;
var timeAccum = 0;
var loaded = false;
Symbol 21 MovieClip Frame 25
stop();
Symbol 21 MovieClip Frame 55
_root.gotoAndPlay("charSelect");
Symbol 42 Button
on (release) {
option = "play";
bar.play();
}
Symbol 45 Button
on (release) {
if (_currentframe != 10) {
gotoAndStop (10);
option = "SELECT PLAYER";
bar.play();
}
}
Symbol 47 Button
on (release) {
if (_currentframe != 5) {
gotoAndStop (5);
option = "SELECT COURSE";
bar.play();
}
}
Symbol 49 Button
on (release) {
getURL ("http://www.entropicorder.net/games/sik-trix-bmx.php", "_blank");
}
Symbol 51 Button
on (release) {
if (_currentframe != 15) {
gotoAndStop (15);
option = "HELP";
bar.play();
}
}
Symbol 57 MovieClip Frame 1
if (_parent.option == "") {
stop();
}
Symbol 57 MovieClip Frame 2
option = _parent.option;
if ((option == "play") || (option == "editor")) {
_root.gotoAndPlay(option);
}
Symbol 57 MovieClip Frame 6
if ((_parent.option != "") && (_parent.option == option)) {
stop();
}
Symbol 80 Button
on (release) {
if (selectHead._currentframe == 13) {
selectHead.gotoAndStop(1);
} else {
selectHead.nextFrame();
}
if (selectHead._currentframe > _root.maxCharacter) {
gotoAndStop (2);
} else {
gotoAndStop (1);
}
}
Symbol 86 Button
on (release) {
if (selectHead._currentframe == 1) {
selectHead.gotoAndStop(13);
} else {
selectHead.prevFrame();
}
if (selectHead._currentframe > _root.maxCharacter) {
gotoAndStop (2);
} else {
gotoAndStop (1);
}
}
Symbol 104 MovieClip Frame 1
stop();
Symbol 108 MovieClip Frame 1
stop();
Symbol 118 MovieClip Frame 1
option = "";
stop();
Symbol 118 MovieClip Frame 10
selector.selectHead.gotoAndStop(1);
Symbol 121 MovieClip Frame 1
stop();
Symbol 139 MovieClip Frame 1
stop();
Symbol 151 MovieClip Frame 1
stop();
Symbol 155 MovieClip Frame 1
stop();
Symbol 156 MovieClip Frame 1
stop();
Symbol 160 MovieClip Frame 1
stop();
Symbol 171 MovieClip Frame 1
stop();
Symbol 179 MovieClip Frame 1
Symbol 181 MovieClip Frame 1
Symbol 193 MovieClip Frame 1
Symbol 202 MovieClip Frame 1
_root.addTrick("Seat Spin", _parent._parent.REGULAR_TRICK);
Symbol 202 MovieClip Frame 12
if (!(_parent._parent.k1 && (_parent._parent.k2))) {
gotoAndPlay (11);
}
Symbol 202 MovieClip Frame 23
_parent.gotoAndStop("fast");
Symbol 203 MovieClip Frame 1
counter = 0;
Symbol 203 MovieClip Frame 6
if (_parent._parent.kUp && (_parent._parent.k1)) {
gotoAndPlay(_currentframe - 1);
counter++;
}
Symbol 203 MovieClip Frame 11
_root.addTrick("No Hander", _parent._parent.REGULAR_TRICK * (_totalframes - 1), counter);
_parent.gotoAndStop("fast");
Symbol 204 MovieClip Frame 1
counter = 0;
Symbol 204 MovieClip Frame 6
if (_parent._parent.bikerDirection(-1) && (_parent._parent.k1)) {
gotoAndPlay (5);
counter++;
}
Symbol 204 MovieClip Frame 11
_root.addTrick("Superman", _root.REGULAR_TRICK * (_totalframes - 1), counter);
_parent.gotoAndStop("fast");
Symbol 205 MovieClip Frame 1
counter = 0;
Symbol 205 MovieClip Frame 6
if (_parent._parent.kDown && (_parent._parent.k1)) {
gotoAndPlay (5);
counter++;
}
Symbol 205 MovieClip Frame 9
_root.addTrick("Tomahawk", _root.REGULAR_TRICK * (_totalframes - 1), counter);
_parent.gotoAndStop("fast");
Symbol 209 MovieClip Frame 1
if (_parent._xscale < 0) {
gotoAndPlay (7);
}
Symbol 209 MovieClip Frame 6
_parent._xscale = _parent._xscale * -1;
if (_parent._parent.kUp) {
play();
counter = counter + 5;
} else {
_root.addTrick("Spin", _root.REGULAR_TRICK, counter);
_parent.gotoAndStop("fast");
}
Symbol 209 MovieClip Frame 12
call(6);
Symbol 210 MovieClip Frame 1
counter = 0;
Symbol 210 MovieClip Frame 8
if (_parent._parent.bikerDirection(1) && (_parent._parent.k1)) {
gotoAndPlay (7);
counter++;
}
Symbol 210 MovieClip Frame 14
_root.addTrick("Peacock", _root.REGULAR_TRICK * (_totalframes - 1), counter);
_parent.gotoAndStop("fast");
Symbol 212 MovieClip Frame 1
counter = 0;
Symbol 212 MovieClip Frame 15
if (_parent._parent.kDown) {
gotoAndPlay (5);
counter = counter + 10;
}
Symbol 212 MovieClip Frame 20
_root.addTrick("Bar Spin", _root.REGULAR_TRICK * (_totalframes - 1), counter);
_parent.gotoAndStop("fast");
Symbol 213 MovieClip Frame 22
_root.addTrick("Flipster", _root.SPECIAL_TRICK * (_totalframes - 1));
_parent.gotoAndStop("fast");
Symbol 214 MovieClip Frame 44
_root.addTrick("Black Hole", _root.SPECIAL_TRICK * (_totalframes - 1));
_parent.gotoAndStop("fast");
Symbol 216 MovieClip Frame 1
counter = 0;
Symbol 216 MovieClip Frame 28
if (_parent._parent.bikerDirection(1) && (_parent._parent.k2)) {
counter = counter + 8;
gotoAndPlay (20);
}
Symbol 216 MovieClip Frame 34
_root.addTrick("Drill Bit", _root.SPECIAL_TRICK * (_totalframes - 1), counter);
_parent.gotoAndStop("fast");
Symbol 218 MovieClip Frame 21
_parent._xscale = _parent._xscale * -1;
Symbol 218 MovieClip Frame 25
_root.addTrick("Big Spin", _root.SPECIAL_TRICK * (_totalframes - 1));
_parent.gotoAndStop("fast");
Symbol 222 MovieClip Frame 1
wait = 10;
Symbol 222 MovieClip Frame 29
if (((Math.abs(_root.speed) > 0) || ((--wait) > 0)) || (((_root.landRotation != 0) && (_root.tileNum != 8)) && (_root.tileNum != 9))) {
gotoAndPlay(_currentframe - 1);
}
Symbol 222 MovieClip Frame 99
_parent._xscale = _parent._xscale * -1;
_parent.gotoAndStop(1);
Symbol 228 MovieClip Frame 1
wait = 15;
Symbol 228 MovieClip Frame 26
if (((Math.abs(_root.speed) > 0) || ((--wait) > 0)) || (((_root.landRotation != 0) && (_root.tileNum != 8)) && (_root.tileNum != 9))) {
gotoAndPlay(_currentframe - 1);
}
Symbol 228 MovieClip Frame 54
_parent.gotoAndStop(1);
Symbol 229 MovieClip Frame 1
wait = 30;
Symbol 229 MovieClip Frame 20
if (((Math.abs(_root.speed) > 0) || ((--wait) > 0)) || (((_root.landRotation != 0) && (_root.tileNum != 8)) && (_root.tileNum != 9))) {
gotoAndPlay(_currentframe - 1);
}
Symbol 229 MovieClip Frame 49
tellTarget ("..") {
gotoAndStop (1);
};
Symbol 230 MovieClip Frame 13
gotoAndPlay (1);
Symbol 230 MovieClip Frame 14
wait = 20;
Symbol 230 MovieClip Frame 23
if ((((Math.abs(_root.speed) > 0) || ((--wait) > 0)) || (((_root.landRotation != 0) && (_root.tileNum != 8)) && (_root.tileNum != 9))) || (_root.state == "air")) {
gotoAndPlay(_currentframe - 1);
}
Symbol 230 MovieClip Frame 52
_parent.gotoAndStop(1);
Symbol 231 MovieClip Frame 1
stop();
_parent.state = "ground";
_parent.keyHold = new Array(0, "");
Symbol 231 MovieClip Frame 15
_parent.keyHold = new Array(0, "");
Symbol 231 MovieClip Frame 54
player.counter = 0;
Symbol 242 MovieClip Frame 1
stop();
Symbol 242 MovieClip Frame 44
stop();
Symbol 242 MovieClip Frame 45
play();
Symbol 253 MovieClip Frame 1
stop();
Symbol 265 MovieClip Frame 1
stop();
Symbol 265 MovieClip Frame 121
gotoAndPlay (2);
Symbol 271 Button
on (press) {
_root.quit("charselect");
}
Symbol 276 Button
on (press) {
_root.toggleMusic();
}
Symbol 277 MovieClip Frame 18
stop();
Symbol 280 Button
on (release) {
getURL ("http://www.entropicorder.net/", "_blank");
}