Frame 2
loadPercent = Math.round((getBytesLoaded() / getBytesTotal()) * 100);
gotoAndPlay(((loadPercent < 100) ? 1 : "loaded"));
Frame 10
Math.getAngle = function (ax, ay, bx, by) {
var _local1 = Math.atan2(by - ay, bx - ax);
var _local2 = Math.round((_local1 * 180) / Math.PI);
return(_local2);
};
Frame 33
stop();
Frame 45
function playSound($soundObj) {
var _local1 = $soundObj;
if ((_local1.position == 0) || (_local1.position == _local1.duration)) {
_local1.start();
}
}
function playWallDamage($bool) {
wallDamageIsPlaying = $bool;
if ($bool == true) {
if ((wallDamage.position == 0) || (wallDamage.position == wallDamage.duration)) {
wallDamage.start();
}
} else {
wallDamage.stop(wallDamage);
}
}
function playBusSound($newSound) {
var _local1 = $newSound;
if (_local1 != curBusSound) {
if (curBusSound != "") {
this[curBusSound].stop(curBusSound);
}
if (_local1 != "") {
curBusSound = _local1;
this[_local1].start(0, 9999);
}
}
}
function TileClass($walkable, $frame) {
this.walkable = $walkable;
this.frame = $frame;
}
function enemyClass($xMove, $yMove, $speed) {
var _local1 = this;
_local1.xMove = $xMove;
_local1.yMove = $yMove;
_local1.speed = $speed;
}
function BusStopClass($xTile, $yTile, $xOffset, $yOffset) {
var _local1 = this;
_local1.xTile = $xTile;
_local1.yTile = $yTile;
_local1.xOffset = $xOffset;
_local1.yOffset = $yOffset;
}
function chooseRider() {
do {
var _local1 = random(busStops.length);
var randStop = busStops[_local1];
} while ((Math.abs(hero.xTile - randStop.xTile) < 3) && (Math.abs(hero.yTile - randStop.yTile) < 3));
rider.identity = _local1;
rider.pickUp.xTile = randStop.xTile;
rider.pickUp.yTile = randStop.yTile;
rider.pickUp.x = ((rider.pickUp.xTile * game.tileW) + (game.tileW / 2)) + (((game.tileW * 1) / 5) * randStop.xOffset);
rider.pickUp.y = ((rider.pickUp.yTile * game.tileH) + (game.tileH / 2)) + (((game.tileH * 1) / 5) * randStop.yOffset);
do {
var _local2 = random(busStops.length);
var randStop2 = busStops[_local2];
} while ((Math.abs(randStop.xTile - randStop2.xTile) < 3) && (Math.abs(randStop.yTile - randStop2.yTile) < 3));
rider.dropOff.xTile = randStop2.xTile;
rider.dropOff.yTile = randStop2.yTile;
rider.dropOff.x = ((rider.dropOff.xTile * game.tileW) + (game.tileW / 2)) + (((game.tileW * 1) / 5) * randStop2.xOffset);
rider.dropOff.y = ((rider.dropOff.yTile * game.tileH) + (game.tileH / 2)) + (((game.tileW * 1) / 5) * randStop2.yOffset);
rider.pickUp.clip._x = rider.pickUp.x;
rider.pickUp.clip._y = rider.pickUp.y;
rider.state = "waiting";
}
function buildMap($map) {
_root.gameHolder.createEmptyMovieClip("tiles", 1);
game.halfVisX = int(game.visX / 2);
game.halfVisY = int(game.visY / 2);
game.clip = _root.gameHolder.tiles;
game.mapWidth = $map[0].length;
game.mapHeight = $map.length;
var fixX = 0;
var fixX1 = 0;
if (game.halfVisX > hero.xTile) {
fixX = hero.xTile - game.halfVisX;
} else if (hero.xTile > ((game.mapWidth - game.halfVisX) - 1)) {
fixX = ((hero.xTile - game.mapWidth) + game.halfVisX) + 1;
fixX1 = 1;
}
var fixY = 0;
var fixY1 = 0;
if (game.halfVisY > hero.yTile) {
fixY = hero.yTile - game.halfVisY;
} else if (hero.yTile > ((game.mapHeight - game.halfVisY) - 1)) {
fixY = ((hero.yTile - game.mapHeight) + game.halfVisY) + 1;
fixY1 = 1;
}
game.clip._x = (game.centerX - ((hero.xTile - fixX) * game.tileW)) - (game.tileW / 2);
game.clip._y = (game.centerY - ((hero.yTile - fixY) * game.tileH)) - (game.tileH / 2);
var y = 0;
while (y < $map.length) {
var _local3 = 0;
while (_local3 < $map[y].length) {
var _local2 = (("tile" + y) + "_") + _local3;
game[_local2] = _root["Tile" + $map[y][_local3]];
_local3++;
}
y++;
}
var y = (((hero.yTile - game.halfVisY) - fixY) - fixY1);
while (y <= ((((hero.yTile + game.halfVisY) + 1) - fixY) - fixY1)) {
var _local3 = ((hero.xTile - game.halfVisX) - fixX) - fixX1;
while (_local3 <= ((((hero.xTile + game.halfVisX) + 1) - fixX) - fixX1)) {
var _local2 = (("tile" + y) + "_") + _local3;
game[_local2] = _root["Tile" + $map[y][_local3]];
game.clip.attachMovie("tile", _local2, ((1 + (y * 100)) + (_local3 * 2)) + (game[_local2].walkable ? 10000 : 30000));
game.clip[_local2]._x = _local3 * game.tileW;
game.clip[_local2]._y = y * game.tileH;
game.clip[_local2].gotoAndStop(game[_local2].frame);
_local3++;
}
y++;
}
var enemies = enemyList[game.currentMap];
game.currentEnemies = enemies.length;
var i = 0;
while (i < game.currentEnemies) {
var _local1 = "enemy" + i;
game[_local1] = _root["Enemy" + enemies[i][0]];
game.clip.attachMovie("enemy" + enemies[i][0], _local1, 100001 + i);
game[_local1].clip = game.clip[_local1];
game[_local1].xTile = enemies[i][1];
game[_local1].yTile = enemies[i][2];
game[_local1].width = game.clip[_local1]._width / 2;
game[_local1].height = game.clip[_local1]._height / 2;
game[_local1].x = (game[_local1].xTile * game.tileW) + (game.tileW / 2);
game[_local1].y = (game[_local1].yTile * game.tileH) + (game.tileH / 2);
game[_local1].clip._x = game[_local1].x;
game[_local1].clip._y = game[_local1].y;
i++;
}
game.clip.attachMovie("hero", "hero", 100000);
hero.clip = game.clip.hero;
hero.x = (hero.xTile * game.tileW) + (game.tileW / 2);
hero.y = (hero.yTile * game.tileH) + (game.tileH / 2);
hero.width = hero.clip._width / 2;
hero.height = hero.clip._height / 2;
hero.clip._x = hero.x;
hero.clip._y = hero.y;
hero.hypotenuse = Math.round(Math.sqrt(Math.pow(hero.width, 2) + Math.pow(hero.height, 2)));
hero.clip._rotation = hero.rotation;
hero.xStep = hero.x - ((fixX + fixX1) * game.tileW);
hero.yStep = hero.y - ((fixY + fixY1) * game.tileH);
game.clip.attachMovie("heroDisplay", "heroDisplay", 20000);
heroDisplay = game.clip.heroDisplay;
heroDisplay._x = hero.x;
heroDisplay._y = hero.y;
heroDisplay._rotation = hero.rotation;
game.clip.attachMovie("pickUp", "pickUp", 19999);
game.clip.attachMovie("dropOff", "dropOff", 19998);
game.clip.attachMovie("pickUpArrow", "pickUpArrow", 100001);
game.clip.attachMovie("dropOffArrow", "dropOffArrow", 100002);
rider.pickUp.clip = game.clip.pickUp;
rider.dropOff.clip = game.clip.dropOff;
rider.pickUp.pointer = game.clip.pickUpArrow;
rider.dropOff.pointer = game.clip.dropOffArrow;
rider.dropOff.pointer._x = game.offScreenX;
ridewr.dropOff.pointer._y = game.offScreenY;
Timer.addTime(31);
_root.chooseRider();
}
function detectKeys() {
var _local1 = _root.hero;
var _local2 = "busIdling";
if (_local1.speed != 0) {
if (Key.isDown(39) || (Key.isDown(88))) {
if (Math.abs(_local1.speed) > 8) {
_local1.turning = "right";
if ((++_local1.leftKey) > 5) {
playSound(skid2);
}
}
_local1.rotation = _local1.rotation + (12 * Math.min(1, _local1.speed / ((_local1.speed >= 0) ? (_local1.maxSpeed * 0.8) : (-_local1.maxReverseSpeed))));
} else if (Key.isDown(37) || (Key.isDown(90))) {
if (Math.abs(_local1.speed) > 8) {
if ((++_local1.rightKey) > 5) {
playSound(skid2);
}
_local1.turning = "left";
}
_local1.rotation = _local1.rotation - (12 * Math.min(1, _local1.speed / ((_local1.speed >= 0) ? (_local1.maxSpeed * 0.8) : (-_local1.maxReverseSpeed))));
} else {
_local1.leftKey = (_local1.rightKey = 0);
_local1.turning = "normal";
if (_local1.rotation < 15) {
_local1.rotation = 0;
} else if ((_local1.rotation > 75) && (_local1.rotation < 105)) {
_local1.rotation = 90;
} else if ((_local1.rotation > 165) && (_local1.rotation < 195)) {
_local1.rotation = 180;
} else if ((_local1.rotation > 255) && (_local1.rotation < 285)) {
_local1.rotation = 270;
} else if (_local1.rotation > 345) {
_local1.rotation = 0;
}
}
_local1.rotation = Math.floor(_local1.rotation % 360);
if (_local1.rotation < 0) {
_local1.rotation = _local1.rotation + 360;
}
_local1.clip._rotation = _local1.rotation;
} else {
_local1.leftKey = (_local1.rightKey = 0);
_local1.turning = "normal";
_local1.rotation = Math.floor(_local1.rotation % 360);
if (_local1.rotation < 0) {
_local1.rotation = _local1.rotation + 360;
}
if (_local1.rotation < 15) {
_local1.rotation = 0;
} else if ((_local1.rotation > 75) && (_local1.rotation < 105)) {
_local1.rotation = 90;
} else if ((_local1.rotation > 165) && (_local1.rotation < 195)) {
_local1.rotation = 180;
} else if ((_local1.rotation > 255) && (_local1.rotation < 285)) {
_local1.rotation = 270;
} else if (_local1.rotation > 345) {
_local1.rotation = 0;
}
_local1.clip._rotation = _local1.rotation;
}
_local1.braking = "normal";
if (Key.isDown(38)) {
if (_local1.speed < 0) {
if (_local1.speed < -1) {
_local1.braking = "backwards";
if (_local1.speed < -5) {
playSound(skid);
}
}
_local1.speed = _local1.speed * 0.5;
if (_local1.speed > -0.1) {
_local1.speed = 0;
}
} else {
_local2 = "busDriving";
_local1.speed = Math.min(_local1.maxSpeed, _local1.speed + _local1.accel);
}
} else if (Key.isDown(40)) {
if (_local1.speed > 0) {
if (_local1.speed > 1) {
_local1.braking = "forwards";
if (_local1.speed > 5) {
playSound(skid);
}
}
_local1.speed = Math.max(0, _local1.speed * 0.5);
if (_local1.speed < 0.1) {
_local1.speed = 0;
}
} else {
_local1.speed = Math.max(_local1.maxReverseSpeed, _local1.speed - _local1.accel);
}
} else if (_local1.speed > 0) {
_local1.speed = Math.max(0, _local1.speed - _local1.decel);
if (_local1.speed < 0.1) {
_local1.speed = 0;
}
} else if (_local1.speed < 0) {
_local1.speed = Math.min(0, _local1.speed + _local1.decel);
if (_local1.speed > -0.1) {
_local1.speed = 0;
}
} else {
_local1.speed = 0;
}
if (_local1.speed != 0) {
_local1.speedX = _local1.speed * Math.cos((_local1.clip._rotation * Math.PI) / 180);
_local1.speedY = _local1.speed * Math.sin((_local1.clip._rotation * Math.PI) / 180);
_root.moveChar(_local1, _local1.speedX, _local1.speedY);
}
playBusSound(_local2);
}
function getMyCorners($x, $y, $ob) {
var _local1 = $ob;
_local1.downY = Math.floor(($y + _local1.height) / game.tileH);
_local1.upY = Math.floor(($y - _local1.height) / game.tileH);
_local1.leftX = Math.floor(($x - _local1.width) / game.tileW);
_local1.rightX = Math.floor(($x + _local1.width) / game.tileW);
if ((_local1.rotation % 90) == 0) {
_local1.upLeft = game[(("tile" + _local1.upY) + "_") + _local1.leftX].walkable;
_local1.downLeft = game[(("tile" + _local1.downY) + "_") + _local1.leftX].walkable;
_local1.upRight = game[(("tile" + _local1.upY) + "_") + _local1.rightX].walkable;
_local1.downRight = game[(("tile" + _local1.downY) + "_") + _local1.rightX].walkable;
} else {
var _local2 = Math.round(Math.sqrt(Math.abs(Math.pow(_local1.hypotenuse, 2) - Math.pow(_local1.height, 2))));
var _local3 = Math.round(Math.sqrt(Math.abs(Math.pow(_local1.hypotenuse, 2) - Math.pow(_local1.width, 2))));
if ((Math.floor(_local1.rotation / 90) % 2) == 0) {
var up = game[(("tile" + _local1.upY) + "_") + Math.floor(($x - _local2) / game.tileW)].walkable;
var down = game[(("tile" + _local1.downY) + "_") + Math.floor(($x + _local2) / game.tileW)].walkable;
var left = game[(("tile" + Math.floor(($y - _local3) / game.tileH)) + "_") + _local1.leftX].walkable;
var right = game[(("tile" + Math.floor(($y + _local3) / game.tileH)) + "_") + _local1.rightX].walkable;
_local1.upLeft = ((up && (left)) ? true : false);
_local1.upRight = ((up && (right)) ? true : false);
_local1.downLeft = ((down && (left)) ? true : false);
_local1.downRight = ((down && (right)) ? true : false);
} else {
var up = game[(("tile" + _local1.upY) + "_") + Math.floor(($x + _local2) / game.tileW)].walkable;
var down = game[(("tile" + _local1.downY) + "_") + Math.floor(($x - _local2) / game.tileW)].walkable;
var left = game[(("tile" + Math.floor(($y + _local3) / game.tileH)) + "_") + _local1.leftX].walkable;
var right = game[(("tile" + Math.floor(($y - _local3) / game.tileH)) + "_") + _local1.rightX].walkable;
_local1.upLeft = ((up && (left)) ? true : false);
_local1.upRight = ((up && (right)) ? true : false);
_local1.downLeft = ((down && (left)) ? true : false);
_local1.downRight = ((down && (right)) ? true : false);
}
}
}
function moveChar($ob, $dirX, $dirY) {
var _local1 = $ob;
var wallDamageFlag = false;
_local1.height = _local1.clip._height / 2;
_local1.width = _local1.clip._width / 2;
getMyCorners(_local1.x, _local1.y + $dirY, _local1);
if ($dirY < -0.5) {
if (_local1.upLeft && (_local1.upRight)) {
_local1.y = _local1.y + $dirY;
} else if ((_local1.rotation > 250) && (_local1.rotation < 290)) {
if (_local1.speed > 5) {
playSound(wallImpact);
_local1.speed = (-_local1.speed) * 0.5;
hero.damage(1);
} else if ((_local1.speed <= 2) && (_local1.speed >= -2)) {
_local1.speed = 1;
} else {
_local1.speed = _local1.speed * 0.25;
hero.damage(0.25);
}
} else {
_local1.speed = _local1.speed * 0.8;
wallDamageFlag = true;
hero.damage(0.07);
}
} else if ($dirY > 0.5) {
if (_local1.downLeft && (_local1.downRight)) {
_local1.y = _local1.y + $dirY;
} else if ((_local1.rotation > 70) && (_local1.rotation < 110)) {
if (_local1.speed > 5) {
playSound(wallImpact);
_local1.speed = (-_local1.speed) * 0.5;
hero.damage(1);
} else if ((_local1.speed <= 2) && (_local1.speed >= -2)) {
_local1.speed = 1;
} else {
_local1.speed = _local1.speed * 0.25;
hero.damage(0.25);
}
} else {
_local1.speed = _local1.speed * 0.8;
wallDamageFlag = true;
hero.damage(0.07);
}
}
getMyCorners(_local1.x + $dirX, _local1.y, _local1);
if ($dirX < -0.5) {
if (_local1.downLeft && (_local1.upLeft)) {
_local1.x = _local1.x + $dirX;
} else if ((_local1.rotation > 160) && (_local1.rotation < 200)) {
if (_local1.speed > 5) {
playSound(wallImpact);
_local1.speed = (-_local1.speed) * 0.5;
hero.damage(1);
} else if ((_local1.speed <= 2) && (_local1.speed >= -2)) {
_local1.speed = 1;
} else {
_local1.speed = _local1.speed * 0.25;
hero.damage(0.25);
}
} else {
_local1.speed = _local1.speed * 0.8;
wallDamageFlag = true;
hero.damage(0.07);
}
} else if ($dirX > 0.5) {
if (_local1.upRight && (_local1.downRight)) {
_local1.x = _local1.x + $dirX;
} else if (((_local1.rotation >= 0) && (_local1.rotation < 20)) || ((_local1.rotation > 340) && (_local1.rotation <= 360))) {
if (_local1.speed > 5) {
playSound(wallImpact);
_local1.speed = (-_local1.speed) * 0.5;
hero.damage(1);
} else if ((_local1.speed <= 2) && (_local1.speed >= -2)) {
_local1.speed = 1;
} else {
_local1.speed = _local1.speed * 0.25;
hero.damage(0.25);
}
} else {
_local1.speed = _local1.speed * 0.8;
wallDamageFlag = true;
hero.damage(0.07);
}
}
if (wallDamageFlag != wallDamageIsPlaying) {
if (Math.abs(_local1.speed) > 2) {
playWallDamage(wallDamageFlag);
} else {
playWallDamage(false);
}
}
getMyCorners(_local1.x, _local1.y, _local1);
if (!(((_local1.upLeft && (_local1.upRight)) && (_local1.downLeft)) && (_local1.downRight))) {
var intersect = true;
do {
getMyCorners(_local1.x, _local1.y, _local1);
if (!(_local1.upLeft && (_local1.upRight))) {
_local1.y = _local1.y + 1;
} else if (!(_local1.downLeft && (_local1.downRight))) {
_local1.y = _local1.y - 1;
} else {
var intersectY = false;
}
if (!(_local1.upLeft && (_local1.downLeft))) {
_local1.x = _local1.x + 1;
} else if (!(_local1.upRight && (_local1.downRight))) {
_local1.x = _local1.x - 1;
} else {
var intersectX = false;
}
intersect = intersectX && (intersectY);
} while (intersect);
}
_local1.clip._x = _local1.x;
_local1.clip._y = _local1.y;
_local1.xTile = Math.floor(_local1.x / game.tileW);
_local1.yTile = Math.floor(_local1.y / game.tileH);
var fixX = 0;
var fixX1 = 0;
if (game.halfVisX > hero.xTile) {
fixX = hero.xTile - game.halfVisX;
fixX1 = 0;
} else if (hero.xTile > ((game.mapWidth - game.halfVisX) - 1)) {
fixX = ((hero.xTile - game.mapWidth) + game.halfVisX) + 1;
fixX1 = 1;
}
var _local3 = 0;
var fixY1 = 0;
if (game.halfVisY > hero.yTile) {
_local3 = hero.yTile - game.halfVisY;
fixY1 = 0;
} else if (hero.yTile > ((game.mapHeight - game.halfVisY) - 1)) {
_local3 = ((hero.yTile - game.mapHeight) + game.halfVisY) + 1;
fixY1 = 1;
}
if (_local1 == hero) {
if ((_local1.x > ((game.halfVisX * game.tileW) + (game.tileW / 2))) && (_local1.x < (((game.mapWidth - game.halfVisX) * game.tileW) - (game.tileW / 2)))) {
game.clip._x = game.centerX - _local1.x;
if (_local1.xStep < (_local1.x - game.tileW)) {
var xNew = ((_local1.xTile + game.halfVisX) + 1);
var xOld = ((_local1.xTile - game.halfVisX) - 1);
var _local2 = (((_local1.yTile - game.halfVisY) - _local3) - fixY1) - 1;
while (_local2 <= ((((_local1.yTile + game.halfVisY) + 1) - _local3) - fixY1)) {
changeTile(xOld, _local2, xNew, _local2, _root["map" + game.currentMap]);
_local2++;
}
_local1.xStep = _local1.xStep + game.tileW;
} else if (_local1.xStep > _local1.x) {
var xOld = ((_local1.xTile + game.halfVisX) + 1);
var xNew = ((_local1.xTile - game.halfVisX) - 1);
var _local2 = (((_local1.yTile - game.halfVisY) - _local3) - fixY1) - 1;
while (_local2 <= ((((_local1.yTile + game.halfVisY) + 1) - _local3) - fixY1)) {
changeTile(xOld, _local2, xNew, _local2, _root["map" + game.currentMap]);
_local2++;
}
_local1.xStep = _local1.xStep - game.tileW;
}
}
if ((_local1.y > ((game.halfVisY * game.tileH) + (game.tileH / 2))) && (_local1.y < (((game.mapHeight - game.halfVisY) * game.tileH) - (game.tileH / 2)))) {
game.clip._y = game.centerY - _local1.y;
if (_local1.yStep < (_local1.y - game.tileH)) {
var yNew = ((_local1.yTile + game.halfVisY) + 1);
var yOld = ((_local1.yTile - game.halfVisY) - 1);
var _local2 = (((_local1.xTile - game.halfVisX) - fixX) - fixX1) - 1;
while (_local2 <= ((((_local1.xTile + game.halfVisX) + 1) - fixX) - fixX1)) {
changeTile(_local2, yOld, _local2, yNew, _root["map" + game.currentMap]);
_local2++;
}
_local1.yStep = _local1.yStep + game.tileH;
} else if (_local1.yStep > _local1.y) {
var yOld = ((_local1.yTile + game.halfVisY) + 1);
var yNew = ((_local1.yTile - game.halfVisY) - 1);
var _local2 = (((_local1.xTile - game.halfVisX) - fixX) - fixX1) - 1;
while (_local2 <= ((((_local1.xTile + game.halfVisX) + 1) - fixX) - fixX1)) {
changeTile(_local2, yOld, _local2, yNew, _root["map" + game.currentMap]);
_local2++;
}
_local1.yStep = _local1.yStep - game.tileH;
}
}
}
return(true);
}
function changeMap($ob) {
var _local2 = $ob;
var _local1 = (("tile" + _local2.yTile) + "_") + _local2.xTile;
game.currentMap = game[_local1].newMap;
_local2.yTile = game[_local1].newCharY;
_local2.xTile = game[_local1].newCharX;
buildMap(_root["map" + game.currentMap]);
}
function changeTile($xOld, $yOld, $xNew, $yNew, $map) {
var _local2 = $yNew;
var _local3 = (("tile" + $yOld) + "_") + $xOld;
var _local1 = (("tile" + _local2) + "_") + $xNew;
if (game[_local3].walkable == undefined) {
} else {
game[_local1] = _root["Tile" + $map[_local2][$xNew]];
game.clip[_local3]._name = _local1;
game.clip[_local1].gotoAndStop(game[_local1].frame);
game.clip[_local1]._x = $xNew * game.tileW;
game.clip[_local1]._y = _local2 * game.tileH;
game.clip[_local1].swapDepths(((1 + (_local2 * 100)) + ($xNew * 2)) + (game[_local1].walkable ? 10000 : 30000));
}
}
function updateHero() {
heroDisplay._x = hero.x;
heroDisplay._y = hero.y;
heroDisplay._rotation = hero.rotation;
if ((rider.state == "waiting") || (rider.state == "riding")) {
var _local1 = rider[((rider.state == "waiting") ? "pickUp" : "dropOff")];
var _local2 = Math.abs(hero.xTile - _local1.xTile);
var _local3 = Math.abs(hero.yTile - _local1.yTile);
if ((_local2 > game.halfVisX) || (_local3 > game.halfVisY)) {
_local1.pointer._x = hero.x;
_local1.pointer._y = hero.y;
_local1.pointer._rotation = Math.getAngle(hero.x, hero.y, _local1.x, _local1.y);
} else {
if (((_local2 == 0) && (_local3 == 0)) && (hero.speed == 0)) {
if (Math.sqrt(Math.pow(hero.x - _local1.x, 2) + Math.pow(hero.y - _local1.y, 2)) <= 45) {
_local1.clip._x = (_local1.x = game.offScreenX);
_local1.clip._y = (_local1.y = game.offScreenY);
rider[((rider.state == "waiting") ? "onBoarding" : "onDroppingOff")]();
}
}
_local1.pointer._x = game.offScreenX;
_local1.pointer._y = game.offScreenY;
_local1.pointer._rotation = 0;
}
}
}
function enemyBrain() {
var _local2 = 0;
while (_local2 < game.currentEnemies) {
var _local3 = "enemy" + _local2;
var _local1 = game[_local3];
getMyCorners(_local1.x + (_local1.speed * _local1.xMove), _local1.y + (_local1.speed * _local1.yMove), _local1);
if (((_local1.downLeft && (_local1.upLeft)) && (_local1.downRight)) && (_local1.upRight)) {
moveChar(_local1, _local1.xMove, _local1.yMove);
} else {
_local1.xMove = -_local1.xMove;
_local1.yMove = -_local1.yMove;
}
_local2++;
}
}
game = {passengers:0, tileW:90, tileH:90, currentMap:1, visX:5, visY:5, centerX:225, centerY:225, offScreenX:-300, offScreenY:-300, interaction:false};
Timer = {frameRate:24, timeLeft:0, travelEstimate:0, travelTime:0, pickUpTime:0, dropOffTime:0, display:_root.timerDisplay};
Timer.addTime = function ($secs) {
this.timeLeft = this.timeLeft + (this.frameRate * $secs);
};
Timer.onTimeUp = function () {
game.interaction = false;
_root.gameOver = "time";
gotoAndPlay ("gameOver");
};
Timer.update = function () {
var _local1 = this;
if (((--_local1.timeLeft) <= 0) && (!timeless)) {
_local1.onTimeUp();
}
timeLeft = Math.max(timeLeft, 0);
_local1.mins = Math.floor((_local1.timeLeft / _local1.frameRate) / 60);
_local1.secs = Math.floor(_local1.timeLeft / _local1.frameRate) % 60;
if (timeless) {
_local1.display.text = "inf";
} else {
_local1.display.text = _local1.mins + ":";
_local1.display.text = _local1.display.text + ((_local1.secs < 10) ? "0" : "");
_local1.display.text = _local1.display.text + _local1.secs;
}
};
Timer.markPickUp = function () {
var _local1 = this;
_local1.travelEstimate = Math.ceil(Math.sqrt(Math.pow(rider.pickUp.xTile - rider.dropOff.xTile, 2) + Math.pow(rider.pickUp.yTile - rider.dropOff.yTile, 2)) * 1.5);
_local1.addTime(Timer.travelEstimate);
_local1.pickUpTime = _local1.timeLeft;
};
Timer.markDropOff = function () {
var _local1 = this;
_local1.dropOffTime = _local1.timeLeft;
_local1.travelTime = Math.floor((_local1.pickUpTime - _local1.dropOffTime) / _local1.frameRate);
};
skid = new Sound();
skid.attachSound("skid");
skid2 = new Sound();
skid2.attachSound("skid2");
wallImpact = new Sound();
wallImpact.attachSound("wallImpact");
wallDamage = new Sound();
wallDamage.attachSound("wallDamage");
wallDamageIsPlaying = false;
busIdling = new Sound();
busIdling.attachSound("busIdling");
busDriving = new Sound();
busDriving.attachSound("busDriving");
curBusSound = "";
map1 = [[100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 107, 109, 109, 109, 109, 109, 105, 100, 100, 100, 100, 100, 100], [100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 112, 1, 1, 1, 1, 1, 111, 100, 100, 100, 100, 100, 100], [100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 112, 1, 185, 186, 187, 1, 111, 100, 100, 100, 100, 100, 100], [100, 100, 100, 100, 100, 100, 100, 100, 100, 107, 109, 109, 109, 109, 103, 1, 188, 189, 190, 1, 101, 109, 109, 109, 109, 105, 100], [100, 107, 109, 109, 109, 109, 109, 109, 109, 103, 2, 3, 2, 3, 1, 1, 191, 192, 193, 1, 1, 1, 1, 2, 3, 111, 100], [100, 112, 1, 1, 1, 1, 1, 1, 1, 1, 5, 235, 236, 4, 1, 1, 194, 195, 196, 1, 320, 321, 322, 323, 4, 111, 100], [100, 112, 1, 1, 120, 121, 1, 1, 1, 1, 1, 237, 238, 1, 1, 1, 197, 198, 199, 1, 324, 325, 326, 327, 1, 111, 100], [100, 112, 1, 2, 122, 123, 3, 1, 1, 1, 2, 239, 240, 3, 1, 1, 200, 201, 202, 1, 328, 329, 330, 331, 1, 111, 100], [100, 112, 1, 5, 4, 5, 10, 3, 1, 1, 5, 4, 5, 4, 2, 6, 209, 204, 206, 6, 332, 333, 334, 335, 1, 101, 105], [100, 112, 1, 300, 301, 302, 303, 4, 150, 139, 1, 266, 267, 268, 269, 15, 7, 1, 5, 15, 13, 3, 1, 1, 2, 3, 111], [100, 112, 1, 304, 305, 306, 307, 1, 140, 141, 1, 270, 271, 272, 273, 5, 146, 131, 132, 147, 8, 340, 341, 342, 343, 4, 111], [100, 112, 1, 308, 309, 310, 311, 1, 142, 143, 1, 274, 275, 276, 277, 2, 148, 135, 136, 149, 3, 344, 345, 346, 347, 1, 111], [100, 112, 1, 312, 313, 314, 315, 2, 152, 153, 6, 278, 279, 280, 281, 5, 4, 1, 1, 5, 4, 348, 349, 350, 351, 1, 111], [100, 112, 2, 3, 1, 1, 1, 9, 7, 5, 8, 4, 1, 1, 2, 3, 120, 121, 1, 1, 2, 352, 353, 354, 355, 3, 111], [100, 112, 5, 250, 251, 252, 253, 5, 181, 161, 162, 163, 164, 165, 182, 10, 122, 123, 6, 3, 5, 4, 1, 1, 5, 4, 111], [100, 112, 1, 254, 255, 256, 257, 1, 167, 168, 169, 170, 171, 172, 173, 11, 4, 9, 14, 146, 131, 132, 133, 1, 104, 110, 108], [100, 112, 1, 258, 259, 260, 261, 2, 183, 175, 176, 177, 178, 179, 184, 7, 150, 151, 10, 148, 135, 136, 137, 1, 111, 100, 100], [107, 103, 1, 262, 263, 264, 265, 11, 4, 1, 1, 2, 3, 1, 9, 7, 140, 232, 9, 7, 1, 2, 3, 1, 111, 100, 100], [112, 2, 3, 1, 1, 2, 11, 4, 1, 1, 2, 11, 215, 216, 217, 217, 218, 219, 220, 220, 221, 222, 4, 1, 111, 100, 100], [112, 5, 146, 131, 132, 147, 4, 266, 267, 268, 269, 10, 223, 224, 225, 226, 227, 228, 229, 229, 230, 231, 3, 104, 108, 100, 100], [112, 1, 134, 135, 136, 149, 3, 270, 271, 272, 273, 5, 10, 3, 1, 1, 1, 1, 1, 2, 3, 5, 4, 101, 105, 100, 100], [112, 2, 3, 1, 1, 9, 7, 274, 275, 276, 277, 1, 5, 181, 161, 162, 163, 164, 165, 182, 10, 3, 1, 1, 111, 100, 100], [112, 5, 360, 361, 362, 363, 10, 278, 279, 280, 281, 1, 1, 167, 168, 169, 170, 171, 172, 173, 5, 124, 125, 1, 111, 100, 100], [112, 1, 364, 365, 366, 367, 9, 7, 1, 2, 3, 2, 6, 183, 175, 176, 177, 178, 179, 184, 6, 126, 127, 1, 101, 109, 105], [112, 1, 368, 369, 370, 371, 5, 124, 125, 5, 150, 151, 8, 4, 1, 2, 3, 1, 1, 9, 14, 4, 1, 1, 2, 3, 111], [112, 2, 372, 373, 374, 375, 6, 126, 127, 1, 140, 141, 1, 1, 1, 5, 146, 131, 132, 147, 4, 266, 267, 268, 269, 4, 111], [112, 5, 4, 1, 1, 5, 8, 4, 1, 1, 142, 143, 1, 1, 1, 2, 148, 135, 136, 149, 3, 270, 271, 272, 273, 1, 111], [106, 110, 110, 110, 110, 110, 110, 110, 102, 1, 144, 145, 1, 1, 1, 5, 4, 1, 1, 5, 4, 274, 275, 276, 277, 1, 111], [100, 100, 100, 100, 100, 100, 100, 100, 112, 1, 1, 1, 1, 104, 110, 110, 110, 110, 110, 102, 2, 278, 279, 280, 281, 1, 111], [100, 100, 100, 100, 100, 100, 100, 100, 106, 110, 110, 110, 110, 108, 100, 100, 100, 100, 100, 112, 5, 4, 1, 1, 1, 1, 111], [100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 106, 110, 110, 110, 110, 110, 110, 108]];
Tile0 = new TileClass(false, 99);
Tile1 = new TileClass(true, 1);
Tile2 = new TileClass(true, 2);
Tile3 = new TileClass(true, 3);
Tile4 = new TileClass(true, 4);
Tile5 = new TileClass(true, 5);
Tile6 = new TileClass(true, 6);
Tile7 = new TileClass(true, 7);
Tile8 = new TileClass(true, 8);
Tile9 = new TileClass(true, 9);
Tile10 = new TileClass(true, 10);
Tile11 = new TileClass(true, 11);
Tile12 = new TileClass(true, 12);
Tile13 = new TileClass(true, 13);
Tile14 = new TileClass(true, 14);
Tile15 = new TileClass(true, 15);
Tile16 = new TileClass(true, 16);
Tile100 = new TileClass(false, 100);
Tile101 = new TileClass(false, 101);
Tile102 = new TileClass(false, 102);
Tile103 = new TileClass(false, 103);
Tile104 = new TileClass(false, 104);
Tile105 = new TileClass(false, 105);
Tile106 = new TileClass(false, 106);
Tile107 = new TileClass(false, 107);
Tile108 = new TileClass(false, 108);
Tile109 = new TileClass(false, 109);
Tile110 = new TileClass(false, 110);
Tile111 = new TileClass(false, 111);
Tile112 = new TileClass(false, 112);
Tile120 = new TileClass(false, 120);
Tile121 = new TileClass(false, 121);
Tile122 = new TileClass(false, 122);
Tile123 = new TileClass(false, 123);
Tile124 = new TileClass(false, 124);
Tile125 = new TileClass(false, 125);
Tile126 = new TileClass(false, 126);
Tile127 = new TileClass(false, 127);
Tile130 = new TileClass(false, 130);
Tile131 = new TileClass(false, 131);
Tile132 = new TileClass(false, 132);
Tile133 = new TileClass(false, 133);
Tile134 = new TileClass(false, 134);
Tile135 = new TileClass(false, 135);
Tile136 = new TileClass(false, 136);
Tile137 = new TileClass(false, 137);
Tile138 = new TileClass(false, 138);
Tile139 = new TileClass(false, 139);
Tile140 = new TileClass(false, 140);
Tile141 = new TileClass(false, 141);
Tile142 = new TileClass(false, 142);
Tile143 = new TileClass(false, 143);
Tile144 = new TileClass(false, 144);
Tile145 = new TileClass(false, 145);
Tile146 = new TileClass(false, 146);
Tile147 = new TileClass(false, 147);
Tile148 = new TileClass(false, 148);
Tile149 = new TileClass(false, 149);
Tile150 = new TileClass(false, 150);
Tile151 = new TileClass(false, 151);
Tile152 = new TileClass(false, 152);
Tile153 = new TileClass(false, 153);
Tile160 = new TileClass(false, 160);
Tile161 = new TileClass(false, 161);
Tile162 = new TileClass(false, 162);
Tile163 = new TileClass(false, 163);
Tile164 = new TileClass(false, 164);
Tile165 = new TileClass(false, 165);
Tile166 = new TileClass(false, 166);
Tile167 = new TileClass(false, 167);
Tile168 = new TileClass(false, 168);
Tile169 = new TileClass(false, 169);
Tile170 = new TileClass(false, 170);
Tile171 = new TileClass(false, 171);
Tile172 = new TileClass(false, 172);
Tile173 = new TileClass(false, 173);
Tile174 = new TileClass(false, 174);
Tile175 = new TileClass(false, 175);
Tile176 = new TileClass(false, 176);
Tile177 = new TileClass(false, 177);
Tile178 = new TileClass(false, 178);
Tile179 = new TileClass(false, 179);
Tile180 = new TileClass(false, 180);
Tile181 = new TileClass(false, 181);
Tile182 = new TileClass(false, 182);
Tile183 = new TileClass(false, 183);
Tile184 = new TileClass(false, 184);
Tile185 = new TileClass(false, 185);
Tile186 = new TileClass(false, 186);
Tile187 = new TileClass(false, 187);
Tile188 = new TileClass(false, 188);
Tile189 = new TileClass(false, 189);
Tile190 = new TileClass(false, 190);
Tile191 = new TileClass(false, 191);
Tile192 = new TileClass(false, 192);
Tile193 = new TileClass(false, 193);
Tile194 = new TileClass(false, 194);
Tile195 = new TileClass(false, 195);
Tile196 = new TileClass(false, 196);
Tile197 = new TileClass(false, 197);
Tile198 = new TileClass(false, 198);
Tile199 = new TileClass(false, 199);
Tile200 = new TileClass(false, 200);
Tile201 = new TileClass(false, 201);
Tile202 = new TileClass(false, 202);
Tile203 = new TileClass(false, 203);
Tile204 = new TileClass(false, 204);
Tile205 = new TileClass(false, 205);
Tile206 = new TileClass(false, 206);
Tile207 = new TileClass(false, 207);
Tile208 = new TileClass(false, 208);
Tile209 = new TileClass(false, 209);
Tile215 = new TileClass(false, 215);
Tile216 = new TileClass(false, 216);
Tile217 = new TileClass(true, 217);
Tile218 = new TileClass(true, 218);
Tile219 = new TileClass(true, 219);
Tile220 = new TileClass(false, 220);
Tile221 = new TileClass(false, 221);
Tile222 = new TileClass(false, 222);
Tile223 = new TileClass(false, 223);
Tile224 = new TileClass(false, 224);
Tile225 = new TileClass(false, 225);
Tile226 = new TileClass(false, 226);
Tile227 = new TileClass(false, 227);
Tile228 = new TileClass(false, 228);
Tile229 = new TileClass(false, 229);
Tile230 = new TileClass(false, 230);
Tile231 = new TileClass(false, 231);
Tile232 = new TileClass(true, 232);
Tile235 = new TileClass(false, 235);
Tile236 = new TileClass(false, 236);
Tile237 = new TileClass(false, 237);
Tile238 = new TileClass(false, 238);
Tile239 = new TileClass(false, 239);
Tile240 = new TileClass(false, 240);
Tile250 = new TileClass(false, 250);
Tile251 = new TileClass(false, 251);
Tile252 = new TileClass(false, 252);
Tile253 = new TileClass(false, 253);
Tile254 = new TileClass(false, 254);
Tile255 = new TileClass(false, 255);
Tile256 = new TileClass(false, 256);
Tile257 = new TileClass(false, 257);
Tile258 = new TileClass(false, 258);
Tile259 = new TileClass(false, 259);
Tile260 = new TileClass(false, 260);
Tile261 = new TileClass(false, 261);
Tile262 = new TileClass(false, 262);
Tile263 = new TileClass(false, 263);
Tile264 = new TileClass(false, 264);
Tile265 = new TileClass(false, 265);
Tile266 = new TileClass(false, 266);
Tile267 = new TileClass(false, 267);
Tile268 = new TileClass(false, 268);
Tile269 = new TileClass(false, 269);
Tile270 = new TileClass(false, 270);
Tile271 = new TileClass(false, 271);
Tile272 = new TileClass(false, 272);
Tile273 = new TileClass(false, 273);
Tile274 = new TileClass(false, 274);
Tile275 = new TileClass(false, 275);
Tile276 = new TileClass(false, 276);
Tile277 = new TileClass(false, 277);
Tile278 = new TileClass(false, 278);
Tile279 = new TileClass(false, 279);
Tile280 = new TileClass(false, 280);
Tile281 = new TileClass(false, 281);
Tile300 = new TileClass(false, 300);
Tile301 = new TileClass(true, 301);
Tile302 = new TileClass(false, 302);
Tile303 = new TileClass(false, 303);
Tile304 = new TileClass(false, 304);
Tile305 = new TileClass(true, 305);
Tile306 = new TileClass(false, 306);
Tile307 = new TileClass(false, 307);
Tile308 = new TileClass(false, 308);
Tile309 = new TileClass(true, 309);
Tile310 = new TileClass(false, 310);
Tile311 = new TileClass(false, 311);
Tile312 = new TileClass(false, 312);
Tile313 = new TileClass(true, 313);
Tile314 = new TileClass(false, 314);
Tile315 = new TileClass(false, 315);
Tile320 = new TileClass(false, 320);
Tile321 = new TileClass(false, 321);
Tile322 = new TileClass(false, 322);
Tile323 = new TileClass(false, 323);
Tile324 = new TileClass(false, 324);
Tile325 = new TileClass(false, 325);
Tile326 = new TileClass(false, 326);
Tile327 = new TileClass(false, 327);
Tile328 = new TileClass(true, 328);
Tile329 = new TileClass(true, 329);
Tile330 = new TileClass(true, 330);
Tile331 = new TileClass(true, 331);
Tile332 = new TileClass(false, 332);
Tile333 = new TileClass(false, 333);
Tile334 = new TileClass(false, 334);
Tile335 = new TileClass(false, 335);
Tile340 = new TileClass(false, 340);
Tile341 = new TileClass(false, 341);
Tile342 = new TileClass(true, 342);
Tile343 = new TileClass(false, 343);
Tile344 = new TileClass(false, 344);
Tile345 = new TileClass(false, 345);
Tile346 = new TileClass(true, 346);
Tile347 = new TileClass(false, 347);
Tile348 = new TileClass(false, 348);
Tile349 = new TileClass(false, 349);
Tile350 = new TileClass(true, 350);
Tile351 = new TileClass(false, 351);
Tile352 = new TileClass(false, 352);
Tile353 = new TileClass(false, 353);
Tile354 = new TileClass(true, 354);
Tile355 = new TileClass(false, 355);
Tile360 = new TileClass(false, 360);
Tile361 = new TileClass(false, 361);
Tile362 = new TileClass(false, 362);
Tile363 = new TileClass(false, 363);
Tile364 = new TileClass(true, 364);
Tile365 = new TileClass(true, 365);
Tile366 = new TileClass(true, 366);
Tile367 = new TileClass(true, 367);
Tile368 = new TileClass(false, 368);
Tile369 = new TileClass(false, 369);
Tile370 = new TileClass(false, 370);
Tile371 = new TileClass(false, 371);
Tile372 = new TileClass(false, 372);
Tile373 = new TileClass(false, 373);
Tile374 = new TileClass(false, 374);
Tile375 = new TileClass(false, 375);
enemy1 = new EnemyClass(4, 0, 8);
enemy2 = new EnemyClass(0, 4, 8);
rider = {pickUp:{xTile:-1, yTile:-1, x:-100, y:-100}, dropOff:{xTile:-1, yTile:-1, x:-100, y:-100}, time:0};
busStops = [new BusStopClass(16, 1, 0, 1), new BusStopClass(19, 2, -1, 0), new BusStopClass(12, 4, 0, 1), new BusStopClass(20, 4, 0, 1), new BusStopClass(4, 5, 0, 1), new BusStopClass(15, 5, 1, 0), new BusStopClass(10, 6, 1, 0), new BusStopClass(19, 6, -1, 0), new BusStopClass(24, 6, -1, 0), new BusStopClass(6, 7, -1, 0), new BusStopClass(8, 8, 0, 1), new BusStopClass(13, 8, 0, 1), new BusStopClass(15, 8, 1, 0), new BusStopClass(2, 9, 1, 0), new BusStopClass(18, 9, 0, 1), new BusStopClass(23, 9, 0, -1), new BusStopClass(10, 10, -1, 0), new BusStopClass(25, 10, -1, 0), new BusStopClass(7, 11, 1, 0), new BusStopClass(15, 11, 1, 0), new BusStopClass(20, 11, -1, 0), new BusStopClass(17, 12, 0, -1), new BusStopClass(4, 13, 0, -1), new BusStopClass(8, 13, 0, 1), new BusStopClass(11, 13, 0, -1), new BusStopClass(18, 13, -1, 0), new BusStopClass(25, 13, -1, 0), new BusStopClass(15, 14, -1, 0), new BusStopClass(21, 14, 0, 1), new BusStopClass(23, 15, -1, 0), new BusStopClass(2, 16, 1, 0), new BusStopClass(7, 16, 1, 0), new BusStopClass(18, 16, 1, 0), new BusStopClass(13, 17, 0, -1), new BusStopClass(3, 18, 0, 1), new BusStopClass(9, 18, 0, 1), new BusStopClass(22, 18, -1, 0), new BusStopClass(1, 19, 1, 0), new BusStopClass(6, 19, -1, 0), new BusStopClass(11, 20, -1, 0), new BusStopClass(16, 20, 0, 1), new BusStopClass(19, 20, 0, -1), new BusStopClass(3, 21, 0, 1), new BusStopClass(12, 21, 1, 0), new BusStopClass(20, 21, -1, 0), new BusStopClass(1, 22, 1, 0), new BusStopClass(7, 23, 0, 1), new BusStopClass(10, 23, 0, -1), new BusStopClass(23, 23, -1, 0), new BusStopClass(13, 24, 0, -1), new BusStopClass(17, 24, 0, 1), new BusStopClass(21, 24, 0, 1), new BusStopClass(6, 25, 1, 0), new BusStopClass(15, 25, 1, 0), new BusStopClass(2, 26, 0, -1), new BusStopClass(8, 26, 0, -1), new BusStopClass(12, 26, -1, 0), new BusStopClass(25, 26, -1, 0), new BusStopClass(16, 27, 0, -1), new BusStopClass(20, 27, 1, 0), new BusStopClass(10, 28, 0, -1), new BusStopClass(21, 29, 0, -1), new BusStopClass(24, 29, 0, -1)];
rider.onBoarding = function () {
hero.braking = "normal";
hero.turning = "normal";
hero.speed = 0;
game.interaction = false;
Timer.markPickUp();
rider.state = "boarding";
alertWindow.alert("boarding");
};
rider.onBoarded = function () {
rider.state = "riding";
game.interaction = true;
rider.dropOff.clip._x = rider.dropOff.x;
rider.dropOff.clip._y = rider.dropOff.y;
};
rider.onDroppingOff = function () {
hero.braking = "normal";
hero.turning = "normal";
hero.speed = 0;
this.fare = Timer.markDropOff();
_root.faresPanel.addFare(this.fare);
game.interaction = false;
rider.state = "droppingOff";
alertWindow.alert("droppingOff");
};
rider.onDroppedOff = function () {
rider.state = "waiting";
game.interaction = true;
chooseRider();
};
hero = {xTile:2, yTile:5, maxSpeed:17, maxReverseSpeed:-12, speed:0, accel:0.5, decel:0.2, rotation:0, health:100, turning:"normal", braking:"normal"};
hero.damage = function ($amount) {
hero.health = hero.health - $amount;
if (hero.health <= 0) {
game.interaction = false;
_root.gameOver = "damage";
gotoAndPlay ("gameOver");
}
};
hero.turnAround = function () {
_root.heroDisplay.uTurn();
};
buildMap(_root["map" + game.currentMap]);
_root.createEmptyMovieClip("controller", 10);
controller.onEnterFrame = function () {
if (game.interaction) {
detectKeys();
updateHero();
Timer.update();
}
};
Frame 61
game.interaction = true;
stop();
Frame 75
game.interaction = false;
stopAllSounds();
Frame 92
stop();
Frame 101
gotoAndPlay ("game");
Symbol 333 MovieClip Frame 1
stop();
Symbol 333 MovieClip Frame 10
stop();
Symbol 341 MovieClip [heroDisplay] Frame 1
function uTurn() {
this.uTurnMC.gotoAndPlay("show");
}
this.onEnterFrame = function () {
var _local1 = _root;
gotoAndPlay(((_local1.hero.braking != "normal") ? (_local1.hero.braking) : (_local1.hero.turning)));
};
Symbol 344 MovieClip [enemy2] Frame 1
stop();
Symbol 346 MovieClip [enemy1] Frame 1
stop();
Symbol 352 MovieClip [pickUp] Frame 37
gotoAndPlay ("loop");
Symbol 354 MovieClip [dropOff] Frame 37
gotoAndPlay ("loop");
Symbol 356 MovieClip [pickUpArrow] Frame 42
gotoAndPlay ("loop");
Symbol 358 MovieClip [dropOffArrow] Frame 42
gotoAndPlay ("loop");
Symbol 368 MovieClip Frame 1
stop();
Symbol 385 Button
on (release) {
nextFrame();
}
Symbol 395 Button
on (release) {
prevFrame();
}
Symbol 407 MovieClip Frame 1
stop();
Symbol 410 Button
on (release) {
gotoAndPlay ("start");
}
Symbol 421 Button
on (release) {
getURL ("http://harrypotter.warnerbros.com/wizardshop/products-homevideo.html", "_blank");
}
Symbol 424 Button
on (release) {
getURL ("http://harrypotter.warnerbros.com/", "_blank");
}
Symbol 428 Button
on (release) {
getURL ("http://harrypotter.warnerbros.com/main/homepage/home.html?fromsite=knight", "_blank");
}
Symbol 430 MovieClip Frame 1
killer.useHandCursor = false;
Symbol 440 MovieClip Frame 1
gotoAndStop((_root.rider.identity % _totalframes) + 1);
Symbol 443 MovieClip Frame 1
function alert($state) {
gotoAndPlay($state);
}
stop();
Symbol 443 MovieClip Frame 6
stop();
Symbol 443 MovieClip Frame 10
dialogue = ("Hello. I need a ride and I need to be there in " + _root.Timer.travelEstimate) + " seconds.";
btn.useHandCursor = false;
btn.onRelease = function () {
_root.rider.onBoarded();
gotoAndStop ("hide");
};
Symbol 443 MovieClip Frame 64
_root.rider.onBoarded();
gotoAndStop ("hide");
Symbol 443 MovieClip Frame 70
options = [("It took you " + _root.Timer.travelTime) + " seconds. Thank you very much.", ("You got me here in " + _root.Timer.travelTime) + " seconds. I am most grateful.", ("Thank you for getting me here in " + _root.Timer.travelTime) + " seconds.", ("You got me here with " + (_root.Timer.travelEstimate - _root.Timer.travelTime)) + " seconds to go."];
dialogue = options[random(options.length)];
btn.useHandCursor = false;
btn.onRelease = function () {
_root.rider.onDroppedOff();
gotoAndStop ("hide");
};
Symbol 443 MovieClip Frame 119
_root.rider.onDroppedOff();
gotoAndStop ("hide");
Symbol 444 Button
on (keyPress "<Space>") {
hero.rotation = hero.rotation + 180;
hero.rotation = hero.rotation % 360;
_root.playSound(skid);
hero.clip._rotation = hero.rotation;
hero.turnAround();
}
Symbol 455 MovieClip Frame 1
this.onEnterFrame = function () {
damage = Math.floor(100 - _root.hero.health);
if (_currentframe < Math.floor(101 - _root.hero.health)) {
nextFrame();
} else {
stop();
}
};
Symbol 455 MovieClip Frame 101
delete onEnterFrame;
Symbol 470 MovieClip Frame 1
stop();
Symbol 470 MovieClip Frame 22
stop();
Symbol 471 MovieClip Frame 1
function addFare() {
var _local2 = this;
fares++;
var _local1 = fares.toString();
i = _local1.length - 1;
while (i >= 0) {
_local2["fareRoll" + ((_local1.length - i) - 1)].gotoAndPlay("roll");
_local2["fare" + ((_local1.length - i) - 1)] = _local1.charAt(i);
i--;
}
_root.game.passengers = fares;
trace(_root.game.passengers);
}
fares = 0;
Symbol 479 MovieClip Frame 2
gotoAndPlay(((_root.hero.speed == 0) ? "normal" : "driving"));
Symbol 479 MovieClip Frame 15
gotoAndPlay(((_root.hero.speed == 0) ? "stopDriving" : "stillDriving"));
Symbol 479 MovieClip Frame 31
gotoAndPlay ("normal");
Symbol 485 MovieClip Frame 2
gotoAndPlay(_root.hero.turning);
Symbol 485 MovieClip Frame 17
if (_root.hero.turning == "left") {
gotoAndPlay ("stillLeft");
}
Symbol 485 MovieClip Frame 29
gotoAndPlay ("normal");
Symbol 485 MovieClip Frame 43
if (_root.hero.turning == "right") {
gotoAndPlay ("stillRight");
}
Symbol 485 MovieClip Frame 56
gotoAndPlay ("normal");
Symbol 488 Button
on (release, keyPress "p") {
gotoAndPlay ("reveal");
_root.game.interaction = false;
}
Symbol 490 Button
on (release) {
_parent.gotoAndPlay("hide");
}
Symbol 491 MovieClip Frame 1
stop();
Symbol 492 MovieClip Frame 1
stop();
Symbol 492 MovieClip Frame 20
stop();
Symbol 492 MovieClip Frame 43
stop();
_root.game.interaction = true;
Symbol 498 Button
on (release) {
_parent.gotoAndPlay("playAgain");
}
Symbol 500 MovieClip Frame 1
switch (_root.gameOver) {
case "time" :
reason = "You ran out of time.";
break;
case "damage" :
reason = "You are an unsafe driver. Your time behind the wheel has ended. Practice your driving skills by trying the game again.";
}
reason = reason + "\r\r";
if (_root.game.passengers == 0) {
reason = reason + "You delivered no passengers. Perhaps you should try again.";
} else {
reason = reason + (("You successfully delivered " + _root.game.passengers) + " passenger");
if (_root.game.passengers > 1) {
reason = reason + "s";
}
reason = reason + ". ";
if (_root.game.passengers < 5) {
reason = reason + "With more practice, you are sure to do better.";
} else if (_root.game.passengers < 10) {
reason = reason + "Nicely done. There is definitely room for improvement.";
} else if (_root.game.passengers < 20) {
reason = reason + "Very good. You are good driver. Try again to see if you can do better.";
} else if (_root.game.passengers < 30) {
reason = reason + "Great work! Your driving skills are top notch.";
} else {
reason = reason + "Brilliant! You would be well suited to drive the real Knight Bus.";
}
}