Frame 1
stop();
Instance of Symbol 39 MovieClip "progressbar" in Frame 1
onClipEvent (load) {
totalFileSize = _root.getBytesTotal();
startTime = getTimer();
startBytes = _root.getBytesLoaded();
this._xscale = 0;
}
onClipEvent (enterFrame) {
bytesLoaded = _root.getBytesLoaded();
amountLoaded = bytesLoaded / totalFileSize;
percentLoaded = int(100 * amountLoaded);
this._xscale = percentLoaded;
timeSoFar = getTimer() - startTime;
speed = bytesLoaded / timeSoFar;
bytesLeft = totalFileSize - bytesLoaded;
timeLeft = (bytesLeft / 1000) * (speed / 1000);
speed = int(10 * speed) / 10;
_root.bytesMessage = ((int(bytesLoaded / 1000) + "kb/") + int(totalFileSize / 1000)) + "kb";
_root.speedMessage = speed + "k/sec";
_root.timeMessage = int(timeLeft) + " seconds remaining";
if (amountLoaded >= 1) {
_root.play();
}
}
Frame 2
function randomNumber(l, h) {
var _local1 = Math.round(Math.random() * (h - l)) + l;
return(_local1);
}
function itemHandler1(obj, item) {
getURL ("http://www.orangefoxgames.com", "_blank");
}
function itemHandler2(obj, item) {
getURL ("http://www.webivia.com", "_blank");
}
function itemHandler3(obj, item) {
_quality = "HIGH";
}
function itemHandler4(obj, item) {
_quality = "MEDIUM";
}
function itemHandler5(obj, item) {
_quality = "LOW";
}
function js(z) {
return("" + int(z / 1));
}
function mkt(j) {
var _local1 = "buwencxikl";
var _local2 = "hviklfrumj";
(g = _local1.length - 1);
_local2 = "";
while (g >= 0) {
_local2 = _local2 + _local1.substr(g, 1);
g--;
}
(g = j.length - 1);
_local1 = "";
while (g >= 0) {
_local1 = _local1 + _local2.charAt(int(j.substr(g, 1)));
g--;
}
return(_local1);
}
stop();
stopAllSounds();
var myMenu = new ContextMenu();
myMenu.hideBuiltInItems();
item1 = new ContextMenuItem("Visit the OFG website", itemHandler1);
myMenu.customItems.push(item1);
item2 = new ContextMenuItem("Visit Webivia", itemHandler2);
myMenu.customItems.push(item2);
item3 = new ContextMenuItem("High quality", itemHandler3);
myMenu.customItems.push(item3);
item4 = new ContextMenuItem("Medium quality", itemHandler4);
myMenu.customItems.push(item4);
item5 = new ContextMenuItem("Low quality", itemHandler5);
myMenu.customItems.push(item5);
myMenu.customItems[2].separatorBefore = true;
_root.menu = myMenu;
Stage.showMenu = true;
Frame 3
stop();
attachMovie("music_control", "music_control", 20010);
_root.music_control._x = Stage.width - 85;
_root.music_control._y = 7;
_root.play();
Frame 4
stop();
Frame 5
function intializeGame() {
selectedPaddle = 0;
keyLeft = false;
keyRight = false;
paddleSpeed = 4;
trainSpeed = 1;
trainMaxSpeed = 4;
trains = new Array();
powerupGuys = new Array();
nextDepth = 2;
timeBeweenPassengers = 4900;
defaultPassengerSpeed = 0.7;
currentPowerup = -1;
tracksY = new Array(172, 344, 516);
passengers = new Array();
powerupNames = new Array("faster_ramps", "wider_ramps", "slower_people", "x5_score", "extra_life");
nextTrain = getTimer() + 1000;
timeBetweenTrains = 6000;
score = 0;
lives = 10;
level = 1;
gotPassengerSound = new Sound(this);
gotPassengerSound.attachSound("passenger_received");
endPowerupSound = new Sound(this);
endPowerupSound.attachSound("powerup_end");
doTrainThreshold = true;
speedMofifier = 1;
scoreModifier = 1;
nextPowerUp = 7;
untilNextLevel = 8;
powerupTimeLeft = -1;
defaultNumberPassengers = 2;
powerupNextSubtract = -1;
updateScoreDisplay();
updateLivesDisplay();
updateLevelDisplay();
setSelectedPaddle();
_root.overhead_0.swapDepths(20000);
_root.overhead_1.swapDepths(20001);
_root.overhead_2.swapDepths(20002);
_root.powerup_tint.swapDepths(20003);
_root.powerup_counter._visible = false;
}
function moveWorld() {
var _local4 = trains.length;
var _local2 = 0;
while (_local2 < _local4) {
switch (trains[_local2].mode) {
case 0 :
_root["train_" + trains[_local2].id]._x = _root["train_" + trains[_local2].id]._x - trains[_local2].currentSpeed;
if (_root["train_" + trains[_local2].id]._x <= trains[_local2].stopAt) {
_root["train_" + trains[_local2].id].sparks_holder.gotoAndStop(2);
trains[_local2].mode = 1;
}
break;
case 1 :
trains[_local2].currentSpeed = trains[_local2].currentSpeed - 0.2;
if (trains[_local2].currentSpeed <= 0) {
if (_root["train_" + trains[_local2].id]._x < -100) {
resetTrainNumbers(_local2);
removeTrain(_local2);
_local2--;
_local4--;
break;
}
trains[_local2].mode = -1;
trains[_local2].nextPassenger = getTimer() + 1000;
trains[_local2].currentSpeed = 0;
_root["train_" + trains[_local2].id].sparks_holder.gotoAndStop(1);
} else {
_root["train_" + trains[_local2].id]._x = _root["train_" + trains[_local2].id]._x - trains[_local2].currentSpeed;
}
break;
case 2 :
trains[_local2].currentSpeed = trains[_local2].currentSpeed + 0.2;
if (trains[_local2].currentSpeed >= trains[_local2].maxSpeed) {
trains[_local2].mode = 0;
trains[_local2].currentSpeed = trains[_local2].maxSpeed;
} else {
_root["train_" + trains[_local2].id]._x = _root["train_" + trains[_local2].id]._x - trains[_local2].currentSpeed;
}
break;
case -1 :
if (trains[_local2].nextPassenger > getTimer()) {
break;
}
if (trains[_local2].numberPassengers <= 0) {
break;
}
newPassenger(_local2, trains[_local2].passengerSpeed);
trains[_local2].nextPassenger = getTimer() + timeBeweenPassengers;
trains[_local2].numberPassengers--;
}
_local2++;
}
var _local3 = passengers.length;
_local2 = 0;
while (_local2 < _local3) {
_root["passenger_" + passengers[_local2].id]._y = _root["passenger_" + passengers[_local2].id]._y + (passengers[_local2].speed * speedMofifier);
if (_root["passenger_" + passengers[_local2].id]._y > (tracksY[passengers[_local2].track] - 42)) {
if (!_root["passenger_" + passengers[_local2].id].hitTest(_root["paddle_" + passengers[_local2].track])) {
trains[passengers[_local2].train].progressPassengers--;
if ((trains[passengers[_local2].train].numberPassengers <= 0) && (trains[passengers[_local2].train].progressPassengers <= 0)) {
trains[passengers[_local2].train].stopAt = -300;
trains[passengers[_local2].train].mode = 2;
}
generateBloodSpot(_local2);
removePassenger(_local2);
_local2--;
_local3--;
lives--;
if (lives <= 0) {
endGame();
}
updateLivesDisplay();
} else if (_root["passenger_" + passengers[_local2].id]._y > (tracksY[passengers[_local2].track] - 28)) {
trains[passengers[_local2].train].progressPassengers--;
if ((trains[passengers[_local2].train].numberPassengers <= 0) && (trains[passengers[_local2].train].progressPassengers <= 0)) {
trains[passengers[_local2].train].stopAt = -300;
trains[passengers[_local2].train].mode = 2;
}
removePassenger(_local2);
_local2--;
_local3--;
score = score + scoreModifier;
gotPassengerSound.start(0, 1);
updateScoreDisplay();
}
}
_local2++;
}
_local2 = 0;
while (_local2 < powerupGuys.length) {
_root["powerup_" + powerupGuys[_local2].id]._y = _root["powerup_" + powerupGuys[_local2].id]._y + 0.6;
if (_root["powerup_" + powerupGuys[_local2].id]._y > (tracksY[powerupGuys[_local2].track] - 60)) {
if (_root["powerup_" + powerupGuys[_local2].id].hitTest(_root["paddle_" + powerupGuys[_local2].track])) {
endPowerup();
currentPowerup = powerupGuys[_local2].type;
beginPowerup();
_root.powerup_tint.gotoAndStop(powerupNames[powerupGuys[_local2].type]);
removePowerupGuy(_local2);
_local2--;
} else if (_root["powerup_" + powerupGuys[_local2].id]._y > (tracksY[powerupGuys[_local2].track] - 42)) {
removePowerupGuy(_local2);
_local2--;
}
}
_local2++;
}
if (currentPowerup != -1) {
if (getTimer() >= powerupNextSubtract) {
powerupTimeLeft--;
_root.powerup_counter.text = powerupTimeLeft;
if (powerupTimeLeft <= 0) {
endPowerup();
} else {
powerupNextSubtract = getTimer() + 1000;
}
}
}
detectKeys();
if (nextTrain <= getTimer()) {
newTrain();
nextTrain = getTimer() + timeBetweenTrains;
}
}
function endPowerup() {
switch (currentPowerup) {
case 0 :
paddleSpeed = 4;
break;
case 1 :
var _local2 = 0;
while (_local2 < 3) {
_root["paddle_" + _local2]._xscale = 100;
_local2++;
}
break;
case 2 :
speedMofifier = 1;
break;
case 3 :
scoreModifier = 1;
}
currentPowerup = -1;
powerupNextSubtract = -1;
powerupTimeLeft = -1;
_root.powerup_counter._visible = false;
endPowerupSound.start(0, 1);
_root.powerup_tint.gotoAndStop(1);
}
function beginPowerup() {
if (currentPowerup == -1) {
return(undefined);
}
switch (currentPowerup) {
case 0 :
paddleSpeed = 6;
powerupTimeLeft = 12;
_root.powerup_counter._visible = true;
_root.powerup_counter.text = powerupTimeLeft;
powerupNextSubtract = getTimer() + 1000;
break;
case 1 :
var _local2 = 0;
while (_local2 < 3) {
_root["paddle_" + _local2]._xscale = 200;
_local2++;
}
powerupTimeLeft = 12;
_root.powerup_counter._visible = true;
_root.powerup_counter.text = powerupTimeLeft;
powerupNextSubtract = getTimer() + 1000;
break;
case 2 :
speedMofifier = 0.6;
powerupTimeLeft = 12;
_root.powerup_counter._visible = true;
_root.powerup_counter.text = powerupTimeLeft;
powerupNextSubtract = getTimer() + 1000;
break;
case 3 :
scoreModifier = 5;
powerupTimeLeft = 12;
_root.powerup_counter._visible = true;
_root.powerup_counter.text = powerupTimeLeft;
powerupNextSubtract = getTimer() + 1000;
break;
case 4 :
lives = lives + 3;
powerupTimeLeft = 2;
_root.powerup_counter.text = powerupTimeLeft;
powerupNextSubtract = getTimer() + 1000;
updateLivesDisplay();
}
}
function removePowerupGuy(g) {
removeMovieClip("powerup_" + powerupGuys[g].id);
powerupGuys.splice(g, 1);
}
function generateBloodSpot(p) {
_root["track_" + passengers[p].track].attachMovie("blood", "blood_" + nextDepth, nextDepth);
_root["track_" + passengers[p].track]["blood_" + nextDepth]._x = _root["passenger_" + passengers[p].id]._x - 270;
_root["track_" + passengers[p].track]["blood_" + nextDepth]._y = -5;
_root["track_" + passengers[p].track]["blood_" + nextDepth]._xscale = 30;
_root["track_" + passengers[p].track]["blood_" + nextDepth]._yscale = 30;
nextDepth++;
}
function removeTrain(t) {
removeMovieClip(_root["train_" + trains[t].id]);
trains.splice(t, 1);
}
function removePassenger(p) {
removeMovieClip(_root["passenger_" + passengers[p].id]);
passengers.splice(p, 1);
}
function newPassenger(t, s) {
var _local3 = getRandomValidPasPos(t);
passengers.push({id:nextDepth, track:trains[t].track, train:t, speed:s});
trains[t].progressPassengers++;
attachMovie("person_holder", "passenger_" + nextDepth, nextDepth);
_root["passenger_" + nextDepth].gotoAndStop(randomNumber(1, _root["passenger_" + nextDepth]._totalframes));
_root["passenger_" + nextDepth]._x = _local3;
_root["passenger_" + nextDepth]._y = tracksY[trains[t].track] - 120;
nextDepth++;
nextPowerUp--;
if (nextPowerUp <= 0) {
nextPowerUp = 7;
newPowerupGuy();
}
untilNextLevel--;
if (untilNextLevel <= 0) {
nextLevel();
}
}
function nextLevel() {
untilNextLevel = 8;
level++;
if ((level % 2) == 0) {
defaultPassengerSpeed = defaultPassengerSpeed + 0.1;
}
if (level > 4) {
untilNextLevel = 20;
}
if (level == 3) {
doTrainThreshold = false;
}
if (level == 4) {
defaultNumberPassengers = 3;
}
attachMovie("level_up", "level_up", 20004);
_root.level_up._x = Stage.width / 2;
_root.level_up._y = Stage.height / 2;
updateLevelDisplay();
}
function newPowerupGuy() {
var _local3 = randomNumber(0, 2);
var _local2 = randomNumber(0, 4);
powerupGuys.push({id:nextDepth, track:_local3, type:_local2});
attachMovie("powerup_guy", "powerup_" + nextDepth, nextDepth);
_root["powerup_" + nextDepth]._x = randomNumber(15, Stage.width - 15);
_root["powerup_" + nextDepth]._y = tracksY[_local3] - 120;
_root["powerup_" + nextDepth].gotoAndStop(powerupNames[_local2]);
nextDepth++;
}
function resetTrainNumbers(t) {
var _local2 = passengers.length;
var _local1 = 0;
while (_local1 < _local2) {
if (passengers[_local1].train > t) {
passengers[_local1].train--;
}
_local1++;
}
}
function getRandomValidPasPos(t) {
var _local4 = _root["train_" + trains[t].id]._x;
var _local3 = _root["train_" + trains[t].id]._x + _root["train_" + trains[t].id].train_body._width;
if (_local4 < 12) {
trainleft = 15;
} else {
_local4 = _root["train_" + trains[t].id]._x + 9;
}
if (_local3 > (Stage.width - 12)) {
_local3 = Stage.width - 15;
} else {
_local3 = (_root["train_" + trains[t].id]._x + _root["train_" + trains[t].id].train_body._width) - 9;
}
var _local5 = randomNumber(_local4, _local3);
if (_local5 <= 12) {
_local5 = 13;
}
return(_local5);
}
function setSelectedPaddle(w) {
if (w != null) {
_root["paddle_" + w].gotoAndStop("unselected");
}
_root["paddle_" + selectedPaddle].gotoAndStop("selected");
}
function togglePaddle(d) {
var _local1 = selectedPaddle;
switch (d) {
case "up" :
if (selectedPaddle > 0) {
selectedPaddle--;
} else {
selectedPaddle = 2;
}
break;
case "down" :
if (selectedPaddle < 2) {
selectedPaddle++;
} else {
selectedPaddle = 0;
}
}
setSelectedPaddle(_local1);
}
function detectKeys() {
if (keyLeft && (!keyRight)) {
if ((_root["paddle_" + selectedPaddle]._x - paddleSpeed) >= 1) {
_root["paddle_" + selectedPaddle]._x = _root["paddle_" + selectedPaddle]._x - paddleSpeed;
}
}
if ((!keyLeft) && (keyRight)) {
if ((_root["paddle_" + selectedPaddle]._x + paddleSpeed) <= 550) {
_root["paddle_" + selectedPaddle]._x = _root["paddle_" + selectedPaddle]._x + paddleSpeed;
}
}
}
function newTrain() {
var _local2 = getEmptyTrack();
if (_local2 == -1) {
return(undefined);
}
var _local3 = randomNumber(1, Stage.width - 70);
var _local11 = -1;
trains.push({id:nextDepth, track:_local2, maxSpeed:trainMaxSpeed, currentSpeed:trainMaxSpeed, mode:0, stopAt:_local3, nextPassenger:_local11, numberPassengers:defaultNumberPassengers, passengerSpeed:defaultPassengerSpeed, progressPassengers:0});
attachMovie("train", "train_" + nextDepth, nextDepth);
_root["train_" + nextDepth]._x = Stage.width + 40;
_root["train_" + nextDepth]._y = tracksY[_local2];
_root["train_" + nextDepth].headlights.gotoAndStop(randomNumber(1, 3));
nextDepth++;
}
function getEmptyTrack() {
var _local3 = new Array(0, 1, 2);
var _local4 = trains.length;
var _local2 = 0;
while (_local2 < _local4) {
var _local1 = 0;
while (_local1 < 3) {
if (_local3[_local1] == trains[_local2].track) {
_local3.splice(_local1, 1);
}
_local1++;
}
_local2++;
}
if (_local3.length <= 0) {
return(-1);
}
if ((_local3.length == 1) && (doTrainThreshold)) {
return(-1);
}
return(_local3[randomNumber(0, _local3.length - 1)]);
}
function updateScoreDisplay() {
_root.score_display.text = score;
}
function updateLevelDisplay() {
_root.level_display.text = level;
}
function updateLivesDisplay() {
_root.lives_display.text = lives;
}
function backToMenu() {
for (var _local2 in _root) {
if (_local2 != "music_control") {
removeMovieClip(_local2);
}
}
gotoAndStop ("menu");
}
function endGame() {
for (var _local2 in _root) {
if (_local2 != "music_control") {
removeMovieClip(_local2);
}
}
gotoAndStop ("game_over");
}
stop();
var selectedPaddle;
var keyLeft;
var keyRight;
var paddleSpeed;
var trainSpeed;
var trains;
var nextDepth;
var trainMaxSpeed;
var tracksY;
var passengers;
var powerupGuys;
var nextTrain;
var timeBetweenTrains;
var score;
var lives;
var defaultNumberPassengers;
var nextPowerUp;
var powerupNames;
var doTrainThreshold;
var currentPowerup;
var powerupTimeLeft;
var powerupNextSubtract;
var defaultPassengerSpeed;
var speedMofifier;
var scoreModifier;
var untilNextLevel;
var level;
var gotPassengerSound;
var endPowerupSound;
var timeBeweenPassengers;
intializeGame();
Instance of Symbol 147 MovieClip in Frame 5
onClipEvent (enterFrame) {
if (Key.isDown(37)) {
_root.keyLeft = true;
} else {
_root.keyLeft = false;
}
if (Key.isDown(39)) {
_root.keyRight = true;
} else {
_root.keyRight = false;
}
_root.moveWorld();
}
on (keyPress "<Up>") {
_root.togglePaddle("up");
}
on (keyPress "<Down>") {
_root.togglePaddle("down");
}
Frame 6
stop();
Frame 7
stop();
_root.show_score.text = score;
myLoadVars = new LoadVars();
myLoadVars.giveurl = _root._url;
myLoadVars.game_id = 13;
myLoadVars.sendAndLoad("http://www.orangefoxgames.com/admin/tracker.php?cachebuster=" + new Date().getTime(), myLoadVars, "POST");
Frame 8
stop();
if (randomNumber(5, 6) == 5) {
_root.about_ryan._y = 137.2;
_root.about_david._y = 203.8;
}
Frame 9
stop();
_root.show_score.text = score;
clicked_submit = false;
Symbol 3 MovieClip [level_up] Frame 16
stop();
this.removeMovieClip();
Symbol 11 MovieClip [blood] Frame 100
this.removeMovieClip();
Symbol 15 MovieClip Frame 1
stop();
Symbol 15 MovieClip Frame 2
stop();
Symbol 15 MovieClip Frame 3
stop();
Symbol 20 MovieClip Frame 1
stop();
Symbol 20 MovieClip Frame 2
stop();
Symbol 23 MovieClip [train] Frame 1
stop();
Symbol 30 MovieClip [person_holder] Frame 1
stop();
Symbol 30 MovieClip [person_holder] Frame 2
stop();
Symbol 30 MovieClip [person_holder] Frame 3
stop();
Symbol 30 MovieClip [person_holder] Frame 4
stop();
Symbol 36 MovieClip [powerup_guy] Frame 1
stop();
Symbol 36 MovieClip [powerup_guy] Frame 2
stop();
Symbol 36 MovieClip [powerup_guy] Frame 3
stop();
Symbol 36 MovieClip [powerup_guy] Frame 4
stop();
Symbol 36 MovieClip [powerup_guy] Frame 5
stop();
Symbol 45 Button
on (release) {
stopAllSounds();
if (this._currentframe > 1) {
this.prevFrame();
} else {
this.gotoAndStop(4);
}
}
Symbol 48 Button
on (release) {
stopAllSounds();
gotoAndStop (1);
}
Symbol 51 Button
on (release) {
stopAllSounds();
if (this._currentframe < 4) {
this.nextFrame();
} else {
this.gotoAndStop(1);
}
}
Symbol 54 Button
on (release) {
stopAllSounds();
gotoAndStop (5);
}
Symbol 60 MovieClip [music_control] Frame 1
stop();
Symbol 60 MovieClip [music_control] Frame 2
stop();
Symbol 60 MovieClip [music_control] Frame 3
stop();
Symbol 60 MovieClip [music_control] Frame 4
stop();
Symbol 60 MovieClip [music_control] Frame 5
stopAllSounds();
Symbol 102 MovieClip Frame 211
_root.play();
Symbol 104 Button
on (release) {
getURL ("http://www.webivia.com", "_blank");
}
Symbol 119 Button
on (release) {
_root.gotoAndStop("game");
}
Symbol 121 Button
on (release) {
_root.gotoAndStop("instructions");
}
Symbol 123 Button
on (release) {
getURL ("http://www.orangefoxgames.com/view_scores_railroad_ruckus.php", "_blank");
}
Symbol 125 Button
on (release) {
getURL ("http://www.orangefoxgames.com", "_blank");
}
Symbol 127 Button
on (release) {
_root.gotoAndStop("about");
}
Symbol 132 MovieClip Frame 2
stop();
Symbol 135 Button
on (release) {
getURL ("http://www.orangefoxgames.com", "_blank");
}
Symbol 137 Button
on (release) {
getURL ("http://www.webivia.com", "_blank");
}
Symbol 139 Button
on (press) {
_root.menu_sound.play();
}
Symbol 141 MovieClip Frame 1
stop();
mySound = new Sound();
mySound.setVolume(100);
Symbol 141 MovieClip Frame 2
stop();
mySound = new Sound();
mySound.setVolume(0);
Symbol 155 MovieClip Frame 1
stop();
Symbol 155 MovieClip Frame 2
stop();
Symbol 169 Button
on (release) {
_root.backToMenu();
}
Symbol 181 MovieClip Frame 1
stop();
Symbol 181 MovieClip Frame 2
stop();
Symbol 181 MovieClip Frame 3
stop();
Symbol 181 MovieClip Frame 4
stop();
Symbol 181 MovieClip Frame 5
stop();
Symbol 181 MovieClip Frame 6
stop();
Symbol 187 Button
on (release) {
getURL ("http://www.orangefoxgames.com/railroad_ruckus_tips_and_tricks.php", "_blank");
}
Symbol 200 Button
on (release) {
_root.gotoAndStop("menu");
}
Symbol 212 Button
on (release) {
nj = _root.js(score);
_root.gbr = _root.mkt(nj);
_root.gotoAndStop("submit_score");
}
Symbol 227 Button
on (release) {
if (!_root.clicked_submit) {
_root.clicked_submit = true;
url = "http://www.orangefoxgames.com/high_scores_pwhrdf/submit_high_score_rr.php";
myLoadVars = new LoadVars();
myLoadVars.score_score = _root.score;
myLoadVars.username = _root.username_input.text;
myLoadVars.password = _root.password_input.text;
myLoadVars.check_code = "dfkjofjijbiig";
myLoadVars.gbr = _root.gbr;
returnedVars = new LoadVars();
myLoadVars.sendAndLoad(url, returnedVars, "POST");
resultText = "Sending score...";
returnedVars.onLoad = function () {
resultText = returnedVars.resultText;
if (returnedVars.resultText == "Login information is incorrect.") {
clicked_submit = false;
} else {
getURL ("http://www.orangefoxgames.com/view_scores_railroad_ruckus.php", "_blank");
}
};
} else {
resultText = "Score already submitted";
}
}
Symbol 234 Button
on (release) {
getURL ("http://www.orangefoxgames.com/account_create.php", "_blank");
}