Frame 4
tb = getBytesTotal();
lb = getBytesLoaded();
v = int((lb / tb) * 100);
thebar.setValue(v);
if (lb < tb) {
gotoAndPlay(_currentframe - 1);
} else if (thebar.mv == thebar.thebar._x) {
play();
} else {
gotoAndPlay(_currentframe - 1);
}
Frame 98
stop();
Frame 107
var lives = 4;
var score = 0;
var level = 1;
Frame 109
function updatePanel() {
txtScore.text = score;
txtLevel.text = level;
lives_mc.gotoAndStop(lives + 1);
}
function crashed() {
e_sound.stop();
h_sound.start();
lives--;
updatePanel();
if (lives == 0) {
restart_mc._visible = true;
restart_mc.gotoAndPlay(1);
} else {
waiter.gotoAndPlay(2);
}
}
function goBack() {
gotoAndPlay(_currentframe - 1 +97);
}
function createGrid() {
var _local3 = 0;
while (_local3 < game.xTiles) {
var _local2 = 0;
while (_local2 < game.yTiles) {
var _local1 = (("t_" + _local3) + "_") + _local2;
game[_local1] = new Object();
game[_local1].x = _local3;
game[_local1].y = _local2;
game.clip.attachMovie("Tile", _local1, (_local3 * 1000) + (_local2 * 2));
game.clip[_local1]._x = _local3 * game.tileH;
game.clip[_local1]._y = _local2 * game.tileW;
game.clip[_local1]._visible = true;
if ((_local3 == game.pathx) || (_local2 == game.pathy)) {
game.clip[_local1].flag._visible = false;
}
game.clip[_local1].tup._visible = false;
game.clip[_local1].tdown._visible = false;
game.clip[_local1].tleft._visible = false;
game.clip[_local1].tright._visible = false;
_local2++;
}
_local3++;
}
var _local2 = 0;
while (_local2 < Math.ceil(game.yTiles / 2)) {
_local3 = 0 + _local2;
while (_local3 < (game.xTiles - _local2)) {
if (_local3 != game.pathx) {
game.clip[(("t_" + _local3) + "_") + _local2].tup._visible = true;
game.clip[(("t_" + _local3) + "_") + ((game.yTiles - 1) - _local2)].tdown._visible = true;
}
_local3++;
}
_local2++;
}
_local3 = 0;
while (_local3 < Math.ceil(game.xTiles / 2)) {
_local2 = 0 + _local3;
while (_local2 < (game.yTiles - _local3)) {
if (_local2 != game.pathy) {
game.clip[(("t_" + _local3) + "_") + _local2].tleft._visible = true;
game.clip[(("t_" + ((game.xTiles - 1) - _local3)) + "_") + _local2].tright._visible = true;
}
_local2++;
}
_local3++;
}
game.clip["t_0_" + game.pathy].tleft._visible = true;
game.clip[(("t_" + (game.xTiles - 1)) + "_") + game.pathy].tright._visible = true;
game.clip[("t_" + game.pathx) + "_0"].tup._visible = true;
game.clip[(("t_" + game.pathx) + "_") + (game.yTiles - 1)].tdown._visible = true;
}
function rotateDirection(plr) {
var _local1 = plr;
switch (_local1.direction) {
case "up" :
_local1.clip._rotation = 0;
return;
case "right" :
_local1.clip._rotation = 90;
return;
case "down" :
_local1.clip._rotation = 180;
return;
case "left" :
_local1.clip._rotation = 270;
}
}
function getX(xtile) {
return((xtile * game.tileW) + (game.tileW / 2));
}
function getY(ytile) {
return((ytile * game.tileH) + (game.tileH / 2));
}
function getMyCorners(x, y, ob) {
var _local1 = ob;
var _local2 = y;
var _local3 = x;
_local1.xtile = Math.floor(_local3 / game.tileW);
_local1.ytile = Math.floor(_local2 / game.tileH);
_local1.downY = Math.floor(((_local2 + _local1.height) - 1) / game.tileH);
_local1.upY = Math.floor((_local2 - _local1.height) / game.tileH);
_local1.leftX = Math.floor((_local3 - _local1.width) / game.tileW);
_local1.rightX = Math.floor(((_local3 + _local1.width) - 1) / game.tileW);
_local1.upleft = game[(("t_" + _local1.upY) + "_") + _local1.leftX].walkable;
_local1.downleft = game[(("t_" + _local1.downY) + "_") + _local1.leftX].walkable;
_local1.upright = game[(("t_" + _local1.upY) + "_") + _local1.rightX].walkable;
_local1.downright = game[(("t_" + _local1.downY) + "_") + _local1.rightX].walkable;
}
function getOrbit(x, y) {
var _local2 = Math.abs(game.pathx - x);
var _local1 = Math.abs(game.pathy - y);
if (_local2 > _local1) {
return(game.pathx - _local2);
}
return(game.pathy - _local1);
}
function go() {
if (!gameon) {
return(undefined);
}
if (Key.isDown(32)) {
game.player.speed = 15;
e_sound.setVolume(50);
if ((game.player.smokes > 0) && (game.player.smokelock == false)) {
removeMovieClip(game.clip["smoke" + game.player.smokes]);
game.clip.attachMovie("smoke", "smoke" + game.player.smokes, 10000000 + game.player.smokes);
game.clip["smoke" + game.player.smokes].player = game.player;
game.clip["smoke" + game.player.smokes]._visible = true;
game.clip["smoke" + game.player.smokes]._x = game.player.x + random(10);
game.clip["smoke" + game.player.smokes]._y = game.player.y + random(10);
game.player.smokes--;
if (game.player.smokes == 0) {
game.player.smokelock = true;
}
}
} else {
e_sound.setVolume(30);
game.player.smokelock = false;
game.player.smokes = 10;
game.player.speed = 10;
}
moveIt(game.player);
moveIt(game.player2);
if (nocpus == 2) {
moveIt(game.player3);
}
}
function moveIt(p) {
var _local1 = p;
if (!_local1.inTransition) {
if (_local1.number == 0) {
getMyCorners(_local1.x, _local1.y, _local1);
if (game.clip[(("t_" + _local1.xtile) + "_") + _local1.ytile].flag._visible == true) {
tx = getX(_local1.xtile);
ty = getY(_local1.ytile);
if ((Math.abs(_local1.x - tx) < 25) && (Math.abs(_local1.y - ty) < 25)) {
game.clip[(("t_" + _local1.xtile) + "_") + _local1.ytile].flag._visible = false;
d_sound.start();
score++;
toeat--;
updatePanel();
if (toeat == 0) {
gameon = false;
level++;
e_sound.stop();
updatePanel();
waiter.gotoAndPlay(2);
}
}
}
tx = getX(_local1.xtile);
ty = getY(_local1.ytile);
}
if (_local1.direction == "up") {
_local1.x = _local1.x;
_local1.y = _local1.y - _local1.speed;
getMyCorners(_local1.x, _local1.y, _local1);
if (_local1.orbit != getOrbit(_local1.xtile, _local1.upY)) {
_local1.x = getX(_local1.xtile);
_local1.y = getY(_local1.ytile);
_local1.passed = 0;
if (_local1.clock) {
_local1.direction = "right";
_local1.clip._rotation = 90;
} else {
_local1.direction = "left";
_local1.clip._rotation = 270;
}
}
_local1.clip._x = _local1.x;
_local1.clip._y = _local1.y;
}
if (_local1.direction == "left") {
_local1.x = _local1.x - _local1.speed;
_local1.y = _local1.y;
getMyCorners(_local1.x, _local1.y, _local1);
if (_local1.orbit != getOrbit(_local1.leftX, _local1.ytile)) {
_local1.x = getX(_local1.xtile);
_local1.y = getY(_local1.ytile);
_local1.passed = 0;
if (_local1.clock) {
_local1.direction = "up";
_local1.clip._rotation = 0;
} else {
_local1.direction = "down";
_local1.clip._rotation = 180;
}
}
_local1.clip._x = _local1.x;
_local1.clip._y = _local1.y;
}
if (_local1.direction == "down") {
_local1.x = _local1.x;
_local1.y = _local1.y + _local1.speed;
getMyCorners(_local1.x, _local1.y, _local1);
if (_local1.orbit != getOrbit(_local1.xtile, _local1.downY)) {
_local1.x = getX(_local1.xtile);
_local1.y = getY(_local1.ytile);
_local1.passed = 0;
if (_local1.clock) {
_local1.direction = "left";
_local1.clip._rotation = 270;
} else {
_local1.direction = "right";
_local1.clip._rotation = 90;
}
}
_local1.clip._x = _local1.x;
_local1.clip._y = _local1.y;
}
if (_local1.direction == "right") {
_local1.x = _local1.x + _local1.speed;
_local1.y = _local1.y;
getMyCorners(_local1.x, _local1.y, _local1);
if (_local1.orbit != getOrbit(_local1.rightX, _local1.ytile)) {
_local1.x = getX(_local1.xtile);
_local1.y = getY(_local1.ytile);
_local1.passed = 0;
if (_local1.clock) {
_local1.direction = "down";
_local1.clip._rotation = 180;
} else {
_local1.direction = "up";
_local1.clip._rotation = 0;
}
}
_local1.clip._x = _local1.x;
_local1.clip._y = _local1.y;
}
if (_local1.number != 0) {
if (_local1.orbit == game.player.orbit) {
if ((Math.abs(_local1.x - game.player.x) < 50) && (Math.abs(_local1.y - game.player.y) < 50)) {
if (_local1.clip.hitTest(game.player.clip)) {
game.clip.attachMovie("crash", "crash", 130000000);
game.clip.crash._x = (_local1.x + game.player.x) / 2;
game.clip.crash._y = (_local1.y + game.player.y) / 2;
game.clip.crash._visible = true;
game.clip.crash.gotoAndPlay(1);
_local1.clip._rotation = _local1.clip._rotation + (-50 + random(100));
game.player.clip._rotation = game.player.clip._rotation + (-50 + random(100));
crashed();
gameon = false;
return;
}
}
}
}
if (_local1.type == "user") {
if (_local1.direction == "up") {
tocheck = _local1.upY;
} else if (_local1.direction == "down") {
tocheck = _local1.downY;
} else if (_local1.direction == "left") {
tocheck = _local1.leftX;
} else if (_local1.direction == "right") {
tocheck = _local1.rightX;
}
if ((((tocheck == game.pathy) && (Key.isDown(37))) && (_local1.ytile == game.pathy)) && ((_local1.xtile > 0) && (_local1.xtile != (game.pathx + 1)))) {
_local1.inTransition = true;
_local1.dx = -7;
if (_local1.direction == "up") {
_local1.dy = -(_local1.speed / 5);
} else {
_local1.dy = _local1.speed / 5;
}
_local1.targettype = "x";
_local1.targetvalue = _local1.xtile - 1;
} else if ((((tocheck == game.pathy) && (Key.isDown(39))) && (_local1.ytile == game.pathy)) && ((_local1.xtile < (game.xTiles - 1)) && (_local1.xtile != (game.pathx - 1)))) {
_local1.inTransition = true;
_local1.dx = 7;
if (_local1.direction == "up") {
_local1.dy = -(_local1.speed / 5);
} else {
_local1.dy = _local1.speed / 5;
}
_local1.targettype = "x";
_local1.targetvalue = _local1.xtile + 1;
} else if ((((tocheck == game.pathx) && (Key.isDown(38))) && (_local1.xtile == game.pathx)) && ((_local1.ytile > 0) && (_local1.ytile != (game.pathy + 1)))) {
_local1.inTransition = true;
_local1.dy = -7;
if (_local1.direction == "left") {
_local1.dx = -(_local1.speed / 5);
} else {
_local1.dx = _local1.speed / 5;
}
_local1.targettype = "y";
_local1.targetvalue = _local1.ytile - 1;
} else if ((((tocheck == game.pathx) && (Key.isDown(40))) && (_local1.xtile == game.pathx)) && ((_local1.ytile < (game.yTiles - 1)) && (_local1.ytile != (game.pathy - 1)))) {
_local1.inTransition = true;
_local1.dy = 7;
if (_local1.direction == "left") {
_local1.dx = -(_local1.speed / 5);
} else {
_local1.dx = _local1.speed / 5;
}
_local1.targettype = "y";
_local1.targetvalue = _local1.ytile + 1;
}
if ((_local1.number == 0) && (_local1.inTransition == true)) {
s_sound.start(0, 1);
}
} else {
if (_local1.direction == "up") {
tocheck = _local1.ytile;
} else if (_local1.direction == "down") {
tocheck = _local1.ytile;
} else if (_local1.direction == "left") {
tocheck = _local1.xtile;
} else if (_local1.direction == "right") {
tocheck = _local1.xtile;
}
if (game.player.orbit != _local1.orbit) {
tomoveorbit = ((game.player.orbit > _local1.orbit) ? 1 : -1);
destorbit = _local1.orbit + tomoveorbit;
othercpuflag = false;
if (nocpus == 2) {
if (_local1.number == 1) {
if (game.player3.orbit == destorbit) {
othercpuflag = true;
}
} else if (_local1.number == 2) {
if (game.player2.orbit == destorbit) {
othercpuflag = true;
}
}
}
randomno = random(7);
if ((othercpuflag == false) && (randomno == 1)) {
if (((_local1.direction == "left") && (tocheck == game.pathx)) && (_local1.passed == 0)) {
_local1.passed = 1;
_local1.inTransition = true;
if (tomoveorbit == 1) {
_local1.dy = -7;
_local1.targetvalue = _local1.ytile - 1;
} else {
_local1.dy = 7;
_local1.targetvalue = _local1.ytile + 1;
}
_local1.dx = -(_local1.speed / 5);
_local1.targettype = "y";
} else if (((_local1.direction == "right") && (tocheck == game.pathx)) && (_local1.passed == 0)) {
_local1.passed = 1;
_local1.inTransition = true;
if (tomoveorbit == 1) {
_local1.dy = 7;
_local1.targetvalue = _local1.ytile + 1;
} else {
_local1.dy = -7;
_local1.targetvalue = _local1.ytile - 1;
}
_local1.dx = _local1.speed / 5;
_local1.targettype = "y";
} else if (((_local1.direction == "up") && (tocheck == game.pathy)) && (_local1.passed == 0)) {
_local1.passed = 1;
_local1.inTransition = true;
if (tomoveorbit == 1) {
_local1.dx = 7;
_local1.targetvalue = _local1.xtile + 1;
} else {
_local1.dx = -7;
_local1.targetvalue = _local1.xtile - 1;
}
_local1.dy = -(_local1.speed / 5);
_local1.targettype = "x";
} else if (((_local1.direction == "down") && (tocheck == game.pathy)) && (_local1.passed == 0)) {
_local1.passed = 1;
_local1.inTransition = true;
if (tomoveorbit == 1) {
_local1.dx = -7;
_local1.targetvalue = _local1.xtile - 1;
} else {
_local1.dx = 7;
_local1.targetvalue = _local1.xtile + 1;
}
_local1.dy = _local1.speed / 5;
_local1.targettype = "x";
}
}
}
}
} else {
_local1.x = _local1.x + _local1.dx;
_local1.y = _local1.y + _local1.dy;
getMyCorners(_local1.x, _local1.y, _local1);
if (_local1.targettype == "x") {
v = Math.abs(_local1.x - getX(_local1.targetvalue));
if ((v < 30) && (_local1.targetvalue == _local1.xtile)) {
_local1.inTransition = false;
_local1.x = getX(_local1.xtile);
_local1.orbit = getOrbit(_local1.xtile, _local1.ytile);
}
} else if (_local1.targettype == "y") {
v = Math.abs(_local1.y - getY(_local1.targetvalue));
if ((v < 30) && (_local1.targetvalue == _local1.ytile)) {
_local1.inTransition = false;
_local1.y = getY(_local1.ytile);
_local1.orbit = getOrbit(_local1.xtile, _local1.ytile);
}
}
if (_local1.number != 0) {
if ((Math.abs(_local1.x - game.player.x) < 50) && (Math.abs(_local1.y - game.player.y) < 50)) {
if (_local1.clip.hitTest(game.player.clip)) {
game.clip.attachMovie("crash", "crash", 130000000);
game.clip.crash._x = (_local1.x + game.player.x) / 2;
game.clip.crash._y = (_local1.y + game.player.y) / 2;
game.clip.crash._visible = true;
game.clip.crash.gotoAndPlay(1);
_local1.clip._rotation = _local1.clip._rotation + (-50 + random(100));
game.player.clip._rotation = game.player.clip._rotation + (-50 + random(100));
crashed();
gameon = false;
return;
}
}
} else {
_local1.clip._x = _local1.x;
_local1.clip._y = _local1.y;
}
}
}
updatePanel();
e_sound = new Sound();
e_sound.attachSound("vrooms");
e_sound.setVolume(30);
s_sound = new Sound();
s_sound.attachSound("screech");
s_sound.setVolume(70);
h_sound = new Sound();
h_sound.attachSound("hithard");
h_sound.setVolume(70);
d_sound = new Sound();
d_sound.attachSound("ding");
d_sound.setVolume(70);
restart_mc._visible = false;
var vlevel = level;
var gameon = false;
var game = new Object();
var toeat = 100;
game_mc._x = 10;
game_mc._y = 10;
game_mc._visible = true;
game_mc._xscale = 70;
game_mc._yscale = 70;
game.clip = game_mc;
game.tileH = 50;
game.tileW = 50;
switch (vlevel) {
case 1 :
game.xTiles = 11;
game.yTiles = 11;
game.pathx = Math.floor(game.xTiles / 2);
game.pathy = Math.floor(game.yTiles / 2);
var nocpus = 1;
var cpu1speed = 5;
var cpu1xtile = 0;
var cpu1ytile = (game.yTiles - 1);
var cpu1direction = "up";
break;
case 2 :
game.xTiles = 11;
game.yTiles = 11;
game.pathx = Math.floor(game.xTiles / 2);
game.pathy = Math.floor(game.yTiles / 2);
var nocpus = 1;
var cpu1speed = 10;
var cpu1xtile = 0;
var cpu1ytile = (game.yTiles - 1);
var cpu1direction = "up";
break;
case 3 :
case 4 :
game.xTiles = 11;
game.yTiles = 11;
game.pathx = Math.floor(game.xTiles / 2);
game.pathy = Math.floor(game.yTiles / 2);
var nocpus = 2;
var cpu1speed = 5;
var cpu1xtile = 0;
var cpu1ytile = (game.yTiles - 1);
var cpu1direction = "up";
var cpu2speed = 5;
var cpu2xtile = (game.pathx + 1);
var cpu2ytile = 0;
var cpu2direction = "right";
break;
default :
game.xTiles = 11;
game.yTiles = 11;
game.pathx = Math.floor(game.xTiles / 2);
game.pathy = Math.floor(game.yTiles / 2);
var nocpus = 2;
var cpu1speed = 10;
var cpu1xtile = 0;
var cpu1ytile = (game.yTiles - 1);
var cpu1direction = "up";
var cpu2speed = 10;
var cpu2xtile = 0;
var cpu2ytile = 0;
var cpu2direction = "right";
}
createGrid();
game.player = new Object();
game.player.number = 0;
game.player.type = "user";
game.player.xtile = game.xTiles - 1;
game.player.ytile = game.yTiles - 1;
game.player.x = getX(game.player.xtile);
game.player.y = getY(game.player.ytile);
game.clip.attachMovie("player", "player", 100000);
game.player.clip = game.clip.player;
game.player.clip.gotoAndStop(2);
game.player.clip._visible = true;
game.player.clip._x = game.player.x;
game.player.clip._y = game.player.y;
game.player.direction = "up";
game.player.clock = false;
game.player.passed = 0;
game.player.afterpasses = 0;
game.player.speed = 10;
game.player.orbit = getOrbit(game.player.xtile, game.player.ytile);
game.player.inTransition = false;
game.player.targettype = "";
game.player.targetvalue = 0;
game.player.dx = 0;
game.player.dy = 0;
game.player.height = 25;
game.player.width = 25;
game.player.smokes = 10;
game.player.smokelock = false;
rotateDirection(game.player);
game.player2 = new Object();
game.player2.number = 1;
game.player2.type = "cpu";
game.player2.xtile = cpu1xtile;
game.player2.ytile = cpu1ytile;
game.player2.x = getX(game.player2.xtile);
game.player2.y = getY(game.player2.ytile);
game.clip.attachMovie("player", "player2", 110000);
game.player2.clip = game.clip.player2;
game.player2.clip._visible = true;
game.player2.clip._x = game.player2.x;
game.player2.clip._y = game.player2.y;
game.player2.direction = cpu1direction;
game.player2.clock = true;
game.player2.passed = "";
game.player2.afterpasses = 0;
game.player2.speed = cpu1speed;
game.player2.orbit = getOrbit(game.player2.xtile, game.player2.ytile);
game.player2.inTransition = false;
game.player2.targettype = "";
game.player2.targetvalue = 0;
game.player2.dx = 0;
game.player2.dy = 0;
game.player2.height = 25;
game.player2.width = 25;
rotateDirection(game.player2);
if (nocpus == 2) {
game.player3 = new Object();
game.player3.number = 2;
game.player3.type = "cpu";
game.player3.xtile = cpu2xtile;
game.player3.ytile = cpu2ytile;
game.player3.x = getX(game.player3.xtile);
game.player3.y = getY(game.player3.ytile);
game.clip.attachMovie("player", "player3", 120000);
game.player3.clip = game.clip.player3;
game.player3.clip._visible = true;
game.player3.clip._x = game.player3.x;
game.player3.clip._y = game.player3.y;
game.player3.direction = cpu2direction;
game.player3.clock = true;
game.player3.passed = 0;
game.player3.afterpasses = 0;
game.player3.speed = cpu2speed;
game.player3.orbit = getOrbit(game.player3.xtile, game.player3.ytile);
game.player3.inTransition = false;
game.player3.targettype = "";
game.player3.targetvalue = 0;
game.player3.dx = 0;
game.player3.dy = 0;
game.player3.height = 25;
game.player3.width = 25;
rotateDirection(game.player3);
}
stop();
Instance of Symbol 76 MovieClip in Frame 109
onClipEvent (enterFrame) {
_parent.go();
}
Symbol 8 MovieClip [player] Frame 3
stop();
Symbol 16 MovieClip [smoke] Frame 17
this.player.smokes++;
stop();
Symbol 18 MovieClip [crash] Frame 10
stop();
Symbol 29 MovieClip Frame 1
function setValue(v) {
mv = (v / 100) * 144;
}
var mv = 0;
Instance of Symbol 28 MovieClip in Symbol 29 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_parent.thebar._x < _parent.mv) {
if ((_parent.mv - _parent.thebar._x) >= 2) {
_parent.thebar._x = _parent.thebar._x + 2;
} else {
_parent.thebar._x++;
}
}
}
Symbol 42 Button
on (release, keyPress "<Space>") {
gotoAndPlay ("game");
}
Symbol 47 Button
on (release) {
gotoAndStop ("instructions");
}
Symbol 52 Button
on (release) {
gotoAndStop ("credits");
}
Symbol 57 Button
on (release) {
getURL ("http://www.funflashgames.com/", "_blank");
}
Symbol 61 Button
on (release) {
getURL ("http://www.funflashgames.com/freecontent.html", "_blank");
}
Symbol 67 Button
on (release) {
gotoAndStop ("title");
}
Symbol 75 Button
on (release) {
getURL ("http://www.quickflashgames.com/", "_blank");
}
Symbol 88 Button
on (release, keyPress "<Space>") {
if (_parent.gameon == false) {
gotoAndPlay ("goout");
_parent.gameon = true;
_parent.e_sound.start(0, 5000000);
}
}
Symbol 89 MovieClip Frame 10
stop();
Symbol 89 MovieClip Frame 22
stop();
Symbol 95 Button
on (release, keyPress "<Space>") {
gotoAndPlay ("goout");
_parent.gotoAndStop("title");
}
Symbol 98 MovieClip Frame 10
stop();
Symbol 98 MovieClip Frame 22
stop();
Symbol 100 MovieClip Frame 1
stop();
Symbol 100 MovieClip Frame 30
_parent.goBack();