[Tools][Expand/Collapse All]Note that automatic extraction of ActionScript 3 is still pretty much unsupported by swfchan. AS1/AS2 works okay most of the time.Frame 1 (68 B)
var FogAD = new FogAdsAS2({id:"5"});
FogAD.showPreGameAd("FogAD");
Frame 2 (2.34 KiB) ●
var debug = true;
var gameName = "18wheeler3";
stop();
fscommand ("showmenu", "false");
stagewidth = Stage.width;
stageheight = Stage.height;
btnFoggy._width = stagewidth;
btnFoggy._height = stageheight;
mcTaglines.swapDepths(99996);
prel.swapDepths(99997);
mcLogo.swapDepths(99998);
btnFoggy.swapDepths(99999);
fogNo = 0;
prel.onEnterFrame = function () {
var _local4 = Math.random();
if (_local4 < ((_root.getBytesLoaded() / _root.getBytesTotal()) / 5)) {
if (fogNo > 999) {
fogNo = 0;
}
var _local5 = random(2) + 1;
var _local3 = _root.attachMovie("fog_1", "fog" + (fogNo++), fogNo);
_local3.cacheAsBitmap = true;
_local3._x = stagewidth / 2;
_local3._y = stageheight / 2;
_local3._xscale = (_local3._yscale = 0);
_local3.gotoAndStop(random(10) + 1);
_local3.speed = 100;
_local3._alpha = 0;
_local3.grow = Math.random();
_local3.fade = false;
_local3.targetX = random(10);
if (_local3.targetX < 5) {
_local3.targetX = random(10);
if (_local3.targetX < 5) {
_local3.targetX = -100;
} else {
_local3.targetX = stagewidth + 100;
}
_local3.targetY = random(stageheight);
} else {
_local3.targetY = random(10);
if (_local3.targetY < 5) {
_local3.targetY = -100;
} else {
_local3.targetY = stageheight + 100;
}
_local3.targetX = random(stagewidth);
}
_local3.onEnterFrame = function () {
this._x = this._x + (((this.targetX - this._x) / this.speed) * 0.5);
this._y = this._y + (((this.targetY - this._y) / this.speed) * 0.5);
this.speed = this.speed * 0.99;
this._xscale = (this._yscale = this._yscale + (this.grow * 2));
if ((this._alpha < 100) && (!this.fade)) {
this._alpha = this._alpha + 2;
}
if (((((this._x < -50) || (this._y < -50)) || (this._x > (stagewidth + 50))) || (this._y > (stageheight + 50))) || (this._xscale > 200)) {
this.fade = true;
}
if (this.fade) {
this._alpha = this._alpha - 5;
if (this._alpha <= 0) {
delete this.onEnterFrame;
this.removeMovieClip();
}
}
};
}
prel.procent.text = Math.floor((_root.getBytesLoaded() / _root.getBytesTotal()) * 100);
prel.gotoAndStop(prel.procent.text);
if (Number(prel.procent.text) > 99) {
mcLogo.removeMovieClip();
play();
delete this.onEnterFrame;
}
};
Instance of Symbol 51 MovieClip in Frame 2 (70 B)
on (release) {
getURL ("http://www.freeonlinegames.com", "_blank");
}
Frame 3 (35 B)
stop();
mcLogo.swapDepths(99998);
Frame 4 (165 B)
if (!okToPlay) {
gotoAndStop (2);
} else {
prel.removeMovieClip();
btnFoggy.removeMovieClip();
mcTaglines.removeMovieClip();
mcLogo.removeMovieClip();
}
Frame 5 (8 B)
play();
Frame 10 (629 B)
function i_fog() {
getURL ("http://www.freeonlinegames.com/?18wheeler3", "_blank");
}
function add_game() {
getURL ("http://www.freegamesforyourwebsite.com/?18wheeler3", "_blank");
}
attachMovie("game_mask", "game_mask", 5000);
this.setMask(game_mask);
_quality = "LOW";
sound_ON = true;
score = 10000;
var i_r_menu = new ContextMenu();
i_r_menu.hideBuiltInItems();
this.menu = i_r_menu;
var i_r_fog = new ContextMenuItem("More Games from FOG", i_fog);
i_r_menu.customItems.push(i_r_fog);
var add_game_v = new ContextMenuItem("Add This Game to Your Website", add_game);
i_r_menu.customItems.push(add_game_v);
Frame 11 (1.39 KiB) ●
sounds = true;
var s1 = new Sound();
s1.attachSound("glass_brake_small");
var s2 = new Sound();
s2.attachSound("glass_brake_big");
var s3 = new Sound();
s3.attachSound("atmosphere");
var s4 = new Sound();
s4.attachSound("truck_drive");
var s5 = new Sound();
s5.attachSound("truck_drive_faster");
var s6 = new Sound();
s6.attachSound("truck_idle");
var s7 = new Sound();
s7.attachSound("truck_start");
var s8 = new Sound();
s8.attachSound("truck_drive_fastest");
var s9 = new Sound();
s9.attachSound("truck_go_back");
var s10 = new Sound();
s10.attachSound("truck_drift_2");
var s11 = new Sound();
s11.attachSound("truck_hit_trailer");
var s12 = new Sound();
s12.attachSound("AI_horn");
var s13 = new Sound();
s13.attachSound("AI_car_brakes");
var s14 = new Sound();
s14.attachSound("Accept_snd");
var s15 = new Sound();
s15.attachSound("Pick_snd");
var s16 = new Sound();
s16.attachSound("Click_snd");
var s17 = new Sound();
s17.attachSound("Crash_snd");
var s18 = new Sound();
s18.attachSound("jazz_music");
var s19 = new Sound();
s19.attachSound("at_night");
var s20 = new Sound();
s20.attachSound("elec");
var s21 = new Sound();
s21.attachSound("music_in_bar");
var s22 = new Sound();
s22.attachSound("police_siren");
var s23 = new Sound();
s23.attachSound("gun");
var s24 = new Sound();
s24.attachSound("woman_scream");
var s25 = new Sound();
s25.attachSound("bank_alarm");
Frame 15 (587 B)
stop();
tutorialScreen = false;
for_fun = false;
volumeBegin = 0;
score = 10000;
stopAllSounds();
_root.s1.setVolume(volumeBegin);
_root.s18.start(1, 9999);
onEnterFrame = function () {
_root.s1.setVolume(volumeBegin);
if (volumeBegin >= 100) {
volumeBegin = 100;
}
};
Paused = false;
hero.removeMovieClip();
trailerBody.removeMovieClip();
game_menu.removeMovieClip();
houses.removeMovieClip();
AI.removeMovieClip();
over.removeMovieClip();
darker.removeMovieClip();
shoot_scene.removeMovieClip();
HP = 100;
main._x = (-_x) + 300;
main._y = (-_y) + 250;
Frame 38 (1 B)
Frame 39 (295 B)
_x = 0;
_y = 0;
stopAllSounds();
Paused = false;
hero.removeMovieClip();
trailerBody.removeMovieClip();
game_menu.removeMovieClip();
houses.removeMovieClip();
AI.removeMovieClip();
over.removeMovieClip();
darker.removeMovieClip();
shoot_scene.removeMovieClip();
HP = 100;
play();
Frame 40 (548 B)
stop();
_root.s18.stop(["jazz_music"]);
sound_ON = true;
camera_dis = false;
camera_dis_2 = false;
_quality = "HIGH";
Paused = true;
s3.start(1, 99999);
s21.start(1, 99999);
glassbrake = 0;
Mouse.hide();
shoot_scene._x = (-_x) + 300;
shoot_scene._y = (-_y) + 250;
game_mask._x = shoot_scene._x - 300;
game_mask._y = shoot_scene._y - 250;
volumeBegin = 0;
_root.s1.setVolume(volumeBegin);
onEnterFrame = function () {
volumeBegin++;
_root.s1.setVolume(volumeBegin);
if (volumeBegin >= 100) {
volumeBegin = 100;
}
};
Frame 41 (79 B)
if (!for_fun) {
_root.gotoAndPlay(59);
} else {
_root.gotoAndStop(64);
}
Frame 45 (83 B)
tutorialScreen = true;
tut_screen._x = (-_x) + 300;
tut_screen._y = (-_y) + 250;
Frame 49 (236 B)
play();
_x = 0;
_y = 0;
stopAllSounds();
Paused = false;
hero.removeMovieClip();
trailerBody.removeMovieClip();
game_menu.removeMovieClip();
houses.removeMovieClip();
AI.removeMovieClip();
over.removeMovieClip();
HP = 100;
Frame 50 (21.25 KiB) ● ● ●
function i_rotation(i_ob, i_obr) {
var _local2 = i_ob._x - i_obr._x;
var _local1 = i_ob._y - i_obr._y;
var _local3 = Math.atan2(_local1, _local2) / i_alpha;
return(_local3);
}
function sprayParticles(x, y, d) {
smokeC++;
s = _root.attachMovie("smoke", "smoke_" + smokeC, _root.getNextHighestDepth());
s._x = x;
s._y = y;
}
function proj(v1, v2) {
dp = dot(v1, v2);
v2s = (v2.x * v2.x) + (v2.y * v2.y);
x = (dp / v2s) * v2.x;
y = (dp / v2s) * v2.y;
return({x:x, y:y});
}
function dot(p1, p2) {
return((p1.x * p2.x) + (p1.y * p2.y));
}
function updatePoint(p) {
p.x = p.x + p.vx;
p.y = p.y + p.vy;
}
function satisfyConstraint(c) {
xd = (c.p2.x + c.p2.vx) - (c.p1.x + c.p1.vx);
yd = (c.p2.y + c.p2.vy) - (c.p1.y + c.p1.vy);
dis = Math.sqrt((xd * xd) + (yd * yd));
force = ((c.len - dis) / dis) * 0.5;
dx = xd * force;
dy = yd * force;
c.p1.vx = c.p1.vx - dx;
c.p1.vy = c.p1.vy - dy;
c.p2.vx = c.p2.vx + dx;
c.p2.vy = c.p2.vy + dy;
}
function update_bg_tiles() {
i = 0;
while (i < bg_A.length) {
if (bg_A[i]._x < (game_menu._x - 600)) {
if ((!bg_A[i].positioned) == true) {
bg_A[i].last_position = bg_A[i]._x;
bg_A[i].positioned = true;
}
bg_A[i]._x = bg_A[i].last_position + 1200;
bg_A[i].positioned = false;
}
if (bg_A[i]._x > (game_menu._x + 600)) {
if ((!bg_A[i].positioned) == true) {
bg_A[i].last_position = bg_A[i]._x;
bg_A[i].positioned = true;
}
bg_A[i]._x = bg_A[i].last_position - 1200;
bg_A[i].positioned = false;
}
if (bg_A[i]._y < (game_menu._y - 500)) {
if ((!bg_A[i].positioned) == true) {
bg_A[i].last_position = bg_A[i]._y;
bg_A[i].positioned = true;
}
bg_A[i]._y = bg_A[i].last_position + 1000;
bg_A[i].positioned = false;
}
if (bg_A[i]._y > (game_menu._y + 500)) {
if ((!bg_A[i].positioned) == true) {
bg_A[i].last_position = bg_A[i]._y;
bg_A[i].positioned = true;
}
bg_A[i]._y = bg_A[i].last_position - 1000;
bg_A[i].positioned = false;
}
i++;
}
}
function ground_hit(gh) {
engineUP = 0;
if (ground.hitTest(hero._x, hero._y, true)) {
car.engineSpd = (-car.engineSpd) + 0.1;
} else if (ground.hitTest(advance_HIT._x, advance_HIT._y, true)) {
car.engineSpd = (-car.engineSpd) - 0.2;
} else if (ground.hitTest(advance_HIT_2._x, advance_HIT_2._y, true)) {
car.engineSpd = (-car.engineSpd) - 0.2;
} else if (ground.hitTest(advance_HIT_3._x, advance_HIT_3._y, true)) {
car.engineSpd = (-car.engineSpd) + 0.1;
} else if (ground.hitTest(advance_HIT_4._x, advance_HIT_4._y, true)) {
car.engineSpd = (-car.engineSpd) + 0.1;
} else if (ground.hitTest(trailerBody._x, trailerBody._y, true)) {
trace("dfgfdgfdg");
car.engineSpd = (-car.engineSpd) + 0.9;
}
if (ground_hitting == false) {
if (ground.hitTest(hero._x, hero._y, true)) {
attachMovie("explosion_mc", "explosion_mc", 500000, {_x:hero._x, _y:hero._y, _rotation:hero._rotation});
} else if (ground.hitTest(advance_HIT._x, advance_HIT._y, true)) {
attachMovie("explosion_mc", "explosion_mc", 500000, {_x:advance_HIT._x, _y:advance_HIT._y, _rotation:hero._rotation});
} else if (ground.hitTest(advance_HIT_2._x, advance_HIT_2._y, true)) {
attachMovie("explosion_mc", "explosion_mc", 500000, {_x:advance_HIT_2._x, _y:advance_HIT_2._y, _rotation:hero._rotation});
} else if (ground.hitTest(advance_HIT_3._x, advance_HIT_3._y, true)) {
attachMovie("explosion_mc", "explosion_mc", 500000, {_x:advance_HIT_3._x, _y:advance_HIT_3._y, _rotation:hero._rotation});
} else if (ground.hitTest(advance_HIT_4._x, advance_HIT_4._y, true)) {
attachMovie("explosion_mc", "explosion_mc", 500000, {_x:advance_HIT_4._x, _y:advance_HIT_4._y, _rotation:hero._rotation});
} else if (ground.hitTest(trailerBody._x, trailerBody._y, true)) {
attachMovie("explosion_mc", "explosion_mc", 500000, {_x:trailerBody._x, _y:trailerBody._y, _rotation:hero._rotation});
}
random_370_380 = random(5) + 370;
car.p1.vx = 0;
car.p1.vy = 0;
car.p2.vx = 0;
car.p2.vy = 0;
car.p3.vx = 0;
car.p3.vy = 0;
ground_hitting = true;
if (ground_hit_timer >= 30) {
attachMovie("glass_brake", "glass_brake", random_370_380, {_x:hero._x, _y:hero._y, _rotation:hero._rotation});
ground_hit_timer = 0;
}
}
}
function trailer_hit(th) {
engineUP = 0;
if (ground.hitTest(trailerBody._x, trailerBody._y, true)) {
car.engineSpd = (-car.engineSpd) + 0.9;
}
if (trailer_hitting == false) {
if (ground.hitTest(trailerBody._x, trailerBody._y, true)) {
attachMovie("explosion_mc", "explosion_mc", 500000, {_x:trailerBody._x, _y:trailerBody._y, _rotation:hero._rotation});
}
random_370_380 = random(5) + 370;
car.p1.vx = 0;
car.p1.vy = 0;
car.p2.vx = 0;
car.p2.vy = 0;
car.p3.vx = 0;
car.p3.vy = 0;
trailer_hitting = true;
if (ground_hit_timer >= 30) {
attachMovie("glass_brake", "glass_brake", random_370_380, {_x:hero._x, _y:hero._y, _rotation:hero._rotation});
ground_hit_timer = 0;
}
}
}
function AI_hit(j) {
engineUP = 0;
if (AI_CARS_A[i].hitTest(advance_HIT._x, advance_HIT._y, true)) {
car.engineSpd = (-car.engineSpd) - 0.2;
} else if (AI_CARS_A[i].hitTest(advance_HIT_2._x, advance_HIT_2._y, true)) {
car.engineSpd = (-car.engineSpd) - 0.2;
} else if (AI_CARS_A[i].hitTest(advance_HIT_3._x, advance_HIT_3._y, true)) {
car.engineSpd = (-car.engineSpd) + 0.1;
} else if (AI_CARS_A[i].hitTest(advance_HIT_4._x, advance_HIT_4._y, true)) {
car.engineSpd = (-car.engineSpd) + 0.1;
} else if (AI_CARS_A[i].hitTest(trailerBory._x, trailerBody._y, true)) {
car.engineSpd = (-car.engineSpd) + 0.1;
} else if (AI_CARS_A[i].hitTest(trailerBody._x + 30, trailerBody._y + 30, true)) {
car.engineSpd = (-car.engineSpd) + 0.1;
} else if (AI_CARS_A[i].hitTest(trailerBody._x - 30, trailerBody._y - 30, true)) {
car.engineSpd = (-car.engineSpd) + 0.1;
}
if (AI_CARS_A[j].AI_hitting == false) {
if (AI_CARS_A[i].hitTest(advance_HIT._x, advance_HIT._y, true)) {
attachMovie("explosion_mc", "explosion_mc", 500000, {_x:advance_HIT._x, _y:advance_HIT._y, _rotation:hero._rotation});
} else if (AI_CARS_A[i].hitTest(advance_HIT_2._x, advance_HIT_2._y, true)) {
attachMovie("explosion_mc", "explosion_mc", 500000, {_x:advance_HIT_2._x, _y:advance_HIT_2._y, _rotation:hero._rotation});
} else if (AI_CARS_A[i].hitTest(advance_HIT_3._x, advance_HIT_3._y, true)) {
attachMovie("explosion_mc", "explosion_mc", 500000, {_x:advance_HIT_3._x, _y:advance_HIT_3._y, _rotation:hero._rotation});
} else if (AI_CARS_A[i].hitTest(advance_HIT_4._x, advance_HIT_4._y, true)) {
attachMovie("explosion_mc", "explosion_mc", 500000, {_x:advance_HIT_4._x, _y:advance_HIT_4._y, _rotation:hero._rotation});
} else if (AI_CARS_A[i].hitTest(trailerBody._x, trailerBody._y, true)) {
attachMovie("explosion_mc", "explosion_mc", 500000, {_x:trailerBody._x, _y:trailerBody._y, _rotation:hero._rotation});
}
random_370_380 = random(5) + 370;
car.p1.vx = 0;
car.p1.vy = 0;
car.p2.vx = 0;
car.p2.vy = 0;
car.p3.vx = 0;
car.p3.vy = 0;
AI.AI_speed = 0;
AI_CARS_A[j].AI_hitting = true;
if (ground_hit_timer >= 30) {
attachMovie("glass_brake", "glass_brake", random_370_380, {_x:hero._x, _y:hero._y, _rotation:hero._rotation});
ground_hit_timer = 0;
}
}
}
function speed_handle(sh) {
if (Key.isDown(49) and ((!speed_1) == true)) {
keyUP = true;
game_menu.handle._alpha = 100;
if (game_menu.handle._currentframe == 10) {
game_menu.handle.gotoAndPlay(30);
} else {
game_menu.handle.play();
}
speed_1 = true;
speed_2 = false;
speed_3 = false;
car.steerCorrect = 0.8;
}
if (Key.isDown(50) and ((!speed_2) == true)) {
keyUP = true;
game_menu.handle._alpha = 100;
game_menu.handle.play();
speed_1 = false;
speed_2 = true;
speed_3 = false;
car.steerCorrect = 0.7;
}
if (Key.isDown(51) and ((!speed_3) == true)) {
keyUP = true;
game_menu.handle._alpha = 100;
if (game_menu.handle._currentframe == 30) {
game_menu.handle.gotoAndPlay(10);
} else {
game_menu.handle.play();
}
speed_1 = false;
speed_2 = false;
speed_3 = true;
car.steerCorrect = 0.6;
}
}
function matrix_update() {
var _local4 = new flash.geom.Matrix();
_local4.tx = 20;
_local4.ty = -110;
_local4.rotate(hero._rotation * (Math.PI/180));
advance_HIT._x = _local4.tx + hero._x;
advance_HIT._y = _local4.ty + hero._y;
var _local3 = new flash.geom.Matrix();
_local3.tx = -20;
_local3.ty = -110;
_local3.rotate(hero._rotation * (Math.PI/180));
advance_HIT_2._x = _local3.tx + hero._x;
advance_HIT_2._y = _local3.ty + hero._y;
var _local2 = new flash.geom.Matrix();
_local2.tx = -20;
_local2.ty = 20;
_local2.rotate(hero._rotation * (Math.PI/180));
advance_HIT_3._x = _local2.tx + hero._x;
advance_HIT_3._y = _local2.ty + hero._y;
var _local1 = new flash.geom.Matrix();
_local1.tx = 20;
_local1.ty = 20;
_local1.rotate(hero._rotation * (Math.PI/180));
advance_HIT_4._x = _local1.tx + hero._x;
advance_HIT_4._y = _local1.ty + hero._y;
}
hero._x = 885;
hero._y = 361;
trailerBody._x = 1330;
trailerBody._y = 1278;
_x = Math.round(300 - car.p1.x);
_y = Math.round(250 - car.p1.y);
game_menu._x = (-_x) + 300;
game_menu._y = (-_y) + 250;
hero_pos_x = hero._x;
hero_pos_y = hero._y;
bg_A = [bgs.bg_1, bgs.bg_2, bgs.bg_3, bgs.bg_4];
roadArray = [road.road_1, road.road_2];
AI_CARS_A = [AI.AI_car_1.car, AI.AI_car_2.car, AI.AI_car_3.car, AI.AI_car_4.car];
game_quality = "low";
arrow_ob = trailerBody;
s18.stop(["menu_music"]);
on_road = true;
speed_1 = true;
speed_2 = false;
speed_3 = false;
ground_hitting = false;
trailerCon = false;
bgs.bg_1.positioned = false;
bgs.bg_2.positioned = false;
bgs.bg_3.positioned = false;
bgs.bg_4.positioned = false;
tutorial_text_3 = false;
tutorial = false;
hitting = false;
smoke_depth = 0;
engineUP = 0;
text_num = 1;
game_menu.handle._alpha = 0;
s7_timer = 50;
ground_hit_timer = 50;
doing_nothing_timer = 50;
HP = 95;
game_menu.HP._alpha = 0;
driftFX = 0;
_root.s18.stop(["jazz_music"]);
stop();
AI.swapDepths(_root.getNextHighestDepth());
hero.swapDepths(_root.getNextHighestDepth());
trailerBody.swapDepths(_root.getNextHighestDepth());
houses.swapDepths(_root.getNextHighestDepth());
over.swapDepths(_root.getNextHighestDepth());
game_menu.swapDepths(999999999);
var car = new Object();
car.steerDir = 0;
car.steerOff = 0;
car.bodyDir = 0;
car.trailerDir = 0;
car.engineSpd = 0;
car.p1 = {x:hero_pos_x, y:hero_pos_y, vx:0, vy:0};
car.p2 = {x:hero_pos_x + 110, y:hero_pos_y - 170, vx:0, vy:0};
car.con = {p1:car.p1, p2:car.p2, len:110};
car.wheelFric = 0.97;
car.rearWheelGrip = 0.02;
car.accel = 0.2;
car.steerCorrect = 0.8;
var i_alpha = (Math.PI/180);
s3.start(1, 99999);
onEnterFrame = function () {
if ((Key.isDown(83) and (sound_ON == true)) and (!press_S)) {
_root.s1.setVolume(0);
sound_ON = false;
press_S = true;
}
if ((Key.isDown(83) and (sound_ON == false)) and (!press_S)) {
_root.s1.setVolume(100);
sound_ON = true;
press_S = true;
}
if (!Key.isDown(83)) {
press_S = false;
}
if (((Key.isDown(80) and (!p_key)) and ((!Paused) == true)) and (game_menu.Pause.can_pause == true)) {
game_menu.Pause.gotoAndPlay(2);
p_key = true;
}
if (((Key.isDown(80) and (!p_key)) and (Paused == true)) and (game_menu.Pause.can_unpause == true)) {
Paused = false;
game_menu.Pause.gotoAndPlay(21);
p_key = true;
}
if (!Key.isDown(80)) {
p_key = false;
}
if (Key.isDown(81) and (!q_key)) {
if (game_quality == "low") {
game_quality = "high";
_quality = "MEDIUM";
q_key = true;
} else if (game_quality == "high") {
game_quality = "low";
_quality = "LOW";
q_key = true;
}
} else if (!Key.isDown(81)) {
q_key = false;
}
_x = Math.round(300 - car.p1.x);
_y = Math.round(250 - car.p1.y);
game_menu._x = (-_x) + 300;
game_menu._y = (-_y) + 250;
game_mask._x = -_x;
game_mask._y = -_y;
extra_BG._x = game_menu._x;
extra_BG._y = game_menu._y;
over._x = game_menu._x;
over._y = game_menu._y;
if ((!Paused) == true) {
game_menu.radar.mini_road._x = (road._x / 50) - (_root.hero._x / 50);
game_menu.radar.mini_road._y = (road._y / 50) - (_root.hero._y / 50);
game_menu.HP._alpha--;
game_menu.HP.gotoAndStop((game_menu._currentframe = HP + 10));
if (game_menu.HP._currentframe <= 10) {
game_menu.game_level.gotoAndStop(3);
attachMovie("wreck", "wreck", 999999988, {_x:hero._x, _y:hero._y, _rotation:hero._rotation});
Paused = true;
}
matrix_update();
ground_hit_timer++;
i = 0;
while (i < roadArray.length) {
if (game_menu.hitTest(roadArray[i])) {
roadArray[i].gotoAndStop(1);
} else if (!game_menu.hitTest(roadArray[i])) {
roadArray[i].gotoAndStop(2);
}
i++;
}
s7_timer++;
if (point_num > 10) {
point_num = 0;
}
if ((houses.park_place.hitTest(hero._x, hero._y, true) and (car.engineSpd <= 0)) and (trailerCon == true)) {
game_menu.texts.play();
}
if (game_menu.help._alpha < 100) {
game_menu.help._alpha++;
}
trailerBody._rotation = 112.7;
if (game_menu.handle._alpha >= 0) {
game_menu.handle._alpha = game_menu.handle._alpha - 3;
}
trailerSnapA = dot({x:Math.cos(car.bodyDir), y:Math.sin(car.bodyDir)}, {x:Math.cos(car.trailerDir), y:Math.sin(car.trailerDir)});
if (trailerSnapA < 0) {
car.p1.vx = (-car.p1.vy) - 0.05;
car.p1.vy = (-car.p1.vy) - 0.05;
}
if (trailerBody.attach_hit.hitTest(hero._x, hero._y, true)) {
ground.trailer_HIT.gotoAndStop(2);
houses.arrow_arrive.gotoAndStop(2);
houses.arrow_arrive_2.gotoAndStop(1);
attachMovie("star_attach", "star_attach", 999999998, {_x:hero._x, _y:hero._y - 30});
car.p3 = {x:trailerBody._x, y:trailerBody._y, vx:0, vy:0};
car.con2 = {p1:car.p2, p2:car.p3, len:150};
trailerBody.attach_hit.gotoAndStop(2);
arrow_ob = houses.park_place;
trailerCon = true;
game_menu.help.gotoAndStop(game_menu.help._currentframe + 1);
}
updatePoint(car.p3);
game_menu.radar.map_arrow._rotation = i_rotation(hero, arrow_ob);
update_bg_tiles();
hero.window.gotoAndStop(Math.round((((car.bodyDir / (Math.PI/180)) + 180) / 360) * 120));
hero._x = car.p2.x;
hero._y = car.p2.y;
hero._rotation = (car.bodyDir / (Math.PI/180)) - 90;
hero.f1._rotation = (hero.f2._rotation = car.steerOff / (Math.PI/180));
trailerBody._x = car.p3.x;
trailerBody._y = car.p3.y;
trailerBody._rotation = (car.trailerDir / (Math.PI/180)) - 90;
updatePoint(car.p1);
updatePoint(car.p2);
i = 0;
while (i < 5) {
satisfyConstraint(car.con);
satisfyConstraint(car.con2);
i++;
}
car.bodyDir = Math.atan2(car.p2.y - car.p1.y, car.p2.x - car.p1.x);
car.trailerDir = Math.atan2(car.p3.y - car.p2.y, car.p3.x - car.p2.x);
car.steerDir = car.bodyDir + car.steerOff;
p1vel = Math.sqrt((car.p1.vx * car.p1.vx) + (car.p1.vy * car.p1.vy));
p2vel = Math.sqrt((car.p2.vx * car.p2.vx) + (car.p2.vy * car.p2.vy));
p3vel = Math.sqrt((car.p3.vx * car.p3.vx) + (car.p3.vy * car.p3.vy));
car.p1.vx = car.p1.vx - (car.engineSpd * Math.cos(car.steerDir));
car.p1.vy = car.p1.vy - (car.engineSpd * Math.sin(car.steerDir));
if (p2vel != 0) {
mDot = dot({x:Math.cos(car.bodyDir), y:Math.sin(car.bodyDir)}, {x:car.p2.vx / p2vel, y:car.p2.vy / p2vel});
if ((Math.abs(mDot) < 0.84) and (car.engineSpd > 0.3)) {
attachMovie("smoke", "smoke", smoke_depth, {_x:hero._x, _y:hero._y, _rotation:hero._rotation});
if (!s10_start) {
s10.start();
s10_start = true;
}
} else {
s10_start = false;
}
}
if (p3vel != 0) {
mDot = dot({x:Math.cos(car.trailerDir), y:Math.sin(car.trailerDir)}, {x:car.p3.vx / p3vel, y:car.p3.vy / p3vel});
if (Math.abs(mDot) < 0.84) {
}
}
if (p2vel != 0) {
pp = proj({x:car.p2.vx, y:car.p2.vy}, {y:-Math.cos(car.bodyDir), x:Math.sin(car.bodyDir)});
car.p2.vx = car.p2.vx * ((1 - Math.abs((pp.x / p2vel) * car.rearWheelGrip)) - driftFX);
car.p2.vy = car.p2.vy * ((1 - Math.abs((pp.y / p2vel) * car.rearWheelGrip)) - driftFX);
}
if (p3vel != 0) {
pp = proj({x:car.p3.vx, y:car.p3.vy}, {y:-Math.cos(car.trailerDir), x:Math.sin(car.trailerDir)});
car.p3.vx = car.p3.vx * (1 - Math.abs((pp.x / p3vel) * car.rearWheelGrip));
car.p3.vy = car.p3.vy * (1 - Math.abs((pp.y / p3vel) * car.rearWheelGrip));
}
car.p1.vx = car.p1.vx * car.wheelFric;
car.p1.vy = car.p1.vy * car.wheelFric;
car.p2.vx = car.p2.vx * car.wheelFric;
car.p2.vy = car.p2.vy * car.wheelFric;
car.p3.vx = car.p3.vx * car.wheelFric;
car.p3.vy = car.p3.vy * car.wheelFric;
car.engineSpd = car.engineSpd * 0.9;
if (car.engineSpd > 0) {
driftFX = 0.1;
car.steerOff = car.steerOff * car.steerCorrect;
} else {
car.steerOff = car.steerOff * (car.steerCorrect / 1.2);
}
if (road.hitTest(hero._x, hero._y, true)) {
on_road = true;
car.accel = 0.2;
car.rearWheelGrip = 0.08;
if (!engineSlowed) {
engineUP = -0.5;
engineSlowed = true;
}
} else {
engineSlowed = false;
car.engineSpd = car.engineSpd - (car.engineSpd / 2);
if (car.engineSpd == 0.5) {
car.engineSpd = 0.5;
}
on_road = false;
car.accel = 0.1;
car.rearWheelGrip = 0.02;
if ((engineSpd > 0) and (game_quality == "high")) {
attachMovie("smoke_sandy", "smoke_sandy", 21, {_x:hero._x, _y:hero._y, _rotation:hero._rotation});
}
}
if (hitting) {
if (ground.hitTest(advance_HIT._x, advance_HIT._y, true)) {
ground_hit(gh);
} else if (ground.hitTest(advance_HIT_2._x, advance_HIT_2._y, true)) {
ground_hit(gh);
} else if (ground.hitTest(advance_HIT_3._x, advance_HIT_3._y, true)) {
ground_hit(gh);
} else if (ground.hitTest(advance_HIT_4._x, advance_HIT_4._y, true)) {
ground_hit(gh);
} else if (ground.hitTest(hero._x, hero._y, true)) {
ground_hit(gh);
} else {
ground_hitting = false;
}
}
if (ground.hitTest(trailerBody._x, trailerBody._y, true) && ((!trailerCon) == false)) {
trailer_hit(th);
} else {
trailer_hitting = false;
}
i = 0;
while (i < AI_CARS_A.length) {
if (AI_CARS_A[i].hitTest(advance_HIT._x, advance_HIT._y, true)) {
AI_hit(i);
} else if (AI_CARS_A[i].hitTest(advance_HIT_2._x, advance_HIT_2._y, true)) {
AI_hit(i);
} else if (AI_CARS_A[i].hitTest(advance_HIT_3._x, advance_HIT_3._y, true)) {
AI_hit(i);
} else if (AI_CARS_A[i].hitTest(advance_HIT_4._x, advance_HIT_4._y, true)) {
AI_hit(i);
} else {
AI_CARS_A[i].AI_hitting = false;
}
i++;
}
if (smoke_depth >= 20) {
smoke_depth = 0;
} else {
smoke_depth++;
}
if (engineUP >= 0.5) {
engineUP = 0.5;
} else if (engineUP <= 0) {
engineUP = 0;
}
if (Key.isDown(38)) {
doing_nothing_timer = 50;
s6_start = false;
s6.stop(["truck_idle"]);
if (keyUP) {
if ((!s7_start) and (s7_timer >= 50)) {
s7.start();
s7_timer = 0;
s7_start = true;
}
if (speed_1) {
s4.start(6, 99999);
s5.stop(["truck_drive_faster"]);
s8.stop(["truck_drive_fastest"]);
}
if (speed_2) {
s5.start(5, 99999);
s4.stop(["truck_drive"]);
s8.stop(["truck_drive_fastest"]);
}
if (speed_3) {
s8.start(4, 99999);
s4.stop(["truck_drive"]);
s5.stop(["truck_drive_faster"]);
}
keyUP = false;
}
car.engineSpd = car.engineSpd + engineUP;
engineUP = engineUP + 0.003;
} else {
if ((car.engineSpd <= 0.001) and (!Key.isDown(40))) {
car.engineSpd = 0;
}
engineUP = engineUP - 0.004;
doing_nothing_timer = doing_nothing_timer - 0.5;
if (doing_nothing_timer <= 0) {
s6.stop(["truck_idle"]);
}
s7_start = false;
s4.stop(["truck_drive"]);
s5.stop(["truck_drive_faster"]);
s7.stop(["truck_start"]);
s8.stop(["truck_drive_fastest"]);
if (!s6_start) {
s6.start(1, 99999);
s6_start = true;
}
keyUP = true;
}
if (Key.isDown(40)) {
doing_nothing_timer = 50;
if ((ground_hitting == true) or (AI_CARS_A[i].AI_hitting == true)) {
car.engineSpd = car.engineSpd - 0.09;
} else {
car.engineSpd = car.engineSpd - 0.05;
}
}
speed_handle(sh);
if (speed_1 and on_road) {
if (car.engineSpd > 0.8) {
car.engineSpd = car.engineSpd - 0.35;
}
}
if (((!tutorial_text_3) and (car.engineSpd > 1.5)) and trailerCon) {
game_menu.help.gotoAndStop(game_menu.help._currentframe + 1);
tutorial_text_3 = true;
}
if (speed_2 and on_road) {
if (car.engineSpd > 2) {
car.engineSpd = car.engineSpd - 0.2;
}
}
if (((car.engineSpd > 4) and speed_3) and on_road) {
car.engineSpd = 4;
}
if (Key.isDown(37)) {
if (on_road == true) {
car.steerOff = car.steerOff - 0.1;
} else {
car.steerOff = car.steerOff - 0.1;
}
} else if (Key.isDown(39)) {
if (on_road == true) {
car.steerOff = car.steerOff + 0.1;
} else {
car.steerOff = car.steerOff + 0.1;
}
}
if (Key.isDown(32)) {
if (car.engineSpd > 0) {
car.engineSpd = car.engineSpd - 0.3;
}
}
wheelBack1o = wheelBack1;
wheelBack2o = wheelBack2;
wheelBack3o = wheelBack3;
wheelBack4o = wheelBack4;
wheelBack5o = wheelBack5;
wheelBack6o = wheelBack6;
}
};
smokeC = 0;
Instance of Symbol 459 MovieClip "extra_BG" in Frame 50 (67 B)
onClipEvent (load) {
this.gotoAndStop(_root._currentframe - 49);
}
Instance of Symbol 549 MovieClip "ground" in Frame 50 (46 B)
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 551 MovieClip "advance_HIT" in Frame 50 (46 B)
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 551 MovieClip "advance_HIT_2" in Frame 50 (46 B)
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 551 MovieClip "advance_HIT_3" in Frame 50 (46 B)
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 551 MovieClip "advance_HIT_4" in Frame 50 (46 B)
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 927 MovieClip "over" in Frame 50 (67 B)
onClipEvent (load) {
this.gotoAndStop(_root._currentframe - 49);
}
Frame 51 (398 B)
_x = 0;
_y = 0;
stopAllSounds();
Paused = false;
hero.removeMovieClip();
trailerBody.removeMovieClip();
game_menu.removeMovieClip();
houses.removeMovieClip();
AI.removeMovieClip();
over.removeMovieClip();
HP = 100;
light_fx_2.removeMovieClip();
light_2.removeMovieClip();
AI_light_2.removeMovieClip();
AI_light_2_AI_2.removeMovieClip();
AI_light_2_AI_3.removeMovieClip();
play();
Frame 52 (23.15 KiB) ● ● ●
function i_rotation(i_ob, i_obr) {
var _local2 = i_ob._x - i_obr._x;
var _local1 = i_ob._y - i_obr._y;
var _local3 = Math.atan2(_local1, _local2) / i_alpha;
return(_local3);
}
function AI_light(ob_1, ob_2) {
ob_1._x = ob_2._x;
ob_1._y = ob_2._y;
ob_1._rotation = ob_2._rotation + 90;
}
function sprayParticles(x, y, d) {
smokeC++;
s = _root.attachMovie("smoke", "smoke_" + smokeC, _root.getNextHighestDepth());
s._x = x;
s._y = y;
}
function proj(v1, v2) {
dp = dot(v1, v2);
v2s = (v2.x * v2.x) + (v2.y * v2.y);
x = (dp / v2s) * v2.x;
y = (dp / v2s) * v2.y;
return({x:x, y:y});
}
function dot(p1, p2) {
return((p1.x * p2.x) + (p1.y * p2.y));
}
function updatePoint(p) {
p.x = p.x + p.vx;
p.y = p.y + p.vy;
}
function satisfyConstraint(c) {
xd = (c.p2.x + c.p2.vx) - (c.p1.x + c.p1.vx);
yd = (c.p2.y + c.p2.vy) - (c.p1.y + c.p1.vy);
dis = Math.sqrt((xd * xd) + (yd * yd));
force = ((c.len - dis) / dis) * 0.5;
dx = xd * force;
dy = yd * force;
c.p1.vx = c.p1.vx - dx;
c.p1.vy = c.p1.vy - dy;
c.p2.vx = c.p2.vx + dx;
c.p2.vy = c.p2.vy + dy;
}
function update_bg_tiles() {
i = 0;
while (i < bg_A.length) {
if (bg_A[i]._x < (game_menu._x - 600)) {
if ((!bg_A[i].positioned) == true) {
bg_A[i].last_position = bg_A[i]._x;
bg_A[i].positioned = true;
}
bg_A[i]._x = bg_A[i].last_position + 1200;
bg_A[i].positioned = false;
}
if (bg_A[i]._x > (game_menu._x + 600)) {
if ((!bg_A[i].positioned) == true) {
bg_A[i].last_position = bg_A[i]._x;
bg_A[i].positioned = true;
}
bg_A[i]._x = bg_A[i].last_position - 1200;
bg_A[i].positioned = false;
}
if (bg_A[i]._y < (game_menu._y - 500)) {
if ((!bg_A[i].positioned) == true) {
bg_A[i].last_position = bg_A[i]._y;
bg_A[i].positioned = true;
}
bg_A[i]._y = bg_A[i].last_position + 1000;
bg_A[i].positioned = false;
}
if (bg_A[i]._y > (game_menu._y + 500)) {
if ((!bg_A[i].positioned) == true) {
bg_A[i].last_position = bg_A[i]._y;
bg_A[i].positioned = true;
}
bg_A[i]._y = bg_A[i].last_position - 1000;
bg_A[i].positioned = false;
}
i++;
}
}
function ground_hit(gh) {
engineUP = 0;
if (ground.hitTest(hero._x, hero._y, true)) {
car.engineSpd = (-car.engineSpd) + 0.1;
} else if (ground.hitTest(advance_HIT._x, advance_HIT._y, true)) {
car.engineSpd = (-car.engineSpd) - 0.2;
} else if (ground.hitTest(advance_HIT_2._x, advance_HIT_2._y, true)) {
car.engineSpd = (-car.engineSpd) - 0.2;
} else if (ground.hitTest(advance_HIT_3._x, advance_HIT_3._y, true)) {
car.engineSpd = (-car.engineSpd) + 0.1;
} else if (ground.hitTest(advance_HIT_4._x, advance_HIT_4._y, true)) {
car.engineSpd = (-car.engineSpd) + 0.1;
} else if (ground.hitTest(trailerBody._x, trailerBody._y, true)) {
trace("dfgfdgfdg");
car.engineSpd = (-car.engineSpd) + 0.9;
}
if (ground_hitting == false) {
if (ground.hitTest(hero._x, hero._y, true)) {
attachMovie("explosion_mc", "explosion_mc", 500000, {_x:hero._x, _y:hero._y, _rotation:hero._rotation});
} else if (ground.hitTest(advance_HIT._x, advance_HIT._y, true)) {
attachMovie("explosion_mc", "explosion_mc", 500000, {_x:advance_HIT._x, _y:advance_HIT._y, _rotation:hero._rotation});
} else if (ground.hitTest(advance_HIT_2._x, advance_HIT_2._y, true)) {
attachMovie("explosion_mc", "explosion_mc", 500000, {_x:advance_HIT_2._x, _y:advance_HIT_2._y, _rotation:hero._rotation});
} else if (ground.hitTest(advance_HIT_3._x, advance_HIT_3._y, true)) {
attachMovie("explosion_mc", "explosion_mc", 500000, {_x:advance_HIT_3._x, _y:advance_HIT_3._y, _rotation:hero._rotation});
} else if (ground.hitTest(advance_HIT_4._x, advance_HIT_4._y, true)) {
attachMovie("explosion_mc", "explosion_mc", 500000, {_x:advance_HIT_4._x, _y:advance_HIT_4._y, _rotation:hero._rotation});
} else if (ground.hitTest(trailerBody._x, trailerBody._y, true)) {
attachMovie("explosion_mc", "explosion_mc", 500000, {_x:trailerBody._x, _y:trailerBody._y, _rotation:hero._rotation});
}
random_370_380 = random(5) + 370;
car.p1.vx = 0;
car.p1.vy = 0;
car.p2.vx = 0;
car.p2.vy = 0;
car.p3.vx = 0;
car.p3.vy = 0;
ground_hitting = true;
if (ground_hit_timer >= 30) {
attachMovie("glass_brake", "glass_brake", random_370_380, {_x:hero._x, _y:hero._y, _rotation:hero._rotation});
ground_hit_timer = 0;
}
}
}
function trailer_hit(th) {
engineUP = 0;
if (ground.hitTest(trailerBody._x, trailerBody._y, true)) {
car.engineSpd = (-car.engineSpd) + 0.9;
}
if (trailer_hitting == false) {
if (ground.hitTest(trailerBody._x, trailerBody._y, true)) {
attachMovie("explosion_mc", "explosion_mc", 500000, {_x:trailerBody._x, _y:trailerBody._y, _rotation:hero._rotation});
}
random_370_380 = random(5) + 370;
car.p1.vx = 0;
car.p1.vy = 0;
car.p2.vx = 0;
car.p2.vy = 0;
car.p3.vx = 0;
car.p3.vy = 0;
trailer_hitting = true;
if (ground_hit_timer >= 30) {
attachMovie("glass_brake", "glass_brake", random_370_380, {_x:hero._x, _y:hero._y, _rotation:hero._rotation});
ground_hit_timer = 0;
}
}
}
function AI_hit(j) {
engineUP = 0;
if (AI.go == true) {
if ((hero.hitTest(AI.AI_car_3.car) and (!attach_wreck)) and (speed_3 == true)) {
attachMovie("wreck", "wreck", 999999992, {_x:AI.AI_car_3._x, _y:AI.AI_car_3._y});
attach_wreck = true;
}
if ((hero.hitTest(AI.AI_car_3.car) and (!attach_boss)) and ((!AI.BOSS_HP) <= 0)) {
attachMovie("BOSS_HP", "BOSS_HP_2", 999999994, {_x:AI.AI_car_3._x, _y:AI.AI_car_3._y});
AI.BOSS_HP = AI.BOSS_HP - 25;
attach_boss = true;
}
}
if (AI_CARS_A[i].hitTest(advance_HIT._x, advance_HIT._y, true)) {
car.engineSpd = (-car.engineSpd) - 0.2;
} else if (AI_CARS_A[i].hitTest(advance_HIT_2._x, advance_HIT_2._y, true)) {
car.engineSpd = (-car.engineSpd) - 0.2;
} else if (AI_CARS_A[i].hitTest(advance_HIT_3._x, advance_HIT_3._y, true)) {
car.engineSpd = (-car.engineSpd) + 0.1;
} else if (AI_CARS_A[i].hitTest(advance_HIT_4._x, advance_HIT_4._y, true)) {
car.engineSpd = (-car.engineSpd) + 0.1;
} else if (AI_CARS_A[i].hitTest(trailerBory._x, trailerBody._y, true)) {
car.engineSpd = (-car.engineSpd) + 0.1;
} else if (AI_CARS_A[i].hitTest(trailerBody._x + 30, trailerBody._y + 30, true)) {
car.engineSpd = (-car.engineSpd) + 0.1;
} else if (AI_CARS_A[i].hitTest(trailerBody._x - 30, trailerBody._y - 30, true)) {
car.engineSpd = (-car.engineSpd) + 0.1;
}
if (AI_CARS_A[j].AI_hitting == false) {
if (AI_CARS_A[i].hitTest(advance_HIT._x, advance_HIT._y, true)) {
attachMovie("explosion_mc", "explosion_mc", 500000, {_x:advance_HIT._x, _y:advance_HIT._y, _rotation:hero._rotation});
} else if (AI_CARS_A[i].hitTest(advance_HIT_2._x, advance_HIT_2._y, true)) {
attachMovie("explosion_mc", "explosion_mc", 500000, {_x:advance_HIT_2._x, _y:advance_HIT_2._y, _rotation:hero._rotation});
} else if (AI_CARS_A[i].hitTest(advance_HIT_3._x, advance_HIT_3._y, true)) {
attachMovie("explosion_mc", "explosion_mc", 500000, {_x:advance_HIT_3._x, _y:advance_HIT_3._y, _rotation:hero._rotation});
} else if (AI_CARS_A[i].hitTest(advance_HIT_4._x, advance_HIT_4._y, true)) {
attachMovie("explosion_mc", "explosion_mc", 500000, {_x:advance_HIT_4._x, _y:advance_HIT_4._y, _rotation:hero._rotation});
} else if (AI_CARS_A[i].hitTest(trailerBody._x, trailerBody._y, true)) {
attachMovie("explosion_mc", "explosion_mc", 500000, {_x:trailerBody._x, _y:trailerBody._y, _rotation:hero._rotation});
}
random_370_380 = random(5) + 370;
car.p1.vx = 0;
car.p1.vy = 0;
car.p2.vx = 0;
car.p2.vy = 0;
car.p3.vx = 0;
car.p3.vy = 0;
AI.AI_speed = 0;
AI_CARS_A[j].AI_hitting = true;
if (ground_hit_timer >= 30) {
attachMovie("glass_brake", "glass_brake", random_370_380, {_x:hero._x, _y:hero._y, _rotation:hero._rotation});
ground_hit_timer = 0;
}
}
}
function speed_handle(sh) {
if (Key.isDown(49) and ((!speed_1) == true)) {
keyUP = true;
game_menu.handle._alpha = 100;
if (game_menu.handle._currentframe == 10) {
game_menu.handle.gotoAndPlay(30);
} else {
game_menu.handle.play();
}
speed_1 = true;
speed_2 = false;
speed_3 = false;
car.steerCorrect = 0.8;
}
if (Key.isDown(50) and ((!speed_2) == true)) {
keyUP = true;
game_menu.handle._alpha = 100;
game_menu.handle.play();
speed_1 = false;
speed_2 = true;
speed_3 = false;
car.steerCorrect = 0.7;
}
if (Key.isDown(51) and ((!speed_3) == true)) {
keyUP = true;
game_menu.handle._alpha = 100;
if (game_menu.handle._currentframe == 30) {
game_menu.handle.gotoAndPlay(10);
} else {
game_menu.handle.play();
}
speed_1 = false;
speed_2 = false;
speed_3 = true;
car.steerCorrect = 0.6;
}
}
function matrix_update() {
var _local4 = new flash.geom.Matrix();
_local4.tx = 20;
_local4.ty = -110;
_local4.rotate(hero._rotation * (Math.PI/180));
advance_HIT._x = _local4.tx + hero._x;
advance_HIT._y = _local4.ty + hero._y;
var _local3 = new flash.geom.Matrix();
_local3.tx = -20;
_local3.ty = -110;
_local3.rotate(hero._rotation * (Math.PI/180));
advance_HIT_2._x = _local3.tx + hero._x;
advance_HIT_2._y = _local3.ty + hero._y;
var _local2 = new flash.geom.Matrix();
_local2.tx = -20;
_local2.ty = 20;
_local2.rotate(hero._rotation * (Math.PI/180));
advance_HIT_3._x = _local2.tx + hero._x;
advance_HIT_3._y = _local2.ty + hero._y;
var _local1 = new flash.geom.Matrix();
_local1.tx = 20;
_local1.ty = 20;
_local1.rotate(hero._rotation * (Math.PI/180));
advance_HIT_4._x = _local1.tx + hero._x;
advance_HIT_4._y = _local1.ty + hero._y;
}
hero._x = 3000;
hero._y = 2800;
_x = Math.round(300 - car.p1.x);
_y = Math.round(250 - car.p1.y);
game_menu._x = Math.round(300 - car.p1.x);
game_menu._y = Math.round(250 - car.p1.y);
hero_pos_x = hero._x;
hero_pos_y = hero._y;
bg_A = [bgs.bg_1, bgs.bg_2, bgs.bg_3, bgs.bg_4];
roadArray = [road.road_1, road.road_2];
AI_CARS_A = [AI.AI_car_1.car, AI.AI_car_2.car, AI.AI_car_3.car, AI.AI_car_4.car];
game_quality = "low";
arrow_ob = park_area;
s18.stop(["menu_music"]);
on_road = true;
speed_1 = true;
speed_2 = false;
speed_3 = false;
ground_hitting = false;
bgs.bg_1.positioned = false;
bgs.bg_2.positioned = false;
bgs.bg_3.positioned = false;
bgs.bg_4.positioned = false;
tutorial = true;
parked = false;
attach_wreck = false;
hitting = false;
smoke_depth = 0;
engineUP = 0;
text_num = 3;
game_menu.handle._alpha = 0;
s7_timer = 50;
ground_hit_timer = 50;
doing_nothing_timer = 50;
HP = 95;
game_menu.HP._alpha = 0;
driftFX = 0;
stop();
AI.swapDepths(_root.getNextHighestDepth());
hero.swapDepths(_root.getNextHighestDepth());
trailerBody.swapDepths(_root.getNextHighestDepth());
houses.swapDepths(_root.getNextHighestDepth());
over.swapDepths(_root.getNextHighestDepth());
light_fx_2.swapDepths(_root.getNextHighestDepth());
light_2.swapDepths(_root.getNextHighestDepth());
AI_light_2.swapDepths(_root.getNextHighestDepth());
AI_light_2_AI_2.swapDepths(_root.getNextHighestDepth());
AI_light_2_AI_3.swapDepths(_root.getNextHighestDepth());
game_menu.swapDepths(999999999);
var car = new Object();
car.steerDir = 0;
car.steerOff = 0;
car.bodyDir = 0;
car.trailerDir = 0;
car.engineSpd = 0;
car.p1 = {x:hero_pos_x, y:hero_pos_y, vx:0, vy:0};
car.p2 = {x:hero_pos_x - 40, y:hero_pos_y + 170, vx:0, vy:0};
car.con = {p1:car.p1, p2:car.p2, len:110};
car.wheelFric = 0.97;
car.rearWheelGrip = 0.02;
car.accel = 0.2;
car.steerCorrect = 0.8;
var i_alpha = (Math.PI/180);
s19.start(1, 99999);
onEnterFrame = function () {
if ((Key.isDown(83) and (sound_ON == true)) and (!press_S)) {
_root.s1.setVolume(0);
sound_ON = false;
press_S = true;
}
if ((Key.isDown(83) and (sound_ON == false)) and (!press_S)) {
_root.s1.setVolume(100);
sound_ON = true;
press_S = true;
}
if (!Key.isDown(83)) {
press_S = false;
}
if (((Key.isDown(80) and (!p_key)) and ((!Paused) == true)) and (game_menu.Pause.can_pause == true)) {
game_menu.Pause.gotoAndPlay(2);
p_key = true;
}
if (((Key.isDown(80) and (!p_key)) and (Paused == true)) and (game_menu.Pause.can_unpause == true)) {
Paused = false;
game_menu.Pause.gotoAndPlay(21);
p_key = true;
}
if (!Key.isDown(80)) {
p_key = false;
}
if (Key.isDown(81) and (!q_key)) {
if (game_quality == "low") {
game_quality = "high";
_quality = "MEDIUM";
q_key = true;
} else if (game_quality == "high") {
game_quality = "low";
_quality = "LOW";
q_key = true;
}
} else if (!Key.isDown(81)) {
q_key = false;
}
_x = Math.round(300 - car.p1.x);
_y = Math.round(250 - car.p1.y);
game_menu._x = (-_x) + 300;
game_menu._y = (-_y) + 250;
game_mask._x = -_x;
game_mask._y = -_y;
extra_BG._x = game_menu._x;
extra_BG._y = game_menu._y;
over._x = game_menu._x;
over._y = game_menu._y;
if ((!Paused) == true) {
game_menu.radar.mini_road._x = (road._x / 50) - (_root.hero._x / 50);
game_menu.radar.mini_road._y = (road._y / 50) - (_root.hero._y / 50);
park_timer--;
if (((park_area.hitTest(hero) and (car.engineSpd > -5)) and (car.engineSpd < 0.9)) and (park_timer <= 0)) {
if (!parked) {
game_menu.help.gotoAndStop(7);
}
parked = true;
lose_timer = 100;
} else if ((!park_area.hitTest(hero)) and (!AI_light_2_AI_2.jim_stop)) {
park_timer = 50;
if (parked == true) {
lose_timer--;
if (lose_timer <= 0) {
text_num = 4;
game_menu.texts.play();
}
}
}
if (game_menu.hitTest(houses.cars_2) and (!s21_start)) {
s21.start(1, 99999);
s21_start = true;
} else if (!game_menu.hitTest(houses.cars_2)) {
s21.stop(["music_in_bar"]);
s21_start = false;
}
if (game_menu.hitTest(houses.houses_dis)) {
houses.houses_dis.gotoAndStop(1);
} else {
houses.houses_dis.gotoAndStop(2);
}
game_menu.HP._alpha--;
game_menu.HP.gotoAndStop((game_menu._currentframe = HP + 10));
if (game_menu.HP._currentframe <= 10) {
game_menu.game_level.gotoAndStop(3);
attachMovie("wreck", "wreck", 999999988, {_x:hero._x, _y:hero._y, _rotation:hero._rotation});
s4.stop(["truck_drive"]);
s5.stop(["truck_drive_faster"]);
s8.stop(["truck_drive_fastest"]);
Paused = true;
}
matrix_update();
ground_hit_timer++;
i = 0;
while (i < roadArray.length) {
if (game_menu.hitTest(roadArray[i])) {
roadArray[i].gotoAndStop(1);
} else if (!game_menu.hitTest(roadArray[i])) {
roadArray[i].gotoAndStop(2);
}
i++;
}
s7_timer++;
if (point_num > 10) {
point_num = 0;
}
if (game_menu.help._alpha < 100) {
game_menu.help._alpha++;
}
trailerBody._rotation = 112.7;
if (game_menu.handle._alpha >= 0) {
game_menu.handle._alpha = game_menu.handle._alpha - 3;
}
trailerSnapA = dot({x:Math.cos(car.bodyDir), y:Math.sin(car.bodyDir)}, {x:Math.cos(car.trailerDir), y:Math.sin(car.trailerDir)});
if (trailerSnapA < 0) {
car.p1.vx = (-car.p1.vy) - 0.05;
car.p1.vy = (-car.p1.vy) - 0.05;
}
if (trailerBody.attach_hit.hitTest(hero._x, hero._y, true)) {
ground.trailer_HIT.gotoAndStop(2);
houses.arrow_arrive.gotoAndStop(2);
houses.arrow_arrive_2.gotoAndStop(1);
attachMovie("star_attach", "star_attach", 999999998, {_x:hero._x, _y:hero._y - 30});
car.p3 = {x:trailerBody._x, y:trailerBody._y, vx:0, vy:0};
car.con2 = {p1:car.p2, p2:car.p3, len:150};
trailerBody.attach_hit.gotoAndStop(2);
arrow_ob = houses.park_place;
trailerCon = true;
}
updatePoint(car.p3);
game_menu.radar.map_arrow._rotation = i_rotation(hero, arrow_ob);
update_bg_tiles();
hero.window.gotoAndStop(Math.round((((car.bodyDir / (Math.PI/180)) + 180) / 360) * 120));
hero._x = car.p2.x;
hero._y = car.p2.y;
hero._rotation = (car.bodyDir / (Math.PI/180)) - 90;
hero.f1._rotation = (hero.f2._rotation = car.steerOff / (Math.PI/180));
trailerBody._x = car.p3.x;
trailerBody._y = car.p3.y;
trailerBody._rotation = (car.trailerDir / (Math.PI/180)) - 90;
updatePoint(car.p1);
updatePoint(car.p2);
i = 0;
while (i < 5) {
satisfyConstraint(car.con);
satisfyConstraint(car.con2);
i++;
}
car.bodyDir = Math.atan2(car.p2.y - car.p1.y, car.p2.x - car.p1.x);
car.trailerDir = Math.atan2(car.p3.y - car.p2.y, car.p3.x - car.p2.x);
car.steerDir = car.bodyDir + car.steerOff;
p1vel = Math.sqrt((car.p1.vx * car.p1.vx) + (car.p1.vy * car.p1.vy));
p2vel = Math.sqrt((car.p2.vx * car.p2.vx) + (car.p2.vy * car.p2.vy));
p3vel = Math.sqrt((car.p3.vx * car.p3.vx) + (car.p3.vy * car.p3.vy));
car.p1.vx = car.p1.vx - (car.engineSpd * Math.cos(car.steerDir));
car.p1.vy = car.p1.vy - (car.engineSpd * Math.sin(car.steerDir));
if (p2vel != 0) {
mDot = dot({x:Math.cos(car.bodyDir), y:Math.sin(car.bodyDir)}, {x:car.p2.vx / p2vel, y:car.p2.vy / p2vel});
if ((Math.abs(mDot) < 0.84) and (car.engineSpd > 0.3)) {
attachMovie("smoke", "smoke", smoke_depth, {_x:hero._x, _y:hero._y, _rotation:hero._rotation});
if (!s10_start) {
s10.start();
s10_start = true;
}
} else {
s10_start = false;
}
}
if (p3vel != 0) {
mDot = dot({x:Math.cos(car.trailerDir), y:Math.sin(car.trailerDir)}, {x:car.p3.vx / p3vel, y:car.p3.vy / p3vel});
if (Math.abs(mDot) < 0.84) {
}
}
if (p2vel != 0) {
pp = proj({x:car.p2.vx, y:car.p2.vy}, {y:-Math.cos(car.bodyDir), x:Math.sin(car.bodyDir)});
car.p2.vx = car.p2.vx * ((1 - Math.abs((pp.x / p2vel) * car.rearWheelGrip)) - driftFX);
car.p2.vy = car.p2.vy * ((1 - Math.abs((pp.y / p2vel) * car.rearWheelGrip)) - driftFX);
}
if (p3vel != 0) {
pp = proj({x:car.p3.vx, y:car.p3.vy}, {y:-Math.cos(car.trailerDir), x:Math.sin(car.trailerDir)});
car.p3.vx = car.p3.vx * (1 - Math.abs((pp.x / p3vel) * car.rearWheelGrip));
car.p3.vy = car.p3.vy * (1 - Math.abs((pp.y / p3vel) * car.rearWheelGrip));
}
car.p1.vx = car.p1.vx * car.wheelFric;
car.p1.vy = car.p1.vy * car.wheelFric;
car.p2.vx = car.p2.vx * car.wheelFric;
car.p2.vy = car.p2.vy * car.wheelFric;
car.p3.vx = car.p3.vx * car.wheelFric;
car.p3.vy = car.p3.vy * car.wheelFric;
car.engineSpd = car.engineSpd * 0.9;
if (car.engineSpd > 0) {
driftFX = 0.1;
car.steerOff = car.steerOff * car.steerCorrect;
} else {
car.steerOff = car.steerOff * (car.steerCorrect / 1.2);
}
if (road.hitTest(hero._x, hero._y, true)) {
on_road = true;
car.accel = 0.2;
car.rearWheelGrip = 0.08;
if (!engineSlowed) {
engineUP = -0.5;
engineSlowed = true;
}
} else {
engineSlowed = false;
car.engineSpd = car.engineSpd - (car.engineSpd / 2);
if (car.engineSpd == 0.5) {
car.engineSpd = 0.5;
}
on_road = false;
car.accel = 0.1;
car.rearWheelGrip = 0.02;
if ((engineSpd > 0) and (game_quality == "high")) {
attachMovie("smoke_sandy", "smoke_sandy", 21, {_x:hero._x, _y:hero._y, _rotation:hero._rotation});
}
}
if (hitting) {
if (ground.hitTest(advance_HIT._x, advance_HIT._y, true)) {
ground_hit(gh);
} else if (ground.hitTest(advance_HIT_2._x, advance_HIT_2._y, true)) {
ground_hit(gh);
} else if (ground.hitTest(advance_HIT_3._x, advance_HIT_3._y, true)) {
ground_hit(gh);
} else if (ground.hitTest(advance_HIT_4._x, advance_HIT_4._y, true)) {
ground_hit(gh);
} else if (ground.hitTest(hero._x, hero._y, true)) {
ground_hit(gh);
} else {
ground_hitting = false;
}
if (ground.hitTest(trailerBody._x, trailerBody._y, true) && ((!trailerCon) == false)) {
trailer_hit(th);
} else {
trailer_hitting = false;
}
}
i = 0;
while (i < AI_CARS_A.length) {
if (AI_CARS_A[i].hitTest(advance_HIT._x, advance_HIT._y, true)) {
AI_hit(i);
} else if (AI_CARS_A[i].hitTest(advance_HIT_2._x, advance_HIT_2._y, true)) {
AI_hit(i);
} else if (AI_CARS_A[i].hitTest(advance_HIT_3._x, advance_HIT_3._y, true)) {
AI_hit(i);
} else if (AI_CARS_A[i].hitTest(advance_HIT_4._x, advance_HIT_4._y, true)) {
AI_hit(i);
} else {
AI_CARS_A[i].AI_hitting = false;
}
i++;
}
if (smoke_depth >= 20) {
smoke_depth = 0;
} else {
smoke_depth++;
}
if (engineUP >= 0.5) {
engineUP = 0.5;
} else if (engineUP <= 0) {
engineUP = 0;
}
if (Key.isDown(38)) {
doing_nothing_timer = 50;
s6_start = false;
s6.stop(["truck_idle"]);
if (keyUP) {
if ((!s7_start) and (s7_timer >= 50)) {
s7.start();
s7_timer = 0;
s7_start = true;
}
if (speed_1) {
s4.start(6, 99999);
s5.stop(["truck_drive_faster"]);
s8.stop(["truck_drive_fastest"]);
}
if (speed_2) {
s5.start(5, 99999);
s4.stop(["truck_drive"]);
s8.stop(["truck_drive_fastest"]);
}
if (speed_3) {
s8.start(4, 99999);
s4.stop(["truck_drive"]);
s5.stop(["truck_drive_faster"]);
}
keyUP = false;
}
car.engineSpd = car.engineSpd + engineUP;
engineUP = engineUP + 0.003;
} else {
if ((car.engineSpd <= 0.001) and (!Key.isDown(40))) {
car.engineSpd = 0;
}
engineUP = engineUP - 0.004;
doing_nothing_timer = doing_nothing_timer - 0.5;
if (doing_nothing_timer <= 0) {
s6.stop(["truck_idle"]);
}
s7_start = false;
s4.stop(["truck_drive"]);
s5.stop(["truck_drive_faster"]);
s7.stop(["truck_start"]);
s8.stop(["truck_drive_fastest"]);
if (!s6_start) {
s6.start(1, 99999);
s6_start = true;
}
keyUP = true;
}
if (Key.isDown(40)) {
doing_nothing_timer = 50;
if ((ground_hitting == true) or (AI_CARS_A[i].AI_hitting == true)) {
car.engineSpd = car.engineSpd - 0.09;
} else {
car.engineSpd = car.engineSpd - 0.05;
}
}
speed_handle(sh);
if (speed_1 and on_road) {
if (car.engineSpd > 0.8) {
car.engineSpd = car.engineSpd - 0.35;
}
}
if (((!tutorial_text_3) and (car.engineSpd > 1.5)) and trailerCon) {
game_menu.help.gotoAndStop(game_menu.help._currentframe + 1);
tutorial_text_3 = true;
}
if (speed_2 and on_road) {
if (car.engineSpd > 2) {
car.engineSpd = car.engineSpd - 0.2;
}
}
if (((car.engineSpd > 4) and speed_3) and on_road) {
car.engineSpd = 4;
}
if (Key.isDown(37)) {
if (on_road == true) {
car.steerOff = car.steerOff - 0.1;
} else {
car.steerOff = car.steerOff - 0.1;
}
} else if (Key.isDown(39)) {
if (on_road == true) {
car.steerOff = car.steerOff + 0.1;
} else {
car.steerOff = car.steerOff + 0.1;
}
}
if (Key.isDown(32)) {
if (car.engineSpd > 0) {
car.engineSpd = car.engineSpd - 0.3;
}
}
light._x = hero._x;
light._y = hero._y;
light._rotation = hero._rotation;
light_2._x = hero._x;
light_2._y = hero._y;
light_2._rotation = hero._rotation;
AI_light(AI_light_1, AI.AI_car_1);
AI_light(AI_light_2, AI.AI_car_1);
AI_light(AI_light_AI_2, AI.AI_car_2);
AI_light(AI_light_2_AI_2, AI.AI_car_2);
AI_light(AI_light_AI_3, AI.AI_car_3);
AI_light(AI_light_2_AI_3, AI.AI_car_3);
wheelBack1o = wheelBack1;
wheelBack2o = wheelBack2;
wheelBack3o = wheelBack3;
wheelBack4o = wheelBack4;
wheelBack5o = wheelBack5;
wheelBack6o = wheelBack6;
}
};
smokeC = 0;
Instance of Symbol 459 MovieClip "extra_BG" in Frame 52 (67 B)
onClipEvent (load) {
this.gotoAndStop(_root._currentframe - 49);
}
Instance of Symbol 551 MovieClip "advance_HIT" in Frame 52 (46 B)
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 551 MovieClip "advance_HIT_2" in Frame 52 (46 B)
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 551 MovieClip "advance_HIT_3" in Frame 52 (46 B)
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 551 MovieClip "advance_HIT_4" in Frame 52 (46 B)
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 607 MovieClip "ground" in Frame 52 (46 B)
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 927 MovieClip "over" in Frame 52 (67 B)
onClipEvent (load) {
this.gotoAndStop(_root._currentframe - 49);
}
Frame 53 (468 B)
_x = 0;
_y = 0;
stopAllSounds();
Paused = false;
hero.removeMovieClip();
trailerBody.removeMovieClip();
game_menu.removeMovieClip();
houses.removeMovieClip();
AI.removeMovieClip();
over.removeMovieClip();
HP = 100;
light_fx_2.removeMovieClip();
light_2.removeMovieClip();
AI_light_2.removeMovieClip();
AI_light_2_AI_2.removeMovieClip();
AI_light_2_AI_3.removeMovieClip();
police_lights.removeMovieClip();
police_lights_2.removeMovieClip();
play();
Frame 54 (21.91 KiB) ● ● ●
function i_rotation(i_ob, i_obr) {
var _local2 = i_ob._x - i_obr._x;
var _local1 = i_ob._y - i_obr._y;
var _local3 = Math.atan2(_local1, _local2) / i_alpha;
return(_local3);
}
function AI_light(ob_1, ob_2) {
ob_1._x = ob_2._x;
ob_1._y = ob_2._y;
ob_1._rotation = ob_2._rotation + 90;
}
function P_light(ob_1, ob_2) {
ob_1._x = ob_2._x;
ob_1._y = ob_2._y;
ob_1._rotation = ob_2._rotation - 180;
}
function sprayParticles(x, y, d) {
smokeC++;
s = _root.attachMovie("smoke", "smoke_" + smokeC, _root.getNextHighestDepth());
s._x = x;
s._y = y;
}
function proj(v1, v2) {
dp = dot(v1, v2);
v2s = (v2.x * v2.x) + (v2.y * v2.y);
x = (dp / v2s) * v2.x;
y = (dp / v2s) * v2.y;
return({x:x, y:y});
}
function dot(p1, p2) {
return((p1.x * p2.x) + (p1.y * p2.y));
}
function updatePoint(p) {
p.x = p.x + p.vx;
p.y = p.y + p.vy;
}
function satisfyConstraint(c) {
xd = (c.p2.x + c.p2.vx) - (c.p1.x + c.p1.vx);
yd = (c.p2.y + c.p2.vy) - (c.p1.y + c.p1.vy);
dis = Math.sqrt((xd * xd) + (yd * yd));
force = ((c.len - dis) / dis) * 0.5;
dx = xd * force;
dy = yd * force;
c.p1.vx = c.p1.vx - dx;
c.p1.vy = c.p1.vy - dy;
c.p2.vx = c.p2.vx + dx;
c.p2.vy = c.p2.vy + dy;
}
function update_bg_tiles() {
i = 0;
while (i < bg_A.length) {
if (bg_A[i]._x < (game_menu._x - 600)) {
if ((!bg_A[i].positioned) == true) {
bg_A[i].last_position = bg_A[i]._x;
bg_A[i].positioned = true;
}
bg_A[i]._x = bg_A[i].last_position + 1200;
bg_A[i].positioned = false;
}
if (bg_A[i]._x > (game_menu._x + 600)) {
if ((!bg_A[i].positioned) == true) {
bg_A[i].last_position = bg_A[i]._x;
bg_A[i].positioned = true;
}
bg_A[i]._x = bg_A[i].last_position - 1200;
bg_A[i].positioned = false;
}
if (bg_A[i]._y < (game_menu._y - 500)) {
if ((!bg_A[i].positioned) == true) {
bg_A[i].last_position = bg_A[i]._y;
bg_A[i].positioned = true;
}
bg_A[i]._y = bg_A[i].last_position + 1000;
bg_A[i].positioned = false;
}
if (bg_A[i]._y > (game_menu._y + 500)) {
if ((!bg_A[i].positioned) == true) {
bg_A[i].last_position = bg_A[i]._y;
bg_A[i].positioned = true;
}
bg_A[i]._y = bg_A[i].last_position - 1000;
bg_A[i].positioned = false;
}
i++;
}
}
function ground_hit(gh) {
engineUP = 0;
if (ground.hitTest(hero._x, hero._y, true)) {
car.engineSpd = (-car.engineSpd) + 0.1;
} else if (ground.hitTest(advance_HIT._x, advance_HIT._y, true)) {
car.engineSpd = (-car.engineSpd) - 0.2;
} else if (ground.hitTest(advance_HIT_2._x, advance_HIT_2._y, true)) {
car.engineSpd = (-car.engineSpd) - 0.2;
} else if (ground.hitTest(advance_HIT_3._x, advance_HIT_3._y, true)) {
car.engineSpd = (-car.engineSpd) + 0.1;
} else if (ground.hitTest(advance_HIT_4._x, advance_HIT_4._y, true)) {
car.engineSpd = (-car.engineSpd) + 0.1;
} else if (ground.hitTest(trailerBody._x, trailerBody._y, true)) {
trace("dfgfdgfdg");
car.engineSpd = (-car.engineSpd) + 0.9;
}
if (ground_hitting == false) {
if (ground.hitTest(hero._x, hero._y, true)) {
attachMovie("explosion_mc", "explosion_mc", 500000, {_x:hero._x, _y:hero._y, _rotation:hero._rotation});
} else if (ground.hitTest(advance_HIT._x, advance_HIT._y, true)) {
attachMovie("explosion_mc", "explosion_mc", 500000, {_x:advance_HIT._x, _y:advance_HIT._y, _rotation:hero._rotation});
} else if (ground.hitTest(advance_HIT_2._x, advance_HIT_2._y, true)) {
attachMovie("explosion_mc", "explosion_mc", 500000, {_x:advance_HIT_2._x, _y:advance_HIT_2._y, _rotation:hero._rotation});
} else if (ground.hitTest(advance_HIT_3._x, advance_HIT_3._y, true)) {
attachMovie("explosion_mc", "explosion_mc", 500000, {_x:advance_HIT_3._x, _y:advance_HIT_3._y, _rotation:hero._rotation});
} else if (ground.hitTest(advance_HIT_4._x, advance_HIT_4._y, true)) {
attachMovie("explosion_mc", "explosion_mc", 500000, {_x:advance_HIT_4._x, _y:advance_HIT_4._y, _rotation:hero._rotation});
} else if (ground.hitTest(trailerBody._x, trailerBody._y, true)) {
attachMovie("explosion_mc", "explosion_mc", 500000, {_x:trailerBody._x, _y:trailerBody._y, _rotation:hero._rotation});
}
random_370_380 = random(5) + 370;
car.p1.vx = 0;
car.p1.vy = 0;
car.p2.vx = 0;
car.p2.vy = 0;
car.p3.vx = 0;
car.p3.vy = 0;
ground_hitting = true;
if (ground_hit_timer >= 30) {
attachMovie("glass_brake", "glass_brake", random_370_380, {_x:hero._x, _y:hero._y, _rotation:hero._rotation});
ground_hit_timer = 0;
}
}
}
function trailer_hit(th) {
engineUP = 0;
if (ground.hitTest(trailerBody._x, trailerBody._y, true)) {
car.engineSpd = (-car.engineSpd) + 0.9;
}
if (trailer_hitting == false) {
if (ground.hitTest(trailerBody._x, trailerBody._y, true)) {
attachMovie("explosion_mc", "explosion_mc", 500000, {_x:trailerBody._x, _y:trailerBody._y, _rotation:hero._rotation});
}
random_370_380 = random(5) + 370;
car.p1.vx = 0;
car.p1.vy = 0;
car.p2.vx = 0;
car.p2.vy = 0;
car.p3.vx = 0;
car.p3.vy = 0;
trailer_hitting = true;
if (ground_hit_timer >= 30) {
attachMovie("glass_brake", "glass_brake", random_370_380, {_x:hero._x, _y:hero._y, _rotation:hero._rotation});
ground_hit_timer = 0;
}
}
}
function AI_hit(j) {
engineUP = 0;
if (AI_CARS_A[i].hitTest(advance_HIT._x, advance_HIT._y, true)) {
car.engineSpd = (-car.engineSpd) - 0.2;
} else if (AI_CARS_A[i].hitTest(advance_HIT_2._x, advance_HIT_2._y, true)) {
car.engineSpd = (-car.engineSpd) - 0.2;
} else if (AI_CARS_A[i].hitTest(advance_HIT_3._x, advance_HIT_3._y, true)) {
car.engineSpd = (-car.engineSpd) + 0.1;
} else if (AI_CARS_A[i].hitTest(advance_HIT_4._x, advance_HIT_4._y, true)) {
car.engineSpd = (-car.engineSpd) + 0.1;
} else if (AI_CARS_A[i].hitTest(trailerBory._x, trailerBody._y, true)) {
car.engineSpd = (-car.engineSpd) + 0.1;
} else if (AI_CARS_A[i].hitTest(trailerBody._x + 30, trailerBody._y + 30, true)) {
car.engineSpd = (-car.engineSpd) + 0.1;
} else if (AI_CARS_A[i].hitTest(trailerBody._x - 30, trailerBody._y - 30, true)) {
car.engineSpd = (-car.engineSpd) + 0.1;
}
if (AI_CARS_A[j].AI_hitting == false) {
if (AI_CARS_A[i].hitTest(advance_HIT._x, advance_HIT._y, true)) {
attachMovie("explosion_mc", "explosion_mc", 500000, {_x:advance_HIT._x, _y:advance_HIT._y, _rotation:hero._rotation});
} else if (AI_CARS_A[i].hitTest(advance_HIT_2._x, advance_HIT_2._y, true)) {
attachMovie("explosion_mc", "explosion_mc", 500000, {_x:advance_HIT_2._x, _y:advance_HIT_2._y, _rotation:hero._rotation});
} else if (AI_CARS_A[i].hitTest(advance_HIT_3._x, advance_HIT_3._y, true)) {
attachMovie("explosion_mc", "explosion_mc", 500000, {_x:advance_HIT_3._x, _y:advance_HIT_3._y, _rotation:hero._rotation});
} else if (AI_CARS_A[i].hitTest(advance_HIT_4._x, advance_HIT_4._y, true)) {
attachMovie("explosion_mc", "explosion_mc", 500000, {_x:advance_HIT_4._x, _y:advance_HIT_4._y, _rotation:hero._rotation});
} else if (AI_CARS_A[i].hitTest(trailerBody._x, trailerBody._y, true)) {
attachMovie("explosion_mc", "explosion_mc", 500000, {_x:trailerBody._x, _y:trailerBody._y, _rotation:hero._rotation});
}
random_370_380 = random(5) + 370;
car.p1.vx = 0;
car.p1.vy = 0;
car.p2.vx = 0;
car.p2.vy = 0;
car.p3.vx = 0;
car.p3.vy = 0;
AI.AI_speed = 0;
AI_CARS_A[j].AI_hitting = true;
if (ground_hit_timer >= 30) {
attachMovie("glass_brake", "glass_brake", random_370_380, {_x:hero._x, _y:hero._y, _rotation:hero._rotation});
ground_hit_timer = 0;
}
}
}
function speed_handle(sh) {
if (Key.isDown(49) and ((!speed_1) == true)) {
keyUP = true;
game_menu.handle._alpha = 100;
if (game_menu.handle._currentframe == 10) {
game_menu.handle.gotoAndPlay(30);
} else {
game_menu.handle.play();
}
speed_1 = true;
speed_2 = false;
speed_3 = false;
car.steerCorrect = 0.8;
}
if (Key.isDown(50) and ((!speed_2) == true)) {
keyUP = true;
game_menu.handle._alpha = 100;
game_menu.handle.play();
speed_1 = false;
speed_2 = true;
speed_3 = false;
car.steerCorrect = 0.7;
}
if (Key.isDown(51) and ((!speed_3) == true)) {
keyUP = true;
game_menu.handle._alpha = 100;
if (game_menu.handle._currentframe == 30) {
game_menu.handle.gotoAndPlay(10);
} else {
game_menu.handle.play();
}
speed_1 = false;
speed_2 = false;
speed_3 = true;
car.steerCorrect = 0.6;
}
}
function matrix_update() {
var _local4 = new flash.geom.Matrix();
_local4.tx = 20;
_local4.ty = -110;
_local4.rotate(hero._rotation * (Math.PI/180));
advance_HIT._x = _local4.tx + hero._x;
advance_HIT._y = _local4.ty + hero._y;
var _local3 = new flash.geom.Matrix();
_local3.tx = -20;
_local3.ty = -110;
_local3.rotate(hero._rotation * (Math.PI/180));
advance_HIT_2._x = _local3.tx + hero._x;
advance_HIT_2._y = _local3.ty + hero._y;
var _local2 = new flash.geom.Matrix();
_local2.tx = -20;
_local2.ty = 20;
_local2.rotate(hero._rotation * (Math.PI/180));
advance_HIT_3._x = _local2.tx + hero._x;
advance_HIT_3._y = _local2.ty + hero._y;
var _local1 = new flash.geom.Matrix();
_local1.tx = 20;
_local1.ty = 20;
_local1.rotate(hero._rotation * (Math.PI/180));
advance_HIT_4._x = _local1.tx + hero._x;
advance_HIT_4._y = _local1.ty + hero._y;
}
hero._x = 754;
hero._y = 345;
_x = Math.round(300 - car.p1.x);
_y = Math.round(250 - car.p1.y);
game_menu._x = (-_x) + 300;
game_menu._y = (-_y) + 250;
hero_pos_x = hero._x;
hero_pos_y = hero._y;
bg_A = [bgs.bg_1, bgs.bg_2, bgs.bg_3, bgs.bg_4];
roadArray = [road.road_1, road.road_2];
AI_CARS_A = [AI.AI_car_1.car, AI.AI_car_2.car, AI.AI_car_3.car, AI.AI_car_4.car];
game_quality = "low";
arrow_ob = road.park_area;
s18.stop(["menu_music"]);
on_road = true;
speed_1 = true;
speed_2 = false;
speed_3 = false;
ground_hitting = false;
trailerCon = false;
bgs.bg_1.positioned = false;
bgs.bg_2.positioned = false;
bgs.bg_3.positioned = false;
bgs.bg_4.positioned = false;
tutorial = true;
hitting = false;
smoke_depth = 0;
engineUP = 0;
text_num = 5;
game_menu.handle._alpha = 0;
s7_timer = 50;
ground_hit_timer = 50;
doing_nothing_timer = 50;
HP = 95;
game_menu.HP._alpha = 0;
driftFX = 0;
stop();
AI.swapDepths(_root.getNextHighestDepth());
hero.swapDepths(_root.getNextHighestDepth());
trailerBody.swapDepths(_root.getNextHighestDepth());
houses.swapDepths(_root.getNextHighestDepth());
over.swapDepths(_root.getNextHighestDepth());
police_lights.swapDepths(_root.getNextHighestDepth());
police_lights_2.swapDepths(_root.getNextHighestDepth());
light_2.swapDepths(_root.getNextHighestDepth());
AI_light_2.swapDepths(_root.getNextHighestDepth());
AI_light_2_AI_2.swapDepths(_root.getNextHighestDepth());
AI_light_2_AI_3.swapDepths(_root.getNextHighestDepth());
game_menu.swapDepths(999999999);
var car = new Object();
car.steerDir = 0;
car.steerOff = 0;
car.bodyDir = 0;
car.trailerDir = 0;
car.engineSpd = 0;
car.p1 = {x:hero_pos_x, y:hero_pos_y, vx:0, vy:0};
car.p2 = {x:hero_pos_x - 90, y:hero_pos_y + 50, vx:0, vy:0};
car.con = {p1:car.p1, p2:car.p2, len:110};
car.wheelFric = 0.97;
car.rearWheelGrip = 0.02;
car.accel = 0.2;
car.steerCorrect = 0.8;
var i_alpha = (Math.PI/180);
s19.start(1, 99999);
onEnterFrame = function () {
if ((Key.isDown(83) and (sound_ON == true)) and (!press_S)) {
_root.s1.setVolume(0);
sound_ON = false;
press_S = true;
}
if ((Key.isDown(83) and (sound_ON == false)) and (!press_S)) {
_root.s1.setVolume(100);
sound_ON = true;
press_S = true;
}
if (!Key.isDown(83)) {
press_S = false;
}
if (((Key.isDown(80) and (!p_key)) and ((!Paused) == true)) and (game_menu.Pause.can_pause == true)) {
game_menu.Pause.gotoAndPlay(2);
p_key = true;
}
if (((Key.isDown(80) and (!p_key)) and (Paused == true)) and (game_menu.Pause.can_unpause == true)) {
Paused = false;
game_menu.Pause.gotoAndPlay(21);
p_key = true;
}
if (!Key.isDown(80)) {
p_key = false;
}
if (Key.isDown(81) and (!q_key)) {
if (game_quality == "low") {
game_quality = "high";
_quality = "MEDIUM";
q_key = true;
} else if (game_quality == "high") {
game_quality = "low";
_quality = "LOW";
q_key = true;
}
} else if (!Key.isDown(81)) {
q_key = false;
}
_x = Math.round(300 - car.p1.x);
_y = Math.round(250 - car.p1.y);
game_menu._x = (-_x) + 300;
game_menu._y = (-_y) + 250;
game_mask._x = -_x;
game_mask._y = -_y;
extra_BG._x = game_menu._x;
extra_BG._y = game_menu._y;
over._x = game_menu._x;
over._y = game_menu._y;
if ((!Paused) == true) {
game_menu.radar.mini_road._x = (road._x / 50) - (_root.hero._x / 50);
game_menu.radar.mini_road._y = (road._y / 50) - (_root.hero._y / 50);
game_menu.HP._alpha--;
game_menu.HP.gotoAndStop((game_menu._currentframe = HP + 10));
if (game_menu.HP._currentframe <= 10) {
game_menu.game_level.gotoAndStop(3);
attachMovie("wreck", "wreck", 999999988, {_x:hero._x, _y:hero._y, _rotation:hero._rotation});
Paused = true;
}
matrix_update();
ground_hit_timer++;
i = 0;
while (i < roadArray.length) {
if (game_menu.hitTest(roadArray[i])) {
roadArray[i].gotoAndStop(1);
} else if (!game_menu.hitTest(roadArray[i])) {
roadArray[i].gotoAndStop(2);
}
i++;
}
s7_timer++;
if (point_num > 10) {
point_num = 0;
}
if (road.park_area.hitTest(hero._x, hero._y, true) and (car.engineSpd <= 0)) {
text_num = 6;
game_menu.texts.play();
}
if (game_menu.help._alpha < 100) {
game_menu.help._alpha++;
}
trailerBody._rotation = 112.7;
if (game_menu.handle._alpha >= 0) {
game_menu.handle._alpha = game_menu.handle._alpha - 3;
}
trailerSnapA = dot({x:Math.cos(car.bodyDir), y:Math.sin(car.bodyDir)}, {x:Math.cos(car.trailerDir), y:Math.sin(car.trailerDir)});
if (trailerSnapA < 0) {
car.p1.vx = (-car.p1.vy) - 0.05;
car.p1.vy = (-car.p1.vy) - 0.05;
}
if (trailerBody.attach_hit.hitTest(hero._x, hero._y, true)) {
ground.trailer_HIT.gotoAndStop(2);
houses.arrow_arrive.gotoAndStop(2);
houses.arrow_arrive_2.gotoAndStop(1);
attachMovie("star_attach", "star_attach", 999999998, {_x:hero._x, _y:hero._y - 30});
car.p3 = {x:trailerBody._x, y:trailerBody._y, vx:0, vy:0};
car.con2 = {p1:car.p2, p2:car.p3, len:150};
trailerBody.attach_hit.gotoAndStop(2);
arrow_ob = houses.park_place;
trailerCon = true;
}
updatePoint(car.p3);
game_menu.radar.map_arrow._rotation = i_rotation(hero, arrow_ob);
update_bg_tiles();
hero.window.gotoAndStop(Math.round((((car.bodyDir / (Math.PI/180)) + 180) / 360) * 120));
hero._x = car.p2.x;
hero._y = car.p2.y;
hero._rotation = (car.bodyDir / (Math.PI/180)) - 90;
hero.f1._rotation = (hero.f2._rotation = car.steerOff / (Math.PI/180));
trailerBody._x = car.p3.x;
trailerBody._y = car.p3.y;
trailerBody._rotation = (car.trailerDir / (Math.PI/180)) - 90;
updatePoint(car.p1);
updatePoint(car.p2);
i = 0;
while (i < 5) {
satisfyConstraint(car.con);
satisfyConstraint(car.con2);
i++;
}
car.bodyDir = Math.atan2(car.p2.y - car.p1.y, car.p2.x - car.p1.x);
car.trailerDir = Math.atan2(car.p3.y - car.p2.y, car.p3.x - car.p2.x);
car.steerDir = car.bodyDir + car.steerOff;
p1vel = Math.sqrt((car.p1.vx * car.p1.vx) + (car.p1.vy * car.p1.vy));
p2vel = Math.sqrt((car.p2.vx * car.p2.vx) + (car.p2.vy * car.p2.vy));
p3vel = Math.sqrt((car.p3.vx * car.p3.vx) + (car.p3.vy * car.p3.vy));
car.p1.vx = car.p1.vx - (car.engineSpd * Math.cos(car.steerDir));
car.p1.vy = car.p1.vy - (car.engineSpd * Math.sin(car.steerDir));
if (p2vel != 0) {
mDot = dot({x:Math.cos(car.bodyDir), y:Math.sin(car.bodyDir)}, {x:car.p2.vx / p2vel, y:car.p2.vy / p2vel});
if ((Math.abs(mDot) < 0.84) and (car.engineSpd > 0.3)) {
attachMovie("smoke", "smoke", smoke_depth, {_x:hero._x, _y:hero._y, _rotation:hero._rotation});
if (!s10_start) {
s10.start();
s10_start = true;
}
} else {
s10_start = false;
}
}
if (p3vel != 0) {
mDot = dot({x:Math.cos(car.trailerDir), y:Math.sin(car.trailerDir)}, {x:car.p3.vx / p3vel, y:car.p3.vy / p3vel});
if (Math.abs(mDot) < 0.84) {
}
}
if (p2vel != 0) {
pp = proj({x:car.p2.vx, y:car.p2.vy}, {y:-Math.cos(car.bodyDir), x:Math.sin(car.bodyDir)});
car.p2.vx = car.p2.vx * ((1 - Math.abs((pp.x / p2vel) * car.rearWheelGrip)) - driftFX);
car.p2.vy = car.p2.vy * ((1 - Math.abs((pp.y / p2vel) * car.rearWheelGrip)) - driftFX);
}
if (p3vel != 0) {
pp = proj({x:car.p3.vx, y:car.p3.vy}, {y:-Math.cos(car.trailerDir), x:Math.sin(car.trailerDir)});
car.p3.vx = car.p3.vx * (1 - Math.abs((pp.x / p3vel) * car.rearWheelGrip));
car.p3.vy = car.p3.vy * (1 - Math.abs((pp.y / p3vel) * car.rearWheelGrip));
}
car.p1.vx = car.p1.vx * car.wheelFric;
car.p1.vy = car.p1.vy * car.wheelFric;
car.p2.vx = car.p2.vx * car.wheelFric;
car.p2.vy = car.p2.vy * car.wheelFric;
car.p3.vx = car.p3.vx * car.wheelFric;
car.p3.vy = car.p3.vy * car.wheelFric;
car.engineSpd = car.engineSpd * 0.9;
if (car.engineSpd > 0) {
driftFX = 0.1;
car.steerOff = car.steerOff * car.steerCorrect;
} else {
car.steerOff = car.steerOff * (car.steerCorrect / 1.2);
}
if (road.hitTest(hero._x, hero._y, true)) {
on_road = true;
car.accel = 0.2;
car.rearWheelGrip = 0.08;
if (!engineSlowed) {
engineUP = -0.5;
engineSlowed = true;
}
} else {
engineSlowed = false;
car.engineSpd = car.engineSpd - (car.engineSpd / 2);
if (car.engineSpd == 0.5) {
car.engineSpd = 0.5;
}
on_road = false;
car.accel = 0.1;
car.rearWheelGrip = 0.02;
if ((engineSpd > 0) and (game_quality == "high")) {
attachMovie("smoke_sandy", "smoke_sandy", 21, {_x:hero._x, _y:hero._y, _rotation:hero._rotation});
}
}
if (hitting) {
if (ground.hitTest(advance_HIT._x, advance_HIT._y, true)) {
ground_hit(gh);
} else if (ground.hitTest(advance_HIT_2._x, advance_HIT_2._y, true)) {
ground_hit(gh);
} else if (ground.hitTest(advance_HIT_3._x, advance_HIT_3._y, true)) {
ground_hit(gh);
} else if (ground.hitTest(advance_HIT_4._x, advance_HIT_4._y, true)) {
ground_hit(gh);
} else if (ground.hitTest(hero._x, hero._y, true)) {
ground_hit(gh);
} else {
ground_hitting = false;
}
if (ground.hitTest(trailerBody._x, trailerBody._y, true) && ((!trailerCon) == false)) {
trailer_hit(th);
} else {
trailer_hitting = false;
}
}
i = 0;
while (i < AI_CARS_A.length) {
if (AI_CARS_A[i].hitTest(advance_HIT._x, advance_HIT._y, true)) {
AI_hit(i);
} else if (AI_CARS_A[i].hitTest(advance_HIT_2._x, advance_HIT_2._y, true)) {
AI_hit(i);
} else if (AI_CARS_A[i].hitTest(advance_HIT_3._x, advance_HIT_3._y, true)) {
AI_hit(i);
} else if (AI_CARS_A[i].hitTest(advance_HIT_4._x, advance_HIT_4._y, true)) {
AI_hit(i);
} else {
AI_CARS_A[i].AI_hitting = false;
}
i++;
}
if (smoke_depth >= 20) {
smoke_depth = 0;
} else {
smoke_depth++;
}
if (engineUP >= 0.5) {
engineUP = 0.5;
} else if (engineUP <= 0) {
engineUP = 0;
}
if (Key.isDown(38)) {
doing_nothing_timer = 50;
s6_start = false;
s6.stop(["truck_idle"]);
if (keyUP) {
if ((!s7_start) and (s7_timer >= 50)) {
s7.start();
s7_timer = 0;
s7_start = true;
}
if (speed_1) {
s4.start(6, 99999);
s5.stop(["truck_drive_faster"]);
s8.stop(["truck_drive_fastest"]);
}
if (speed_2) {
s5.start(5, 99999);
s4.stop(["truck_drive"]);
s8.stop(["truck_drive_fastest"]);
}
if (speed_3) {
s8.start(4, 99999);
s4.stop(["truck_drive"]);
s5.stop(["truck_drive_faster"]);
}
keyUP = false;
}
car.engineSpd = car.engineSpd + engineUP;
engineUP = engineUP + 0.003;
} else {
if ((car.engineSpd <= 0.001) and (!Key.isDown(40))) {
car.engineSpd = 0;
}
engineUP = engineUP - 0.004;
doing_nothing_timer = doing_nothing_timer - 0.5;
if (doing_nothing_timer <= 0) {
s6.stop(["truck_idle"]);
}
s7_start = false;
s4.stop(["truck_drive"]);
s5.stop(["truck_drive_faster"]);
s7.stop(["truck_start"]);
s8.stop(["truck_drive_fastest"]);
if (!s6_start) {
s6.start(1, 99999);
s6_start = true;
}
keyUP = true;
}
if (Key.isDown(40)) {
doing_nothing_timer = 50;
if ((ground_hitting == true) or (AI_CARS_A[i].AI_hitting == true)) {
car.engineSpd = car.engineSpd - 0.09;
} else {
car.engineSpd = car.engineSpd - 0.05;
}
}
speed_handle(sh);
if (speed_1 and on_road) {
if (car.engineSpd > 0.8) {
car.engineSpd = car.engineSpd - 0.35;
}
}
if (speed_2 and on_road) {
if (car.engineSpd > 2) {
car.engineSpd = car.engineSpd - 0.2;
}
}
if (((car.engineSpd > 4) and speed_3) and on_road) {
car.engineSpd = 4;
}
if (Key.isDown(37)) {
if (on_road == true) {
car.steerOff = car.steerOff - 0.1;
} else {
car.steerOff = car.steerOff - 0.1;
}
} else if (Key.isDown(39)) {
if (on_road == true) {
car.steerOff = car.steerOff + 0.1;
} else {
car.steerOff = car.steerOff + 0.1;
}
}
if (Key.isDown(32)) {
if (car.engineSpd > 0) {
car.engineSpd = car.engineSpd - 0.3;
}
}
light._x = hero._x;
light._y = hero._y;
light._rotation = hero._rotation;
light_2._x = hero._x;
light_2._y = hero._y;
light_2._rotation = hero._rotation;
AI_light(AI_light_1, AI.AI_car_1);
AI_light(AI_light_2, AI.AI_car_1);
AI_light(AI_light_1_AI_2, AI.AI_car_2);
AI_light(AI_light_2_AI_2, AI.AI_car_2);
P_light(police_lights, AI.AI_car_1);
P_light(police_lights_2, AI.AI_car_2);
P_light(police_lights_3, AI.AI_car_3);
wheelBack1o = wheelBack1;
wheelBack2o = wheelBack2;
wheelBack3o = wheelBack3;
wheelBack4o = wheelBack4;
wheelBack5o = wheelBack5;
wheelBack6o = wheelBack6;
}
};
smokeC = 0;
Instance of Symbol 459 MovieClip "extra_BG" in Frame 54 (67 B)
onClipEvent (load) {
this.gotoAndStop(_root._currentframe - 49);
}
Instance of Symbol 551 MovieClip "advance_HIT" in Frame 54 (46 B)
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 551 MovieClip "advance_HIT_2" in Frame 54 (46 B)
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 551 MovieClip "advance_HIT_3" in Frame 54 (46 B)
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 551 MovieClip "advance_HIT_4" in Frame 54 (46 B)
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 626 MovieClip "ground" in Frame 54 (46 B)
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 927 MovieClip "over" in Frame 54 (67 B)
onClipEvent (load) {
this.gotoAndStop(_root._currentframe - 49);
}
Frame 55 (468 B)
_x = 0;
_y = 0;
stopAllSounds();
Paused = false;
hero.removeMovieClip();
trailerBody.removeMovieClip();
game_menu.removeMovieClip();
houses.removeMovieClip();
AI.removeMovieClip();
over.removeMovieClip();
HP = 100;
light_fx_2.removeMovieClip();
light_2.removeMovieClip();
AI_light_2.removeMovieClip();
AI_light_2_AI_2.removeMovieClip();
AI_light_2_AI_3.removeMovieClip();
police_lights.removeMovieClip();
police_lights_2.removeMovieClip();
play();
Frame 56 (23.09 KiB) ● ● ●
function i_rotation(i_ob, i_obr) {
var _local2 = i_ob._x - i_obr._x;
var _local1 = i_ob._y - i_obr._y;
var _local3 = Math.atan2(_local1, _local2) / i_alpha;
return(_local3);
}
function sprayParticles(x, y, d) {
smokeC++;
s = _root.attachMovie("smoke", "smoke_" + smokeC, _root.getNextHighestDepth());
s._x = x;
s._y = y;
}
function proj(v1, v2) {
dp = dot(v1, v2);
v2s = (v2.x * v2.x) + (v2.y * v2.y);
x = (dp / v2s) * v2.x;
y = (dp / v2s) * v2.y;
return({x:x, y:y});
}
function dot(p1, p2) {
return((p1.x * p2.x) + (p1.y * p2.y));
}
function updatePoint(p) {
p.x = p.x + p.vx;
p.y = p.y + p.vy;
}
function satisfyConstraint(c) {
xd = (c.p2.x + c.p2.vx) - (c.p1.x + c.p1.vx);
yd = (c.p2.y + c.p2.vy) - (c.p1.y + c.p1.vy);
dis = Math.sqrt((xd * xd) + (yd * yd));
force = ((c.len - dis) / dis) * 0.5;
dx = xd * force;
dy = yd * force;
c.p1.vx = c.p1.vx - dx;
c.p1.vy = c.p1.vy - dy;
c.p2.vx = c.p2.vx + dx;
c.p2.vy = c.p2.vy + dy;
}
function update_bg_tiles() {
i = 0;
while (i < bg_A.length) {
if (bg_A[i]._x < (game_menu._x - 600)) {
if ((!bg_A[i].positioned) == true) {
bg_A[i].last_position = bg_A[i]._x;
bg_A[i].positioned = true;
}
bg_A[i]._x = bg_A[i].last_position + 1200;
bg_A[i].positioned = false;
}
if (bg_A[i]._x > (game_menu._x + 600)) {
if ((!bg_A[i].positioned) == true) {
bg_A[i].last_position = bg_A[i]._x;
bg_A[i].positioned = true;
}
bg_A[i]._x = bg_A[i].last_position - 1200;
bg_A[i].positioned = false;
}
if (bg_A[i]._y < (game_menu._y - 500)) {
if ((!bg_A[i].positioned) == true) {
bg_A[i].last_position = bg_A[i]._y;
bg_A[i].positioned = true;
}
bg_A[i]._y = bg_A[i].last_position + 1000;
bg_A[i].positioned = false;
}
if (bg_A[i]._y > (game_menu._y + 500)) {
if ((!bg_A[i].positioned) == true) {
bg_A[i].last_position = bg_A[i]._y;
bg_A[i].positioned = true;
}
bg_A[i]._y = bg_A[i].last_position - 1000;
bg_A[i].positioned = false;
}
i++;
}
}
function ground_hit(gh) {
engineUP = 0;
if (ground.hitTest(hero._x, hero._y, true)) {
car.engineSpd = (-car.engineSpd) + 0.1;
} else if (ground.hitTest(advance_HIT._x, advance_HIT._y, true)) {
car.engineSpd = (-car.engineSpd) - 0.2;
} else if (ground.hitTest(advance_HIT_2._x, advance_HIT_2._y, true)) {
car.engineSpd = (-car.engineSpd) - 0.2;
} else if (ground.hitTest(advance_HIT_3._x, advance_HIT_3._y, true)) {
car.engineSpd = (-car.engineSpd) + 0.1;
} else if (ground.hitTest(advance_HIT_4._x, advance_HIT_4._y, true)) {
car.engineSpd = (-car.engineSpd) + 0.1;
} else if (ground.hitTest(trailerBody._x, trailerBody._y, true)) {
trace("dfgfdgfdg");
car.engineSpd = (-car.engineSpd) + 0.9;
}
if (ground_hitting == false) {
if (ground.hitTest(hero._x, hero._y, true)) {
attachMovie("explosion_mc", "explosion_mc", 500000, {_x:hero._x, _y:hero._y, _rotation:hero._rotation});
} else if (ground.hitTest(advance_HIT._x, advance_HIT._y, true)) {
attachMovie("explosion_mc", "explosion_mc", 500000, {_x:advance_HIT._x, _y:advance_HIT._y, _rotation:hero._rotation});
} else if (ground.hitTest(advance_HIT_2._x, advance_HIT_2._y, true)) {
attachMovie("explosion_mc", "explosion_mc", 500000, {_x:advance_HIT_2._x, _y:advance_HIT_2._y, _rotation:hero._rotation});
} else if (ground.hitTest(advance_HIT_3._x, advance_HIT_3._y, true)) {
attachMovie("explosion_mc", "explosion_mc", 500000, {_x:advance_HIT_3._x, _y:advance_HIT_3._y, _rotation:hero._rotation});
} else if (ground.hitTest(advance_HIT_4._x, advance_HIT_4._y, true)) {
attachMovie("explosion_mc", "explosion_mc", 500000, {_x:advance_HIT_4._x, _y:advance_HIT_4._y, _rotation:hero._rotation});
} else if (ground.hitTest(trailerBody._x, trailerBody._y, true)) {
attachMovie("explosion_mc", "explosion_mc", 500000, {_x:trailerBody._x, _y:trailerBody._y, _rotation:hero._rotation});
}
random_370_380 = random(5) + 370;
car.p1.vx = 0;
car.p1.vy = 0;
car.p2.vx = 0;
car.p2.vy = 0;
car.p3.vx = 0;
car.p3.vy = 0;
ground_hitting = true;
if (ground_hit_timer >= 30) {
attachMovie("glass_brake", "glass_brake", random_370_380, {_x:hero._x, _y:hero._y, _rotation:hero._rotation});
ground_hit_timer = 0;
}
}
}
function trailer_hit(th) {
engineUP = 0;
if (ground.hitTest(trailerBody._x, trailerBody._y, true)) {
car.engineSpd = (-car.engineSpd) + 0.9;
}
if (trailer_hitting == false) {
if (ground.hitTest(trailerBody._x, trailerBody._y, true)) {
attachMovie("explosion_mc", "explosion_mc", 500000, {_x:trailerBody._x, _y:trailerBody._y, _rotation:hero._rotation});
}
random_370_380 = random(5) + 370;
car.p1.vx = 0;
car.p1.vy = 0;
car.p2.vx = 0;
car.p2.vy = 0;
car.p3.vx = 0;
car.p3.vy = 0;
trailer_hitting = true;
if (ground_hit_timer >= 30) {
attachMovie("glass_brake", "glass_brake", random_370_380, {_x:hero._x, _y:hero._y, _rotation:hero._rotation});
ground_hit_timer = 0;
}
}
}
function AI_hit(j) {
if (!AI_reco) {
if (j == 0) {
AI.AI_speed_1 = AI.AI_speed_1 - 0.05;
AI.AI_speed_1 = -1;
}
if (j == 1) {
AI.AI_speed_2 = AI.AI_speed_2 - 0.05;
AI.AI_speed_2 = -1;
}
AI_reco = true;
}
if (AI_CARS_A[i].hitTest(advance_HIT._x, advance_HIT._y, true)) {
car.engineSpd = (-car.engineSpd) - 0.2;
} else if (AI_CARS_A[i].hitTest(advance_HIT_2._x, advance_HIT_2._y, true)) {
car.engineSpd = (-car.engineSpd) - 0.2;
} else if (AI_CARS_A[i].hitTest(advance_HIT_3._x, advance_HIT_3._y, true)) {
car.engineSpd = (-car.engineSpd) + 0.1;
} else if (AI_CARS_A[i].hitTest(advance_HIT_4._x, advance_HIT_4._y, true)) {
car.engineSpd = (-car.engineSpd) + 0.1;
} else if (AI_CARS_A[i].hitTest(hero._x, hero._y, true)) {
car.engineSpd = (-car.engineSpd) + 0.1;
} else if (AI_CARS_A[i].hitTest(trailerBory._x, trailerBody._y, true)) {
car.engineSpd = (-car.engineSpd) + 0.1;
} else if (AI_CARS_A[i].hitTest(trailerBody._x + 30, trailerBody._y + 30, true)) {
car.engineSpd = (-car.engineSpd) + 0.1;
} else if (AI_CARS_A[i].hitTest(trailerBody._x - 30, trailerBody._y - 30, true)) {
car.engineSpd = (-car.engineSpd) + 0.1;
}
if (AI_CARS_A[j].AI_hitting == false) {
if (AI_CARS_A[i].hitTest(advance_HIT._x, advance_HIT._y, true)) {
attachMovie("explosion_mc", "explosion_mc", 500000, {_x:advance_HIT._x, _y:advance_HIT._y, _rotation:hero._rotation});
attachMovie("wreck", "wreck", 999999992, {_x:hero._x, _y:hero._y});
} else if (AI_CARS_A[i].hitTest(advance_HIT_2._x, advance_HIT_2._y, true)) {
attachMovie("explosion_mc", "explosion_mc", 500000, {_x:advance_HIT_2._x, _y:advance_HIT_2._y, _rotation:hero._rotation});
attachMovie("wreck", "wreck", 999999992, {_x:hero._x, _y:hero._y});
} else if (AI_CARS_A[i].hitTest(advance_HIT_3._x, advance_HIT_3._y, true)) {
attachMovie("explosion_mc", "explosion_mc", 500000, {_x:advance_HIT_3._x, _y:advance_HIT_3._y, _rotation:hero._rotation});
attachMovie("wreck", "wreck", 999999992, {_x:hero._x, _y:hero._y});
} else if (AI_CARS_A[i].hitTest(advance_HIT_4._x, advance_HIT_4._y, true)) {
attachMovie("explosion_mc", "explosion_mc", 500000, {_x:advance_HIT_4._x, _y:advance_HIT_4._y, _rotation:hero._rotation});
attachMovie("wreck", "wreck", 999999992, {_x:hero._x, _y:hero._y});
} else if (AI_CARS_A[i].hitTest(trailerBody._x, trailerBody._y, true)) {
attachMovie("explosion_mc", "explosion_mc", 500000, {_x:trailerBody._x, _y:trailerBody._y, _rotation:hero._rotation});
attachMovie("wreck", "wreck", 999999992, {_x:hero._x, _y:hero._y});
} else if (AI_CARS_A[i].hitTest(hero._x, hero._y, true)) {
attachMovie("explosion_mc", "explosion_mc", 500000, {_x:trailerBody._x, _y:trailerBody._y, _rotation:hero._rotation});
attachMovie("wreck", "wreck", 999999992, {_x:hero._x, _y:hero._y});
}
random_370_380 = random(5) + 370;
car.p1.vx = car.p1.vx - 1;
car.p1.vy = car.p1.vy - 1;
engineSpd = 0;
engineUP = engineUP - 2;
AI_CARS_A[j].AI_hitting = true;
if (ground_hit_timer >= 30) {
attachMovie("glass_brake", "glass_brake", random_370_380, {_x:hero._x, _y:hero._y, _rotation:hero._rotation});
ground_hit_timer = 0;
}
}
}
function speed_handle(sh) {
if (Key.isDown(49) and ((!speed_1) == true)) {
keyUP = true;
game_menu.handle._alpha = 100;
if (game_menu.handle._currentframe == 10) {
game_menu.handle.gotoAndPlay(30);
} else {
game_menu.handle.play();
}
speed_1 = true;
speed_2 = false;
speed_3 = false;
car.steerCorrect = 0.8;
}
if (Key.isDown(50) and ((!speed_2) == true)) {
keyUP = true;
game_menu.handle._alpha = 100;
game_menu.handle.play();
speed_1 = false;
speed_2 = true;
speed_3 = false;
car.steerCorrect = 0.7;
}
if (Key.isDown(51) and ((!speed_3) == true)) {
keyUP = true;
game_menu.handle._alpha = 100;
if (game_menu.handle._currentframe == 30) {
game_menu.handle.gotoAndPlay(10);
} else {
game_menu.handle.play();
}
speed_1 = false;
speed_2 = false;
speed_3 = true;
car.steerCorrect = 0.6;
}
}
function matrix_update() {
var _local6 = new flash.geom.Matrix();
_local6.tx = 20;
_local6.ty = -110;
_local6.rotate(hero._rotation * (Math.PI/180));
advance_HIT._x = _local6.tx + hero._x;
advance_HIT._y = _local6.ty + hero._y;
var _local5 = new flash.geom.Matrix();
_local5.tx = -20;
_local5.ty = -110;
_local5.rotate(hero._rotation * (Math.PI/180));
advance_HIT_2._x = _local5.tx + hero._x;
advance_HIT_2._y = _local5.ty + hero._y;
var _local4 = new flash.geom.Matrix();
_local4.tx = -20;
_local4.ty = 20;
_local4.rotate(hero._rotation * (Math.PI/180));
advance_HIT_3._x = _local4.tx + hero._x;
advance_HIT_3._y = _local4.ty + hero._y;
var _local3 = new flash.geom.Matrix();
_local3.tx = 20;
_local3.ty = 20;
_local3.rotate(hero._rotation * (Math.PI/180));
advance_HIT_4._x = _local3.tx + hero._x;
advance_HIT_4._y = _local3.ty + hero._y;
var _local2 = new flash.geom.Matrix();
_local2.tx = 120;
_local2.ty = -100;
_local2.rotate(hero._rotation * (Math.PI/180));
AI_follow._x = _local2.tx + hero._x;
AI_follow._y = _local2.ty + hero._y;
var _local1 = new flash.geom.Matrix();
_local1.tx = -120;
_local1.ty = -100;
_local1.rotate(hero._rotation * (Math.PI/180));
AI_follow_2._x = _local1.tx + hero._x;
AI_follow_2._y = _local1.ty + hero._y;
}
hero._x = 1455;
hero._y = 324;
trailerBody._x = 6059;
trailerBody._y = -8598;
trailerBody.gotoAndStop(2);
_x = Math.round(300 - car.p1.x);
_y = Math.round(250 - car.p1.y);
game_menu._x = (-_x) + 300;
game_menu._y = (-_y) + 250;
hero_pos_x = hero._x;
hero_pos_y = hero._y;
bg_A = [bgs.bg_1, bgs.bg_2, bgs.bg_3, bgs.bg_4];
roadArray = [road.road_1, road.road_2];
AI_CARS_A = [AI.AI_car_1.car, AI.AI_car_2.car];
game_quality = "low";
arrow_ob = trailerBody;
s18.stop(["menu_music"]);
on_road = true;
speed_1 = true;
speed_2 = false;
speed_3 = false;
ground_hitting = false;
trailerCon = false;
bgs.bg_1.positioned = false;
bgs.bg_2.positioned = false;
bgs.bg_3.positioned = false;
bgs.bg_4.positioned = false;
smoke_depth = 0;
engineUP = 0;
text_num = 7;
game_menu.handle._alpha = 0;
s7_timer = 50;
ground_hit_timer = 50;
doing_nothing_timer = 50;
HP = 95;
game_menu.HP._alpha = 0;
driftFX = 0;
smoking_timer = 25;
smoking_depth = 850;
stop();
AI.swapDepths(_root.getNextHighestDepth());
hero.swapDepths(_root.getNextHighestDepth());
trailerBody.swapDepths(_root.getNextHighestDepth());
houses.swapDepths(_root.getNextHighestDepth());
over.swapDepths(_root.getNextHighestDepth());
game_menu.swapDepths(999999999);
var car = new Object();
car.steerDir = 0;
car.steerOff = 0;
car.bodyDir = 0;
car.trailerDir = 0;
car.engineSpd = 0;
car.p1 = {x:hero_pos_x, y:hero_pos_y, vx:0, vy:0};
car.p2 = {x:hero_pos_x + 110, y:hero_pos_y - 170, vx:0, vy:0};
car.con = {p1:car.p1, p2:car.p2, len:110};
car.wheelFric = 0.97;
car.rearWheelGrip = 0.02;
car.accel = 0.2;
car.steerCorrect = 0.8;
var i_alpha = (Math.PI/180);
s3.start(1, 99999);
onEnterFrame = function () {
if ((Key.isDown(83) and (sound_ON == true)) and (!press_S)) {
_root.s1.setVolume(0);
sound_ON = false;
press_S = true;
}
if ((Key.isDown(83) and (sound_ON == false)) and (!press_S)) {
_root.s1.setVolume(100);
sound_ON = true;
press_S = true;
}
if (!Key.isDown(83)) {
press_S = false;
}
if (((Key.isDown(80) and (!p_key)) and ((!Paused) == true)) and (game_menu.Pause.can_pause == true)) {
game_menu.Pause.gotoAndPlay(2);
p_key = true;
}
if (((Key.isDown(80) and (!p_key)) and (Paused == true)) and (game_menu.Pause.can_unpause == true)) {
Paused = false;
game_menu.Pause.gotoAndPlay(21);
p_key = true;
}
if (!Key.isDown(80)) {
p_key = false;
}
if (Key.isDown(81) and (!q_key)) {
if (game_quality == "low") {
game_quality = "high";
_quality = "MEDIUM";
q_key = true;
} else if (game_quality == "high") {
game_quality = "low";
_quality = "LOW";
q_key = true;
}
} else if (!Key.isDown(81)) {
q_key = false;
}
_x = Math.round(300 - car.p1.x);
_y = Math.round(250 - car.p1.y);
game_menu._x = (-_x) + 300;
game_menu._y = (-_y) + 250;
game_mask._x = -_x;
game_mask._y = -_y;
extra_BG._x = game_menu._x;
extra_BG._y = game_menu._y;
over._x = game_menu._x;
over._y = game_menu._y;
if ((!Paused) == true) {
if (HP <= 50) {
smoking_timer--;
if (smoking_timer <= 0) {
attachMovie("smoking", "smoking_2", smoking_depth, {_x:hero._x, _y:hero._y, _rotation:hero._rotation});
smoking_timer = 10;
smoking_depth++;
if (smoking_depth > 880) {
smoking_depth = 850;
}
}
}
game_menu.radar.mini_road._x = (road._x / 50) - (_root.hero._x / 50);
game_menu.radar.mini_road._y = (road._y / 50) - (_root.hero._y / 50);
game_menu.HP._alpha--;
game_menu.HP.gotoAndStop((game_menu._currentframe = HP + 10));
if (game_menu.HP._currentframe <= 10) {
game_menu.game_level.gotoAndStop(3);
attachMovie("wreck", "wreck", 999999988, {_x:hero._x, _y:hero._y, _rotation:hero._rotation});
Paused = true;
}
matrix_update();
ground_hit_timer++;
i = 0;
while (i < roadArray.length) {
if (game_menu.hitTest(roadArray[i])) {
roadArray[i].gotoAndStop(1);
} else if (!game_menu.hitTest(roadArray[i])) {
roadArray[i].gotoAndStop(2);
}
i++;
}
s7_timer++;
if (point_num > 10) {
point_num = 0;
}
if (road.park_area.hitTest(hero._x, hero._y, true) and (car.engineSpd <= 0)) {
text_num = 9;
game_menu.texts.play();
}
if (game_menu.help._alpha < 100) {
game_menu.help._alpha++;
}
trailerBody._rotation = -170;
if (game_menu.handle._alpha >= 0) {
game_menu.handle._alpha = game_menu.handle._alpha - 3;
}
trailerSnapA = dot({x:Math.cos(car.bodyDir), y:Math.sin(car.bodyDir)}, {x:Math.cos(car.trailerDir), y:Math.sin(car.trailerDir)});
if (trailerSnapA < 0) {
car.p1.vx = (-car.p1.vy) - 0.05;
car.p1.vy = (-car.p1.vy) - 0.05;
}
if (trailerBody.attach_hit.hitTest(hero._x, hero._y, true)) {
ground.trailer_HIT.gotoAndStop(2);
houses.arrow_arrive.gotoAndStop(2);
houses.arrow_arrive_2.gotoAndStop(1);
attachMovie("star_attach", "star_attach", 999999998, {_x:hero._x, _y:hero._y - 30});
car.p3 = {x:trailerBody._x, y:trailerBody._y, vx:0, vy:0};
car.con2 = {p1:car.p2, p2:car.p3, len:150};
trailerBody.attach_hit.gotoAndStop(2);
arrow_ob = road.park_area;
trailerCon = true;
road.park_area.gotoAndStop(1);
ground.trailer_hit_mc.gotoAndStop(2);
}
updatePoint(car.p3);
game_menu.radar.map_arrow._rotation = i_rotation(hero, arrow_ob);
update_bg_tiles();
hero.window.gotoAndStop(Math.round((((car.bodyDir / (Math.PI/180)) + 180) / 360) * 120));
hero._x = car.p2.x;
hero._y = car.p2.y;
hero._rotation = (car.bodyDir / (Math.PI/180)) - 90;
hero.f1._rotation = (hero.f2._rotation = car.steerOff / (Math.PI/180));
trailerBody._x = car.p3.x;
trailerBody._y = car.p3.y;
trailerBody._rotation = (car.trailerDir / (Math.PI/180)) - 90;
updatePoint(car.p1);
updatePoint(car.p2);
i = 0;
while (i < 5) {
satisfyConstraint(car.con);
satisfyConstraint(car.con2);
i++;
}
car.bodyDir = Math.atan2(car.p2.y - car.p1.y, car.p2.x - car.p1.x);
car.trailerDir = Math.atan2(car.p3.y - car.p2.y, car.p3.x - car.p2.x);
car.steerDir = car.bodyDir + car.steerOff;
p1vel = Math.sqrt((car.p1.vx * car.p1.vx) + (car.p1.vy * car.p1.vy));
p2vel = Math.sqrt((car.p2.vx * car.p2.vx) + (car.p2.vy * car.p2.vy));
p3vel = Math.sqrt((car.p3.vx * car.p3.vx) + (car.p3.vy * car.p3.vy));
car.p1.vx = car.p1.vx - (car.engineSpd * Math.cos(car.steerDir));
car.p1.vy = car.p1.vy - (car.engineSpd * Math.sin(car.steerDir));
if (p2vel != 0) {
mDot = dot({x:Math.cos(car.bodyDir), y:Math.sin(car.bodyDir)}, {x:car.p2.vx / p2vel, y:car.p2.vy / p2vel});
if ((Math.abs(mDot) < 0.84) and (car.engineSpd > 0.3)) {
attachMovie("smoke", "smoke", smoke_depth, {_x:hero._x, _y:hero._y, _rotation:hero._rotation});
if (!s10_start) {
s10.start();
s10_start = true;
}
} else {
s10_start = false;
}
}
if (p3vel != 0) {
mDot = dot({x:Math.cos(car.trailerDir), y:Math.sin(car.trailerDir)}, {x:car.p3.vx / p3vel, y:car.p3.vy / p3vel});
if (Math.abs(mDot) < 0.84) {
}
}
if (p2vel != 0) {
pp = proj({x:car.p2.vx, y:car.p2.vy}, {y:-Math.cos(car.bodyDir), x:Math.sin(car.bodyDir)});
car.p2.vx = car.p2.vx * ((1 - Math.abs((pp.x / p2vel) * car.rearWheelGrip)) - driftFX);
car.p2.vy = car.p2.vy * ((1 - Math.abs((pp.y / p2vel) * car.rearWheelGrip)) - driftFX);
}
if (p3vel != 0) {
pp = proj({x:car.p3.vx, y:car.p3.vy}, {y:-Math.cos(car.trailerDir), x:Math.sin(car.trailerDir)});
car.p3.vx = car.p3.vx * (1 - Math.abs((pp.x / p3vel) * car.rearWheelGrip));
car.p3.vy = car.p3.vy * (1 - Math.abs((pp.y / p3vel) * car.rearWheelGrip));
}
car.p1.vx = car.p1.vx * car.wheelFric;
car.p1.vy = car.p1.vy * car.wheelFric;
car.p2.vx = car.p2.vx * car.wheelFric;
car.p2.vy = car.p2.vy * car.wheelFric;
car.p3.vx = car.p3.vx * car.wheelFric;
car.p3.vy = car.p3.vy * car.wheelFric;
car.engineSpd = car.engineSpd * 0.9;
if (car.engineSpd > 0) {
driftFX = 0.1;
car.steerOff = car.steerOff * car.steerCorrect;
} else {
car.steerOff = car.steerOff * (car.steerCorrect / 1.2);
}
if (road.hitTest(hero._x, hero._y, true)) {
on_road = true;
car.accel = 0.2;
car.rearWheelGrip = 0.08;
if (!engineSlowed) {
engineUP = -0.5;
engineSlowed = true;
}
} else {
engineSlowed = false;
car.engineSpd = car.engineSpd - (car.engineSpd / 2);
if (car.engineSpd == 0.5) {
car.engineSpd = 0.5;
}
on_road = false;
car.accel = 0.1;
car.rearWheelGrip = 0.02;
if ((engineSpd > 0) and (game_quality == "high")) {
attachMovie("smoke_sandy", "smoke_sandy", 21, {_x:hero._x, _y:hero._y, _rotation:hero._rotation});
}
}
if (ground.hitTest(over._x - 300, over._y - 250, true)) {
over_hit = true;
} else if (ground.hitTest(over._x + 300, over._y + 250, true)) {
over_hit = true;
} else {
over_hit = false;
}
if (ground.hitTest(advance_HIT._x, advance_HIT._y, true)) {
ground_hit(gh);
} else if (ground.hitTest(advance_HIT_2._x, advance_HIT_2._y, true)) {
ground_hit(gh);
} else if (ground.hitTest(advance_HIT_3._x, advance_HIT_3._y, true)) {
ground_hit(gh);
} else if (ground.hitTest(advance_HIT_4._x, advance_HIT_4._y, true)) {
ground_hit(gh);
} else if (ground.hitTest(hero._x, hero._y, true)) {
ground_hit(gh);
} else {
ground_hitting = false;
}
if (ground.hitTest(trailerBody._x, trailerBody._y, true) && ((!trailerCon) == false)) {
trailer_hit(th);
} else {
trailer_hitting = false;
}
i = 0;
while (i < AI_CARS_A.length) {
if (AI_CARS_A[i].hitTest(advance_HIT._x, advance_HIT._y, true)) {
AI_hit(i);
} else if (AI_CARS_A[i].hitTest(advance_HIT_2._x, advance_HIT_2._y, true)) {
AI_hit(i);
} else if (AI_CARS_A[i].hitTest(advance_HIT_3._x, advance_HIT_3._y, true)) {
AI_hit(i);
} else if (AI_CARS_A[i].hitTest(advance_HIT_4._x, advance_HIT_4._y, true)) {
AI_hit(i);
} else if (AI_CARS_A[i].hitTest(hero._x, hero._y, true)) {
AI_hit(i);
} else if (AI_CARS_A[i].hitTest(trailerBody._x + 30, trailerBody._y + 30, true)) {
AI_hit(i);
} else if (AI_CARS_A[i].hitTest(trailerBody._x + 30, trailerBody._y + 30, true)) {
AI_hit(i);
} else {
AI_CARS_A[i].AI_hitting = false;
AI_reco = false;
}
i++;
}
if (smoke_depth >= 20) {
smoke_depth = 0;
} else {
smoke_depth++;
}
if (engineUP >= 0.5) {
engineUP = 0.5;
} else if (engineUP <= 0) {
engineUP = 0;
}
if (Key.isDown(38)) {
doing_nothing_timer = 50;
s6_start = false;
s6.stop(["truck_idle"]);
if (keyUP) {
if ((!s7_start) and (s7_timer >= 50)) {
s7.start();
s7_timer = 0;
s7_start = true;
}
if (speed_1) {
s4.start(6, 99999);
s5.stop(["truck_drive_faster"]);
s8.stop(["truck_drive_fastest"]);
}
if (speed_2) {
s5.start(5, 99999);
s4.stop(["truck_drive"]);
s8.stop(["truck_drive_fastest"]);
}
if (speed_3) {
s8.start(4, 99999);
s4.stop(["truck_drive"]);
s5.stop(["truck_drive_faster"]);
}
keyUP = false;
}
car.engineSpd = car.engineSpd + engineUP;
engineUP = engineUP + 0.003;
} else {
if ((car.engineSpd <= 0.001) and (!Key.isDown(40))) {
car.engineSpd = 0;
}
engineUP = engineUP - 0.004;
doing_nothing_timer = doing_nothing_timer - 0.5;
if (doing_nothing_timer <= 0) {
s6.stop(["truck_idle"]);
}
s7_start = false;
s4.stop(["truck_drive"]);
s5.stop(["truck_drive_faster"]);
s7.stop(["truck_start"]);
s8.stop(["truck_drive_fastest"]);
if (!s6_start) {
s6.start(1, 99999);
s6_start = true;
}
keyUP = true;
}
if (Key.isDown(40)) {
doing_nothing_timer = 50;
if ((ground_hitting == true) or (AI_CARS_A[i].AI_hitting == true)) {
car.engineSpd = car.engineSpd - 0.09;
} else {
car.engineSpd = car.engineSpd - 0.05;
}
}
speed_handle(sh);
if (speed_1 and on_road) {
if (car.engineSpd > 0.8) {
car.engineSpd = car.engineSpd - 0.35;
}
}
if (speed_2 and on_road) {
if (car.engineSpd > 2) {
car.engineSpd = car.engineSpd - 0.2;
}
}
if (((car.engineSpd > 4) and speed_3) and on_road) {
car.engineSpd = 4;
}
if (Key.isDown(37)) {
if (on_road == true) {
car.steerOff = car.steerOff - 0.1;
} else {
car.steerOff = car.steerOff - 0.1;
}
} else if (Key.isDown(39)) {
if (on_road == true) {
car.steerOff = car.steerOff + 0.1;
} else {
car.steerOff = car.steerOff + 0.1;
}
}
if (Key.isDown(32)) {
if (car.engineSpd > 0) {
car.engineSpd = car.engineSpd - 0.3;
}
}
wheelBack1o = wheelBack1;
wheelBack2o = wheelBack2;
wheelBack3o = wheelBack3;
wheelBack4o = wheelBack4;
wheelBack5o = wheelBack5;
wheelBack6o = wheelBack6;
}
};
smokeC = 0;
Instance of Symbol 459 MovieClip "extra_BG" in Frame 56 (67 B)
onClipEvent (load) {
this.gotoAndStop(_root._currentframe - 49);
}
Instance of Symbol 645 MovieClip "ground" in Frame 56 (46 B)
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 551 MovieClip "advance_HIT" in Frame 56 (46 B)
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 551 MovieClip "advance_HIT_2" in Frame 56 (46 B)
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 551 MovieClip "advance_HIT_3" in Frame 56 (46 B)
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 551 MovieClip "advance_HIT_4" in Frame 56 (46 B)
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 551 MovieClip "AI_follow" in Frame 56 (46 B)
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 551 MovieClip "AI_follow_2" in Frame 56 (46 B)
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 927 MovieClip "over" in Frame 56 (67 B)
onClipEvent (load) {
this.gotoAndStop(_root._currentframe - 49);
}
Frame 57 (236 B)
_x = 0;
_y = 0;
stopAllSounds();
Paused = false;
hero.removeMovieClip();
trailerBody.removeMovieClip();
game_menu.removeMovieClip();
houses.removeMovieClip();
AI.removeMovieClip();
over.removeMovieClip();
HP = 100;
play();
Frame 58 (20.91 KiB) ● ● ●
function i_rotation(i_ob, i_obr) {
var _local2 = i_ob._x - i_obr._x;
var _local1 = i_ob._y - i_obr._y;
var _local3 = Math.atan2(_local1, _local2) / i_alpha;
return(_local3);
}
function sprayParticles(x, y, d) {
smokeC++;
s = _root.attachMovie("smoke", "smoke_" + smokeC, _root.getNextHighestDepth());
s._x = x;
s._y = y;
}
function proj(v1, v2) {
dp = dot(v1, v2);
v2s = (v2.x * v2.x) + (v2.y * v2.y);
x = (dp / v2s) * v2.x;
y = (dp / v2s) * v2.y;
return({x:x, y:y});
}
function dot(p1, p2) {
return((p1.x * p2.x) + (p1.y * p2.y));
}
function updatePoint(p) {
p.x = p.x + p.vx;
p.y = p.y + p.vy;
}
function satisfyConstraint(c) {
xd = (c.p2.x + c.p2.vx) - (c.p1.x + c.p1.vx);
yd = (c.p2.y + c.p2.vy) - (c.p1.y + c.p1.vy);
dis = Math.sqrt((xd * xd) + (yd * yd));
force = ((c.len - dis) / dis) * 0.5;
dx = xd * force;
dy = yd * force;
c.p1.vx = c.p1.vx - dx;
c.p1.vy = c.p1.vy - dy;
c.p2.vx = c.p2.vx + dx;
c.p2.vy = c.p2.vy + dy;
}
function update_bg_tiles() {
i = 0;
while (i < bg_A.length) {
if (bg_A[i]._x < (game_menu._x - 600)) {
if ((!bg_A[i].positioned) == true) {
bg_A[i].last_position = bg_A[i]._x;
bg_A[i].positioned = true;
}
bg_A[i]._x = bg_A[i].last_position + 1200;
bg_A[i].positioned = false;
}
if (bg_A[i]._x > (game_menu._x + 600)) {
if ((!bg_A[i].positioned) == true) {
bg_A[i].last_position = bg_A[i]._x;
bg_A[i].positioned = true;
}
bg_A[i]._x = bg_A[i].last_position - 1200;
bg_A[i].positioned = false;
}
if (bg_A[i]._y < (game_menu._y - 500)) {
if ((!bg_A[i].positioned) == true) {
bg_A[i].last_position = bg_A[i]._y;
bg_A[i].positioned = true;
}
bg_A[i]._y = bg_A[i].last_position + 1000;
bg_A[i].positioned = false;
}
if (bg_A[i]._y > (game_menu._y + 500)) {
if ((!bg_A[i].positioned) == true) {
bg_A[i].last_position = bg_A[i]._y;
bg_A[i].positioned = true;
}
bg_A[i]._y = bg_A[i].last_position - 1000;
bg_A[i].positioned = false;
}
i++;
}
}
function ground_hit(gh) {
engineUP = 0;
if (ground.hitTest(hero._x, hero._y, true)) {
car.engineSpd = (-car.engineSpd) + 0.1;
} else if (ground.hitTest(advance_HIT._x, advance_HIT._y, true)) {
car.engineSpd = (-car.engineSpd) - 0.2;
} else if (ground.hitTest(advance_HIT_2._x, advance_HIT_2._y, true)) {
car.engineSpd = (-car.engineSpd) - 0.2;
} else if (ground.hitTest(advance_HIT_3._x, advance_HIT_3._y, true)) {
car.engineSpd = (-car.engineSpd) + 0.1;
} else if (ground.hitTest(advance_HIT_4._x, advance_HIT_4._y, true)) {
car.engineSpd = (-car.engineSpd) + 0.1;
} else if (ground.hitTest(trailerBody._x, trailerBody._y, true)) {
trace("dfgfdgfdg");
car.engineSpd = (-car.engineSpd) + 0.9;
}
if (ground_hitting == false) {
if (ground.hitTest(hero._x, hero._y, true)) {
attachMovie("explosion_mc", "explosion_mc", 500000, {_x:hero._x, _y:hero._y, _rotation:hero._rotation});
} else if (ground.hitTest(advance_HIT._x, advance_HIT._y, true)) {
attachMovie("explosion_mc", "explosion_mc", 500000, {_x:advance_HIT._x, _y:advance_HIT._y, _rotation:hero._rotation});
} else if (ground.hitTest(advance_HIT_2._x, advance_HIT_2._y, true)) {
attachMovie("explosion_mc", "explosion_mc", 500000, {_x:advance_HIT_2._x, _y:advance_HIT_2._y, _rotation:hero._rotation});
} else if (ground.hitTest(advance_HIT_3._x, advance_HIT_3._y, true)) {
attachMovie("explosion_mc", "explosion_mc", 500000, {_x:advance_HIT_3._x, _y:advance_HIT_3._y, _rotation:hero._rotation});
} else if (ground.hitTest(advance_HIT_4._x, advance_HIT_4._y, true)) {
attachMovie("explosion_mc", "explosion_mc", 500000, {_x:advance_HIT_4._x, _y:advance_HIT_4._y, _rotation:hero._rotation});
} else if (ground.hitTest(trailerBody._x, trailerBody._y, true)) {
attachMovie("explosion_mc", "explosion_mc", 500000, {_x:trailerBody._x, _y:trailerBody._y, _rotation:hero._rotation});
}
random_370_380 = random(5) + 370;
car.p1.vx = 0;
car.p1.vy = 0;
car.p2.vx = 0;
car.p2.vy = 0;
car.p3.vx = 0;
car.p3.vy = 0;
ground_hitting = true;
if (ground_hit_timer >= 30) {
attachMovie("glass_brake", "glass_brake", random_370_380, {_x:hero._x, _y:hero._y, _rotation:hero._rotation});
ground_hit_timer = 0;
}
}
}
function trailer_hit(th) {
engineUP = 0;
if (ground.hitTest(trailerBody._x, trailerBody._y, true)) {
car.engineSpd = (-car.engineSpd) + 0.9;
}
if (trailer_hitting == false) {
if (ground.hitTest(trailerBody._x, trailerBody._y, true)) {
attachMovie("explosion_mc", "explosion_mc", 500000, {_x:trailerBody._x, _y:trailerBody._y, _rotation:hero._rotation});
}
random_370_380 = random(5) + 370;
car.p1.vx = 0;
car.p1.vy = 0;
car.p2.vx = 0;
car.p2.vy = 0;
car.p3.vx = 0;
car.p3.vy = 0;
trailer_hitting = true;
if (ground_hit_timer >= 30) {
attachMovie("glass_brake", "glass_brake", random_370_380, {_x:hero._x, _y:hero._y, _rotation:hero._rotation});
ground_hit_timer = 0;
}
}
}
function AI_hit(j) {
engineUP = 0;
if (AI_CARS_A[i].hitTest(advance_HIT._x, advance_HIT._y, true)) {
car.engineSpd = (-car.engineSpd) - 0.2;
} else if (AI_CARS_A[i].hitTest(advance_HIT_2._x, advance_HIT_2._y, true)) {
car.engineSpd = (-car.engineSpd) - 0.2;
} else if (AI_CARS_A[i].hitTest(advance_HIT_3._x, advance_HIT_3._y, true)) {
car.engineSpd = (-car.engineSpd) + 0.1;
} else if (AI_CARS_A[i].hitTest(advance_HIT_4._x, advance_HIT_4._y, true)) {
car.engineSpd = (-car.engineSpd) + 0.1;
} else if (AI_CARS_A[i].hitTest(trailerBory._x, trailerBody._y, true)) {
car.engineSpd = (-car.engineSpd) + 0.1;
} else if (AI_CARS_A[i].hitTest(trailerBody._x + 30, trailerBody._y + 30, true)) {
car.engineSpd = (-car.engineSpd) + 0.1;
} else if (AI_CARS_A[i].hitTest(trailerBody._x - 30, trailerBody._y - 30, true)) {
car.engineSpd = (-car.engineSpd) + 0.1;
}
if (AI_CARS_A[j].AI_hitting == false) {
if (AI_CARS_A[i].hitTest(advance_HIT._x, advance_HIT._y, true)) {
attachMovie("explosion_mc", "explosion_mc", 500000, {_x:advance_HIT._x, _y:advance_HIT._y, _rotation:hero._rotation});
} else if (AI_CARS_A[i].hitTest(advance_HIT_2._x, advance_HIT_2._y, true)) {
attachMovie("explosion_mc", "explosion_mc", 500000, {_x:advance_HIT_2._x, _y:advance_HIT_2._y, _rotation:hero._rotation});
} else if (AI_CARS_A[i].hitTest(advance_HIT_3._x, advance_HIT_3._y, true)) {
attachMovie("explosion_mc", "explosion_mc", 500000, {_x:advance_HIT_3._x, _y:advance_HIT_3._y, _rotation:hero._rotation});
} else if (AI_CARS_A[i].hitTest(advance_HIT_4._x, advance_HIT_4._y, true)) {
attachMovie("explosion_mc", "explosion_mc", 500000, {_x:advance_HIT_4._x, _y:advance_HIT_4._y, _rotation:hero._rotation});
} else if (AI_CARS_A[i].hitTest(trailerBody._x, trailerBody._y, true)) {
attachMovie("explosion_mc", "explosion_mc", 500000, {_x:trailerBody._x, _y:trailerBody._y, _rotation:hero._rotation});
}
random_370_380 = random(5) + 370;
car.p1.vx = 0;
car.p1.vy = 0;
car.p2.vx = 0;
car.p2.vy = 0;
car.p3.vx = 0;
car.p3.vy = 0;
AI.AI_speed = 0;
AI_CARS_A[j].AI_hitting = true;
if (ground_hit_timer >= 30) {
attachMovie("glass_brake", "glass_brake", random_370_380, {_x:hero._x, _y:hero._y, _rotation:hero._rotation});
ground_hit_timer = 0;
}
}
}
function speed_handle(sh) {
if (Key.isDown(49) and ((!speed_1) == true)) {
keyUP = true;
game_menu.handle._alpha = 100;
if (game_menu.handle._currentframe == 10) {
game_menu.handle.gotoAndPlay(30);
} else {
game_menu.handle.play();
}
speed_1 = true;
speed_2 = false;
speed_3 = false;
car.steerCorrect = 0.8;
}
if (Key.isDown(50) and ((!speed_2) == true)) {
keyUP = true;
game_menu.handle._alpha = 100;
game_menu.handle.play();
speed_1 = false;
speed_2 = true;
speed_3 = false;
car.steerCorrect = 0.7;
}
if (Key.isDown(51) and ((!speed_3) == true)) {
keyUP = true;
game_menu.handle._alpha = 100;
if (game_menu.handle._currentframe == 30) {
game_menu.handle.gotoAndPlay(10);
} else {
game_menu.handle.play();
}
speed_1 = false;
speed_2 = false;
speed_3 = true;
car.steerCorrect = 0.6;
}
}
function matrix_update() {
var _local4 = new flash.geom.Matrix();
_local4.tx = 20;
_local4.ty = -110;
_local4.rotate(hero._rotation * (Math.PI/180));
advance_HIT._x = _local4.tx + hero._x;
advance_HIT._y = _local4.ty + hero._y;
var _local3 = new flash.geom.Matrix();
_local3.tx = -20;
_local3.ty = -110;
_local3.rotate(hero._rotation * (Math.PI/180));
advance_HIT_2._x = _local3.tx + hero._x;
advance_HIT_2._y = _local3.ty + hero._y;
var _local2 = new flash.geom.Matrix();
_local2.tx = -20;
_local2.ty = 20;
_local2.rotate(hero._rotation * (Math.PI/180));
advance_HIT_3._x = _local2.tx + hero._x;
advance_HIT_3._y = _local2.ty + hero._y;
var _local1 = new flash.geom.Matrix();
_local1.tx = 20;
_local1.ty = 20;
_local1.rotate(hero._rotation * (Math.PI/180));
advance_HIT_4._x = _local1.tx + hero._x;
advance_HIT_4._y = _local1.ty + hero._y;
}
hero._x = 2050;
hero._y = 754;
_x = Math.round(300 - car.p1.x);
_y = Math.round(250 - car.p1.y);
game_menu._x = (-_x) + 300;
game_menu._y = (-_y) + 250;
hero_pos_x = hero._x;
hero_pos_y = hero._y;
bg_A = [bgs.bg_1, bgs.bg_2, bgs.bg_3, bgs.bg_4];
roadArray = [road.road_1, road.road_2];
AI_CARS_A = [AI.AI_car_1.car, AI.AI_car_2.car, AI.AI_car_3.car, AI.AI_car_4.car];
game_quality = "low";
arrow_ob = road.park_area;
s18.stop(["menu_music"]);
on_road = true;
speed_1 = true;
speed_2 = false;
speed_3 = false;
ground_hitting = false;
trailerCon = false;
bgs.bg_1.positioned = false;
bgs.bg_2.positioned = false;
bgs.bg_3.positioned = false;
bgs.bg_4.positioned = false;
hitting = false;
smoke_depth = 0;
engineUP = 0;
text_num = 10;
game_menu.handle._alpha = 0;
s7_timer = 50;
ground_hit_timer = 50;
doing_nothing_timer = 50;
HP = 95;
game_menu.HP._alpha = 0;
driftFX = 0;
stop();
AI.swapDepths(_root.getNextHighestDepth());
hero.swapDepths(_root.getNextHighestDepth());
trailerBody.swapDepths(_root.getNextHighestDepth());
houses.swapDepths(_root.getNextHighestDepth());
over.swapDepths(_root.getNextHighestDepth());
game_menu.swapDepths(999999999);
var car = new Object();
car.steerDir = 0;
car.steerOff = 0;
car.bodyDir = 0;
car.trailerDir = 0;
car.engineSpd = 0;
car.p1 = {x:hero_pos_x, y:hero_pos_y, vx:0, vy:0};
car.p2 = {x:hero_pos_x - 110, y:hero_pos_y + 15, vx:0, vy:0};
car.con = {p1:car.p1, p2:car.p2, len:110};
car.wheelFric = 0.97;
car.rearWheelGrip = 0.02;
car.accel = 0.2;
car.steerCorrect = 0.8;
var i_alpha = (Math.PI/180);
s3.start(1, 99999);
onEnterFrame = function () {
if ((Key.isDown(83) and (sound_ON == true)) and (!press_S)) {
_root.s1.setVolume(0);
sound_ON = false;
press_S = true;
}
if ((Key.isDown(83) and (sound_ON == false)) and (!press_S)) {
_root.s1.setVolume(100);
sound_ON = true;
press_S = true;
}
if (!Key.isDown(83)) {
press_S = false;
}
if (((Key.isDown(80) and (!p_key)) and ((!Paused) == true)) and (game_menu.Pause.can_pause == true)) {
game_menu.Pause.gotoAndPlay(2);
p_key = true;
}
if (((Key.isDown(80) and (!p_key)) and (Paused == true)) and (game_menu.Pause.can_unpause == true)) {
Paused = false;
game_menu.Pause.gotoAndPlay(21);
p_key = true;
}
if (!Key.isDown(80)) {
p_key = false;
}
if (Key.isDown(81) and (!q_key)) {
if (game_quality == "low") {
game_quality = "high";
_quality = "MEDIUM";
q_key = true;
} else if (game_quality == "high") {
game_quality = "low";
_quality = "LOW";
q_key = true;
}
} else if (!Key.isDown(81)) {
q_key = false;
}
_x = Math.round(300 - car.p1.x);
_y = Math.round(250 - car.p1.y);
game_menu._x = (-_x) + 300;
game_menu._y = (-_y) + 250;
game_mask._x = -_x;
game_mask._y = -_y;
extra_BG._x = game_menu._x;
extra_BG._y = game_menu._y;
over._x = game_menu._x;
over._y = game_menu._y;
if ((!Paused) == true) {
game_menu.radar.mini_road._x = (road._x / 50) - (_root.hero._x / 50);
game_menu.radar.mini_road._y = (road._y / 50) - (_root.hero._y / 50);
game_menu.HP._alpha--;
game_menu.HP.gotoAndStop((game_menu._currentframe = HP + 10));
if (game_menu.HP._currentframe <= 10) {
game_menu.game_level.gotoAndStop(3);
attachMovie("wreck", "wreck", 999999988, {_x:hero._x, _y:hero._y, _rotation:hero._rotation});
Paused = true;
}
matrix_update();
ground_hit_timer++;
i = 0;
while (i < roadArray.length) {
if (game_menu.hitTest(roadArray[i])) {
roadArray[i].gotoAndStop(1);
} else if (!game_menu.hitTest(roadArray[i])) {
roadArray[i].gotoAndStop(2);
}
i++;
}
s7_timer++;
if (point_num > 10) {
point_num = 0;
}
if (road.park_area.hitTest(hero._x, hero._y, true) and (car.engineSpd <= 0)) {
text_num = 11;
hero.gotoAndStop(2);
game_menu.texts.play();
}
if (game_menu.help._alpha < 100) {
game_menu.help._alpha++;
}
trailerBody._rotation = 112.7;
if (game_menu.handle._alpha >= 0) {
game_menu.handle._alpha = game_menu.handle._alpha - 3;
}
trailerSnapA = dot({x:Math.cos(car.bodyDir), y:Math.sin(car.bodyDir)}, {x:Math.cos(car.trailerDir), y:Math.sin(car.trailerDir)});
if (trailerSnapA < 0) {
car.p1.vx = (-car.p1.vy) - 0.05;
car.p1.vy = (-car.p1.vy) - 0.05;
}
if (trailerBody.attach_hit.hitTest(hero._x, hero._y, true)) {
ground.trailer_HIT.gotoAndStop(2);
houses.arrow_arrive.gotoAndStop(2);
houses.arrow_arrive_2.gotoAndStop(1);
attachMovie("star_attach", "star_attach", 999999998, {_x:hero._x, _y:hero._y - 30});
car.p3 = {x:trailerBody._x, y:trailerBody._y, vx:0, vy:0};
car.con2 = {p1:car.p2, p2:car.p3, len:150};
trailerBody.attach_hit.gotoAndStop(2);
arrow_ob = houses.park_place;
trailerCon = true;
}
updatePoint(car.p3);
game_menu.radar.map_arrow._rotation = i_rotation(hero, arrow_ob);
update_bg_tiles();
hero.window.gotoAndStop(Math.round((((car.bodyDir / (Math.PI/180)) + 180) / 360) * 120));
hero._x = car.p2.x;
hero._y = car.p2.y;
hero._rotation = (car.bodyDir / (Math.PI/180)) - 90;
hero.f1._rotation = (hero.f2._rotation = car.steerOff / (Math.PI/180));
trailerBody._x = car.p3.x;
trailerBody._y = car.p3.y;
trailerBody._rotation = (car.trailerDir / (Math.PI/180)) - 90;
updatePoint(car.p1);
updatePoint(car.p2);
i = 0;
while (i < 5) {
satisfyConstraint(car.con);
satisfyConstraint(car.con2);
i++;
}
car.bodyDir = Math.atan2(car.p2.y - car.p1.y, car.p2.x - car.p1.x);
car.trailerDir = Math.atan2(car.p3.y - car.p2.y, car.p3.x - car.p2.x);
car.steerDir = car.bodyDir + car.steerOff;
p1vel = Math.sqrt((car.p1.vx * car.p1.vx) + (car.p1.vy * car.p1.vy));
p2vel = Math.sqrt((car.p2.vx * car.p2.vx) + (car.p2.vy * car.p2.vy));
p3vel = Math.sqrt((car.p3.vx * car.p3.vx) + (car.p3.vy * car.p3.vy));
car.p1.vx = car.p1.vx - (car.engineSpd * Math.cos(car.steerDir));
car.p1.vy = car.p1.vy - (car.engineSpd * Math.sin(car.steerDir));
if (p2vel != 0) {
mDot = dot({x:Math.cos(car.bodyDir), y:Math.sin(car.bodyDir)}, {x:car.p2.vx / p2vel, y:car.p2.vy / p2vel});
if ((Math.abs(mDot) < 0.84) and (car.engineSpd > 0.3)) {
attachMovie("smoke", "smoke", smoke_depth, {_x:hero._x, _y:hero._y, _rotation:hero._rotation});
if (!s10_start) {
s10.start();
s10_start = true;
}
} else {
s10_start = false;
}
}
if (p3vel != 0) {
mDot = dot({x:Math.cos(car.trailerDir), y:Math.sin(car.trailerDir)}, {x:car.p3.vx / p3vel, y:car.p3.vy / p3vel});
if (Math.abs(mDot) < 0.84) {
}
}
if (p2vel != 0) {
pp = proj({x:car.p2.vx, y:car.p2.vy}, {y:-Math.cos(car.bodyDir), x:Math.sin(car.bodyDir)});
car.p2.vx = car.p2.vx * ((1 - Math.abs((pp.x / p2vel) * car.rearWheelGrip)) - driftFX);
car.p2.vy = car.p2.vy * ((1 - Math.abs((pp.y / p2vel) * car.rearWheelGrip)) - driftFX);
}
if (p3vel != 0) {
pp = proj({x:car.p3.vx, y:car.p3.vy}, {y:-Math.cos(car.trailerDir), x:Math.sin(car.trailerDir)});
car.p3.vx = car.p3.vx * (1 - Math.abs((pp.x / p3vel) * car.rearWheelGrip));
car.p3.vy = car.p3.vy * (1 - Math.abs((pp.y / p3vel) * car.rearWheelGrip));
}
car.p1.vx = car.p1.vx * car.wheelFric;
car.p1.vy = car.p1.vy * car.wheelFric;
car.p2.vx = car.p2.vx * car.wheelFric;
car.p2.vy = car.p2.vy * car.wheelFric;
car.p3.vx = car.p3.vx * car.wheelFric;
car.p3.vy = car.p3.vy * car.wheelFric;
car.engineSpd = car.engineSpd * 0.9;
if (car.engineSpd > 0) {
driftFX = 0.1;
car.steerOff = car.steerOff * car.steerCorrect;
} else {
car.steerOff = car.steerOff * (car.steerCorrect / 1.2);
}
if (road.hitTest(hero._x, hero._y, true)) {
on_road = true;
car.accel = 0.2;
car.rearWheelGrip = 0.08;
if (!engineSlowed) {
engineUP = -0.5;
engineSlowed = true;
}
} else {
engineSlowed = false;
car.engineSpd = car.engineSpd - (car.engineSpd / 2);
if (car.engineSpd == 0.5) {
car.engineSpd = 0.5;
}
on_road = false;
car.accel = 0.1;
car.rearWheelGrip = 0.02;
if ((engineSpd > 0) and (game_quality == "high")) {
attachMovie("smoke_sandy", "smoke_sandy", 21, {_x:hero._x, _y:hero._y, _rotation:hero._rotation});
}
}
if (hitting) {
if (ground.hitTest(advance_HIT._x, advance_HIT._y, true)) {
ground_hit(gh);
} else if (ground.hitTest(advance_HIT_2._x, advance_HIT_2._y, true)) {
ground_hit(gh);
} else if (ground.hitTest(advance_HIT_3._x, advance_HIT_3._y, true)) {
ground_hit(gh);
} else if (ground.hitTest(advance_HIT_4._x, advance_HIT_4._y, true)) {
ground_hit(gh);
} else if (ground.hitTest(hero._x, hero._y, true)) {
ground_hit(gh);
} else {
ground_hitting = false;
}
}
if (ground.hitTest(trailerBody._x, trailerBody._y, true) && ((!trailerCon) == false)) {
trailer_hit(th);
} else {
trailer_hitting = false;
}
i = 0;
while (i < AI_CARS_A.length) {
if (AI_CARS_A[i].hitTest(advance_HIT._x, advance_HIT._y, true)) {
AI_hit(i);
} else if (AI_CARS_A[i].hitTest(advance_HIT_2._x, advance_HIT_2._y, true)) {
AI_hit(i);
} else if (AI_CARS_A[i].hitTest(advance_HIT_3._x, advance_HIT_3._y, true)) {
AI_hit(i);
} else if (AI_CARS_A[i].hitTest(advance_HIT_4._x, advance_HIT_4._y, true)) {
AI_hit(i);
} else {
AI_CARS_A[i].AI_hitting = false;
}
i++;
}
if (smoke_depth >= 20) {
smoke_depth = 0;
} else {
smoke_depth++;
}
if (engineUP >= 0.5) {
engineUP = 0.5;
} else if (engineUP <= 0) {
engineUP = 0;
}
if (Key.isDown(38)) {
doing_nothing_timer = 50;
s6_start = false;
s6.stop(["truck_idle"]);
if (keyUP) {
if ((!s7_start) and (s7_timer >= 50)) {
s7.start();
s7_timer = 0;
s7_start = true;
}
if (speed_1) {
s4.start(6, 99999);
s5.stop(["truck_drive_faster"]);
s8.stop(["truck_drive_fastest"]);
}
if (speed_2) {
s5.start(5, 99999);
s4.stop(["truck_drive"]);
s8.stop(["truck_drive_fastest"]);
}
if (speed_3) {
s8.start(4, 99999);
s4.stop(["truck_drive"]);
s5.stop(["truck_drive_faster"]);
}
keyUP = false;
}
car.engineSpd = car.engineSpd + engineUP;
engineUP = engineUP + 0.003;
} else {
if ((car.engineSpd <= 0.001) and (!Key.isDown(40))) {
car.engineSpd = 0;
}
engineUP = engineUP - 0.004;
doing_nothing_timer = doing_nothing_timer - 0.5;
if (doing_nothing_timer <= 0) {
s6.stop(["truck_idle"]);
}
s7_start = false;
s4.stop(["truck_drive"]);
s5.stop(["truck_drive_faster"]);
s7.stop(["truck_start"]);
s8.stop(["truck_drive_fastest"]);
if (!s6_start) {
s6.start(1, 99999);
s6_start = true;
}
keyUP = true;
}
if (Key.isDown(40)) {
doing_nothing_timer = 50;
if ((ground_hitting == true) or (AI_CARS_A[i].AI_hitting == true)) {
car.engineSpd = car.engineSpd - 0.09;
} else {
car.engineSpd = car.engineSpd - 0.05;
}
}
speed_handle(sh);
if (speed_1 and on_road) {
if (car.engineSpd > 0.8) {
car.engineSpd = car.engineSpd - 0.35;
}
}
if (speed_2 and on_road) {
if (car.engineSpd > 2) {
car.engineSpd = car.engineSpd - 0.2;
}
}
if (((car.engineSpd > 4) and speed_3) and on_road) {
car.engineSpd = 4;
}
if (Key.isDown(37)) {
if (on_road == true) {
car.steerOff = car.steerOff - 0.1;
} else {
car.steerOff = car.steerOff - 0.1;
}
} else if (Key.isDown(39)) {
if (on_road == true) {
car.steerOff = car.steerOff + 0.1;
} else {
car.steerOff = car.steerOff + 0.1;
}
}
if (Key.isDown(32)) {
if (car.engineSpd > 0) {
car.engineSpd = car.engineSpd - 0.3;
}
}
wheelBack1o = wheelBack1;
wheelBack2o = wheelBack2;
wheelBack3o = wheelBack3;
wheelBack4o = wheelBack4;
wheelBack5o = wheelBack5;
wheelBack6o = wheelBack6;
}
};
smokeC = 0;
Instance of Symbol 459 MovieClip "extra_BG" in Frame 58 (67 B)
onClipEvent (load) {
this.gotoAndStop(_root._currentframe - 49);
}
Instance of Symbol 656 MovieClip "ground" in Frame 58 (46 B)
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 551 MovieClip "advance_HIT" in Frame 58 (46 B)
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 551 MovieClip "advance_HIT_2" in Frame 58 (46 B)
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 551 MovieClip "advance_HIT_3" in Frame 58 (46 B)
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 551 MovieClip "advance_HIT_4" in Frame 58 (46 B)
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 927 MovieClip "over" in Frame 58 (67 B)
onClipEvent (load) {
this.gotoAndStop(_root._currentframe - 49);
}
Frame 59 (286 B)
_quality = "LOW";
Mouse.show();
_x = 0;
_y = 0;
stopAllSounds();
Paused = false;
hero.removeMovieClip();
trailerBody.removeMovieClip();
game_menu.removeMovieClip();
houses.removeMovieClip();
AI.removeMovieClip();
over.removeMovieClip();
HP = 100;
timer = 3000;
play();
Frame 60 (23.21 KiB) ● ● ●
function i_rotation(i_ob, i_obr) {
var _local2 = i_ob._x - i_obr._x;
var _local1 = i_ob._y - i_obr._y;
var _local3 = Math.atan2(_local1, _local2) / i_alpha;
return(_local3);
}
function sprayParticles(x, y, d) {
smokeC++;
s = _root.attachMovie("smoke", "smoke_" + smokeC, _root.getNextHighestDepth());
s._x = x;
s._y = y;
}
function proj(v1, v2) {
dp = dot(v1, v2);
v2s = (v2.x * v2.x) + (v2.y * v2.y);
x = (dp / v2s) * v2.x;
y = (dp / v2s) * v2.y;
return({x:x, y:y});
}
function dot(p1, p2) {
return((p1.x * p2.x) + (p1.y * p2.y));
}
function updatePoint(p) {
p.x = p.x + p.vx;
p.y = p.y + p.vy;
}
function satisfyConstraint(c) {
xd = (c.p2.x + c.p2.vx) - (c.p1.x + c.p1.vx);
yd = (c.p2.y + c.p2.vy) - (c.p1.y + c.p1.vy);
dis = Math.sqrt((xd * xd) + (yd * yd));
force = ((c.len - dis) / dis) * 0.5;
dx = xd * force;
dy = yd * force;
c.p1.vx = c.p1.vx - dx;
c.p1.vy = c.p1.vy - dy;
c.p2.vx = c.p2.vx + dx;
c.p2.vy = c.p2.vy + dy;
}
function update_bg_tiles() {
i = 0;
while (i < bg_A.length) {
if (bg_A[i]._x < (game_menu._x - 600)) {
if ((!bg_A[i].positioned) == true) {
bg_A[i].last_position = bg_A[i]._x;
bg_A[i].positioned = true;
}
bg_A[i]._x = bg_A[i].last_position + 1200;
bg_A[i].positioned = false;
}
if (bg_A[i]._x > (game_menu._x + 600)) {
if ((!bg_A[i].positioned) == true) {
bg_A[i].last_position = bg_A[i]._x;
bg_A[i].positioned = true;
}
bg_A[i]._x = bg_A[i].last_position - 1200;
bg_A[i].positioned = false;
}
if (bg_A[i]._y < (game_menu._y - 500)) {
if ((!bg_A[i].positioned) == true) {
bg_A[i].last_position = bg_A[i]._y;
bg_A[i].positioned = true;
}
bg_A[i]._y = bg_A[i].last_position + 1000;
bg_A[i].positioned = false;
}
if (bg_A[i]._y > (game_menu._y + 500)) {
if ((!bg_A[i].positioned) == true) {
bg_A[i].last_position = bg_A[i]._y;
bg_A[i].positioned = true;
}
bg_A[i]._y = bg_A[i].last_position - 1000;
bg_A[i].positioned = false;
}
i++;
}
}
function ground_hit(gh) {
engineUP = 0;
if (ground.hitTest(hero._x, hero._y, true)) {
car.engineSpd = (-car.engineSpd) + 0.1;
} else if (ground.hitTest(advance_HIT._x, advance_HIT._y, true)) {
car.engineSpd = (-car.engineSpd) - 0.2;
} else if (ground.hitTest(advance_HIT_2._x, advance_HIT_2._y, true)) {
car.engineSpd = (-car.engineSpd) - 0.2;
} else if (ground.hitTest(advance_HIT_3._x, advance_HIT_3._y, true)) {
car.engineSpd = (-car.engineSpd) + 0.1;
} else if (ground.hitTest(advance_HIT_4._x, advance_HIT_4._y, true)) {
car.engineSpd = (-car.engineSpd) + 0.1;
} else if (ground.hitTest(trailerBody._x, trailerBody._y, true)) {
trace("dfgfdgfdg");
car.engineSpd = (-car.engineSpd) + 0.9;
}
if (ground_hitting == false) {
if (ground.hitTest(hero._x, hero._y, true)) {
attachMovie("explosion_mc", "explosion_mc", 500000, {_x:hero._x, _y:hero._y, _rotation:hero._rotation});
} else if (ground.hitTest(advance_HIT._x, advance_HIT._y, true)) {
attachMovie("explosion_mc", "explosion_mc", 500000, {_x:advance_HIT._x, _y:advance_HIT._y, _rotation:hero._rotation});
} else if (ground.hitTest(advance_HIT_2._x, advance_HIT_2._y, true)) {
attachMovie("explosion_mc", "explosion_mc", 500000, {_x:advance_HIT_2._x, _y:advance_HIT_2._y, _rotation:hero._rotation});
} else if (ground.hitTest(advance_HIT_3._x, advance_HIT_3._y, true)) {
attachMovie("explosion_mc", "explosion_mc", 500000, {_x:advance_HIT_3._x, _y:advance_HIT_3._y, _rotation:hero._rotation});
} else if (ground.hitTest(advance_HIT_4._x, advance_HIT_4._y, true)) {
attachMovie("explosion_mc", "explosion_mc", 500000, {_x:advance_HIT_4._x, _y:advance_HIT_4._y, _rotation:hero._rotation});
} else if (ground.hitTest(trailerBody._x, trailerBody._y, true)) {
attachMovie("explosion_mc", "explosion_mc", 500000, {_x:trailerBody._x, _y:trailerBody._y, _rotation:hero._rotation});
}
random_370_380 = random(5) + 370;
car.p1.vx = 0;
car.p1.vy = 0;
car.p2.vx = 0;
car.p2.vy = 0;
car.p3.vx = 0;
car.p3.vy = 0;
ground_hitting = true;
if (ground_hit_timer >= 30) {
attachMovie("glass_brake", "glass_brake", random_370_380, {_x:hero._x, _y:hero._y, _rotation:hero._rotation});
ground_hit_timer = 0;
}
}
}
function trailer_hit(th) {
engineUP = 0;
if (ground.hitTest(trailerBody._x, trailerBody._y, true)) {
car.engineSpd = (-car.engineSpd) + 0.9;
}
if (trailer_hitting == false) {
if (ground.hitTest(trailerBody._x, trailerBody._y, true)) {
attachMovie("explosion_mc", "explosion_mc", 500000, {_x:trailerBody._x, _y:trailerBody._y, _rotation:hero._rotation});
}
random_370_380 = random(5) + 370;
car.p1.vx = 0;
car.p1.vy = 0;
car.p2.vx = 0;
car.p2.vy = 0;
car.p3.vx = 0;
car.p3.vy = 0;
trailer_hitting = true;
if (ground_hit_timer >= 30) {
attachMovie("glass_brake", "glass_brake", random_370_380, {_x:hero._x, _y:hero._y, _rotation:hero._rotation});
ground_hit_timer = 0;
}
}
}
function AI_hit(j) {
if (!AI_reco) {
if (j == 0) {
AI.AI_speed_1 = AI.AI_speed_1 - 0.05;
AI.AI_speed_1 = -1;
}
if (j == 1) {
AI.AI_speed_2 = AI.AI_speed_2 - 0.05;
AI.AI_speed_2 = -1;
}
AI_reco = true;
}
if (AI_CARS_A[i].hitTest(advance_HIT._x, advance_HIT._y, true)) {
car.engineSpd = (-car.engineSpd) - 0.2;
} else if (AI_CARS_A[i].hitTest(advance_HIT_2._x, advance_HIT_2._y, true)) {
car.engineSpd = (-car.engineSpd) - 0.2;
} else if (AI_CARS_A[i].hitTest(advance_HIT_3._x, advance_HIT_3._y, true)) {
car.engineSpd = (-car.engineSpd) + 0.1;
} else if (AI_CARS_A[i].hitTest(advance_HIT_4._x, advance_HIT_4._y, true)) {
car.engineSpd = (-car.engineSpd) + 0.1;
} else if (AI_CARS_A[i].hitTest(hero._x, hero._y, true)) {
car.engineSpd = (-car.engineSpd) + 0.1;
} else if (AI_CARS_A[i].hitTest(trailerBory._x, trailerBody._y, true)) {
car.engineSpd = (-car.engineSpd) + 0.1;
} else if (AI_CARS_A[i].hitTest(trailerBody._x + 30, trailerBody._y + 30, true)) {
car.engineSpd = (-car.engineSpd) + 0.1;
} else if (AI_CARS_A[i].hitTest(trailerBody._x - 30, trailerBody._y - 30, true)) {
car.engineSpd = (-car.engineSpd) + 0.1;
}
if (AI_CARS_A[j].AI_hitting == false) {
if (AI_CARS_A[i].hitTest(advance_HIT._x, advance_HIT._y, true)) {
attachMovie("explosion_mc", "explosion_mc", 500000, {_x:advance_HIT._x, _y:advance_HIT._y, _rotation:hero._rotation});
attachMovie("wreck", "wreck", 999999992, {_x:hero._x, _y:hero._y});
} else if (AI_CARS_A[i].hitTest(advance_HIT_2._x, advance_HIT_2._y, true)) {
attachMovie("explosion_mc", "explosion_mc", 500000, {_x:advance_HIT_2._x, _y:advance_HIT_2._y, _rotation:hero._rotation});
attachMovie("wreck", "wreck", 999999992, {_x:hero._x, _y:hero._y});
} else if (AI_CARS_A[i].hitTest(advance_HIT_3._x, advance_HIT_3._y, true)) {
attachMovie("explosion_mc", "explosion_mc", 500000, {_x:advance_HIT_3._x, _y:advance_HIT_3._y, _rotation:hero._rotation});
attachMovie("wreck", "wreck", 999999992, {_x:hero._x, _y:hero._y});
} else if (AI_CARS_A[i].hitTest(advance_HIT_4._x, advance_HIT_4._y, true)) {
attachMovie("explosion_mc", "explosion_mc", 500000, {_x:advance_HIT_4._x, _y:advance_HIT_4._y, _rotation:hero._rotation});
attachMovie("wreck", "wreck", 999999992, {_x:hero._x, _y:hero._y});
} else if (AI_CARS_A[i].hitTest(trailerBody._x, trailerBody._y, true)) {
attachMovie("explosion_mc", "explosion_mc", 500000, {_x:trailerBody._x, _y:trailerBody._y, _rotation:hero._rotation});
attachMovie("wreck", "wreck", 999999992, {_x:hero._x, _y:hero._y});
} else if (AI_CARS_A[i].hitTest(hero._x, hero._y, true)) {
attachMovie("explosion_mc", "explosion_mc", 500000, {_x:trailerBody._x, _y:trailerBody._y, _rotation:hero._rotation});
attachMovie("wreck", "wreck", 999999992, {_x:hero._x, _y:hero._y});
}
random_370_380 = random(5) + 370;
car.p1.vx = car.p1.vx - 1;
car.p1.vy = car.p1.vy - 1;
engineSpd = 0;
engineUP = engineUP - 2;
AI_CARS_A[j].AI_hitting = true;
if (ground_hit_timer >= 30) {
attachMovie("glass_brake", "glass_brake", random_370_380, {_x:hero._x, _y:hero._y, _rotation:hero._rotation});
ground_hit_timer = 0;
}
}
}
function speed_handle(sh) {
if (Key.isDown(49) and ((!speed_1) == true)) {
keyUP = true;
game_menu.handle._alpha = 100;
if (game_menu.handle._currentframe == 10) {
game_menu.handle.gotoAndPlay(30);
} else {
game_menu.handle.play();
}
speed_1 = true;
speed_2 = false;
speed_3 = false;
car.steerCorrect = 0.8;
}
if (Key.isDown(50) and ((!speed_2) == true)) {
keyUP = true;
game_menu.handle._alpha = 100;
game_menu.handle.play();
speed_1 = false;
speed_2 = true;
speed_3 = false;
car.steerCorrect = 0.7;
}
if (Key.isDown(51) and ((!speed_3) == true)) {
keyUP = true;
game_menu.handle._alpha = 100;
if (game_menu.handle._currentframe == 30) {
game_menu.handle.gotoAndPlay(10);
} else {
game_menu.handle.play();
}
speed_1 = false;
speed_2 = false;
speed_3 = true;
car.steerCorrect = 0.6;
}
}
function matrix_update() {
var _local6 = new flash.geom.Matrix();
_local6.tx = 20;
_local6.ty = -110;
_local6.rotate(hero._rotation * (Math.PI/180));
advance_HIT._x = _local6.tx + hero._x;
advance_HIT._y = _local6.ty + hero._y;
var _local5 = new flash.geom.Matrix();
_local5.tx = -20;
_local5.ty = -110;
_local5.rotate(hero._rotation * (Math.PI/180));
advance_HIT_2._x = _local5.tx + hero._x;
advance_HIT_2._y = _local5.ty + hero._y;
var _local4 = new flash.geom.Matrix();
_local4.tx = -20;
_local4.ty = 20;
_local4.rotate(hero._rotation * (Math.PI/180));
advance_HIT_3._x = _local4.tx + hero._x;
advance_HIT_3._y = _local4.ty + hero._y;
var _local3 = new flash.geom.Matrix();
_local3.tx = 20;
_local3.ty = 20;
_local3.rotate(hero._rotation * (Math.PI/180));
advance_HIT_4._x = _local3.tx + hero._x;
advance_HIT_4._y = _local3.ty + hero._y;
var _local2 = new flash.geom.Matrix();
_local2.tx = 120;
_local2.ty = -100;
_local2.rotate(hero._rotation * (Math.PI/180));
AI_follow._x = _local2.tx + hero._x;
AI_follow._y = _local2.ty + hero._y;
var _local1 = new flash.geom.Matrix();
_local1.tx = -120;
_local1.ty = -100;
_local1.rotate(hero._rotation * (Math.PI/180));
AI_follow_2._x = _local1.tx + hero._x;
AI_follow_2._y = _local1.ty + hero._y;
}
hero._x = 5707;
hero._y = 5216;
trailerBody._x = 32100;
trailerBody._y = 10000;
_x = Math.round(300 - car.p1.x);
_y = Math.round(250 - car.p1.y);
game_menu._x = (-_x) + 300;
game_menu._y = (-_y) + 250;
hero_pos_x = hero._x;
hero_pos_y = hero._y;
bg_A = [bgs.bg_1, bgs.bg_2, bgs.bg_3, bgs.bg_4];
roadArray = [road.road_1, road.road_2];
AI_CARS_A = [AI.AI_car_1.car, AI.AI_car_2.car, AI.AI_car_3.car, AI.AI_car_4.car];
game_quality = "low";
arrow_ob = trailerBody;
s18.stop(["menu_music"]);
on_road = true;
speed_1 = true;
speed_2 = false;
speed_3 = false;
ground_hitting = false;
trailerCon = false;
bgs.bg_1.positioned = false;
bgs.bg_2.positioned = false;
bgs.bg_3.positioned = false;
bgs.bg_4.positioned = false;
hitting = false;
smoke_depth = 0;
engineUP = 0;
text_num = 12;
game_menu.handle._alpha = 0;
s7_timer = 50;
ground_hit_timer = 50;
doing_nothing_timer = 50;
HP = 95;
game_menu.HP._alpha = 0;
driftFX = 0;
timer = 3000;
game_menu.help.gotoAndStop(9);
stop();
AI.swapDepths(_root.getNextHighestDepth());
hero.swapDepths(_root.getNextHighestDepth());
trailerBody.swapDepths(_root.getNextHighestDepth());
houses.swapDepths(_root.getNextHighestDepth());
over.swapDepths(_root.getNextHighestDepth());
game_menu.swapDepths(999999999);
var car = new Object();
car.steerDir = 0;
car.steerOff = 0;
car.bodyDir = 0;
car.trailerDir = 0;
car.engineSpd = 0;
car.p1 = {x:hero_pos_x, y:hero_pos_y, vx:0, vy:0};
car.p2 = {x:hero_pos_x + 20, y:hero_pos_y + 50, vx:0, vy:0};
car.con = {p1:car.p1, p2:car.p2, len:110};
car.wheelFric = 0.97;
car.rearWheelGrip = 0.02;
car.accel = 0.2;
car.steerCorrect = 0.8;
var i_alpha = (Math.PI/180);
s3.start(1, 99999);
onEnterFrame = function () {
if ((Key.isDown(83) and (sound_ON == true)) and (!press_S)) {
_root.s1.setVolume(0);
sound_ON = false;
press_S = true;
}
if ((Key.isDown(83) and (sound_ON == false)) and (!press_S)) {
_root.s1.setVolume(100);
sound_ON = true;
press_S = true;
}
if (!Key.isDown(83)) {
press_S = false;
}
if (((Key.isDown(80) and (!p_key)) and ((!Paused) == true)) and (game_menu.Pause.can_pause == true)) {
game_menu.Pause.gotoAndPlay(2);
p_key = true;
}
if (((Key.isDown(80) and (!p_key)) and (Paused == true)) and (game_menu.Pause.can_unpause == true)) {
Paused = false;
game_menu.Pause.gotoAndPlay(21);
p_key = true;
}
if (!Key.isDown(80)) {
p_key = false;
}
if (Key.isDown(81) and (!q_key)) {
if (game_quality == "low") {
game_quality = "high";
_quality = "MEDIUM";
q_key = true;
} else if (game_quality == "high") {
game_quality = "low";
_quality = "LOW";
q_key = true;
}
} else if (!Key.isDown(81)) {
q_key = false;
}
_x = Math.round(300 - car.p1.x);
_y = Math.round(250 - car.p1.y);
game_menu._x = (-_x) + 300;
game_menu._y = (-_y) + 250;
game_mask._x = -_x;
game_mask._y = -_y;
extra_BG._x = game_menu._x;
extra_BG._y = game_menu._y;
over._x = game_menu._x;
over._y = game_menu._y;
if ((!Paused) == true) {
if ((road.border_line.hitTest(advance_HIT._x, advance_HIT._y, true) or road.border_line.hitTest(advance_HIT_2._x, advance_HIT_2._y, true)) or road.border_line.hitTest(hero._x, hero._y, true)) {
if (road.border_line._currentframe == 1) {
road.border_line.play();
engineUP = engineUP - 0.2;
}
}
if (timer <= 0) {
game_menu.game_level.gotoAndStop("lose");
Paused = true;
}
if (!trailerCon) {
timer--;
}
game_menu.radar.mini_road._x = (road._x / 50) - (_root.hero._x / 50);
game_menu.radar.mini_road._y = (road._y / 50) - (_root.hero._y / 50);
game_menu.HP._alpha--;
game_menu.HP.gotoAndStop((game_menu._currentframe = HP + 10));
if (game_menu.HP._currentframe <= 10) {
game_menu.game_level.gotoAndStop(3);
attachMovie("wreck", "wreck", 999999988, {_x:hero._x, _y:hero._y, _rotation:hero._rotation});
Paused = true;
}
matrix_update();
ground_hit_timer++;
i = 0;
while (i < roadArray.length) {
if (game_menu.hitTest(roadArray[i])) {
roadArray[i].gotoAndStop(1);
} else if (!game_menu.hitTest(roadArray[i])) {
roadArray[i].gotoAndStop(2);
}
i++;
}
s7_timer++;
if (point_num > 10) {
point_num = 0;
}
if (((hero._x <= 1003) and (hero._y >= 18982)) and trailerCon) {
text_num = 14;
game_menu.texts.play();
}
if (game_menu.help._alpha < 100) {
game_menu.help._alpha++;
}
trailerBody._rotation = 112.7;
if (game_menu.handle._alpha >= 0) {
game_menu.handle._alpha = game_menu.handle._alpha - 3;
}
trailerSnapA = dot({x:Math.cos(car.bodyDir), y:Math.sin(car.bodyDir)}, {x:Math.cos(car.trailerDir), y:Math.sin(car.trailerDir)});
if (trailerSnapA < 0) {
car.p1.vx = (-car.p1.vy) - 0.05;
car.p1.vy = (-car.p1.vy) - 0.05;
}
if (trailerBody.attach_hit.hitTest(hero._x, hero._y, true)) {
ground.trailer_HIT.gotoAndStop(2);
houses.arrow_arrive.gotoAndStop(2);
houses.arrow_arrive_2.gotoAndStop(1);
attachMovie("star_attach", "star_attach", 999999998, {_x:hero._x, _y:hero._y - 30});
car.p3 = {x:trailerBody._x, y:trailerBody._y, vx:0, vy:0};
car.con2 = {p1:car.p2, p2:car.p3, len:150};
trailerBody.attach_hit.gotoAndStop(2);
arrow_ob = road.border_line;
trailerCon = true;
game_menu.game_level.gotoAndStop(6);
}
updatePoint(car.p3);
game_menu.radar.map_arrow._rotation = i_rotation(hero, arrow_ob);
update_bg_tiles();
hero.window.gotoAndStop(Math.round((((car.bodyDir / (Math.PI/180)) + 180) / 360) * 120));
hero._x = car.p2.x;
hero._y = car.p2.y;
hero._rotation = (car.bodyDir / (Math.PI/180)) - 90;
hero.f1._rotation = (hero.f2._rotation = car.steerOff / (Math.PI/180));
trailerBody._x = car.p3.x;
trailerBody._y = car.p3.y;
trailerBody._rotation = (car.trailerDir / (Math.PI/180)) - 90;
updatePoint(car.p1);
updatePoint(car.p2);
i = 0;
while (i < 5) {
satisfyConstraint(car.con);
satisfyConstraint(car.con2);
i++;
}
car.bodyDir = Math.atan2(car.p2.y - car.p1.y, car.p2.x - car.p1.x);
car.trailerDir = Math.atan2(car.p3.y - car.p2.y, car.p3.x - car.p2.x);
car.steerDir = car.bodyDir + car.steerOff;
p1vel = Math.sqrt((car.p1.vx * car.p1.vx) + (car.p1.vy * car.p1.vy));
p2vel = Math.sqrt((car.p2.vx * car.p2.vx) + (car.p2.vy * car.p2.vy));
p3vel = Math.sqrt((car.p3.vx * car.p3.vx) + (car.p3.vy * car.p3.vy));
car.p1.vx = car.p1.vx - (car.engineSpd * Math.cos(car.steerDir));
car.p1.vy = car.p1.vy - (car.engineSpd * Math.sin(car.steerDir));
if (p2vel != 0) {
mDot = dot({x:Math.cos(car.bodyDir), y:Math.sin(car.bodyDir)}, {x:car.p2.vx / p2vel, y:car.p2.vy / p2vel});
if ((Math.abs(mDot) < 0.84) and (car.engineSpd > 0.3)) {
attachMovie("smoke", "smoke", smoke_depth, {_x:hero._x, _y:hero._y, _rotation:hero._rotation});
if (!s10_start) {
s10.start();
s10_start = true;
}
} else {
s10_start = false;
}
}
if (p3vel != 0) {
mDot = dot({x:Math.cos(car.trailerDir), y:Math.sin(car.trailerDir)}, {x:car.p3.vx / p3vel, y:car.p3.vy / p3vel});
if (Math.abs(mDot) < 0.84) {
}
}
if (p2vel != 0) {
pp = proj({x:car.p2.vx, y:car.p2.vy}, {y:-Math.cos(car.bodyDir), x:Math.sin(car.bodyDir)});
car.p2.vx = car.p2.vx * ((1 - Math.abs((pp.x / p2vel) * car.rearWheelGrip)) - driftFX);
car.p2.vy = car.p2.vy * ((1 - Math.abs((pp.y / p2vel) * car.rearWheelGrip)) - driftFX);
}
if (p3vel != 0) {
pp = proj({x:car.p3.vx, y:car.p3.vy}, {y:-Math.cos(car.trailerDir), x:Math.sin(car.trailerDir)});
car.p3.vx = car.p3.vx * (1 - Math.abs((pp.x / p3vel) * car.rearWheelGrip));
car.p3.vy = car.p3.vy * (1 - Math.abs((pp.y / p3vel) * car.rearWheelGrip));
}
car.p1.vx = car.p1.vx * car.wheelFric;
car.p1.vy = car.p1.vy * car.wheelFric;
car.p2.vx = car.p2.vx * car.wheelFric;
car.p2.vy = car.p2.vy * car.wheelFric;
car.p3.vx = car.p3.vx * car.wheelFric;
car.p3.vy = car.p3.vy * car.wheelFric;
car.engineSpd = car.engineSpd * 0.9;
if (car.engineSpd > 0) {
driftFX = 0.1;
car.steerOff = car.steerOff * car.steerCorrect;
} else {
car.steerOff = car.steerOff * (car.steerCorrect / 1.2);
}
if (road.hitTest(hero._x, hero._y, true)) {
on_road = true;
car.accel = 0.2;
car.rearWheelGrip = 0.08;
if (!engineSlowed) {
engineUP = -0.5;
engineSlowed = true;
}
} else {
engineSlowed = false;
car.engineSpd = car.engineSpd - (car.engineSpd / 2);
if (car.engineSpd == 0.5) {
car.engineSpd = 0.5;
}
on_road = false;
car.accel = 0.1;
car.rearWheelGrip = 0.02;
if ((engineSpd > 0) and (game_quality == "high")) {
attachMovie("smoke_sandy", "smoke_sandy", 21, {_x:hero._x, _y:hero._y, _rotation:hero._rotation});
}
}
if (ground.hitTest(over._x - 300, over._y - 250, true)) {
over_hit = true;
} else if (ground.hitTest(over._x + 300, over._y + 250, true)) {
over_hit = true;
} else {
over_hit = false;
}
if (ground.hitTest(advance_HIT._x, advance_HIT._y, true)) {
ground_hit(gh);
} else if (ground.hitTest(advance_HIT_2._x, advance_HIT_2._y, true)) {
ground_hit(gh);
} else if (ground.hitTest(advance_HIT_3._x, advance_HIT_3._y, true)) {
ground_hit(gh);
} else if (ground.hitTest(advance_HIT_4._x, advance_HIT_4._y, true)) {
ground_hit(gh);
} else if (ground.hitTest(hero._x, hero._y, true)) {
ground_hit(gh);
} else {
ground_hitting = false;
}
if (ground.hitTest(trailerBody._x, trailerBody._y, true) && ((!trailerCon) == false)) {
trailer_hit(th);
} else {
trailer_hitting = false;
}
i = 0;
while (i < AI_CARS_A.length) {
if (AI_CARS_A[i].hitTest(advance_HIT._x, advance_HIT._y, true)) {
AI_hit(i);
} else if (AI_CARS_A[i].hitTest(advance_HIT_2._x, advance_HIT_2._y, true)) {
AI_hit(i);
} else if (AI_CARS_A[i].hitTest(advance_HIT_3._x, advance_HIT_3._y, true)) {
AI_hit(i);
} else if (AI_CARS_A[i].hitTest(advance_HIT_4._x, advance_HIT_4._y, true)) {
AI_hit(i);
} else if (AI_CARS_A[i].hitTest(hero._x, hero._y, true)) {
AI_hit(i);
} else if (AI_CARS_A[i].hitTest(trailerBody._x + 30, trailerBody._y + 30, true)) {
AI_hit(i);
} else if (AI_CARS_A[i].hitTest(trailerBody._x + 30, trailerBody._y + 30, true)) {
AI_hit(i);
} else {
AI_CARS_A[i].AI_hitting = false;
AI_reco = false;
}
i++;
}
if (smoke_depth >= 20) {
smoke_depth = 0;
} else {
smoke_depth++;
}
if (engineUP >= 0.5) {
engineUP = 0.5;
} else if (engineUP <= 0) {
engineUP = 0;
}
if (Key.isDown(38)) {
doing_nothing_timer = 50;
s6_start = false;
s6.stop(["truck_idle"]);
if (keyUP) {
if ((!s7_start) and (s7_timer >= 50)) {
s7.start();
s7_timer = 0;
s7_start = true;
}
if (speed_1) {
s4.start(6, 99999);
s5.stop(["truck_drive_faster"]);
s8.stop(["truck_drive_fastest"]);
}
if (speed_2) {
s5.start(5, 99999);
s4.stop(["truck_drive"]);
s8.stop(["truck_drive_fastest"]);
}
if (speed_3) {
s8.start(4, 99999);
s4.stop(["truck_drive"]);
s5.stop(["truck_drive_faster"]);
}
keyUP = false;
}
car.engineSpd = car.engineSpd + engineUP;
engineUP = engineUP + 0.003;
} else {
if ((car.engineSpd <= 0.001) and (!Key.isDown(40))) {
car.engineSpd = 0;
}
engineUP = engineUP - 0.004;
doing_nothing_timer = doing_nothing_timer - 0.5;
if (doing_nothing_timer <= 0) {
s6.stop(["truck_idle"]);
}
s7_start = false;
s4.stop(["truck_drive"]);
s5.stop(["truck_drive_faster"]);
s7.stop(["truck_start"]);
s8.stop(["truck_drive_fastest"]);
if (!s6_start) {
s6.start(1, 99999);
s6_start = true;
}
keyUP = true;
}
if (Key.isDown(40)) {
doing_nothing_timer = 50;
if ((ground_hitting == true) or (AI_CARS_A[i].AI_hitting == true)) {
car.engineSpd = car.engineSpd - 0.09;
} else {
car.engineSpd = car.engineSpd - 0.05;
}
}
speed_handle(sh);
if (speed_1 and on_road) {
if (car.engineSpd > 0.8) {
car.engineSpd = car.engineSpd - 0.35;
}
}
if (speed_2 and on_road) {
if (car.engineSpd > 2) {
car.engineSpd = car.engineSpd - 0.2;
}
}
if (((car.engineSpd > 4) and speed_3) and on_road) {
car.engineSpd = 4;
}
if (Key.isDown(37)) {
if (on_road == true) {
car.steerOff = car.steerOff - 0.1;
} else {
car.steerOff = car.steerOff - 0.1;
}
} else if (Key.isDown(39)) {
if (on_road == true) {
car.steerOff = car.steerOff + 0.1;
} else {
car.steerOff = car.steerOff + 0.1;
}
}
if (Key.isDown(32)) {
if (car.engineSpd > 0) {
car.engineSpd = car.engineSpd - 0.3;
}
}
wheelBack1o = wheelBack1;
wheelBack2o = wheelBack2;
wheelBack3o = wheelBack3;
wheelBack4o = wheelBack4;
wheelBack5o = wheelBack5;
wheelBack6o = wheelBack6;
}
};
smokeC = 0;
Instance of Symbol 459 MovieClip "extra_BG" in Frame 60 (67 B)
onClipEvent (load) {
this.gotoAndStop(_root._currentframe - 49);
}
Instance of Symbol 685 MovieClip "ground" in Frame 60 (46 B)
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 551 MovieClip "advance_HIT" in Frame 60 (46 B)
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 551 MovieClip "advance_HIT_2" in Frame 60 (46 B)
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 551 MovieClip "advance_HIT_3" in Frame 60 (46 B)
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 551 MovieClip "advance_HIT_4" in Frame 60 (46 B)
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 551 MovieClip "AI_follow" in Frame 60 (46 B)
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 551 MovieClip "AI_follow_2" in Frame 60 (46 B)
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 927 MovieClip "over" in Frame 60 (67 B)
onClipEvent (load) {
this.gotoAndStop(_root._currentframe - 49);
}
Frame 61 (299 B)
_x = 0;
_y = 0;
stopAllSounds();
Paused = false;
hero.removeMovieClip();
trailerBody.removeMovieClip();
game_menu.removeMovieClip();
houses.removeMovieClip();
AI.removeMovieClip();
over.removeMovieClip();
johnny.removeMovieClip();
HP = 100;
jumped = false;
can_jump = false;
play();
Frame 62 (22.69 KiB) ● ● ●
function i_rotation(i_ob, i_obr) {
var _local2 = i_ob._x - i_obr._x;
var _local1 = i_ob._y - i_obr._y;
var _local3 = Math.atan2(_local1, _local2) / i_alpha;
return(_local3);
}
function sprayParticles(x, y, d) {
smokeC++;
s = _root.attachMovie("smoke", "smoke_" + smokeC, _root.getNextHighestDepth());
s._x = x;
s._y = y;
}
function proj(v1, v2) {
dp = dot(v1, v2);
v2s = (v2.x * v2.x) + (v2.y * v2.y);
x = (dp / v2s) * v2.x;
y = (dp / v2s) * v2.y;
return({x:x, y:y});
}
function dot(p1, p2) {
return((p1.x * p2.x) + (p1.y * p2.y));
}
function updatePoint(p) {
p.x = p.x + p.vx;
p.y = p.y + p.vy;
}
function satisfyConstraint(c) {
xd = (c.p2.x + c.p2.vx) - (c.p1.x + c.p1.vx);
yd = (c.p2.y + c.p2.vy) - (c.p1.y + c.p1.vy);
dis = Math.sqrt((xd * xd) + (yd * yd));
force = ((c.len - dis) / dis) * 0.5;
dx = xd * force;
dy = yd * force;
c.p1.vx = c.p1.vx - dx;
c.p1.vy = c.p1.vy - dy;
c.p2.vx = c.p2.vx + dx;
c.p2.vy = c.p2.vy + dy;
}
function update_bg_tiles() {
i = 0;
while (i < bg_A.length) {
if (bg_A[i]._x < (game_menu._x - 600)) {
if ((!bg_A[i].positioned) == true) {
bg_A[i].last_position = bg_A[i]._x;
bg_A[i].positioned = true;
}
bg_A[i]._x = bg_A[i].last_position + 1200;
bg_A[i].positioned = false;
}
if (bg_A[i]._x > (game_menu._x + 600)) {
if ((!bg_A[i].positioned) == true) {
bg_A[i].last_position = bg_A[i]._x;
bg_A[i].positioned = true;
}
bg_A[i]._x = bg_A[i].last_position - 1200;
bg_A[i].positioned = false;
}
if (bg_A[i]._y < (game_menu._y - 500)) {
if ((!bg_A[i].positioned) == true) {
bg_A[i].last_position = bg_A[i]._y;
bg_A[i].positioned = true;
}
bg_A[i]._y = bg_A[i].last_position + 1000;
bg_A[i].positioned = false;
}
if (bg_A[i]._y > (game_menu._y + 500)) {
if ((!bg_A[i].positioned) == true) {
bg_A[i].last_position = bg_A[i]._y;
bg_A[i].positioned = true;
}
bg_A[i]._y = bg_A[i].last_position - 1000;
bg_A[i].positioned = false;
}
i++;
}
}
function ground_hit(gh) {
engineUP = 0;
if (ground.hitTest(hero._x, hero._y, true)) {
car.engineSpd = (-car.engineSpd) + 0.1;
} else if (ground.hitTest(advance_HIT._x, advance_HIT._y, true)) {
car.engineSpd = (-car.engineSpd) - 0.2;
} else if (ground.hitTest(advance_HIT_2._x, advance_HIT_2._y, true)) {
car.engineSpd = (-car.engineSpd) - 0.2;
} else if (ground.hitTest(advance_HIT_3._x, advance_HIT_3._y, true)) {
car.engineSpd = (-car.engineSpd) + 0.1;
} else if (ground.hitTest(advance_HIT_4._x, advance_HIT_4._y, true)) {
car.engineSpd = (-car.engineSpd) + 0.1;
} else if (ground.hitTest(trailerBody._x, trailerBody._y, true)) {
trace("dfgfdgfdg");
car.engineSpd = (-car.engineSpd) + 0.9;
}
if (ground_hitting == false) {
if (ground.hitTest(hero._x, hero._y, true)) {
attachMovie("explosion_mc", "explosion_mc", 500000, {_x:hero._x, _y:hero._y, _rotation:hero._rotation});
} else if (ground.hitTest(advance_HIT._x, advance_HIT._y, true)) {
attachMovie("explosion_mc", "explosion_mc", 500000, {_x:advance_HIT._x, _y:advance_HIT._y, _rotation:hero._rotation});
} else if (ground.hitTest(advance_HIT_2._x, advance_HIT_2._y, true)) {
attachMovie("explosion_mc", "explosion_mc", 500000, {_x:advance_HIT_2._x, _y:advance_HIT_2._y, _rotation:hero._rotation});
} else if (ground.hitTest(advance_HIT_3._x, advance_HIT_3._y, true)) {
attachMovie("explosion_mc", "explosion_mc", 500000, {_x:advance_HIT_3._x, _y:advance_HIT_3._y, _rotation:hero._rotation});
} else if (ground.hitTest(advance_HIT_4._x, advance_HIT_4._y, true)) {
attachMovie("explosion_mc", "explosion_mc", 500000, {_x:advance_HIT_4._x, _y:advance_HIT_4._y, _rotation:hero._rotation});
} else if (ground.hitTest(trailerBody._x, trailerBody._y, true)) {
attachMovie("explosion_mc", "explosion_mc", 500000, {_x:trailerBody._x, _y:trailerBody._y, _rotation:hero._rotation});
}
random_370_380 = random(5) + 370;
car.p1.vx = 0;
car.p1.vy = 0;
car.p2.vx = 0;
car.p2.vy = 0;
car.p3.vx = 0;
car.p3.vy = 0;
ground_hitting = true;
if (ground_hit_timer >= 30) {
attachMovie("glass_brake", "glass_brake", random_370_380, {_x:hero._x, _y:hero._y, _rotation:hero._rotation});
ground_hit_timer = 0;
}
}
}
function trailer_hit(th) {
engineUP = 0;
if (ground.hitTest(trailerBody._x, trailerBody._y, true)) {
car.engineSpd = (-car.engineSpd) + 0.9;
}
if (trailer_hitting == false) {
if (ground.hitTest(trailerBody._x, trailerBody._y, true)) {
attachMovie("explosion_mc", "explosion_mc", 500000, {_x:trailerBody._x, _y:trailerBody._y, _rotation:hero._rotation});
}
random_370_380 = random(5) + 370;
car.p1.vx = 0;
car.p1.vy = 0;
car.p2.vx = 0;
car.p2.vy = 0;
car.p3.vx = 0;
car.p3.vy = 0;
trailer_hitting = true;
if (ground_hit_timer >= 30) {
attachMovie("glass_brake", "glass_brake", random_370_380, {_x:hero._x, _y:hero._y, _rotation:hero._rotation});
ground_hit_timer = 0;
}
}
}
function AI_hit(j) {
engineUP = 0;
if (AI_CARS_A[i].hitTest(advance_HIT._x, advance_HIT._y, true)) {
car.engineSpd = (-car.engineSpd) - 0.2;
} else if (AI_CARS_A[i].hitTest(advance_HIT_2._x, advance_HIT_2._y, true)) {
car.engineSpd = (-car.engineSpd) - 0.2;
} else if (AI_CARS_A[i].hitTest(advance_HIT_3._x, advance_HIT_3._y, true)) {
car.engineSpd = (-car.engineSpd) + 0.1;
} else if (AI_CARS_A[i].hitTest(advance_HIT_4._x, advance_HIT_4._y, true)) {
car.engineSpd = (-car.engineSpd) + 0.1;
} else if (AI_CARS_A[i].hitTest(trailerBory._x, trailerBody._y, true)) {
car.engineSpd = (-car.engineSpd) + 0.1;
} else if (AI_CARS_A[i].hitTest(trailerBody._x + 30, trailerBody._y + 30, true)) {
car.engineSpd = (-car.engineSpd) + 0.1;
} else if (AI_CARS_A[i].hitTest(trailerBody._x - 30, trailerBody._y - 30, true)) {
car.engineSpd = (-car.engineSpd) + 0.1;
}
if (AI_CARS_A[j].AI_hitting == false) {
if (AI_CARS_A[i].hitTest(advance_HIT._x, advance_HIT._y, true)) {
attachMovie("explosion_mc", "explosion_mc", 500000, {_x:advance_HIT._x, _y:advance_HIT._y, _rotation:hero._rotation});
} else if (AI_CARS_A[i].hitTest(advance_HIT_2._x, advance_HIT_2._y, true)) {
attachMovie("explosion_mc", "explosion_mc", 500000, {_x:advance_HIT_2._x, _y:advance_HIT_2._y, _rotation:hero._rotation});
} else if (AI_CARS_A[i].hitTest(advance_HIT_3._x, advance_HIT_3._y, true)) {
attachMovie("explosion_mc", "explosion_mc", 500000, {_x:advance_HIT_3._x, _y:advance_HIT_3._y, _rotation:hero._rotation});
} else if (AI_CARS_A[i].hitTest(advance_HIT_4._x, advance_HIT_4._y, true)) {
attachMovie("explosion_mc", "explosion_mc", 500000, {_x:advance_HIT_4._x, _y:advance_HIT_4._y, _rotation:hero._rotation});
} else if (AI_CARS_A[i].hitTest(trailerBody._x, trailerBody._y, true)) {
attachMovie("explosion_mc", "explosion_mc", 500000, {_x:trailerBody._x, _y:trailerBody._y, _rotation:hero._rotation});
}
random_370_380 = random(5) + 370;
car.p1.vx = 0;
car.p1.vy = 0;
car.p2.vx = 0;
car.p2.vy = 0;
car.p3.vx = 0;
car.p3.vy = 0;
AI.AI_speed = 0;
AI_CARS_A[j].AI_hitting = true;
if (ground_hit_timer >= 30) {
attachMovie("glass_brake", "glass_brake", random_370_380, {_x:hero._x, _y:hero._y, _rotation:hero._rotation});
ground_hit_timer = 0;
}
}
}
function speed_handle(sh) {
if (!jumped) {
if (Key.isDown(49) and ((!speed_1) == true)) {
keyUP = true;
game_menu.handle._alpha = 100;
if (game_menu.handle._currentframe == 10) {
game_menu.handle.gotoAndPlay(30);
} else {
game_menu.handle.play();
}
speed_1 = true;
speed_2 = false;
speed_3 = false;
car.steerCorrect = 0.8;
}
if (Key.isDown(50) and ((!speed_2) == true)) {
keyUP = true;
game_menu.handle._alpha = 100;
game_menu.handle.play();
speed_1 = false;
speed_2 = true;
speed_3 = false;
car.steerCorrect = 0.7;
}
if (Key.isDown(51) and ((!speed_3) == true)) {
keyUP = true;
game_menu.handle._alpha = 100;
if (game_menu.handle._currentframe == 30) {
game_menu.handle.gotoAndPlay(10);
} else {
game_menu.handle.play();
}
speed_1 = false;
speed_2 = false;
speed_3 = true;
car.steerCorrect = 0.6;
}
}
}
function matrix_update() {
var _local4 = new flash.geom.Matrix();
_local4.tx = 20;
_local4.ty = -110;
_local4.rotate(hero._rotation * (Math.PI/180));
advance_HIT._x = _local4.tx + hero._x;
advance_HIT._y = _local4.ty + hero._y;
var _local3 = new flash.geom.Matrix();
_local3.tx = -20;
_local3.ty = -110;
_local3.rotate(hero._rotation * (Math.PI/180));
advance_HIT_2._x = _local3.tx + hero._x;
advance_HIT_2._y = _local3.ty + hero._y;
var _local2 = new flash.geom.Matrix();
_local2.tx = -20;
_local2.ty = 20;
_local2.rotate(hero._rotation * (Math.PI/180));
advance_HIT_3._x = _local2.tx + hero._x;
advance_HIT_3._y = _local2.ty + hero._y;
var _local1 = new flash.geom.Matrix();
_local1.tx = 20;
_local1.ty = 20;
_local1.rotate(hero._rotation * (Math.PI/180));
advance_HIT_4._x = _local1.tx + hero._x;
advance_HIT_4._y = _local1.ty + hero._y;
}
hero._x = -750;
hero._y = 680;
trailerBody._x = 1330;
trailerBody._y = 1278;
_x = Math.round(300 - car.p1.x);
_y = Math.round(250 - car.p1.y);
game_menu._x = (-_x) + 300;
game_menu._y = (-_y) + 250;
hero_pos_x = hero._x;
hero_pos_y = hero._y;
bg_A = [bgs.bg_1, bgs.bg_2, bgs.bg_3, bgs.bg_4];
roadArray = [road.road_1, road.road_2];
AI_CARS_A = [AI.AI_car_1.car, AI.AI_car_2.car, AI.AI_car_3.car, AI.AI_car_4.car];
game_quality = "low";
arrow_ob = houses.shine;
s18.stop(["menu_music"]);
on_road = true;
speed_1 = true;
speed_2 = false;
speed_3 = false;
ground_hitting = false;
trailerCon = false;
bgs.bg_1.positioned = false;
bgs.bg_2.positioned = false;
bgs.bg_3.positioned = false;
bgs.bg_4.positioned = false;
tutorial = false;
hitting = false;
can_jump = false;
jumped = false;
winner = false;
smoke_depth = 0;
engineUP = 0;
text_num = 15;
game_menu.handle._alpha = 0;
s7_timer = 50;
ground_hit_timer = 50;
doing_nothing_timer = 50;
HP = 95;
game_menu.HP._alpha = 0;
driftFX = 0;
game_menu.help.gotoAndStop(9);
jump_timer = 75;
fail_timer = 150;
win_timer = 100;
stop();
AI.swapDepths(_root.getNextHighestDepth());
hero.swapDepths(_root.getNextHighestDepth());
trailerBody.swapDepths(_root.getNextHighestDepth());
houses.swapDepths(_root.getNextHighestDepth());
over.swapDepths(_root.getNextHighestDepth());
game_menu.swapDepths(999999999);
var car = new Object();
car.steerDir = 0;
car.steerOff = 0;
car.bodyDir = 0;
car.trailerDir = 0;
car.engineSpd = 0;
car.p1 = {x:hero_pos_x, y:hero_pos_y, vx:0, vy:0};
car.p2 = {x:hero_pos_x - 110, y:hero_pos_y + 20, vx:0, vy:0};
car.con = {p1:car.p1, p2:car.p2, len:110};
car.wheelFric = 0.97;
car.rearWheelGrip = 0.02;
car.accel = 0.2;
car.steerCorrect = 0.8;
var i_alpha = (Math.PI/180);
s3.start(1, 99999);
onEnterFrame = function () {
if ((Key.isDown(83) and (sound_ON == true)) and (!press_S)) {
_root.s1.setVolume(0);
sound_ON = false;
press_S = true;
}
if ((Key.isDown(83) and (sound_ON == false)) and (!press_S)) {
_root.s1.setVolume(100);
sound_ON = true;
press_S = true;
}
if (!Key.isDown(83)) {
press_S = false;
}
if (((Key.isDown(80) and (!p_key)) and ((!Paused) == true)) and (game_menu.Pause.can_pause == true)) {
game_menu.Pause.gotoAndPlay(2);
p_key = true;
}
if (((Key.isDown(80) and (!p_key)) and (Paused == true)) and (game_menu.Pause.can_unpause == true)) {
Paused = false;
game_menu.Pause.gotoAndPlay(21);
p_key = true;
}
if (!Key.isDown(80)) {
p_key = false;
}
if (Key.isDown(81) and (!q_key)) {
if (game_quality == "low") {
game_quality = "high";
_quality = "MEDIUM";
q_key = true;
} else if (game_quality == "high") {
game_quality = "low";
_quality = "LOW";
q_key = true;
}
} else if (!Key.isDown(81)) {
q_key = false;
}
_x = Math.round(300 - car.p1.x);
_y = Math.round(250 - car.p1.y);
game_menu._x = (-_x) + 300;
game_menu._y = (-_y) + 250;
game_mask._x = -_x;
game_mask._y = -_y;
extra_BG._x = game_menu._x;
extra_BG._y = game_menu._y;
over._x = game_menu._x;
over._y = game_menu._y;
cliff._x = game_menu._x;
cliff._y = game_menu._y;
if ((!Paused) == true) {
if ((road.border_line.hitTest(advance_HIT._x, advance_HIT._y, true) or road.border_line.hitTest(advance_HIT_2._x, advance_HIT_2._y, true)) or road.border_line.hitTest(hero._x, hero._y, true)) {
if (road.border_line._currentframe == 1) {
road.border_line.play();
engineUP = engineUP - 0.2;
}
}
if (!jumped) {
jump_timer--;
if ((Key.isDown(32) and (jump_timer <= 0)) and (!(hero._currentframe === 3))) {
attachMovie("johnny", "johnny", 777777777, {_x:hero._x, _y:hero._y, _rotation:hero._rotation});
}
} else if (jumped and (!winner)) {
fail_timer--;
if (fail_timer <= 0) {
game_menu.game_level.gotoAndStop("lose");
Paused = true;
}
}
if (winner) {
win_timer--;
if (win_timer <= 0) {
game_menu.game_level.gotoAndStop(2);
}
}
if ((((hero._currentframe == 3) and jumped) and (hero._x >= 17700)) and (!winner)) {
winner = true;
} else if (((hero._currentframe == 3) and (!jumped)) and ((!winner) == true)) {
game_menu.game_level.gotoAndStop("lose");
Paused = true;
}
if (hero._x >= 17700) {
if (hero._x <= 18000) {
car.p1.vx = car.p1.vx + 2;
}
}
if (hero._x >= 17000) {
cliff.gotoAndStop(1);
if (!road.hitTest(hero._x, hero._y, true)) {
hero.gotoAndStop(3);
}
} else {
cliff.gotoAndStop(2);
}
if (hero._x >= 15000) {
can_jump = true;
game_menu.help.gotoAndStop(15);
}
game_menu.radar.mini_road._x = (road._x / 50) - (_root.hero._x / 50);
game_menu.radar.mini_road._y = (road._y / 50) - (_root.hero._y / 50);
game_menu.HP._alpha--;
game_menu.HP.gotoAndStop((game_menu._currentframe = HP + 10));
if (game_menu.HP._currentframe <= 10) {
game_menu.game_level.gotoAndStop(3);
attachMovie("wreck", "wreck", 999999988, {_x:hero._x, _y:hero._y, _rotation:hero._rotation});
Paused = true;
}
matrix_update();
ground_hit_timer++;
i = 0;
while (i < roadArray.length) {
if (game_menu.hitTest(roadArray[i])) {
roadArray[i].gotoAndStop(1);
} else if (!game_menu.hitTest(roadArray[i])) {
roadArray[i].gotoAndStop(2);
}
i++;
}
s7_timer++;
if (point_num > 10) {
point_num = 0;
}
if ((houses.park_place.hitTest(hero._x, hero._y, true) and (car.engineSpd <= 0)) and (trailerCon == true)) {
game_menu.texts.play();
}
if (game_menu.help._alpha < 100) {
game_menu.help._alpha++;
}
trailerBody._rotation = 112.7;
if (game_menu.handle._alpha >= 0) {
game_menu.handle._alpha = game_menu.handle._alpha - 3;
}
trailerSnapA = dot({x:Math.cos(car.bodyDir), y:Math.sin(car.bodyDir)}, {x:Math.cos(car.trailerDir), y:Math.sin(car.trailerDir)});
if (trailerSnapA < 0) {
car.p1.vx = (-car.p1.vy) - 0.05;
car.p1.vy = (-car.p1.vy) - 0.05;
}
if (trailerBody.attach_hit.hitTest(hero._x, hero._y, true)) {
ground.trailer_HIT.gotoAndStop(2);
houses.arrow_arrive.gotoAndStop(2);
houses.arrow_arrive_2.gotoAndStop(1);
attachMovie("star_attach", "star_attach", 999999998, {_x:hero._x, _y:hero._y - 30});
car.p3 = {x:trailerBody._x, y:trailerBody._y, vx:0, vy:0};
car.con2 = {p1:car.p2, p2:car.p3, len:150};
trailerBody.attach_hit.gotoAndStop(2);
arrow_ob = houses.park_place;
trailerCon = true;
}
updatePoint(car.p3);
game_menu.radar.map_arrow._rotation = i_rotation(hero, arrow_ob);
update_bg_tiles();
hero.window.gotoAndStop(Math.round((((car.bodyDir / (Math.PI/180)) + 180) / 360) * 120));
hero._x = car.p2.x;
hero._y = car.p2.y;
hero._rotation = (car.bodyDir / (Math.PI/180)) - 90;
hero.f1._rotation = (hero.f2._rotation = car.steerOff / (Math.PI/180));
trailerBody._x = car.p3.x;
trailerBody._y = car.p3.y;
trailerBody._rotation = (car.trailerDir / (Math.PI/180)) - 90;
updatePoint(car.p1);
updatePoint(car.p2);
i = 0;
while (i < 5) {
satisfyConstraint(car.con);
satisfyConstraint(car.con2);
i++;
}
car.bodyDir = Math.atan2(car.p2.y - car.p1.y, car.p2.x - car.p1.x);
car.trailerDir = Math.atan2(car.p3.y - car.p2.y, car.p3.x - car.p2.x);
car.steerDir = car.bodyDir + car.steerOff;
p1vel = Math.sqrt((car.p1.vx * car.p1.vx) + (car.p1.vy * car.p1.vy));
p2vel = Math.sqrt((car.p2.vx * car.p2.vx) + (car.p2.vy * car.p2.vy));
p3vel = Math.sqrt((car.p3.vx * car.p3.vx) + (car.p3.vy * car.p3.vy));
car.p1.vx = car.p1.vx - (car.engineSpd * Math.cos(car.steerDir));
car.p1.vy = car.p1.vy - (car.engineSpd * Math.sin(car.steerDir));
if (p2vel != 0) {
mDot = dot({x:Math.cos(car.bodyDir), y:Math.sin(car.bodyDir)}, {x:car.p2.vx / p2vel, y:car.p2.vy / p2vel});
if ((Math.abs(mDot) < 0.84) and (car.engineSpd > 0.3)) {
attachMovie("smoke", "smoke", smoke_depth, {_x:hero._x, _y:hero._y, _rotation:hero._rotation});
if (!s10_start) {
s10.start();
s10_start = true;
}
} else {
s10_start = false;
}
}
if (p3vel != 0) {
mDot = dot({x:Math.cos(car.trailerDir), y:Math.sin(car.trailerDir)}, {x:car.p3.vx / p3vel, y:car.p3.vy / p3vel});
if (Math.abs(mDot) < 0.84) {
}
}
if (p2vel != 0) {
pp = proj({x:car.p2.vx, y:car.p2.vy}, {y:-Math.cos(car.bodyDir), x:Math.sin(car.bodyDir)});
car.p2.vx = car.p2.vx * ((1 - Math.abs((pp.x / p2vel) * car.rearWheelGrip)) - driftFX);
car.p2.vy = car.p2.vy * ((1 - Math.abs((pp.y / p2vel) * car.rearWheelGrip)) - driftFX);
}
if (p3vel != 0) {
pp = proj({x:car.p3.vx, y:car.p3.vy}, {y:-Math.cos(car.trailerDir), x:Math.sin(car.trailerDir)});
car.p3.vx = car.p3.vx * (1 - Math.abs((pp.x / p3vel) * car.rearWheelGrip));
car.p3.vy = car.p3.vy * (1 - Math.abs((pp.y / p3vel) * car.rearWheelGrip));
}
car.p1.vx = car.p1.vx * car.wheelFric;
car.p1.vy = car.p1.vy * car.wheelFric;
car.p2.vx = car.p2.vx * car.wheelFric;
car.p2.vy = car.p2.vy * car.wheelFric;
car.p3.vx = car.p3.vx * car.wheelFric;
car.p3.vy = car.p3.vy * car.wheelFric;
car.engineSpd = car.engineSpd * 0.9;
if (car.engineSpd > 0) {
driftFX = 0.1;
car.steerOff = car.steerOff * car.steerCorrect;
} else {
car.steerOff = car.steerOff * (car.steerCorrect / 1.2);
}
if (road.hitTest(hero._x, hero._y, true)) {
on_road = true;
car.accel = 0.2;
car.rearWheelGrip = 0.08;
if (!engineSlowed) {
engineUP = -0.5;
engineSlowed = true;
}
} else {
engineSlowed = false;
car.engineSpd = car.engineSpd - (car.engineSpd / 2);
if (car.engineSpd == 0.5) {
car.engineSpd = 0.5;
}
on_road = false;
car.accel = 0.1;
car.rearWheelGrip = 0.02;
if ((engineSpd > 0) and (game_quality == "high")) {
attachMovie("smoke_sandy", "smoke_sandy", 21, {_x:hero._x, _y:hero._y, _rotation:hero._rotation});
}
}
if (hitting) {
if (ground.hitTest(advance_HIT._x, advance_HIT._y, true)) {
ground_hit(gh);
} else if (ground.hitTest(advance_HIT_2._x, advance_HIT_2._y, true)) {
ground_hit(gh);
} else if (ground.hitTest(advance_HIT_3._x, advance_HIT_3._y, true)) {
ground_hit(gh);
} else if (ground.hitTest(advance_HIT_4._x, advance_HIT_4._y, true)) {
ground_hit(gh);
} else if (ground.hitTest(hero._x, hero._y, true)) {
ground_hit(gh);
} else {
ground_hitting = false;
}
}
if (ground.hitTest(trailerBody._x, trailerBody._y, true) && ((!trailerCon) == false)) {
trailer_hit(th);
} else {
trailer_hitting = false;
}
i = 0;
while (i < AI_CARS_A.length) {
if (AI_CARS_A[i].hitTest(advance_HIT._x, advance_HIT._y, true)) {
AI_hit(i);
} else if (AI_CARS_A[i].hitTest(advance_HIT_2._x, advance_HIT_2._y, true)) {
AI_hit(i);
} else if (AI_CARS_A[i].hitTest(advance_HIT_3._x, advance_HIT_3._y, true)) {
AI_hit(i);
} else if (AI_CARS_A[i].hitTest(advance_HIT_4._x, advance_HIT_4._y, true)) {
AI_hit(i);
} else {
AI_CARS_A[i].AI_hitting = false;
}
i++;
}
if (smoke_depth >= 20) {
smoke_depth = 0;
} else {
smoke_depth++;
}
if (engineUP >= 0.5) {
engineUP = 0.5;
} else if (engineUP <= 0) {
engineUP = 0;
}
if ((Key.isDown(38) and (!jumped)) or (can_jump and jumped)) {
doing_nothing_timer = 50;
s6_start = false;
s6.stop(["truck_idle"]);
if (keyUP) {
if ((!s7_start) and (s7_timer >= 50)) {
s7.start();
s7_timer = 0;
s7_start = true;
}
if (speed_1) {
s4.start(6, 99999);
s5.stop(["truck_drive_faster"]);
s8.stop(["truck_drive_fastest"]);
}
if (speed_2) {
s5.start(5, 99999);
s4.stop(["truck_drive"]);
s8.stop(["truck_drive_fastest"]);
}
if (speed_3) {
s8.start(4, 99999);
s4.stop(["truck_drive"]);
s5.stop(["truck_drive_faster"]);
}
keyUP = false;
}
car.engineSpd = car.engineSpd + engineUP;
engineUP = engineUP + 0.003;
} else {
if (!jumped) {
if ((car.engineSpd <= 0.001) and (!Key.isDown(40))) {
car.engineSpd = 0;
}
engineUP = engineUP - 0.004;
doing_nothing_timer = doing_nothing_timer - 0.5;
if (doing_nothing_timer <= 0) {
s6.stop(["truck_idle"]);
}
s7_start = false;
s4.stop(["truck_drive"]);
s5.stop(["truck_drive_faster"]);
s7.stop(["truck_start"]);
s8.stop(["truck_drive_fastest"]);
if (!s6_start) {
s6.start(1, 99999);
s6_start = true;
}
keyUP = true;
}
if (Key.isDown(40) and (!jumped)) {
doing_nothing_timer = 50;
if ((ground_hitting == true) or (AI_CARS_A[i].AI_hitting == true)) {
car.engineSpd = car.engineSpd - 0.09;
} else {
car.engineSpd = car.engineSpd - 0.05;
}
}
}
speed_handle(sh);
if (!jumped) {
if (speed_1 and on_road) {
if (car.engineSpd > 0.8) {
car.engineSpd = car.engineSpd - 0.35;
}
}
if (speed_2 and on_road) {
if (car.engineSpd > 2) {
car.engineSpd = car.engineSpd - 0.2;
}
}
if (((car.engineSpd > 4) and speed_3) and on_road) {
car.engineSpd = 4;
}
}
if (Key.isDown(37) and (!jumped)) {
if (on_road == true) {
car.steerOff = car.steerOff - 0.1;
} else {
car.steerOff = car.steerOff - 0.1;
}
} else if (Key.isDown(39) and (!jumped)) {
if (on_road == true) {
car.steerOff = car.steerOff + 0.1;
} else {
car.steerOff = car.steerOff + 0.1;
}
}
wheelBack1o = wheelBack1;
wheelBack2o = wheelBack2;
wheelBack3o = wheelBack3;
wheelBack4o = wheelBack4;
wheelBack5o = wheelBack5;
wheelBack6o = wheelBack6;
}
};
smokeC = 0;
Instance of Symbol 459 MovieClip "extra_BG" in Frame 62 (67 B)
onClipEvent (load) {
this.gotoAndStop(_root._currentframe - 49);
}
Instance of Symbol 947 MovieClip "cliff" in Frame 62 (22 B)
onClipEvent (load) {
}
Instance of Symbol 707 MovieClip "ground" in Frame 62 (46 B)
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 551 MovieClip "advance_HIT" in Frame 62 (46 B)
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 551 MovieClip "advance_HIT_2" in Frame 62 (46 B)
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 551 MovieClip "advance_HIT_3" in Frame 62 (46 B)
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 551 MovieClip "advance_HIT_4" in Frame 62 (46 B)
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 704 MovieClip "houses" in Frame 62 (22 B)
onClipEvent (load) {
}
Instance of Symbol 927 MovieClip "over" in Frame 62 (67 B)
onClipEvent (load) {
this.gotoAndStop(_root._currentframe - 49);
}
Frame 63 (292 B)
_x = 0;
_y = 0;
stopAllSounds();
Paused = true;
hero.removeMovieClip();
trailerBody.removeMovieClip();
game_menu.removeMovieClip();
houses.removeMovieClip();
AI.removeMovieClip();
over.removeMovieClip();
darker.removeMovieClip();
end_scene.removeMovieClip();
HP = 100;
play();
Frame 64 (648 B)
stop();
volumeBegin = 0;
sound_ON = true;
_quality = "LOW";
Mouse.show();
Paused = true;
end_scene._x = (-_x) + 300;
end_scene._y = (-_y) + 250;
if (score <= 0) {
score = 0;
}
stopAllSounds();
Paused = true;
hero.removeMovieClip();
trailerBody.removeMovieClip();
game_menu.removeMovieClip();
houses.removeMovieClip();
AI.removeMovieClip();
over.removeMovieClip();
darker.removeMovieClip();
end_scene.removeMovieClip();
_root.s1.setVolume(volumeBegin);
_root.s18.start(1, 9999);
onEnterFrame = function () {
volumeBegin++;
_root.s1.setVolume(volumeBegin);
if (volumeBegin >= 100) {
volumeBegin = 100;
}
};
Symbol 2 MovieClip [fog_1] Frame 1 (8 B)
stop();
Symbol 998 MovieClip [__Packages.FogAdsAS2] Frame 0 (3.69 KiB) ●
class FogAdsAS2 extends MovieClip
{
var options, clip, urlInfo, remoteHandle, mc, res, enterFrameFunc, admc, getURL;
function FogAdsAS2 (o) {
super();
var _local4 = {ad_timeout:5000, fadeout_time:500, adFinished:function () {
trace("options.adFinished()");
_root.play();
}, allowOnFOG:false, ad_server:"www.freeonlinegames.com/tracking"};
options = parseOptions(o, _local4);
clip = _root;
urlInfo = getUrlInfo(_root._url);
}
function showPreGameAd(RemoteHandle) {
if ((_root._url.indexOf(".freeonlinegames.com") > -1) && (!options.allowOnFOG)) {
options.adFinished();
return(undefined);
}
remoteHandle = RemoteHandle;
_root.stop();
mc = clip.createEmptyMovieClip("_fogad", clip.getNextHighestDepth());
res = getDims(options);
var _local7 = res[0];
var _local6 = res[1];
mc.x = _local7 * 0.5;
mc.y = _local6 * 0.5;
var _local3 = createEmptyMovieClipAS3(mc, "_bkg", 1);
_local3.graphics.beginFill(16777215);
_local3.graphics.drawRect(0, 0, _local7, _local6);
_local3.x = -(_local7 / 2);
_local3.y = -(_local6 / 2);
enterFrameFunc = function () {
var _local2 = false;
if (this.admc.time_elapsed > this.admc.ad_msec) {
_local2 = true;
}
if (this.admc.time_elapsed > (this.admc.ad_msec / 2)) {
this.admc.showSkipButton();
}
if (_local2 && (this.admc.AdStatus == "complete")) {
this.admc.adFinished();
}
};
System.security.allowDomain("*");
var _local5 = new Object();
_local5.onLoadInit = function (c) {
trace(RemoteHandle);
_root[RemoteHandle].admc = c;
c.showAd(RemoteHandle);
};
_local5.onLoadError = function () {
this.clip.play();
};
var _local4 = mc.createEmptyMovieClip("mlc", mc.getNextHighestDepth());
_local4._x = (res[0] / 2) - 150;
_local4._y = (res[1] / 2) - 125;
var _local9 = new MovieClipLoader();
_local9.addListener(_local5);
_local9.loadClip((("http://" + options.ad_server) + "/loader-as2.swf?c=") + Math.random(), _local4);
trace("Waiting to load swf..");
}
function cleanupClip(e) {
trace("cleanupClip()");
delete enterFrameFunc;
admc.cleanupClip();
}
function parseOptions(options, defaults) {
var _local2 = {};
var _local1;
for (_local1 in defaults) {
_local2[_local1] = defaults[_local1];
}
if (options) {
for (_local1 in options) {
_local2[_local1] = options[_local1];
}
}
return(_local2);
}
function createEmptyMovieClipAS3(parent, name, depth) {
var _local2 = new MovieClip();
return(addToMovieClip(parent, name, _local2));
}
function addToMovieClip(parent, name, child) {
parent.addChild(child);
parent[name] = child;
child.name = name;
return(child);
}
function getDims(options) {
var _local2;
var _local1;
if (typeof(options.res) != "undefined") {
var _local3 = options.res.split("x");
_local2 = parseFloat(_local3[0]);
_local1 = parseFloat(_local3[1]);
}
if ((!_local2) || (!_local1)) {
_local2 = Stage.width;
_local1 = Stage.height;
}
return([_local2, _local1]);
}
function getUrlInfo(url) {
var _local1 = url.indexOf("://") + 3;
var _local3 = url.indexOf("/", _local1);
var _local5 = url.substring(_local1, _local3);
var _local4 = _local5.lastIndexOf(".") - 1;
var _local6 = _local5.lastIndexOf(".", _local4) + 1;
return({domain:_local5, uri:url.substr(_local3)});
}
function trackClick(type) {
trace(("trackClick('" + type) + "')");
if (admc) {
admc.trackClick(type);
} else {
var _local2 = ("http://www.freeonlinegames.com/?utm_source=game" + options.id) + "&utm_medium=game";
getURL(_local2, "_blank");
trace("Backup Tracking: " + _local2);
}
}
}
Symbol 9 MovieClip Frame 1 (8 B)
stop();
Symbol 56 Button (70 B)
on (release) {
getURL ("http://www.freeonlinegames.com", "_blank");
}
Instance of Symbol 58 MovieClip "mcNotice" in Symbol 100 MovieClip Frame 1 (42 B)
onClipEvent (load) {
_visible = false;
}
Symbol 100 MovieClip Frame 120 (290 B)
stop();
if ((_url.indexOf("freeonlinegames.com") >= 0) && (_url.indexOf("file:") == -1)) {
_root.okToPlay = true;
_root.play();
} else if (_root.debug) {
_root.okToPlay = true;
_root.play();
} else {
_root.mcTaglines._visible = false;
mcNotice._visible = true;
}
Symbol 101 MovieClip Frame 60 (95 B)
stop();
var fogsound = new Sound();
fogsound.attachSound("fogaudio");
fogsound.start(0, 1);
Symbol 129 MovieClip Frame 1 (8 B)
stop();
Symbol 135 MovieClip [BOSS_HP] Frame 36 (52 B)
_root.attach_boss = false;
this.removeMovieClip();
Symbol 137 MovieClip [darker] Frame 77 (66 B)
_root.gotoAndPlay(39);
this.removeMovieClip();
stopAllSounds();
Symbol 172 MovieClip Frame 18 (1 B)
Symbol 173 MovieClip [explosion_mc] Frame 18 (24 B)
this.removeMovieClip();
Symbol 181 MovieClip [glass_brake] Frame 1 (231 B)
_root.HP = _root.HP - 5;
_root.game_menu.HP._alpha = 100;
if (_root.sounds == true) {
if (_root.car.engineSpd <= 1.5) {
_root.s1.start();
_root.s17.start();
} else {
_root.s2.start();
_root.s17.start();
}
}
Symbol 181 MovieClip [glass_brake] Frame 3 (8 B)
stop();
Symbol 185 MovieClip [johnny] Frame 1 (21 B)
_root.jumped = true;
Symbol 185 MovieClip [johnny] Frame 20 (8 B)
stop();
Symbol 188 MovieClip [restart_Black] Frame 35 (78 B)
_root.gotoAndStop(_root._currentframe - 1);
this.removeMovieClip();
stop();
Symbol 189 MovieClip [restart_Black_2] Frame 35 (78 B)
_root.gotoAndStop(_root._currentframe + 1);
this.removeMovieClip();
stop();
Symbol 192 MovieClip [smoke] Frame 31 (24 B)
this.removeMovieClip();
Symbol 196 MovieClip [smoke_2] Frame 13 (24 B)
this.removeMovieClip();
Instance of Symbol 197 MovieClip in Symbol 198 MovieClip [smoke_sandy] Frame 1 (56 B)
onClipEvent (load) {
this.gotoAndStop(random(7) + 1);
}
Symbol 198 MovieClip [smoke_sandy] Frame 8 (24 B)
this.removeMovieClip();
Symbol 201 MovieClip [smoking] Frame 40 (24 B)
this.removeMovieClip();
Symbol 205 MovieClip [star_attach] Frame 41 (24 B)
this.removeMovieClip();
Instance of Symbol 210 MovieClip in Symbol 211 MovieClip [window_shot] Frame 1 (99 B)
onClipEvent (load) {
this._rotation = random(360) + 0;
_root.glassbrake = _root.glassbrake + 1;
}
Instance of Symbol 210 MovieClip in Symbol 212 MovieClip [window_shot2] Frame 1 (99 B)
onClipEvent (load) {
this._rotation = random(360) + 0;
_root.glassbrake = _root.glassbrake + 1;
}
Symbol 213 MovieClip [wreck] Frame 1 (19 B)
_root.s17.start();
Symbol 213 MovieClip [wreck] Frame 7 (19 B)
_root.s17.start();
Symbol 213 MovieClip [wreck] Frame 14 (19 B)
_root.s17.start();
Symbol 213 MovieClip [wreck] Frame 21 (19 B)
_root.s17.start();
Symbol 213 MovieClip [wreck] Frame 29 (19 B)
_root.s17.start();
Symbol 213 MovieClip [wreck] Frame 46 (24 B)
this.removeMovieClip();
Symbol 214 MovieClip Frame 1 (8 B)
stop();
Symbol 229 MovieClip Frame 1 (8 B)
stop();
Symbol 229 MovieClip Frame 25 (8 B)
stop();
Symbol 231 MovieClip Frame 1 (8 B)
stop();
Symbol 231 MovieClip Frame 25 (8 B)
stop();
Symbol 233 MovieClip Frame 1 (8 B)
stop();
Symbol 233 MovieClip Frame 25 (8 B)
stop();
Symbol 235 MovieClip Frame 1 (8 B)
stop();
Symbol 235 MovieClip Frame 25 (8 B)
stop();
Symbol 237 MovieClip Frame 1 (8 B)
stop();
Symbol 237 MovieClip Frame 25 (8 B)
stop();
Symbol 239 MovieClip Frame 1 (8 B)
stop();
Symbol 239 MovieClip Frame 25 (8 B)
stop();
Symbol 245 MovieClip Frame 1 (2.22 KiB) ●
onEnterFrame = function () {
_root.volumeBegin++;
if (_parent._currentframe == 35) {
if (play_btn.hitTest(white) and (play_btn._currentframe == 1)) {
play_btn.play();
_root.s15.start();
} else if ((!play_btn.hitTest(white)) and (play_btn._currentframe == 25)) {
play_btn.gotoAndStop(1);
}
if (how_to_play_btn.hitTest(white) and (how_to_play_btn._currentframe == 1)) {
how_to_play_btn.play();
_root.s15.start();
} else if ((!how_to_play_btn.hitTest(white)) and (how_to_play_btn._currentframe == 25)) {
how_to_play_btn.gotoAndStop(1);
}
if (more_games_btn.hitTest(white) and (more_games_btn._currentframe == 1)) {
more_games_btn.play();
_root.s15.start();
} else if ((!more_games_btn.hitTest(white)) and (more_games_btn._currentframe == 25)) {
more_games_btn.gotoAndStop(1);
}
if (your_web_btn.hitTest(white) and (your_web_btn._currentframe == 1)) {
your_web_btn.play();
_root.s15.start();
} else if ((!your_web_btn.hitTest(white)) and (your_web_btn._currentframe == 25)) {
your_web_btn.gotoAndStop(1);
}
if (wheeler_1_btn.hitTest(white) and (wheeler_1_btn._currentframe == 1)) {
wheeler_1_btn.play();
_root.s15.start();
} else if ((!wheeler_1_btn.hitTest(white)) and (wheeler_1_btn._currentframe == 25)) {
wheeler_1_btn.gotoAndStop(1);
}
if (wheeler_2_btn.hitTest(white) and (wheeler_2_btn._currentframe == 1)) {
wheeler_2_btn.play();
_root.s15.start();
} else if ((!wheeler_2_btn.hitTest(white)) and (wheeler_2_btn._currentframe == 25)) {
wheeler_2_btn.gotoAndStop(1);
}
}
};
onMouseDown = function () {
if (play_btn.hitTest(white)) {
_root.gotoAndStop(45);
_root.s16.start();
}
if (how_to_play_btn.hitTest(white)) {
_root.gotoAndStop(45);
_root.s16.start();
}
if (more_games_btn.hitTest(white)) {
_root.FogAD.trackClick("moregames");
_root.s16.start();
}
if (your_web_btn.hitTest(white)) {
getURL ("http://www.freegamesforyourwebsite.com/?18wheeler3", "_blank");
_root.s16.start();
}
if (wheeler_1_btn.hitTest(white)) {
_root.FogAD.trackClick("moregames");
_root.s16.start();
}
if (wheeler_2_btn.hitTest(white)) {
_root.FogAD.trackClick("moregames");
_root.s16.start();
}
};
Instance of Symbol 241 MovieClip "white" in Symbol 245 MovieClip Frame 1 (93 B)
onClipEvent (load) {
this._y = 0;
}
onClipEvent (enterFrame) {
this._y = _parent._ymouse;
}
Symbol 246 MovieClip Frame 1 (85 B)
onMouseDown = function () {
if (_currentframe == 1) {
play();
}
};
stop();
Instance of Symbol 218 MovieClip in Symbol 246 MovieClip Frame 1 (21 B)
/* no clip actions */
Instance of Symbol 51 MovieClip in Symbol 246 MovieClip Frame 1 (70 B)
on (release) {
getURL ("http://www.freeonlinegames.com", "_blank");
}
Instance of Symbol 51 MovieClip in Symbol 246 MovieClip Frame 1 (70 B)
on (release) {
getURL ("http://www.freeonlinegames.com", "_blank");
}
Symbol 246 MovieClip Frame 2 (19 B)
_root.s14.start();
Symbol 246 MovieClip Frame 35 (8 B)
stop();
Symbol 254 MovieClip Frame 1 (8 B)
stop();
Symbol 258 MovieClip Frame 18 (8 B)
stop();
Symbol 260 MovieClip Frame 1 (8 B)
stop();
Symbol 260 MovieClip Frame 2 (25 B)
_root.camera_dis = true;
Symbol 260 MovieClip Frame 35 (8 B)
stop();
Symbol 262 MovieClip Frame 1 (8 B)
stop();
Symbol 262 MovieClip Frame 2 (27 B)
_root.camera_dis_2 = true;
Symbol 262 MovieClip Frame 35 (8 B)
stop();
Symbol 265 MovieClip Frame 1 (8 B)
stop();
Instance of Symbol 265 MovieClip "body_hit" in Symbol 292 MovieClip Frame 1 (46 B)
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 265 MovieClip "head_hit" in Symbol 292 MovieClip Frame 1 (46 B)
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 265 MovieClip "legs_hit" in Symbol 292 MovieClip Frame 1 (46 B)
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 265 MovieClip "body_hit" in Symbol 307 MovieClip Frame 2 (46 B)
onClipEvent (load) {
this._visible = false;
}
Symbol 307 MovieClip Frame 138 (59 B)
_root.shoot_scene.game_level.gotoAndStop("lose");
stop();
Instance of Symbol 265 MovieClip "body_hit" in Symbol 327 MovieClip Frame 3 (46 B)
onClipEvent (load) {
this._visible = false;
}
Symbol 327 MovieClip Frame 11 (1 B)
Symbol 327 MovieClip Frame 178 (59 B)
stop();
_root.shoot_scene.game_level.gotoAndStop("lose");
Instance of Symbol 265 MovieClip "body_hit" in Symbol 331 MovieClip Frame 3 (46 B)
onClipEvent (load) {
this._visible = false;
}
Symbol 331 MovieClip Frame 80 (56 B)
_parent._parent.alarm = false;
_parent.gotoAndStop(1);
Symbol 340 MovieClip Frame 5 (19 B)
_root.s24.start();
Symbol 340 MovieClip Frame 45 (183 B)
stop();
if ((_root.camera_dis == true) and (_root.camera_dis_2 == true)) {
_root.shoot_scene.game_level.gotoAndStop(2);
} else {
_root.shoot_scene.game_level.gotoAndStop(5);
}
Symbol 346 MovieClip Frame 7 (8 B)
stop();
Symbol 347 MovieClip Frame 10 (19 B)
_root.s24.start();
Symbol 347 MovieClip Frame 45 (183 B)
stop();
if ((_root.camera_dis == true) and (_root.camera_dis_2 == true)) {
_root.shoot_scene.game_level.gotoAndStop(2);
} else {
_root.shoot_scene.game_level.gotoAndStop(5);
}
Symbol 361 MovieClip Frame 12 (19 B)
_root.s24.start();
Symbol 361 MovieClip Frame 45 (183 B)
stop();
if ((_root.camera_dis == true) and (_root.camera_dis_2 == true)) {
_root.shoot_scene.game_level.gotoAndStop(2);
} else {
_root.shoot_scene.game_level.gotoAndStop(5);
}
Symbol 380 MovieClip Frame 20 (17 B)
gotoAndPlay (1);
Symbol 380 MovieClip Frame 21 (35 B)
_parent.body_hit_2.gotoAndStop(2);
Symbol 380 MovieClip Frame 53 (183 B)
stop();
if ((_root.camera_dis == true) and (_root.camera_dis_2 == true)) {
_root.shoot_scene.game_level.gotoAndStop(2);
} else {
_root.shoot_scene.game_level.gotoAndStop(5);
}
Instance of Symbol 265 MovieClip "body_hit" in Symbol 381 MovieClip Frame 1 (46 B)
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 349 MovieClip "more_blood" in Symbol 381 MovieClip Frame 148 (46 B)
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 265 MovieClip "body_hit_2" in Symbol 381 MovieClip Frame 148 (46 B)
onClipEvent (load) {
this._visible = false;
}
Symbol 381 MovieClip Frame 306 (59 B)
stop();
_root.shoot_scene.game_level.gotoAndStop("lose");
Symbol 382 MovieClip Frame 1 (8 B)
stop();
Symbol 383 MovieClip Frame 1 (370 B)
onEnterFrame = function () {
if (alarm and (jim._currentframe == 1)) {
jim.gotoAndStop(2);
alarm = false;
}
if (alarm_2 and (jim._currentframe == 1)) {
jim.gotoAndStop(4);
alarm_2 = false;
}
if (alarm and (jim._currentframe == 4)) {
jim.gotoAndStop(2);
jim.jim_2.gotoAndPlay(75);
jim.jim_2.jim_3.gotoAndPlay(75);
alarm = false;
}
};
Instance of Symbol 265 MovieClip "cam_hit" in Symbol 383 MovieClip Frame 1 (46 B)
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 265 MovieClip "cam_hit_2" in Symbol 383 MovieClip Frame 1 (46 B)
onClipEvent (load) {
this._visible = false;
}
Symbol 399 MovieClip Frame 9 (8 B)
stop();
Symbol 400 MovieClip Frame 1 (8 B)
stop();
Symbol 410 MovieClip Frame 1 (49 B)
canshoot = true;
_root.shoot = false;
stop();
Symbol 410 MovieClip Frame 2 (59 B)
canshoot = false;
_root.s23.start();
_root.shoot = true;
Instance of Symbol 404 MovieClip in Symbol 410 MovieClip Frame 2 (57 B)
onClipEvent (load) {
this._rotation = random(360) + 1;
}
Instance of Symbol 404 MovieClip in Symbol 410 MovieClip Frame 2 (57 B)
onClipEvent (load) {
this._rotation = random(360) + 1;
}
Instance of Symbol 265 MovieClip "HIT" in Symbol 410 MovieClip Frame 2 (46 B)
onClipEvent (load) {
this._visible = false;
}
Symbol 410 MovieClip Frame 3 (21 B)
_root.shoot = false;
Symbol 410 MovieClip Frame 14 (17 B)
canshoot = true;
Symbol 418 MovieClip Frame 21 (220 B)
stop();
_root.score = _root.score + 125;
onEnterFrame = function () {
if (Key.isDown(32) and (!pressed)) {
attachMovie("restart_Black_2", 999999995, {_x:game_menu._x, _y:game_menu._y});
pressed = true;
}
};
Symbol 421 MovieClip Frame 21 (184 B)
stop();
onEnterFrame = function () {
if (Key.isDown(32) and (!pressed)) {
attachMovie("restart_Black", 999999995, {_x:game_menu._x, _y:game_menu._y});
pressed = true;
}
};
Symbol 424 MovieClip Frame 21 (218 B)
stop();
_root.score = _root.score - 100;
onEnterFrame = function () {
if (Key.isDown(32) and (!pressed)) {
attachMovie("restart_Black", 999999995, {_x:game_menu._x, _y:game_menu._y});
pressed = true;
}
};
Symbol 427 MovieClip Frame 34 (184 B)
stop();
onEnterFrame = function () {
if (Key.isDown(32) and (!pressed)) {
attachMovie("restart_Black", 999999995, {_x:game_menu._x, _y:game_menu._y});
pressed = true;
}
};
Symbol 428 MovieClip Frame 1 (8 B)
stop();
Symbol 432 MovieClip Frame 73 (8 B)
stop();
Symbol 437 MovieClip Frame 1 (97 B)
if (_root.sound_ON == true) {
_root.s1.setVolume(0);
}
_root.game_menu.texts.gotoAndStop(1);
Symbol 437 MovieClip Frame 5 (98 B)
if (_root.sound_ON == true) {
_root.s1.setVolume(20);
}
_root.game_menu.texts.gotoAndStop(1);
Symbol 437 MovieClip Frame 10 (98 B)
if (_root.sound_ON == true) {
_root.s1.setVolume(30);
}
_root.game_menu.texts.gotoAndStop(1);
Symbol 437 MovieClip Frame 14 (98 B)
if (_root.sound_ON == true) {
_root.s1.setVolume(50);
}
_root.game_menu.texts.gotoAndStop(1);
Symbol 437 MovieClip Frame 18 (98 B)
if (_root.sound_ON == true) {
_root.s1.setVolume(70);
}
_root.game_menu.texts.gotoAndStop(1);
Symbol 437 MovieClip Frame 22 (98 B)
if (_root.sound_ON == true) {
_root.s1.setVolume(90);
}
_root.game_menu.texts.gotoAndStop(1);
Symbol 437 MovieClip Frame 26 (109 B)
if (_root.sound_ON == true) {
_root.s1.setVolume(100);
}
_root.game_menu.texts.gotoAndPlay(2);
stop();
Symbol 438 MovieClip Frame 24 (8 B)
stop();
Symbol 439 MovieClip Frame 1 (128 B)
stop();
if (_root.tutorialScreen == true) {
gotoAndStop (2);
_root.tutorialScreen = false;
} else {
gotoAndStop (3);
}
Symbol 441 MovieClip Frame 1 (2.91 KiB) ●
broken_win = 1490;
broken_truck = 1451;
broken_win_2 = 2000;
onEnterFrame = function () {
shoot_bg._x = (-_xmouse) / 10;
shoot_bg._y = (-_ymouse) / 10;
in_truck._x = (-_xmouse) / 3;
in_truck._y = (-_ymouse) / 3;
hand_gun._x = hand_gun._x - ((hand_gun._x - _xmouse) / 7);
hand_gun._y = hand_gun._y - ((hand_gun._y - _ymouse) / 7);
if (in_truck._x >= 120) {
in_truck._x = 120;
}
if (in_truck._x <= -25) {
in_truck._x = -25;
}
if (in_truck._y >= 70) {
in_truck._y = 70;
}
if (in_truck._y <= -70) {
in_truck._y = -70;
}
if (hand_gun._y <= -190) {
hand_gun._y = -190;
}
if (hand_gun._x <= -280) {
hand_gun._x = -280;
}
if (hand_gun._x >= 275) {
hand_gun._x = 275;
}
if (_root.glassbrake >= 10) {
in_truck.gotoAndStop(2);
}
if (hand_gun.hand_gun_2.HIT.hitTest(shoot_bg.jim.jim_2.head_hit)) {
if (shoot_bg.jim._currentframe == 1) {
shoot_bg.jim.gotoAndStop(7);
}
}
if (hand_gun.hand_gun_2.HIT.hitTest(shoot_bg.jim.jim_2.body_hit)) {
if (shoot_bg.jim._currentframe == 1) {
shoot_bg.jim.gotoAndStop(3);
} else if (shoot_bg.jim._currentframe == 2) {
shoot_bg.jim.gotoAndStop(6);
} else if (shoot_bg.jim._currentframe == 3) {
shoot_bg.jim.gotoAndStop(5);
} else if (shoot_bg.jim._currentframe == 4) {
shoot_bg.jim.gotoAndStop(6);
} else if (shoot_bg.jim._currentframe == 8) {
shoot_bg.jim.gotoAndStop(6);
}
}
if (hand_gun.hand_gun_2.HIT.hitTest(shoot_bg.jim.jim_2.body_hit_2)) {
if (shoot_bg.jim._currentframe == 8) {
shoot_bg.jim.jim_2.stop();
shoot_bg.jim.jim_2.jim_3.gotoAndPlay(21);
shoot_bg.jim.jim_2.more_blood._visible = true;
}
}
if (hand_gun.hand_gun_2.HIT.hitTest(shoot_bg.jim.jim_2.legs_hit)) {
if (shoot_bg.jim._currentframe == 1) {
shoot_bg.jim.gotoAndStop(8);
}
}
if (hand_gun.hand_gun_2.HIT.hitTest(in_truck.truck_hit)) {
in_truck.truck_hits.attachMovie("truck_shot", "truck_shot", broken_truck, {_x:hand_gun._x, _y:hand_gun._y});
broken_truck = broken_truck + 1;
}
if (hand_gun.hand_gun_2.HIT.hitTest(shoot_bg.fog_cir)) {
shoot_bg.fog_cir.play();
}
if (hand_gun.hand_gun_2.HIT.hitTest(shoot_bg.window_hit)) {
if (shoot_bg.jim._currentframe == 1) {
broken_win_2 = broken_win_2 + 1;
}
shoot_bg.alarm = true;
}
if (hand_gun.hand_gun_2.HIT.hitTest(in_truck.window_hit)) {
in_truck.window.attachMovie("window_shot", "window_shot", broken_win, {_x:hand_gun._x, _y:hand_gun._y});
broken_win = broken_win + 1;
shoot_bg.alarm_2 = true;
}
if (hand_gun.hand_gun_2.HIT.hitTest(shoot_bg.cam_hit)) {
shoot_bg.camera.play();
shoot_bg.cam_hit.gotoAndStop(2);
}
if (hand_gun.hand_gun_2.HIT.hitTest(shoot_bg.cam_hit_2)) {
shoot_bg.camera_2.play();
shoot_bg.cam_hit_2.gotoAndStop(2);
}
};
onMouseDown = function () {
if (hand_gun.hand_gun_2.canshoot == true) {
hand_gun.hand_gun_2.gotoAndPlay(2);
_root.s23.stop(["gun"]);
}
};
Instance of Symbol 51 MovieClip in Symbol 441 MovieClip Frame 1 (70 B)
on (release) {
getURL ("http://www.freeonlinegames.com", "_blank");
}
Instance of Symbol 51 MovieClip in Symbol 441 MovieClip Frame 1 (70 B)
on (release) {
getURL ("http://www.freeonlinegames.com", "_blank");
}
Symbol 449 MovieClip Frame 40 (8 B)
stop();
Instance of Symbol 448 MovieClip in Symbol 449 MovieClip Frame 40 (276 B)
onClipEvent (enterFrame) {
KeyListener = {};
KeyListener.onKeyDown = function () {
if (_parent._parent.keyboard._currentframe == 75) {
_root.gotoAndStop(50);
if (!s14_start) {
_root.s14.start();
s14_start = true;
}
}
};
Key.addListener(KeyListener);
}
Symbol 452 MovieClip Frame 75 (8 B)
stop();
Instance of Symbol 246 MovieClip in Symbol 453 MovieClip Frame 1 (45 B)
onClipEvent (load) {
this.gotoAndStop(35);
}
Instance of Symbol 246 MovieClip in Symbol 454 MovieClip Frame 1 (45 B)
onClipEvent (load) {
this.gotoAndStop(35);
}
Symbol 455 MovieClip Frame 36 (8 B)
stop();
Symbol 456 MovieClip Frame 1 (28 B)
stop();
_root.s14.start();
Symbol 471 MovieClip Frame 1 (8 B)
stop();
Instance of Symbol 478 MovieClip "window" in Symbol 479 MovieClip Frame 1 (36 B)
onClipEvent (load) {
this.stop();
}
Symbol 488 MovieClip Frame 1 (1 B)
Instance of Symbol 478 MovieClip "window" in Symbol 491 MovieClip Frame 1 (36 B)
onClipEvent (load) {
this.stop();
}
Symbol 493 MovieClip Frame 1 (1 B)
Symbol 513 MovieClip Frame 1 (8 B)
stop();
Symbol 514 MovieClip Frame 1 (1 B)
Instance of Symbol 478 MovieClip "window" in Symbol 514 MovieClip Frame 1 (21 B)
/* no clip actions */
Instance of Symbol 265 MovieClip "HIT" in Symbol 514 MovieClip Frame 1 (42 B)
onClipEvent (load) {
_visible = false;
}
Instance of Symbol 478 MovieClip in Symbol 514 MovieClip Frame 4 (77 B)
onClipEvent (enterFrame) {
this.gotoAndStop(_parent.window._currentframe);
}
Instance of Symbol 471 MovieClip in Symbol 514 MovieClip Frame 9 (77 B)
onClipEvent (enterFrame) {
this.gotoAndStop(_parent.window._currentframe);
}
Instance of Symbol 265 MovieClip "HIT" in Symbol 514 MovieClip Frame 18 (42 B)
onClipEvent (load) {
_visible = false;
}
Symbol 515 MovieClip Frame 1 (5.2 KiB) ● ●
function rotation(dx, dy) {
return((Math.atan2(dy, dx) * 180) / Math.PI);
}
AI_speed = 7;
AI_car_1.horn_timer = 50;
AI_car_2.horn_timer = 50;
AI_car_4.horn_timer = 50;
var AI_CARS_A = [AI_car_1, AI_car_2, AI_car_4];
var pos_A_1 = new Array([820, 706], [1423, -191], [2250, 394], [1750, 1186]);
var pos_A_2 = new Array([2329, 1864], [3214, 2430], [3967, 3039], [4097, 3000], [3388, 2289], [2423, 1698]);
var pos_A_4 = new Array([20968, 26362], [19655, 26102], [19639, 26255], [20920, 26508]);
var currentPos = 0;
var currentPos_2 = 0;
var currentPos_3 = 0;
var currentPos_4 = 0;
AI_car_1.gotoAndStop(random(16) + 1);
AI_car_2.gotoAndStop(random(16) + 1);
AI_car_3.gotoAndStop(random(16) + 1);
AI_car_4.gotoAndStop(random(16) + 1);
var MP = (Math.PI/180);
onEnterFrame = function () {
if ((!_root.Paused) == true) {
AI_car_1._x = AI_car_1._x + (AI_speed * Math.cos(AI_car_1._rotation * MP));
AI_car_1._y = AI_car_1._y + (AI_speed * Math.sin(AI_car_1._rotation * MP));
AI_car_2._x = AI_car_2._x + (AI_speed * Math.cos(AI_car_2._rotation * MP));
AI_car_2._y = AI_car_2._y + (AI_speed * Math.sin(AI_car_2._rotation * MP));
AI_car_4._x = AI_car_4._x + (AI_speed * Math.cos(AI_car_4._rotation * MP));
AI_car_4._y = AI_car_4._y + (AI_speed * Math.sin(AI_car_4._rotation * MP));
if (AI_speed <= 0) {
AI_speed = 0;
}
if (((((!_root.hero.hitTest(AI_car_1.HIT)) and (!_root.hero.hitTest(AI_car_2.HIT))) and (!_root.hero.hitTest(AI_car_3.HIT))) and (!_root.hero.hitTest(AI_car_4.HIT))) and (!trailerHITandCON)) {
_root.s12.stop(["AI_horn"]);
AI_car_1.s12_start = false;
AI_car_2.s12_start = false;
AI_car_3.s12_start = false;
AI_car_4.s12_start = false;
AI_car_1.horn_timer = 50;
AI_car_2.horn_timer = 50;
AI_car_3.horn_timer = 50;
AI_car_4.horn_timer = 50;
AI_speed = AI_speed + 0.05;
if (AI_speed >= 3) {
s13_start = false;
AI_speed = 3;
}
} else if ((!AI_speed) <= 0) {
AI_speed = AI_speed - 0.2;
}
i = 0;
while (i < AI_CARS_A.length) {
if (_root.trailerBody.hitTest(AI_CARS_A[i].HIT) and (_root.trailerCon == true)) {
trailerHITandCON = true;
} else {
trailerHITandCON = false;
}
AI_CARS_A[i].window.gotoAndStop(Math.round(((AI_CARS_A[i]._rotation + 180) * 120) / 360));
if (_root.hero.hitTest(AI_CARS_A[i].HIT) or trailerHITandCON) {
AI_CARS_A[i].horn_timer--;
if ((AI_CARS_A[i].horn_timer <= 0) and (!AI_CARS_A[i].s12_start)) {
_root.s12.start();
AI_CARS_A[i].s12_start = true;
}
if (!s13_start) {
_root.s13.start();
s13_start = true;
}
}
i++;
}
if ((((AI_car_1._x <= (pos_A_1[currentPos][0] + 50)) && (AI_car_1._x >= (pos_A_1[currentPos][0] - 50))) && (AI_car_1._y <= (pos_A_1[currentPos][1] + 50))) && (AI_car_1._y >= (pos_A_1[currentPos][1] - 50))) {
if (currentPos == pos_A_1.length) {
currentPos = 0;
} else {
currentPos++;
}
}
var _local4 = rotation((pos_A_1[currentPos][0] + 15) - AI_car_1._x, (pos_A_1[currentPos][1] - 15) - AI_car_1._y);
var _local7 = Math.abs(_local4 - AI_car_1._rotation);
if (_local7 > 180) {
if (_local4 > AI_car_1._rotation) {
_local4 = _local4 - 360;
} else {
_local4 = _local4 + 360;
}
}
if (AI_car_1._rotation < (_local4 - 3)) {
AI_car_1._rotation = AI_car_1._rotation + 3;
} else if (AI_car_1._rotation > (_local4 + 3)) {
AI_car_1._rotation = AI_car_1._rotation - 3;
}
}
if ((((AI_car_2._x <= (pos_A_2[currentPos_2][0] + 50)) && (AI_car_2._x >= (pos_A_2[currentPos_2][0] - 50))) && (AI_car_2._y <= (pos_A_2[currentPos_2][1] + 50))) && (AI_car_2._y >= (pos_A_2[currentPos_2][1] - 50))) {
if (currentPos_2 == pos_A_2.length) {
currentPos_2 = 0;
} else {
currentPos_2++;
}
}
var _local2 = rotation((pos_A_2[currentPos_2][0] + 15) - AI_car_2._x, (pos_A_2[currentPos_2][1] - 15) - AI_car_2._y);
var _local6 = Math.abs(_local2 - AI_car_2._rotation);
if (_local6 > 180) {
if (_local2 > AI_car_2._rotation) {
_local2 = _local2 - 360;
} else {
_local2 = _local2 + 360;
}
}
if (AI_car_2._rotation < (_local2 - 3)) {
AI_car_2._rotation = AI_car_2._rotation + 3;
} else if (AI_car_2._rotation > (_local2 + 3)) {
AI_car_2._rotation = AI_car_2._rotation - 3;
}
if ((((AI_car_4._x <= (pos_A_4[currentPos_4][0] + 50)) && (AI_car_4._x >= (pos_A_4[currentPos_4][0] - 50))) && (AI_car_4._y <= (pos_A_4[currentPos_4][1] + 50))) && (AI_car_4._y >= (pos_A_4[currentPos_4][1] - 50))) {
if (currentPos_4 == pos_A_4.length) {
currentPos_4 = 0;
} else {
currentPos_4++;
}
}
var _local3 = rotation((pos_A_4[currentPos_4][0] + 15) - AI_car_4._x, (pos_A_4[currentPos_4][1] - 15) - AI_car_4._y);
var _local5 = Math.abs(_local3 - AI_car_4._rotation);
if (_local5 > 180) {
if (_local3 > AI_car_4._rotation) {
_local3 = _local3 - 460;
} else {
_local3 = _local3 + 460;
}
}
if (AI_car_4._rotation < (_local3 - 4)) {
AI_car_4._rotation = AI_car_4._rotation + 4;
} else if (AI_car_4._rotation > (_local3 + 4)) {
AI_car_4._rotation = AI_car_4._rotation - 4;
}
};
Symbol 520 MovieClip Frame 1 (8 B)
stop();
Symbol 526 MovieClip Frame 171 (8 B)
stop();
Symbol 539 MovieClip Frame 100 (8 B)
stop();
Symbol 540 MovieClip Frame 1 (8 B)
stop();
Instance of Symbol 522 MovieClip "brakeLight" in Symbol 540 MovieClip Frame 1 (171 B)
onClipEvent (enterFrame) {
if ((!_root.Paused) == true) {
if (Key.isDown(32) or Key.isDown(40)) {
this._visible = true;
} else {
this._visible = false;
}
}
}
Symbol 540 MovieClip Frame 3 (145 B)
_root.s5.stop(["truck_drive_faster"]);
_root.s8.stop(["truck_drive_fastest"]);
_root.s6.stop(["truck_idle"]);
_root.s4.stop(["truck_drive"]);
Symbol 545 MovieClip Frame 1 (8 B)
stop();
Instance of Symbol 265 MovieClip "attach_hit" in Symbol 545 MovieClip Frame 1 (46 B)
onClipEvent (load) {
this._visible = false;
}
Symbol 548 MovieClip Frame 1 (8 B)
stop();
Symbol 572 MovieClip Frame 1 (8 B)
stop();
Symbol 576 MovieClip Frame 1 (8 B)
stop();
Symbol 576 MovieClip Frame 101 (8 B)
stop();
Symbol 577 MovieClip Frame 1 (8 B)
stop();
Instance of Symbol 576 MovieClip in Symbol 577 MovieClip Frame 1 (84 B)
onClipEvent (enterFrame) {
if (_root.game_menu.hitTest(this)) {
this.play();
}
}
Symbol 578 MovieClip Frame 1 (8 B)
stop();
Instance of Symbol 560 MovieClip "park_place" in Symbol 578 MovieClip Frame 1 (149 B)
onClipEvent (enterFrame) {
if (this.hitTest(_root.game_menu._x, _root.game_menu._y, true)) {
this._alpha = 40;
} else {
this._alpha = 100;
}
}
Instance of Symbol 564 MovieClip in Symbol 578 MovieClip Frame 1 (149 B)
onClipEvent (enterFrame) {
if (this.hitTest(_root.game_menu._x, _root.game_menu._y, true)) {
this._alpha = 40;
} else {
this._alpha = 100;
}
}
Instance of Symbol 577 MovieClip "arrow_arrive_2" in Symbol 578 MovieClip Frame 1 (44 B)
onClipEvent (load) {
this.gotoAndStop(2);
}
Symbol 584 MovieClip Frame 1 (8 B)
stop();
Symbol 594 MovieClip Frame 57 (64 B)
if (_root.over.hitTest(_parent.cars)) {
_root.s20.start();
}
Symbol 594 MovieClip Frame 106 (64 B)
if (_root.over.hitTest(_parent.cars)) {
_root.s20.start();
}
Symbol 599 MovieClip Frame 1 (8 B)
stop();
Symbol 601 MovieClip Frame 57 (66 B)
if (_root.over.hitTest(_parent.cars_2)) {
_root.s20.start();
}
Symbol 601 MovieClip Frame 106 (66 B)
if (_root.over.hitTest(_parent.cars_2)) {
_root.s20.start();
}
Symbol 605 MovieClip Frame 1 (7.53 KiB) ● ●
function rotation(dx, dy) {
return((Math.atan2(dy, dx) * 180) / Math.PI);
}
AI_speed = 7;
AI_car_1.horn_timer = 50;
AI_car_2.horn_timer = 50;
AI_car_3.horn_timer = 50;
win_timer = 75;
go_timer = 135;
BOSS_HP = 100;
BOSS_DIE = false;
sign_timer = 35;
AI_blink = false;
_root.AI_light_AI_3._visible = false;
_root.AI_light_2_AI_3._visible = false;
go_but_stay = false;
var AI_CARS_A = [AI_car_1, AI_car_2, AI_car_4];
var pos_A_1 = new Array([1856, -228], [1930, -465], [1957, -860], [2037, -1242], [2073, -1671], [2135, -2019], [2172, -2346], [2233, -2789], [2202, -2482], [2135, -2146], [2122, -1845], [2053, -1514], [2028, -1193], [1957, -840], [1944, -586]);
var pos_A_2 = new Array([2730, -3509], [2662, -3035], [2620, -2835], [2579, -2573], [2541, -2073], [2483, -1925], [2460, -1550], [2408, -1373], [2381, -1014], [2327, -846], [2309, -518], [2264, -364], [2260, -156]);
var pos_A_3 = new Array([2610, -3729], [2627, -3559], [2717, -3400], [2675, -3126], [2519, -2960], [2425, -2590], [2471, -2416], [2393, -2062], [2246, -1794], [2216, -1467], [2363, -1042], [2205, -729], [2104, -255], [1960, -49], [1723, -221], [1340, -258], [751, -365], [639, 229], [577, 793], [749, 1004], [1018, 1031], [1573, 1114], [1821, 1283], [2619, 1816], [2708, 2015], [2876, 2575], [2842, 2778], [2759, 3245]);
var currentPos = 0;
var currentPos_2 = 0;
var currentPos_3 = 0;
AI_car_1.gotoAndStop(16);
AI_car_2.gotoAndStop(9);
AI_car_2.HIT.gotoAndStop(2);
AI_car_3.gotoAndStop(14);
var MP = (Math.PI/180);
onEnterFrame = function () {
if ((!_root.Paused) == true) {
if (go == true) {
if (!lights_on) {
_root.AI_light_AI_3._visible = true;
_root.AI_light_2_AI_3._visible = true;
lights_on = true;
}
if (AI_car_3.car.hitTest(_root.houses.lose_house)) {
_root.Paused = true;
_root.game_menu.game_level.gotoAndStop(4);
}
if (AI_speed == 0) {
AI_speed_CAR_3 = AI_speed;
} else {
AI_speed_CAR_3 = AI_speed + 4;
}
if (BOSS_HP <= 0) {
win_timer--;
if (win_timer <= 0) {
_root.game_menu.game_level.gotoAndStop(2);
_root.Paused = true;
}
BOSS_DIE = true;
if (!attach_wreck) {
_root.AI_light_AI_3._visible = false;
_root.AI_light_2_AI_3._visible = false;
_root.attachMovie("wreck", "wreck", 999999983, {_x:_root.AI.AI_car_3._x, _y:_root.AI.AI_car_3._y});
AI_car_3.gotoAndStop(17);
attach_wreck = true;
}
}
}
if (_root.over.hitTest(AI_car_2._x, AI_car_2._y, true) and (_root.parked == true)) {
sign_timer--;
if ((sign_timer <= 0) and (!AI_blink)) {
_root.AI_light_2_AI_2.play();
_root.AI_light_AI_2.play();
AI_blink = true;
go_but_stay = true;
_root.arrow_ob = _root.AI.AI_car_3;
}
}
if (go_but_stay == true) {
go_timer--;
if (go_timer <= 0) {
go = true;
}
}
AI_car_1._x = AI_car_1._x + (AI_speed * Math.cos(AI_car_1._rotation * MP));
AI_car_1._y = AI_car_1._y + (AI_speed * Math.sin(AI_car_1._rotation * MP));
if ((_root.parked == true) and ((!_root.AI_light_2_AI_2.jim_stop) == true)) {
AI_car_2.HIT.gotoAndStop(1);
AI_car_2._x = AI_car_2._x + (AI_speed * Math.cos(AI_car_2._rotation * MP));
AI_car_2._y = AI_car_2._y + (AI_speed * Math.sin(AI_car_2._rotation * MP));
}
if ((!BOSS_DIE) and (go == true)) {
AI_car_3._x = AI_car_3._x + (AI_speed_CAR_3 * Math.cos(AI_car_3._rotation * MP));
AI_car_3._y = AI_car_3._y + (AI_speed_CAR_3 * Math.sin(AI_car_3._rotation * MP));
}
if (AI_speed <= 0) {
AI_speed = 0;
}
if (((((!_root.hero.hitTest(AI_car_1.HIT)) and (!_root.hero.hitTest(AI_car_2.HIT))) and (!_root.hero.hitTest(AI_car_3.HIT))) and (!_root.hero.hitTest(AI_car_4.HIT))) and (!trailerHITandCON)) {
_root.s12.stop(["AI_horn"]);
AI_car_1.s12_start = false;
AI_car_2.s12_start = false;
AI_car_3.s12_start = false;
AI_car_4.s12_start = false;
AI_car_1.horn_timer = 50;
AI_car_2.horn_timer = 50;
AI_car_3.horn_timer = 50;
AI_car_4.horn_timer = 50;
AI_speed = AI_speed + 0.05;
if (AI_speed >= 3) {
s13_start = false;
AI_speed = 3;
}
} else if ((!AI_speed) <= 0) {
AI_speed = AI_speed - 0.2;
}
i = 0;
while (i < AI_CARS_A.length) {
if (_root.trailerBody.hitTest(AI_CARS_A[i].HIT) and (_root.trailerCon == true)) {
trailerHITandCON = true;
} else {
trailerHITandCON = false;
}
AI_CARS_A[i].window.gotoAndStop(Math.round(((AI_CARS_A[i]._rotation + 180) * 120) / 360));
if (_root.hero.hitTest(AI_CARS_A[i].HIT) or trailerHITandCON) {
AI_CARS_A[i].horn_timer--;
if ((AI_CARS_A[i].horn_timer <= 0) and (!AI_CARS_A[i].s12_start)) {
_root.s12.start();
AI_CARS_A[i].s12_start = true;
}
if (!s13_start) {
_root.s13.start();
s13_start = true;
}
}
i++;
}
if ((((AI_car_1._x <= (pos_A_1[currentPos][0] + 50)) && (AI_car_1._x >= (pos_A_1[currentPos][0] - 50))) && (AI_car_1._y <= (pos_A_1[currentPos][1] + 50))) && (AI_car_1._y >= (pos_A_1[currentPos][1] - 50))) {
if (currentPos == pos_A_1.length) {
currentPos = 0;
} else {
currentPos++;
}
}
var _local4 = rotation((pos_A_1[currentPos][0] + 15) - AI_car_1._x, (pos_A_1[currentPos][1] - 15) - AI_car_1._y);
var _local7 = Math.abs(_local4 - AI_car_1._rotation);
if (_local7 > 180) {
if (_local4 > AI_car_1._rotation) {
_local4 = _local4 - 360;
} else {
_local4 = _local4 + 360;
}
}
if (AI_car_1._rotation < (_local4 - 3)) {
AI_car_1._rotation = AI_car_1._rotation + 3;
} else if (AI_car_1._rotation > (_local4 + 3)) {
AI_car_1._rotation = AI_car_1._rotation - 3;
}
}
if ((_root.parked == true) and ((!_root.AI_light_2_AI_2.jim_stop) == true)) {
if ((((AI_car_2._x <= (pos_A_2[currentPos_2][0] + 50)) && (AI_car_2._x >= (pos_A_2[currentPos_2][0] - 50))) && (AI_car_2._y <= (pos_A_2[currentPos_2][1] + 50))) && (AI_car_2._y >= (pos_A_2[currentPos_2][1] - 50))) {
if (currentPos_2 == pos_A_2.length) {
currentPos_2 = 0;
} else {
currentPos_2++;
}
}
var _local2 = rotation((pos_A_2[currentPos_2][0] + 15) - AI_car_2._x, (pos_A_2[currentPos_2][1] - 15) - AI_car_2._y);
var _local6 = Math.abs(_local2 - AI_car_2._rotation);
if (_local6 > 180) {
if (_local2 > AI_car_2._rotation) {
_local2 = _local2 - 360;
} else {
_local2 = _local2 + 360;
}
}
if (AI_car_2._rotation < (_local2 - 3)) {
AI_car_2._rotation = AI_car_2._rotation + 3;
} else if (AI_car_2._rotation > (_local2 + 3)) {
AI_car_2._rotation = AI_car_2._rotation - 3;
}
}
if (go == true) {
if ((((AI_car_3._x <= (pos_A_3[currentPos_3][0] + 50)) && (AI_car_3._x >= (pos_A_3[currentPos_3][0] - 50))) && (AI_car_3._y <= (pos_A_3[currentPos_3][1] + 50))) && (AI_car_3._y >= (pos_A_3[currentPos_3][1] - 50))) {
if (currentPos_3 == pos_A_3.length) {
currentPos_3 = 0;
} else {
currentPos_3++;
}
}
var _local3 = rotation((pos_A_3[currentPos_3][0] + 15) - AI_car_3._x, (pos_A_3[currentPos_3][1] - 15) - AI_car_3._y);
var _local5 = Math.abs(_local3 - AI_car_3._rotation);
if (_local5 > 180) {
if (_local3 > AI_car_3._rotation) {
_local3 = _local3 - 360;
} else {
_local3 = _local3 + 360;
}
}
if (AI_car_3._rotation < (_local3 - 3)) {
AI_car_3._rotation = AI_car_3._rotation + 3;
} else if (AI_car_3._rotation > (_local3 + 3)) {
AI_car_3._rotation = AI_car_3._rotation - 3;
}
}
};
Symbol 613 MovieClip Frame 1 (8 B)
stop();
Symbol 624 MovieClip Frame 1 (5.59 KiB) ● ●
function rotation(dx, dy) {
return((Math.atan2(dy, dx) * 180) / Math.PI);
}
AI_speed = 7;
AI_car_1.horn_timer = 50000;
AI_car_2.horn_timer = 50000;
lose_delay = 75;
alarm_timer = 40;
alarm = false;
var AI_CARS_A = [AI_car_1, AI_car_2, AI_car_3, AI_car_4];
var pos_A_1 = new Array([5151, 972], [5647, 1181], [6016, 1203], [6817, 1250], [7152, 1351], [8805, 1933], [9064, 2103], [9665, 2526], [9894, 2604], [10375, 2764], [10628, 2727], [11465, 2567], [11304, 2416], [11102, 2416], [10440, 2571], [10270, 2530], [9764, 2379], [9622, 2274], [8900, 1774], [8717, 1705], [6910, 1077], [6681, 1059], [5711, 1013], [5522, 953], [5348, 876]);
var pos_A_2 = new Array([10071, -699], [10297, -672], [10842, -571], [11002, -452], [11348, -185], [11610, -123], [12708, 31], [12955, 158], [14157, 725], [14425, 710], [15008, 639], [14925, 508], [14648, 514], [14184, 547], [13877, 435], [12776, -137], [12526, -170], [11422, -345], [11238, -490], [10916, -731], [10645, -790], [10261, -864]);
var currentPos = 0;
var currentPos_2 = 0;
_root.police_lights._visible = false;
_root.police_lights_2._visible = false;
AI_car_1.gotoAndStop(4);
AI_car_2.gotoAndStop(4);
var MP = (Math.PI/180);
onEnterFrame = function () {
if ((!_root.Paused) == true) {
if (alarm) {
pos_A_1 = new Array([_root.hero._x, _root.hero._y]);
currentPos = 0;
pos_A_2 = new Array([_root.hero._x, _root.hero._y]);
currentPos_2 = 0;
lose_delay--;
if (lose_delay <= 0) {
_root.Paused = true;
_root.game_menu.game_level.gotoAndStop("lose");
}
}
AI_car_1._x = AI_car_1._x + (AI_speed * Math.cos(AI_car_1._rotation * MP));
AI_car_1._y = AI_car_1._y + (AI_speed * Math.sin(AI_car_1._rotation * MP));
AI_car_2._x = AI_car_2._x + (AI_speed * Math.cos(AI_car_2._rotation * MP));
AI_car_2._y = AI_car_2._y + (AI_speed * Math.sin(AI_car_2._rotation * MP));
if (AI_speed <= 0) {
AI_speed = 0;
}
if (((((!_root.hero.hitTest(AI_car_1.HIT)) and (!_root.hero.hitTest(AI_car_2.HIT))) and (!_root.hero.hitTest(AI_car_3.HIT))) and (!_root.hero.hitTest(AI_car_4.HIT))) and (!trailerHITandCON)) {
_root.s12.stop(["AI_horn"]);
AI_car_1.s12_start = false;
AI_car_2.s12_start = false;
AI_car_3.s12_start = false;
AI_car_4.s12_start = false;
AI_car_1.horn_timer = 50;
AI_car_2.horn_timer = 50;
AI_car_3.horn_timer = 50;
AI_car_4.horn_timer = 50;
AI_speed = AI_speed + 0.05;
if (AI_speed >= 3) {
s13_start = false;
AI_speed = 3;
}
} else if ((!AI_speed) <= 0) {
AI_speed = AI_speed - 0.2;
}
i = 0;
while (i < AI_CARS_A.length) {
if (_root.trailerBody.hitTest(AI_CARS_A[i].HIT) and (_root.trailerCon == true)) {
trailerHITandCON = true;
} else {
trailerHITandCON = false;
}
AI_CARS_A[i].window.gotoAndStop(Math.round(((AI_CARS_A[i]._rotation + 180) * 120) / 360));
if (_root.hero.hitTest(AI_CARS_A[i].HIT) or trailerHITandCON) {
AI_CARS_A[i].horn_timer--;
if ((AI_CARS_A[i].horn_timer <= 0) and (!AI_CARS_A[i].s12_start)) {
AI_CARS_A[i].s12_start = true;
}
if (!s13_start) {
_root.s13.start();
s13_start = true;
}
}
i++;
}
if (AI_car_1.hitTest(_root.game_menu)) {
alarm_timer--;
if ((alarm_timer <= 0) and AI_car_1.hitTest(_root.game_menu)) {
_root.police_lights._visible = true;
_root.police_lights_2._visible = true;
_root.police_lights_3._visible = true;
alarm = true;
if (!s22_start) {
_root.s22.start();
s22_start = true;
}
}
}
if ((((AI_car_1._x <= (pos_A_1[currentPos][0] + 50)) && (AI_car_1._x >= (pos_A_1[currentPos][0] - 50))) && (AI_car_1._y <= (pos_A_1[currentPos][1] + 50))) && (AI_car_1._y >= (pos_A_1[currentPos][1] - 50))) {
if (currentPos == pos_A_1.length) {
currentPos = 0;
} else {
currentPos++;
}
}
var _local3 = rotation((pos_A_1[currentPos][0] + 15) - AI_car_1._x, (pos_A_1[currentPos][1] - 15) - AI_car_1._y);
var _local5 = Math.abs(_local3 - AI_car_1._rotation);
if (_local5 > 180) {
if (_local3 > AI_car_1._rotation) {
_local3 = _local3 - 360;
} else {
_local3 = _local3 + 360;
}
}
if (AI_car_1._rotation < (_local3 - 3)) {
AI_car_1._rotation = AI_car_1._rotation + 3;
} else if (AI_car_1._rotation > (_local3 + 3)) {
AI_car_1._rotation = AI_car_1._rotation - 3;
}
}
if (AI_car_2.hitTest(_root.game_menu)) {
alarm_timer--;
if ((alarm_timer <= 0) and AI_car_2.hitTest(_root.game_menu)) {
_root.police_lights._visible = true;
_root.police_lights_2._visible = true;
_root.police_lights_3._visible = true;
alarm = true;
if (!s22_start) {
_root.s22.start();
s22_start = true;
}
}
}
if ((((AI_car_2._x <= (pos_A_2[currentPos_2][0] + 50)) && (AI_car_2._x >= (pos_A_2[currentPos_2][0] - 50))) && (AI_car_2._y <= (pos_A_2[currentPos_2][1] + 50))) && (AI_car_2._y >= (pos_A_2[currentPos_2][1] - 50))) {
if (currentPos_2 == pos_A_2.length) {
currentPos_2 = 0;
} else {
currentPos_2++;
}
}
var _local2 = rotation((pos_A_2[currentPos_2][0] + 15) - AI_car_2._x, (pos_A_2[currentPos_2][1] - 15) - AI_car_2._y);
var _local4 = Math.abs(_local2 - AI_car_2._rotation);
if (_local4 > 180) {
if (_local2 > AI_car_2._rotation) {
_local2 = _local2 - 360;
} else {
_local2 = _local2 + 360;
}
}
if (AI_car_2._rotation < (_local2 - 3)) {
AI_car_2._rotation = AI_car_2._rotation + 3;
} else if (AI_car_2._rotation > (_local2 + 3)) {
AI_car_2._rotation = AI_car_2._rotation - 3;
}
};
Symbol 630 MovieClip Frame 1 (1 B)
Symbol 636 MovieClip Frame 2 (8 B)
stop();
Instance of Symbol 636 MovieClip "park_area" in Symbol 638 MovieClip Frame 1 (44 B)
onClipEvent (load) {
this.gotoAndStop(2);
}
Symbol 640 MovieClip Frame 1 (8 B)
stop();
Symbol 641 MovieClip Frame 1 (5.79 KiB) ● ●
function rotation(dx, dy) {
return((Math.atan2(dy, dx) * 180) / Math.PI);
}
AI_speed_1 = 100;
AI_speed_2 = 100;
AI_car_1.horn_timer = 50;
AI_car_2.horn_timer = 50;
alarm = false;
alarm_timer = 150;
var AI_CARS_A = [AI_car_1, AI_car_2, AI_car_4];
var currentPos = 0;
var currentPos_2 = 0;
var currentPos_3 = 0;
var currentPos_4 = 0;
AI_car_1.gotoAndStop(18);
AI_car_2.gotoAndStop(18);
AI_car_3.gotoAndStop(random(16) + 1);
AI_car_4.gotoAndStop(random(16) + 1);
var MP = (Math.PI/180);
onEnterFrame = function () {
if (_root.trailerCon and (!_root.over_hit)) {
alarm_timer--;
if (((alarm_timer <= 0) and (!_root.ground.hitTest(_root.game_menu._x >= -600, _root.game_menu._y >= -600, true))) and (!_root.ground.hitTest(_root.game_menu._x <= 600, _root.game_menu._y <= 600, true))) {
alarm = true;
if (!text_play) {
_root.text_num = 8;
_root.game_menu.texts.play();
text_play = true;
}
}
}
if ((!_root.Paused) == true) {
if (AI_car_1.HIT.hitTest(AI_car_2.car) and AI_car_1.hitTest(_root.game_menu)) {
AI_speed_1 = 0;
}
if (AI_car_2.HIT.hitTest(AI_car_1.car) and AI_car_2.hitTest(_root.game_menu)) {
AI_speed_2 = 0;
}
if (AI_car_1.car.hitTest(_root.AI_follow)) {
var _local3 = new Array([_root.advance_HIT_2._x, _root.advance_HIT_2._y]);
} else {
var _local3 = new Array([_root.AI_follow._x, _root.AI_follow._y]);
}
if (AI_car_2.car.hitTest(_root.AI_follow_2)) {
var _local2 = new Array([_root.advance_HIT._x, _root.advance_HIT._y]);
} else {
var _local2 = new Array([_root.AI_follow_2._x, _root.AI_follow_2._y]);
}
if ((alarm == true) and (!_root.over_hit)) {
AI_car_1._x = AI_car_1._x + (AI_speed_1 * Math.cos(AI_car_1._rotation * MP));
AI_car_1._y = AI_car_1._y + (AI_speed_1 * Math.sin(AI_car_1._rotation * MP));
AI_car_2._x = AI_car_2._x + (AI_speed_2 * Math.cos(AI_car_2._rotation * MP));
AI_car_2._y = AI_car_2._y + (AI_speed_2 * Math.sin(AI_car_2._rotation * MP));
} else {
AI_speed_1 = 0;
AI_speed_2 = 0;
}
if (((((!_root.hero.hitTest(AI_car_1.HIT)) and (!_root.hero.hitTest(AI_car_2.HIT))) and (!_root.hero.hitTest(AI_car_3.HIT))) and (!_root.hero.hitTest(AI_car_4.HIT))) and (!trailerHITandCON)) {
_root.s12.stop(["AI_horn"]);
AI_car_1.s12_start = false;
AI_car_2.s12_start = false;
AI_car_3.s12_start = false;
AI_car_4.s12_start = false;
AI_car_1.horn_timer = 50;
AI_car_2.horn_timer = 50;
AI_car_3.horn_timer = 50;
AI_car_4.horn_timer = 50;
if (!AI_car_1.hitTest(_root.game_menu)) {
AI_speed_1 = AI_speed_1 + 0.035;
} else {
AI_speed_1 = AI_speed_1 + 0.2;
}
if (!AI_car_2.hitTest(_root.game_menu)) {
AI_speed_2 = AI_speed_2 + 0.035;
} else {
AI_speed_2 = AI_speed_2 + 0.2;
}
if ((AI_speed_1 >= 100) and (!AI_car_1.hitTest(_root.game_menu))) {
AI_speed_1 = 100;
} else if (((AI_speed_1 >= 35) and _root.road.hitTest(AI_car_1._x, AI_car_1._y, true)) and AI_car_1.hitTest(_root.game_menu)) {
s13_start = false;
AI_speed_1 = 35;
} else if (((AI_speed_1 >= 5) and AI_car_1.hitTest(_root.game_menu)) and (!_root.road.hitTest(AI_car_1._x, AI_car_1._y, true))) {
AI_speed_1 = 5;
}
if ((AI_speed_2 >= 100) and (!AI_car_2.hitTest(_root.game_menu))) {
AI_speed_2 = 100;
} else if (((AI_speed_2 >= 35) and _root.road.hitTest(AI_car_2._x, AI_car_2._y, true)) and AI_car_2.hitTest(_root.game_menu)) {
s13_start = false;
AI_speed_2 = 35;
} else if (((AI_speed_1 >= 5) and AI_car_2.hitTest(_root.game_menu)) and (!_root.road.hitTest(AI_car_2._x, AI_car_2._y, true))) {
AI_speed_2 = 5;
}
i = 0;
while (i < AI_CARS_A.length) {
if (_root.trailerBody.hitTest(AI_CARS_A[i].HIT) and (_root.trailerCon == true)) {
trailerHITandCON = true;
} else {
trailerHITandCON = false;
}
AI_CARS_A[i].window.gotoAndStop(Math.round(((AI_CARS_A[i]._rotation + 180) * 120) / 360));
i++;
}
if ((((AI_car_1._x <= (_local3[currentPos][0] + 50)) && (AI_car_1._x >= (_local3[currentPos][0] - 50))) && (AI_car_1._y <= (_local3[currentPos][1] + 50))) && (AI_car_1._y >= (_local3[currentPos][1] - 50))) {
if (currentPos == _local3.length) {
currentPos = 0;
} else {
currentPos++;
}
}
var _local5 = rotation((_local3[currentPos][0] + 15) - AI_car_1._x, (_local3[currentPos][1] - 15) - AI_car_1._y);
var _local7 = Math.abs(_local5 - AI_car_1._rotation);
if (_local7 > 180) {
if (!AI_car_1.hit.hitTest(_root.hero)) {
if (_local5 > AI_car_1._rotation) {
_local5 = _local5 - 360;
} else {
_local5 = _local5 + 360;
}
}
}
if (AI_car_1._rotation < (_local5 - 3)) {
AI_car_1._rotation = AI_car_1._rotation + 3;
} else if (AI_car_1._rotation > (_local5 + 3)) {
AI_car_1._rotation = AI_car_1._rotation - 3;
}
}
if ((((AI_car_2._x <= (_local2[currentPos_2][0] + 50)) && (AI_car_2._x >= (_local2[currentPos_2][0] - 50))) && (AI_car_2._y <= (_local2[currentPos_2][1] + 50))) && (AI_car_2._y >= (_local2[currentPos_2][1] - 50))) {
if (currentPos_2 == _local2.length) {
currentPos_2 = 0;
} else {
currentPos_2++;
}
}
var _local4 = rotation((_local2[currentPos_2][0] + 15) - AI_car_2._x, (_local2[currentPos_2][1] - 15) - AI_car_2._y);
var _local6 = Math.abs(_local4 - AI_car_2._rotation);
if (_local6 > 180) {
if (_local4 > AI_car_2._rotation) {
_local4 = _local4 - 360;
} else {
_local4 = _local4 + 360;
}
}
if (AI_car_2._rotation < (_local4 - 3)) {
AI_car_2._rotation = AI_car_2._rotation + 3;
} else if (AI_car_2._rotation > (_local4 + 3)) {
AI_car_2._rotation = AI_car_2._rotation - 3;
}
}
};
Symbol 644 MovieClip Frame 1 (8 B)
stop();
Instance of Symbol 478 MovieClip "window" in Symbol 648 MovieClip Frame 1 (36 B)
onClipEvent (load) {
this.stop();
}
Symbol 650 MovieClip Frame 1 (1 B)
Instance of Symbol 636 MovieClip "park_area" in Symbol 651 MovieClip Frame 1 (44 B)
onClipEvent (load) {
this.gotoAndStop(1);
}
Symbol 653 MovieClip Frame 1 (8 B)
stop();
Symbol 654 MovieClip Frame 1 (5.49 KiB) ● ●
function rotation(dx, dy) {
return((Math.atan2(dy, dx) * 180) / Math.PI);
}
AI_speed = 7;
AI_car_1.horn_timer = 50;
AI_car_2.horn_timer = 50;
var AI_CARS_A = [AI_car_1, AI_car_2, AI_car_4];
var pos_A_1 = new Array([5050, 3516], [4931, 3753], [4275, 4867], [3915, 5465], [3615, 5767], [3506, 5912], [3411, 6164], [3432, 6387], [3487, 6662], [3644, 6788], [3922, 6968], [4327, 6895], [4510, 6643], [4591, 6263], [4836, 6163], [6683, 5541], [8287, 5100], [8175, 4955], [7963, 4872]);
var pos_A_2 = new Array([5608, 5715], [4461, 6121], [4416, 6285], [4359, 6553], [4233, 6729], [3964, 6771], [3654, 6579], [3590, 6211], [3714, 5912], [3876, 5731], [4071, 5558], [4226, 5285], [4735, 4413], [5125, 3753], [5358, 3827], [6581, 4345], [7776, 4960], [7688, 5097], [7400, 5171], [6477, 5422]);
var currentPos = 0;
var currentPos_2 = 0;
var currentPos_3 = 0;
var currentPos_4 = 0;
AI_car_1.gotoAndStop(random(16) + 1);
AI_car_2.gotoAndStop(random(16) + 1);
AI_car_3.gotoAndStop(random(16) + 1);
AI_car_4.gotoAndStop(random(16) + 1);
var MP = (Math.PI/180);
onEnterFrame = function () {
if ((!_root.Paused) == true) {
AI_car_1._x = AI_car_1._x + (AI_speed * Math.cos(AI_car_1._rotation * MP));
AI_car_1._y = AI_car_1._y + (AI_speed * Math.sin(AI_car_1._rotation * MP));
AI_car_2._x = AI_car_2._x + (AI_speed * Math.cos(AI_car_2._rotation * MP));
AI_car_2._y = AI_car_2._y + (AI_speed * Math.sin(AI_car_2._rotation * MP));
AI_car_4._x = AI_car_4._x + (AI_speed * Math.cos(AI_car_4._rotation * MP));
AI_car_4._y = AI_car_4._y + (AI_speed * Math.sin(AI_car_4._rotation * MP));
if (AI_speed <= 0) {
AI_speed = 0;
}
if (((((!_root.hero.hitTest(AI_car_1.HIT)) and (!_root.hero.hitTest(AI_car_2.HIT))) and (!_root.hero.hitTest(AI_car_3.HIT))) and (!_root.hero.hitTest(AI_car_4.HIT))) and (!trailerHITandCON)) {
_root.s12.stop(["AI_horn"]);
AI_car_1.s12_start = false;
AI_car_2.s12_start = false;
AI_car_3.s12_start = false;
AI_car_4.s12_start = false;
AI_car_1.horn_timer = 50;
AI_car_2.horn_timer = 50;
AI_car_3.horn_timer = 50;
AI_car_4.horn_timer = 50;
AI_speed = AI_speed + 0.05;
if (AI_speed >= 3) {
s13_start = false;
AI_speed = 3;
}
} else if ((!AI_speed) <= 0) {
AI_speed = AI_speed - 0.2;
}
i = 0;
while (i < AI_CARS_A.length) {
if (_root.trailerBody.hitTest(AI_CARS_A[i].HIT) and (_root.trailerCon == true)) {
trailerHITandCON = true;
} else {
trailerHITandCON = false;
}
AI_CARS_A[i].window.gotoAndStop(Math.round(((AI_CARS_A[i]._rotation + 180) * 120) / 360));
if (_root.hero.hitTest(AI_CARS_A[i].HIT) or trailerHITandCON) {
AI_CARS_A[i].horn_timer--;
if ((AI_CARS_A[i].horn_timer <= 0) and (!AI_CARS_A[i].s12_start)) {
_root.s12.start();
AI_CARS_A[i].s12_start = true;
}
if (!s13_start) {
_root.s13.start();
s13_start = true;
}
}
i++;
}
if ((((AI_car_1._x <= (pos_A_1[currentPos][0] + 50)) && (AI_car_1._x >= (pos_A_1[currentPos][0] - 50))) && (AI_car_1._y <= (pos_A_1[currentPos][1] + 50))) && (AI_car_1._y >= (pos_A_1[currentPos][1] - 50))) {
if (currentPos == pos_A_1.length) {
currentPos = 0;
} else {
currentPos++;
}
}
var _local4 = rotation((pos_A_1[currentPos][0] + 15) - AI_car_1._x, (pos_A_1[currentPos][1] - 15) - AI_car_1._y);
var _local7 = Math.abs(_local4 - AI_car_1._rotation);
if (_local7 > 180) {
if (_local4 > AI_car_1._rotation) {
_local4 = _local4 - 360;
} else {
_local4 = _local4 + 360;
}
}
if (AI_car_1._rotation < (_local4 - 3)) {
AI_car_1._rotation = AI_car_1._rotation + 3;
} else if (AI_car_1._rotation > (_local4 + 3)) {
AI_car_1._rotation = AI_car_1._rotation - 3;
}
}
if ((((AI_car_2._x <= (pos_A_2[currentPos_2][0] + 50)) && (AI_car_2._x >= (pos_A_2[currentPos_2][0] - 50))) && (AI_car_2._y <= (pos_A_2[currentPos_2][1] + 50))) && (AI_car_2._y >= (pos_A_2[currentPos_2][1] - 50))) {
if (currentPos_2 == pos_A_2.length) {
currentPos_2 = 0;
} else {
currentPos_2++;
}
}
var _local2 = rotation((pos_A_2[currentPos_2][0] + 15) - AI_car_2._x, (pos_A_2[currentPos_2][1] - 15) - AI_car_2._y);
var _local6 = Math.abs(_local2 - AI_car_2._rotation);
if (_local6 > 180) {
if (_local2 > AI_car_2._rotation) {
_local2 = _local2 - 360;
} else {
_local2 = _local2 + 360;
}
}
if (AI_car_2._rotation < (_local2 - 3)) {
AI_car_2._rotation = AI_car_2._rotation + 3;
} else if (AI_car_2._rotation > (_local2 + 3)) {
AI_car_2._rotation = AI_car_2._rotation - 3;
}
if ((((AI_car_4._x <= (pos_A_4[currentPos_4][0] + 50)) && (AI_car_4._x >= (pos_A_4[currentPos_4][0] - 50))) && (AI_car_4._y <= (pos_A_4[currentPos_4][1] + 50))) && (AI_car_4._y >= (pos_A_4[currentPos_4][1] - 50))) {
if (currentPos_4 == pos_A_4.length) {
currentPos_4 = 0;
} else {
currentPos_4++;
}
}
var _local3 = rotation((pos_A_4[currentPos_4][0] + 15) - AI_car_4._x, (pos_A_4[currentPos_4][1] - 15) - AI_car_4._y);
var _local5 = Math.abs(_local3 - AI_car_4._rotation);
if (_local5 > 180) {
if (_local3 > AI_car_4._rotation) {
_local3 = _local3 - 460;
} else {
_local3 = _local3 + 460;
}
}
if (AI_car_4._rotation < (_local3 - 4)) {
AI_car_4._rotation = AI_car_4._rotation + 4;
} else if (AI_car_4._rotation > (_local3 + 4)) {
AI_car_4._rotation = AI_car_4._rotation - 4;
}
};
Symbol 666 MovieClip Frame 1 (1 B)
Symbol 676 MovieClip Frame 1 (8 B)
stop();
Symbol 676 MovieClip Frame 8 (8 B)
stop();
Symbol 682 MovieClip Frame 1 (8 B)
stop();
Instance of Symbol 680 MovieClip in Symbol 682 MovieClip Frame 1 (127 B)
onClipEvent (enterFrame) {
if (_root.game_menu.hitTest(this) and (!s25_start)) {
_root.s25.start();
s25_start = true;
}
}
Symbol 683 MovieClip Frame 1 (5.79 KiB) ● ●
function rotation(dx, dy) {
return((Math.atan2(dy, dx) * 180) / Math.PI);
}
AI_speed_1 = 100;
AI_speed_2 = 100;
AI_car_1.horn_timer = 50;
AI_car_2.horn_timer = 50;
alarm = false;
alarm_timer = 150;
var AI_CARS_A = [AI_car_1, AI_car_2, AI_car_4];
var currentPos = 0;
var currentPos_2 = 0;
var currentPos_3 = 0;
var currentPos_4 = 0;
AI_car_1.gotoAndStop(16);
AI_car_2.gotoAndStop(14);
AI_car_3.gotoAndStop(random(16) + 1);
AI_car_4.gotoAndStop(random(16) + 1);
var MP = (Math.PI/180);
onEnterFrame = function () {
if (_root.trailerCon and (!_root.over_hit)) {
alarm_timer--;
if (((alarm_timer <= 0) and (!_root.ground.hitTest(_root.game_menu._x >= -600, _root.game_menu._y >= -600, true))) and (!_root.ground.hitTest(_root.game_menu._x <= 600, _root.game_menu._y <= 600, true))) {
alarm = true;
if (!text_play) {
_root.text_num = 13;
_root.game_menu.texts.play();
text_play = true;
}
}
}
if ((!_root.Paused) == true) {
if (AI_car_1.HIT.hitTest(AI_car_2.car) and AI_car_1.hitTest(_root.game_menu)) {
AI_speed_1 = 0;
}
if (AI_car_2.HIT.hitTest(AI_car_1.car) and AI_car_2.hitTest(_root.game_menu)) {
AI_speed_2 = 0;
}
if (AI_car_1.car.hitTest(_root.AI_follow)) {
var _local3 = new Array([_root.advance_HIT_2._x, _root.advance_HIT_2._y]);
} else {
var _local3 = new Array([_root.AI_follow._x, _root.AI_follow._y]);
}
if (AI_car_2.car.hitTest(_root.AI_follow_2)) {
var _local2 = new Array([_root.advance_HIT._x, _root.advance_HIT._y]);
} else {
var _local2 = new Array([_root.AI_follow_2._x, _root.AI_follow_2._y]);
}
if ((alarm == true) and (!_root.over_hit)) {
AI_car_1._x = AI_car_1._x + (AI_speed_1 * Math.cos(AI_car_1._rotation * MP));
AI_car_1._y = AI_car_1._y + (AI_speed_1 * Math.sin(AI_car_1._rotation * MP));
AI_car_2._x = AI_car_2._x + (AI_speed_2 * Math.cos(AI_car_2._rotation * MP));
AI_car_2._y = AI_car_2._y + (AI_speed_2 * Math.sin(AI_car_2._rotation * MP));
} else {
AI_speed_1 = 0;
AI_speed_2 = 0;
}
if (((((!_root.hero.hitTest(AI_car_1.HIT)) and (!_root.hero.hitTest(AI_car_2.HIT))) and (!_root.hero.hitTest(AI_car_3.HIT))) and (!_root.hero.hitTest(AI_car_4.HIT))) and (!trailerHITandCON)) {
_root.s12.stop(["AI_horn"]);
AI_car_1.s12_start = false;
AI_car_2.s12_start = false;
AI_car_3.s12_start = false;
AI_car_4.s12_start = false;
AI_car_1.horn_timer = 50;
AI_car_2.horn_timer = 50;
AI_car_3.horn_timer = 50;
AI_car_4.horn_timer = 50;
if (!AI_car_1.hitTest(_root.game_menu)) {
AI_speed_1 = AI_speed_1 + 0.05;
} else {
AI_speed_1 = AI_speed_1 + 0.2;
}
if (!AI_car_2.hitTest(_root.game_menu)) {
AI_speed_2 = AI_speed_2 + 0.05;
} else {
AI_speed_2 = AI_speed_2 + 0.2;
}
if ((AI_speed_1 >= 100) and (!AI_car_1.hitTest(_root.game_menu))) {
AI_speed_1 = 100;
} else if (((AI_speed_1 >= 35) and _root.road.hitTest(AI_car_1._x, AI_car_1._y, true)) and AI_car_1.hitTest(_root.game_menu)) {
s13_start = false;
AI_speed_1 = 35;
} else if (((AI_speed_1 >= 5) and AI_car_1.hitTest(_root.game_menu)) and (!_root.road.hitTest(AI_car_1._x, AI_car_1._y, true))) {
AI_speed_1 = 5;
}
if ((AI_speed_2 >= 100) and (!AI_car_2.hitTest(_root.game_menu))) {
AI_speed_2 = 100;
} else if (((AI_speed_2 >= 35) and _root.road.hitTest(AI_car_2._x, AI_car_2._y, true)) and AI_car_2.hitTest(_root.game_menu)) {
s13_start = false;
AI_speed_2 = 35;
} else if (((AI_speed_1 >= 5) and AI_car_2.hitTest(_root.game_menu)) and (!_root.road.hitTest(AI_car_2._x, AI_car_2._y, true))) {
AI_speed_2 = 5;
}
i = 0;
while (i < AI_CARS_A.length) {
if (_root.trailerBody.hitTest(AI_CARS_A[i].HIT) and (_root.trailerCon == true)) {
trailerHITandCON = true;
} else {
trailerHITandCON = false;
}
AI_CARS_A[i].window.gotoAndStop(Math.round(((AI_CARS_A[i]._rotation + 180) * 120) / 360));
i++;
}
if ((((AI_car_1._x <= (_local3[currentPos][0] + 50)) && (AI_car_1._x >= (_local3[currentPos][0] - 50))) && (AI_car_1._y <= (_local3[currentPos][1] + 50))) && (AI_car_1._y >= (_local3[currentPos][1] - 50))) {
if (currentPos == _local3.length) {
currentPos = 0;
} else {
currentPos++;
}
}
var _local5 = rotation((_local3[currentPos][0] + 15) - AI_car_1._x, (_local3[currentPos][1] - 15) - AI_car_1._y);
var _local7 = Math.abs(_local5 - AI_car_1._rotation);
if (_local7 > 180) {
if (!AI_car_1.hit.hitTest(_root.hero)) {
if (_local5 > AI_car_1._rotation) {
_local5 = _local5 - 360;
} else {
_local5 = _local5 + 360;
}
}
}
if (AI_car_1._rotation < (_local5 - 3)) {
AI_car_1._rotation = AI_car_1._rotation + 3;
} else if (AI_car_1._rotation > (_local5 + 3)) {
AI_car_1._rotation = AI_car_1._rotation - 3;
}
}
if ((((AI_car_2._x <= (_local2[currentPos_2][0] + 50)) && (AI_car_2._x >= (_local2[currentPos_2][0] - 50))) && (AI_car_2._y <= (_local2[currentPos_2][1] + 50))) && (AI_car_2._y >= (_local2[currentPos_2][1] - 50))) {
if (currentPos_2 == _local2.length) {
currentPos_2 = 0;
} else {
currentPos_2++;
}
}
var _local4 = rotation((_local2[currentPos_2][0] + 15) - AI_car_2._x, (_local2[currentPos_2][1] - 15) - AI_car_2._y);
var _local6 = Math.abs(_local4 - AI_car_2._rotation);
if (_local6 > 180) {
if (_local4 > AI_car_2._rotation) {
_local4 = _local4 - 360;
} else {
_local4 = _local4 + 360;
}
}
if (AI_car_2._rotation < (_local4 - 3)) {
AI_car_2._rotation = AI_car_2._rotation + 3;
} else if (AI_car_2._rotation > (_local4 + 3)) {
AI_car_2._rotation = AI_car_2._rotation - 3;
}
}
};
Symbol 690 MovieClip Frame 1 (1 B)
Symbol 692 MovieClip Frame 1 (8 B)
stop();
Symbol 692 MovieClip Frame 8 (8 B)
stop();
Symbol 695 MovieClip Frame 1 (8 B)
stop();
Instance of Symbol 478 MovieClip in Symbol 698 MovieClip Frame 1 (36 B)
onClipEvent (load) {
this.stop();
}
Symbol 704 MovieClip Frame 1 (8 B)
stop();
Instance of Symbol 560 MovieClip "park_place" in Symbol 704 MovieClip Frame 1 (149 B)
onClipEvent (enterFrame) {
if (this.hitTest(_root.game_menu._x, _root.game_menu._y, true)) {
this._alpha = 40;
} else {
this._alpha = 100;
}
}
Instance of Symbol 577 MovieClip "arrow_arrive_2" in Symbol 704 MovieClip Frame 1 (44 B)
onClipEvent (load) {
this.gotoAndStop(2);
}
Symbol 705 MovieClip Frame 1 (2.88 KiB) ●
function rotation(dx, dy) {
return((Math.atan2(dy, dx) * 180) / Math.PI);
}
AI_speed = 7;
AI_car_1.horn_timer = 50;
AI_car_2.horn_timer = 50;
var AI_CARS_A = [AI_car_1, AI_car_2, AI_car_4];
var pos_A_1 = new Array([801, -99], [856, 285], [921, 680], [999, 1185], [1159, 1178], [1739, 1091], [2314, 1007], [2293, 883], [2145, 894], [1901, 933], [1137, 1046], [1098, 922], [1043, 571], [942, -103]);
var currentPos = 0;
AI_car_1.gotoAndStop(1);
var MP = (Math.PI/180);
onEnterFrame = function () {
if ((!_root.Paused) == true) {
AI_car_1._x = AI_car_1._x + (AI_speed * Math.cos(AI_car_1._rotation * MP));
AI_car_1._y = AI_car_1._y + (AI_speed * Math.sin(AI_car_1._rotation * MP));
if (AI_speed <= 0) {
AI_speed = 0;
}
if (((((!_root.hero.hitTest(AI_car_1.HIT)) and (!_root.hero.hitTest(AI_car_2.HIT))) and (!_root.hero.hitTest(AI_car_3.HIT))) and (!_root.hero.hitTest(AI_car_4.HIT))) and (!trailerHITandCON)) {
_root.s12.stop(["AI_horn"]);
AI_car_1.s12_start = false;
AI_car_2.s12_start = false;
AI_car_3.s12_start = false;
AI_car_4.s12_start = false;
AI_car_1.horn_timer = 50;
AI_car_2.horn_timer = 50;
AI_car_3.horn_timer = 50;
AI_car_4.horn_timer = 50;
AI_speed = AI_speed + 0.05;
if (AI_speed >= 3) {
s13_start = false;
AI_speed = 3;
}
} else if ((!AI_speed) <= 0) {
AI_speed = AI_speed - 0.2;
}
i = 0;
while (i < AI_CARS_A.length) {
if (_root.trailerBody.hitTest(AI_CARS_A[i].HIT) and (_root.trailerCon == true)) {
trailerHITandCON = true;
} else {
trailerHITandCON = false;
}
AI_CARS_A[i].window.gotoAndStop(Math.round(((AI_CARS_A[i]._rotation + 180) * 120) / 360));
if (_root.hero.hitTest(AI_CARS_A[i].HIT) or trailerHITandCON) {
AI_CARS_A[i].horn_timer--;
if ((AI_CARS_A[i].horn_timer <= 0) and (!AI_CARS_A[i].s12_start)) {
_root.s12.start();
AI_CARS_A[i].s12_start = true;
}
if (!s13_start) {
_root.s13.start();
s13_start = true;
}
}
i++;
}
if ((((AI_car_1._x <= (pos_A_1[currentPos][0] + 50)) && (AI_car_1._x >= (pos_A_1[currentPos][0] - 50))) && (AI_car_1._y <= (pos_A_1[currentPos][1] + 50))) && (AI_car_1._y >= (pos_A_1[currentPos][1] - 50))) {
if (currentPos == pos_A_1.length) {
currentPos = 0;
} else {
currentPos++;
}
}
var _local2 = rotation((pos_A_1[currentPos][0] + 15) - AI_car_1._x, (pos_A_1[currentPos][1] - 15) - AI_car_1._y);
var _local3 = Math.abs(_local2 - AI_car_1._rotation);
if (_local3 > 180) {
if (_local2 > AI_car_1._rotation) {
_local2 = _local2 - 360;
} else {
_local2 = _local2 + 360;
}
}
if (AI_car_1._rotation < (_local2 - 3)) {
AI_car_1._rotation = AI_car_1._rotation + 3;
} else if (AI_car_1._rotation > (_local2 + 3)) {
AI_car_1._rotation = AI_car_1._rotation - 3;
}
}
};
Symbol 708 MovieClip Frame 1 (39 B)
gotoAndStop(_root._currentframe - 49);
Instance of Symbol 494 MovieClip "road_1" in Symbol 708 MovieClip Frame 2 (46 B)
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 578 MovieClip "houses" in Symbol 708 MovieClip Frame 2 (46 B)
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 549 MovieClip "ground" in Symbol 708 MovieClip Frame 2 (46 B)
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 585 MovieClip "road_1" in Symbol 708 MovieClip Frame 4 (46 B)
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 604 MovieClip "houses" in Symbol 708 MovieClip Frame 4 (46 B)
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 607 MovieClip "ground" in Symbol 708 MovieClip Frame 4 (46 B)
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 620 MovieClip "road_1" in Symbol 708 MovieClip Frame 6 (46 B)
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 623 MovieClip "houses" in Symbol 708 MovieClip Frame 6 (46 B)
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 626 MovieClip "ground" in Symbol 708 MovieClip Frame 6 (46 B)
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 638 MovieClip "road_1" in Symbol 708 MovieClip Frame 8 (46 B)
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 640 MovieClip "houses" in Symbol 708 MovieClip Frame 8 (46 B)
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 645 MovieClip "ground" in Symbol 708 MovieClip Frame 8 (46 B)
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 651 MovieClip "road_1" in Symbol 708 MovieClip Frame 10 (46 B)
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 653 MovieClip "houses" in Symbol 708 MovieClip Frame 10 (46 B)
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 656 MovieClip "ground" in Symbol 708 MovieClip Frame 10 (46 B)
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 677 MovieClip "road_1" in Symbol 708 MovieClip Frame 12 (46 B)
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 682 MovieClip "houses" in Symbol 708 MovieClip Frame 12 (46 B)
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 685 MovieClip "ground" in Symbol 708 MovieClip Frame 12 (46 B)
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 698 MovieClip "road_1" in Symbol 708 MovieClip Frame 14 (46 B)
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 704 MovieClip "houses" in Symbol 708 MovieClip Frame 14 (46 B)
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 707 MovieClip "ground" in Symbol 708 MovieClip Frame 14 (46 B)
onClipEvent (load) {
this._visible = false;
}
Symbol 711 MovieClip Frame 1 (8 B)
stop();
Symbol 716 MovieClip Frame 1 (62 B)
if (_root.speed_1 == true) {
stop();
} else {
play();
}
Symbol 716 MovieClip Frame 10 (62 B)
if (_root.speed_2 == true) {
stop();
} else {
play();
}
Symbol 716 MovieClip Frame 20 (62 B)
if (_root.speed_3 == true) {
stop();
} else {
play();
}
Symbol 716 MovieClip Frame 30 (62 B)
if (_root.speed_2 == true) {
stop();
} else {
play();
}
Symbol 716 MovieClip Frame 41 (17 B)
gotoAndPlay (1);
Symbol 745 MovieClip Frame 1 (498 B)
stop();
canpress = true;
lastFrame = 8;
onEnterFrame = function () {
if ((((Key.isDown(32) and (canpress == true)) and (!(_currentframe === lastFrame))) and (_parent._parent._currentframe <= 35)) and (_parent._parent._currentframe >= 24)) {
gotoAndStop(_currentframe + 1);
_parent._parent.gotoAndPlay("contrast");
if (!s_start) {
_root.s16.start();
}
s_start = true;
canpress = false;
} else if (!Key.isDown(32)) {
s_start = false;
canpress = true;
}
};
Symbol 745 MovieClip Frame 8 (100 B)
_parent._parent.gotoAndPlay("finish");
_root.Paused = false;
_root.text_num = _root.text_num + 1;
Symbol 755 MovieClip Frame 1 (498 B)
stop();
canpress = true;
lastFrame = 7;
onEnterFrame = function () {
if ((((Key.isDown(32) and (canpress == true)) and (!(_currentframe === lastFrame))) and (_parent._parent._currentframe <= 35)) and (_parent._parent._currentframe >= 24)) {
gotoAndStop(_currentframe + 1);
_parent._parent.gotoAndPlay("contrast");
if (!s_start) {
_root.s16.start();
}
s_start = true;
canpress = false;
} else if (!Key.isDown(32)) {
s_start = false;
canpress = true;
}
};
Symbol 755 MovieClip Frame 7 (83 B)
_parent._parent.gotoAndPlay("finish");
_root.game_menu.game_level.gotoAndStop(2);
Symbol 773 MovieClip Frame 1 (499 B)
stop();
canpress = true;
lastFrame = 12;
onEnterFrame = function () {
if ((((Key.isDown(32) and (canpress == true)) and (!(_currentframe === lastFrame))) and (_parent._parent._currentframe <= 35)) and (_parent._parent._currentframe >= 24)) {
gotoAndStop(_currentframe + 1);
_parent._parent.gotoAndPlay("contrast");
if (!s_start) {
_root.s16.start();
}
s_start = true;
canpress = false;
} else if (!Key.isDown(32)) {
s_start = false;
canpress = true;
}
};
Symbol 773 MovieClip Frame 12 (62 B)
_parent._parent.gotoAndPlay("finish");
_root.Paused = false;
Symbol 776 MovieClip Frame 1 (498 B)
stop();
canpress = true;
lastFrame = 3;
onEnterFrame = function () {
if ((((Key.isDown(32) and (canpress == true)) and (!(_currentframe === lastFrame))) and (_parent._parent._currentframe <= 35)) and (_parent._parent._currentframe >= 24)) {
gotoAndStop(_currentframe + 1);
_parent._parent.gotoAndPlay("contrast");
if (!s_start) {
_root.s16.start();
}
s_start = true;
canpress = false;
} else if (!Key.isDown(32)) {
s_start = false;
canpress = true;
}
};
Symbol 776 MovieClip Frame 3 (83 B)
_parent._parent.gotoAndPlay("finish");
_root.game_menu.game_level.gotoAndStop(4);
Symbol 797 MovieClip Frame 1 (499 B)
stop();
canpress = true;
lastFrame = 10;
onEnterFrame = function () {
if ((((Key.isDown(32) and (canpress == true)) and (!(_currentframe === lastFrame))) and (_parent._parent._currentframe <= 35)) and (_parent._parent._currentframe >= 24)) {
gotoAndStop(_currentframe + 1);
_parent._parent.gotoAndPlay("contrast");
if (!s_start) {
_root.s16.start();
}
s_start = true;
canpress = false;
} else if (!Key.isDown(32)) {
s_start = false;
canpress = true;
}
};
Symbol 797 MovieClip Frame 10 (62 B)
_parent._parent.gotoAndPlay("finish");
_root.Paused = false;
Symbol 804 MovieClip Frame 1 (498 B)
stop();
canpress = true;
lastFrame = 7;
onEnterFrame = function () {
if ((((Key.isDown(32) and (canpress == true)) and (!(_currentframe === lastFrame))) and (_parent._parent._currentframe <= 35)) and (_parent._parent._currentframe >= 24)) {
gotoAndStop(_currentframe + 1);
_parent._parent.gotoAndPlay("contrast");
if (!s_start) {
_root.s16.start();
}
s_start = true;
canpress = false;
} else if (!Key.isDown(32)) {
s_start = false;
canpress = true;
}
};
Symbol 804 MovieClip Frame 7 (83 B)
_parent._parent.gotoAndPlay("finish");
_root.game_menu.game_level.gotoAndStop(2);
Symbol 814 MovieClip Frame 1 (498 B)
stop();
canpress = true;
lastFrame = 7;
onEnterFrame = function () {
if ((((Key.isDown(32) and (canpress == true)) and (!(_currentframe === lastFrame))) and (_parent._parent._currentframe <= 35)) and (_parent._parent._currentframe >= 24)) {
gotoAndStop(_currentframe + 1);
_parent._parent.gotoAndPlay("contrast");
if (!s_start) {
_root.s16.start();
}
s_start = true;
canpress = false;
} else if (!Key.isDown(32)) {
s_start = false;
canpress = true;
}
};
Symbol 814 MovieClip Frame 7 (62 B)
_parent._parent.gotoAndPlay("finish");
_root.Paused = false;
Symbol 818 MovieClip Frame 1 (498 B)
stop();
canpress = true;
lastFrame = 4;
onEnterFrame = function () {
if ((((Key.isDown(32) and (canpress == true)) and (!(_currentframe === lastFrame))) and (_parent._parent._currentframe <= 35)) and (_parent._parent._currentframe >= 24)) {
gotoAndStop(_currentframe + 1);
_parent._parent.gotoAndPlay("contrast");
if (!s_start) {
_root.s16.start();
}
s_start = true;
canpress = false;
} else if (!Key.isDown(32)) {
s_start = false;
canpress = true;
}
};
Symbol 818 MovieClip Frame 4 (62 B)
_parent._parent.gotoAndPlay("finish");
_root.Paused = false;
Symbol 823 MovieClip Frame 1 (498 B)
stop();
canpress = true;
lastFrame = 5;
onEnterFrame = function () {
if ((((Key.isDown(32) and (canpress == true)) and (!(_currentframe === lastFrame))) and (_parent._parent._currentframe <= 35)) and (_parent._parent._currentframe >= 24)) {
gotoAndStop(_currentframe + 1);
_parent._parent.gotoAndPlay("contrast");
if (!s_start) {
_root.s16.start();
}
s_start = true;
canpress = false;
} else if (!Key.isDown(32)) {
s_start = false;
canpress = true;
}
};
Symbol 823 MovieClip Frame 5 (105 B)
_root.Paused = true;
_parent._parent.gotoAndPlay("finish");
_root.game_menu.game_level.gotoAndStop(2);
Symbol 832 MovieClip Frame 1 (498 B)
stop();
canpress = true;
lastFrame = 5;
onEnterFrame = function () {
if ((((Key.isDown(32) and (canpress == true)) and (!(_currentframe === lastFrame))) and (_parent._parent._currentframe <= 35)) and (_parent._parent._currentframe >= 24)) {
gotoAndStop(_currentframe + 1);
_parent._parent.gotoAndPlay("contrast");
if (!s_start) {
_root.s16.start();
}
s_start = true;
canpress = false;
} else if (!Key.isDown(32)) {
s_start = false;
canpress = true;
}
};
Symbol 832 MovieClip Frame 5 (62 B)
_root.Paused = false;
_parent._parent.gotoAndPlay("finish");
Symbol 839 MovieClip Frame 1 (498 B)
stop();
canpress = true;
lastFrame = 7;
onEnterFrame = function () {
if ((((Key.isDown(32) and (canpress == true)) and (!(_currentframe === lastFrame))) and (_parent._parent._currentframe <= 35)) and (_parent._parent._currentframe >= 24)) {
gotoAndStop(_currentframe + 1);
_parent._parent.gotoAndPlay("contrast");
if (!s_start) {
_root.s16.start();
}
s_start = true;
canpress = false;
} else if (!Key.isDown(32)) {
s_start = false;
canpress = true;
}
};
Symbol 839 MovieClip Frame 7 (113 B)
_root.Paused = true;
_root.attachMovie("darker", "darker_2", 1000000000, {_x:_root.over._x, _y:_root.over._y});
Symbol 855 MovieClip Frame 1 (499 B)
stop();
canpress = true;
lastFrame = 10;
onEnterFrame = function () {
if ((((Key.isDown(32) and (canpress == true)) and (!(_currentframe === lastFrame))) and (_parent._parent._currentframe <= 35)) and (_parent._parent._currentframe >= 24)) {
gotoAndStop(_currentframe + 1);
_parent._parent.gotoAndPlay("contrast");
if (!s_start) {
_root.s16.start();
}
s_start = true;
canpress = false;
} else if (!Key.isDown(32)) {
s_start = false;
canpress = true;
}
};
Symbol 855 MovieClip Frame 10 (106 B)
_root.Paused = false;
_parent._parent.gotoAndPlay("finish");
_root.game_menu.game_level.gotoAndStop(5);
Symbol 868 MovieClip Frame 1 (499 B)
stop();
canpress = true;
lastFrame = 10;
onEnterFrame = function () {
if ((((Key.isDown(32) and (canpress == true)) and (!(_currentframe === lastFrame))) and (_parent._parent._currentframe <= 35)) and (_parent._parent._currentframe >= 24)) {
gotoAndStop(_currentframe + 1);
_parent._parent.gotoAndPlay("contrast");
if (!s_start) {
_root.s16.start();
}
s_start = true;
canpress = false;
} else if (!Key.isDown(32)) {
s_start = false;
canpress = true;
}
};
Symbol 868 MovieClip Frame 10 (62 B)
_root.Paused = false;
_parent._parent.gotoAndPlay("finish");
Symbol 871 MovieClip Frame 1 (498 B)
stop();
canpress = true;
lastFrame = 3;
onEnterFrame = function () {
if ((((Key.isDown(32) and (canpress == true)) and (!(_currentframe === lastFrame))) and (_parent._parent._currentframe <= 35)) and (_parent._parent._currentframe >= 24)) {
gotoAndStop(_currentframe + 1);
_parent._parent.gotoAndPlay("contrast");
if (!s_start) {
_root.s16.start();
}
s_start = true;
canpress = false;
} else if (!Key.isDown(32)) {
s_start = false;
canpress = true;
}
};
Symbol 871 MovieClip Frame 3 (105 B)
_root.Paused = true;
_parent._parent.gotoAndPlay("finish");
_root.game_menu.game_level.gotoAndStop(2);
Symbol 885 MovieClip Frame 1 (499 B)
stop();
canpress = true;
lastFrame = 10;
onEnterFrame = function () {
if ((((Key.isDown(32) and (canpress == true)) and (!(_currentframe === lastFrame))) and (_parent._parent._currentframe <= 35)) and (_parent._parent._currentframe >= 24)) {
gotoAndStop(_currentframe + 1);
_parent._parent.gotoAndPlay("contrast");
if (!s_start) {
_root.s16.start();
}
s_start = true;
canpress = false;
} else if (!Key.isDown(32)) {
s_start = false;
canpress = true;
}
};
Symbol 885 MovieClip Frame 10 (62 B)
_root.Paused = false;
_parent._parent.gotoAndPlay("finish");
Symbol 886 MovieClip Frame 1 (38 B)
stop();
gotoAndStop(_root.text_num);
Instance of Symbol 886 MovieClip in Symbol 887 MovieClip Frame 1 (46 B)
onClipEvent (load) {
this._visible = false;
}
Symbol 887 MovieClip Frame 7 (93 B)
if (_root.sound_ON == true) {
_root.s1.setVolume(80);
}
_root.score = _root.score - 100;
Symbol 887 MovieClip Frame 10 (81 B)
_root.Paused = true;
if (_root.sound_ON == true) {
_root.s1.setVolume(50);
}
Symbol 887 MovieClip Frame 13 (59 B)
if (_root.sound_ON == true) {
_root.s1.setVolume(30);
}
Symbol 887 MovieClip Frame 18 (8 B)
play();
Symbol 887 MovieClip Frame 19 (8 B)
play();
Symbol 887 MovieClip Frame 20 (8 B)
play();
Symbol 887 MovieClip Frame 21 (8 B)
play();
Symbol 887 MovieClip Frame 22 (8 B)
play();
Symbol 887 MovieClip Frame 23 (8 B)
play();
Symbol 887 MovieClip Frame 24 (8 B)
play();
Symbol 887 MovieClip Frame 25 (8 B)
play();
Symbol 887 MovieClip Frame 26 (8 B)
play();
Symbol 887 MovieClip Frame 35 (8 B)
stop();
Symbol 887 MovieClip Frame 45 (59 B)
if (_root.sound_ON == true) {
_root.s1.setVolume(50);
}
Symbol 887 MovieClip Frame 48 (59 B)
if (_root.sound_ON == true) {
_root.s1.setVolume(80);
}
Symbol 887 MovieClip Frame 52 (256 B)
if (_root.sound_ON == true) {
_root.s1.setVolume(100);
}
stop();
if (!_root.tutorial) {
_parent.help.gotoAndStop(_parent.help._currentframe + 1);
}
if (_root._currentframe == 52) {
_root.game_menu.help.gotoAndStop(6);
}
_root.hitting = true;
Symbol 893 MovieClip Frame 186 (48 B)
_parent.gotoAndStop(_parent._currentframe + 1);
Symbol 897 MovieClip Frame 81 (8 B)
stop();
Symbol 898 MovieClip Frame 1 (8 B)
stop();
Symbol 898 MovieClip Frame 2 (17 B)
this._alpha = 0;
Symbol 898 MovieClip Frame 3 (17 B)
this._alpha = 0;
Symbol 898 MovieClip Frame 4 (17 B)
this._alpha = 0;
Symbol 898 MovieClip Frame 5 (32 B)
stop();
_root.tutorial = true;
Symbol 898 MovieClip Frame 6 (17 B)
this._alpha = 0;
Symbol 898 MovieClip Frame 7 (17 B)
this._alpha = 0;
Symbol 898 MovieClip Frame 8 (18 B)
this._alpha = 80;
Symbol 898 MovieClip Frame 9 (8 B)
stop();
Symbol 898 MovieClip Frame 15 (8 B)
stop();
Symbol 906 MovieClip Frame 1 (39 B)
gotoAndStop(_root._currentframe - 49);
Symbol 907 MovieClip Frame 101 (8 B)
stop();
Symbol 912 MovieClip Frame 1 (8 B)
stop();
Symbol 919 MovieClip Frame 1 (8 B)
stop();
Symbol 919 MovieClip Frame 25 (8 B)
stop();
Symbol 920 MovieClip Frame 1 (1.91 KiB) ●
onEnterFrame = function () {
if (_parent._parent._parent._currentframe == 20) {
if (resume_btn.hitTest(white) and (resume_btn._currentframe == 1)) {
resume_btn.play();
_root.s15.start();
} else if ((!resume_btn.hitTest(white)) and (resume_btn._currentframe == 25)) {
resume_btn.gotoAndStop(1);
}
if (more_games_btn.hitTest(white) and (more_games_btn._currentframe == 1)) {
more_games_btn.play();
_root.s15.start();
} else if ((!more_games_btn.hitTest(white)) and (more_games_btn._currentframe == 25)) {
more_games_btn.gotoAndStop(1);
}
if (your_web_btn.hitTest(white) and (your_web_btn._currentframe == 1)) {
your_web_btn.play();
_root.s15.start();
} else if ((!your_web_btn.hitTest(white)) and (your_web_btn._currentframe == 25)) {
your_web_btn.gotoAndStop(1);
}
if (wheeler_1_btn.hitTest(white) and (wheeler_1_btn._currentframe == 1)) {
wheeler_1_btn.play();
_root.s15.start();
} else if ((!wheeler_1_btn.hitTest(white)) and (wheeler_1_btn._currentframe == 25)) {
wheeler_1_btn.gotoAndStop(1);
}
if (wheeler_2_btn.hitTest(white) and (wheeler_2_btn._currentframe == 1)) {
wheeler_2_btn.play();
_root.s15.start();
} else if ((!wheeler_2_btn.hitTest(white)) and (wheeler_2_btn._currentframe == 25)) {
wheeler_2_btn.gotoAndStop(1);
}
}
onMouseDown = function () {
if (resume_btn.hitTest(white)) {
_root.Paused = false;
_parent._parent._parent.play();
}
if (more_games_btn.hitTest(white)) {
_root.FogAD.trackClick("moregames");
_root.s16.start();
}
if (your_web_btn.hitTest(white)) {
getURL ("http://www.freegamesforyourwebsite.com/?18wheeler3", "_blank");
_root.s16.start();
}
if (wheeler_1_btn.hitTest(white)) {
_root.FogAD.trackClick("moregames");
_root.s16.start();
}
if (wheeler_2_btn.hitTest(white)) {
_root.FogAD.trackClick("moregames");
_root.s16.start();
}
};
};
Instance of Symbol 241 MovieClip "white" in Symbol 920 MovieClip Frame 1 (93 B)
onClipEvent (load) {
this._y = 0;
}
onClipEvent (enterFrame) {
this._y = _parent._ymouse;
}
Symbol 924 MovieClip Frame 1 (28 B)
can_pause = true;
stop();
Symbol 924 MovieClip Frame 2 (19 B)
can_pause = false;
Symbol 924 MovieClip Frame 6 (59 B)
if (_root.sound_ON == true) {
_root.s1.setVolume(80);
}
Symbol 924 MovieClip Frame 10 (59 B)
if (_root.sound_ON == true) {
_root.s1.setVolume(50);
}
Symbol 924 MovieClip Frame 14 (59 B)
if (_root.sound_ON == true) {
_root.s1.setVolume(30);
}
Symbol 924 MovieClip Frame 17 (81 B)
_root.Paused = true;
if (_root.sound_ON == true) {
_root.s1.setVolume(10);
}
Symbol 924 MovieClip Frame 20 (89 B)
can_unpause = true;
if (_root.sound_ON == true) {
_root.s1.setVolume(0);
}
stop();
Symbol 924 MovieClip Frame 21 (21 B)
can_unpause = false;
Symbol 924 MovieClip Frame 23 (59 B)
if (_root.sound_ON == true) {
_root.s1.setVolume(10);
}
Symbol 924 MovieClip Frame 26 (59 B)
if (_root.sound_ON == true) {
_root.s1.setVolume(30);
}
Symbol 924 MovieClip Frame 29 (59 B)
if (_root.sound_ON == true) {
_root.s1.setVolume(50);
}
Symbol 924 MovieClip Frame 32 (59 B)
if (_root.sound_ON == true) {
_root.s1.setVolume(80);
}
Symbol 924 MovieClip Frame 35 (79 B)
if (_root.sound_ON == true) {
_root.s1.setVolume(100);
}
gotoAndStop (1);
Instance of Symbol 51 MovieClip in Symbol 925 MovieClip Frame 1 (70 B)
on (release) {
getURL ("http://www.freeonlinegames.com", "_blank");
}
Instance of Symbol 51 MovieClip in Symbol 925 MovieClip Frame 1 (70 B)
on (release) {
getURL ("http://www.freeonlinegames.com", "_blank");
}
Symbol 926 MovieClip Frame 1 (8 B)
stop();
Instance of Symbol 926 MovieClip in Symbol 927 MovieClip Frame 3 (295 B)
onClipEvent (load) {
gotoAndStop (20);
}
onClipEvent (enterFrame) {
if (_root.hero.hitTest(_root.houses) and (!red)) {
this.gotoAndPlay(21);
red = true;
blue = false;
} else if ((!_root.hero.hitTest(_root.houses)) and (!blue)) {
this.gotoAndPlay(2);
blue = true;
red = false;
}
}
Instance of Symbol 926 MovieClip in Symbol 927 MovieClip Frame 5 (295 B)
onClipEvent (load) {
gotoAndStop (20);
}
onClipEvent (enterFrame) {
if (_root.hero.hitTest(_root.houses) and (!red)) {
this.gotoAndPlay(21);
red = true;
blue = false;
} else if ((!_root.hero.hitTest(_root.houses)) and (!blue)) {
this.gotoAndPlay(2);
blue = true;
red = false;
}
}
Symbol 939 MovieClip Frame 20 (17 B)
gotoAndPlay (1);
Symbol 940 MovieClip Frame 1 (8 B)
stop();
Symbol 940 MovieClip Frame 38 (8 B)
stop();
Symbol 943 MovieClip Frame 1 (27 B)
stop();
jim_stop = false;
Symbol 943 MovieClip Frame 38 (98 B)
stop();
jim_stop = true;
_root.game_menu.help.gotoAndStop(8);
_root.park_area.gotoAndStop(25);
Instance of Symbol 946 MovieClip in Symbol 947 MovieClip Frame 1 (124 B)
onClipEvent (enterFrame) {
this._x = this._x - (_root.car.engineSpd / 2);
if (this._x <= -900) {
this._x = -100;
}
}
Symbol 948 MovieClip Frame 1 (8 B)
stop();
Instance of Symbol 946 MovieClip in Symbol 948 MovieClip Frame 1 (102 B)
onClipEvent (enterFrame) {
this._x = this._x - 0.5;
if (this._x <= -900) {
this._x = -100;
}
}
Symbol 954 Button (53 B)
on (release) {
_parent.play();
_root.s16.start();
}
Instance of Symbol 478 MovieClip in Symbol 960 MovieClip Frame 1 (36 B)
onClipEvent (load) {
this.stop();
}
Symbol 962 MovieClip Frame 1 (8 B)
stop();
Symbol 962 MovieClip Frame 25 (8 B)
stop();
Symbol 964 MovieClip Frame 1 (8 B)
stop();
Symbol 964 MovieClip Frame 25 (8 B)
stop();
Symbol 965 MovieClip Frame 1 (2.23 KiB) ●
onEnterFrame = function () {
_root.volumeBegin++;
if (_parent._currentframe == 30) {
if (play_again_btn.hitTest(white) and (play_again_btn._currentframe == 1)) {
play_again_btn.play();
_root.s15.start();
} else if ((!play_again_btn.hitTest(white)) and (play_again_btn._currentframe == 25)) {
play_again_btn.gotoAndStop(1);
}
if (credits_btn.hitTest(white) and (credits_btn._currentframe == 1)) {
credits_btn.play();
_root.s15.start();
} else if ((!credits_btn.hitTest(white)) and (credits_btn._currentframe == 25)) {
credits_btn.gotoAndStop(1);
}
if (more_games_btn.hitTest(white) and (more_games_btn._currentframe == 1)) {
more_games_btn.play();
_root.s15.start();
} else if ((!more_games_btn.hitTest(white)) and (more_games_btn._currentframe == 25)) {
more_games_btn.gotoAndStop(1);
}
if (your_web_btn.hitTest(white) and (your_web_btn._currentframe == 1)) {
your_web_btn.play();
_root.s15.start();
} else if ((!your_web_btn.hitTest(white)) and (your_web_btn._currentframe == 25)) {
your_web_btn.gotoAndStop(1);
}
if (wheeler_1_btn.hitTest(white) and (wheeler_1_btn._currentframe == 1)) {
wheeler_1_btn.play();
_root.s15.start();
} else if ((!wheeler_1_btn.hitTest(white)) and (wheeler_1_btn._currentframe == 25)) {
wheeler_1_btn.gotoAndStop(1);
}
if (wheeler_2_btn.hitTest(white) and (wheeler_2_btn._currentframe == 1)) {
wheeler_2_btn.play();
_root.s15.start();
} else if ((!wheeler_2_btn.hitTest(white)) and (wheeler_2_btn._currentframe == 25)) {
wheeler_2_btn.gotoAndStop(1);
}
}
};
onMouseDown = function () {
if (play_again_btn.hitTest(white)) {
_root.s16.start();
_parent.gotoAndPlay(91);
}
if (credits_btn.hitTest(white)) {
_parent.play();
_root.s16.start();
}
if (more_games_btn.hitTest(white)) {
_root.FogAD.trackClick("moregames");
_root.s16.start();
}
if (your_web_btn.hitTest(white)) {
getURL ("http://www.freegamesforyourwebsite.com/?18wheeler3", "_blank");
_root.s16.start();
}
if (wheeler_1_btn.hitTest(white)) {
_root.FogAD.trackClick("moregames");
_root.s16.start();
}
if (wheeler_2_btn.hitTest(white)) {
_root.FogAD.trackClick("moregames");
_root.s16.start();
}
};
Instance of Symbol 241 MovieClip "white" in Symbol 965 MovieClip Frame 1 (93 B)
onClipEvent (load) {
this._y = 0;
}
onClipEvent (enterFrame) {
this._y = _parent._ymouse;
}
Symbol 976 Button (119 B)
on (release) {
_root.s16.start();
getURL ("http://www.freeonlinegames.com/arcade-games/18-wheeler.html", "_blank");
}
Symbol 980 Button (122 B)
on (release) {
_root.s16.start();
getURL ("http://www.freeonlinegames.com/racing-games/18-wheeler--2.html", "_blank");
}
Symbol 984 Button (60 B)
on (release) {
_root.s16.start();
_root.gotoAndStop(15);
}
Symbol 990 Button (83 B)
on (release) {
_root.for_fun = true;
_root.s16.start();
_root.gotoAndStop(40);
}
Symbol 994 Button (70 B)
on (release) {
getURL ("http://www.fog.com/?18wheeler3", "_blank");
}
Symbol 996 MovieClip Frame 1 (45 B)
if (_root.for_fun) {
gotoAndStop (120);
}
Symbol 996 MovieClip Frame 14 (8 B)
stop();
Symbol 996 MovieClip Frame 30 (8 B)
stop();
Symbol 996 MovieClip Frame 58 (8 B)
stop();
Symbol 996 MovieClip Frame 89 (18 B)
gotoAndStop (30);
Symbol 996 MovieClip Frame 120 (8 B)
stop();
Instance of Symbol 948 MovieClip in Symbol 997 MovieClip Frame 1 (22 B)
onClipEvent (load) {
}