Frame 1
stop();
Frame 2
stop();
Frame 3
newgame.onRelease = function () {
tlacitkoZvuk();
gotoAndStop ("difficulty");
};
instructions.onRelease = function () {
tlacitkoZvuk();
gotoAndStop ("instructions");
};
high.onRelease = function () {
tlacitkoZvuk();
getURL ("http://scores.funny-games.biz/show.php?game_id=13&difficulty=1", "_blank");
};
play_games.onRelease = function () {
tlacitkoZvuk();
getURL ("http://www.funny-games.biz/main.html", "_blank");
};
funny.onRelease = function () {
getURL ("http://www.funny-games.biz/main.html", "_blank");
};
stop();
score = 0;
sounds_enabled = true;
music_enabled = true;
if (hudba_menu == null) {
hudba_menu = new Sound();
hudba_menu.attachSound("hudba_menu");
hudba_menu.start(0, 9999);
}
_global.tlacitkoZvuk = function () {
if (_root.sounds_enabled) {
var _local2 = new Sound();
_local2.attachSound("tlacitko1");
_local2.start(0, 1);
}
};
Frame 4
back.onRelease = function () {
tlacitkoZvuk();
gotoAndStop ("menu");
};
Frame 5
back.onRelease = function () {
tlacitkoZvuk();
gotoAndStop ("menu");
};
continue_but.onRelease = function () {
tlacitkoZvuk();
gotoAndStop ("select_car");
};
Frame 6
function select(num) {
car_types[0] = num;
available[num - 1] = false;
var _local2 = 1;
while (_local2 <= 5) {
var _local1 = 0;
while (_local1 < available.length) {
if (available[_local1]) {
available[_local1] = false;
car_types[_local2] = _local1 + 1;
break;
}
_local1++;
}
_local2++;
}
gotoAndStop ("play1");
}
stop();
_quality = "HIGH";
c1.onRelease = function () {
tlacitkoZvuk();
select(1);
};
c2.onRelease = function () {
tlacitkoZvuk();
select(2);
};
c3.onRelease = function () {
tlacitkoZvuk();
select(3);
};
c4.onRelease = function () {
tlacitkoZvuk();
select(4);
};
this.car_types = new Array();
this.available = [true, true, true, true, true, true];
back.onRelease = function () {
tlacitkoZvuk();
gotoAndStop ("menu");
};
Frame 7
function finishLevel(level, pos, time, powerups) {
_quality = "high";
var _local2 = new Sound();
_local2.stop();
if (music_enabled) {
_local2.attachSound("end_level");
_local2.start(0, 999999);
}
var _local3 = this.attachMovie("finish_dialog", "f_d" + this.getNextHighestDepth(), this.getNextHighestDepth());
this.level = level;
_local3.position = pos;
_local3.time = time;
_local3.powerups = powerups;
}
function nextLevel() {
var _local3 = new Sound();
_local3.stop();
if (this.level < 6) {
this.game.nextLevel();
} else {
_root.oil_count = game.car.oil_count;
_root.rocket_count = game.car.rocket_count;
_root.turbo_count = game.car.turbo_count;
nextFrame();
}
}
function resetLevel() {
this.game.resetLevel();
}
function saveResults() {
var _local1 = new Sound();
_local1.stop();
gotoAndStop ("save_results");
}
hudba_menu.stop("hudba_menu");
hudba_menu = null;
if (difficulty != 4) {
_root.oil_count = 0;
_root.rocket_count = 0;
_root.turbo_count = 0;
} else {
_root.oil_count = 99;
_root.rocket_count = 99;
_root.turbo_count = 0;
}
Frame 8
function nightRide() {
mask.blendMode = "layer";
mask.lineStyle(0, 0, 0);
mask.beginFill(0, 90);
mask.lineTo(1000, 0);
mask.lineTo(1000, 1000);
mask.lineTo(0, 1000);
mask.lineTo(0, 0);
mask.endFill();
mask_movies = new Array();
var _local1 = 0;
while (_local1 < game.cars.length) {
mask_movies[_local1] = [mask.attachMovie("car_mask", "car_mask" + _local1, _local1 + 1), game.cars[_local1]];
mask_movies[_local1][0].car = game.cars[_local1];
mask_movies[_local1][0].blendMode = "alpha";
_local1++;
}
onEnterFrame = function () {
var _local1 = 0;
while (_local1 < mask_movies.length) {
mask_movies[_local1][0]._x = mask_movies[_local1][1]._x;
mask_movies[_local1][0]._y = mask_movies[_local1][1]._y;
mask_movies[_local1][0]._rotation = mask_movies[_local1][1]._rotation;
mask_movies[_local1][2]._x = mask_movies[_local1][1]._x;
mask_movies[_local1][2]._y = mask_movies[_local1][1]._y;
mask_movies[_local1][2]._rotation = mask_movies[_local1][1]._rotation;
_local1++;
}
};
disp.gotoAndStop(2);
}
function addRocketMask(r) {
var _local2 = this.mask.attachMovie("rocket_mask", "rm" + this.mask.getNextHighestDepth(), this.mask.getNextHighestDepth());
_local2.blendMode = "alpha";
_local2.target = r;
r.mask_clip = _local2;
_local2.onEnterFrame = function () {
this._x = this.target._x;
this._y = this.target._y;
this._rotation = this.target._rotation;
if (this.target._x == null) {
removeMovieClip(this);
}
};
}
function finishLevel(level, pos, time, powerups) {
_quality = "high";
var _local2 = new Sound();
_local2.stop();
if (music_enabled) {
_local2.attachSound("end_level");
_local2.start(0, 999999);
}
var _local3 = this.attachMovie("finish_dialog", "f_d" + this.getNextHighestDepth(), this.getNextHighestDepth());
this.level = level + 6;
_local3.position = pos;
_local3.time = time;
_local3.powerups = powerups;
}
function nextLevel() {
var _local2 = new Sound();
_local2.stop();
if (this.level < 12) {
this.game.nextLevel();
} else {
disp.removeMovieClip();
nextFrame();
}
}
function resetLevel() {
this.game.resetLevel();
}
function saveResults() {
var _local1 = new Sound();
_local1.stop();
gotoAndStop ("save_results");
}
var h = new Sound();
h.stop();
this.onEnterFrame = function () {
onEnterFrame = null;
nightRide();
};
Frame 9
function s() {
if (((nick.text.length > 0) && (nick.text != " ")) && (nick.text != "enter your nick")) {
saving._visible = true;
now = new Date();
diff = difficulty;
username = nick.text;
game_id = 13;
chs = ((score * now.getUTCHours()) * now.getUTCDate()) + (now.getUTCFullYear() * 77);
loadVariablesNum ("http://scores.funny-games.biz/scores.php", 0, "POST");
}
}
hudba_menu = new Sound();
hudba_menu.attachSound("hudba_menu");
hudba_menu.start(0, 9999);
saving._visible = false;
sc.text = "Score: " + score;
this.onData = function () {
getURL ("http://scores.funny-games.biz/show.php?game_id=13&difficulty=" + diff, "_blank");
gotoAndStop ("menu");
};
save.onRelease = function () {
if ((((nick.text.length > 0) && (nick.text != " ")) && (nick.text != " ")) && (nick.text.toLowerCase() != "enter your nick")) {
s();
} else if (nick.text == "enter your nick") {
nick.text = "ENTER YOUR NICK";
} else {
nick.text = "enter your nick";
}
};
Frame 35
stop();
game.setMask(mask);
onEnterFrame = function () {
mask._x = game.car._x;
mask._y = game.car._y;
mask._rotation = game.car._rotation;
mask2._x = game.car._x;
mask2._y = game.car._y;
mask2._rotation = game.car._rotation;
};
Symbol 12 MovieClip [car_mask] Frame 1
onEnterFrame = function () {
if (!car.live) {
if (this._currentframe == 1) {
this.play();
}
} else {
this.gotoAndStop(1);
}
};
Symbol 12 MovieClip [car_mask] Frame 38
stop();
Symbol 14 MovieClip [stopa] Frame 1
onEnterFrame = function () {
_alpha = (_alpha - 1);
if (_alpha <= 0) {
onEnterFrame = null;
removeMovieClip(this);
}
};
Symbol 21 MovieClip [rocket_mask] Frame 1
stop();
Symbol 21 MovieClip [rocket_mask] Frame 11
stop();
removeMovieClip(this);
Symbol 31 MovieClip [rocket] Frame 1
stop();
this.onEnterFrame = function () {
var _local3 = this._x;
var _local2 = this._y;
this._x = this._x + (Math.sin((this._rotation * Math.PI) / 180) * 20);
this._y = this._y + ((-Math.cos((this._rotation * Math.PI) / 180)) * 20);
if ((Math.abs(_x) > 3000) || (Math.abs(_y) > 3000)) {
this._parent.removeRocket(this);
removeMovieClip(this);
}
if (this._parent.checkRocket(this)) {
ang = Math.atan2(_local2 - this._parent.cars[i]._y, this._parent.cars[i]._x - _local3);
this._parent.cars[i].x_force = this._parent.cars[i].x_force + (Math.cos(ang) * 10);
this._parent.cars[i].y_force = this._parent.cars[i].y_force + ((-Math.sin(ang)) * 10);
this._parent.cars[i].dir = this._parent.cars[i].dir + ((random(45) + 45) * Math.pow(-1, random(2)));
this.onEnterFrame = null;
play();
this.mask_clip.play();
} else {
var i = 0;
while (i < this._parent.cars.length) {
if (this._parent.cars[i].hitTest(this._x, this._y, true)) {
ang = Math.atan2(_local2 - this._parent.cars[i]._y, this._parent.cars[i]._x - _local3);
this._parent.cars[i].x_force = this._parent.cars[i].x_force + (Math.cos(ang) * 10);
this._parent.cars[i].y_force = this._parent.cars[i].y_force + ((-Math.sin(ang)) * 10);
this._parent.cars[i].dir = this._parent.cars[i].dir + ((random(45) + 45) * Math.pow(-1, random(2)));
this.onEnterFrame = null;
play();
this.mask_clip.play();
break;
}
i++;
}
}
};
Symbol 31 MovieClip [rocket] Frame 2
if (_root.sounds_enabled) {
var s = new Sound();
s.attachSound("zasah_raketou");
s.start(0, 1);
}
Symbol 31 MovieClip [rocket] Frame 15
stop();
this._parent.removeRocket(this);
removeMovieClip(this);
Symbol 54 MovieClip [finish_dialog] Frame 1
click_shade.useHandCursor = false;
Symbol 54 MovieClip [finish_dialog] Frame 36
f_text.text = "You finished " + this.position;
save._visible = false;
this.next_level._visible = false;
save_back._visible = false;
sec = Math.round(time / 1000);
min = Math.floor(sec / 60);
sec2 = sec - (min * 60);
t.text = (("Time: " + min) + ":") + ((sec2 < 10) ? ("0" + sec2) : (sec2));
pw.text = "Power ups:" + powerups;
pwb_val = Math.round((powerups * 15) / this.position);
pwb.text = "Power ups bonus:" + pwb_val;
sc_val = Math.round(((200 - sec) * 10) / this.position);
sc.text = "Time bonus:" + sc_val;
tsc.text = "Total score:" + ((_parent.score + sc_val) + pwb_val);
sc._visible = false;
tsc._visible = false;
pwb._visible = false;
pw._visible = false;
if (this.position < 4) {
_parent.score = _parent.score + (sc_val + pwb_val);
opakovat._visible = false;
next_level._visible = true;
sc._visible = true;
tsc._visible = true;
pwb._visible = true;
pw._visible = true;
save_back._visible = true;
}
if (this.position == 1) {
f_text.text = f_text.text + "st";
} else if (this.position == 2) {
f_text.text = f_text.text + "nd";
} else if (this.position == 3) {
f_text.text = f_text.text + "rd";
} else {
f_text.text = f_text.text + "th";
}
stop();
if (_parent.level > 11) {
this.next_level._visible = false;
if (position < 4) {
save._visible = true;
save_back._visible = false;
}
}
next_level.onRelease = function () {
_parent.nextLevel();
this._parent.removeMovieClip();
};
save.onRelease = function () {
_parent.saveResults();
this._parent.removeMovieClip();
};
save_back.onRelease = function () {
_parent.saveResults();
this._parent.removeMovieClip();
};
opakovat.onRelease = function () {
_parent.resetLevel();
this._parent.removeMovieClip();
};
Symbol 93 MovieClip Frame 138
stop();
t = getTimer();
onEnterFrame = function () {
if ((getTimer() - t) > 3000) {
onEnterFrame = null;
if (_root.loaded) {
_root.gotoAndStop("menu");
} else {
_root.anim_finished = true;
}
}
};
Symbol 97 MovieClip Frame 1
_root.stop();
PercentLoaded = (_root.getBytesLoaded() / _root.getBytesTotal()) * 100;
if (PercentLoaded != 100) {
setProperty(bar, _xscale , PercentLoaded);
} else {
gotoAndStop ("loaded");
}
Symbol 97 MovieClip Frame 2
gotoAndPlay (1);
Symbol 97 MovieClip Frame 3
if (_root.anim_finished) {
_root.gotoAndStop("menu");
} else {
_root.loaded = true;
}
Symbol 124 MovieClip Frame 17
stop();
Symbol 156 MovieClip Frame 1
stop();
Symbol 174 MovieClip Frame 1
stop();
c1.onRelease = function () {
tlacitkoZvuk();
gotoAndStop (1);
};
c2.onRelease = function () {
tlacitkoZvuk();
gotoAndStop (2);
};
c3.onRelease = function () {
tlacitkoZvuk();
gotoAndStop (3);
};
c4.onRelease = function () {
gotoAndStop (4);
};
_parent.difficulty = 1;
if (set != true) {
set = true;
gotoAndStop (2);
}
Symbol 174 MovieClip Frame 2
_parent.difficulty = 2;
Symbol 174 MovieClip Frame 3
_parent.difficulty = 3;
Symbol 174 MovieClip Frame 4
_parent.difficulty = 4;
Symbol 238 MovieClip Frame 1
function checkSlides(point) {
var _local1 = 0;
while (_local1 < slides.length) {
if (slides[_local1].hitTest(point[0], point[1], true)) {
return(true);
}
_local1++;
}
return(false);
}
function checkJumps(point) {
var _local1 = 0;
while (_local1 < jumps.length) {
if (jumps[_local1].hitTest(point[0], point[1], true)) {
return(true);
}
_local1++;
}
return(false);
}
function createOil(x, y) {
var _local2 = this.attachMovie("oil", "oil" + this.getNextHighestDepth(), this.getNextHighestDepth());
_local2._x = x;
_local2._y = y;
this.slides.push(_local2);
}
stop();
slides = new Array();
jumps = [jump1];
Symbol 239 MovieClip Frame 1
stop();
this._parent.acceleration = (this._parent.init_acceleration = 0.13);
this._parent.tire = (this._parent.init_tire = 1.3);
this._parent.turn_speed = (this._parent.init_turn_speed = 5);
this._parent.max_speed = (this._parent.init_max_speed = 15);
this._parent.brakes = (this._parent.init_brakes = 0.17);
this._parent.target_path = 1;
this._parent.map_dot = "blue";
if (((_root.difficulty == 3) || (_root.difficulty == 4)) && (this._parent.car_type == "player")) {
this._parent.acceleration = (this._parent.init_acceleration = 0.125);
this._parent.tire = (this._parent.init_tire = 1.25);
this._parent.turn_speed = (this._parent.init_turn_speed = 4.5);
this._parent.max_speed = (this._parent.init_max_speed = 14);
this._parent.brakes = (this._parent.init_brakes = 0.16);
}
Symbol 239 MovieClip Frame 2
stop();
this._parent.acceleration = (this._parent.init_acceleration = 0.17);
this._parent.tire = (this._parent.init_tire = 1.2);
this._parent.turn_speed = (this._parent.init_turn_speed = 5);
this._parent.max_speed = (this._parent.init_max_speed = 25);
this._parent.brakes = (this._parent.init_brakes = 0.13);
this._parent.target_path = 1;
this._parent.map_dot = "red";
if (((_root.difficulty == 3) || (_root.difficulty == 4)) && (this._parent.car_type == "player")) {
this._parent.acceleration = (this._parent.init_acceleration = 0.16);
this._parent.tire = (this._parent.init_tire = 1.15);
this._parent.turn_speed = (this._parent.init_turn_speed = 4.5);
this._parent.max_speed = (this._parent.init_max_speed = 22);
this._parent.brakes = (this._parent.init_brakes = 0.12);
}
Symbol 239 MovieClip Frame 3
this._parent.acceleration = (this._parent.init_acceleration = 0.12);
this._parent.tire = (this._parent.init_tire = 1.5);
this._parent.turn_speed = (this._parent.init_turn_speed = 6);
this._parent.max_speed = (this._parent.init_max_speed = 25);
this._parent.brakes = (this._parent.init_brakes = 0.15);
this._parent.target_path = 0;
this._parent.map_dot = "yellow";
if (((_root.difficulty == 3) || (_root.difficulty == 4)) && (this._parent.car_type == "player")) {
this._parent.acceleration = (this._parent.init_acceleration = 0.115);
this._parent.tire = (this._parent.init_tire = 1.4);
this._parent.turn_speed = (this._parent.init_turn_speed = 5);
this._parent.max_speed = (this._parent.init_max_speed = 22);
this._parent.brakes = (this._parent.init_brakes = 0.14);
}
Symbol 239 MovieClip Frame 4
this._parent.acceleration = (this._parent.init_acceleration = 0.13);
this._parent.tire = (this._parent.init_tire = 1.4);
this._parent.turn_speed = (this._parent.init_turn_speed = 5);
this._parent.max_speed = (this._parent.init_max_speed = 17);
this._parent.brakes = (this._parent.init_brakes = 0.13);
this._parent.target_path = 0;
this._parent.map_dot = "green";
if (((_root.difficulty == 3) || (_root.difficulty == 4)) && (this._parent.car_type == "player")) {
this._parent.acceleration = (this._parent.init_acceleration = 0.12);
this._parent.tire = (this._parent.init_tire = 1.3);
this._parent.turn_speed = (this._parent.init_turn_speed = 4.5);
this._parent.max_speed = (this._parent.init_max_speed = 16);
this._parent.brakes = (this._parent.init_brakes = 0.12);
}
Symbol 239 MovieClip Frame 5
this._parent.acceleration = (this._parent.init_acceleration = 0.13);
this._parent.tire = (this._parent.init_tire = 1.4);
this._parent.turn_speed = (this._parent.init_turn_speed = 5);
this._parent.max_speed = (this._parent.init_max_speed = 17);
this._parent.brakes = (this._parent.init_brakes = 0.13);
this._parent.target_path = 0;
this._parent.map_dot = "brown";
if (((_root.difficulty == 3) || (_root.difficulty == 4)) && (this._parent.car_type == "player")) {
this._parent.acceleration = (this._parent.init_acceleration = 0.115);
this._parent.tire = (this._parent.init_tire = 1.3);
this._parent.turn_speed = (this._parent.init_turn_speed = 4.5);
this._parent.max_speed = (this._parent.init_max_speed = 15);
this._parent.brakes = (this._parent.init_brakes = 0.115);
}
Symbol 239 MovieClip Frame 6
this._parent.acceleration = (this._parent.init_acceleration = 0.13);
this._parent.tire = (this._parent.init_tire = 1.4);
this._parent.turn_speed = (this._parent.init_turn_speed = 5);
this._parent.max_speed = (this._parent.init_max_speed = 17);
this._parent.brakes = (this._parent.init_brakes = 0.13);
this._parent.target_path = 0;
this._parent.map_dot = "white";
if (((_root.difficulty == 3) || (_root.difficulty == 4)) && (this._parent.car_type == "player")) {
this._parent.acceleration = (this._parent.init_acceleration = 0.115);
this._parent.tire = (this._parent.init_tire = 1.3);
this._parent.turn_speed = (this._parent.init_turn_speed = 4.5);
this._parent.max_speed = (this._parent.init_max_speed = 15);
this._parent.brakes = (this._parent.init_brakes = 0.115);
}
Symbol 240 MovieClip Frame 1
function stopaGum() {
var _local3;
if (((Math.abs(dir - smyk) > 20) || (sliding)) || (Key.isDown(32) && (spd > 5))) {
body = new Array();
body.push([this._x + (((Math.cos(((_rotation + 56) * Math.PI) / 180) * 60) * this._xscale) / 100), this._y + (((Math.sin(((_rotation + 56) * Math.PI) / 180) * 60) * this._yscale) / 100)]);
body.push([this._x + (((Math.cos((((_rotation + 56) + 56) * Math.PI) / 180) * 60) * this._xscale) / 100), this._y + (((Math.sin((((_rotation + 56) + 56) * Math.PI) / 180) * 60) * this._yscale) / 100)]);
if (old_point != null) {
if (sliding) {
body.push([this._x + (((Math.cos(((_rotation - 56) * Math.PI) / 180) * 60) * this._xscale) / 100), this._y + (((Math.sin(((_rotation - 56) * Math.PI) / 180) * 60) * this._yscale) / 100)]);
body.push([this._x + (((Math.cos((((_rotation - 56) - 56) * Math.PI) / 180) * 60) * this._xscale) / 100), this._y + (((Math.sin((((_rotation - 56) - 56) * Math.PI) / 180) * 60) * this._yscale) / 100)]);
if (old_point.length == 4) {
_parent.stopaGum(body, old_point, Math.abs(dir - smyk) + (((start_slide_time + slide_length) - _parent.level_timer) / 100), 0, (((start_slide_time + slide_length) - _parent.level_timer) / 2000) + 1);
}
} else {
if (Key.isDown(32)) {
_local3 = Math.abs(dir - smyk) + 40;
} else {
_local3 = Math.abs(dir - smyk);
}
_parent.stopaGum(body, old_point, _local3);
}
}
old_point = body;
} else {
old_point = null;
}
}
function chcipni() {
if (live) {
if (_root.sounds_enabled) {
var _local2 = new Sound();
_local2.attachSound("pad_ze_stolu");
_local2.start(0, 1);
}
old_point = null;
live = false;
}
}
function checkHit() {
var _local4 = new Array();
_local4.push([this._x + (((Math.cos(((_rotation + 54) * Math.PI) / 180) * 50) * this._xscale) / 100), this._y + (((Math.sin(((_rotation + 54) * Math.PI) / 180) * 50) * this._yscale) / 100)]);
_local4.push([this._x + (((Math.cos((((_rotation + 180) - 54) * Math.PI) / 180) * 50) * this._xscale) / 100), this._y + (((Math.sin((((_rotation + 180) - 54) * Math.PI) / 180) * 50) * this._yscale) / 100)]);
_local4.push([this._x + (((Math.cos(((_rotation - 54) * Math.PI) / 180) * 50) * this._xscale) / 100), this._y + (((Math.sin(((_rotation - 54) * Math.PI) / 180) * 50) * this._yscale) / 100)]);
_local4.push([this._x + (((Math.cos((((_rotation - 180) + 54) * Math.PI) / 180) * 50) * this._xscale) / 100), this._y + (((Math.sin((((_rotation - 180) + 54) * Math.PI) / 180) * 50) * this._yscale) / 100)]);
var _local5 = _parent.checkHit(_local4);
var _local9 = _local5[3];
var _local7 = _local5[2];
var _local6 = _local5[1];
var _local8 = _local5[0];
if (((_local9 || (_local7)) || (_local6)) || (_local8)) {
this.spd = this.spd * 0.9;
}
var _local3 = 0;
while (_local3 < _local5.length) {
if (_local5[_local3]) {
this._x = this._x + (((this._x - _local4[_local3][0]) / 40) * (Math.abs(spd) + 5));
this._y = this._y + (((this._y - _local4[_local3][1]) / 40) * (Math.abs(spd) + 5));
}
_local3++;
}
}
function checkSlide() {
var _local4 = new Array();
_local4.push([this._x + (((Math.cos(((_rotation + 54) * Math.PI) / 180) * 50) * this._xscale) / 100), this._y + (((Math.sin(((_rotation + 54) * Math.PI) / 180) * 50) * this._yscale) / 100)]);
_local4.push([this._x + (((Math.cos((((_rotation + 180) - 54) * Math.PI) / 180) * 50) * this._xscale) / 100), this._y + (((Math.sin((((_rotation + 180) - 54) * Math.PI) / 180) * 50) * this._yscale) / 100)]);
_local4.push([this._x + (((Math.cos(((_rotation - 54) * Math.PI) / 180) * 50) * this._xscale) / 100), this._y + (((Math.sin(((_rotation - 54) * Math.PI) / 180) * 50) * this._yscale) / 100)]);
_local4.push([this._x + (((Math.cos((((_rotation - 180) + 54) * Math.PI) / 180) * 50) * this._xscale) / 100), this._y + (((Math.sin((((_rotation - 180) + 54) * Math.PI) / 180) * 50) * this._yscale) / 100)]);
if (_parent.checkSlide(_local4)) {
if (!sliding) {
if (_root.sounds_enabled) {
var _local5 = new Sound();
_local5.attachSound("splash");
_local5.start(0, 1);
}
}
this.start_slide_time = _parent.level_timer;
sliding = true;
}
}
function checkJump() {
var _local4 = new Array();
_local4.push([this._x + (((Math.cos(((_rotation + 54) * Math.PI) / 180) * 50) * this._xscale) / 100), this._y + (((Math.sin(((_rotation + 54) * Math.PI) / 180) * 50) * this._yscale) / 100)]);
_local4.push([this._x + (((Math.cos((((_rotation + 180) - 54) * Math.PI) / 180) * 50) * this._xscale) / 100), this._y + (((Math.sin((((_rotation + 180) - 54) * Math.PI) / 180) * 50) * this._yscale) / 100)]);
_local4.push([this._x + (((Math.cos(((_rotation - 54) * Math.PI) / 180) * 50) * this._xscale) / 100), this._y + (((Math.sin(((_rotation - 54) * Math.PI) / 180) * 50) * this._yscale) / 100)]);
_local4.push([this._x + (((Math.cos((((_rotation - 180) + 54) * Math.PI) / 180) * 50) * this._xscale) / 100), this._y + (((Math.sin((((_rotation - 180) + 54) * Math.PI) / 180) * 50) * this._yscale) / 100)]);
if (_parent.checkJump(_local4)) {
if (Math.abs(spd) > 5) {
if (_root.sounds_enabled) {
var _local5 = new Sound();
_local5.attachSound("jump_sound");
_local5.start(0, 1);
}
jumping = true;
old_point = null;
jump_way = 1;
target_scale = init_scale_x * (1 + (spd / 50));
}
}
}
function getCarHitPoints() {
var _local2 = new Array();
_local2.push([this._x + (((Math.cos(((_rotation + 70) * Math.PI) / 180) * 70) * this._xscale) / 100), this._y + (((Math.sin(((_rotation + 70) * Math.PI) / 180) * 75) * this._yscale) / 100)]);
_local2.push([this._x + (((Math.cos((((_rotation + 180) - 70) * Math.PI) / 180) * 70) * this._xscale) / 100), this._y + (((Math.sin((((_rotation + 180) - 70) * Math.PI) / 180) * 75) * this._yscale) / 100)]);
_local2.push([this._x + (((Math.cos(((_rotation - 70) * Math.PI) / 180) * 70) * this._xscale) / 100), this._y + (((Math.sin(((_rotation - 70) * Math.PI) / 180) * 70) * this._yscale) / 100)]);
_local2.push([this._x + (((Math.cos((((_rotation - 180) + 70) * Math.PI) / 180) * 70) * this._xscale) / 100), this._y + (((Math.sin((((_rotation - 180) + 70) * Math.PI) / 180) * 70) * this._yscale) / 100)]);
return(_local2);
}
function hitCar(car, skip_next, hit_point) {
if (skip_next != true) {
car.hitCar(this, true, hit_point);
hit_point = null;
}
if (hit_point != null) {
var _local13 = getCarHitPoints();
car._x = car._x - (((this._x - _local13[hit_point][0]) / 50) * (Math.abs(spd * 1.4) + 5));
car._y = car._y - (((this._y - _local13[hit_point][1]) / 50) * (Math.abs(spd * 1.4) + 5));
}
var _local15 = Math.atan2(car._y - this._y, car._x - this._x);
var _local4 = (-((((-_local15) * 180) / Math.PI) - 90)) - smyk;
var _local9;
var _local10;
var _local11;
_local4 = _local4 % 360;
if (_local4 < 0) {
_local4 = _local4 + 360;
}
if (_local4 > 180) {
_local4 = 360 - _local4;
}
if (_local4 < 90) {
var _local14 = car.spd;
var _local6 = car.smyk;
_local6 = _local6 % 360;
if (_local6 < 0) {
_local6 = _local6 + 360;
}
var _local5 = smyk % 360;
if (_local5 < 0) {
_local5 = _local5 + 360;
}
if (Math.abs(_local5 - _local6) > 180) {
if (_local5 > 180) {
_local6 + 360;
} else {
_local5 = _local5 + 360;
}
}
var _local7 = (Math.sqrt(Math.max(Math.cos((Math.abs(_local5 - _local6) * Math.PI) / 180), 0)) * _local14) / 2;
if (spd > _local7) {
if (_local7 > 0) {
_local9 = (spd - _local7) / 2;
} else {
_local9 = spd / 2;
}
_local10 = Math.sin((smyk * Math.PI) / 180) * _local9;
_local11 = (-Math.cos((smyk * Math.PI) / 180)) * _local9;
car.x_force = car.x_force + _local10;
car.y_force = car.y_force + _local11;
this.x_force = this.x_force - _local10;
this.y_force = this.y_force - _local11;
car.dir = car.dir + (random(30) - 15);
if (_root.sounds_enabled) {
var _local8 = new Sound();
if ((Math.abs(_local10) + Math.abs(_local11)) > 6) {
_local8.attachSound("naraz2");
} else {
_local8.attachSound("naraz3");
}
_local8.start(0, 1);
}
}
}
}
function proceedForces() {
if ((x_force != 0) || (y_force != 0)) {
var _local3 = Math.sin((smyk * Math.PI) / 180) * spd;
var _local4 = (-Math.cos((smyk * Math.PI) / 180)) * spd;
_local3 = _local3 + this.x_force;
_local4 = _local4 + this.y_force;
this.x_force = 0;
this.y_force = 0;
this.spd = Math.sqrt((_local3 * _local3) + (_local4 * _local4));
var _local2 = -(((Math.atan2(-_local4, _local3) * 180) / Math.PI) - 90);
_local2 = _local2 % 360;
if (_local2 < 0) {
_local2 = _local2 + 360;
}
this.smyk = _local2;
this.dir = this.dir % 360;
if (this.dir < 0) {
this.dir = this.dir + 360;
}
if (Math.abs(smyk - dir) > 180) {
if (smyk > 180) {
dir = dir + 360;
} else {
smyk = smyk + 360;
}
}
if (Math.abs(smyk - dir) > 90) {
spd = -spd;
smyk = smyk - 180;
}
}
}
function setPath(path, ref_obj) {
this.path = path;
this.ref_obj = ref_obj;
this.path_index = 0;
lap_timer = _parent.level_timer;
}
function getCurPoint() {
if (this.path == null) {
return(undefined);
}
var _local4;
if (this.path[this.path_index][this.target_path] != null) {
_local4 = this.path[this.path_index][this.target_path];
} else {
_local4 = this.path[this.path_index][0];
}
var _local3 = [_local4[0], _local4[1], _local4[2]];
_local3[0] = _local3[0] + this.ref_obj._x;
_local3[1] = _local3[1] + this.ref_obj._y;
vzd = Math.sqrt(((_local3[0] - this._x) * (_local3[0] - this._x)) + ((_local3[1] - this._y) * (_local3[1] - this._y)));
if ((vzd < 100) && (path.length > 1)) {
if (path_index == 0) {
laps++;
if (laps == _parent.laps_count) {
this.finished = true;
_parent.carFinished(false);
}
}
this.path_index++;
if (this.path_index >= this.path.length) {
this.path_index = 0;
lap_timer = _parent.level_timer;
}
this.inc = ((Math.random() - 0.5) * path[path_index][0][2]) / 2.5;
return(getCurPoint());
}
if (old_path_point != this.path_index) {
old_path_point = this.path_index;
old_point_timer = _parent.level_timer;
}
return(_local3);
}
function setCars(cars) {
var _local2 = 0;
while (_local2 < cars.length) {
if (cars[_local2] != this) {
this.targets.push(cars[_local2]);
}
_local2++;
}
}
function setBonus(b) {
switch (b) {
case 0 :
this.turbo_count++;
break;
case 1 :
this.oil_count++;
break;
case 2 :
this.grip_bonus_timer = _parent.level_timer;
break;
case 3 :
this.rocket_count = this.rocket_count + 3;
}
}
function checkRocket() {
var _local6;
var _local5;
if ((rocket_count > 0) && ((_parent.level_timer - rocket_used) > 1000)) {
var _local4 = 0;
while (_local4 < targets.length) {
vzd = Math.sqrt(Math.pow(targets[_local4]._x - this._x, 2) + Math.pow(targets[_local4]._y - this._y, 2));
var _local7 = 200;
if (_root.difficulty == 4) {
_local7 = 700;
}
if (vzd < 500) {
_local6 = ((Math.atan2(targets[_local4]._y - this._y, targets[_local4]._x - this._x) * 180) / Math.PI) + 90;
_local5 = this._rotation;
if (_local5 < 0) {
_local5 = _local5 + 360;
}
if (_local6 < 0) {
_local6 = _local6 + 360;
}
if (Math.abs(_local5 - _local6) > 180) {
if (_local5 > 180) {
_local6 = _local6 + 360;
} else {
_local5 = _local5 + 360;
}
}
if (Math.abs(_local5 - _local6) < 5) {
this._parent.fireRocket(this);
this.rocket_used = _parent.level_timer;
}
}
_local4++;
}
}
if (_root.difficulty < 4) {
if ((oil_count > 0) && ((_parent.level_timer - oil_used) > 2000)) {
this._parent.createOil(this);
this.oil_used = _parent.level_timer;
}
} else if ((oil_count > 0) && ((_parent.level_timer - oil_used) > 15000)) {
this._parent.createOil(this);
this.oil_used = _parent.level_timer;
}
}
_rotation = 180;
dir = (smyk = 180);
dirX = 0;
dirY = 0;
spd = 0;
this.turbo_count = 0;
this.oil_count = 0;
this.rocket_count = 0;
if (_root.difficulty == 4) {
this.rocket_count = 99;
this.oil_count = 99;
}
this.targets = new Array();
this.laps = -1;
live = true;
finished = false;
sliding = false;
jumping = false;
smyk = dir;
mspd = 1.11;
var path_index = 0;
lap_timer = 0;
init_scale_x = _xscale;
init_scale_y = _yscale;
var target_scale;
var jump_way = 0;
var live = true;
this.x_force = 0;
this.y_force = 0;
init_tire = 1.2;
tire = init_tire;
old_path_point = -1;
old_point_timer = 0;
acceleration = 0.1;
brakes = 1;
turn_speed = 5;
max_speed = 50;
this.inc = 0;
slide_length = 8000;
rocket_used = 0;
oil_used = _parent.level_timer + random(5000);
this.onEnterFrame = function () {
if (!_parent.paused) {
if (live) {
proceedForces();
checkRocket();
if (sliding) {
tire = (((_parent.level_timer - start_slide_time) / slide_length) * 1.1) + 0.1;
if ((_parent.level_timer - start_slide_time) > slide_length) {
sliding = false;
tire = init_tire;
}
}
if (!jumping) {
point = getCurPoint();
ang = ((Math.atan2(this._y - point[1], this._x - point[0]) * 180) / Math.PI) - 90;
target_speed = point[2] + inc;
if (target_speed == null) {
target_speed = 50000;
}
target_speed = Math.min(max_speed, target_speed);
if (finished) {
target_speed = 0;
}
var _local3 = dir % 360;
if (ang < 0) {
ang = ang + 360;
}
if (_local3 < 0) {
_local3 = _local3 + 360;
}
if (Math.abs(_local3 - ang) > 180) {
if (_local3 > 180) {
ang = ang + 360;
} else {
_local3 = _local3 + 360;
}
}
if (_local3 < ang) {
if ((turn_speed - (spd / 20)) > (ang - _local3)) {
dir = dir + (ang - _local3);
} else {
dir = dir + (turn_speed - (spd / 20));
}
} else if ((turn_speed - (spd / 20)) > (_local3 - ang)) {
dir = dir - (_local3 - ang);
} else {
dir = dir - (turn_speed - (spd / 20));
}
if (spd < target_speed) {
if (spd < 0) {
spd = spd + 0.4;
} else {
if (spd < 1) {
spd = spd + (acceleration * 10);
} else if (spd < 10) {
spd = spd + (acceleration * (11 - spd));
} else {
spd = spd + acceleration;
}
if (spd > target_speed) {
spd = target_speed;
}
}
} else if (spd > 0) {
spd = spd - brakes;
if (spd < target_speed) {
spd = target_speed;
}
}
if (((_parent.level_timer - old_point_timer) > 8000) && (!finished)) {
var _local4 = this.path_index - 1;
var _local5 = _local4 + 1;
if (_local4 < 0) {
_local4 = this.path.length - 1;
}
if (_local5 >= this.path.length) {
_local5 = 0;
}
this._x = this.path[_local4][0][0] + this._parent.bg._x;
this._y = this.path[_local4][0][1] + this._parent.bg._y;
this.spd = 0;
this._rotation = (this.dir = (this.smyk = (-(((Math.atan2((this.path[_local5][0][1] + this._parent.bg._y) - this._y, (this._x - this.path[_local5][0][0]) + this._parent.bg._x) * 180) / Math.PI) - 90)) + 180));
this.old_point_timer = _parent.level_timer;
}
}
this.old_x = this._x;
this.old_y = this._y;
if (Math.abs(spd) > 1) {
if (!jumping) {
smyk = smyk + (((dir - smyk) / Math.abs(spd)) * tire);
}
dirX = Math.sin((Math.PI/180) * smyk) * spd;
dirY = Math.cos((Math.PI/180) * smyk) * spd;
this._x = this._x + dirX;
this._y = this._y - dirY;
} else {
dirX = 0;
dirY = 0;
}
if (spd > 1) {
spd = spd - (Math.abs(dir - smyk) / 200);
spd = Math.max(0, spd);
} else if (spd < -1) {
spd = spd + (Math.abs(dir - smyk) / 200);
spd = Math.min(0, spd);
}
_rotation = dir;
checkHit();
if (!jumping) {
stopaGum();
checkSlide();
checkJump();
} else if (jump_way == 1) {
this._xscale = this._xscale + (jump_way * 2);
this._yscale = this._yscale + (jump_way * 2);
if (this._xscale >= this.target_scale) {
this.jump_way = -1;
}
} else if (jump_way == -1) {
this._xscale = this._xscale + (jump_way * 2);
this._yscale = this._yscale + (jump_way * 2);
if (this._xscale <= this.init_scale_x) {
this.jump_way = 0;
this.jumping = false;
this._xscale = (this._yscale = this.init_scale_x);
}
}
} else if (_xscale > 0) {
this._rotation = this._rotation + 5;
this._xscale--;
this._yscale--;
dirX = Math.sin((Math.PI/180) * smyk) * spd;
dirY = Math.cos((Math.PI/180) * smyk) * spd;
spd = spd * 0.95;
this._x = this._x + dirX;
this._y = this._y - dirY;
} else {
this._xscale = (this._yscale = this.init_scale_x);
var _local4 = this.path_index - 1;
var _local5 = _local4 + 1;
if (_local4 < 0) {
_local4 = this.path.length - 1;
}
if (_local5 >= this.path.length) {
_local5 = 0;
}
this._x = this.path[_local4][0][0] + this._parent.bg._x;
this._y = this.path[_local4][0][1] + this._parent.bg._y;
this.spd = 0;
this._rotation = (this.dir = (this.smyk = (-(((Math.atan2((this.path[_local5][0][1] + this._parent.bg._y) - this._y, (this._x - this.path[_local5][0][0]) + this._parent.bg._x) * 180) / Math.PI) - 90)) + 180));
this.live = true;
}
}
};
Symbol 435 MovieClip Frame 1
stop();
type = 0;
Symbol 435 MovieClip Frame 2
type = 1;
Symbol 435 MovieClip Frame 3
type = 2;
Symbol 435 MovieClip Frame 4
type = 3;
Symbol 442 MovieClip Frame 1
function checkHit(point) {
var _local1 = 0;
while (_local1 < hits.length) {
if (hits[_local1].hitTest(point[0], point[1], true)) {
return(true);
}
_local1++;
}
return(false);
}
function checkBonuses(car) {
var _local2 = 0;
while (_local2 < this.bonuses.length) {
if (car.hitTest(this.bonuses[_local2])) {
var _local4 = this.bonuses[_local2].type;
var _local3 = random(dots.length);
bonuses[_local2]._x = (dots[_local3][0]._x + random(100)) - 50;
bonuses[_local2]._y = (dots[_local3][0]._y + random(100)) - 50;
bonuses[_local2].gotoAndStop(random(4) + 1);
return(_local4);
}
_local2++;
}
return(null);
}
function checkPoints(car) {
if (car.hitTest(points[cur_cp])) {
if (cur_cp == 0) {
laps++;
}
cur_cp++;
if (cur_cp >= points.length) {
cur_cp = 0;
}
}
if ((laps == _parent.laps_count) && (!finished)) {
_parent.finish();
finished = true;
}
}
bonuses = [b1, b2, b3, b4];
hits = [hit1];
points = [cp0, cp1, cp2, cp3, cp4, cp5, cp6, cp7];
var i = 0;
while (i < points.length) {
points[i]._visible = false;
i++;
}
finished = false;
laps = 0;
cur_cp = 1;
var dots = [[dot0, 8, dotb0, 8], [dot1, 30, dotb1, 30], [dot2, 8, dotb2, 8], [dot3, 11, dotb3, 11], [dot4, 9, dotb4, 9], [dot5, 30, dotb5, 30], [dot6, 10, dotb6, 10], [dot7, 15, dotb7, 15], [dot8, 10, dotb8, 10], [dot9, 30], [dot10, 30, dotb10, 30], [dot11, 30, dotb11, 30], [dot12, 8, dotb12, 8], [dot13, 15, dotb13, 15], [dot14, 10, dotb14, 10], [dot15, 15, dotb15, 15], [dot16, 10, dotb16, 10], [dot17, 15, dotb17, 15], [dot18, 15, dotb18, 15], [dot19, 7, dotb19, 7], [dot20, 7, dotb20, 7], [dotc20, 15, dotd20, 15], [dot21, 30, dotb21, 30], [dot22, 15, dotb22, 15], [dot23, 8, dotb23, 8]];
var AI_path = new Array();
AI_path[0] = new Array();
var cur_i = 0;
difficulty_coef = [0.75, 1, 1, 1];
coef = difficulty_coef[_parent.difficulty - 1];
var i = 0;
while (i < dots.length) {
if (AI_path[cur_i].length > 0) {
AI_path.push(new Array());
cur_i = AI_path.length - 1;
}
var e = 0;
while (e < (dots[i].length / 2)) {
if (dots[i][e * 2] != null) {
AI_path[cur_i].push([dots[i][e * 2]._x, dots[i][e * 2]._y, dots[i][(e * 2) + 1] * coef]);
dots[i][e * 2]._visible = false;
}
e++;
}
i++;
}
var i = 0;
while (i < dots.length) {
dots[i][0].n = dots[i][0]._name.substring(3, dots[i][0]._name.length);
dots[i][2].n = dots[i][2]._name.substring(3, dots[i][2]._name.length);
i++;
}
var i = 0;
while (i < bonuses.length) {
var d = random(dots.length);
bonuses[i]._x = (dots[d][0]._x + random(100)) - 50;
bonuses[i]._y = (dots[d][0]._y + random(100)) - 50;
bonuses[i].gotoAndStop(random(4) + 1);
i++;
}
Symbol 443 MovieClip Frame 1
function resetRotation() {
var _local7 = this._x - this._parent.bg._x;
var _local6 = this._y - this._parent.bg._y;
var _local4 = 999999999 /* 0x3B9AC9FF */;
var _local3;
var _local5 = -1;
var _local2 = 0;
while (_local2 < this.path.length) {
_local3 = Math.sqrt(Math.pow(_local7 - path[_local2][0][0], 2) + Math.pow(_local6 - path[_local2][0][1], 2));
if (_local3 < _local4) {
_local4 = _local3;
_local5 = _local2;
}
_local2++;
}
var _local8 = _local5 + 1;
if (_local8 >= this.path.length) {
_local8 = 0;
}
var _local10 = path[_local8][0][0] + this._parent.bg._x;
var _local9 = path[_local8][0][1] + this._parent.bg._y;
this._rotation = (this.dir = (this.smyk = (((Math.atan2(_local9 - this._y, _local10 - this._x) * 180) / Math.PI) - 90) + 180));
}
function stopaGum() {
var _local3;
if (((Math.abs(dir - smyk) > 20) || (sliding)) || (Key.isDown(32) && (spd > 5))) {
body = new Array();
body.push([this._x + (((Math.cos(((_rotation + 56) * Math.PI) / 180) * 60) * this._xscale) / 100), this._y + (((Math.sin(((_rotation + 56) * Math.PI) / 180) * 60) * this._yscale) / 100)]);
body.push([this._x + (((Math.cos((((_rotation + 56) + 56) * Math.PI) / 180) * 60) * this._xscale) / 100), this._y + (((Math.sin((((_rotation + 56) + 56) * Math.PI) / 180) * 60) * this._yscale) / 100)]);
if (old_point != null) {
if (sliding) {
stopa_zvuk.stop("smyk");
stopa_zvuk = null;
body.push([this._x + (((Math.cos(((_rotation - 56) * Math.PI) / 180) * 60) * this._xscale) / 100), this._y + (((Math.sin(((_rotation - 56) * Math.PI) / 180) * 60) * this._yscale) / 100)]);
body.push([this._x + (((Math.cos((((_rotation - 56) - 56) * Math.PI) / 180) * 60) * this._xscale) / 100), this._y + (((Math.sin((((_rotation - 56) - 56) * Math.PI) / 180) * 60) * this._yscale) / 100)]);
if (old_point.length == 4) {
_parent.stopaGum(body, old_point, Math.abs(dir - smyk) + (((start_slide_time + slide_length) - _parent.level_timer) / 100), 0, (((start_slide_time + slide_length) - _parent.level_timer) / 2000) + 1);
}
} else {
if (stopa_zvuk == null) {
stopa_zvuk = new Sound();
stopa_zvuk.attachSound("smyk");
stopa_zvuk.start(0, 1);
}
if (Key.isDown(32)) {
_local3 = Math.abs(dir - smyk) + 40;
} else {
_local3 = Math.abs(dir - smyk);
}
_parent.stopaGum(body, old_point, _local3);
}
}
old_point = body;
} else {
stopa_zvuk.stop("smyk");
stopa_zvuk = null;
old_point = null;
}
}
function chcipni() {
if (live) {
if (_root.sounds_enabled) {
var _local2 = new Sound();
_local2.attachSound("pad_ze_stolu");
_local2.start(0, 1);
}
old_point = null;
live = false;
}
}
function checkHit() {
var _local6 = new Array();
_local6.push([this._x + (((Math.cos(((_rotation + 54) * Math.PI) / 180) * 50) * this._xscale) / 100), this._y + (((Math.sin(((_rotation + 54) * Math.PI) / 180) * 50) * this._yscale) / 100)]);
_local6.push([this._x + (((Math.cos((((_rotation + 180) - 54) * Math.PI) / 180) * 50) * this._xscale) / 100), this._y + (((Math.sin((((_rotation + 180) - 54) * Math.PI) / 180) * 50) * this._yscale) / 100)]);
_local6.push([this._x + (((Math.cos(((_rotation - 54) * Math.PI) / 180) * 50) * this._xscale) / 100), this._y + (((Math.sin(((_rotation - 54) * Math.PI) / 180) * 50) * this._yscale) / 100)]);
_local6.push([this._x + (((Math.cos((((_rotation - 180) + 54) * Math.PI) / 180) * 50) * this._xscale) / 100), this._y + (((Math.sin((((_rotation - 180) + 54) * Math.PI) / 180) * 50) * this._yscale) / 100)]);
var _local7 = _parent.checkHit(_local6);
var _local11 = _local7[3];
var _local9 = _local7[2];
var _local8 = _local7[1];
var _local10 = _local7[0];
if (((_local11 || (_local9)) || (_local8)) || (_local10)) {
this.spd = this.spd * 0.9;
}
var _local4 = 0;
while (_local4 < _local7.length) {
if (_local7[_local4]) {
this._x = this._x + (((this._x - _local6[_local4][0]) / 40) * (Math.abs(spd) + 5));
this._y = this._y + (((this._y - _local6[_local4][1]) / 40) * (Math.abs(spd) + 5));
if ((_parent.level_timer - hit_sound_timer) > 1000) {
if (_root.sounds_enabled) {
var _local5 = new Sound();
if (Math.abs(spd) < 10) {
_local5.attachSound("naraz3");
} else {
_local5.attachSound("naraz2");
}
_local5.start(0, 1);
hit_sound_timer = _parent.level_timer;
}
}
}
_local4++;
}
}
function checkSlide() {
var _local4 = new Array();
_local4.push([this._x + (((Math.cos(((_rotation + 54) * Math.PI) / 180) * 50) * this._xscale) / 100), this._y + (((Math.sin(((_rotation + 54) * Math.PI) / 180) * 50) * this._yscale) / 100)]);
_local4.push([this._x + (((Math.cos((((_rotation + 180) - 54) * Math.PI) / 180) * 50) * this._xscale) / 100), this._y + (((Math.sin((((_rotation + 180) - 54) * Math.PI) / 180) * 50) * this._yscale) / 100)]);
_local4.push([this._x + (((Math.cos(((_rotation - 54) * Math.PI) / 180) * 50) * this._xscale) / 100), this._y + (((Math.sin(((_rotation - 54) * Math.PI) / 180) * 50) * this._yscale) / 100)]);
_local4.push([this._x + (((Math.cos((((_rotation - 180) + 54) * Math.PI) / 180) * 50) * this._xscale) / 100), this._y + (((Math.sin((((_rotation - 180) + 54) * Math.PI) / 180) * 50) * this._yscale) / 100)]);
if (_parent.checkSlide(_local4)) {
if (!sliding) {
if (_root.sounds_enabled) {
var _local5 = new Sound();
_local5.attachSound("splash");
_local5.start(0, 1);
}
}
this.start_slide_time = _parent.level_timer;
sliding = true;
}
}
function checkJump() {
var _local4 = new Array();
_local4.push([this._x + (((Math.cos(((_rotation + 54) * Math.PI) / 180) * 50) * this._xscale) / 100), this._y + (((Math.sin(((_rotation + 54) * Math.PI) / 180) * 50) * this._yscale) / 100)]);
_local4.push([this._x + (((Math.cos((((_rotation + 180) - 54) * Math.PI) / 180) * 50) * this._xscale) / 100), this._y + (((Math.sin((((_rotation + 180) - 54) * Math.PI) / 180) * 50) * this._yscale) / 100)]);
_local4.push([this._x + (((Math.cos(((_rotation - 54) * Math.PI) / 180) * 50) * this._xscale) / 100), this._y + (((Math.sin(((_rotation - 54) * Math.PI) / 180) * 50) * this._yscale) / 100)]);
_local4.push([this._x + (((Math.cos((((_rotation - 180) + 54) * Math.PI) / 180) * 50) * this._xscale) / 100), this._y + (((Math.sin((((_rotation - 180) + 54) * Math.PI) / 180) * 50) * this._yscale) / 100)]);
if (_parent.checkJump(_local4)) {
if (Math.abs(spd) > 5) {
if (_root.sounds_enabled) {
var _local5 = new Sound();
_local5.attachSound("jump_sound");
_local5.start(0, 1);
}
jumping = true;
old_point = null;
jump_way = 1;
target_scale = init_scale_x * (1 + (spd / 50));
}
}
}
function getCarHitPoints() {
var _local2 = new Array();
_local2.push([this._x + (((Math.cos(((_rotation + 70) * Math.PI) / 180) * 70) * this._xscale) / 100), this._y + (((Math.sin(((_rotation + 70) * Math.PI) / 180) * 75) * this._yscale) / 100)]);
_local2.push([this._x + (((Math.cos((((_rotation + 180) - 70) * Math.PI) / 180) * 70) * this._xscale) / 100), this._y + (((Math.sin((((_rotation + 180) - 70) * Math.PI) / 180) * 75) * this._yscale) / 100)]);
_local2.push([this._x + (((Math.cos(((_rotation - 70) * Math.PI) / 180) * 70) * this._xscale) / 100), this._y + (((Math.sin(((_rotation - 70) * Math.PI) / 180) * 70) * this._yscale) / 100)]);
_local2.push([this._x + (((Math.cos((((_rotation - 180) + 70) * Math.PI) / 180) * 70) * this._xscale) / 100), this._y + (((Math.sin((((_rotation - 180) + 70) * Math.PI) / 180) * 70) * this._yscale) / 100)]);
return(_local2);
}
function hitCar(car, skip_next, hit_point) {
if (skip_next != true) {
car.hitCar(this, true, hit_point);
hit_point = null;
}
if (hit_point != null) {
var _local13 = getCarHitPoints();
car._x = car._x - (((this._x - _local13[hit_point][0]) / 50) * (Math.abs(spd * 1.4) + 5));
car._y = car._y - (((this._y - _local13[hit_point][1]) / 50) * (Math.abs(spd * 1.4) + 5));
}
var _local15 = Math.atan2(car._y - this._y, car._x - this._x);
var _local4 = (-((((-_local15) * 180) / Math.PI) - 90)) - smyk;
var _local9;
var _local10;
var _local11;
_local4 = _local4 % 360;
if (_local4 < 0) {
_local4 = _local4 + 360;
}
if (_local4 > 180) {
_local4 = 360 - _local4;
}
if (_local4 < 90) {
var _local14 = car.spd;
var _local6 = car.smyk;
_local6 = _local6 % 360;
if (_local6 < 0) {
_local6 = _local6 + 360;
}
var _local5 = smyk % 360;
if (_local5 < 0) {
_local5 = _local5 + 360;
}
if (Math.abs(_local5 - _local6) > 180) {
if (_local5 > 180) {
_local6 + 360;
} else {
_local5 = _local5 + 360;
}
}
var _local7 = Math.cos((Math.abs(_local5 - _local6) * Math.PI) / 180) * _local14;
if (spd > _local7) {
if (_local7 > 0) {
_local9 = (spd - _local7) / 2;
} else {
_local9 = spd / 2;
}
_local10 = Math.sin((smyk * Math.PI) / 180) * _local9;
_local11 = (-Math.cos((smyk * Math.PI) / 180)) * _local9;
car.x_force = car.x_force + _local10;
car.y_force = car.y_force + _local11;
this.x_force = this.x_force - _local10;
this.y_force = this.y_force - _local11;
car.dir = car.dir + (random(50) - 25);
if (_root.sounds_enabled) {
var _local8 = new Sound();
if ((Math.abs(_local10) + Math.abs(_local11)) > 6) {
_local8.attachSound("naraz2");
} else {
_local8.attachSound("naraz3");
}
_local8.start(0, 1);
}
}
}
}
function proceedForces() {
if ((x_force != 0) || (y_force != 0)) {
var _local3 = Math.sin((smyk * Math.PI) / 180) * spd;
var _local4 = (-Math.cos((smyk * Math.PI) / 180)) * spd;
_local3 = _local3 + this.x_force;
_local4 = _local4 + this.y_force;
this.x_force = 0;
this.y_force = 0;
this.spd = Math.sqrt((_local3 * _local3) + (_local4 * _local4));
var _local2 = -(((Math.atan2(-_local4, _local3) * 180) / Math.PI) - 90);
_local2 = _local2 % 360;
if (_local2 < 0) {
_local2 = _local2 + 360;
}
this.smyk = _local2;
this.dir = this.dir % 360;
if (this.dir < 0) {
this.dir = this.dir + 360;
}
if (Math.abs(smyk - dir) > 180) {
if (smyk > 180) {
dir = dir + 360;
} else {
smyk = smyk + 360;
}
}
if (Math.abs(smyk - dir) > 90) {
spd = -spd;
smyk = smyk - 180;
}
}
}
function setPath(path) {
this.path = path;
}
function setBonus(b) {
if (_root.sounds_enabled) {
var _local4 = new Sound();
_local4.attachSound("pick_premie");
_local4.start(0, 1);
}
switch (b) {
case 0 :
this.turbo_count++;
break;
case 1 :
this.oil_count++;
break;
case 2 :
this.grip_bonus_timer = _parent.level_timer;
break;
case 3 :
this.rocket_count = this.rocket_count + 3;
}
}
function useTurbo() {
if (turbo_count > 0) {
if (_root.sounds_enabled) {
var _local4 = new Sound();
_local4.attachSound("turbo");
_local4.start(0, 1);
}
this.speed_bonus_timer = _parent.level_timer;
turbo_count--;
}
}
_rotation = 180;
dir = (smyk = 180);
hit_sound_timer = 0;
dirX = 0;
dirY = 0;
spd = 0;
car_type = "player";
if (rocket_count == null) {
rocket_count = 0;
}
if (oil_count == null) {
oil_count = 0;
}
if (_root.difficulty == 4) {
rocket_count = 99;
oil_count = 99;
}
if (turbo_count == null) {
turbo_count = 0;
}
grip_bonus_timer = null;
sliding = false;
var stopa_zvuk = new Sound();
stopa_zvuk.attachSound("smyk");
jumping = false;
smyk = dir;
mspd = 1.11;
finished = false;
init_scale_x = _xscale;
init_scale_y = _yscale;
this.x_force = 0;
this.y_force = 0;
var target_scale;
var jump_way = 0;
var live = true;
init_tire = 1.2;
tire = init_tire;
acceleration = (init_acceleration = 0.1);
brakes = (init_brakes = 1);
this.turn_speed = (this.init_turn_speed = 5);
max_speed = (init_max_speed = 50);
slide_length = 8000;
this.onEnterFrame = function () {
if (!_parent.paused) {
if (live) {
proceedForces();
if (sliding) {
tire = (((_parent.level_timer - start_slide_time) / slide_length) * 1.1) + 0.1;
if ((_parent.level_timer - start_slide_time) > slide_length) {
sliding = false;
tire = init_tire;
}
}
if (speed_bonus_timer != null) {
if ((_parent.level_timer - speed_bonus_timer) < 4000) {
this.acceleration = 0.35;
this.max_speed = 50;
} else {
speed_bonus_timer = null;
this.acceleration = this.init_acceleration;
this.max_speed = init_max_speed;
}
}
if (grip_bonus_timer != null) {
if ((_parent.level_timer - grip_bonus_timer) < 8000) {
this.tire = 2;
this.turn_speed = 6;
} else {
this.tire = init_tire;
this.turn_speed = init_turn_speed;
this.grip_bonus_timer = null;
}
}
if (!jumping) {
if (Key.isDown(38) && (finished == false)) {
if (spd < 0) {
spd = spd + (acceleration * 5);
} else if (spd < 1) {
spd = spd + (acceleration * 10);
} else if (spd < 10) {
spd = spd + (acceleration * (11 - spd));
} else {
spd = spd + acceleration;
}
spd = Math.min(max_speed, spd);
} else if (spd > 0) {
spd = spd - 0.03;
}
if (Key.isDown(39) && (Math.abs(spd) > 0.4)) {
if (Math.abs(spd) > 5) {
if (spd > 0) {
dir = dir + (turn_speed - (spd / 20));
} else {
dir = dir + ((-turn_speed) + (spd / 20));
}
} else {
dir = dir + (spd / 2);
}
}
if (Key.isDown(37) && (Math.abs(spd) > 0.4)) {
if (Math.abs(spd) > 5) {
if (spd > 0) {
dir = dir - (turn_speed - (spd / 20));
} else {
dir = dir - ((-turn_speed) + (spd / 20));
}
} else {
dir = dir - (spd / 2);
}
}
if (Key.isDown(32) && (sliding == false)) {
tire = 0.1;
turn_speed = 10;
if (spd > 0.5) {
spd = spd - 0.5;
} else if (spd < -0.5) {
spd = spd + 0.5;
}
} else if ((sliding == false) && (grip_bonus_timer == null)) {
tire = init_tire;
turn_speed = init_turn_speed;
}
if (Key.isDown(40)) {
if (spd > 4) {
spd = spd - brakes;
} else if (spd > -1) {
spd = spd - (acceleration * 5);
} else if (spd > -10) {
spd = spd - ((acceleration * (12 - spd)) / 2);
} else {
spd = spd - acceleration;
}
} else if (spd < 0) {
spd = spd + 0.08;
}
if (finished) {
spd = spd * 0.9;
}
}
this.old_x = this._x;
this.old_y = this._y;
if (Math.abs(spd) > 1) {
if (!jumping) {
smyk = smyk + (((dir - smyk) / Math.abs(spd)) * tire);
}
dirX = Math.sin((Math.PI/180) * smyk) * spd;
dirY = Math.cos((Math.PI/180) * smyk) * spd;
this._x = this._x + dirX;
this._y = this._y - dirY;
} else {
dirX = 0;
dirY = 0;
}
if (grip_bonus_timer == null) {
if (spd > 1) {
spd = spd - (Math.abs(dir - smyk) / 200);
spd = Math.max(0, spd);
} else if (spd < -1) {
spd = spd + (Math.abs(dir - smyk) / 200);
spd = Math.min(0, spd);
}
} else if (spd > 1) {
spd = spd - (Math.abs(dir - smyk) / 300);
spd = Math.max(0, spd);
} else if (spd < -1) {
spd = spd + (Math.abs(dir - smyk) / 300);
spd = Math.min(0, spd);
}
_rotation = dir;
checkHit();
if (!jumping) {
stopaGum();
checkSlide();
checkJump();
} else if (jump_way == 1) {
this._xscale = this._xscale + (jump_way * 2);
this._yscale = this._yscale + (jump_way * 2);
if (this._xscale >= this.target_scale) {
this.jump_way = -1;
}
} else if (jump_way == -1) {
this._xscale = this._xscale + (jump_way * 2);
this._yscale = this._yscale + (jump_way * 2);
if (this._xscale <= this.init_scale_x) {
this.jump_way = 0;
this.jumping = false;
this._xscale = (this._yscale = this.init_scale_x);
}
}
} else if (_xscale > 0) {
this._rotation = this._rotation + 5;
this._xscale--;
this._yscale--;
dirX = Math.sin((Math.PI/180) * smyk) * spd;
dirY = Math.cos((Math.PI/180) * smyk) * spd;
spd = spd * 0.95;
this._x = this._x + dirX;
this._y = this._y - dirY;
} else {
live = true;
this._xscale = (this._yscale = this.init_scale_x);
this.spd = 0;
var _local8 = this._x - this._parent.bg._x;
var _local7 = this._y - this._parent.bg._y;
var _local5 = 999999999 /* 0x3B9AC9FF */;
var _local4;
var _local6 = -1;
var _local3 = 0;
while (_local3 < this.path.length) {
_local4 = Math.sqrt(Math.pow(_local8 - path[_local3][0][0], 2) + Math.pow(_local7 - path[_local3][0][1], 2));
if (_local4 < _local5) {
_local5 = _local4;
_local6 = _local3;
}
_local3++;
}
var _local9 = _local6 + 1;
if (_local9 >= this.path.length) {
_local9 = 0;
}
this._x = path[_local6][0][0] + this._parent.bg._x;
this._y = path[_local6][0][1] + this._parent.bg._y;
var _local11 = path[_local9][0][0] + this._parent.bg._x;
var _local10 = path[_local9][0][1] + this._parent.bg._y;
this._parent.check_inside = false;
this._rotation = (this.dir = (this.smyk = (((Math.atan2(_local10 - this._y, _local11 - this._x) * 180) / Math.PI) - 90) + 180));
}
}
};
Symbol 446 MovieClip Frame 1
t = getTimer();
var count;
onEnterFrame = function () {
if ((1000 / (getTimer() - t)) < 20) {
count++;
if (count > 2) {
if (_quality == "HIGH") {
_quality = "MEDIUM";
} else {
_quality = "MEDIUM";
if ("MEDIUM") {
_quality = "LOW";
}
}
count = 0;
}
} else {
count = 0;
}
t = getTimer();
};
Symbol 455 MovieClip Frame 1
function checkSlides(point) {
var _local1 = 0;
while (_local1 < slides.length) {
if (slides[_local1].hitTest(point[0], point[1], true)) {
return(true);
}
_local1++;
}
return(false);
}
function checkJumps(point) {
var _local1 = 0;
while (_local1 < jumps.length) {
if (jumps[_local1].hitTest(point[0], point[1], true)) {
return(true);
}
_local1++;
}
return(false);
}
function createOil(x, y) {
var _local2 = this.attachMovie("oil", "oil" + this.getNextHighestDepth(), this.getNextHighestDepth());
_local2._x = x;
_local2._y = y;
this.slides.push(_local2);
}
stop();
slides = new Array();
jumps = null;
Symbol 514 MovieClip Frame 1
function checkHit(point) {
var _local1 = 0;
while (_local1 < hits.length) {
if (hits[_local1].hitTest(point[0], point[1], true)) {
return(true);
}
_local1++;
}
return(false);
}
function checkBonuses(car) {
var _local2 = 0;
while (_local2 < this.bonuses.length) {
if (car.hitTest(this.bonuses[_local2])) {
var _local4 = this.bonuses[_local2].type;
var _local3 = random(dots.length);
bonuses[_local2]._x = (dots[_local3][0]._x + random(100)) - 50;
bonuses[_local2]._y = (dots[_local3][0]._y + random(100)) - 50;
bonuses[_local2].gotoAndStop(random(4) + 1);
return(_local4);
}
_local2++;
}
return(null);
}
function checkPoints(car) {
if (car.hitTest(points[cur_cp])) {
if (cur_cp == 0) {
laps++;
}
cur_cp++;
if (cur_cp >= points.length) {
cur_cp = 0;
}
}
if ((laps == _parent.laps_count) && (!finished)) {
_parent.finish();
finished = true;
}
}
points = [cp0, cp1, cp2, cp3, cp4, cp5, cp6];
var i = 0;
while (i < points.length) {
points[i]._visible = false;
i++;
}
finished = false;
laps = 0;
cur_cp = 1;
bonuses = [b1, b2, b3, b4];
hits = [hit1];
var dots = [[dot0, 15, dotb0, 15], [dot1, 30, dotb1, 30], [dot2, 30, dotb2, 30], [dot3, 15, dotb3, 15], [dot4, 12, dotb4, 12], [dot5, 10, dotb5, 10], [dot6, 10, dotb6, 10], [dot7, 15, dotb7, 15], [dot8, 30, dotb8, 30], [dot9, 10, dotb9, 10], [dot10, 10, dotb10, 10], [dot11, 8], [dotb11, 10], [dot12, 30], [dotb12, 15], [dot13, 18, dotb13, 18], [dot14, 30, dotb14, 30], [dot15, 10, dotb15, 10], [dot16, 10, dotb16, 10], [dot17, 30, dotb17, 30], [dot18, 15, dotb18, 15], [dot19, 15, dotb19, 15], [dot20, 30, dotb20, 30], [dot21, 15, dotb21, 15], [dot22, 8, dotb22, 8], [dot23, 15], [dot24, 18, dotb24, 18], [dot25, 17, dotb25, 17], [dot26, 12, dotb26, 12], [dot27, 9, dotb27, 9], [dot28, 15, dotb28, 15], [dot29, 8, dotb29, 8], [dot30, 8, dotb30, 8]];
var AI_path = new Array();
AI_path[0] = new Array();
var cur_i = 0;
difficulty_coef = [0.75, 1, 1, 1];
coef = difficulty_coef[_parent.difficulty - 1];
var i = 0;
while (i < dots.length) {
if (AI_path[cur_i].length > 0) {
AI_path.push(new Array());
cur_i = AI_path.length - 1;
}
var e = 0;
while (e < (dots[i].length / 2)) {
if (dots[i][e * 2] != null) {
AI_path[cur_i].push([dots[i][e * 2]._x, dots[i][e * 2]._y, dots[i][(e * 2) + 1] * coef]);
dots[i][e * 2]._visible = false;
}
e++;
}
i++;
}
var i = 0;
while (i < dots.length) {
dots[i][0].n = dots[i][0]._name.substring(3, dots[i][0]._name.length);
dots[i][2].n = dots[i][2]._name.substring(3, dots[i][2]._name.length);
i++;
}
var i = 0;
while (i < bonuses.length) {
var d = random(dots.length);
bonuses[i]._x = (dots[d][0]._x + random(100)) - 50;
bonuses[i]._y = (dots[d][0]._y + random(100)) - 50;
bonuses[i].gotoAndStop(random(4) + 1);
i++;
}
Symbol 728 MovieClip Frame 1
function checkSlides(point) {
var _local1 = 0;
while (_local1 < slides.length) {
if (slides[_local1].hitTest(point[0], point[1], true)) {
return(true);
}
_local1++;
}
return(false);
}
function checkJumps(point) {
var _local1 = 0;
while (_local1 < jumps.length) {
if (jumps[_local1].hitTest(point[0], point[1], true)) {
return(true);
}
_local1++;
}
return(false);
}
function createOil(x, y) {
var _local2 = this.attachMovie("oil", "oil" + this.getNextHighestDepth(), this.getNextHighestDepth());
_local2._x = x;
_local2._y = y;
this.slides.push(_local2);
}
stop();
slides = [slide1];
jumps = [jump1];
Symbol 817 MovieClip Frame 1
function checkHit(point) {
var _local1 = 0;
while (_local1 < hits.length) {
if (hits[_local1].hitTest(point[0], point[1], true)) {
return(true);
}
_local1++;
}
return(false);
}
function checkBonuses(car) {
var _local2 = 0;
while (_local2 < this.bonuses.length) {
if (car.hitTest(this.bonuses[_local2])) {
var _local4 = this.bonuses[_local2].type;
var _local3 = random(dots.length);
bonuses[_local2]._x = (dots[_local3][0]._x + random(200)) - 100;
bonuses[_local2]._y = (dots[_local3][0]._y + random(200)) - 100;
bonuses[_local2].gotoAndStop(random(4) + 1);
return(_local4);
}
_local2++;
}
return(null);
}
function checkPoints(car) {
if (car.hitTest(points[cur_cp])) {
if (cur_cp == 0) {
laps++;
}
cur_cp++;
if (cur_cp >= points.length) {
cur_cp = 0;
}
}
if ((laps == _parent.laps_count) && (!finished)) {
_parent.finish();
finished = true;
}
}
points = [cp0, cp1, cp2, cp3];
var i = 0;
while (i < points.length) {
points[i]._visible = false;
i++;
}
bonuses = [b1, b2, b3, b4];
finished = false;
laps = 0;
cur_cp = 1;
hits = [hit1, jump2];
var dots = [[dot0, 10, dotb0, 15], [dot1, 10, dotb1, 20], [dot2, 10], [dot3, 20, dotb3, 20], [dot4, 20, dotb4, 20], [dot5, 20], [dot6, 20, dotb6, 20], [dot7, 12], [dot8, 12], [dot9, 8], [dot10, 7], [dot11, 20], [dot12, 12], [dot13, 15], [dot14, 15], [dot15, 20, dotb15, 20], [dot16, 40], [dot17, 25, dotb17, 25], [dot18, 13, dotb18, 13], [dot19, 22], [dot20, 20, dotb20, 20], [dot21, 25, dotb21, 25], [dot22, 30], [dot23, 25, dotb23, 25], [dot24, 40, dotb24, 40], [dot25, 20, dotb25, 20], [dot26, 20], [dot27, 15], [dot28, 15], [dot29, 15], [dot30, 13, dotb30, 13], [dot31, 10, dotb31, 10], [dot32, 15], [dot33, 12], [dot34, 10], [dot35, 10], [dot36, 10], [dot37, 15], [dot38, 20], [dot39, 15, dotb39, 15], [dot40, 10, dotb40, 10], [dot41, 10, dotb41, 10]];
var AI_path = new Array();
AI_path[0] = new Array();
var cur_i = 0;
difficulty_coef = [0.75, 1, 1, 1];
coef = difficulty_coef[_parent.difficulty - 1];
var i = 0;
while (i < dots.length) {
if (AI_path[cur_i].length > 0) {
AI_path.push(new Array());
cur_i = AI_path.length - 1;
}
var e = 0;
while (e < (dots[i].length / 2)) {
if (dots[i][e * 2] != null) {
AI_path[cur_i].push([dots[i][e * 2]._x, dots[i][e * 2]._y, dots[i][(e * 2) + 1] * coef]);
dots[i][e * 2]._visible = false;
}
e++;
}
i++;
}
var i = 0;
while (i < dots.length) {
dots[i][0].n = dots[i][0]._name.substring(3, dots[i][0]._name.length);
i++;
}
var i = 0;
while (i < bonuses.length) {
var d = random(dots.length);
bonuses[i]._x = (dots[d][0]._x + random(200)) - 100;
bonuses[i]._y = (dots[d][0]._y + random(200)) - 100;
bonuses[i].gotoAndStop(random(4) + 1);
i++;
}
Symbol 820 MovieClip Frame 1
function checkSlides(point) {
var _local1 = 0;
while (_local1 < slides.length) {
if (slides[_local1].hitTest(point[0], point[1], true)) {
return(true);
}
_local1++;
}
return(false);
}
function checkJumps(point) {
var _local1 = 0;
while (_local1 < jumps.length) {
if (jumps[_local1].hitTest(point[0], point[1], true)) {
return(true);
}
_local1++;
}
return(false);
}
function createOil(x, y) {
var _local2 = this.attachMovie("oil", "oil" + this.getNextHighestDepth(), this.getNextHighestDepth());
_local2._x = x;
_local2._y = y;
this.slides.push(_local2);
}
stop();
slides = new Array();
jumps = [jump1];
Symbol 824 MovieClip Frame 1
function checkHit(point) {
var _local1 = 0;
while (_local1 < hits.length) {
if (hits[_local1].hitTest(point[0], point[1], true)) {
return(true);
}
_local1++;
}
return(false);
}
function checkBonuses(car) {
var _local2 = 0;
while (_local2 < this.bonuses.length) {
if (car.hitTest(this.bonuses[_local2])) {
var _local4 = this.bonuses[_local2].type;
var _local3 = random(dots.length);
bonuses[_local2]._x = (dots[_local3][0]._x + random(100)) - 50;
bonuses[_local2]._y = (dots[_local3][0]._y + random(100)) - 50;
bonuses[_local2].gotoAndStop(random(4) + 1);
return(_local4);
}
_local2++;
}
return(null);
}
function checkPoints(car) {
if (car.hitTest(points[cur_cp])) {
if (cur_cp == 0) {
laps++;
}
cur_cp++;
if (cur_cp >= points.length) {
cur_cp = 0;
}
}
if ((laps == _parent.laps_count) && (!finished)) {
_parent.finish();
finished = true;
}
}
bonuses = [b1, b2, b3, b4];
hits = [hit1];
points = [cp0, cp1, cp2, cp3, cp4, cp5];
var i = 0;
while (i < points.length) {
points[i]._visible = false;
i++;
}
finished = false;
laps = 0;
cur_cp = 1;
var dots = [[dot0, 8, dotb0, 8], [dot1, 30, dotb1, 30], [dot2, 10, dotb2, 10], [dotx3, 8], [dot3, 15], [dotx4, 12], [dot4, 12], [dot5, 15, dotb5, 15], [dot6, 12, dotb6, 12], [dot7, 30, dotb7, 30], [dot8, 30, dotb8, 30], [dot9, 30, dotb9, 30], [dot10, 14, dotb10, 14], [dot11, 16, dotb11, 16], [dot12, 9, dotb12, 9], [dot13, 11, dotb13, 11], [dot14, 10, dotb14, 10], [dot15, 11, dotb15, 11], [dot16, 30, dotb16, 30], [dot17, 12, dotb17, 12], [dot18, 9, dotb18, 9], [dot19, 8, dotb19, 8], [dot20, 9, dotb20, 9], [dot21, 11, dotb21, 11], [dot22, 9, dotb22, 9], [dot23, 15, dotb23, 15], [dot24, 30, dotb24, 30], [dot25, 30, dotb25, 30], [dot26, 13, dotb26, 13]];
var AI_path = new Array();
AI_path[0] = new Array();
var cur_i = 0;
difficulty_coef = [0.68, 0.78, 0.9, 0.9];
coef = difficulty_coef[_parent.difficulty - 1];
var i = 0;
while (i < dots.length) {
if (AI_path[cur_i].length > 0) {
AI_path.push(new Array());
cur_i = AI_path.length - 1;
}
var e = 0;
while (e < (dots[i].length / 2)) {
if (dots[i][e * 2] != null) {
AI_path[cur_i].push([dots[i][e * 2]._x, dots[i][e * 2]._y, dots[i][(e * 2) + 1] * coef]);
dots[i][e * 2]._visible = false;
}
e++;
}
i++;
}
var i = 0;
while (i < dots.length) {
dots[i][0].n = dots[i][0]._name.substring(3, dots[i][0]._name.length);
dots[i][2].n = dots[i][2]._name.substring(3, dots[i][2]._name.length);
i++;
}
var i = 0;
while (i < bonuses.length) {
var d = random(dots.length);
bonuses[i]._x = (dots[d][0]._x + random(100)) - 50;
bonuses[i]._y = (dots[d][0]._y + random(100)) - 50;
bonuses[i].gotoAndStop(random(4) + 1);
i++;
}
Symbol 827 MovieClip Frame 1
function checkSlides(point) {
var _local1 = 0;
while (_local1 < slides.length) {
if (slides[_local1].hitTest(point[0], point[1], true)) {
return(true);
}
_local1++;
}
return(false);
}
function checkJumps(point) {
var _local1 = 0;
while (_local1 < jumps.length) {
if (jumps[_local1].hitTest(point[0], point[1], true)) {
return(true);
}
_local1++;
}
return(false);
}
function createOil(x, y) {
var _local2 = this.attachMovie("oil", "oil" + this.getNextHighestDepth(), this.getNextHighestDepth());
_local2._x = x;
_local2._y = y;
this.slides.push(_local2);
}
stop();
slides = new Array();
jumps = null;
Symbol 830 MovieClip Frame 1
function checkHit(point) {
var _local1 = 0;
while (_local1 < hits.length) {
if (hits[_local1].hitTest(point[0], point[1], true)) {
return(true);
}
_local1++;
}
return(false);
}
function checkBonuses(car) {
var _local2 = 0;
while (_local2 < this.bonuses.length) {
if (car.hitTest(this.bonuses[_local2])) {
var _local4 = this.bonuses[_local2].type;
var _local3 = random(dots.length);
bonuses[_local2]._x = (dots[_local3][0]._x + random(100)) - 50;
bonuses[_local2]._y = (dots[_local3][0]._y + random(100)) - 50;
bonuses[_local2].gotoAndStop(random(4) + 1);
return(_local4);
}
_local2++;
}
return(null);
}
function checkPoints(car) {
if (car.hitTest(points[cur_cp])) {
if (cur_cp == 0) {
laps++;
}
cur_cp++;
if (cur_cp >= points.length) {
cur_cp = 0;
}
}
if ((laps == _parent.laps_count) && (!finished)) {
_parent.finish();
finished = true;
}
}
points = [cp0, cp1, cp2, cp3, cp4, cp5, cp6, cp7];
var i = 0;
while (i < points.length) {
points[i]._visible = false;
i++;
}
finished = false;
laps = 0;
cur_cp = 1;
bonuses = [b1, b2, b3, b4];
hits = [hit1];
var dots = [[dot0, 14, dotb0, 14], [dot1, 30, dotb1, 30], [dot2, 16, dotb2, 16], [dot3, 12, dotb3, 12], [dot4, 15, dotb4, 15], [dot5, 30, dotb5, 30], [dot6, 30, dotb6, 30], [dot7, 10, dotb7, 10], [dot8, 13, dotb8, 13], [dot9, 30, dotb9, 30], [dot10, 10], [dotb10, 10], [dot11, 14], [dot12, 30], [dot13, 30, dotb13, 30], [dot14, 15, dotb14, 15], [dot15, 16, dotb15, 16], [dot16, 16, dotb16, 16], [dot17, 16, dotb17, 16], [dot18, 30, dotb18, 30], [dot19, 15, dotb19, 15], [dot20, 13, dotb20, 13], [dot21, 16, dotb21, 16], [dot22, 30, dotb22, 30], [dot23, 8], [dotb23, 8], [dot24, 12, dotb24, 12], [dot25, 13, dotb25, 13], [dot26, 15, dotb26, 15], [dot27, 30, dotb27, 30]];
var AI_path = new Array();
AI_path[0] = new Array();
var cur_i = 0;
difficulty_coef = [0.68, 0.78, 0.9, 0.9];
coef = difficulty_coef[_parent.difficulty - 1];
var i = 0;
while (i < dots.length) {
if (AI_path[cur_i].length > 0) {
AI_path.push(new Array());
cur_i = AI_path.length - 1;
}
var e = 0;
while (e < (dots[i].length / 2)) {
if (dots[i][e * 2] != null) {
AI_path[cur_i].push([dots[i][e * 2]._x, dots[i][e * 2]._y, dots[i][(e * 2) + 1] * coef]);
dots[i][e * 2]._visible = false;
}
e++;
}
i++;
}
var i = 0;
while (i < dots.length) {
dots[i][0].n = dots[i][0]._name.substring(3, dots[i][0]._name.length);
dots[i][2].n = dots[i][2]._name.substring(3, dots[i][2]._name.length);
i++;
}
var i = 0;
while (i < bonuses.length) {
var d = random(dots.length);
bonuses[i]._x = (dots[d][0]._x + random(100)) - 50;
bonuses[i]._y = (dots[d][0]._y + random(100)) - 50;
bonuses[i].gotoAndStop(random(4) + 1);
i++;
}
Symbol 835 MovieClip Frame 1
function checkSlides(point) {
var _local1 = 0;
while (_local1 < slides.length) {
if (slides[_local1].hitTest(point[0], point[1], true)) {
return(true);
}
_local1++;
}
return(false);
}
function checkJumps(point) {
var _local1 = 0;
while (_local1 < jumps.length) {
if (jumps[_local1].hitTest(point[0], point[1], true)) {
return(true);
}
_local1++;
}
return(false);
}
function createOil(x, y) {
var _local2 = this.attachMovie("oil", "oil" + this.getNextHighestDepth(), this.getNextHighestDepth());
_local2._x = x;
_local2._y = y;
this.slides.push(_local2);
}
stop();
slides = [slide1];
jumps = [jump1];
Symbol 838 MovieClip Frame 1
function checkHit(point) {
var _local1 = 0;
while (_local1 < hits.length) {
if (hits[_local1].hitTest(point[0], point[1], true)) {
return(true);
}
_local1++;
}
return(false);
}
function checkBonuses(car) {
var _local2 = 0;
while (_local2 < this.bonuses.length) {
if (car.hitTest(this.bonuses[_local2])) {
var _local4 = this.bonuses[_local2].type;
var _local3 = random(dots.length);
bonuses[_local2]._x = (dots[_local3][0]._x + random(200)) - 100;
bonuses[_local2]._y = (dots[_local3][0]._y + random(200)) - 100;
bonuses[_local2].gotoAndStop(random(4) + 1);
return(_local4);
}
_local2++;
}
return(null);
}
function checkPoints(car) {
if (car.hitTest(points[cur_cp])) {
if (cur_cp == 0) {
laps++;
}
cur_cp++;
if (cur_cp >= points.length) {
cur_cp = 0;
}
}
if ((laps == _parent.laps_count) && (!finished)) {
_parent.finish();
finished = true;
}
}
points = [cp0, cp1, cp2, cp3];
var i = 0;
while (i < points.length) {
points[i]._visible = false;
i++;
}
bonuses = [b1, b2, b3, b4];
finished = false;
laps = 0;
cur_cp = 1;
hits = [hit1, jump2];
var dots = [[dot0, 10, dotb0, 10], [dot1, 15, dotb1, 15], [dot2, 15, dotb2, 15], [dot3, 10, dotb3, 10], [dot4, 15, dotb4, 15], [dot5, 30], [dot6, 30, dotb6, 30], [dot7, 8], [dot8, 8], [dot9, 15], [dot10, 12], [dot11, 10], [dot12, 15], [dot13, 15], [dot14, 13], [dot15, 9], [dot16, 30], [dot17, 12], [dot18, 7], [dotb18, 10], [dot19, 10], [dot20, 30], [dot21, 15], [dot22, 8]];
var AI_path = new Array();
AI_path[0] = new Array();
var cur_i = 0;
difficulty_coef = [0.68, 0.78, 0.9, 0.9];
coef = difficulty_coef[_parent.difficulty - 1];
var i = 0;
while (i < dots.length) {
if (AI_path[cur_i].length > 0) {
AI_path.push(new Array());
cur_i = AI_path.length - 1;
}
var e = 0;
while (e < (dots[i].length / 2)) {
if (dots[i][e * 2] != null) {
AI_path[cur_i].push([dots[i][e * 2]._x, dots[i][e * 2]._y, dots[i][(e * 2) + 1] * coef]);
dots[i][e * 2]._visible = false;
}
e++;
}
i++;
}
var i = 0;
while (i < dots.length) {
dots[i][0].n = dots[i][0]._name.substring(3, dots[i][0]._name.length);
i++;
}
var i = 0;
while (i < bonuses.length) {
var d = random(dots.length);
bonuses[i]._x = (dots[d][0]._x + random(200)) - 100;
bonuses[i]._y = (dots[d][0]._y + random(200)) - 100;
bonuses[i].gotoAndStop(random(4) + 1);
i++;
}
Symbol 840 MovieClip Frame 1
function go() {
paused = false;
}
function exitLevel() {
var _local1 = 0;
while (_local1 < cars.length) {
cars[_local1].removeMovieClip();
_local1++;
}
bg.removeMovieClip();
bg = null;
hits.removeMovieClip();
hits = null;
bg_con.removeMovieClip();
bg_con = null;
}
function moveBg() {
if (car._x > 600) {
bg._x = bg._x - (car._x - 600);
moveCars(-(car._x - 600), 0);
car._x = 600;
} else if (car._x < 300) {
bg._x = bg._x + (300 - car._x);
moveCars(300 - car._x, 0);
car._x = 300;
}
if (car._y < 275) {
bg._y = bg._y + (275 - car._y);
moveCars(0, 275 - car._y);
car._y = 275;
} else if (car._y > 325) {
bg._y = bg._y - (car._y - 325);
moveCars(0, -(car._y - 325));
car._y = 325;
}
bg2._x = bg._x / 4;
bg2._y = bg._y / 4;
bg_con._x = bg._x;
bg_con._y = bg._y;
hits._x = bg._x;
hits._y = bg._y;
}
function moveCars(x, y) {
var _local1 = 0;
while (_local1 < enemyCars.length) {
enemyCars[_local1]._x = enemyCars[_local1]._x + x;
enemyCars[_local1]._y = enemyCars[_local1]._y + y;
_local1++;
}
_local1 = 0;
while (_local1 < rockets.length) {
rockets[_local1]._x = rockets[_local1]._x + x;
rockets[_local1]._y = rockets[_local1]._y + y;
_local1++;
}
}
function stopaGum(body, body2, alpha, color, thickness) {
if ((this.cur_con == null) || (this.cur_con.count > 10)) {
if (cur_con != null) {
bitmap.draw(cur_con);
cur_con.removeMovieClip();
}
this.cur_con = bg_con.createEmptyMovieClip("con" + bg_con.getNextHighestDepth(), bg_con.getNextHighestDepth());
this.cur_con.count = 0;
}
cur_con.count++;
if (thickness == null) {
thickness = 1;
}
if (color == null) {
color = 0;
}
if (alpha == null) {
alpha = 50;
}
cur_con.lineStyle(thickness, color, alpha);
var _local8;
if (stopa_frame > 2) {
old_bg_con_x = bg_con._x;
old_bg_con_y = bg_con._y;
}
stopa_frame = 0;
var _local2 = 0;
while (_local2 < body.length) {
cur_con.moveTo(body[_local2][0] - this.bg_con._x, body[_local2][1] - this.bg_con._y);
cur_con.lineTo(body2[_local2][0] - old_bg_con_x, body2[_local2][1] - old_bg_con_y);
_local2++;
}
}
function checkHit(points) {
var _local4 = new Array();
found = false;
var _local2 = 0;
while (_local2 < points.length) {
_local4[_local2] = this.hits.checkHit(points[_local2]);
_local2++;
}
return(_local4);
}
function checkSlide(points) {
var _local2 = 0;
while (_local2 < points.length) {
if (this.bg.checkSlides(points[_local2])) {
return(true);
}
_local2++;
}
return(false);
}
function checkJump(points) {
var _local2 = 0;
while (_local2 < points.length) {
if (this.bg.checkJumps(points[_local2])) {
return(true);
}
_local2++;
}
return(false);
}
function swapCarDown(car) {
hits.swapDepths(10);
bg_con.swapDepths(9);
bg.swapDepths(8);
}
function carsHitTest() {
var _local3 = new Array();
var _local2 = 0;
while (_local2 < cars.length) {
_local3[_local2] = new Array();
if (!cars[_local2].live) {
} else {
var _local1 = 0;
while (_local1 < cars.length) {
if (!cars[_local1].live) {
} else if (_local2 == _local1) {
} else if (_local3[_local2][_local1] || (_local3[_local1][_local2])) {
} else if (carHitCheck(cars[_local2], cars[_local1])) {
_local3[_local2][_local1] = true;
_local3[_local1][_local2] = true;
}
_local1++;
}
}
_local2++;
}
}
function carHitCheck(car1, car2) {
var _local5 = car1.getCarHitPoints();
var _local4 = car2.getCarHitPoints();
var _local6 = false;
if (car1.hitTest(car2)) {
var _local1 = 0;
while (_local1 < _local5.length) {
if (car2.hitTest(_local5[_local1][0], _local5[_local1][1], true, _local1)) {
car2.hitCar(car1, false, _local1);
_local6 = true;
break;
}
_local1++;
}
_local1 = 0;
while (_local1 < _local4.length) {
if (car1.hitTest(_local4[_local1][0], _local4[_local1][1], true)) {
car1.hitCar(car2, false, _local1);
_local6 = true;
break;
}
_local1++;
}
}
return(_local6);
}
function checkCarsInside() {
if (check_inside) {
var _local2 = 0;
while (_local2 < cars.length) {
if ((!this.bg.hitTest(cars[_local2]._x, cars[_local2]._y, true)) && (cars[_local2].live)) {
cars[_local2].chcipni();
}
_local2++;
}
} else {
check_inside = true;
}
}
function checkBonuses() {
var _local2 = 0;
while (_local2 < this.cars.length) {
var _local3 = this.hits.checkBonuses(this.cars[_local2]);
if (_local3 != null) {
this.cars[_local2].setBonus(_local3);
if (cars[_local2] == car) {
picked_powerups++;
}
}
_local2++;
}
}
function insertRocket(r) {
this.rockets.push(r);
}
function removeRocket(r) {
var _local1 = 0;
while (_local1 < rockets.length) {
if (rockets[_local1] == r) {
rockets.splice(_local1, 1);
break;
}
_local1++;
}
}
function finish() {
car.finished = true;
carFinished(true);
}
function carFinished(player) {
if (player) {
this._parent.finishLevel(this.level, car_position, level_timer, picked_powerups);
} else {
car_position++;
}
}
function checkKeys() {
if (Key.getCode() == 83) {
if ((car.oil_count > 0) && ((getTimer() - oil_time) > 5000)) {
createOil(car);
oil_time = getTimer();
}
}
if ((Key.getCode() == 68) && ((getTimer() - fire_time) > 1000)) {
fire_time = getTimer();
fireRocket(car);
}
if (Key.getCode() == 65) {
car.useTurbo();
}
}
function fireRocket(car) {
if (car.rocket_count > 0) {
if (_root.sounds_enabled) {
var _local5 = new Sound();
_local5.attachSound("launch");
_local5.start(0, 1);
}
var _local3 = this.attachMovie("rocket", "rocket" + this.getNextHighestDepth(), this.getNextHighestDepth());
_local3._rotation = car._rotation;
_local3._x = car._x + (Math.sin((this.car.dir * Math.PI) / 180) * 40);
_local3._y = car._y - (Math.cos((this.car.dir * Math.PI) / 180) * 40);
this._parent.addRocketMask(_local3);
car.rocket_count--;
insertRocket(_local3);
}
}
function createOil(car) {
if (car.oil_count > 0) {
if (_root.sounds_enabled) {
var _local3 = new Sound();
_local3.attachSound("splash");
_local3.start(0, 1);
}
this.bg.createOil((car._x - bg._x) - (Math.sin((this.car.smyk * Math.PI) / 180) * 40), (car._y - bg._y) + (Math.cos((this.car.smyk * Math.PI) / 180) * 40));
car.oil_count--;
}
}
function nextLevel() {
_root.oil_count = car.oil_count;
_root.rocket_count = car.rocket_count;
_root.turbo_count = car.turbo_count;
this.onEnterFrame = null;
exitLevel();
gotoAndStop("play" + (this.level + 1));
}
function resetLevel() {
this.onEnterFrame = null;
exitLevel();
gotoAndStop ("reset_level");
}
function returnToRace() {
this.check_inside = false;
var _local2 = hits.cur_cp - 1;
if (_local2 < 0) {
_local2 = hits.points.length - 1;
}
car._x = this.hits.points[_local2]._x + hits._x;
car._y = this.hits.points[_local2]._y + hits._y;
car.spd = 0;
car.resetRotation();
}
function checkRocket(rocket) {
var _local2 = 0;
while (_local2 < this.hits.hits.length) {
if (this.hits.hits[_local2].hitTest(rocket._x, rocket._y, true)) {
return(true);
}
_local2++;
}
}
if (game_sound == null) {
game_sound = new Sound();
} else {
game_sound.stop();
}
game_sound.attachSound("detsky_pokoj");
game_sound.start(0, 9999);
this.car_types = _parent.car_types;
oil_time = 0;
fire_time = 0;
this.difficulty = _parent.difficulty;
stop();
this.laps_count = 2;
picked_powerups = 0;
this.bg = this.bg_lev2;
this.bg2 = null;
this.hits = this.hits_lev2;
var pos = 1;
disp = _parent.disp;
this.car_position = 1;
this.level = 1;
this.paused = true;
var stopa_frame = 0;
var start = true;
_parent.starter.gotoAndPlay(1);
this.cars = [car, car1, car2, car3, car4, car5];
this.rockets = new Array();
level_timer = 0;
var i = 0;
while (i < cars.length) {
cars[i].gr.gotoAndStop(car_types[i]);
i++;
}
var enemyCars = [car, car1, car2, car3, car4, car5];
hits.setMask(mask);
first_run = true;
var bitmap = (new flash.display.BitmapData(2800, 2800, true, 0));
bg_con = this.createEmptyMovieClip("bg_con", 1);
bg_con.attachBitmap(bitmap, 2);
this.hits.swapDepths(2);
this.cur_con = null;
var i = 0;
while (i < cars.length) {
cars[i].swapDepths(90 + i);
i++;
}
Key.addListener(this);
onKeyDown = function () {
if (!paused) {
checkKeys();
}
if (Key.getCode() == 80) {
paused = !paused;
if (paused) {
disp.pause.gotoAndStop(2);
} else {
disp.pause.gotoAndStop(1);
}
}
};
disp.mapka.gotoAndStop(1);
this.onEnterFrame = function () {
fps.text = (((("FPS=" + Math.round(1000 / (getTimer() - t))) + "\tX=") + this._xmouse) + "\t\tY=") + this._ymouse;
t = getTimer();
var _local3 = 0;
while (_local3 < cars.length) {
disp.mapka[cars[_local3].map_dot]._x = ((-(bg._x - cars[_local3]._x)) / 30) + 2;
disp.mapka[cars[_local3].map_dot]._y = (-(bg._y - cars[_local3]._y)) / 29;
_local3++;
}
if (!paused) {
if (!car.finished) {
level_timer = level_timer + 33.3333333333333;
}
old_bg_con_x = bg_con._x;
old_bg_con_y = bg_con._y;
stopa_frame++;
moveBg();
carsHitTest();
checkBonuses();
hits.checkPoints(car);
if (first_run) {
car.oil_count = _root.oil_count;
car.rocket_count = _root.rocket_count;
car.turbo_count = _root.turbo_count;
first_run = false;
_local3 = 0;
while (_local3 < cars.length) {
cars[_local3].setPath(hits.AI_path, hits);
cars[_local3].setCars(cars);
_local3++;
}
}
}
};
moveBg();
Symbol 840 MovieClip Frame 2
stop();
game_sound.stop("detsky_pokoj");
game_sound.attachSound("zahrada");
game_sound.start(0, 9999);
this.bg = this.bg_lev3;
this.bg2 = null;
picked_powerups = 0;
this.hits = this.hits_lev3;
var pos = 1;
this.car_position = 1;
this.paused = true;
this.level = 2;
disp = _parent.disp;
var stopa_frame = 0;
var start = true;
_parent.starter.gotoAndPlay(1);
this.cars = [car, car1, car2, car3, car4, car5];
this.rockets = new Array();
var i = 0;
while (i < cars.length) {
cars[i].gr.gotoAndStop(car_types[i]);
i++;
}
var enemyCars = [car, car1, car2, car3, car4, car5];
hits.setMask(mask);
first_run = true;
var bitmap = (new flash.display.BitmapData(2800, 2800, true, 0));
bg_con = this.createEmptyMovieClip("bg_con", 1);
bg_con.attachBitmap(bitmap, 2);
this.hits.swapDepths(2);
this.cur_con = null;
var i = 0;
while (i < cars.length) {
cars[i].swapDepths(90 + i);
i++;
}
level_timer = 0;
Key.addListener(this);
onKeyDown = function () {
if (!paused) {
checkKeys();
}
if (Key.getCode() == 80) {
paused = !paused;
if (paused) {
disp.pause.gotoAndStop(2);
} else {
disp.pause.gotoAndStop(1);
}
}
};
disp.mapka.gotoAndStop(2);
this.onEnterFrame = function () {
fps.text = (((("FPS=" + Math.round(1000 / (getTimer() - t))) + "\tX=") + this._xmouse) + "\t\tY=") + this._ymouse;
t = getTimer();
var _local3 = 0;
while (_local3 < cars.length) {
disp.mapka[cars[_local3].map_dot]._x = ((-(bg._x - cars[_local3]._x)) / 31) + 2;
disp.mapka[cars[_local3].map_dot]._y = ((-(bg._y - cars[_local3]._y)) / 30) + 2;
_local3++;
}
if (!paused) {
old_bg_con_x = bg_con._x;
old_bg_con_y = bg_con._y;
if (!car.finished) {
level_timer = level_timer + 33.3333333333333;
}
stopa_frame++;
moveBg();
carsHitTest();
checkBonuses();
hits.checkPoints(car);
if (first_run) {
car.oil_count = _root.oil_count;
car.rocket_count = _root.rocket_count;
car.turbo_count = _root.turbo_count;
first_run = false;
_local3 = 0;
while (_local3 < cars.length) {
cars[_local3].setPath(hits.AI_path, hits);
cars[_local3].setCars(cars);
_local3++;
}
}
}
};
moveBg();
Symbol 840 MovieClip Frame 3
function saveResults() {
exitLevel();
gotoAndStop ("save_results");
}
stop();
game_sound.stop("zahrada");
game_sound.attachSound("hudba_stul");
game_sound.start(0, 9999);
this.paused = true;
picked_powerups = 0;
var pos = 1;
this.level = 3;
var stopa_frame = 0;
var start = true;
disp = _parent.disp;
level_timer = 0;
var check_inside = true;
this.car_position = 1;
this.bg = this.bg_lev1;
this.bg2 = this.bg2_lev1;
this.hits = this.hits_lev1;
this.cars = [car, car1, car2, car3, car4, car5];
this.rockets = new Array();
var i = 0;
while (i < cars.length) {
cars[i].gr.gotoAndStop(car_types[i]);
i++;
}
_parent.starter.gotoAndPlay(1);
var enemyCars = [car1, car2, car3, car4, car5];
hits.setMask(mask);
first_run = true;
var bitmap = (new flash.display.BitmapData(2200, 2200, true, 0));
bg_con = this.createEmptyMovieClip("bg_con", 1);
bg_con.attachBitmap(bitmap, 2);
this.hits.swapDepths(2);
this.cur_con = null;
var i = 0;
while (i < cars.length) {
cars[i].swapDepths(90 + i);
i++;
}
Key.addListener(this);
disp.mapka.gotoAndStop(3);
onKeyDown = function () {
if (!paused) {
checkKeys();
}
if (Key.getCode() == 80) {
paused = !paused;
if (paused) {
disp.pause.gotoAndStop(2);
} else {
disp.pause.gotoAndStop(1);
}
}
};
this.onEnterFrame = function () {
fps.text = (((("FPS=" + Math.round(1000 / (getTimer() - t))) + "\tX=") + this._xmouse) + "\t\tY=") + this._ymouse;
t = getTimer();
var _local3 = 0;
while (_local3 < cars.length) {
disp.mapka[cars[_local3].map_dot]._x = (-(bg._x - cars[_local3]._x)) / 20;
disp.mapka[cars[_local3].map_dot]._y = ((-(bg._y - cars[_local3]._y)) / 20) - 7;
_local3++;
}
if (!paused) {
if (!car.finished) {
level_timer = level_timer + 33.3333333333333;
}
old_bg_con_x = bg_con._x;
old_bg_con_y = bg_con._y;
stopa_frame++;
moveBg();
carsHitTest();
checkCarsInside();
checkBonuses();
hits.checkPoints(car);
if (first_run) {
car.oil_count = _root.oil_count;
car.rocket_count = _root.rocket_count;
car.turbo_count = _root.turbo_count;
first_run = false;
_local3 = 0;
while (_local3 < cars.length) {
cars[_local3].setPath(hits.AI_path, hits);
cars[_local3].setCars(cars);
_local3++;
}
}
}
};
moveBg();
Symbol 840 MovieClip Frame 4
game_sound.stop("hudba_stul");
game_sound.attachSound("detsky_pokoj");
game_sound.start(0, 9999);
this.car_types = _parent.car_types;
oil_time = 0;
fire_time = 0;
this.difficulty = _parent.difficulty;
stop();
this.laps_count = 2;
picked_powerups = 0;
this.bg = this.bg_lev4;
this.bg2 = null;
this.hits = this.hits_lev4;
var pos = 1;
disp = _parent.disp;
this.car_position = 1;
this.level = 4;
this.paused = true;
var stopa_frame = 0;
var start = true;
_parent.starter.gotoAndPlay(1);
this.cars = [car, car1, car2, car3, car4, car5];
this.rockets = new Array();
level_timer = 0;
var i = 0;
while (i < cars.length) {
cars[i].gr.gotoAndStop(car_types[i]);
i++;
}
var enemyCars = [car, car1, car2, car3, car4, car5];
hits.setMask(mask);
first_run = true;
var bitmap = (new flash.display.BitmapData(2800, 2800, true, 0));
bg_con = this.createEmptyMovieClip("bg_con", 1);
bg_con.attachBitmap(bitmap, 2);
this.hits.swapDepths(2);
this.cur_con = null;
var i = 0;
while (i < cars.length) {
cars[i].swapDepths(90 + i);
i++;
}
Key.addListener(this);
onKeyDown = function () {
if (!paused) {
checkKeys();
}
if (Key.getCode() == 80) {
paused = !paused;
if (paused) {
disp.pause.gotoAndStop(2);
} else {
disp.pause.gotoAndStop(1);
}
}
};
disp.mapka.gotoAndStop(4);
this.onEnterFrame = function () {
fps.text = (((("FPS=" + Math.round(1000 / (getTimer() - t))) + "\tX=") + this._xmouse) + "\t\tY=") + this._ymouse;
t = getTimer();
var _local3 = 0;
while (_local3 < cars.length) {
disp.mapka[cars[_local3].map_dot]._x = ((-(bg._x - cars[_local3]._x)) / 30) + 2;
disp.mapka[cars[_local3].map_dot]._y = (-(bg._y - cars[_local3]._y)) / 29;
_local3++;
}
if (!paused) {
if (!car.finished) {
level_timer = level_timer + 33.3333333333333;
}
old_bg_con_x = bg_con._x;
old_bg_con_y = bg_con._y;
stopa_frame++;
moveBg();
carsHitTest();
checkBonuses();
hits.checkPoints(car);
if (first_run) {
car.oil_count = _root.oil_count;
car.rocket_count = _root.rocket_count;
car.turbo_count = _root.turbo_count;
first_run = false;
_local3 = 0;
while (_local3 < cars.length) {
cars[_local3].setPath(hits.AI_path, hits);
cars[_local3].setCars(cars);
_local3++;
}
}
}
};
moveBg();
Symbol 840 MovieClip Frame 5
stop();
game_sound.stop("detsky_pokoj");
game_sound.attachSound("zahrada");
game_sound.start(0, 9999);
this.bg = this.bg_lev5;
this.bg2 = null;
picked_powerups = 0;
this.hits = this.hits_lev5;
var pos = 1;
this.car_position = 1;
this.paused = true;
this.level = 5;
disp = _parent.disp;
var stopa_frame = 0;
var start = true;
_parent.starter.gotoAndPlay(1);
this.cars = [car, car1, car2, car3, car4, car5];
this.rockets = new Array();
var i = 0;
while (i < cars.length) {
cars[i].gr.gotoAndStop(car_types[i]);
i++;
}
var enemyCars = [car, car1, car2, car3, car4, car5];
hits.setMask(mask);
first_run = true;
var bitmap = (new flash.display.BitmapData(2800, 2800, true, 0));
bg_con = this.createEmptyMovieClip("bg_con", 1);
bg_con.attachBitmap(bitmap, 2);
this.hits.swapDepths(2);
this.cur_con = null;
var i = 0;
while (i < cars.length) {
cars[i].swapDepths(90 + i);
i++;
}
level_timer = 0;
Key.addListener(this);
onKeyDown = function () {
if (!paused) {
checkKeys();
}
if (Key.getCode() == 80) {
paused = !paused;
if (paused) {
disp.pause.gotoAndStop(2);
} else {
disp.pause.gotoAndStop(1);
}
}
};
disp.mapka.gotoAndStop(5);
this.onEnterFrame = function () {
fps.text = (((("FPS=" + Math.round(1000 / (getTimer() - t))) + "\tX=") + this._xmouse) + "\t\tY=") + this._ymouse;
t = getTimer();
var _local3 = 0;
while (_local3 < cars.length) {
disp.mapka[cars[_local3].map_dot]._x = ((-(bg._x - cars[_local3]._x)) / 31) + 2;
disp.mapka[cars[_local3].map_dot]._y = ((-(bg._y - cars[_local3]._y)) / 30) + 2;
_local3++;
}
if (!paused) {
old_bg_con_x = bg_con._x;
old_bg_con_y = bg_con._y;
if (!car.finished) {
level_timer = level_timer + 33.3333333333333;
}
stopa_frame++;
moveBg();
carsHitTest();
checkBonuses();
hits.checkPoints(car);
if (first_run) {
car.oil_count = _root.oil_count;
car.rocket_count = _root.rocket_count;
car.turbo_count = _root.turbo_count;
first_run = false;
_local3 = 0;
while (_local3 < cars.length) {
cars[_local3].setPath(hits.AI_path, hits);
cars[_local3].setCars(cars);
_local3++;
}
}
}
};
moveBg();
Symbol 840 MovieClip Frame 6
function saveResults() {
exitLevel();
gotoAndStop ("save_results");
}
stop();
game_sound.stop();
game_sound.attachSound("hudba_stul");
game_sound.start(0, 9999);
this.paused = true;
picked_powerups = 0;
var pos = 1;
this.level = 6;
var stopa_frame = 0;
var start = true;
disp = _parent.disp;
level_timer = 0;
var check_inside = true;
this.car_position = 1;
this.bg = this.bg_lev6;
this.bg2 = this.bg2_lev6;
this.hits = this.hits_lev6;
this.cars = [car, car1, car2, car3, car4, car5];
this.rockets = new Array();
var i = 0;
while (i < cars.length) {
cars[i].gr.gotoAndStop(car_types[i]);
i++;
}
_parent.starter.gotoAndPlay(1);
var enemyCars = [car1, car2, car3, car4, car5];
hits.setMask(mask);
first_run = true;
var bitmap = (new flash.display.BitmapData(2200, 2200, true, 0));
bg_con = this.createEmptyMovieClip("bg_con", 1);
bg_con.attachBitmap(bitmap, 2);
this.hits.swapDepths(2);
this.cur_con = null;
var i = 0;
while (i < cars.length) {
cars[i].swapDepths(90 + i);
i++;
}
Key.addListener(this);
disp.mapka.gotoAndStop(6);
onKeyDown = function () {
if (!paused) {
checkKeys();
}
if (Key.getCode() == 80) {
paused = !paused;
if (paused) {
disp.pause.gotoAndStop(2);
} else {
disp.pause.gotoAndStop(1);
}
}
};
this.onEnterFrame = function () {
fps.text = (((("FPS=" + Math.round(1000 / (getTimer() - t))) + "\tX=") + this._xmouse) + "\t\tY=") + this._ymouse;
t = getTimer();
var _local3 = 0;
while (_local3 < cars.length) {
disp.mapka[cars[_local3].map_dot]._x = (-(bg._x - cars[_local3]._x)) / 20;
disp.mapka[cars[_local3].map_dot]._y = ((-(bg._y - cars[_local3]._y)) / 20) - 7;
_local3++;
}
if (!paused) {
if (!car.finished) {
level_timer = level_timer + 33.3333333333333;
}
old_bg_con_x = bg_con._x;
old_bg_con_y = bg_con._y;
stopa_frame++;
moveBg();
carsHitTest();
checkCarsInside();
checkBonuses();
hits.checkPoints(car);
if (first_run) {
car.oil_count = _root.oil_count;
car.rocket_count = _root.rocket_count;
car.turbo_count = _root.turbo_count;
first_run = false;
_local3 = 0;
while (_local3 < cars.length) {
cars[_local3].setPath(hits.AI_path, hits);
cars[_local3].setCars(cars);
_local3++;
}
}
}
};
moveBg();
Symbol 840 MovieClip Frame 7
var sss = new Sound();
sss.stop();
gotoAndStop("play" + this.level);
Symbol 847 MovieClip Frame 61
_parent.game.go();
if (_root.sounds_enabled) {
var s = new Sound();
s.attachSound("start_zavodu");
s.start(0, 1);
}
Symbol 847 MovieClip Frame 90
stop();
Symbol 861 MovieClip Frame 1
stop();
Symbol 887 MovieClip Frame 1
stop();
Symbol 893 MovieClip Frame 1
onEnterFrame = function () {
if (this._parent._parent.game.car.oil_count < 1) {
this._alpha = 50;
} else {
this._alpha = 100;
}
};
Symbol 895 MovieClip Frame 1
onEnterFrame = function () {
if (this._parent._parent.game.car.rocket_count < 1) {
this._alpha = 50;
} else {
this._alpha = 100;
}
};
Symbol 897 MovieClip Frame 1
onEnterFrame = function () {
if (this._parent._parent.game.car.turbo_count < 1) {
this._alpha = 50;
} else {
this._alpha = 100;
}
};
Symbol 912 MovieClip Frame 1
stop();
Symbol 913 MovieClip Frame 1
onEnterFrame = function () {
var _local2 = _parent.game.hits.laps + 1;
if (_local2 > _parent.game.laps_count) {
_local2 = _parent.game.laps_count;
}
sec = Math.round(_parent.game.level_timer / 1000);
min = Math.floor(sec / 60);
sec2 = sec - (min * 60);
laps.text = ((("Lap " + _local2) + " of ") + _parent.game.laps_count) + newline;
time.text = (("Time: " + min) + ":") + ((sec2 < 10) ? ("0" + sec2) : (sec2));
};
stop();
back.onRelease = function () {
var _local2 = new Sound();
_local2.stop();
_root.gotoAndStop("menu");
};
restart.onRelease = function () {
_parent.game.resetLevel();
};
return_to_race.onRelease = function () {
_parent.game.returnToRace();
};
funny.onRelease = function () {
getURL ("http://www.funny-games.biz/main.html", "_blank");
};
Symbol 913 MovieClip Frame 2
back.onRelease = function () {
var _local2 = new Sound();
_local2.stop();
_root.gotoAndStop("menu");
};
restart.onRelease = function () {
_parent.game.resetLevel();
};
return_to_race.onRelease = function () {
_parent.game.returnToRace();
};
funny.onRelease = function () {
getURL ("http://www.funny-games.biz/main.html", "_blank");
};
Symbol 920 MovieClip Frame 61
_parent.game.go();
if (_root.sounds_enabled) {
var s = new Sound();
s.attachSound("start_zavodu");
s.start(0, 1);
}
Symbol 920 MovieClip Frame 90
stop();
Symbol 930 MovieClip Frame 1
function stopaGum(body, body2, alpha, color, thickness) {
if ((this.cur_con == null) || (this.cur_con.count > 200)) {
if (cur_con != null) {
cur_con.cacheAsBitmap = true;
}
trace("next_ con");
this.cur_con = bg_con.createEmptyMovieClip("con" + bg_con.getNextHighestDepth(), bg_con.getNextHighestDepth());
this.cur_con.count = 0;
}
cur_con.count++;
if (thickness == null) {
thickness = 1;
}
if (color == null) {
color = 0;
}
if (alpha == null) {
alpha = 50;
}
cur_con.lineStyle(thickness, color, alpha);
var _local8;
if (stopa_frame > 2) {
old_bg_con_x = bg_con._x;
old_bg_con_y = bg_con._y;
}
stopa_frame = 0;
var _local2 = 0;
while (_local2 < body.length) {
cur_con.moveTo(body[_local2][0] - this.bg_con._x, body[_local2][1] - this.bg_con._y);
cur_con.lineTo(body2[_local2][0] - old_bg_con_x, body2[_local2][1] - old_bg_con_y);
_local2++;
}
old_bg_con_x = bg_con._x;
old_bg_con_y = bg_con._y;
}
function checkHit(points) {
var _local4 = new Array();
var _local2 = 0;
while (_local2 < points.length) {
_local4[_local2] = this.hits.checkHit(points[_local2]);
_local2++;
}
return(_local4);
}
function checkSlide(points) {
var _local2 = 0;
while (_local2 < points.length) {
if (this.bg.checkSlides(points[_local2])) {
return(true);
}
_local2++;
}
return(false);
}
function checkJump(points) {
var _local2 = 0;
while (_local2 < points.length) {
if (this.bg.checkJumps(points[_local2])) {
return(true);
}
_local2++;
}
return(false);
}
function swapCarDown(car) {
hits.swapDepths(10);
bg_con.swapDepths(9);
bg.swapDepths(8);
}
var pos = 1;
var stopa_frame = 0;
var start = true;
bg2.setMask(mask);
bg.setMask(mask);
hits.setMask(mask);
this.onEnterFrame = function () {
fps.text = Math.round(1000 / (getTimer() - t));
t = getTimer();
mask._x = car._x;
mask._y = car._y;
mask._rotation = car._rotation;
stopa_frame++;
if (car._x > 600) {
bg._x = bg._x - (car._x - 600);
car._x = 600;
} else if (car._x < 300) {
bg._x = bg._x + (300 - car._x);
car._x = 300;
}
if (car._y < 300) {
bg._y = bg._y + (300 - car._y);
car._y = 300;
} else if (car._y > 300) {
bg._y = bg._y - (car._y - 300);
car._y = 300;
}
bg2._x = bg._x / 4;
bg2._y = bg._y / 4;
bg_con._x = bg._x;
bg_con._y = bg._y;
hits._x = bg._x;
hits._y = bg._y;
if (!this.bg.hitTest(car._x, car._y, true)) {
car.chcipni();
}
if (start) {
var _local3 = car.checkHit();
trace(_local3);
var _local2 = 0;
while (_local2 < _local3.length) {
f = this.attachMovie("test", "test" + _local2, 10000 + _local2);
f._x = _local3[_local2][0];
f._y = _local3[_local2][1];
trace(f._y);
_local2++;
}
start = false;
}
};
bg_con = this.createEmptyMovieClip("bg_con", 1);
this.hits.swapDepths(2);
this.car.swapDepths(3);
this.cur_con = null;