Frame 1
System.useCodepage = ture;
_root.game_so = SharedObject.getLocal("FlashGamesStudio");
_root.game_so.data.playerName = "";
_root.game_so.data.useremail = "";
Instance of Symbol 23 MovieClip "Code_mc" in Frame 1
onClipEvent (enterFrame) {
TotalKB = _root.getBytesTotal() / 1000;
LoadedKB = _root.getBytesLoaded() / 1000;
_root.Size_txt.text = ((int(LoadedKB) + "KB/") + int(TotalKB)) + "KB";
LoadedPercent = int((LoadedKB / TotalKB) * 100);
_root.Percent_txt.text = LoadedPercent + "%";
_root.Bar_mc._xscale = LoadedPercent;
trace("sadadas==================1111111111");
DLRate = (_root.getBytesLoaded() / (getTimer() / 1000)) / 1000;
_root.Rate_txt.text = (int(DLRate * 100) / 100) + "KB/s";
SecondsLeft = (TotalKB - LoadedKB) / DLRate;
Minutes = Math.floor(SecondsLeft / 60);
if (Number(Minutes) < 10) {
Minutes = "0" + Minutes;
}
Seconds = int(SecondsLeft - (Minutes * 60));
if (Number(Seconds) < 10) {
Seconds = "0" + Seconds;
}
_root.TimeLeft_txt.text = (Minutes + " : ") + Seconds;
}
onClipEvent (load) {
_root.Percent_txt.text = "0%";
_root.Bar_mc._xscale = 0;
}
Frame 10
if (Number(Code_mc.LoadedPercent) == 100) {
nextFrame();
} else {
gotoAndPlay (1);
}
Frame 11
function p1_click() {
typ_hry = 1;
gotoAndPlay (12);
}
function p2_click() {
typ_hry = 2;
gotoAndPlay (12);
}
function help_click() {
napoveda.gotoAndStop(2);
}
function help_click_close() {
napoveda.gotoAndStop(1);
}
function nastaveni_click() {
nastaveni.gotoAndStop(2);
hudba_zvuky_update();
}
function nastaveni_click_close() {
nastaveni.gotoAndStop(1);
}
function hudba_click() {
ma_se_prehravat_hudba = (ma_se_prehravat_hudba ? false : true);
cislo_snimku = (ma_se_prehravat_hudba ? 1 : 2);
nastaveni.ukazatel_hudba.gotoAndStop(cislo_snimku);
}
function zvuky_click() {
maji_se_prehravat_zvuky = (maji_se_prehravat_zvuky ? false : true);
cislo_snimku = (maji_se_prehravat_zvuky ? 1 : 2);
nastaveni.ukazatel_zvuky.gotoAndStop(cislo_snimku);
}
function hudba_zvuky_update() {
cislo_snimku = (ma_se_prehravat_hudba ? 1 : 2);
nastaveni.ukazatel_hudba.gotoAndStop(cislo_snimku);
cislo_snimku = (maji_se_prehravat_zvuky ? 1 : 2);
nastaveni.ukazatel_zvuky.gotoAndStop(cislo_snimku);
cislo_snimku = ((_quality == "LOW") ? 1 : 2);
nastaveni.ukazatel_1.gotoAndStop(cislo_snimku);
cislo_snimku = ((_quality == "MEDIUM") ? 1 : 2);
nastaveni.ukazatel_2.gotoAndStop(cislo_snimku);
cislo_snimku = ((_quality == "HIGH") ? 1 : 2);
nastaveni.ukazatel_3.gotoAndStop(cislo_snimku);
}
function nastavit_kvalitu(cislo) {
var _local1 = cislo;
if (_local1 == 1) {
_quality = "LOW";
hudba_zvuky_update();
}
if (_local1 == 2) {
_quality = "MEDIUM";
hudba_zvuky_update();
}
if (_local1 == 3) {
_quality = "HIGH";
hudba_zvuky_update();
}
}
typ_hry = 0;
skok_pro_fadein_hudby = 3;
if (!prvni_start_mame_za_sebou) {
ma_se_prehravat_hudba = true;
maji_se_prehravat_zvuky = true;
} else {
cislo_snimku = (ma_se_prehravat_hudba ? 1 : 2);
nastaveni.ukazatel_hudba.gotoAndStop(cislo_snimku);
cislo_snimku = (maji_se_prehravat_zvuky ? 1 : 2);
nastaveni.ukazatel_zvuky.gotoAndStop(cislo_snimku);
}
prvni_start_mame_za_sebou = true;
hudba_na_pozadi = new Sound();
hudba_na_pozadi.attachSound("music1");
hudba_na_pozadi.setVolume(0);
if (prehrava_se_hudba) {
hudba_na_pozadi.stop();
}
prehrava_se_hudba = false;
uhel = 0;
stop();
Frame 12
function vypocitej_uhel_ze_souradnic(rozdil_x, rozdil_y) {
var _local1 = rozdil_y;
var _local2 = rozdil_x;
if (_local2 == 0) {
_local2 = 0.01;
}
if (_local1 == 0) {
_local1 = 0.01;
}
vystup = (Math.atan(_local2 / _local1) * 180) / 3.141593;
if (_local1 < 0) {
vystup = uhel(360 - vystup);
} else {
vystup = uhel(180 - vystup);
}
return(vystup);
}
function vypocitej_polomer_ze_souradnic(rozdil_x, rozdil_y) {
vystup = Math.sqrt((rozdil_x * rozdil_x) + (rozdil_y * rozdil_y));
return(vystup);
}
function vypocitej_nove_souradnice(polomer, vstupni_uhel) {
vystup = new Array();
vystup.x = vystup.x + (polomer * sintab[uhel(vstupni_uhel)]);
vystup.y = vystup.y + (polomer * (-costab[uhel(vstupni_uhel)]));
return(vystup);
}
function skryt_sipku_u_auta() {
je_zobrazena_sipka_u_auta = false;
sipka_auto.gotoAndStop(1);
}
function sound_updater() {
if ((typ_hry == 1) && (maji_se_prehravat_zvuky)) {
if (auto[0].s < -2) {
nove_cislo_zvuku = 3;
}
if ((auto[0].s < 0) && (auto[0].s >= -2)) {
nove_cislo_zvuku = 2;
}
if (auto[0].s == 0) {
nove_cislo_zvuku = 1;
}
if ((auto[0].s > 0) && (auto[0].s <= 2)) {
nove_cislo_zvuku = 2;
}
if ((auto[0].s > 2) && (auto[0].s <= 4)) {
nove_cislo_zvuku = 3;
}
if ((auto[0].s > 4) && (auto[0].s <= 6)) {
nove_cislo_zvuku = 4;
}
if (auto[0].s > 6) {
nove_cislo_zvuku = 5;
}
if (nove_cislo_zvuku != auto[0].zvuk_auta) {
if (auto[0].zvuk_auta != 0) {
if (auto[0].zvuk_auta == 1) {
auto[0].zvuk_r1.stop();
}
if (auto[0].zvuk_auta == 2) {
auto[0].zvuk_r2.stop();
}
if (auto[0].zvuk_auta == 3) {
auto[0].zvuk_r3.stop();
}
if (auto[0].zvuk_auta == 4) {
auto[0].zvuk_r4.stop();
}
if (auto[0].zvuk_auta == 5) {
auto[0].zvuk_r5.stop();
}
}
auto[0].zvuk_auta = nove_cislo_zvuku;
if (nove_cislo_zvuku == 1) {
auto[0].zvuk_r1.start(0, 9999);
}
if (nove_cislo_zvuku == 2) {
auto[0].zvuk_r2.start(0, 9999);
}
if (nove_cislo_zvuku == 3) {
auto[0].zvuk_r3.start(0, 9999);
}
if (nove_cislo_zvuku == 4) {
auto[0].zvuk_r4.start(0, 9999);
}
if (nove_cislo_zvuku == 5) {
auto[0].zvuk_r5.start(0, 9999);
}
}
if (pauza_aktivni) {
if (auto[0].zvuk_auta == 1) {
auto[0].zvuk_r1.stop();
}
if (auto[0].zvuk_auta == 2) {
auto[0].zvuk_r2.stop();
}
if (auto[0].zvuk_auta == 3) {
auto[0].zvuk_r3.stop();
}
if (auto[0].zvuk_auta == 4) {
auto[0].zvuk_r4.stop();
}
if (auto[0].zvuk_auta == 5) {
auto[0].zvuk_r5.stop();
}
auto[0].zvuk_auta = 0;
}
if (auto[0].zvuk_hit_playing > 0) {
auto[0].zvuk_hit_playing--;
}
}
}
function sound_hit_start() {
if ((typ_hry == 1) && (maji_se_prehravat_zvuky)) {
if (auto[0].zvuk_hit_playing == 0) {
auto[0].zvuk_hit.start(0, 1);
auto[0].zvuk_hit_playing = 8;
}
}
}
function sound_odpocet1() {
if (maji_se_prehravat_zvuky) {
auto[0].zvuk_odpocet1.start(0, 1);
}
}
function sound_odpocet2() {
if (maji_se_prehravat_zvuky) {
auto[0].zvuk_odpocet2.start(0, 1);
}
}
function sound_smyk_start() {
if ((typ_hry == 1) && (maji_se_prehravat_zvuky)) {
if (auto[0].zvuk_smyk == 0) {
auto[0].zvuk_sm.start(0, 9999);
auto[0].zvuk_smyk = 6;
}
}
}
function sound_smyk_stop() {
if ((typ_hry == 1) && (maji_se_prehravat_zvuky)) {
if (auto[0].zvuk_smyk > 1) {
auto[0].zvuk_smyk--;
}
if (auto[0].zvuk_smyk == 1) {
auto[0].zvuk_sm.stop();
auto[0].zvuk_smyk = 0;
}
}
}
function sound_updater_stop() {
if (auto[0].zvuk_auta == 1) {
auto[0].zvuk_r1.stop();
}
if (auto[0].zvuk_auta == 2) {
auto[0].zvuk_r2.stop();
}
if (auto[0].zvuk_auta == 3) {
auto[0].zvuk_r3.stop();
}
if (auto[0].zvuk_auta == 4) {
auto[0].zvuk_r4.stop();
}
if (auto[0].zvuk_auta == 5) {
auto[0].zvuk_r5.stop();
}
if (auto[0].zvuk_smyk == 1) {
auto[0].zvuk_sm.stop();
}
}
function show_pauza() {
pauza.gotoAndStop(2);
}
function hide_pauza() {
pauza.gotoAndStop(1);
}
function ukaz_posledni_kolo(vstup) {
if ((vstup == (pocet_kol - 1)) && (!ukazuje_se_posledni_kolo)) {
lastlap.gotoAndPlay(2);
ukazuje_se_posledni_kolo = true;
}
if ((vstup == pocet_kol) && (ukazuje_se_posledni_kolo)) {
lastlap.gotoAndStop(1);
ukazuje_se_posledni_kolo = false;
}
}
function skryj_posledni_kolo() {
lastlap.gotoAndStop(1);
ukazuje_se_posledni_kolo = false;
}
function show_turbo(cislo) {
if (cislo == 0) {
turbo_hrac1.gotoAndPlay(2);
} else {
turbo_hrac2.gotoAndPlay(2);
}
auto[cislo].ukturbo = true;
}
function hide_turbo(cislo) {
if (cislo == 0) {
turbo_hrac1.gotoAndPlay(10);
} else {
turbo_hrac2.gotoAndPlay(10);
}
auto[cislo].ukturbo = false;
}
function set_kola(cislo, hodnota) {
var _local1 = hodnota;
_local1 = Math.floor(_local1) + 1;
if (_local1 > pocet_kol) {
_local1 = pocet_kol;
}
if (cislo == 0) {
kola1.cislo_kola.gotoAndStop(_local1);
} else {
kola2.cislo_kola.gotoAndStop(_local1);
}
}
function set_kola_cas(hodnota_kola, hodnota_cas) {
var _local1 = hodnota_kola;
_local1 = Math.floor(_local1) + 1;
if (_local1 > pocet_kol) {
_local1 = pocet_kol;
}
kola_cas.cislo_kola.gotoAndStop(_local1);
ukaz_minuty = Math.floor((hodnota_cas / 25) / 60);
ukaz_sekundy = Math.floor((hodnota_cas / 25) - (ukaz_minuty * 60));
hodnota_cislo1 = Math.floor(ukaz_minuty / 10);
hodnota_cislo2 = ukaz_minuty - (hodnota_cislo1 * 10);
hodnota_cislo1++;
hodnota_cislo2++;
kola_cas.cislo1.gotoAndStop(hodnota_cislo1);
kola_cas.cislo2.gotoAndStop(hodnota_cislo2);
hodnota_cislo3 = Math.floor(ukaz_sekundy / 10);
hodnota_cislo4 = ukaz_sekundy - (hodnota_cislo3 * 10);
hodnota_cislo3++;
hodnota_cislo4++;
kola_cas.cislo3.gotoAndStop(hodnota_cislo3);
kola_cas.cislo4.gotoAndStop(hodnota_cislo4);
}
function set_turbo(cislo, hodnota) {
var _local1 = hodnota;
if (cislo == 0) {
panel_speed1.ukazatel_turbo1._xscale = Math.abs(_local1);
panel_speed1.youmen.gotoAndStop(int(Math.abs(_local1) / 4));
} else {
panel_speed2.ukazatel_turbo2._xscale = Math.abs(_local1);
panel_speed2.youmen.gotoAndStop(int(Math.abs(_local1) / 4));
}
}
function set_speed(cislo, hodnota) {
var _local1 = hodnota;
if (cislo == 0) {
panel_speed1.ukazatel_rychlost1._xscale = Math.abs(_local1);
panel_speed1.sudu = int(4 * Math.abs(_local1));
panel_speed1.zheng._rotation = ((4 * Math.abs(_local1)) * 180) / 400;
} else {
panel_speed2.ukazatel_rychlost2._xscale = Math.abs(_local1);
panel_speed2.sudu = int(4 * Math.abs(_local1));
panel_speed2.zheng_rotation = ((4 * Math.abs(_local1)) * 180) / 400;
}
}
function game_init() {
if (typ_hry == 1) {
panel_speed1.gotoAndStop(2);
show_turbo(0);
kola_cas.gotoAndStop(2);
set_speed(0, 0);
} else {
panel_speed1.gotoAndStop(2);
panel_speed2.gotoAndStop(2);
kola1.gotoAndStop(2);
kola2.gotoAndStop(2);
show_turbo(0);
show_turbo(1);
set_speed(0, 0);
set_speed(1, 0);
}
}
function nastartuj() {
start_action = true;
gotoAndPlay (13);
}
function ingame_menu(vitez, vitezny_cas) {
skryj_posledni_kolo();
zaverecne_menu_aktivni = true;
sound_updater_stop();
if (typ_hry == 1) {
if (vitez == 0) {
endmenu.gotoAndStop(3);
} else {
endmenu.gotoAndStop(2);
}
} else if (vitez == 0) {
endmenu.gotoAndStop(4);
} else {
endmenu.gotoAndStop(5);
}
}
function hide_ingame_menu() {
endmenu.gotoAndStop(1);
}
function restartovat() {
hide_ingame_menu();
sound_updater_stop();
gotoAndPlay (12);
}
function zpet_do_main_menu() {
hide_ingame_menu();
sound_updater_stop();
gotoAndPlay (11);
}
function dalsi_level() {
hide_ingame_menu();
sound_updater_stop();
gotoAndStop (15);
}
function uhel(cislo) {
var _local1 = cislo;
_local1 = Math.round(_local1);
while (_local1 > 359) {
_local1 = _local1 - 360;
}
while (_local1 < 0) {
_local1 = _local1 + 360;
}
return(_local1);
}
function soucet_uhlu(uhel1, uhel2, rychlost1, rychlost2) {
var _local1 = uhel2;
var _local2 = uhel1;
var _local3 = rychlost2;
_local2 = uhel(_local2);
_local1 = uhel(_local1);
if (Math.abs(_local2 - _local1) > 180) {
if (_local1 < 180) {
_local1 = _local1 + 360;
} else {
uhel = uhel - 360;
}
}
if (_local3 > 0) {
vystup = _local2 - ((_local2 - _local1) * (1 / ((rychlost1 + _local3) / _local3)));
} else {
vystup = _local2;
}
return(vystup);
}
function vyber_nejvyssi_cislo(cislo1, cislo2, cislo3, max_cislo) {
var _local2 = cislo3;
var _local1 = cislo2;
var _local3 = cislo1;
vystup = ((_local3 > _local1) ? (_local3) : (_local1));
vystup = ((_local2 > vystup) ? (_local2) : (vystup));
if ((((_local3 == 0) || (_local1 == 0)) || (_local2 == 0)) && (((_local3 == max_cislo) || (_local1 == max_cislo)) || (_local2 == max_cislo))) {
vystup = 0;
if (_local3 < (max_cislo - 1)) {
vystup = _local3;
}
if ((_local1 < (max_cislo - 1)) && (_local1 > vystup)) {
vystup = _local1;
}
if ((_local2 < (max_cislo - 1)) && (_local2 > vystup)) {
vystup = _local2;
}
}
return(vystup);
}
function spocitej_novou_pozici(cislo) {
var _local1 = cislo;
rozdil_x = Math.abs(cputrack[auto[_local1].bod].x - auto[_local1].x);
rozdil_y = Math.abs(cputrack[auto[_local1].bod].y - auto[_local1].y);
vzdalenost_bodu = Math.sqrt((rozdil_x * rozdil_x) + (rozdil_y * rozdil_y));
if (vzdalenost_bodu < vzdalenost_pro_zmenu_bodu) {
auto[_local1].bod++;
}
if (auto[_local1].bod > max_cputrack) {
auto[_local1].bod = 0;
}
auto[_local1].newx = cputrack[auto[_local1].bod].x;
auto[_local1].newy = cputrack[auto[_local1].bod].y;
rozdil_x = auto[_local1].newx - auto[_local1].x;
rozdil_y = auto[_local1].newy - auto[_local1].y;
if (rozdil_x == 0) {
rozdil_x = 0.1;
}
if (rozdil_y == 0) {
rozdil_y = 0.1;
}
auto[_local1].newr = (Math.atan(rozdil_x / rozdil_y) * 180) / 3.141593;
if (rozdil_y < 0) {
auto[_local1].newr = uhel(360 - auto[_local1].newr);
} else {
auto[_local1].newr = uhel(180 - auto[_local1].newr);
}
rozdil_uhlu2 = Math.abs(uhel(auto[_local1].r) - auto[_local1].newr);
if (rozdil_uhlu2 > 180) {
if (uhel(auto[_local1].r) > 179) {
auto[_local1].newr = auto[_local1].newr + 360;
} else {
auto[_local1].newr = auto[_local1].newr - 360;
}
}
}
function urovne_init() {
i = 0;
while (i <= 1) {
if ((auto[i].uroven == 1) || (auto[i].uroven == 2)) {
auto[i].i = auto[i].i1;
auto[i].i.gotoAndStop(2);
auto[i].i2.gotoAndStop(1);
} else {
auto[i].i = auto[i].i2;
auto[i].i.gotoAndStop(2);
auto[i].i1.gotoAndStop(1);
}
i++;
}
}
function place_car(cislo) {
var _local1 = cislo;
if ((auto[_local1].uroven == 1) || (auto[_local1].uroven == 2)) {
if (auto[_local1].i != auto[_local1].i1) {
auto[_local1].i = auto[_local1].i1;
auto[_local1].i.gotoAndStop(2);
auto[_local1].i2.gotoAndStop(1);
}
} else if (auto[_local1].i != auto[_local1].i2) {
auto[_local1].i = auto[_local1].i2;
auto[_local1].i.gotoAndStop(2);
auto[_local1].i1.gotoAndStop(1);
}
auto[_local1].i._x = auto[_local1].x;
auto[_local1].i._y = auto[_local1].y;
auto[_local1].f = uhel(auto[_local1].r);
auto[_local1].i._rotation = auto[_local1].f;
}
function calculate_car(cislo) {
var _local1 = cislo;
auto[_local1].p = 0;
if (pisek.hitTest(auto[_local1].x, auto[_local1].y, true)) {
auto[_local1].p = 1;
}
if (led.hitTest(auto[_local1].x, auto[_local1].y, true)) {
auto[_local1].p = 2;
}
zbytek_za_carkou = auto[_local1].kolo - Math.floor(auto[_local1].kolo);
if (zbytek_za_carkou > 0) {
kolize_finish = finish.hitTest(auto[_local1].x, auto[_local1].y, true);
if (kolize_finish) {
auto[_local1].kolo = auto[_local1].kolo + 0.5;
}
} else {
kolize_halftrack = halftrack.hitTest(auto[_local1].x, auto[_local1].y, true);
if (kolize_halftrack) {
auto[_local1].kolo = auto[_local1].kolo + 0.5;
}
}
if ((auto[_local1].uroven == 1) || (auto[_local1].uroven == 3)) {
kolize_limiter = limiter1.hitTest(auto[_local1].x, auto[_local1].y, true);
if (kolize_limiter) {
auto[_local1].uroven = 2;
}
} else {
kolize_limiter = limiter2.hitTest(auto[_local1].x, auto[_local1].y, true);
if (kolize_limiter) {
auto[_local1].uroven = 3;
}
}
otaceni2_povrch = otaceni2;
if (auto[_local1].p == 1) {
otaceni2_povrch = otaceni2_pisek;
}
if (auto[_local1].p == 2) {
otaceni2_povrch = otaceni2_led;
}
maximalni_rychlost_povrch = maximalni_rychlost;
if (_root.auto[_local1].p == 1) {
maximalni_rychlost_povrch = maximalni_rychlost_pisek;
}
if (_root.auto[_local1].p == 2) {
maximalni_rychlost_povrch = maximalni_rychlost_led;
}
if (Math.abs(auto[_local1].r - auto[_local1].r2) < otaceni2_povrch) {
auto[_local1].r2 = auto[_local1].r;
}
if ((Math.abs(auto[_local1].r - auto[_local1].r2) > (otaceni2_povrch * 3)) && (auto[_local1].s > smyk_speed)) {
auto[_local1].s = auto[_local1].s - smyk;
}
if (((Math.abs(auto[_local1].r - auto[_local1].r2) > (otaceni2_povrch * 5)) && (auto[_local1].s > smyk_speed2)) && (_local1 == 0)) {
sound_smyk_start();
}
if (((Math.abs(auto[_local1].r - auto[_local1].r2) <= (otaceni2_povrch * 5)) || (auto[_local1].s <= smyk_speed2)) && (_local1 == 0)) {
sound_smyk_stop();
}
if (auto[_local1].r > auto[_local1].r2) {
auto[_local1].r2 = auto[_local1].r2 + otaceni2_povrch;
}
if (auto[_local1].r < auto[_local1].r2) {
auto[_local1].r2 = auto[_local1].r2 - otaceni2_povrch;
}
if (auto[_local1].uroven <= 2) {
kolize1 = kolize.hitTest(auto[_local1].x + auto[_local1].c[auto[_local1].f][0], auto[_local1].y + auto[_local1].c[auto[_local1].f][1], true);
kolize2 = kolize.hitTest(auto[_local1].x + auto[_local1].c[auto[_local1].f][2], auto[_local1].y + auto[_local1].c[auto[_local1].f][3], true);
kolize3 = kolize.hitTest(auto[_local1].x + auto[_local1].c[auto[_local1].f][4], auto[_local1].y + auto[_local1].c[auto[_local1].f][5], true);
kolize4 = kolize.hitTest(auto[_local1].x + auto[_local1].c[auto[_local1].f][6], auto[_local1].y + auto[_local1].c[auto[_local1].f][7], true);
} else {
kolize1 = kolizelevel2.hitTest(auto[_local1].x + auto[_local1].c[auto[_local1].f][0], auto[_local1].y + auto[_local1].c[auto[_local1].f][1], true);
kolize2 = kolizelevel2.hitTest(auto[_local1].x + auto[_local1].c[auto[_local1].f][2], auto[_local1].y + auto[_local1].c[auto[_local1].f][3], true);
kolize3 = kolizelevel2.hitTest(auto[_local1].x + auto[_local1].c[auto[_local1].f][4], auto[_local1].y + auto[_local1].c[auto[_local1].f][5], true);
kolize4 = kolizelevel2.hitTest(auto[_local1].x + auto[_local1].c[auto[_local1].f][6], auto[_local1].y + auto[_local1].c[auto[_local1].f][7], true);
}
if (((kolize1 || (kolize2)) || (kolize3)) || (kolize4)) {
rychlost_posunu = auto[_local1].s;
uhel_posunu = auto[_local1].r2;
} else {
rychlost_posunu = ((auto[_local1].s > auto[_local1].s2) ? (auto[_local1].s) : (auto[_local1].s2));
if (auto[_local1].s < 0) {
rychlost_posunu = auto[_local1].s;
}
uhel_bezneho_pohybu = uhel(auto[_local1].r2);
uhel_narazu = uhel(auto[_local1].r3);
rozdil_uhlu = Math.abs(uhel_bezneho_pohybu - uhel_narazu);
if (rozdil_uhlu > 180) {
if (uhel_bezneho_pohybu > 179) {
uhel_narazu = uhel_narazu + 360;
} else {
uhel_narazu = uhel_narazu - 360;
}
}
if (auto[_local1].s2 > 0) {
uhel_posunu = uhel_bezneho_pohybu - ((uhel_bezneho_pohybu - uhel_narazu) * (1 / ((auto[_local1].s + auto[_local1].s2) / auto[_local1].s2)));
} else {
uhel_posunu = auto[_local1].r2;
}
}
auto[_local1].x = auto[_local1].x + (rychlost_posunu * sintab[uhel(uhel_posunu)]);
auto[_local1].y = auto[_local1].y + (rychlost_posunu * (-costab[uhel(uhel_posunu)]));
if (auto[_local1].s2 > 0) {
auto[_local1].s2 = auto[_local1].s2 - zpomaleni_rychlosti_odrazu;
}
if (auto[_local1].s2 < 0) {
auto[_local1].s2 = 0;
}
if ((_local1 == 0) && (auto[0].uroven == auto[1].uroven)) {
kolize1a = auto[1].i.hitTest(auto[_local1].x + auto[_local1].c[auto[_local1].f][0], auto[_local1].y + auto[_local1].c[auto[_local1].f][1], true);
kolize2a = auto[1].i.hitTest(auto[_local1].x + auto[_local1].c[auto[_local1].f][2], auto[_local1].y + auto[_local1].c[auto[_local1].f][3], true);
kolize3a = auto[1].i.hitTest(auto[_local1].x + auto[_local1].c[auto[_local1].f][4], auto[_local1].y + auto[_local1].c[auto[_local1].f][5], true);
kolize4a = auto[1].i.hitTest(auto[_local1].x + auto[_local1].c[auto[_local1].f][6], auto[_local1].y + auto[_local1].c[auto[_local1].f][7], true);
kolize1 = kolize1 || (kolize1a);
kolize2 = kolize2 || (kolize2a);
kolize3 = kolize3 || (kolize3a);
kolize4 = kolize4 || (kolize4a);
}
if ((_local1 == 1) && (auto[0].uroven == auto[1].uroven)) {
kolize1a = auto[0].i.hitTest(auto[_local1].x + auto[_local1].c[auto[_local1].f][0], auto[_local1].y + auto[_local1].c[auto[_local1].f][1], true);
kolize2a = auto[0].i.hitTest(auto[_local1].x + auto[_local1].c[auto[_local1].f][2], auto[_local1].y + auto[_local1].c[auto[_local1].f][3], true);
kolize3a = auto[0].i.hitTest(auto[_local1].x + auto[_local1].c[auto[_local1].f][4], auto[_local1].y + auto[_local1].c[auto[_local1].f][5], true);
kolize4a = auto[0].i.hitTest(auto[_local1].x + auto[_local1].c[auto[_local1].f][6], auto[_local1].y + auto[_local1].c[auto[_local1].f][7], true);
kolize1 = kolize1 || (kolize1a);
kolize2 = kolize2 || (kolize2a);
kolize3 = kolize3 || (kolize3a);
kolize4 = kolize4 || (kolize4a);
}
rychlost_predana_autem = Math.abs(auto[_local1].s * zmenseni_rychlosti_predane);
cislo_posouvaneho_auta = ((_local1 == 0) ? 1 : 0);
if ((auto[_local1].s > 0) && (kolize1a || (kolize2a))) {
auto[cislo_posouvaneho_auta].s2 = rychlost_predana_autem;
auto[cislo_posouvaneho_auta].r3 = auto[_local1].r2;
}
if ((auto[_local1].s < 0) && (kolize3a || (kolize4a))) {
auto[cislo_posouvaneho_auta].s2 = rychlost_predana_autem;
auto[cislo_posouvaneho_auta].r3 = auto[_local1].r2 - 180;
}
koeficient_rychlosti = Math.abs(rychlost_posunu) / maximalni_rychlost_povrch;
rychlost_odrazeni = koeficient_rychlosti * vzdalenost_kolize;
if (rychlost_odrazeni < min_vzdalenost_kolize) {
rychlost_odrazeni = min_vzdalenost_kolize;
}
if (auto[_local1].s >= 0) {
if (((kolize1 && (kolize2)) && (!kolize3)) && (!kolize4)) {
auto[_local1].s = (auto[_local1].s * -1) * odraz_pri_celnim_narazu;
auto[_local1].x = auto[_local1].x + (rychlost_odrazeni * sintab[uhel(auto[_local1].r2 + 180)]);
auto[_local1].y = auto[_local1].y + (rychlost_odrazeni * (-costab[uhel(auto[_local1].r2 + 180)]));
}
if (((kolize1 && (!kolize2)) && (!kolize3)) && (!kolize4)) {
auto[_local1].r = auto[_local1].r + (uhel_kolize * koeficient_rychlosti);
auto[_local1].s = auto[_local1].s * rychlost_kolize;
auto[_local1].x = auto[_local1].x + (rychlost_odrazeni * sintab[uhel(auto[_local1].r2 + 90)]);
auto[_local1].y = auto[_local1].y + (rychlost_odrazeni * (-costab[uhel(auto[_local1].r2 + 90)]));
}
if ((((!kolize1) && (kolize2)) && (!kolize3)) && (!kolize4)) {
auto[_local1].r = auto[_local1].r - (uhel_kolize * koeficient_rychlosti);
auto[_local1].s = auto[_local1].s * rychlost_kolize;
auto[_local1].x = auto[_local1].x + (rychlost_odrazeni * sintab[uhel(auto[_local1].r2 - 90)]);
auto[_local1].y = auto[_local1].y + (rychlost_odrazeni * (-costab[uhel(auto[_local1].r2 - 90)]));
}
if ((((!kolize1) && (!kolize2)) && (kolize3)) && (!kolize4)) {
}
if ((((!kolize1) && (!kolize2)) && (!kolize3)) && (kolize4)) {
}
if ((((!kolize1) && (kolize2)) && (!kolize3)) && (kolize4)) {
auto[_local1].x = auto[_local1].x + (rychlost_odrazeni * sintab[uhel(auto[_local1].r2 - 90)]);
auto[_local1].y = auto[_local1].y + (rychlost_odrazeni * (-costab[uhel(auto[_local1].r2 - 90)]));
}
if (((kolize1 && (!kolize2)) && (kolize3)) && (!kolize4)) {
auto[_local1].x = auto[_local1].x + (rychlost_odrazeni * sintab[uhel(auto[_local1].r2 + 90)]);
auto[_local1].y = auto[_local1].y + (rychlost_odrazeni * (-costab[uhel(auto[_local1].r2 + 90)]));
}
}
if (auto[_local1].s < 0) {
if ((((!kolize1) && (!kolize2)) && (kolize3)) && (kolize4)) {
auto[_local1].s = (auto[_local1].s * -1) / 1.5;
auto[_local1].x = auto[_local1].x + (rychlost_odrazeni * sintab[uhel(auto[_local1].r2)]);
auto[_local1].y = auto[_local1].y + (rychlost_odrazeni * (-costab[uhel(auto[_local1].r2)]));
}
if ((((!kolize1) && (!kolize2)) && (kolize3)) && (!kolize4)) {
auto[_local1].r = auto[_local1].r + (uhel_kolize * (-koeficient_rychlosti));
auto[_local1].s = auto[_local1].s * rychlost_kolize;
auto[_local1].x = auto[_local1].x + (rychlost_odrazeni * sintab[uhel(auto[_local1].r2 + 90)]);
auto[_local1].y = auto[_local1].y + (rychlost_odrazeni * (-costab[uhel(auto[_local1].r2 + 90)]));
}
if ((((!kolize1) && (!kolize2)) && (!kolize3)) && (kolize4)) {
auto[_local1].r = auto[_local1].r + (uhel_kolize * (-koeficient_rychlosti));
auto[_local1].s = auto[_local1].s * rychlost_kolize;
auto[_local1].x = auto[_local1].x + (rychlost_odrazeni * sintab[uhel(auto[_local1].r2 - 90)]);
auto[_local1].y = auto[_local1].y + (rychlost_odrazeni * (-costab[uhel(auto[_local1].r2 - 90)]));
}
}
if (((kolize1 || (kolize2)) || (kolize3)) || (kolize4)) {
auto[_local1].r2 = auto[_local1].r;
}
if ((((kolize1 || (kolize2)) || (kolize3)) || (kolize4)) && (_local1 == 0)) {
sound_hit_start();
}
}
sintab = new Array();
costab = new Array();
i = 0;
while (i < 360) {
cossin_rad = (i * 3.141593) / 180;
sintab[i] = Math.sin(cossin_rad);
costab[i] = Math.cos(cossin_rad);
i++;
}
fscommand ("trapallkeys", "true");
auto = new Array();
auto[0] = new Array();
auto[0].x = 235;
auto[0].y = 212;
auto[0].r = 8;
auto[0].r2 = 8;
auto[0].r3 = 8;
auto[0].s = 0;
auto[0].s2 = 0;
auto[0].i = auto1;
auto[0].i1 = auto1;
auto[0].i2 = auto1l2;
auto[0].f = 0;
auto[0].p = 0;
auto[0].cpu = false;
auto[0].newx = 0;
auto[0].newy = 0;
auto[0].newr = 0;
auto[0].turbo = 100;
auto[0].ta = false;
auto[0].bod = 0;
auto[0].timer = 0;
auto[0].kolo = 0;
auto[0].ukturbo = true;
auto[0].uroven = 2;
auto[0].vlevo = 37;
auto[0].vpravo = 39;
auto[0].plyn = 38;
auto[0].brzda = 40;
auto[0].nitro = 16;
engine_volume = 70;
odpocet_volume = 100;
auto[0].zvuk_r1 = new Sound(auto[0].i);
auto[0].zvuk_r1.attachSound("zvuk_r1");
auto[0].zvuk_r1.setVolume(engine_volume);
auto[0].zvuk_r2 = new Sound(auto[0].i);
auto[0].zvuk_r2.attachSound("zvuk_r2");
auto[0].zvuk_r2.setVolume(engine_volume);
auto[0].zvuk_r3 = new Sound(auto[0].i);
auto[0].zvuk_r3.attachSound("zvuk_r3");
auto[0].zvuk_r3.setVolume(engine_volume);
auto[0].zvuk_r4 = new Sound(auto[0].i);
auto[0].zvuk_r4.attachSound("zvuk_r4");
auto[0].zvuk_r4.setVolume(engine_volume);
auto[0].zvuk_r5 = new Sound(auto[0].i);
auto[0].zvuk_r5.attachSound("zvuk_r5");
auto[0].zvuk_r5.setVolume(engine_volume);
auto[0].zvuk_auta = 0;
auto[0].zvuk_sm = new Sound(kolize);
auto[0].zvuk_sm.attachSound("zvuk_smyku");
auto[0].zvuk_sm.setVolume(engine_volume);
auto[0].zvuk_smyk = 0;
auto[0].zvuk_hit = new Sound(pisek);
auto[0].zvuk_hit.attachSound("zvuk_hit");
auto[0].zvuk_hit.setVolume(engine_volume);
auto[0].zvuk_hit_playing = 0;
auto[0].zvuk_odpocet1 = new Sound(odpocet);
auto[0].zvuk_odpocet1.attachSound("zvuk_odpocet1");
auto[0].zvuk_odpocet1.setVolume(odpocet_volume);
auto[0].zvuk_odpocet2 = new Sound(odpocet);
auto[0].zvuk_odpocet2.attachSound("zvuk_odpocet2");
auto[0].zvuk_odpocet2.setVolume(odpocet_volume);
auto[0].c = new Array();
auto[0].c[0] = new Array(-4.8, -7.8, 4.6, -7.8, -4.9, 9.1, 4.6, 9.2);
auto[1] = new Array();
auto[1].x = 215;
auto[1].y = 218;
auto[1].r = 7;
auto[1].r2 = 7;
auto[1].r3 = 7;
auto[1].s = 0;
auto[1].s2 = 0;
auto[1].i = auto2;
auto[1].i1 = auto2;
auto[1].i2 = auto2l2;
auto[1].f = 0;
auto[1].p = 0;
auto[1].cpu = false;
auto[1].newx = 0;
auto[1].newy = 0;
auto[1].newr = 0;
auto[1].turbo = 100;
auto[1].ta = false;
auto[1].bod = 0;
auto[1].timer = 0;
auto[1].kolo = 0;
auto[1].ukturbo = true;
auto[1].uroven = 2;
auto[1].vlevo = 65;
auto[1].vpravo = 68;
auto[1].plyn = 87;
auto[1].brzda = 83;
auto[1].nitro = 192;
uhel_bodu1 = vypocitej_uhel_ze_souradnic(auto[0].c[0][0], auto[0].c[0][1]);
uhel_bodu2 = vypocitej_uhel_ze_souradnic(auto[0].c[0][2], auto[0].c[0][3]);
uhel_bodu3 = vypocitej_uhel_ze_souradnic(auto[0].c[0][4], auto[0].c[0][5]);
uhel_bodu4 = vypocitej_uhel_ze_souradnic(auto[0].c[0][6], auto[0].c[0][7]);
polomer_bodu1 = vypocitej_polomer_ze_souradnic(auto[0].c[0][0], auto[0].c[0][1]);
polomer_bodu2 = vypocitej_polomer_ze_souradnic(auto[0].c[0][2], auto[0].c[0][3]);
polomer_bodu3 = vypocitej_polomer_ze_souradnic(auto[0].c[0][4], auto[0].c[0][5]);
polomer_bodu4 = vypocitej_polomer_ze_souradnic(auto[0].c[0][6], auto[0].c[0][7]);
i = 1;
while (i <= 359) {
auto[0].c[i] = new Array();
nove_souradnice1 = vypocitej_nove_souradnice(polomer_bodu1, uhel_bodu1 + i);
nove_souradnice2 = vypocitej_nove_souradnice(polomer_bodu2, uhel_bodu2 + i);
nove_souradnice3 = vypocitej_nove_souradnice(polomer_bodu3, uhel_bodu3 + i);
nove_souradnice4 = vypocitej_nove_souradnice(polomer_bodu4, uhel_bodu4 + i);
auto[0].c[i][0] = nove_souradnice1.x;
auto[0].c[i][1] = nove_souradnice1.y;
auto[0].c[i][2] = nove_souradnice2.x;
auto[0].c[i][3] = nove_souradnice2.y;
auto[0].c[i][4] = nove_souradnice3.x;
auto[0].c[i][5] = nove_souradnice3.y;
auto[0].c[i][6] = nove_souradnice4.x;
auto[0].c[i][7] = nove_souradnice4.y;
i++;
}
auto[1].c = auto[0].c;
pocet_auticek = 2;
start_action = false;
pauza_aktivni = 0;
zaverecne_menu_aktivni = false;
ukazuje_se_posledni_kolo = false;
if (typ_hry == 1) {
je_zobrazena_sipka_u_auta = true;
sipka_auto.gotoAndPlay(2);
}
if (!akcelerace) {
akcelerace = 0.1;
}
if (!akcelerace_pisek) {
akcelerace_pisek = 0.09;
}
if (!akcelerace_led) {
akcelerace_led = 0.07;
}
if (!zpomaleni) {
zpomaleni = 0.1;
}
if (!zpomaleni_pisek) {
zpomaleni_pisek = 0.1;
}
if (!zpomaleni_led) {
zpomaleni_led = 0.08;
}
if (!smyk) {
smyk = 0.13;
}
if (!smyk_speed) {
smyk_speed = 2.5;
}
if (!smyk_speed2) {
smyk_speed2 = 1;
}
if (!brzda) {
brzda = 0.3;
}
if (!brzda_pisek) {
brzda_pisek = 0.13;
}
if (!brzda_led) {
brzda_led = 0.13;
}
if (!otaceni) {
otaceni = 5;
}
if (!otaceni2) {
otaceni2 = 4;
}
if (!otaceni2_pisek) {
otaceni2_pisek = 2.9;
}
if (!otaceni2_led) {
otaceni2_led = 2.4;
}
if (!maximalni_rychlost) {
maximalni_rychlost = 5.5;
}
if (!maximalni_rychlost_pisek) {
maximalni_rychlost_pisek = 5.5;
}
if (!maximalni_rychlost_led) {
maximalni_rychlost_led = 5.5;
}
if (!minimalni_rychlost) {
minimalni_rychlost = -3;
}
if (!minimalni_rychlost_pisek) {
minimalni_rychlost_pisek = -2.6;
}
if (!minimalni_rychlost_led) {
minimalni_rychlost_led = -3;
}
if (!uhel_kolize) {
uhel_kolize = 11;
}
if (!vzdalenost_kolize) {
vzdalenost_kolize = 2.2;
}
if (!min_vzdalenost_kolize) {
min_vzdalenost_kolize = 0.2;
}
if (!rychlost_kolize) {
rychlost_kolize = 0.6;
}
zmenseni_rychlosti_predane = 0.6;
zpomaleni_rychlosti_odrazu = 0.4;
odraz_pri_celnim_narazu = 0.2;
cpu_max_rozdil_uhlu = 25;
cpu_max_rychlost_pri_smyku = 3;
rychlost_turba = 3;
akcelerace_turba = 0.18;
maximalni_turbo = 100;
turbo_filling = 0.4;
turbo_using = 3;
vzdalenost_pro_zmenu_bodu = 32;
snizeni_max_rychlosti_cpu = -0.4;
pocet_kol = 8;
klavesa_zpet_do_menu = 27;
klavesa_pause = 80;
if (typ_hry == 1) {
auto[1].cpu = true;
}
cputrack = new Array();
max_cputrack = 40;
i = 0;
while (i <= max_cputrack) {
xova = Math.round(eval (("cpubod" + i) + "._x"));
yova = Math.round(eval (("cpubod" + i) + "._y"));
cputrack[i] = new Array();
cputrack[i].x = xova;
cputrack[i].y = yova;
i++;
}
game_init();
i = 0;
while (i < pocet_auticek) {
place_car(i);
i++;
}
stop();
deng.gotoAndStop(1);
Instance of Symbol 167 MovieClip "auto1" in Frame 12
onClipEvent (enterFrame) {
if (Key.isDown(_root.klavesa_zpet_do_menu)) {
_root.zpet_do_main_menu();
}
if (_root.ma_se_prehravat_hudba && (!_root.prehrava_se_hudba)) {
_root.hudba_na_pozadi.start(0, 9999);
_root.prehrava_se_hudba = true;
}
if (_root.ma_se_prehravat_hudba || (_root.maji_se_prehravat_zvuky)) {
if (_root.hudba_na_pozadi.getVolume() < 100) {
if (_root.hudba_na_pozadi.getVolume() < (100 - _root.skok_pro_fadein_hudby)) {
_root.hudba_na_pozadi.setVolume(_root.hudba_na_pozadi.getVolume() + _root.skok_pro_fadein_hudby);
} else {
_root.hudba_na_pozadi.setVolume(100);
}
}
}
if (_root.je_zobrazena_sipka_u_auta && (_root.auto[0].s != 0)) {
_root.skryt_sipku_u_auta();
}
if (!_root.zaverecne_menu_aktivni) {
if (Key.isDown(_root.klavesa_pause)) {
if (_root.pauza_aktivni == 0) {
_root.pauza_aktivni = 1;
_root.show_pauza();
}
if (_root.pauza_aktivni == 2) {
_root.pauza_aktivni = 3;
}
} else {
if (_root.pauza_aktivni == 1) {
_root.pauza_aktivni = 2;
}
if (_root.pauza_aktivni == 3) {
_root.pauza_aktivni = 0;
_root.hide_pauza();
}
}
_root.sound_updater();
}
if (_root.start_action && (_root.pauza_aktivni == 0)) {
if (_root.auto[0].turbo < 0) {
_root.auto[0].turbo = 0;
}
if (_root.auto[1].turbo < 0) {
_root.auto[1].turbo = 0;
}
if (_root.auto[0].turbo >= _root.maximalni_turbo) {
_root.auto[0].turbo = _root.maximalni_turbo;
if (_root.auto[0].ukturbo == false) {
_root.show_turbo(0);
}
} else if (_root.auto[0].ukturbo == true) {
_root.hide_turbo(0);
}
_root.set_turbo(0, _root.auto[0].turbo);
_root.set_speed(0, (_root.auto[0].s / (_root.maximalni_rychlost + _root.rychlost_turba)) * 100);
if (_root.typ_hry == 1) {
_root.set_kola_cas(_root.auto[0].kolo, _root.auto[0].timer);
_root.ukaz_posledni_kolo(_root.auto[0].kolo);
} else {
if (_root.auto[1].turbo >= _root.maximalni_turbo) {
_root.auto[1].turbo = _root.maximalni_turbo;
if (_root.auto[1].ukturbo == false) {
_root.show_turbo(1);
}
} else if (_root.auto[1].ukturbo == true) {
_root.hide_turbo(1);
}
_root.set_turbo(1, _root.auto[1].turbo);
_root.set_speed(1, (_root.auto[1].s / (_root.maximalni_rychlost + _root.rychlost_turba)) * 100);
_root.set_kola(0, _root.auto[0].kolo);
_root.set_kola(1, _root.auto[1].kolo);
}
i = 0;
while (i < _root.pocet_auticek) {
if (_root.auto[i].kolo == _root.pocet_kol) {
_root.start_action = false;
_root.ingame_menu(i, _root.auto[i].timer);
}
_root.auto[i].timer++;
akcelerace_povrch = _root.akcelerace;
if (_root.auto[i].p == 1) {
akcelerace_povrch = _root.akcelerace_pisek;
}
if (_root.auto[i].p == 2) {
akcelerace_povrch = _root.akcelerace_led;
}
zpomaleni_povrch = _root.zpomaleni;
if (_root.auto[i].p == 1) {
zpomaleni_povrch = _root.zpomaleni_pisek;
}
if (_root.auto[i].p == 2) {
zpomaleni_povrch = _root.zpomaleni_led;
}
brzda_povrch = _root.brzda;
if (_root.auto[i].p == 1) {
brzda_povrch = _root.brzda_pisek;
}
if (_root.auto[i].p == 2) {
brzda_povrch = _root.brzda_led;
}
maximalni_rychlost_povrch = _root.maximalni_rychlost;
if (_root.auto[i].p == 1) {
maximalni_rychlost_povrch = _root.maximalni_rychlost_pisek;
}
if (_root.auto[i].p == 2) {
maximalni_rychlost_povrch = _root.maximalni_rychlost_led;
}
minimalni_rychlost_povrch = _root.minimalni_rychlost;
if (_root.auto[i].p == 1) {
minimalni_rychlost_povrch = _root.minimalni_rychlost_pisek;
}
if (_root.auto[i].p == 2) {
minimalni_rychlost_povrch = _root.minimalni_rychlost_led;
}
if (_root.auto[i].ta) {
maximalni_rychlost_povrch = maximalni_rychlost_povrch + _root.rychlost_turba;
}
if (_root.auto[i].cpu) {
maximalni_rychlost_povrch = maximalni_rychlost_povrch - _root.snizeni_max_rychlosti_cpu;
}
zpomaleni_otaceni = 1;
if (Math.abs(_root.auto[i].s) < 1) {
zpomaleni_otaceni = Math.abs(_root.auto[i].s);
}
if (Key.isDown(_root.auto[i].vpravo) && (!_root.auto[i].cpu)) {
if (_root.auto[i].s > 0) {
_root.auto[i].r = _root.auto[i].r + (_root.otaceni * zpomaleni_otaceni);
}
if (_root.auto[i].s < 0) {
_root.auto[i].r = _root.auto[i].r - (_root.otaceni * zpomaleni_otaceni);
}
}
if (Key.isDown(_root.auto[i].vlevo) && (!_root.auto[i].cpu)) {
if (_root.auto[i].s > 0) {
_root.auto[i].r = _root.auto[i].r - (_root.otaceni * zpomaleni_otaceni);
}
if (_root.auto[i].s < 0) {
_root.auto[i].r = _root.auto[i].r + (_root.otaceni * zpomaleni_otaceni);
}
}
if (Key.isDown(_root.auto[i].plyn) && (!_root.auto[i].cpu)) {
if (_root.auto[i].s < maximalni_rychlost_povrch) {
_root.auto[i].s = _root.auto[i].s + akcelerace_povrch;
}
}
if (Key.isDown(_root.auto[i].brzda) && (!_root.auto[i].cpu)) {
if (_root.auto[i].s > minimalni_rychlost_povrch) {
if (_root.auto[i].s > 0) {
_root.auto[i].s = _root.auto[i].s - brzda_povrch;
} else {
_root.auto[i].s = _root.auto[i].s - akcelerace_povrch;
}
}
}
if (Key.isDown(_root.auto[i].nitro) && (!_root.auto[i].cpu)) {
if (_root.auto[i].ta) {
if (_root.auto[i].turbo > 0) {
if (_root.auto[i].s < maximalni_rychlost_povrch) {
_root.auto[i].s = _root.auto[i].s + _root.akcelerace_turba;
}
_root.auto[i].turbo = _root.auto[i].turbo - _root.turbo_using;
} else {
_root.auto[i].ta = false;
}
} else if (_root.auto[i].turbo >= _root.maximalni_turbo) {
_root.auto[i].ta = true;
} else if (_root.auto[i].turbo < _root.maximalni_turbo) {
_root.auto[i].turbo = _root.auto[i].turbo + _root.turbo_filling;
}
}
if ((Key.isDown(_root.auto[i].nitro) == false) && (!_root.auto[i].cpu)) {
_root.auto[i].ta = false;
if (_root.auto[i].turbo < _root.maximalni_turbo) {
_root.auto[i].turbo = _root.auto[i].turbo + _root.turbo_filling;
}
}
if (((Key.isDown(_root.auto[i].plyn) == false) && (Key.isDown(_root.auto[i].brzda) == false)) && (!_root.auto[i].cpu)) {
if (_root.auto[i].s > 0) {
_root.auto[i].s = _root.auto[i].s - zpomaleni_povrch;
}
if (_root.auto[i].s < 0) {
_root.auto[i].s = _root.auto[i].s + zpomaleni_povrch;
}
if (Math.abs(_root.auto[i].s) < zpomaleni_povrch) {
_root.auto[i].s = 0;
}
}
if (_root.auto[i].cpu) {
_root.spocitej_novou_pozici(i);
if (_root.auto[i].s < maximalni_rychlost_povrch) {
_root.auto[i].s = _root.auto[i].s + akcelerace_povrch;
}
if (Math.abs(_root.auto[i].newr - _root.auto[i].r) < _root.otaceni) {
_root.auto[i].r = _root.auto[i].newr;
}
if (_root.auto[i].newr > _root.uhel(_root.auto[i].r)) {
if (_root.auto[i].s > 0) {
_root.auto[i].r = _root.auto[i].r + (_root.otaceni * zpomaleni_otaceni);
}
if (_root.auto[i].s < 0) {
_root.auto[i].r = _root.auto[i].r - (_root.otaceni * zpomaleni_otaceni);
}
}
if (_root.auto[i].newr < _root.uhel(_root.auto[i].r)) {
if (_root.auto[i].s > 0) {
_root.auto[i].r = _root.auto[i].r - (_root.otaceni * zpomaleni_otaceni);
}
if (_root.auto[i].s < 0) {
_root.auto[i].r = _root.auto[i].r + (_root.otaceni * zpomaleni_otaceni);
}
}
}
if (_root.auto[i].s > maximalni_rychlost_povrch) {
_root.auto[i].s = _root.auto[i].s - zpomaleni_povrch;
}
if (_root.auto[i].s < minimalni_rychlost_povrch) {
_root.auto[i].s = _root.auto[i].s + zpomaleni_povrch;
}
i++;
}
} else if (_root.pauza_aktivni == 0) {
i = 0;
while (i < _root.pocet_auticek) {
brzda_povrch = _root.brzda;
if (_root.auto[i].p == 1) {
brzda_povrch = _root.brzda_pisek;
}
if (_root.auto[i].p == 2) {
brzda_povrch = _root.brzda_led;
}
if (_root.auto[i].s > 0) {
_root.auto[i].s = _root.auto[i].s - brzda_povrch;
}
if (_root.auto[i].s < 0) {
_root.auto[i].s = _root.auto[i].s + brzda_povrch;
}
if (Math.abs(_root.auto[i].s) < brzda_povrch) {
_root.auto[i].s = 0;
}
i++;
}
}
}
Frame 13
i = 0;
while (i < pocet_auticek) {
if (pauza_aktivni == 0) {
calculate_car(i);
place_car(i);
}
i++;
}
Frame 14
gotoAndPlay (13);
Symbol 39 Button
on (release) {
_root.nastaveni_click();
_root.ma1.enabled = 0;
_root.ma2.enabled = 0;
_root.ma4.enabled = 0;
}
Symbol 42 Button
on (release) {
_root.ma1.enabled = 0;
_root.ma2.enabled = 0;
_root.ma3.enabled = 0;
_root.help_click();
}
Symbol 45 Button
on (release) {
_root.p2_click();
}
Symbol 48 Button
on (release) {
_root.p1_click();
}
Symbol 55 Button
on (release) {
_root.mytu.gotoAndStop(3);
_root.shanghai.gotoAndStop(1);
}
Symbol 59 Button
on (release) {
_root.mytu.gotoAndStop(4);
_root.shanghai.gotoAndStop(1);
}
Symbol 63 Button
on (release) {
_root.mytu.gotoAndStop(5);
_root.shanghai.gotoAndStop(1);
}
Symbol 76 MovieClip Frame 2
stop();
Symbol 81 Button
on (release) {
_root.mytu.gotoAndStop(2);
play();
}
Symbol 82 MovieClip Frame 2
stop();
Symbol 86 Button
on (release) {
getURL ("http://www.t45ol.com", "_blank");
}
Symbol 116 Button
on (release) {
_root.ma1.enabled = 1;
_root.ma2.enabled = 1;
_root.ma3.enabled = 1;
_root.ma4.enabled = 1;
_root.help_click_close();
}
Symbol 117 MovieClip Frame 1
stop();
Symbol 127 Button
on (release) {
_root.ma1.enabled = 1;
_root.ma2.enabled = 1;
_root.ma4.enabled = 1;
_root.ma3.enabled = 1;
_root.nastaveni_click_close();
}
Symbol 130 MovieClip Frame 1
stop();
Symbol 130 MovieClip Frame 2
stop();
Symbol 132 MovieClip Frame 1
stop();
Symbol 132 MovieClip Frame 2
stop();
Symbol 134 MovieClip Frame 1
stop();
Symbol 134 MovieClip Frame 2
stop();
Symbol 136 MovieClip Frame 1
stop();
Symbol 136 MovieClip Frame 2
stop();
Symbol 138 Button
on (release) {
_root.zvuky_click();
}
Symbol 139 Button
on (release) {
_root.nastavit_kvalitu(3);
}
Symbol 140 Button
on (release) {
_root.nastavit_kvalitu(2);
}
Symbol 141 Button
on (release) {
_root.nastavit_kvalitu(1);
}
Symbol 142 MovieClip Frame 1
stop();
Symbol 142 MovieClip Frame 2
hudba_zvuky_update();
stop();
Instance of Symbol 130 MovieClip "ukazatel_zvuky" in Symbol 142 MovieClip Frame 2
on (release) {
_root.zvuky_click();
}
Symbol 167 MovieClip Frame 2
stop();
Symbol 171 MovieClip Frame 2
stop();
Symbol 209 Button
on (release) {
getURL ("http://www.t45ol.com", "_blank");
}
Symbol 218 MovieClip Frame 1
stop();
Symbol 218 MovieClip Frame 2
stop();
Symbol 218 MovieClip Frame 3
stop();
Symbol 219 MovieClip Frame 1
stop();
Symbol 219 MovieClip Frame 2
stop();
Symbol 220 MovieClip Frame 1
stop();
Symbol 220 MovieClip Frame 2
stop();
Symbol 244 MovieClip Frame 1
stop();
Symbol 255 MovieClip Frame 1
stop();
Symbol 266 MovieClip Frame 1
stop();
Symbol 277 MovieClip Frame 1
stop();
Symbol 288 MovieClip Frame 1
stop();
Symbol 289 MovieClip Frame 1
stop();
Symbol 292 MovieClip Frame 1
stop();
Symbol 292 MovieClip Frame 2
play();
Symbol 292 MovieClip Frame 30
gotoAndPlay (2);
Symbol 297 MovieClip Frame 1
stop();
Symbol 300 MovieClip Frame 1
stop();
Symbol 303 MovieClip Frame 1
stop();
Symbol 303 MovieClip Frame 2
play();
Symbol 303 MovieClip Frame 18
gotoAndPlay (2);
Symbol 310 MovieClip Frame 1
_root.urovne_init();
Symbol 310 MovieClip Frame 2
_root.sound_odpocet1();
Symbol 310 MovieClip Frame 26
_root.sound_odpocet1();
Symbol 310 MovieClip Frame 49
_root.deng.play();
Symbol 310 MovieClip Frame 51
_root.sound_odpocet1();
Symbol 310 MovieClip Frame 74
_root.deng.play();
Symbol 310 MovieClip Frame 75
_root.sound_odpocet2();
_root.nastartuj();
Symbol 310 MovieClip Frame 90
stop();
Symbol 321 Button
on (release) {
_root.restartovat();
}
Symbol 327 Button
on (release) {
_root.zpet_do_main_menu();
}
Symbol 336 Button
on (press) {
trace("xxx");
if ((_root.endmenu.username.text.length != 0) and (_root.endmenu.useremail.text.length != 0)) {
_root.game_so.data.playerName = _root.endmenu.username.text;
_root.game_so.data.usetime = _root.endmenu.yongshi.usetime;
_root.game_so.data.useremail = _root.endmenu.useremail.text;
_root.phb.gotoAndPlay(2);
}
}
Symbol 350 MovieClip Frame 1
stop();
Instance of Symbol 346 MovieClip "yongshi" in Symbol 350 MovieClip Frame 3
onClipEvent (enterFrame) {
this.usetime = (((String(_root.kola_cas.cislo1._currentFrame - 1) + String(_root.kola_cas.cislo2._currentFrame - 1)) + ":") + String(_root.kola_cas.cislo3._currentFrame - 1)) + String(_root.kola_cas.cislo4._currentFrame - 1);
_root.score = (((_root.kola_cas.cislo4._currentFrame - 1) + (10 * (_root.kola_cas.cislo3._currentFrame - 1))) + (60 * (_root.kola_cas.cislo2._currentFrame - 1))) + (10 * (_root.kola_cas.cislo1._currentFrame - 1));
trace(_root.score);
}
Symbol 352 MovieClip Frame 1
stop();
Symbol 352 MovieClip Frame 2
stop();
Symbol 369 Button
on (release) {
getURL ("http://www.t45ol.com/", "_blank");
}
Symbol 371 Button
on (release) {
getURL ("http://www.t45ol.com/play_flash.php?ID=1015", "_blank");
}
Symbol 375 MovieClip Frame 1
stop();
errorMsg = "";
i = 0;
alien_mc.onEnterFrame = function () {
i = i + 0.25;
i = i % 2;
this.gotoAndStop(i + 1);
};
Symbol 381 MovieClip Frame 1
stop();
Symbol 381 MovieClip Frame 2
stop();
score = _root.score;
trace(score + "dddd");
trace(_root.game_so.data.playerName.length + "dddd");
showScores = function () {
var _local2 = 10;
while (_local2 > 0) {
var _local3 = scoreboard_lv["name" + (page + _local2)];
var s = scoreboard_lv["score" + (page + _local2)];
var _local1 = this[("line" + _local2) + "_mc"];
_local1.rank_txt.text = (page + _local2) + ".";
_local1.name_txt.text = (_local3.length ? (_local3.toUpperCase()) : "-");
_local1.score_txt.text = s;
_local1.rank_txt.textColor = (_local1.name_txt.textColor = (_local1.score_txt.textColor = ((_root.game_so.data.playerName.length && (_local3.toUpperCase() == _root.game_so.data.playerName.toUpperCase())) ? 3407616 : 16777215)));
_local1._visible = true;
loading_mc._visible = false;
_local2--;
}
};
page = 0;
maxScore = 50;
scoreboard_lv = new LoadVars();
trace("ph===========================");
trace("score=" + score);
if ((score > 0) && (_root.game_so.data.playerName.length > 0)) {
scoreboard_lv.score = score;
scoreboard_lv.name = _root.game_so.data.playerName.toLowerCase();
scoreboard_lv.useremail = _root.game_so.data.useremail.toLowerCase();
trace("scoreboard_lv.score=" + scoreboard_lv.score);
trace("scoreboard_lv.name=" + scoreboard_lv.name);
trace("scoreboard_lv.useremail=" + scoreboard_lv.useremail);
}
scoreboard_lv.game = "f1";
scoreboard_lv.sendAndLoad("game_score1.php", scoreboard_lv, "POST");
scoreboard_lv.onLoad = function (success) {
if (success) {
trace("success=" + success);
if (Boolean(scoreboard_lv.success)) {
trace("success===================");
trace("scoreboard_lv.maxScore.length=" + scoreboard_lv.maxScore.length);
if (scoreboard_lv.maxScore.length > 0) {
maxScore = Number(scoreboard_lv.maxScore);
}
trace("maxScore=" + maxScore);
showScores();
} else {
trace("not success===================");
loading_mc.errorMsg = scoreboard_lv.errorMsg.toUpperCase();
trace("loading_mc.errorMsg=" + loading_mc.errorMsg);
loading_mc.gotoAndStop(2);
}
} else {
loading_mc.errorMsg = "SCORES ONLY ON T45OL.COM";
loading_mc.gotoAndStop(2);
}
};
score = 0;
last_btn._visible = false;
next_btn._visible = true;
last_btn.onPress = function () {
page = page - 10;
if (page < 0) {
page = 0;
}
if (page < 10) {
last_btn._visible = false;
}
next_btn._visible = true;
showScores();
};
top_btn.onPress = function () {
page = 1;
next_btn._visible = true;
showScores();
};
next_btn.onPress = function () {
page = page + 10;
if (page > maxScore) {
page = maxScore;
}
if (page > (maxScore - 20)) {
next_btn._visible = false;
}
last_btn._visible = true;
showScores();
};
newGame_btn.onRelease = function () {
gotoAndStop (2);
};
ufo_mc.dir = 1;
ufo_mc.onEnterFrame = function () {
var _local1 = this;
if (!_local1._visible) {
_local1.dir = (int(rnd() * 2) * 2) - 1;
_local1._x = 250 - (_local1.dir * 300);
_local1._visible = true;
}
_local1._x = _local1._x + (_local1.dir * 3);
if ((_local1._x > 550) || (_local1._x < -50)) {
_local1._visible = false;
}
};
Symbol 394 MovieClip Frame 1
stop();
Symbol 398 MovieClip Frame 1
stop();
Symbol 398 MovieClip Frame 2
play();
Symbol 398 MovieClip Frame 9
stop();
Symbol 402 Button
on (release) {
_root.zpet_do_main_menu();
}