Frame 1
stop();
fscommand ("fullscreen", "false");
fscommand ("allowscale", "false");
fscommand ("showmenu", "false");
Frame 2
loadingbar.onEnterFrame = function () {
if (_root.getBytesLoaded() >= _root.getBytesTotal()) {
_root.gotoAndPlay("init");
} else {
this._xscale = (_root.getBytesLoaded() / _root.getBytesTotal()) * 100;
}
};
stop();
Frame 5
function WorldToScreen(world_x, world_y, world_z) {
x = Math.round((world_x * 7) + ((world_z * 5) * 1.4));
y = Math.round(((-(world_z * 5)) + ((world_x * 7) * 0.71426)) - (world_y * 5));
return([x, y]);
}
var Snd_hit = new Sound();
Snd_hit.attachSound("hit_1");
var Snd_hit2 = new Sound();
Snd_hit2.attachSound("hit_2");
var B = new Object();
B.clip = "tile_blktop";
B.oktodrive = true;
B.effects = new Object();
B.effects.bumpy = 0;
B.effects.drag = 0;
var P = new Object();
P.clip = "tile_pothole";
P.oktodrive = true;
P.effects = new Object();
P.effects.bumpy = 5;
P.effects.drag = 0.08;
var L = new Object();
L.clip = "obj_lightpole";
L.doWhenHit = function (speed, angle, tile) {
if (Math.abs(_root.game.player.speed) >= 0.5) {
_root.Snd_hit.start();
}
_root.game.player.car_x = _root.game.player.car_x + ((-speed) * Math.sin((angle * Math.PI) / 180));
_root.game.player.car_z = _root.game.player.car_z + ((-speed) * Math.cos((angle * Math.PI) / 180));
_root.game.player.speed = -(_root.game.player.speed * 0.8);
};
var H = new Object();
H.clip = "obj_hydrant";
H.doWhenHit = function (speed, angle, tile) {
if (Math.abs(_root.game.player.speed) >= 0.5) {
_root.Snd_hit.start();
}
_root.game.player.car_x = _root.game.player.car_x + ((-speed) * Math.sin((angle * Math.PI) / 180));
_root.game.player.car_z = _root.game.player.car_z + ((-speed) * Math.cos((angle * Math.PI) / 180));
_root.game.player.speed = -(_root.game.player.speed * 0.8);
};
var S = new Object();
S.clip = "obj_sp_cone";
S.doWhenHit = function (speed, angle, tile) {
_root.Snd_hit2.start();
_root.score = _root.score + 50;
_root.cones_hit++;
this.speed = speed * 1.8;
this.angle = angle + (random(30) - 15);
if (this.angle < 0) {
this.angle = 360 + this.angle;
}
this.angle = this.angle % 360;
var _local3 = "hit_" + (45 * Math.floor(this.angle / 45));
this.gotoAndStop(_local3);
_root.game.player.speed = _root.game.player.speed * 0.8;
this.onEnterFrame = this.doAfterHit;
tile.object = null;
};
S.doAfterHit = function () {
if ((Math.abs(this.trans_x) + Math.abs(this.trans_z)) >= 0.01) {
this.trans_x = this.speed * Math.sin((this.angle * Math.PI) / 180);
this.trans_z = this.speed * Math.cos((this.angle * Math.PI) / 180);
this.pos_x = this.pos_x + this.trans_x;
this.pos_z = this.pos_z + this.trans_z;
var _local3 = _root.WorldToScreen(this.pos_x, 0, this.pos_z);
var _local4 = Math.floor(((world.totaldepth - (this.pos_z + 8)) * 1000) + this.pos_x);
this.swapDepths(_local4);
this._x = _local3[0];
this._y = _local3[1];
this.speed = this.speed * 0.8;
this.t_row = Math.floor(this.pos_z / _root.world.tile_height);
this.t_col = Math.floor(this.pos_x / _root.world.tile_width);
this.t_tile = _root.game[(("tile_" + this.t_row) + "_") + this.t_col];
this.t_object = this.t_tile.object;
if (this.t_object) {
_local3 = WorldToScreen(this.t_object.pos_x, 0, this.t_object.pos_z);
if (this.hitTest(_local3[0] + _root.game._x, _local3[1] + _root.game._y, true)) {
this.t_object = null;
this.t_object.doWhenHit(this.speed, this.angle, this.t_tile);
}
}
} else {
this._alpha = this._alpha - 5;
if (this._alpha <= 0) {
this.removeMovieClip();
}
}
};
var C = new Object();
C.clip = "obj_cone";
C.doWhenHit = function (speed, angle, tile) {
_root.Snd_hit2.start();
_root.score = _root.score + 10;
_root.cones_hit++;
this.speed = speed * 1.8;
this.angle = angle + (random(30) - 15);
if (this.angle < 0) {
this.angle = 360 + this.angle;
}
this.angle = this.angle % 360;
var _local3 = "hit_" + (45 * Math.floor(this.angle / 45));
this.gotoAndStop(_local3);
_root.game.player.speed = _root.game.player.speed * 0.8;
this.onEnterFrame = this.doAfterHit;
tile.object = null;
};
C.doAfterHit = function () {
if ((Math.abs(this.trans_x) + Math.abs(this.trans_z)) >= 0.01) {
this.trans_x = this.speed * Math.sin((this.angle * Math.PI) / 180);
this.trans_z = this.speed * Math.cos((this.angle * Math.PI) / 180);
this.pos_x = this.pos_x + this.trans_x;
this.pos_z = this.pos_z + this.trans_z;
var _local3 = _root.WorldToScreen(this.pos_x, 0, this.pos_z);
var _local4 = Math.floor(((world.totaldepth - (this.pos_z + 8)) * 1000) + this.pos_x);
this.swapDepths(_local4);
this._x = _local3[0];
this._y = _local3[1];
this.speed = this.speed * 0.8;
this.t_row = Math.floor(this.pos_z / _root.world.tile_height);
this.t_col = Math.floor(this.pos_x / _root.world.tile_width);
this.t_tile = _root.game[(("tile_" + this.t_row) + "_") + this.t_col];
this.t_object = this.t_tile.object;
if (this.t_object) {
_local3 = WorldToScreen(this.t_object.pos_x, 0, this.t_object.pos_z);
if (this.hitTest(_local3[0] + _root.game._x, _local3[1] + _root.game._y, true)) {
this.t_object = null;
this.t_object.doWhenHit(this.speed, this.angle, this.t_tile);
}
}
} else {
this._alpha = this._alpha - 5;
if (this._alpha <= 0) {
this.removeMovieClip();
}
}
};
var map = new Array();
map[0] = [B, B, B, B, B, B, B, B, B, B, B, B];
map[1] = [B, B, B, B, B, B, B, B, B, B, B, B];
map[2] = [B, B, B, P, B, B, B, B, P, B, B, B];
map[3] = [B, B, B, B, B, B, B, B, B, B, B, B];
map[4] = [B, B, B, B, B, B, B, B, B, B, B, B];
map[5] = [B, B, B, B, B, B, P, B, B, B, B, B];
map[6] = [B, B, P, B, B, B, B, B, B, B, B, B];
map[7] = [B, B, B, P, B, B, B, B, B, B, B, B];
map[8] = [B, B, B, B, B, B, B, B, B, B, B, B];
map[9] = [B, B, B, B, B, B, B, B, B, B, B, B];
map[10] = [B, B, B, B, B, B, B, P, B, B, B, B];
map[11] = [B, B, B, B, B, B, B, B, B, B, B, B];
map[12] = [B, B, B, B, B, B, B, B, B, B, B, B];
var objects = new Array();
objects[0] = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
objects[1] = [0, S, 0, C, 0, C, C, 0, 0, S, 0, 0];
objects[2] = [0, C, 0, 0, H, 0, 0, 0, C, L, 0, 0];
objects[3] = [0, C, C, C, 0, 0, C, 0, 0, 0, C, 0];
objects[4] = [0, C, 0, 0, C, S, 0, 0, 0, C, C, 0];
objects[5] = [0, L, C, 0, 0, 0, C, L, 0, C, 0, 0];
objects[6] = [0, 0, 0, S, C, C, C, C, 0, C, 0, 0];
objects[7] = [0, L, 0, 0, 0, C, 0, C, 0, 0, H, 0];
objects[8] = [0, C, C, C, C, 0, L, 0, C, 0, C, 0];
objects[9] = [0, C, S, C, 0, 0, C, C, C, 0, H, 0];
objects[10] = [0, 0, C, C, 0, 0, C, S, C, 0, 0, 0];
objects[11] = [0, C, C, C, 0, S, C, C, C, 0, L, 0];
objects[12] = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
var world = new Object();
world.tile_width = 10;
world.tile_height = 10;
world.totaldepth = world.tile_height * map.length;
world.totalwidth = world.tile_width * map[0].length;
var screen = new Object();
screen.scroll_x = 0;
screen.scroll_y = 0;
screen.keepplayerat_x = 200;
screen.keepplayerat_y = 200;
var player = new Object();
player.car_x = 55;
player.car_y = 0;
player.car_z = 55;
player.speed = 0;
player.maxspeed = 2;
player.accelrate = 0.2;
player.decelrate = 0.9;
player.angle = 0;
player.anglechange = 0;
player.maxanglechange = 10;
player.anglechangerate = 7;
player.allowturns = true;
stop();
Frame 11
var lives = 3;
var score = 0;
var row = 0;
while (row < _root.map.length) {
var col = 0;
while (col < _root.map[row].length) {
if ((!_root.map[row][col]) || (_root.map[row][col] == 0)) {
} else {
var the_tile = ((("tile_" + row) + "_") + col);
var world_x = (world.tile_width * col);
var world_y = 0;
var world_z = (world.tile_height * row);
var newdepth = Math.floor(((world.totaldepth - world_z) * 1000) + world_x);
_root.game.attachMovie(_root.map[row][col].clip, the_tile, newdepth, _root.map[row][col]);
var temp = _root.WorldToScreen(world_x, world_y, world_z);
_root.game[the_tile]._x = temp[0];
_root.game[the_tile]._y = temp[1];
_root.game[the_tile].swapDepths(temp[1] + temp[0]);
if ((!_root.objects[row][col]) || (_root.objects[row][col] == 0)) {
} else {
var the_object = ((("object_" + row) + "_") + col);
var world_x = ((world.tile_width * col) + (world.tile_width / 2));
var world_y = 0;
var world_z = ((world.tile_height * row) + (world.tile_height / 2));
var newdepth = Math.floor(((world.totaldepth - world_z) * 1000) + world_x);
_root.game.attachMovie(_root.objects[row][col].clip, the_object, newdepth, _root.objects[row][col]);
var temp = _root.WorldToScreen(world_x, world_y, world_z);
_root.game[the_object]._x = temp[0];
_root.game[the_object]._y = temp[1];
_root.game[the_object].pos_x = world_x;
_root.game[the_object].pos_z = world_z;
_root.game[the_tile].object = _root.game[the_object];
}
}
col++;
}
row++;
}
var newdepth = Math.floor(((world.totaldepth - player.car_z) * 1000) + player.car_x);
game.attachMovie("player", "player", newdepth, player);
var temp = WorldToScreen(player.car_x, player.car_y, player.car_z);
game.player._x = temp[0];
game.player._y = temp[1];
game.player.stop();
game.player.car_collider.stop();
game.player.car_collider._visible = false;
_root.focus_x = temp[0];
_root.focus_y = temp[1];
game.onEnterFrame = function () {
var _local4 = _root.screen.keepplayerat_x - _root.focus_x;
var _local3 = _root.screen.keepplayerat_y - _root.focus_y;
var _local6 = Math.floor(this._x + ((_local4 - this._x) * 0.2));
var _local5 = Math.floor(this._y + ((_local3 - this._y) * 0.2));
this._x = _local6;
this._y = _local5;
};
stop();
Frame 20
timer.gameStartTime = getTimer();
timer.gameDuration = 30000;
timer.gameTimerStarted = false;
timer.display = 30;
timer.onEnterFrame = function () {
gameTimeLeft = this.gameDuration - (getTimer() - this.gameStartTime);
if (gameTimeLeft <= 0) {
timer.display = 0;
this._xscale = 0;
_root.timer.onEnterFrame = null;
_root.game.player.onEnterFrame = null;
_root.gotoAndPlay("game_over");
} else {
secondsleft = Math.ceil(gameTimeLeft / 1000);
timer.display = secondsleft;
this._xscale = ((secondsleft * 1000) / this.gameDuration) * 100;
}
};
game.player.onEnterFrame = function () {
if (Key.isDown(38)) {
this.speed = Math.min(this.maxspeed, this.speed + this.accelrate);
} else if (Key.isDown(40)) {
this.speed = Math.max(-this.maxspeed, this.speed - this.accelrate);
} else if (Math.abs(this.speed) <= 0.1) {
this.speed = 0;
} else {
this.speed = this.speed * this.decelrate;
}
if (this.car_tile.effects.drag) {
this.speed = this.speed - (this.speed * this.car_tile.effects.drag);
}
if (Key.isDown(39) && (this.allowturns == true)) {
this.speedpercent = this.speed / this.maxspeed;
this.anglechange = Math.min(this.maxanglechange, this.maxanglechange * this.speedpercent);
this.angle = this.angle + this.anglechange;
} else if (Key.isDown(37) && (this.allowturns == true)) {
this.speedpercent = this.speed / this.maxspeed;
this.anglechange = Math.max(-this.maxanglechange, (-this.maxanglechange) * this.speedpercent);
this.angle = this.angle + this.anglechange;
}
if (this.angle < 0) {
this.angle = 360 + this.angle;
}
this.angle = this.angle % 360;
this.stepfactor_x = Math.sin((this.angle * Math.PI) / 180);
this.stepfactor_z = Math.cos((this.angle * Math.PI) / 180);
this.t_car_x = this.car_x + (this.speed * this.stepfactor_x);
this.t_car_z = this.car_z + (this.speed * this.stepfactor_z);
if (this.speed >= 0) {
this.t_bumper_x = this.t_car_x + (6 * this.stepfactor_x);
this.t_bumper_z = this.t_car_z + (6 * this.stepfactor_z);
} else {
this.t_bumper_x = this.t_car_x + (-6 * this.stepfactor_x);
this.t_bumper_z = this.t_car_z + (-6 * this.stepfactor_z);
}
this.t_car_row = Math.floor(this.t_car_z / _root.world.tile_height);
this.t_car_col = Math.floor(this.t_car_x / _root.world.tile_width);
this.t_car_tile = _root.game[(("tile_" + this.t_car_row) + "_") + this.t_car_col];
this.t_bumper_row = Math.floor(this.t_bumper_z / _root.world.tile_height);
this.t_bumper_col = Math.floor(this.t_bumper_x / _root.world.tile_width);
this.t_bumper_tile = _root.game[(("tile_" + this.t_bumper_row) + "_") + this.t_bumper_col];
this.t_bumper_object = this.t_bumper_tile.object;
if (!this.t_bumper_tile.oktodrive) {
this.speed = -(this.speed * 0.8);
this.allowturns = false;
clearInterval(intervalID);
var intervalID = setInterval(function () {
_root.game.player.allowturns = true;
clearInterval(intervalID);
}, 250);
return(undefined);
}
this.car_x = this.t_car_x;
this.car_z = this.t_car_z;
this.bumper_x = this.t_bumper_x;
this.bumper_z = this.t_bumper_z;
this.car_row = this.t_car_row;
this.car_col = this.t_car_col;
this.car_tile = this.t_car_tile;
this.bumper_row = this.t_bumper_row;
this.bumper_col = this.t_bumper_col;
this.bumper_tile = this.t_bumper_tile;
this.bumper_object = this.t_bumper_object;
this.bumper_local_x = this.bumper_x % _root.world.tile_width;
this.bumper_local_z = this.bumper_z % _root.world.tile_height;
if (this.bumper_object) {
var _local3 = WorldToScreen(this.bumper_object.pos_x, 0, this.bumper_object.pos_z);
if (this.car_collider.hitTest(_local3[0] + _root.game._x, _local3[1] + _root.game._y, true)) {
this.bumper_object.doWhenHit(this.speed, this.angle, this.bumper_tile);
}
}
this.pan_pos_x = this.car_x + ((7 * this.speed) * this.stepfactor_x);
this.pan_pos_z = this.car_z + ((7 * this.speed) * this.stepfactor_z);
var _local3 = WorldToScreen(this.pan_pos_x, 0, this.pan_pos_z);
_root.focus_x = _local3[0];
_root.focus_y = _local3[1];
_local3 = WorldToScreen(this.car_x, this.car_y, this.car_z);
var _local5 = Math.floor(((world.totaldepth - this.car_z) * 1000) + this.car_x);
this.swapDepths(_local5);
var _local4 = Math.round(this.angle * 0.1) + 1;
this.gotoAndStop(_local4);
this.car_collider.gotoAndStop(_local4);
this._x = _local3[0];
this._y = _local3[1] + random(this.car_tile.effects.bumpy * Math.abs(this.speed));
};
stop();
Frame 29
if (false) {
}
Frame 30
if (false) {
}
Frame 31
if (false) {
}
Frame 32
if (false) {
}
Frame 38
stop();
Symbol 15 MovieClip Frame 10
stop();
Symbol 17 Button
on (release) {
getURL ("http://www.ultimatearcade.com/", "_blank");
}
Symbol 26 MovieClip Frame 61
_root.gotoAndPlay("loading");
Symbol 39 Button
on (release) {
gotoAndPlay ("countdown");
}
Symbol 208 MovieClip [obj_cone] Frame 1
stop();
Symbol 208 MovieClip [obj_cone] Frame 21
gotoAndPlay ("hit_0");
Symbol 227 MovieClip [obj_sp_cone] Frame 1
stop();
Symbol 227 MovieClip [obj_sp_cone] Frame 21
gotoAndPlay ("hit_0");
Symbol 257 MovieClip Frame 73
_root.gotoAndPlay("play");
Symbol 257 MovieClip Frame 75
stop();
Symbol 278 Button
on (release) {
gotoAndPlay ("countdown");
}
Symbol 282 Button
on (release) {
getURL ("http://www.ultimatearcade.com/sports/games/conecrazy.html", "_blank");
}
Symbol 283 MovieClip Frame 1
stop();
Symbol 283 MovieClip Frame 2
stop();