home *** CD-ROM | disk | FTP | other *** search
- function Pr_Car()
- {
- with(_root.car)
- {
- if(_root.doroga.hitTest(getBounds(_root).xMax,_y,true))
- {
- _x -= _root.speed2;
- if(_root.p > 0.5)
- {
- _root.p -= _root.speed2 * 2;
- }
- else if(_root.p < 0.5)
- {
- _root.p += _root.speed2 * 2;
- }
- }
- if(_root.doroga.hitTest(getBounds(_root).xMin,_y,true))
- {
- _x += _root.speed2;
- if(_root.p > 0.5)
- {
- _root.p -= _root.speed2 * 2;
- }
- else if(_root.p < 0.5)
- {
- _root.p += _root.speed2 * 2;
- }
- }
- if(_root.doroga.hitTest(_x,getBounds(_root).yMax,true))
- {
- _y -= _root.speed2;
- if(_root.p > 0.5)
- {
- _root.p -= _root.speed2 * 2;
- }
- else if(_root.p < 0.5)
- {
- _root.p += _root.speed2 * 2;
- }
- }
- if(_root.doroga.hitTest(_x,getBounds(_root).yMin,true))
- {
- _y += _root.speed2;
- if(_root.p > 0.5)
- {
- _root.p -= _root.speed2 * 2;
- }
- else if(_root.p < 0.5)
- {
- _root.p += _root.speed2 * 2;
- }
- }
- }
- }
- function MoveAll(nextl)
- {
- speed = 3;
- speed2 = 0.4;
- otkl = 6;
- if(p < 2)
- {
- car.flame.gotoandstop(1);
- netrofl = false;
- if(_root.netro.dwn)
- {
- _root.netro.gotoandplay(1);
- _root.msnd.Playsnd(4);
- }
- }
- if(p > 0)
- {
- if(_root.netrofl)
- {
- spm.speed._rotation = 85;
- }
- else
- {
- spm.speed._rotation = p * 50 - 90;
- }
- }
- if(p < 0)
- {
- spm.speed._rotation = (- p) * 10 - 90;
- }
- gameDate = new Date();
- sec = gameDate.getSeconds();
- min = gameDate.getMinutes();
- mls = int(gameDate.getMilliseconds() / 10);
- if(mls < 10)
- {
- mls = "0" + mls;
- }
- gts = sec - startsec;
- gtm = min - startmin;
- if(gtm < 0)
- {
- gtmp = gtm + 60;
- }
- else
- {
- gtmp = gtm;
- }
- if(gts < 0)
- {
- gtsl = gts + 60;
- }
- else
- {
- gtsl = gts;
- }
- if(gts < 10 and gts > -1)
- {
- gtsl = "0" + gtsl;
- }
- if(gtsl == 0)
- {
- gtml = gtmp;
- }
- if(gtml < 1)
- {
- time = "00:" + gtsl + ":" + mls;
- }
- else
- {
- time = gtml + ":" + gtsl + ":" + mls;
- }
- if(p < 0.05 && p > 0.049 || p < 0.02 && p > 0.019 || p < 0.04 && p > 0.039 || p < 0.03 && p > 0.029 || p < 0.01 && p > 0.009 || p < 0.01 && p > 0)
- {
- p = 0;
- }
- car._x += p * Math.cos(0.017453292519943295 * _root.rotcar);
- car._y += p * Math.sin(0.017453292519943295 * _root.rotcar);
- car2._x += p2 * Math.cos(0.017453292519943295 * _root.rotcar2);
- car2._y += p2 * Math.sin(0.017453292519943295 * _root.rotcar2);
- car3._x += p3 * Math.cos(0.017453292519943295 * _root.rotcar3);
- car3._y += p3 * Math.sin(0.017453292519943295 * _root.rotcar3);
- car4._x += p4 * Math.cos(0.017453292519943295 * _root.rotcar4);
- car4._y += p4 * Math.sin(0.017453292519943295 * _root.rotcar4);
- rotcar = getProperty("/car", _rotation);
- rotcar2 = getProperty("/car2", _rotation);
- rotcar3 = getProperty("/car3", _rotation);
- rotcar4 = getProperty("/car4", _rotation);
- prov._x = car._x;
- prov._y = car._y;
- prov._rotation = car._rotation;
- prov._visible = 0;
- if(p > 0)
- {
- if(car.hitTest("/fon"))
- {
- p -= 0.02;
- }
- }
- if(p < 0)
- {
- if(car.hitTest("/fon"))
- {
- p += 0.02;
- }
- }
- if(p2 < 0)
- {
- if(car2.hitTest("/fon"))
- {
- p2 += 0.02;
- }
- }
- if(p3 < 0)
- {
- if(car3.hitTest("/fon"))
- {
- p3 += 0.02;
- }
- }
- if(p4 < 0)
- {
- if(car4.hitTest("/fon"))
- {
- p4 += 0.02;
- }
- }
- }
- function MyCarSelect(col)
- {
- col2 = col + 1;
- if(col2 > 5)
- {
- col2 = 1;
- }
- col3 = col2 + 1;
- if(col3 > 5)
- {
- col3 = 1;
- }
- col4 = col3 + 1;
- if(col4 > 5)
- {
- col4 = 1;
- }
- _root.car.gotoandstop(col);
- _root.car2.gotoandstop(col2);
- _root.car3.gotoandstop(col3);
- _root.car4.gotoandstop(col4);
- }
- function SetEndTime()
- {
- stoptime2 = new Date();
- secstop2 = stoptime2.getSeconds();
- minstop2 = stoptime2.getMinutes();
- ssl2 = secstop2 - startsec;
- msl2 = minstop2 - startmin;
- if(msl2 < 0)
- {
- mslp2 = msl2 + 60 - 1;
- }
- else
- {
- mslp2 = msl2 - 1;
- }
- if(ssl2 < 0)
- {
- sslp2 = ssl2 + 60;
- }
- else
- {
- sslp2 = ssl2;
- }
- if(mslp2 < 1)
- {
- _root.timelast2 = sslp2 + "sec";
- }
- else
- {
- _root.timelast2 = mslp2 + "min" + " " + sslp2 + "sec";
- }
- }
- function CarBot2(ll)
- {
- rand = random(ll) * 0.03;
- if(_root.p2 < _root.speed + rand)
- {
- _root.p2 += 0.1 + rand;
- }
- with(_root.car)
- {
- if(_root.car2.hitTest(getBounds(_root).xMax,_y,true))
- {
- _x -= 0.5;
- }
- if(_root.car2.hitTest(getBounds(_root).xMin,_y,true))
- {
- _x += 0.5;
- }
- if(_root.car2.hitTest(_x,getBounds(_root).yMax,true))
- {
- _y -= 0.5;
- }
- if(_root.car2.hitTest(_x,getBounds(_root).yMin,true))
- {
- _y += 0.5;
- }
- }
- with(_root.car3)
- {
- if(_root.car2.hitTest(getBounds(_root).xMax,_y,true))
- {
- _rotation -= 3;
- _x -= 0.5;
- }
- if(_root.car2.hitTest(getBounds(_root).xMin,_y,true))
- {
- _rotation -= 3;
- _x += 0.5;
- }
- if(_root.car2.hitTest(_x,getBounds(_root).yMax,true))
- {
- _rotation -= 3;
- _y -= 0.5;
- }
- if(_root.car2.hitTest(_x,getBounds(_root).yMin,true))
- {
- _rotation -= 3;
- _y += 0.5;
- }
- }
- with(_root.car4)
- {
- if(_root.car2.hitTest(getBounds(_root).xMax,_y,true))
- {
- _rotation -= 3;
- _x -= 0.5;
- }
- if(_root.car2.hitTest(getBounds(_root).xMin,_y,true))
- {
- _rotation -= 3;
- _x += 0.5;
- }
- if(_root.car2.hitTest(_x,getBounds(_root).yMax,true))
- {
- _rotation -= 3;
- _y -= 0.5;
- }
- if(_root.car2.hitTest(_x,getBounds(_root).yMin,true))
- {
- _rotation -= 3;
- _y += 0.5;
- }
- }
- }
- function CarBot3(ll)
- {
- rand = random(3) * 0.03;
- if(_root.p3 < _root.speed + rand)
- {
- _root.p3 += 0.1 + rand;
- }
- with(_root.car)
- {
- if(_root.car3.hitTest(getBounds(_root).xMax,_y,true))
- {
- _x -= 0.5;
- }
- if(_root.car3.hitTest(getBounds(_root).xMin,_y,true))
- {
- _x += 0.5;
- }
- if(_root.car3.hitTest(_x,getBounds(_root).yMax,true))
- {
- _y -= 0.5;
- }
- if(_root.car3.hitTest(_x,getBounds(_root).yMin,true))
- {
- _y += 0.5;
- }
- }
- with(_root.car2)
- {
- if(_root.car3.hitTest(getBounds(_root).xMax,_y,true))
- {
- _rotation -= 3;
- _x -= 0.5;
- }
- if(_root.car3.hitTest(getBounds(_root).xMin,_y,true))
- {
- _rotation -= 3;
- _x += 0.5;
- }
- if(_root.car3.hitTest(_x,getBounds(_root).yMax,true))
- {
- _rotation -= 3;
- _y -= 0.5;
- }
- if(_root.car3.hitTest(_x,getBounds(_root).yMin,true))
- {
- _rotation -= 3;
- _y += 0.5;
- }
- }
- with(_root.car4)
- {
- if(_root.car3.hitTest(getBounds(_root).xMax,_y,true))
- {
- _rotation -= 3;
- _x -= 0.5;
- }
- if(_root.car3.hitTest(getBounds(_root).xMin,_y,true))
- {
- _rotation -= 3;
- _x += 0.5;
- }
- if(_root.car3.hitTest(_x,getBounds(_root).yMax,true))
- {
- _rotation -= 3;
- _y -= 0.5;
- }
- if(_root.car3.hitTest(_x,getBounds(_root).yMin,true))
- {
- _rotation -= 3;
- _y += 0.5;
- }
- }
- }
- function CarBot4(ll)
- {
- rand = random(ll) * 0.03;
- if(_root.p4 < _root.speed + rand)
- {
- _root.p4 += 0.1 + rand;
- }
- with(_root.car)
- {
- if(_root.car4.hitTest(getBounds(_root).xMax,_y,true))
- {
- _x -= 0.5;
- }
- if(_root.car4.hitTest(getBounds(_root).xMin,_y,true))
- {
- _x += 0.5;
- }
- if(_root.car4.hitTest(_x,getBounds(_root).yMax,true))
- {
- _y -= 0.5;
- }
- if(_root.car4.hitTest(_x,getBounds(_root).yMin,true))
- {
- _y += 0.5;
- }
- }
- with(_root.car2)
- {
- if(_root.car4.hitTest(getBounds(_root).xMax,_y,true))
- {
- _x -= 0.5;
- }
- if(_root.car4.hitTest(getBounds(_root).xMin,_y,true))
- {
- _x += 0.5;
- }
- if(_root.car4.hitTest(_x,getBounds(_root).yMax,true))
- {
- _y -= 0.5;
- }
- if(_root.car4.hitTest(_x,getBounds(_root).yMin,true))
- {
- _y += 0.5;
- }
- }
- with(_root.car3)
- {
- if(_root.car4.hitTest(getBounds(_root).xMax,_y,true))
- {
- _rotation -= 3;
- _x -= 0.5;
- }
- if(_root.car4.hitTest(getBounds(_root).xMin,_y,true))
- {
- _rotation -= 3;
- _x += 0.5;
- }
- if(_root.car4.hitTest(_x,getBounds(_root).yMax,true))
- {
- _rotation -= 3;
- _y -= 0.5;
- }
- if(_root.car4.hitTest(_x,getBounds(_root).yMin,true))
- {
- _rotation -= 3;
- _y += 0.5;
- }
- }
- }
- function SetEndGame()
- {
- stopAllSounds();
- laps = "5";
- netrofl = false;
- stay = 1;
- t = 15;
- p = 0;
- p2 = 0;
- p3 = 0;
- p4 = 0;
- lap = 1;
- lap2 = 1;
- lap3 = 1;
- lap4 = 1;
- po1 = 0;
- po2 = 0;
- po3 = 0;
- pob3_2 = 0;
- pob3_3 = 0;
- pob3_4 = 0;
- ran = random(10);
- netro.gotoandstop(1);
- car._rotation = -90;
- car.flame.gotoandstop(1);
- spm.speed._rotation = -90;
- }
- if(map == 2)
- {
- gotoAndPlay(113);
- }
- if(map == 3)
- {
- gotoAndPlay(141);
- }
- if(map == 4)
- {
- gotoAndPlay(169);
- }
- if(map == 5)
- {
- gotoAndPlay(197);
- }
-