Combined Code
movieClip 2 {
}
movieClip 3 mcActionGame {
instance of movieClip 2 {
onClipEvent (load) {
_visible = false;
}
}
}
movieClip 4 mcActionMenu {
#initclip
Object.registerClass('mcActionMenu', CActionMenu);
#endinitclip
instance of movieClip 2 {
onClipEvent (load) {
_visible = false;
}
}
}
movieClip 9 {
}
movieClip 10 {
}
movieClip 11 {
}
movieClip 12 {
}
movieClip 13 {
}
movieClip 15 {
}
movieClip 20 {
}
movieClip 23 {
}
movieClip 26 {
}
movieClip 28 {
}
movieClip 31 {
}
movieClip 33 {
}
movieClip 35 {
}
movieClip 37 {
}
movieClip 40 {
}
movieClip 43 {
}
movieClip 46 {
}
movieClip 49 {
}
movieClip 52 {
}
movieClip 55 {
}
movieClip 58 {
}
movieClip 61 {
}
movieClip 63 {
}
movieClip 66 {
}
movieClip 68 {
}
movieClip 70 {
}
movieClip 72 {
}
movieClip 75 {
}
movieClip 80 {
}
movieClip 83 {
}
movieClip 86 {
}
movieClip 89 {
}
movieClip 92 {
}
movieClip 95 {
}
movieClip 98 {
}
movieClip 101 {
}
movieClip 104 {
}
movieClip 107 {
}
movieClip 110 {
}
movieClip 113 {
}
movieClip 116 {
}
movieClip 119 {
}
movieClip 122 {
}
movieClip 125 {
}
movieClip 128 {
}
movieClip 131 {
}
movieClip 136 {
}
movieClip 139 {
}
movieClip 142 {
}
movieClip 145 {
}
movieClip 148 {
}
movieClip 151 {
}
movieClip 154 {
}
movieClip 157 {
}
movieClip 160 {
}
movieClip 163 {
}
movieClip 166 {
}
movieClip 169 {
}
movieClip 174 {
}
movieClip 177 {
}
movieClip 180 {
}
movieClip 183 {
}
movieClip 186 {
}
movieClip 189 {
}
movieClip 192 {
}
movieClip 195 {
}
movieClip 198 {
}
movieClip 200 {
}
movieClip 202 {
}
movieClip 206 {
}
movieClip 211 {
}
movieClip 212 {
}
movieClip 215 {
}
movieClip 220 {
}
movieClip 221 {
}
movieClip 224 {
}
movieClip 225 {
}
movieClip 226 {
}
movieClip 229 {
}
movieClip 232 {
}
movieClip 235 {
}
movieClip 238 {
}
movieClip 241 {
}
movieClip 244 {
}
movieClip 247 {
}
movieClip 252 {
}
movieClip 253 {
}
movieClip 254 mcBonus {
frame 1 {
stop();
}
frame 21 {
stop();
}
}
movieClip 256 {
}
movieClip 257 mcTrack_6 {
}
movieClip 261 {
}
movieClip 263 {
}
movieClip 265 {
}
movieClip 267 {
}
movieClip 271 {
}
movieClip 275 {
}
movieClip 278 {
}
movieClip 284 {
}
movieClip 287 {
}
movieClip 290 {
}
movieClip 293 {
}
movieClip 296 {
}
movieClip 299 {
}
movieClip 302 {
}
movieClip 305 {
}
movieClip 308 {
}
movieClip 311 {
}
movieClip 314 {
}
movieClip 317 {
}
movieClip 320 {
}
movieClip 323 {
}
movieClip 326 {
}
movieClip 329 {
}
movieClip 332 {
}
movieClip 335 {
}
movieClip 338 {
}
movieClip 341 {
}
movieClip 344 {
}
movieClip 347 {
}
movieClip 350 {
}
movieClip 353 {
}
movieClip 356 {
}
movieClip 359 {
}
movieClip 362 {
}
movieClip 365 {
}
movieClip 370 {
}
movieClip 373 {
}
movieClip 375 {
}
movieClip 377 {
}
movieClip 379 {
}
movieClip 382 {
}
movieClip 385 {
}
movieClip 388 {
}
movieClip 391 {
}
movieClip 394 {
}
movieClip 397 {
}
movieClip 400 {
}
movieClip 403 {
}
movieClip 406 {
}
movieClip 408 {
}
movieClip 409 mcTrack_5 {
}
movieClip 413 {
}
movieClip 416 {
}
movieClip 420 {
}
movieClip 422 {
}
movieClip 424 {
}
movieClip 426 {
}
movieClip 428 {
}
movieClip 431 {
}
movieClip 433 {
}
movieClip 436 {
}
movieClip 439 {
}
movieClip 442 {
}
movieClip 443 {
}
movieClip 445 {
}
movieClip 447 {
}
movieClip 449 {
}
movieClip 452 {
}
movieClip 455 {
}
movieClip 457 {
}
movieClip 458 mcTrack_4 {
}
movieClip 461 {
}
movieClip 464 {
}
movieClip 467 {
}
movieClip 470 {
}
movieClip 473 {
}
movieClip 476 {
}
movieClip 479 {
}
movieClip 481 {
}
movieClip 484 {
}
movieClip 487 {
}
movieClip 489 {
}
movieClip 492 {
}
movieClip 494 {
}
movieClip 495 mcTrack_3 {
}
movieClip 499 {
}
movieClip 502 {
}
movieClip 507 {
}
movieClip 510 {
}
movieClip 513 {
}
movieClip 516 {
}
movieClip 517 {
}
movieClip 520 {
}
movieClip 522 {
}
movieClip 525 {
}
movieClip 526 mcTrack_2 {
}
movieClip 530 {
}
movieClip 533 {
}
movieClip 535 {
}
movieClip 537 {
}
movieClip 538 mcTrack_1 {
}
movieClip 540 {
}
movieClip 541 {
}
movieClip 542 mcCarShadow_Mini {
}
movieClip 544 {
}
movieClip 545 {
}
movieClip 546 mcCarYellow_Mini {
}
movieClip 548 {
}
movieClip 549 {
}
movieClip 550 mcCarRed_Mini {
}
movieClip 552 {
}
movieClip 553 {
}
movieClip 554 mcCarOrange_mini {
}
movieClip 556 {
}
movieClip 557 {
}
movieClip 558 mcCarGreen_Mini {
}
movieClip 560 {
}
movieClip 561 {
}
movieClip 562 mcCarBlue_Mini {
}
movieClip 564 mcCode2 {
}
movieClip 566 {
}
movieClip 567 mcSled {
}
movieClip 569 {
}
movieClip 571 {
}
movieClip 572 {
}
movieClip 573 {
}
movieClip 574 {
}
movieClip 577 {
}
movieClip 578 {
}
movieClip 580 {
}
movieClip 581 {
}
movieClip 584 {
}
movieClip 585 mcCarYellow {
}
movieClip 588 {
}
movieClip 589 {
}
movieClip 590 mcCarShadow {
}
movieClip 593 {
}
movieClip 594 {
}
movieClip 595 mcCarOrange {
}
movieClip 598 {
}
movieClip 599 {
}
movieClip 600 mcCarGreen {
}
movieClip 603 {
}
movieClip 604 {
}
movieClip 605 mcCarBlue {
}
movieClip 606 mcCarRed {
}
frame 1 {
_global.gameMode = 0;
_global.championshipLevel = 0;
_global.championshipLevelMax = 6;
_global.currentTrackName = 'mcTrack_1';
_global.track_collision_on = true;
_global.bonusNames = new Array('nitro', 'steer');
_global.bonusTime = new Array(240000, 240);
_global.openSite = function () {
getURL('http://www.gametop.com/stats/monstertruckracing.html', '_blank');
};
_global.enableSound = function (is_on) {
_global.soundOn = is_on;
trace('_global.soundOn = ' + _global.soundOn);
};
_global.playSound = function (sound_mark) {
if (_global.soundOn == false) {
return undefined;
}
if (!_root.sounds) {
return undefined;
}
_root.sounds.gotoAndPlay(sound_mark);
};
_global.randRange = function (min, max) {
var v1 = Math.floor(Math.random() * (max - min + 1)) + min;
return v1;
};
_global.lineInterpolation = function (ymin, ymax, xmin, xmax, xcur) {
var v2;
var v1;
var v3;
v1 = (ymax - ymin) / (xmax - xmin);
v3 = ymin - v1 * xmin;
v2 = v1 * xcur + v3;
return v2;
};
_global.vecLength = function (px, py) {
var v2 = px * px + py * py;
var v1 = Math.sqrt(v2);
return v1;
};
_global.vecDotProduct = function (px1, py1, px2, py2) {
var v1 = px1 * px2 + py1 * py2;
return v1;
};
_global.vecGetAngle = function (px1, py1, px2, py2) {
px1 = _global.roundTo(px1, 0.0001);
px2 = _global.roundTo(px2, 0.0001);
py1 = _global.roundTo(py1, 0.0001);
py2 = _global.roundTo(py2, 0.0001);
var v4 = _global.vecLength(px1, py1);
if (v4 == 0) {
return 0;
}
var v5 = _global.vecLength(px2, py2);
if (v5 == 0) {
return 0;
}
px1 /= v4;
py1 /= v4;
px2 /= v5;
py2 /= v5;
var v10 = vecDotProduct(px1, py1, px2, py2);
var v9 = Math.acos(v10);
var v2 = v9 * 180 / Math.PI;
if (py2 < 0) {
v2 = -v2;
}
v2 = _global.roundTo(v2, 0.01);
return v2;
};
_global.roundTo = function (value, base) {
return Math.floor((value + base / 2) / base) * base;
};
_global.formTimeStr = function (seconds) {
if (seconds < 0 || seconds == undefined) {
return 'error!';
}
var v3 = Math.round(seconds / 1000);
var v2 = v3 % 60;
if (v2 < 10) {
v2 = '0' + v2;
}
var v1 = Math.floor(v3 / 60);
if (v1 < 10) {
v1 = '0' + v1;
}
var v5 = v1 + ':' + v2 + '\n';
return v5;
};
_global.onNewGame = function () {
_root.mcActionMenu.startWait('select_game');
};
_global.onHelp = function () {
_root.mcActionMenu.startWait('help');
};
_global.onMoreFreeGames = function () {
_global.openSite();
};
_global.onMainMenu_LevelStats = function () {
_root.mcActionMenu.startWait('menu', 'root');
};
_global.onMainMenu_Help = function () {
_root.mcActionMenu.startWait('main');
};
_global.onMainMenu_Pause = function () {
_root.mcActionGame.startWait('menu', 'root');
};
_global.onMainMenu_SelectGame = function () {
_root.mcActionMenu.startWait('main');
};
_global.onMainMenu_SelectTrack = function () {
_root.mcActionMenu.startWait('select_game');
};
_global.onChampionship = function () {
_global.gameMode = 0;
_global.championshipLevel = 0;
_global.startGame();
};
_global.onSingleRace = function () {
_global.gameMode = 3;
_root.mcActionMenu.startWait('select_track');
};
_global.onTrial = function () {
_global.gameMode = 1;
_root.mcActionMenu.startWait('select_track');
};
_global.onShadowRace = function () {
_global.gameMode = 2;
_root.mcActionMenu.startWait('select_track');
};
_global.onSelectTrack1 = function () {
_global.currentTrackName = 'mcTrack_1';
_global.startGame();
};
_global.onSelectTrack2 = function () {
_global.currentTrackName = 'mcTrack_2';
_global.startGame();
};
_global.onSelectTrack3 = function () {
_global.currentTrackName = 'mcTrack_3';
_global.startGame();
};
_global.onSelectTrack4 = function () {
_global.currentTrackName = 'mcTrack_4';
_global.startGame();
};
_global.onSelectTrack5 = function () {
_global.currentTrackName = 'mcTrack_5';
_global.startGame();
};
_global.onSelectTrack6 = function () {
_global.currentTrackName = 'mcTrack_6';
_global.startGame();
};
_global.startGame = function () {
var v3 = 'ERROR!';
if (_global.gameMode == 1) {
v3 = 'trial';
} else {
if (_global.gameMode == 2) {
v3 = 'shadow race';
} else {
if (_global.gameMode == 0) {
v3 = 'championship';
} else {
if (_global.gameMode == 3) {
v3 = 'single race';
}
}
}
}
trace('');
trace('Starting game...');
trace('game mode: ' + _global.gameMode + ' [' + v3 + '];');
if (_global.gameMode == 0) {
trace('championship level: ' + _global.championshipLevel + ';');
} else {
trace('track name: ' + _global.currentTrackName + ';');
}
trace('');
_root.mcActionMenu.startWait('game', 'root');
};
_global.onOk_LevelStatistic = function () {
if (_global.gameMode == 0) {
if (_global.iStatHeaderFrame == 1) {
_global.championshipLevel += 1;
}
if (_global.championshipLevel == _global.championshipLevelMax) {
_root.mcActionMenu.startWait('championshipCompleted', 'root');
} else {
_root.mcActionMenu.startWait('game', 'root');
}
} else {
_root.mcActionMenu.startWait('menu', 'root');
}
};
_global.onOk_ChampionshipCompleted = function () {
_root.mcActionMenu.startWait('menu', 'root');
};
_global.onPause_Resume = function () {
_root.mcActionGame.gamePause(false);
};
_global.onPause_Restart = function () {
_root.mcActionGame.startWait('gameRestart', 'root');
};
_global.friction1 = 0.25;
_global.wheel_omega1 = 6;
_global.max_wheel_ang1 = 30;
_global.acc1 = 0.75;
_global.max_speed1 = 15;
_global.dir_omega1 = 4;
_global.min_speed_for_rotate1 = 3;
_global.speed_for_break_when_rotate1 = 3;
_global.add_friction_min1 = 0.25;
_global.add_friction_max1 = 0.25;
_global.speed_add_friction_min1 = 8;
_global.speed_add_friction_max1 = 15;
_global.min_speed_for_drift1 = 1000;
_global.min_wheel_angle_for_drift1 = 40;
_global.max_wheel_angle_for_drift1 = 40;
_global.drift_coeff_min1 = 0;
_global.drift_coeff_max1 = 0;
_global.collision_speed_lost_coeff1 = 0.5;
_global.block_control_time1 = 12;
_global.arCars = new Array();
var car = null;
car = new Object();
car.drivername = 'player';
car.carname = 'mcCarRed';
car.is_player = true;
car.friction1 = 0.25;
car.wheel_omega1 = 8;
car.max_wheel_ang1 = 45;
car.acc1 = 0.75;
car.max_speed1 = 25;
car.dir_omega1 = 4;
car.min_speed_for_rotate1 = 4;
car.speed_for_break_when_rotate1 = 15;
car.add_friction_min1 = 0.15;
car.add_friction_max1 = 0.15;
car.speed_add_friction_min1 = 8;
car.speed_add_friction_max1 = 15;
car.min_speed_for_drift1 = 15;
car.min_wheel_angle_for_drift1 = 20;
car.max_wheel_angle_for_drift1 = 40;
car.drift_coeff_min1 = 0.01;
car.drift_coeff_max1 = 0.2;
car.collision_speed_lost_coeff1 = 0.5;
car.block_control_time1 = 12;
_global.arCars.push(car);
car = new Object();
car.drivername = 'carShadow';
car.carname = 'mcCarShadow';
car.is_player = false;
car.friction1 = 0.25;
car.wheel_omega1 = 6;
car.max_wheel_ang1 = 30;
car.acc1 = 0.75;
car.max_speed1 = 15;
car.dir_omega1 = 4;
car.min_speed_for_rotate1 = 4;
car.speed_for_break_when_rotate1 = 3;
car.add_friction_min1 = 0.25;
car.add_friction_max1 = 0.25;
car.speed_add_friction_min1 = 8;
car.speed_add_friction_max1 = 15;
car.min_speed_for_drift1 = 1000;
car.min_wheel_angle_for_drift1 = 40;
car.max_wheel_angle_for_drift1 = 40;
car.drift_coeff_min1 = 0;
car.drift_coeff_max1 = 0;
car.collision_speed_lost_coeff1 = 0.5;
car.block_control_time1 = 12;
_global.arCars.push(car);
car = new Object();
car.drivername = 'comp_1';
car.carname = 'mcCarGreen';
car.friction1 = 0.25;
car.wheel_omega1 = 6;
car.max_wheel_ang1 = 30;
car.acc1 = 0.75;
car.max_speed1 = 15;
car.dir_omega1 = 3;
car.min_speed_for_rotate1 = 3;
car.speed_for_break_when_rotate1 = 3;
car.add_friction_min1 = 0.25;
car.add_friction_max1 = 0.25;
car.speed_add_friction_min1 = 8;
car.speed_add_friction_max1 = 15;
car.min_speed_for_drift1 = 1000;
car.min_wheel_angle_for_drift1 = 40;
car.max_wheel_angle_for_drift1 = 40;
car.drift_coeff_min1 = 0;
car.drift_coeff_max1 = 0;
car.collision_speed_lost_coeff1 = 0.5;
car.block_control_time1 = 12;
_global.arCars.push(car);
car = new Object();
car.drivername = 'comp_2';
car.carname = 'mcCarBlue';
car.friction1 = 0.25;
car.wheel_omega1 = 6;
car.max_wheel_ang1 = 30;
car.acc1 = 0.75;
car.max_speed1 = 15;
car.dir_omega1 = 4;
car.min_speed_for_rotate1 = 3;
car.speed_for_break_when_rotate1 = 3;
car.add_friction_min1 = 0.25;
car.add_friction_max1 = 0.25;
car.speed_add_friction_min1 = 8;
car.speed_add_friction_max1 = 15;
car.min_speed_for_drift1 = 1000;
car.min_wheel_angle_for_drift1 = 40;
car.max_wheel_angle_for_drift1 = 40;
car.drift_coeff_min1 = 0;
car.drift_coeff_max1 = 0;
car.collision_speed_lost_coeff1 = 0.5;
car.block_control_time1 = 12;
_global.arCars.push(car);
car = new Object();
car.drivername = 'comp_3';
car.carname = 'mcCarYellow';
car.friction1 = 0.25;
car.wheel_omega1 = 6;
car.max_wheel_ang1 = 30;
car.acc1 = 0.75;
car.max_speed1 = 15;
car.dir_omega1 = 4;
car.min_speed_for_rotate1 = 3;
car.speed_for_break_when_rotate1 = 3;
car.add_friction_min1 = 0.25;
car.add_friction_max1 = 0.25;
car.speed_add_friction_min1 = 8;
car.speed_add_friction_max1 = 15;
car.min_speed_for_drift1 = 1000;
car.min_wheel_angle_for_drift1 = 40;
car.max_wheel_angle_for_drift1 = 40;
car.drift_coeff_min1 = 0;
car.drift_coeff_max1 = 0;
car.collision_speed_lost_coeff1 = 0.5;
car.block_control_time1 = 12;
_global.arCars.push(car);
car = new Object();
car.drivername = 'comp_4';
car.carname = 'mcCarOrange';
car.friction1 = 0.25;
car.wheel_omega1 = 6;
car.max_wheel_ang1 = 30;
car.acc1 = 0.75;
car.max_speed1 = 15;
car.dir_omega1 = 4;
car.min_speed_for_rotate1 = 3;
car.speed_for_break_when_rotate1 = 3;
car.add_friction_min1 = 0.25;
car.add_friction_max1 = 0.25;
car.speed_add_friction_min1 = 8;
car.speed_add_friction_max1 = 15;
car.min_speed_for_drift1 = 1000;
car.min_wheel_angle_for_drift1 = 40;
car.max_wheel_angle_for_drift1 = 40;
car.drift_coeff_min1 = 0;
car.drift_coeff_max1 = 0;
car.collision_speed_lost_coeff1 = 0.5;
car.block_control_time1 = 12;
_global.arCars.push(car);
_global.arLevels = new Array();
var level = null;
level = new Object();
level.trackname = 'mcTrack_1';
level.lapnum = 3;
level.cars = 'player,comp_1,comp_2,comp_3,comp_4';
level.view_width = 3500;
level.view_height = 3500;
level.node_steps = 20;
_global.arLevels.push(level);
level = new Object();
level.trackname = 'mcTrack_2';
level.lapnum = 3;
level.cars = 'player,comp_1,comp_2,comp_3,comp_4';
level.view_width = 3400;
level.view_height = 3800;
level.node_steps = 10;
_global.arLevels.push(level);
level = new Object();
level.trackname = 'mcTrack_3';
level.lapnum = 3;
level.cars = 'player,comp_1,comp_2,comp_3,comp_4';
_global.arLevels.push(level);
level = new Object();
level.trackname = 'mcTrack_4';
level.lapnum = 3;
level.cars = 'player,comp_1,comp_2,comp_3,comp_4';
_global.arLevels.push(level);
level = new Object();
level.trackname = 'mcTrack_5';
level.lapnum = 3;
level.cars = 'player,comp_1,comp_2,comp_3,comp_4';
_global.arLevels.push(level);
level = new Object();
level.trackname = 'mcTrack_6';
level.lapnum = 3;
level.cars = 'player,comp_1,comp_2,comp_3,comp_4';
_global.arLevels.push(level);
fscommand('showmenu', 'false');
_focusrect = false;
_root.loaderAnimDelta = 5;
_root.loaderAnimPause = 2500;
_root.parsingAnimDelta = 10;
_global.soundOn = true;
}
movieClip 608 {
}
movieClip 609 {
frame 1 {
stop();
}
instance of movieClip 2 {
onClipEvent (load) {
_visible = false;
}
}
}
movieClip 798 __Packages.CActionMenu {
#initclip
if (!_global.CActionMenu) {
var v1 = function () {
super();
};
_global.CActionMenu = v1;
_global.CActionMenu extends MovieClip;
var v2 = v1.prototype;
v2.startWait = function (gotoLabel, clipName) {
if (this.m_waitTime > 0) {
return undefined;
}
this.m_gotoLabel = gotoLabel;
if (clipName) {
this.m_clipName = clipName;
} else {
this.m_clipName = 'mcMainMenu';
}
this.m_waitTime = 25;
_root.fade_clip.gotoAndPlay(2);
};
v2.onEnterFrame = function () {
if (this.m_waitTime <= 0) {
return undefined;
}
this.m_waitTime -= 1;
if (this.m_waitTime > 0) {
return undefined;
}
if (this.m_clipName == 'root') {
_root.gotoAndStop(this.m_gotoLabel);
} else {
_root[this.m_clipName].gotoAndStop(this.m_gotoLabel);
}
this.m_gotoLabel = '';
this.m_waitTime = 0;
};
v2.m_waitTime = 0;
v2.m_gotoLabel = '';
v2.m_clipName = '';
ASSetPropFlags(_global.CActionMenu.prototype, null, 1);
}
#endinitclip
}
movieClip 799 __Packages.CActionGame {
#initclip
if (!_global.CActionGame) {
var v1 = function () {
super();
this.m_bIsInitOk = true;
this.gameInit();
};
_global.CActionGame = v1;
_global.CActionGame extends MovieClip;
var v2 = v1.prototype;
v2.gameInit = function () {
_global.raceTime = 0;
_global.raceTimeLap = 0;
_global.racePlace = 0;
_global.racePlaceMax = 0;
this.m_iNumBotCollisions = 0;
_global.iStatHeaderFrame = 1;
this.m_iFramesPassed = 0;
this.m_iTimeStart = getTimer();
this.m_CCars = new Array();
this.m_iPlayerCarIndex = -1;
this.m_iFocusedCar = 0;
var v14 = null;
if (_global.gameMode == 0 || _global.gameMode == 3) {
v14 = null;
if (_global.gameMode == 0) {
if (_global.championshipLevel == undefined || _global.championshipLevel < 0) {
_global.championshipLevel = 0;
}
v14 = _global.arLevels[_global.championshipLevel];
} else {
if (_global.gameMode == 3) {
v14 = this.findTrackByName(_global.currentTrackName);
}
}
if (!v14) {
trace('gameInit: can\'t find championship level with index ' + _global.championshipLevel + '!');
this.m_bIsInitOk = false;
return undefined;
}
this.gameAddTrackClip(v14.trackname);
var v16 = v14.cars.split(',');
var v9 = null;
var v4 = 0;
while (this.m_mcTrack['sp' + v4] != undefined) {
v9 = this.findCarByName(v16[v4]);
if (v9 == null) {
trace('Can\'t find car for start point sp' + v4 + '! Car name is "' + v16[v4] + '".');
} else {
this.gameAddCar(v9, this.m_mcTrack['sp' + v4]._x, this.m_mcTrack['sp' + v4]._y, this.m_mcTrack['sp' + v4]._rotation, this.m_mcTrack['sp' + v4].getDepth(), 'sp' + v4);
}
v4 += 1;
}
this.m_iMaxNumLap = v14.lapnum;
} else {
if (_global.gameMode == 1 || _global.gameMode == 2) {
v14 = this.findTrackByName(_global.currentTrackName);
this.gameAddTrackClip(_global.currentTrackName);
if (this.m_mcTrack.sp6) {
this.gameAddCar(this.findCarByName('player'), this.m_mcTrack.sp6._x, this.m_mcTrack.sp6._y, this.m_mcTrack.sp6._rotation, this.m_mcTrack.sp6.getDepth(), 'sp6');
} else {
trace('Need sp6 position!');
}
if (_global.gameMode == 2) {
this.m_iMaxNumLap = 1;
this.m_iShadowRacePart = 0;
this.m_arSaved = new Array();
if (this.m_mcTrack.sp7 == undefined) {
trace('Can\'t find shadow car position');
} else {
this.m_fShadowX = this.m_mcTrack.sp6._x;
this.m_fShadowY = this.m_mcTrack.sp6._y;
this.m_fShadowAngle = this.m_mcTrack.sp6._rotation;
this.m_fShadowDepth = this.m_mcTrack.sp7.getDepth();
}
} else {
this.m_iMaxNumLap = 3;
}
} else {
trace('ERROR: unknow game mode!!!');
this.m_bIsInitOk = false;
}
}
if (!this.m_bIsInitOk) {
return undefined;
}
if (this.m_iPlayerCarIndex == -1) {
trace('No player car was founded!');
} else {
this.m_CCars[this.m_iPlayerCarIndex].carSetAIType(1);
this.m_iFocusedCar = this.m_iPlayerCarIndex;
}
this.m_arWayPoints = new Array();
if (this.m_mcTrack.wayClip) {
var v4 = 1;
while (v4 <= this.m_mcTrack.wayClip._totalframes) {
this.m_mcTrack.wayClip.gotoAndStop(v4);
var v5 = {'x': this.m_mcTrack.wayClip.clop._x + this.m_mcTrack.wayClip._x, 'y': this.m_mcTrack.wayClip.clop._y + this.m_mcTrack.wayClip._y};
v5.x = Math.floor(v5.x);
v5.y = Math.floor(v5.y);
this.m_arWayPoints.push(v5);
v4 += 1;
}
this.m_mcTrack.wayClip.gotoAndStop(1);
this.m_mcTrack.wayClip._visible = true;
}
this.m_arDObj = new Array();
var v10 = this.m_mcTrack.damageClip;
for (var v19 in v10) {
if (typeof v10[v19] == 'movieclip') {
this.m_arDObj.push(v10[v19]);
}
}
v4 = 0;
while (this.m_mcTrack['sp' + v4] != undefined) {
this.m_mcTrack['sp' + v4]._visible = false;
v4 += 1;
}
this.m_mcTrack.sp6._visible = false;
this.m_mcTrack.sp7._visible = false;
_root.mcGUI.mcStartCounter._visible = true;
_root.mcGUI.mcLastLap._visible = false;
this.cameraMoveTo(275 - this.m_CCars[this.m_iFocusedCar].m_fX, 200 - this.m_CCars[this.m_iFocusedCar].m_fY);
this.m_CCars[this.m_iFocusedCar].m_mcObj.focus_frame._visible = true;
this.m_tfDebug = '';
this.printDebug();
this.m_viewWidth = this.m_mcTrack._width - 550;
this.m_viewHeight = this.m_mcTrack._height - 400;
if (v14.view_width != undefined) {
this.m_viewWidth = v14.view_width - 550;
}
if (v14.view_height != undefined) {
this.m_viewHeight = v14.view_height - 400;
}
trace('view_width: ' + this.m_viewWidth);
trace('view_height: ' + this.m_viewHeight);
this.m_iNodeSteps = 10;
if (v14.node_steps > 0) {
this.m_iNodeSteps = v14.node_steps;
}
trace('node steps: ' + this.m_iNodeSteps);
v4 = 0;
while (v4 < this.m_CCars.length) {
if (this.m_CCars[v4].carGetAIType() == 0) {
var v11 = this.m_CCars[this.m_iPlayerCarIndex].m_max_speed1;
var v13 = this.m_CCars[this.m_iPlayerCarIndex].m_acc1;
var v6 = v11 - 7;
v6 += _global.randRange(-3, 2);
this.m_CCars[v4].m_max_speed1 = v6;
var v8 = v13 - 0.15;
v8 += _global.randRange(0, 15) / 100;
this.m_CCars[v4].m_acc1 = v8;
trace(v6 + ',' + v8);
}
v4 += 1;
}
if (_global.gameMode == 2) {
this.gameHideAllBonuses();
} else {
this.gameResetAllBonuses();
}
this.gameToggleDebugInfo();
this.m_iFlashPlayerCar = 0;
_root.mcGUI.bonus_slot1._visible = false;
_root.mcGUI.bonus_slot1.flash_time = 0;
_root.mcGUI.bonus_slot2._visible = false;
_root.mcGUI.bonus_slot2.flash_time = 0;
_root.mcGUI.bonus_slot3._visible = false;
_root.mcGUI.bonus_slot3.flash_time = 0;
_root.mcGUI.bonus_slot4._visible = false;
_root.mcGUI.bonus_slot4.flash_time = 0;
var v15 = _root.mcGUI.miniMap.track;
_root.mcGUI.miniMap.gotoAndStop(v14.trackname + '_Mini');
trace('miniMap = ' + v15);
v4 = this.m_CCars.length - 1;
while (v4 >= 0) {
var v12 = this.m_CCars[v4];
var v7 = v15.attachMovie(v12.getCarClipName() + '_Mini', 'MiniCar' + v4, v15.getNextHighestDepth());
v7._x = this.m_CCars[v4].m_fX;
v7._y = this.m_CCars[v4].m_fY;
v7._rotation = this.m_CCars[v4].m_fAngle;
v4 -= 1;
}
this.gamePause(false);
};
v2.gameResetAllBonuses = function () {
this.gameResetAllBonuses2();
return undefined;
};
v2.gameResetAllBonuses2 = function () {
if (_global.gameMode == 2) {
return undefined;
}
var v4 = 0;
while (this.m_mcTrack['b' + v4] != undefined) {
var v3 = this.m_mcTrack['b' + v4];
v3.dead = false;
v3._visible = true;
v3.gotoAndStop(1);
v3.bonus_type = 0;
v4 += 1;
}
};
v2.gameHideAllBonuses = function () {
var v2 = 0;
while (this.m_mcTrack['b' + v2] != undefined) {
var v3 = this.m_mcTrack['b' + v2];
v3.dead = true;
v3._visible = false;
v2 += 1;
}
};
v2.gameFrame = function () {
if (this.m_gotoWaitTime > 0) {
this.m_gotoWaitTime -= 1;
if (this.m_gotoWaitTime <= 0) {
if (this.m_gotoClipName == 'root') {
_root.gotoAndStop(this.m_gotoLabel);
} else {
_root[this.m_gotoClipName].gotoAndStop(this.m_gotoLabel);
}
this.m_gotoLabel = '';
this.m_gotoWaitTime = 0;
}
return undefined;
}
if (this.m_bIsRaceEnd) {
this.m_iWaitAfterRace -= 1;
if (this.m_iWaitAfterRace == 0) {
_root.gotoAndStop('levelStatistic');
_root.stat_header.gotoAndStop(_global.iStatHeaderFrame);
_root.stat_time.text = _global.formTimeStr(_global.raceTime);
_root.stat_timelap.text = _global.formTimeStr(_global.raceTimeLap);
_root.stat_place.text = _global.racePlace + '/' + _global.racePlaceMax;
}
}
if (!this.m_bIsInitOk) {
return undefined;
}
if (this.m_bIsPaused) {
return undefined;
}
if (_global.gameMode == 2 && this.m_iShadowRacePart == 1 && this.m_iWaitAfterRace > 0) {
this.m_iWaitAfterRace -= 1;
if (this.m_iWaitAfterRace == 0) {
this.m_iShadowRacePart = 2;
this.gameAddShadowCar();
this.m_CCars[0].carReset();
_root.mcGUI.mcStartCounter._visible = true;
_root.mcGUI.mcStartCounter.gotoAndPlay(1);
this.cameraMoveTo(275 - this.m_CCars[0].m_fX, 200 - this.m_CCars[0].m_fY);
trace('Shadow race: first part ended. Add shadow and restart race.');
}
}
if (_root.mcGUI.mcStartCounter._visible) {
this.m_iFlashPlayerCar -= 1;
if (this.m_iFlashPlayerCar <= 0) {
this.m_CCars[this.m_iPlayerCarIndex].m_mcObj._visible = !this.m_CCars[this.m_iPlayerCarIndex].m_mcObj._visible;
this.m_iFlashPlayerCar = 6;
}
if (_root.mcGUI.mcStartCounter._currentframe == _root.mcGUI.mcStartCounter._totalframes) {
_root.mcGUI.mcStartCounter._visible = false;
this.m_CCars[this.m_iPlayerCarIndex].m_mcObj._visible = true;
}
return undefined;
}
if (_root.mcGUI.mcLastLap._visible) {
if (_root.mcGUI.mcLastLap._currentframe == _root.mcGUI.mcLastLap._totalframes) {
_root.mcGUI.mcLastLap._visible = false;
}
}
this.m_tfDebug = '';
this.m_iFramesPassed += 1;
this.m_iTimePassed = getTimer() - this.m_iTimeStart;
var v40 = Math.round(this.m_iTimePassed / 1000);
var v39 = v40 % 60;
if (v39 < 10) {
v39 = '0' + v39;
}
var v44 = Math.floor(v40 / 60);
var v45 = v44 + ':' + v39 + '\n';
this.m_tfDebug += v45;
var v8 = new Array();
var v7 = new Array();
var v36 = _root.mcGUI.miniMap.track;
var v5 = 0;
while (v5 < this.m_CCars.length) {
this.m_CCars[v5].carThink();
var v13 = v36['MiniCar' + v5];
if (v13) {
v13._x = this.m_CCars[v5].m_fX;
v13._y = this.m_CCars[v5].m_fY;
v13._rotation = this.m_CCars[v5].m_fAngle;
}
var v9 = new Object();
v9.indx = v5;
v9.par = this.m_CCars[v5].m_iCurLap * 1000 + this.m_CCars[v5].m_iLastNode;
v8.push(v9);
if (this.m_CCars[v5].carGetAIType() != 2) {
if (this.m_CCars[v5].m_immuneToCollision <= 0) {
var v6 = 0;
while (v6 < this.m_CCars.length) {
if (v5 != v6) {
if (this.m_CCars[v6].carGetAIType() != 2) {
if (this.m_CCars[v6].m_immuneToCollision <= 0) {
var v11 = false;
var v14 = _global.vecLength(this.m_CCars[v6].m_fX - this.m_CCars[v5].m_fX, this.m_CCars[v6].m_fY - this.m_CCars[v5].m_fY);
if (v14 <= 60) {
v11 = true;
}
if (v11) {
var v10 = false;
var v4 = 0;
while (v4 < v7.length) {
if (v7[v4].c1 == v5 && v7[v4].c2 == v6 || v7[v4].c1 == v6 && v7[v4].c2 == v5) {
v10 = true;
break;
}
v4 += 1;
}
if (!v10) {
v9 = new Object();
v9.c1 = v5;
v9.c2 = v6;
v7.push(v9);
}
}
}
}
}
v6 += 1;
}
}
}
v5 += 1;
}
v5 = 0;
while (v5 < v7.length) {
var v19 = v7[v5].c1;
var v20 = v7[v5].c2;
var v12 = this.m_CCars[v19];
var v17 = this.m_CCars[v20];
if (this.m_CCars[v20].m_iLastNode < this.m_CCars[v19].m_iLastNode) {
v12 = this.m_CCars[v20];
v17 = this.m_CCars[v19];
}
v12.m_mcObj.stop_sign._rotation = 0;
var v18 = v12.m_fX - v17.m_fX;
var v16 = v12.m_fY - v17.m_fY;
var v23 = _global.vecLength(v18, v16) * 10;
v18 /= v23;
v16 /= v23;
var v24 = (v12.m_fAngle / 180) * Math.PI;
var v28 = Math.cos(v24);
var v27 = Math.sin(v24);
var v22 = (v17.m_fAngle / 180) * Math.PI;
var v25 = Math.cos(v22);
var v31 = Math.sin(v22);
var v26 = v28 + v18;
var v30 = v27 + v16;
var v35 = _global.vecGetAngle(1, 0, v26, v30);
var v29 = v25 - v18;
var v32 = v31 - v16;
var v34 = _global.vecGetAngle(1, 0, v29, v32);
v5 += 1;
}
var v21 = true;
while (v21) {
v21 = false;
v4 = 0;
while (v4 < v8.length) {
if (v8[v4].par < v8[v4 + 1].par) {
v21 = true;
var v15 = v8[v4 + 1];
v8[v4 + 1] = v8[v4];
v8[v4] = v15;
}
v4 += 1;
}
}
var v33 = '';
v5 = 0;
while (v5 < v8.length) {
this.m_CCars[v8[v5].indx].m_iCurPlace = v5 + 1;
v33 += v8[v5].par;
v33 += ',';
v5 += 1;
}
this.cameraMoveTo(275 - this.m_CCars[this.m_iFocusedCar].m_fX, 200 - this.m_CCars[this.m_iFocusedCar].m_fY);
this.gameProcessInput();
var v43 = this.m_CCars[this.m_iFocusedCar].m_iCurPlace;
var v41 = this.m_CCars.length;
var v37 = this.m_CCars[this.m_iFocusedCar].m_iCurLap;
var v42 = this.m_iMaxNumLap;
if (v37 < 1) {
v37 = 1;
} else {
if (v37 > this.m_iMaxNumLap) {
v37 = this.m_iMaxNumLap;
}
}
_root.mcGUI.tf_place.text = v43 + '/' + v41;
_root.mcGUI.tf_lap.text = v37 + '/' + v42;
var v38 = this.m_CCars[this.m_iFocusedCar].m_iLastNode + this.m_iNodeSteps;
if (v38 < 0) {
v38 += this.m_arWayPoints.length;
}
if (v38 >= this.m_arWayPoints.length) {
v38 -= this.m_arWayPoints.length;
}
this.m_mcTrack.wayClip.gotoAndStop(v38);
this.m_tfDebug += 'Num Bot Collisions: ' + this.m_iNumBotCollisions;
this.printDebug();
};
v2.gameProcessInput = function () {
if (this.m_iButtonPressedTime > 0) {
this.m_iButtonPressedTime -= 1;
return undefined;
}
var v2 = 12;
var v3 = -1;
if (Key.isDown(27) || Key.isDown(80)) {
this.gamePause(true);
} else {
if (Key.isDown(49)) {
this.m_iButtonPressedTime = v2;
} else {
if (Key.isDown(50)) {
this.m_iButtonPressedTime = v2;
v3 = 1;
} else {
if (Key.isDown(51)) {
this.m_iButtonPressedTime = v2;
} else {
if (Key.isDown(52)) {
this.m_iButtonPressedTime = v2;
} else {
if (Key.isDown(53)) {
this.m_iButtonPressedTime = v2;
} else {
if (Key.isDown(54)) {
this.m_iButtonPressedTime = v2;
} else {
if (Key.isDown(48)) {
this.m_iButtonPressedTime = v2;
} else {
if (Key.isDown(56)) {
this.m_iButtonPressedTime = v2;
}
}
}
}
}
}
}
}
}
if (v3 >= 0 && v3 <= this.m_CCars.length - 1) {
if (this.m_CCars[this.m_iFocusedCar].carGetAIType() == 1) {
this.m_CCars[this.m_iFocusedCar].carSetAIType(0);
}
this.m_iFocusedCar = v3;
}
};
v2.gameToggleDebugInfo = function () {
var v3 = 0;
while (v3 < this.m_CCars.length) {
this.m_CCars[v3].carShowHideCollisionPoints();
this.m_CCars[v3].m_mcObj.center._visible = !this.m_CCars[v3].m_mcObj.center._visible;
v3 += 1;
}
this.m_CCars[this.m_iFocusedCar].m_mcObj.focus_frame._visible = !this.m_CCars[this.m_iFocusedCar].m_mcObj.focus_frame._visible;
this.m_mcTrack.wayClip._visible = !this.m_mcTrack.wayClip._visible;
this.m_mcTrack.hitClip._visible = !this.m_mcTrack.hitClip._visible;
v3 = 0;
while (this.m_mcTrack['f' + v3] != undefined) {
this.m_mcTrack['f' + v3]._visible = !this.m_mcTrack['f' + v3]._visible;
v3 += 1;
}
_root.mcGUI.mcDebug._visible = !_root.mcGUI.mcDebug._visible;
};
v2.gameAddTrackClip = function (track_name) {
this.m_mcTrack = this.attachMovie(track_name, 'mcTrackClip', this.getNextHighestDepth(), {'_x': 0, '_y': 0});
if (!this.m_mcTrack) {
trace('gameAddTrackClip: can\'t find clip with linkage ' + track_name);
this.m_bIsInitOk = false;
}
};
v2.gameAddCar = function (car_set_obj, px, py, ang, depth, sp_name) {
var v3 = this.m_CCars.length;
var v5 = this.m_mcTrack.attachMovie(car_set_obj.carname, 'Car' + v3, depth);
var v2 = new CCar(v5, px, py, ang);
v2.carSetPhysicSettings(car_set_obj);
v2.m_iCurPlace = v3 + 1;
if (car_set_obj.is_player) {
this.m_iPlayerCarIndex = v3;
}
v2.m_mcObj.focus_frame._visible = false;
v2.carStopWheel();
v2.setStartPointName(sp_name);
v2.setCarClipName(car_set_obj.carname);
this.m_CCars.push(v2);
};
v2.cameraMoveTo = function (need_x, need_y) {
var v2 = this.m_mcTrack._x;
var v3 = this.m_mcTrack._y;
this.m_mcTrack._x += need_x - v2;
this.m_mcTrack._y += need_y - v3;
if (this.m_mcTrack._x > 0) {
this.m_mcTrack._x = 0;
} else {
if (this.m_mcTrack._x < -this.m_viewWidth) {
this.m_mcTrack._x = -this.m_viewWidth;
}
}
if (this.m_mcTrack._y > 0) {
this.m_mcTrack._y = 0;
} else {
if (this.m_mcTrack._y < -this.m_viewHeight) {
this.m_mcTrack._y = -this.m_viewHeight;
}
}
};
v2.findCarByName = function (drivername) {
if (drivername == undefined) {
return null;
}
var v3 = null;
var v2 = 0;
while (v2 < _global.arCars.length) {
if (_global.arCars[v2].drivername == drivername) {
v3 = _global.arCars[v2];
break;
}
v2 += 1;
}
return v3;
};
v2.printDebug = function () {
_root.mcGUI.mcDebug.tf.text = this.m_tfDebug;
};
v2.onEnterFrame = function () {
this.gameFrame();
};
v2.getHitClip = function () {
return this.m_mcTrack.hitClip;
};
v2.getTrackClip = function () {
return this.m_mcTrack;
};
v2.getNearestNodeIndex = function (pos_x, pos_y, hint) {
var v8 = 0;
var v6 = 1000000;
var v11 = 0;
var v7 = this.m_arWayPoints.length;
if (hint >= 0) {
v11 = hint - Math.floor(this.m_iNodeSteps / 2);
v7 = hint + Math.floor(this.m_iNodeSteps / 2);
}
var v5 = v11;
while (v5 < v7) {
var v3 = v5;
if (v3 < 0) {
v3 += this.m_arWayPoints.length;
}
if (v3 >= this.m_arWayPoints.length) {
v3 -= this.m_arWayPoints.length;
}
var v4 = _global.vecLength(pos_x - this.m_arWayPoints[v3].x, pos_y - this.m_arWayPoints[v3].y);
if (v4 == 0) {
v4 = 1000000000;
}
if (v4 < v6) {
v6 = v4;
v8 = v3;
}
v5 += 1;
}
return v8;
};
v2.getTrackNode = function (n) {
if (n < 0) {
n += this.m_arWayPoints.length;
}
if (n >= this.m_arWayPoints.length) {
n -= this.m_arWayPoints.length;
}
var v3 = {'x': this.m_arWayPoints[n].x, 'y': this.m_arWayPoints[n].y};
return v3;
};
v2.gameEndRace = function () {
if (_global.gameMode == 2 && this.m_iShadowRacePart == 0) {
_root.fade_clip.gotoAndPlay(2);
this.m_iWaitAfterRace = 25;
this.m_iShadowRacePart = 1;
return undefined;
}
if (_global.gameMode == 2 && this.m_iShadowRacePart == 1) {
return undefined;
}
var v5 = 100;
var v6 = 0;
var v4 = 0;
while (v4 < this.m_CCars.length) {
if (this.m_CCars[v4].carGetAIType() == 1) {
v5 = this.m_CCars[v4].m_iCurPlace;
v6 = this.m_CCars[v4].m_iBestLap;
break;
}
v4 += 1;
}
_global.raceTime = this.m_iTimePassed;
_global.raceTimeLap = v6;
_global.racePlace = v5;
_global.racePlaceMax = this.m_CCars.length;
var v7 = 'ERROR!';
if (_global.gameMode == 1) {
v7 = 'trial';
} else {
if (_global.gameMode == 2) {
v7 = 'shadow race';
} else {
if (_global.gameMode == 0) {
v7 = 'championship';
} else {
if (_global.gameMode == 3) {
v7 = 'single race';
}
}
}
}
trace('');
trace('End game...');
trace('game mode: ' + _global.gameMode + ' [' + v7 + '];');
if (_global.gameMode == 0) {
trace('championship level: ' + _global.championshipLevel + ';');
} else {
trace('track name: ' + _global.currentTrackName + ';');
}
trace('player place: ' + v5 + '/' + this.m_CCars.length);
trace('');
this.m_bIsRaceEnd = true;
this.m_iWaitAfterRace = 25;
_root.fade_clip.gotoAndPlay(2);
if (_global.gameMode == 1) {
_global.iStatHeaderFrame = 4;
_global.playSound('sndWin');
} else {
if (_global.gameMode == 2 || _global.gameMode == 0 || _global.gameMode == 3) {
_global.iStatHeaderFrame = 1;
if (v5 > 1) {
_global.iStatHeaderFrame = 2;
_global.playSound('sndLose');
} else {
_global.playSound('sndWin');
}
}
}
};
v2.gameSavePositionForShadowCar = function (cx, cy, angle, wangle, node) {
if (_global.gameMode != 2) {
return undefined;
}
if (this.m_iShadowRacePart != 0) {
return undefined;
}
var v3 = new Object();
v3.x = cx;
v3.y = cy;
v3.angle = angle;
v3.wangle = wangle;
v3.node = node;
this.m_arSaved.push(v3);
};
v2.gameGetNextSavedPosition = function () {
var v2 = null;
if (this.m_arSaved[0] != undefined) {
v2 = this.m_arSaved[0];
this.m_arSaved.shift();
}
return v2;
};
v2.gameAddShadowCar = function () {
var v5 = 'carShadow';
var v6 = this.findCarByName(v5);
if (v6 == null) {
trace('Can\'t find shadow car! Car name is "' + v5 + '".');
return undefined;
}
this.gameAddCar(v6, this.m_fShadowX, this.m_fShadowY, this.m_fShadowAngle, this.m_fShadowDepth, 'sp7');
this.m_CCars[1].carSetAIType(2);
var v4 = _root.mcGUI.miniMap.track.track;
var v7 = this.m_CCars[1];
var v3 = v4.attachMovie(v7.getCarClipName() + '_Mini', 'MiniCar1', v4.getNextHighestDepth());
v3._x = this.m_CCars[1].m_fX;
v3._y = this.m_CCars[1].m_fY;
v3._rotation = this.m_CCars[1].m_fAngle;
this.m_iButtonPressedTime = 0;
};
v2.findTrackByName = function (trname) {
var v3 = null;
var v2 = 0;
while (v2 < _global.arLevels.length) {
if (_global.arLevels[v2].trackname == trname) {
v3 = _global.arLevels[v2];
break;
}
v2 += 1;
}
return v3;
};
v2.startWait = function (gotoLabel, clipName) {
if (this.m_gotoWaitTime > 0) {
return undefined;
}
this.m_gotoLabel = gotoLabel;
if (clipName) {
this.m_gotoClipName = clipName;
} else {
this.m_gotoClipName = 'mcMainMenu';
}
this.m_gotoWaitTime = 25;
_root.fade_clip.gotoAndPlay(2);
};
v2.gamePause = function (bIs) {
this.m_bIsPaused = bIs;
_root.mcGUI.pause_win._visible = bIs;
};
v2.gameIsOnScreen = function (px, py) {
var v2 = this.m_CCars[this.m_iFocusedCar].m_fX;
var v3 = this.m_CCars[this.m_iFocusedCar].m_fY;
var v7 = v2 - 275;
var v5 = v2 + 275;
var v4 = v3 - 200;
var v6 = v3 + 200;
if (px >= v7 && px <= v5 && py >= v4 && py <= v6) {
return true;
}
return false;
};
v2.m_iFramesPassed = 0;
v2.m_iTimePassed = 0;
v2.m_iTimeStart = 0;
v2.m_mcTrack = null;
v2.m_iPlayerCarIndex = -1;
v2.m_iFocusedCar = 0;
v2.m_tfDebug = '';
v2.m_iButtonPressedTime = 0;
v2.m_bIsInitOk = false;
v2.m_iMaxNumLap = 3;
v2.m_iShadowRacePart = 0;
v2.m_bIsRaceEnd = false;
v2.m_iWaitAfterRace = 25;
v2.m_gotoWaitTime = 0;
v2.m_gotoLabel = '';
v2.m_gotoClipName = '';
ASSetPropFlags(_global.CActionGame.prototype, null, 1);
}
#endinitclip
}
movieClip 800 __Packages.CCar {
#initclip
if (!_global.CCar) {
var v1 = function (clip, pos_x, pos_y, angle) {
this.m_mcObj = clip;
this.m_fStartX = pos_x;
this.m_fStartY = pos_y;
this.m_fStartAngle = angle;
this.m_mcObj.stop_sign._visible = false;
this.m_fX = pos_x;
this.m_fY = pos_y;
this.m_fAngle = angle;
this.m_fStartX = this.m_fX;
this.m_fStartY = this.m_fY;
this.m_fStartAngle = this.m_fAngle;
this.m_fWheelAngle = 0;
this.m_iAIType = 0;
this.carSetSpeed(0);
this.m_arLastCollision = new Array();
this.m_friction1 = _global.friction1;
this.m_wheel_omega1 = _global.wheel_omega1;
this.m_max_wheel_ang1 = _global.max_wheel_ang1;
this.m_acc1 = _global.acc1;
this.m_max_speed1 = _global.max_speed1;
this.m_dir_omega1 = _global.dir_omega1;
this.m_min_speed_for_rotate1 = _global.min_speed_for_rotate1;
this.m_speed_for_break_when_rotate1 = _global.speed_for_break_when_rotate1;
this.m_add_friction_min1 = _global.add_friction_min1;
this.m_add_friction_max1 = _global.add_friction_max1;
this.m_speed_add_friction_min1 = _global.speed_add_friction_min1;
this.m_speed_add_friction_max1 = _global.speed_add_friction_max1;
this.m_collision_speed_lost_coeff1 = _global.collision_speed_lost_coeff1;
this.m_block_control_time1 = _global.block_control_time1;
this.m_min_speed_for_drift1 = _global.min_speed_for_drift1;
this.m_min_wheel_angle_for_drift1 = _global.min_wheel_angle_for_drift1;
this.m_max_wheel_angle_for_drift1 = _global.max_wheel_angle_for_drift1;
this.m_drift_coeff_min1 = _global.drift_coeff_min1;
this.m_drift_coeff_max1 = _global.drift_coeff_max1;
this.m_iTimeStart = getTimer();
this.m_iLastNode = _root.mcActionGame.getNearestNodeIndex(this.m_fX, this.m_fY, -1);
this.m_immuneToCollision = 0;
this.m_iActiveBonusType = new Array(-1, -1, -1, -1);
this.m_iActiveBonusTime = new Array(0, 0, 0, 0);
this.m_bIsNitroEffect = false;
this.m_bIsNitroIncSpeed = false;
this.m_mcObj.turbo._visible = false;
this.carSetMovieClip();
this.m_fLastSledX = new Array();
this.m_fLastSledY = new Array();
var v4 = this.carGetWheelGlobalPos('bWheel1');
this.m_fLastSledX[0] = v4.x;
this.m_fLastSledY[0] = v4.y;
v4 = this.carGetWheelGlobalPos('bWheel2');
this.m_fLastSledX[1] = v4.x;
this.m_fLastSledY[1] = v4.y;
v4 = this.carGetWheelGlobalPos('fWheel1');
this.m_fLastSledX[2] = v4.x;
this.m_fLastSledY[2] = v4.y;
v4 = this.carGetWheelGlobalPos('fWheel2');
this.m_fLastSledX[3] = v4.x;
this.m_fLastSledY[3] = v4.y;
this.m_iTimeFromLastCollision = 0;
};
_global.CCar = v1;
var v2 = v1.prototype;
v2.carReset = function () {
this.m_fX = this.m_fStartX;
this.m_fY = this.m_fStartY;
this.m_fAngle = this.m_fStartAngle;
this.m_fPreX = this.m_fX;
this.m_fPreY = this.m_fY;
this.m_fPreAngle = this.m_fAngle;
this.m_fWheelAngle = 0;
this.carSetSpeed(0);
this.m_iLastNode = _root.mcActionGame.getNearestNodeIndex(this.m_fX, this.m_fY, -1);
delete this.m_arLastCollision;
this.m_arLastCollision = new Array();
this.m_iRowLap = 0;
this.m_iCurLap = 0;
this.m_iBlockControlTime = 0;
this.m_fFakeWheelAngle = 0;
this.m_iBestLap = 100000;
this.m_iLapTime = 0;
this.m_iTimeStart = getTimer();
this.m_mcObj.stop_sign._visible = false;
this.m_immuneToCollision = 0;
var v3 = this.carGetWheelGlobalPos('bWheel1');
this.m_fLastSledX[0] = v3.x;
this.m_fLastSledY[0] = v3.y;
v3 = this.carGetWheelGlobalPos('bWheel2');
this.m_fLastSledX[1] = v3.x;
this.m_fLastSledY[1] = v3.y;
v3 = this.carGetWheelGlobalPos('fWheel1');
this.m_fLastSledX[2] = v3.x;
this.m_fLastSledY[2] = v3.y;
v3 = this.carGetWheelGlobalPos('fWheel2');
this.m_fLastSledX[3] = v3.x;
this.m_fLastSledY[3] = v3.y;
this.m_iTimeFromLastCollision = 0;
this.carBonusDropAll();
this.carSetMovieClip();
};
v2.carThink = function () {
this.m_iLiveFrames += 1;
this.m_iLapTime = getTimer() - this.m_iTimeStart;
this.m_fPreX = this.m_fX;
this.m_fPreY = this.m_fY;
this.m_fPreAngle = this.m_fAngle;
if (this.m_immuneToCollision > 0) {
this.m_immuneToCollision -= 1;
}
var v4 = 0;
while (v4 < this.m_iActiveBonusType.length) {
if (this.m_iActiveBonusType[v4] >= 0) {
--this.m_iActiveBonusTime[v4];
var v6 = Math.floor(this.m_iActiveBonusTime[v4] / 24) + 1;
if (v6 < 1000) {
_root.mcGUI['bonus_slot' + (v4 + 1)].tf.text = v6;
if (v6 < 10) {
_root.mcGUI['bonus_slot' + (v4 + 1)].tf.text = '0' + v6;
}
} else {
_root.mcGUI['bonus_slot' + (v4 + 1)].tf.text = '';
}
var v8 = _global.bonusTime[this.m_iActiveBonusType[v4]];
if (this.m_iActiveBonusTime[v4] < v8 * 0.2) {
--_root.mcGUI['bonus_slot' + (v4 + 1)].flash_time;
if (_root.mcGUI['bonus_slot' + (v4 + 1)].flash_time <= 0) {
_root.mcGUI['bonus_slot' + (v4 + 1)].flash_time = 6;
_root.mcGUI['bonus_slot' + (v4 + 1)]._visible = !_root.mcGUI['bonus_slot' + (v4 + 1)]._visible;
}
}
if (this.m_iActiveBonusTime[v4] <= 0) {
this.carBonusDrop(v4);
}
}
v4 += 1;
}
var v13 = _root.mcActionGame.getNearestNodeIndex(this.m_fX, this.m_fY, this.m_iLastNode);
var v10 = _root.mcActionGame.getTrackNode(v13 + _root.mcActionGame.m_iNodeSteps);
this.m_fNodeX = v10.x;
this.m_fNodeY = v10.y;
this.m_iLastNode = v13;
var v11 = _root.mcActionGame.getTrackNode(this.m_iLastNode);
var v12 = _root.mcActionGame.getTrackNode(this.m_iLastNode + _root.mcActionGame.m_iNodeSteps);
var v15 = v12.x - v11.x;
var v14 = v12.y - v11.y;
if (this.m_immuneToCollision <= 0) {
this.m_fNeedAngle1_bot = _global.vecGetAngle(1, 0, v15, v14);
}
if (this.m_iBlockControlTime > 0) {
this.m_iBlockControlTime -= 1;
}
this.m_iTimeFromLastCollision += 1;
if (this.m_bIsNitroEffect && this.m_bIsNitroIncSpeed) {
this.carChangeSpeed(this.m_acc1 * 4);
if (this.carGetSpeed() >= this.m_iNitroMaxSpeed) {
this.m_bIsNitroIncSpeed = false;
this.carSetSpeed(this.m_iNitroMaxSpeed);
}
}
if (this.carGetSpeed() == 0) {
this.carStopWheel();
} else {
this.carPlayWheel();
}
switch (this.m_iAIType) {
case 1:
this.carThink_Player();
if (_global.gameMode == 2) {
_root.mcActionGame.gameSavePositionForShadowCar(this.m_fX, this.m_fY, this.m_fAngle, this.m_fWheelAngle, this.m_iLastNode);
}
break;
case 2:
this.carThink_ShadowBot();
break;
case 0:
default:
this.carThink_Bot();
}
this.carUpdateLap();
this.carSetMovieClip();
if (this.m_arLastCollision.length != 0) {
this.m_iPointFlashTime -= 1;
if (this.m_iPointFlashTime <= 0) {
this.m_iPointFlashTime = 6;
v4 = 0;
while (v4 < this.m_arLastCollision.length) {
var v7 = this.m_arLastCollision[v4].indx;
var v5 = this.m_mcObj['c' + v7];
_loc0_ = 20;
v5._yscale = 20;
v5._xscale = _loc0_;
if (v5._alpha == 0) {
v5._alpha = 100;
} else {
v5._alpha = 0;
}
v4 += 1;
}
}
}
this.m_mcObj.stop_sign._visible = false;
if (this.m_iAIType == 1) {
if (this.carGetSpeed() >= this.m_max_speed1 * 0.7 && this.m_fWheelAngle != 0) {
this.carAddSled('bWheel1', 0);
this.carAddSled('bWheel2', 1);
}
var v9 = this.carGetWheelGlobalPos('bWheel1');
this.m_fLastSledX[0] = v9.x;
this.m_fLastSledY[0] = v9.y;
v9 = this.carGetWheelGlobalPos('bWheel2');
this.m_fLastSledX[1] = v9.x;
this.m_fLastSledY[1] = v9.y;
}
};
v2.carGetWheelGlobalPos = function (wheel_name) {
var v4 = this.m_mcObj[wheel_name]._x;
var v5 = this.m_mcObj[wheel_name]._y;
var v3 = {'x': v4, 'y': v5};
this.m_mcObj.localToGlobal(v3);
_root.mcActionGame.m_mcTrack.globalToLocal(v3);
return v3;
};
v2.carAddSled = function (wheel_name, wheel_index) {
var v3 = this.carGetWheelGlobalPos(wheel_name);
var sled = _root.mcActionGame.m_mcTrack.sledClip.createEmptyMovieClip('sled_mc', _root.mcActionGame.m_mcTrack.sledClip.getNextHighestDepth());
sled.lineStyle(16, 0, 30, false, 'none', 'none', 'round', 1);
sled.moveTo(this.m_fLastSledX[wheel_index], this.m_fLastSledY[wheel_index]);
sled.lineTo(v3.x, v3.y);
sled.waitBeforeFade = 48;
sled.onEnterFrame = function () {
if (sled.waitBeforeFade > 0) {
--sled.waitBeforeFade;
} else {
this._alpha -= 4;
}
if (this._alpha <= 0) {
this.removeMovieClip();
}
};
this.m_fLastSledX[wheel_index] = v3.x;
this.m_fLastSledY[wheel_index] = v3.y;
};
v2.carThink_Player = function () {
var v12 = this.m_friction1;
var v4 = this.m_wheel_omega1;
var v3 = this.m_max_wheel_ang1;
var v5 = this.m_acc1;
var v22 = this.m_max_speed1;
var v23 = this.m_dir_omega1;
var v21 = this.m_min_speed_for_rotate1;
var v20 = this.m_speed_for_break_when_rotate1;
var v14 = this.m_add_friction_min1;
var v10 = this.m_add_friction_max1;
var v11 = this.m_speed_add_friction_min1;
var v18 = this.m_speed_add_friction_max1;
var v17 = this.m_collision_speed_lost_coeff1;
var v8 = this.m_block_control_time1;
var v16 = this.m_min_speed_for_drift1;
var v15 = this.m_min_wheel_angle_for_drift1;
var v13 = this.m_max_wheel_angle_for_drift1;
var v9 = this.m_drift_coeff_min1;
var v19 = this.m_drift_coeff_max1;
if (Key.isDown(37) && this.m_iBlockControlTime <= 0) {
this.m_fWheelAngle -= v4;
if (this.m_fWheelAngle < -v3) {
this.m_fWheelAngle = -v3;
}
} else {
if (Key.isDown(39) && this.m_iBlockControlTime <= 0) {
this.m_fWheelAngle += v4;
if (this.m_fWheelAngle > v3) {
this.m_fWheelAngle = v3;
}
}
}
if (Key.isDown(38) && this.m_iBlockControlTime <= 0) {
if (!this.m_bIsNitroEffect) {
var v7 = this.carGetSpeed();
this.carChangeSpeed(v5);
if (v7 <= 0 && this.carGetSpeed() > 0) {
_global.playSound('sndEngine');
}
}
} else {
if (Key.isDown(40) && this.m_iBlockControlTime <= 0) {
this.carChangeSpeed(-v5);
}
}
this.carCalculateMove();
var v6 = this.carCalculateCollisionsAndReactions();
if (this.m_bIsCollisionInPreFrame && v6) {
this.m_iNumFramesInStack += 1;
} else {
this.m_iNumFramesInStack = 0;
}
this.m_bIsCollisionInPreFrame = v6;
if (this.m_iNumFramesInStack >= 24) {
this.m_fX = this.m_fNodeX;
this.m_fY = this.m_fNodeY;
this.carSetSpeed(0);
}
};
v2.carThink_ShadowBot = function () {
var v3 = _root.mcActionGame.gameGetNextSavedPosition();
if (v3 == null) {
return undefined;
}
this.m_fX = v3.x;
this.m_fY = v3.y;
this.m_fAngle = v3.angle;
this.m_fWheelAngle = v3.wangle;
this.m_iLastNode = v3.node;
this.m_iCurLap = 1;
};
v2.carThink_Bot = function () {
var v24 = this.m_friction1;
var v26 = this.m_wheel_omega1;
var v21 = this.m_max_wheel_ang1;
var v11 = this.m_acc1;
var v13 = this.m_max_speed1;
var v5 = this.m_dir_omega1;
var v9 = this.m_min_speed_for_rotate1;
var v19 = this.m_speed_for_break_when_rotate1;
var v25 = this.m_add_friction_min1;
var v22 = this.m_add_friction_max1;
var v14 = this.m_speed_add_friction_min1;
var v18 = this.m_speed_add_friction_max1;
var v16 = this.m_collision_speed_lost_coeff1;
var v23 = this.m_block_control_time1;
var v12 = this.m_min_speed_for_drift1;
var v27 = this.m_min_wheel_angle_for_drift1;
var v20 = this.m_max_wheel_angle_for_drift1;
var v17 = this.m_drift_coeff_min1;
var v15 = this.m_drift_coeff_max1;
if (this.m_iBlockControlTime <= 0) {
this.m_bIsIgnoreCollision = false;
if (this.m_iBotAfterCollisionTime > 0) {
this.m_fNeedAngle1_bot = _global.vecGetAngle(1, 0, this.m_fNodeX - this.m_fX, this.m_fNodeY - this.m_fY);
this.m_iBotAfterCollisionTime -= 1;
this.m_bIsIgnoreCollision = true;
}
var v10 = Math.abs(this.m_fNeedAngle1_bot - this.m_fAngle);
if (v10 > 5 && Math.abs(this.carGetSpeed()) >= v9) {
var v3 = this.m_fAngle;
var v4 = this.m_fNeedAngle1_bot;
if (v3 < 0) {
v3 = 360 + v3;
}
if (v4 < 0) {
v4 = 360 + v4;
}
var v6 = Math.abs(v4 - v3);
var v8 = 360 - v6;
if (v6 < v8) {
if (v3 > v4) {
v3 -= v5;
if (v3 < 0) {
v3 += 360;
}
if (v3 < v4) {
v3 = v4;
}
} else {
if (v3 < v4) {
v3 += v5;
if (v3 >= 360) {
v3 -= 360;
}
if (v3 > v4) {
v3 = v4;
}
}
}
} else {
if (v6 > v8) {
if (v3 > v4) {
v3 += v5;
if (v3 >= 360) {
v3 -= 360;
}
if (v3 < v4) {
v3 = v4;
}
} else {
if (v3 < v4) {
v3 -= v5;
if (v3 < 0) {
v3 += 360;
}
if (v3 > v4) {
v3 = v4;
}
}
}
}
}
if (v3 > 180) {
v3 -= 360;
}
this.m_fAngle = v3;
}
if (!this.m_bIsNitroEffect) {
this.carChangeSpeed(v11);
}
}
this.carCalculateMove();
var v7 = this.carCalculateCollisionsAndReactions();
if (this.m_bIsCollisionInPreFrame && v7) {
this.m_iNumFramesInStack += 1;
} else {
this.m_iNumFramesInStack = 0;
}
this.m_bIsCollisionInPreFrame = v7;
if (v7) {
this.m_iBotAfterCollisionTime = 24;
}
if (this.m_iNumFramesInStack >= 24) {
this.m_fX = this.m_fNodeX;
this.m_fY = this.m_fNodeY;
this.carSetSpeed(0);
}
};
v2.carSetPhysicSettings = function (obj) {
if (obj.drivername != undefined) {
this.m_drivername = obj.drivername;
}
if (obj.carname != undefined) {
this.m_carname = obj.carname;
}
if (obj.friction1 != undefined) {
this.m_friction1 = obj.friction1;
}
if (obj.wheel_omega1 != undefined) {
this.m_wheel_omega1 = obj.wheel_omega1;
}
if (obj.max_wheel_ang1 != undefined) {
this.m_max_wheel_ang1 = obj.max_wheel_ang1;
}
if (obj.acc1 != undefined) {
this.m_acc1 = obj.acc1;
}
if (obj.max_speed1 != undefined) {
this.m_max_speed1 = obj.max_speed1;
}
if (obj.dir_omega1 != undefined) {
this.m_dir_omega1 = obj.dir_omega1;
}
if (obj.min_speed_for_rotate1 != undefined) {
this.m_min_speed_for_rotate1 = obj.min_speed_for_rotate1;
}
if (obj.speed_for_break_when_rotate1 != undefined) {
this.m_speed_for_break_when_rotate1 = obj.speed_for_break_when_rotate1;
}
if (obj.add_friction_min1 != undefined) {
this.m_add_friction_min1 = obj.add_friction_min1;
}
if (obj.add_friction_max1 != undefined) {
this.m_add_friction_max1 = obj.add_friction_max1;
}
if (obj.speed_add_friction_min1 != undefined) {
this.m_speed_add_friction_min1 = obj.speed_add_friction_min1;
}
if (obj.speed_add_friction_max1 != undefined) {
this.m_speed_add_friction_max1 = obj.speed_add_friction_max1;
}
if (obj.collision_speed_lost_coeff1 != undefined) {
this.m_collision_speed_lost_coeff1 = obj.collision_speed_lost_coeff1;
}
if (obj.block_control_time1 != undefined) {
this.m_block_control_time1 = obj.block_control_time1;
}
if (obj.min_speed_for_drift1 != undefined) {
this.m_min_speed_for_drift1 = obj.min_speed_for_drift1;
}
if (obj.min_wheel_angle_for_drift1 != undefined) {
this.m_min_wheel_angle_for_drift1 = obj.min_wheel_angle_for_drift1;
}
if (obj.max_wheel_angle_for_drift1 != undefined) {
this.m_max_wheel_angle_for_drift1 = obj.max_wheel_angle_for_drift1;
}
if (obj.drift_coeff_min1 != undefined) {
this.m_drift_coeff_min1 = obj.drift_coeff_min1;
}
if (obj.drift_coeff_max1 != undefined) {
this.m_drift_coeff_max1 = obj.drift_coeff_max1;
}
this.m_iNitroMaxSpeed = this.m_max_speed1 + this.m_max_speed1 * 0.3;
};
v2.getVel = function () {
var v3 = this.carGetSpeed();
v3 = _global.roundTo(v3, 0.01);
return v3;
};
v2.carSetAIType = function (ai) {
this.m_iAIType = ai;
};
v2.carGetAIType = function () {
return this.m_iAIType;
};
v2.carSetMovieClip = function () {
this.m_mcObj._x = this.m_fX;
this.m_mcObj._y = this.m_fY;
this.m_mcObj._rotation = this.m_fAngle;
if (this.m_mcArrow) {
this.m_mcArrow._x = this.m_fX;
this.m_mcArrow._y = this.m_fY;
this.m_mcArrow._rotation = this.m_fNeedAngle1_bot;
}
this.m_mcObj.fWheel1._rotation = this.m_fWheelAngle;
this.m_mcObj.fWheel2._rotation = this.m_fWheelAngle;
if (this.m_iAIType == 0) {
this.m_mcObj.fWheel1._rotation = this.m_fFakeWheelAngle;
this.m_mcObj.fWheel2._rotation = this.m_fFakeWheelAngle;
}
};
v2.carDelete = function () {
this.m_mcObj.removeMovieClip();
if (this.m_mcArrow) {
this.m_mcArrow.removeMovieClip();
}
};
v2.carUpdateLap = function () {
var v6 = this.m_iLastNode;
var v4 = _root.mcActionGame.getNearestNodeIndex(this.m_fX, this.m_fY, this.m_iLastNode);
var v8 = 20;
var v5 = 100;
if (v6 > v5 && v4 < v8) {
this.m_iRowLap += 1;
} else {
if (v6 < v8 && v4 > v5) {
this.m_iRowLap -= 1;
}
}
if (this.m_iRowLap > this.m_iCurLap) {
this.m_iCurLap = this.m_iRowLap;
if (this.m_iAIType == 0) {
this.m_fAngle = this.m_fStartAngle;
}
if (this.m_iCurLap > 1) {
if (this.m_iBestLap > this.m_iLapTime) {
this.m_iBestLap = this.m_iLapTime;
}
if (this.m_iAIType == 1) {
var v9 = 'lap ' + this.m_iCurLap + ' of ' + _root.mcActionGame.m_iMaxNumLap;
if (this.m_iCurLap == _root.mcActionGame.m_iMaxNumLap) {
v9 = 'LAST LAP';
}
trace('lap time ' + _global.formTimeStr(this.m_iLapTime));
trace('best time ' + _global.formTimeStr(this.m_iBestLap));
if (this.m_iCurLap == _root.mcActionGame.m_iMaxNumLap + 1) {
_root.mcActionGame.gameEndRace();
} else {
_root.mcGUI.mcLastLap._visible = true;
_root.mcGUI.mcLastLap.gotoAndPlay(2);
var v7 = this.m_iCurLap - 1;
if (this.m_iCurLap == _root.mcActionGame.m_iMaxNumLap) {
v7 = 4;
}
_root.mcGUI.mcLastLap.msg.gotoAndStop(v7);
_root.mcActionGame.gameResetAllBonuses();
_global.playSound('sndCount2');
}
}
}
this.m_iLapTime = 0;
this.m_iTimeStart = getTimer();
}
};
v2.carSimpleCollisionTest = function (hitClip, points, bIsWithShape) {
var v3 = false;
var v1 = 0;
while (v1 < points.length) {
v3 = hitClip.hitTest(points[v1].x, points[v1].y, bIsWithShape);
if (v3) {
break;
}
v1 += 1;
}
return v3;
};
v2.carCollisionTest = function (hitClip, points, bIsWithShape, rpoints) {
var v1 = 0;
while (v1 < points.length) {
var v3 = hitClip.hitTest(points[v1].x, points[v1].y, bIsWithShape);
if (v3) {
rpoints.push(points[v1]);
}
v1 += 1;
}
};
v2.carPrepareCollisionPoints = function (points_array) {
var v2 = 0;
while (this.m_mcObj['c' + v2] != undefined) {
var v3 = this.m_mcObj['c' + v2];
var v4 = {'x': v3._x, 'y': v3._y, 'indx': v2};
this.m_mcObj.localToGlobal(v4);
points_array.push(v4);
v2 += 1;
}
};
v2.carShowHideCollisionPoints = function () {
var v2 = 0;
while (this.m_mcObj['c' + v2] != undefined) {
var v3 = this.m_mcObj['c' + v2];
v3._visible = !v3._visible;
v2 += 1;
}
};
v2.carCalculateMove = function () {
var v6 = this.m_friction1;
var v29 = this.m_wheel_omega1;
var v31 = this.m_max_wheel_ang1;
var v24 = this.m_acc1;
var v28 = this.m_max_speed1;
var v4 = this.m_dir_omega1;
var v26 = this.m_min_speed_for_rotate1;
var v23 = this.m_speed_for_break_when_rotate1;
var v16 = this.m_add_friction_min1;
var v18 = this.m_add_friction_max1;
var v11 = this.m_speed_add_friction_min1;
var v7 = this.m_speed_add_friction_max1;
var v30 = this.m_collision_speed_lost_coeff1;
var v32 = this.m_block_control_time1;
var v19 = this.m_min_speed_for_drift1;
var v14 = this.m_min_wheel_angle_for_drift1;
var v9 = this.m_max_wheel_angle_for_drift1;
var v21 = this.m_drift_coeff_min1;
var v22 = this.m_drift_coeff_max1;
var v15 = Math.abs(this.carGetSpeed());
if (v15 > v26 && this.m_fWheelAngle != 0) {
if (v15 >= v23) {
v6 = v24;
if (this.carGetSpeed() >= v11 && this.carGetSpeed() <= v7) {
v6 += _global.lineInterpolation(v16, v18, v11, v7, this.carGetSpeed());
} else {
if (this.carGetSpeed() > v7) {
v6 += _global.lineInterpolation(v16, v18, v11, v7, v7);
}
}
}
if (this.m_fWheelAngle > 0) {
if (this.carGetSpeed() > 0) {
this.m_fAngle += v4;
} else {
this.m_fAngle -= v4;
}
this.m_fWheelAngle -= v4;
if (this.m_fWheelAngle < 0) {
this.m_fWheelAngle = 0;
}
} else {
if (this.m_fWheelAngle < 0) {
if (this.carGetSpeed() > 0) {
this.m_fAngle -= v4;
} else {
this.m_fAngle += v4;
}
this.m_fWheelAngle += v4;
if (this.m_fWheelAngle > 0) {
this.m_fWheelAngle = 0;
}
}
}
}
var v17 = (this.m_fAngle / 180) * Math.PI;
var v12 = Math.cos(v17);
var v10 = Math.sin(v17);
var v25 = _global.vecGetAngle(1, 0, v12, v10);
this.m_fAngle = v25;
var v8 = new CVector2D();
v8.setVector(v12, v10);
v8.Rotate(90);
var v3 = 0;
if (this.carGetSpeed() >= v19) {
var v5 = Math.abs(this.m_fWheelAngle);
if (v5 > v9) {
v5 = v9;
}
if (v5 >= v14 && v5 <= v9) {
v3 = _global.lineInterpolation(v21, v22, v14, v9, v5);
}
}
var v13 = 1 - v3;
if (this.m_fWheelAngle > 0) {
v3 = -v3;
}
if (this.carGetSpeed() > 0) {
this.carChangeSpeed(-v6);
if (this.carGetSpeed() < 0) {
this.carSetSpeed(0);
}
} else {
if (this.carGetSpeed() < 0) {
this.carChangeSpeed(v6);
if (this.carGetSpeed() > 0) {
this.carSetSpeed(0);
}
}
}
var v20 = this.carGetSpeed() * (v13 * v12 + v3 * v8.m_fX);
var v27 = this.carGetSpeed() * (v13 * v10 + v3 * v8.m_fY);
this.m_fX += v20;
this.m_fY += v27;
this.carSetMovieClip();
};
v2.carCalculateCollisionsAndReactions = function () {
if (this.m_bIsIgnoreCollision) {
return false;
}
var v13 = this.m_friction1;
var v20 = this.m_wheel_omega1;
var v26 = this.m_max_wheel_ang1;
var v15 = this.m_acc1;
var v17 = this.m_max_speed1;
var v23 = this.m_dir_omega1;
var v27 = this.m_min_speed_for_rotate1;
var v14 = this.m_speed_for_break_when_rotate1;
var v19 = this.m_add_friction_min1;
var v28 = this.m_add_friction_max1;
var v29 = this.m_speed_add_friction_min1;
var v24 = this.m_speed_add_friction_max1;
var v10 = this.m_collision_speed_lost_coeff1;
var v11 = this.m_block_control_time1;
var v22 = this.m_min_speed_for_drift1;
var v21 = this.m_min_wheel_angle_for_drift1;
var v16 = this.m_max_wheel_angle_for_drift1;
var v25 = this.m_drift_coeff_min1;
var v18 = this.m_drift_coeff_max1;
var v8 = new Array();
this.carPrepareCollisionPoints(v8);
var v4 = 0;
while (v4 < _root.mcActionGame.m_arDObj.length) {
var v6 = _root.mcActionGame.m_arDObj[v4];
if (!v6.dead) {
if (this.carSimpleCollisionTest(v6, v8, true) != false) {
v6.gotoAndPlay('die');
v6.dead = true;
if (_root.mcActionGame.gameIsOnScreen(this.m_fX, this.m_fY)) {
_global.playSound('sndDestroy');
}
}
}
v4 += 1;
}
v4 = 0;
while (_root.mcActionGame.m_mcTrack['b' + v4] != undefined) {
var v5 = _root.mcActionGame.m_mcTrack['b' + v4];
if (!v5.dead) {
if (this.carSimpleCollisionTest(v5, v8, true) != false) {
v5.dead = true;
v5.gotoAndPlay('die');
this.carBonusTaken(v5.bonus_type);
}
}
v4 += 1;
}
if (_global.track_collision_on == false) {
return undefined;
}
var v9 = new Array();
var v12 = _root.mcActionGame.getHitClip();
this.carCollisionTest(v12, v8, true, v9);
if (v9.length == 0) {
return false;
}
this.m_fX = this.m_fPreX;
this.m_fY = this.m_fPreY;
this.m_fAngle = this.m_fPreAngle;
this.carSetSpeed(-this.carGetSpeed() * v10);
this.m_iBlockControlTime = v11;
if (_root.mcActionGame.gameIsOnScreen(this.m_fX, this.m_fY) && this.m_iTimeFromLastCollision > 24) {
_global.playSound('sndCrash');
}
this.m_iTimeFromLastCollision = 0;
if (this.m_iAIType == 0) {
_root.mcActionGame.m_iNumBotCollisions += 1;
}
delete this.m_arLastCollision;
this.m_arLastCollision = new Array();
v4 = 0;
while (v4 < v9.length) {
this.m_arLastCollision.push(v9[v4]);
v4 += 1;
}
v4 = 0;
while (this.m_mcObj['c' + v4] != undefined) {
var v7 = this.m_mcObj['c' + v4];
v7._yscale = 10;
v7._xscale = 10;
v7._alpha = 100;
v4 += 1;
}
return true;
};
v2.carStopWheel = function () {
this.m_mcObj.fWheel1.wbody.stop();
this.m_mcObj.fWheel2.wbody.stop();
this.m_mcObj.bWheel1.wbody.stop();
this.m_mcObj.bWheel2.wbody.stop();
};
v2.carPlayWheel = function () {
this.m_mcObj.fWheel1.wbody.play();
this.m_mcObj.fWheel2.wbody.play();
this.m_mcObj.bWheel1.wbody.play();
this.m_mcObj.bWheel2.wbody.play();
};
v2.carBonusTaken = function (bonus_type) {
trace('try to take bonus ' + bonus_type + '...');
if (bonus_type < 0 || bonus_type > 1) {
trace('unknow bonus!');
return undefined;
}
var v7 = false;
var v4 = 0;
while (v4 < this.m_iActiveBonusType.length) {
if (this.m_iActiveBonusType[v4] == bonus_type) {
this.m_iActiveBonusTime[v4] = _global.bonusTime[bonus_type];
if (this.m_iAIType == 1) {
_root.mcGUI['bonus_slot' + (v4 + 1)]._visible = true;
_root.mcGUI['bonus_slot' + (v4 + 1)].flash_time = 0;
}
v7 = true;
trace('this bonus is already taken(index = ' + v4 + '). Update it time.');
break;
}
v4 += 1;
}
if (v7) {
return undefined;
}
var v6 = -1;
trace('try to find free slot...');
v4 = 0;
while (v4 < this.m_iActiveBonusType.length) {
if (this.m_iActiveBonusType[v4] < 0) {
v6 = v4;
break;
}
v4 += 1;
}
if (v6 < 0) {
trace('too many bonuses is already active! Can\'t take new one!');
return undefined;
}
trace('Add bonus in slot with index ' + v6);
this.m_iActiveBonusType[v6] = bonus_type;
this.m_iActiveBonusTime[v6] = _global.bonusTime[bonus_type];
switch (bonus_type) {
case 0:
this.m_bIsNitroEffect = true;
this.m_bIsNitroIncSpeed = true;
this.carSetSpeed(this.m_max_speed1 + 1);
this.m_mcObj.turbo._visible = true;
if (this.m_iAIType == 1) {
_root.mcGUI.mcLastLap._visible = true;
_root.mcGUI.mcLastLap.gotoAndPlay(2);
_root.mcGUI.mcLastLap.msg.gotoAndStop(5);
_global.playSound('sndNitroStart');
}
break;
case 1:
this.m_speed_for_break_when_rotate1 *= 1000;
}
if (this.m_iAIType == 1) {
_root.mcGUI['bonus_slot' + (v6 + 1)]._visible = true;
_root.mcGUI['bonus_slot' + (v6 + 1)].gotoAndStop(_global.bonusNames[bonus_type]);
_root.mcGUI['bonus_slot' + (v6 + 1)].flash_time = 0;
}
};
v2.carBonusDrop = function (bonus_index) {
if (bonus_index < 0 || bonus_index > this.m_iActiveBonusType.length - 1) {
return undefined;
}
if (this.m_iActiveBonusType[bonus_index] < 0 || this.m_iActiveBonusType[bonus_index] > 1) {
return undefined;
}
var v5 = this.m_iActiveBonusType[bonus_index];
switch (v5) {
case 0:
this.m_bIsNitroEffect = false;
this.m_bIsNitroIncSpeed = false;
this.m_mcObj.turbo._visible = false;
break;
case 1:
this.m_speed_for_break_when_rotate1 /= 1000;
}
trace('Drop bonus ' + this.m_iActiveBonusType[bonus_index] + ' at slot ' + bonus_index);
this.m_iActiveBonusType[bonus_index] = -1;
this.m_iActiveBonusTime[bonus_index] = 0;
if (this.m_iAIType == 1) {
_root.mcGUI['bonus_slot' + (bonus_index + 1)]._visible = false;
_root.mcGUI['bonus_slot' + (bonus_index + 1)].flash_time = 0;
_global.playSound('sndNitroEnd');
}
};
v2.carBonusDropAll = function () {
var v2 = 0;
while (v2 < this.m_iActiveBonusType.length) {
this.carBonusDrop(this.m_iActiveBonusType[v2]);
v2 += 1;
}
};
v2.carChangeSpeed = function (acc) {
var v2 = this.m_fSpeed1 + acc;
this.carSetSpeed(v2);
};
v2.carSetSpeed = function (new_speed) {
var v3 = this.m_max_speed1;
this.m_fSpeed1 = new_speed;
if (this.m_fSpeed1 > v3) {
if (!this.m_bIsNitroEffect) {
this.m_fSpeed1 = v3;
}
} else {
if (this.m_fSpeed1 < -v3) {
this.m_fSpeed1 = -v3;
}
}
if (this.m_bIsNitroEffect && this.m_fSpeed1 <= v3) {
var v2 = 0;
while (v2 < this.m_iActiveBonusType.length) {
if (this.m_iActiveBonusType[v2] == 0) {
this.carBonusDrop(v2);
break;
}
v2 += 1;
}
}
};
v2.carGetSpeed = function () {
return this.m_fSpeed1;
};
v2.setStartPointName = function (sp_name) {
this.m_spName = sp_name;
};
v2.setCarClipName = function (nm) {
this.m_mcCarName = nm;
};
v2.getCarClipName = function () {
return this.m_mcCarName;
};
v2.m_iAIType = 0;
v2.m_mcObj = null;
v2.m_mcArrow = null;
v2.m_fX = 0;
v2.m_fY = 0;
v2.m_fAngle = 0;
v2.m_fPreX = 0;
v2.m_fPreY = 0;
v2.m_fPreAngle = 0;
v2.m_fWheelAngle = 0;
v2.m_fStartX = 0;
v2.m_fStartY = 0;
v2.m_fStartAngle = 0;
v2.m_iLiveFrames = 0;
v2.m_iBlockControlTime = 0;
v2.m_iCurLap = 0;
v2.m_iRowLap = 0;
v2.m_iPointFlashTime = 0;
v2.m_fNodeX = -1;
v2.m_fNodeY = -1;
v2.m_iLastNode = -1;
v2.m_bIsCollisionInPreFrame = false;
v2.m_iNumFramesInStack = 0;
v2.m_iBotAfterCollisionTime = 0;
v2.m_fFakeWheelAngle = 0;
v2.m_iCurPlace = 1;
v2.m_iBestLap = 100000;
v2.m_iLapTime = 0;
v2.m_iTimeStart = 0;
v2.m_fSpeed1 = 0;
v2.m_drivername = 'unknow';
v2.m_carname = 'unknow';
v2.m_friction1 = 0.25;
v2.m_wheel_omega1 = 6;
v2.m_max_wheel_ang1 = 30;
v2.m_acc1 = 0.75;
v2.m_max_speed1 = 15;
v2.m_dir_omega1 = 4;
v2.m_min_speed_for_rotate1 = 3;
v2.m_speed_for_break_when_rotate1 = 3;
v2.m_add_friction_min1 = 0.25;
v2.m_add_friction_max1 = 0.25;
v2.m_speed_add_friction_min1 = 8;
v2.m_speed_add_friction_max1 = 15;
v2.m_collision_speed_lost_coeff1 = 0.5;
v2.m_block_control_time1 = 12;
v2.m_min_speed_for_drift1 = 1000;
v2.m_min_wheel_angle_for_drift1 = 40;
v2.m_max_wheel_angle_for_drift1 = 40;
v2.m_drift_coeff_min1 = 0;
v2.m_drift_coeff_max1 = 0;
v2.m_fNeedAngle1_bot = 0;
v2.m_bIsIgnoreCollision = false;
ASSetPropFlags(_global.CCar.prototype, null, 1);
}
#endinitclip
}
movieClip 801 __Packages.CVector2D {
#initclip
if (!_global.CVector2D) {
var v1 = function () {
this.m_fX = 0;
this.m_fY = 0;
};
_global.CVector2D = v1;
var v2 = v1.prototype;
v2.setVector = function (x, y) {
this.m_fX = x;
this.m_fY = y;
};
v2.setX = function (x) {
this.m_fX = x;
};
v2.getX = function () {
return this.m_fX;
};
v2.setY = function (y) {
this.m_fY = y;
};
v2.getY = function () {
return this.m_fY;
};
v2.getLengthPow2 = function () {
var v2 = this.m_fX * this.m_fX + this.m_fY * this.m_fY;
return v2;
};
v2.getLength = function () {
var v2 = this.getLengthPow2();
var v3 = Math.sqrt(v2);
return v3;
};
v2.calcLength = function (px, py) {
var v2 = px * px + py * py;
var v1 = Math.sqrt(v2);
return v1;
};
v2.Normalize = function () {
var v2 = this.getLength();
if (v2 == 0) {
return undefined;
}
this.m_fX /= v2;
this.m_fY /= v2;
};
v2.Add = function (add_x, add_y) {
this.m_fX += add_x;
this.m_fY += add_y;
};
v2.AddX = function (add_x) {
this.m_fX += add_x;
};
v2.AddY = function (add_y) {
this.m_fY += add_y;
};
v2.Scale = function (scale_x, scale_y) {
this.m_fX *= scale_x;
this.m_fY *= scale_y;
};
v2.ScaleX = function (scale_x) {
this.m_fX *= scale_x;
};
v2.ScaleY = function (scale_y) {
this.m_fY *= scale_y;
};
v2.DotProduct = function (vec2_x, vec2_y) {
var v2 = this.m_fX * vec2_x + this.m_fY * vec2_y;
return v2;
};
v2.getAngle = function (dir_x, dir_y) {
var v3 = this.getLength();
if (v3 == 0) {
return 0;
}
var v2 = this.calcLength(dir_x, dir_y);
if (v2 == 0) {
return 0;
}
var v6 = this.DotProduct(dir_x, dir_y);
var v4 = Math.acos(v6);
var v5 = v4 * 180 / Math.PI;
return v5;
};
v2.Rotate = function (ang) {
var v5 = ang * Math.PI / 180;
var v3 = Math.sin(v5);
var v4 = Math.cos(v5);
v4 = _global.roundTo(v4, 0.0001);
v3 = _global.roundTo(v3, 0.0001);
this.m_fX = _global.roundTo(this.m_fX, 0.0001);
this.m_fY = _global.roundTo(this.m_fY, 0.0001);
var v6 = this.m_fX;
var v7 = this.m_fY;
this.m_fX = v6 * v4 - v7 * v3;
this.m_fY = v7 * v4 + v6 * v3;
};
ASSetPropFlags(_global.CVector2D.prototype, null, 1);
}
#endinitclip
}
// unknown tag 88 length 282
movieClip 615 {
}
movieClip 616 {
}
instance of movieClip 616 {
onClipEvent (load) {
_alpha = 0;
}
onClipEvent (enterFrame) {
t = _root.getBytesTotal();
l = _root.getBytesLoaded();
bar._xscale = 100 * l / t;
p = Math.round(1000 * l / t) / 10;
if (p == Math.floor(p)) {
p += '.0';
}
p += '%';
tf.text = p;
if (t > 0) {
if (l < t && _alpha < 100) {
_alpha = _alpha + 5;
}
if (l == t && _alpha > 0) {
_alpha = _alpha - 5;
}
}
}
}
frame 3 {
stop();
}
movieClip 619 {
}
instance of movieClip 619 {
onClipEvent (load) {
_alpha = 0;
state = 0;
_root.stop();
}
onClipEvent (enterFrame) {
l = _root.getBytesLoaded();
t = _root.getBytesTotal();
if (state == 0) {
_alpha = _alpha + _root.loaderAnimDelta;
if (_alpha >= 100) {
_alpha = 100;
state = 1;
startPause = getTimer();
}
} else {
if (state == 1 && t == l && l > 10 && getTimer() - startPause > _root.loaderAnimPause) {
var cur_frame = _root.fade_clip._currentframe;
if (cur_frame == 1) {
_root.fade_clip.gotoAndPlay(2);
}
if (cur_frame == 25) {
_root.gotoAndStop('menu');
}
}
}
}
}
frame 10 {
}
movieClip 623 {
}
button 628 {
on (press) {
onNewGame();
}
on (rollOver) {
_global.playSound('sndButton');
}
}
button 633 {
on (press) {
onHelp();
}
on (rollOver) {
_global.playSound('sndButton');
}
}
button 638 {
on (press) {
onMoreFreeGames();
}
on (rollOver) {
_global.playSound('sndButton');
}
}
button 640 {
on (press) {
this._parent.soundOff();
this.gotoAndStop(2);
}
}
button 642 {
on (press) {
this._parent.soundOn();
this.gotoAndStop(1);
}
}
movieClip 643 {
frame 1 {
this.stop();
_root.mcMusic.gotoAndPlay('start_1');
_global.enableSound(true);
}
frame 2 {
this.stop();
_root.mcMusic.gotoAndPlay('stop_1');
_global.enableSound(false);
}
}
button 650 {
on (press) {
onMainMenu_Help();
}
on (rollOver) {
_global.playSound('sndButton');
}
}
button 655 {
on (press) {
onChampionship();
}
on (rollOver) {
_global.playSound('sndButton');
}
}
button 660 {
on (press) {
onShadowRace();
}
on (rollOver) {
_global.playSound('sndButton');
}
}
button 665 {
on (press) {
onTrial();
}
on (rollOver) {
_global.playSound('sndButton');
}
}
button 666 {
on (press) {
onMainMenu_SelectGame();
}
on (rollOver) {
_global.playSound('sndButton');
}
}
button 671 {
on (press) {
onSingleRace();
}
on (rollOver) {
_global.playSound('sndButton');
}
}
movieClip 676 {
}
movieClip 680 {
}
movieClip 686 {
frame 1 {
stop();
}
instance border_clip of movieClip 680 {
onClipEvent (load) {
_visible = false;
}
}
frame 2 {
stop();
}
frame 3 {
stop();
}
frame 4 {
stop();
}
frame 5 {
stop();
}
frame 6 {
stop();
}
}
button 687 {
on (press) {
onMainMenu_SelectTrack();
}
on (rollOver) {
_global.playSound('sndButton');
}
}
movieClip 688 {
frame 1 {
stop();
}
frame 11 {
stop();
}
frame 21 {
stop();
}
frame 31 {
stop();
}
instance of movieClip 686 {
onClipEvent (load) {
gotoAndStop(1);
this.decAlpha = false;
}
onClipEvent (press) {
onSelectTrack1();
}
onClipEvent (rollOver) {
_global.playSound('sndButton');
this.border_clip._visible = true;
this.decAlpha = true;
}
onClipEvent (enterFrame) {
if (this.decAlpha && this.fade._alpha > 0) {
this.fade._alpha -= 5;
if (this.fade._alpha < 0) {
this.fade._alpha = 0;
}
} else {
if (!this.decAlpha && this.fade._alpha < 70) {
this.fade._alpha += 10;
if (this.fade._alpha > 70) {
this.fade._alpha = 70;
}
}
}
}
onClipEvent (rollOut) {
this.border_clip._visible = false;
this.decAlpha = false;
}
}
instance of movieClip 686 {
onClipEvent (load) {
gotoAndStop(4);
this.decAlpha = false;
}
onClipEvent (press) {
onSelectTrack4();
}
onClipEvent (rollOver) {
_global.playSound('sndButton');
this.border_clip._visible = true;
this.decAlpha = true;
}
onClipEvent (enterFrame) {
if (this.decAlpha && this.fade._alpha > 0) {
this.fade._alpha -= 5;
if (this.fade._alpha < 0) {
this.fade._alpha = 0;
}
} else {
if (!this.decAlpha && this.fade._alpha < 70) {
this.fade._alpha += 10;
if (this.fade._alpha > 70) {
this.fade._alpha = 70;
}
}
}
}
onClipEvent (rollOut) {
this.border_clip._visible = false;
this.decAlpha = false;
}
}
instance of movieClip 686 {
onClipEvent (load) {
gotoAndStop(2);
this.decAlpha = false;
}
onClipEvent (press) {
onSelectTrack2();
}
onClipEvent (rollOver) {
_global.playSound('sndButton');
this.border_clip._visible = true;
this.decAlpha = true;
}
onClipEvent (enterFrame) {
if (this.decAlpha && this.fade._alpha > 0) {
this.fade._alpha -= 5;
if (this.fade._alpha < 0) {
this.fade._alpha = 0;
}
} else {
if (!this.decAlpha && this.fade._alpha < 70) {
this.fade._alpha += 10;
if (this.fade._alpha > 70) {
this.fade._alpha = 70;
}
}
}
}
onClipEvent (rollOut) {
this.border_clip._visible = false;
this.decAlpha = false;
}
}
instance of movieClip 686 {
onClipEvent (load) {
gotoAndStop(5);
this.decAlpha = false;
}
onClipEvent (press) {
onSelectTrack5();
}
onClipEvent (rollOver) {
_global.playSound('sndButton');
this.border_clip._visible = true;
this.decAlpha = true;
}
onClipEvent (enterFrame) {
if (this.decAlpha && this.fade._alpha > 0) {
this.fade._alpha -= 5;
if (this.fade._alpha < 0) {
this.fade._alpha = 0;
}
} else {
if (!this.decAlpha && this.fade._alpha < 70) {
this.fade._alpha += 10;
if (this.fade._alpha > 70) {
this.fade._alpha = 70;
}
}
}
}
onClipEvent (rollOut) {
this.border_clip._visible = false;
this.decAlpha = false;
}
}
instance of movieClip 686 {
onClipEvent (load) {
gotoAndStop(3);
this.decAlpha = false;
}
onClipEvent (press) {
onSelectTrack3();
}
onClipEvent (rollOver) {
_global.playSound('sndButton');
this.border_clip._visible = true;
this.decAlpha = true;
}
onClipEvent (enterFrame) {
if (this.decAlpha && this.fade._alpha > 0) {
this.fade._alpha -= 5;
if (this.fade._alpha < 0) {
this.fade._alpha = 0;
}
} else {
if (!this.decAlpha && this.fade._alpha < 70) {
this.fade._alpha += 10;
if (this.fade._alpha > 70) {
this.fade._alpha = 70;
}
}
}
}
onClipEvent (rollOut) {
this.border_clip._visible = false;
this.decAlpha = false;
}
}
instance of movieClip 686 {
onClipEvent (load) {
gotoAndStop(6);
this.decAlpha = false;
}
onClipEvent (press) {
onSelectTrack6();
}
onClipEvent (rollOver) {
_global.playSound('sndButton');
this.border_clip._visible = true;
this.decAlpha = true;
}
onClipEvent (enterFrame) {
if (this.decAlpha && this.fade._alpha > 0) {
this.fade._alpha -= 5;
if (this.fade._alpha < 0) {
this.fade._alpha = 0;
}
} else {
if (!this.decAlpha && this.fade._alpha < 70) {
this.fade._alpha += 10;
if (this.fade._alpha > 70) {
this.fade._alpha = 70;
}
}
}
}
onClipEvent (rollOut) {
this.border_clip._visible = false;
this.decAlpha = false;
}
}
}
movieClip 698 {
frame 1 {
stop();
}
frame 10 {
gotoAndStop(1);
}
frame 25 {
gotoAndStop(1);
}
frame 35 {
gotoAndStop(1);
}
frame 46 {
gotoAndStop(1);
}
frame 57 {
gotoAndStop(1);
}
frame 65 {
gotoAndStop(1);
}
frame 73 {
gotoAndStop(1);
}
frame 82 {
gotoAndStop(1);
}
frame 93 {
gotoAndStop(1);
}
frame 103 {
gotoAndStop(1);
}
}
movieClip 700 {
frame 1 {
stop();
}
frame 12 {
gotoAndStop(1);
}
frame 25 {
gotoAndStop(1);
}
}
frame 16 {
stop();
}
movieClip 703 {
}
movieClip 709 {
frame 1 {
_root.car._alpha = 0;
}
frame 11 {
_root.car._alpha = 100;
}
}
movieClip 710 {
frame 20 {
_global.playSound('sndCount1');
}
frame 42 {
_global.playSound('sndCount1');
}
frame 66 {
_global.playSound('sndCount1');
}
frame 88 {
_global.playSound('sndCount2');
}
frame 106 {
stop();
}
}
movieClip 713 {
}
movieClip 717 {
frame 1 {
stop();
}
frame 16 {
stop();
}
}
movieClip 719 {
}
movieClip 722 {
}
movieClip 724 {
}
movieClip 726 {
}
movieClip 728 {
}
movieClip 730 {
}
movieClip 731 {
frame 1 {
stop();
}
frame 2 {
stop();
}
frame 3 {
stop();
}
frame 4 {
stop();
}
frame 5 {
stop();
}
frame 6 {
stop();
}
}
movieClip 742 {
frame 1 {
stop();
}
frame 2 {
stop();
}
frame 3 {
stop();
}
frame 4 {
stop();
}
frame 5 {
stop();
}
}
movieClip 743 {
frame 1 {
stop();
}
}
movieClip 751 {
}
movieClip 754 {
}
button 756 {
on (press) {
onMoreFreeGames();
}
on (rollOver) {
_global.playSound('sndButton');
}
}
button 759 {
on (press) {
onMainMenu_Pause();
}
on (rollOver) {
_global.playSound('sndButton');
}
}
button 764 {
on (press) {
onPause_Restart();
}
on (rollOver) {
_global.playSound('sndButton');
}
}
button 769 {
on (press) {
onPause_Resume();
}
on (rollOver) {
_global.playSound('sndButton');
}
}
movieClip 770 {
}
movieClip 771 {
}
frame 22 {
stop();
}
button 778 {
on (press) {
onOk_LevelStatistic();
}
on (rollOver) {
_global.playSound('sndButton');
}
}
movieClip 787 {
frame 1 {
stop();
}
frame 2 {
stop();
}
frame 3 {
stop();
}
frame 4 {
stop();
}
}
button 788 {
on (press) {
onMainMenu_LevelStats();
}
on (rollOver) {
_global.playSound('sndButton');
}
}
frame 36 {
stop();
}
frame 51 {
gotoAndStop('game');
}