home *** CD-ROM | disk | FTP | other *** search
- sine_lookup_table = "0.000/.0175/.0349/.0523/.0698/.0872/.1045/.1219/.1392/.1564/.1736/.1908/.2079/.2250/.2419/.2588/.2756/.2924/.3090/.3256/.3420/.3584/.3746/.3907/.4067/.4226/.4384/.4540/.4695/.4848/.5000/.5150/.5299/.5446/.5592/.5736/.5878/.6018/.6157/.6428/.6561/.6691/.6820/.6947/.7071/.7193/.7314/.7431/.7547/.7660/.7771/.7880/.7986/.8090/.8192/.8290/.8387/.8480/.8572/.8660/.8746/.8829/.8910/.8988/.9063/.9135/.9205/.9272/.9336/.9397/.9455/.9511/.9563/.9613/.9659/.9703/.9744/.9781/.9816/.9848/.9877/.9903/.9925/.9945/.9962/.9976/.9986/.9994/.9998/1.000";
- setProperty("_root.stat_car1speed.bar2", _width, getProperty("/carspeed/hairline", _height) * 10);
- stat_car1speed = getProperty("/carspeed/hairline", _height) * 20;
- setProperty("_root.stat_car2speed.bar2", _width, getProperty("/carspeed2/hairline", _height) * 10);
- stat_car2speed = getProperty("/carspeed2/hairline", _height) * 20;
- hairlineheight = getProperty("/carspeed/hairline", _height);
- xmov = (getProperty("/carspeed", _width) - 1) * vroom;
- ymov = (getProperty("/carspeed", _height) - 1) * vroom;
- carx = getProperty("/car", _X);
- cary = getProperty("/car", _Y);
- car_rotate = getProperty("/car", _rotation);
- carspeedx = getProperty("/carspeed", _X);
- carspeedy = getProperty("/carspeed", _Y);
- if(car1dead != 1)
- {
- if(Key.isDown(38))
- {
- if(Number(hairline) < 54)
- {
- hairline = Number(hairline) + 2;
- }
- }
- if(Key.isDown(37))
- {
- if(carx < 300 and 95 < carx and cary < 105)
- {
- setProperty("/car", _rotation, getProperty("/car", _rotation) - 2);
- setProperty("/carspeed", _rotation, getProperty("/carspeed", _rotation) - 2);
- }
- else
- {
- setProperty("/car", _rotation, getProperty("/car", _rotation) - 8);
- setProperty("/carspeed", _rotation, getProperty("/carspeed", _rotation) - 8);
- }
- }
- if(Key.isDown(39))
- {
- if(carx < 300 and 95 < carx and cary < 105)
- {
- setProperty("/car", _rotation, Number(getProperty("/car", _rotation)) + 2);
- setProperty("/carspeed", _rotation, Number(getProperty("/carspeed", _rotation)) + 2);
- }
- else
- {
- setProperty("/car", _rotation, Number(getProperty("/car", _rotation)) + 8);
- setProperty("/carspeed", _rotation, Number(getProperty("/carspeed", _rotation)) + 8);
- }
- }
- if(Key.isDown(40))
- {
- if(0.1 < Number(hairline))
- {
- hairline -= 2;
- }
- }
- if(90 >= Number(car_rotate) and Number(car_rotate) >= Number(-90))
- {
- setProperty("/car", _Y, cary - ymov);
- setProperty("/carspeed", _Y, carspeedy - ymov);
- }
- else
- {
- setProperty("/car", _Y, Number(cary) + Number(ymov));
- setProperty("/carspeed", _Y, Number(carspeedy) + Number(ymov));
- }
- if(Number(car_rotate) < 0)
- {
- setProperty("/car", _X, carx - xmov);
- setProperty("/carspeed", _X, carspeedx - xmov);
- }
- else
- {
- setProperty("/car", _X, Number(carx) + Number(xmov));
- setProperty("/carspeed", _X, Number(carspeedx) + Number(xmov));
- }
- if(Number(cary) < 40)
- {
- setProperty("/car", _Y, 41);
- setProperty("/carspeed", _Y, 41);
- hairline = 0.1;
- setProperty("_root.stat_car1health.bar2", _width, getProperty("_root.stat_car1health.bar2", _width) + 6.725);
- stat_car1health -= 5;
- tellTarget("_root.car1sounds")
- {
- gotoAndStop("crash1");
- play();
- }
- }
- else if(360 < Number(cary))
- {
- setProperty("/car", _Y, 359);
- setProperty("/carspeed", _Y, 359);
- hairline = 0.1;
- setProperty("_root.stat_car1health.bar2", _width, getProperty("_root.stat_car1health.bar2", _width) + 6.725);
- stat_car1health -= 5;
- tellTarget("_root.car1sounds")
- {
- gotoAndStop("crash1");
- play();
- }
- }
- if(Number(carx) < 20)
- {
- setProperty("/car", _X, 21);
- setProperty("/carspeed", _X, 21);
- hairline = 0.1;
- setProperty("_root.stat_car1health.bar2", _width, getProperty("_root.stat_car1health.bar2", _width) + 6.725);
- stat_car1health -= 5;
- tellTarget("_root.car1sounds")
- {
- gotoAndStop("crash1");
- play();
- }
- }
- else if(625 < Number(carx))
- {
- setProperty("/car", _X, 624);
- setProperty("/carspeed", _X, 624);
- hairline = 0.1;
- setProperty("_root.stat_car1health.bar2", _width, getProperty("_root.stat_car1health.bar2", _width) + 6.725);
- stat_car1health -= 5;
- tellTarget("_root.car1sounds")
- {
- gotoAndStop("crash1");
- play();
- }
- }
- if(570 < carx and carx < 600 and cary < 50)
- {
- hairline = 0.1;
- setProperty("/car", _Y, cary - ymov);
- setProperty("/carspeed", _Y, carx - xmov);
- setProperty("_root.stat_car1health.bar2", _width, getProperty("_root.stat_car1health.bar2", _width) + 1.35);
- stat_car1health -= 1;
- tellTarget("_root.car1sounds")
- {
- gotoAndStop("crash1");
- play();
- }
- }
- if(125 < carx and carx < 488 and (145 < cary and cary < 165))
- {
- hairline = 0.1;
- setProperty("/car", _Y, 144);
- setProperty("/carspeed", _Y, 144);
- setProperty("_root.stat_car1health.bar2", _width, getProperty("_root.stat_car1health.bar2", _width) + 6.725);
- stat_car1health -= 5;
- tellTarget("_root.car1sounds")
- {
- gotoAndStop("crash1");
- play();
- }
- }
- if(125 < carx and carx < 488 and (170 < cary and cary < 205))
- {
- hairline = 0.1;
- setProperty("/car", _Y, 206);
- setProperty("/carspeed", _Y, 206);
- setProperty("_root.stat_car1health.bar2", _width, getProperty("_root.stat_car1health.bar2", _width) + 6.725);
- stat_car1health -= 5;
- tellTarget("_root.car1sounds")
- {
- gotoAndStop("crash1");
- play();
- }
- }
- if(125 < carx and carx < 250 and (250 < cary and cary < 280))
- {
- hairline = 0.1;
- setProperty("/car", _Y, 281);
- setProperty("/carspeed", _Y, 281);
- setProperty("_root.stat_car1health.bar2", _width, getProperty("_root.stat_car1health.bar2", _width) + 6.725);
- stat_car1health -= 5;
- tellTarget("_root.car1sounds")
- {
- gotoAndStop("crash1");
- play();
- }
- }
- if(448 < carx and carx < 495 and (220 < cary and cary < 260))
- {
- hairline = 0.1;
- setProperty("/car", _Y, 261);
- setProperty("/carspeed", _Y, 261);
- setProperty("_root.stat_car1health.bar2", _width, getProperty("_root.stat_car1health.bar2", _width) + 6.725);
- stat_car1health -= 5;
- tellTarget("_root.car1sounds")
- {
- gotoAndStop("crash1");
- play();
- }
- }
- if(120 < carx and carx < 165 and (155 < cary and cary < 270))
- {
- hairline = 0.1;
- setProperty("/car", _X, carx - xmov * 1.5);
- setProperty("/carspeed", _X, carx - xmov * 1.5);
- setProperty("_root.stat_car1health.bar2", _width, getProperty("_root.stat_car1health.bar2", _width) + 6.725);
- stat_car1health -= 5;
- tellTarget("_root.car1sounds")
- {
- gotoAndStop("crash1");
- play();
- }
- }
- if(455 < carx and carx < 470 and (200 < cary and cary < 245))
- {
- hairline = 0.1;
- setProperty("/car", _X, carx - xmov * 1.5);
- setProperty("/carspeed", _X, carx - xmov * 1.5);
- setProperty("_root.stat_car1health.bar2", _width, getProperty("_root.stat_car1health.bar2", _width) + 6.725);
- stat_car1health -= 5;
- tellTarget("_root.car1sounds")
- {
- gotoAndStop("crash1");
- play();
- }
- }
- if(470 < carx and carx < 505 and (160 < cary and cary < 245))
- {
- hairline = 0.1;
- setProperty("/car", _X, 506);
- setProperty("/carspeed", _X, 506);
- setProperty("_root.stat_car1health.bar2", _width, getProperty("_root.stat_car1health.bar2", _width) + 6.725);
- stat_car1health -= 5;
- tellTarget("_root.car1sounds")
- {
- gotoAndStop("crash1");
- play();
- }
- }
- if(200 < carx and carx < 255 and (180 < cary and cary < 270))
- {
- hairline = 0.1;
- setProperty("/car", _X, 256);
- setProperty("/carspeed", _X, 256);
- setProperty("_root.stat_car1health.bar2", _width, getProperty("_root.stat_car1health.bar2", _width) + 6.725);
- stat_car1health -= 5;
- tellTarget("_root.car1sounds")
- {
- gotoAndStop("crash1");
- play();
- }
- }
- if(330 < carx and carx < 410 and 295 < cary)
- {
- hairline = 0.1;
- if(carx < 375)
- {
- setProperty("/car", _X, carx - xmov * 1.5);
- setProperty("/carspeed", _X, carx - xmov * 1.5);
- setProperty("/car", _Y, cary - ymov * 1.5);
- setProperty("/carspeed", _Y, cary - ymov * 1.5);
- }
- else if(375 < carx)
- {
- setProperty("/car", _X, carx + xmov * 1.5);
- setProperty("/carspeed", _X, carx + xmov * 1.5);
- setProperty("/car", _Y, cary - ymov * 1.5);
- setProperty("/carspeed", _Y, cary - ymov * 1.5);
- }
- else if(cary < 285)
- {
- setProperty("/car", _Y, cary - ymov * 1.5);
- setProperty("/carspeed", _Y, cary - ymov * 1.5);
- }
- setProperty("_root.stat_car1health.bar2", _width, getProperty("_root.stat_car1health.bar2", _width) + 6.725);
- stat_car1health -= 5;
- tellTarget("_root.car1sounds")
- {
- gotoAndStop("crash1");
- play();
- }
- }
- if(400 < carx and carx < 475 and 110 < cary and cary < 140)
- {
- if(vroom < 3)
- {
- tellTarget("_root.car1sounds")
- {
- gotoAndStop("vroom");
- }
- }
- vroom = 3;
- }
- else if(1 < vroom)
- {
- vroom -= 0.1;
- if(carx < 140)
- {
- vroom -= 0.5;
- }
- }
- else
- {
- vroom = 1;
- }
- }
- hairlineheight2 = getProperty("/carspeed2/hairline", _height);
- xmov2 = (getProperty("/carspeed2", _width) - 1) * vroom2;
- ymov2 = (getProperty("/carspeed2", _height) - 1) * vroom2;
- carx2 = getProperty("/car2", _X);
- cary2 = getProperty("/car2", _Y);
- car_rotate2 = getProperty("/car2", _rotation);
- carspeedx2 = getProperty("/carspeed2", _X);
- carspeedy2 = getProperty("/carspeed2", _Y);
- if(car2dead != 1)
- {
- if(Key.isDown(87))
- {
- if(Number(hairline2) < 54)
- {
- hairline2 = Number(hairline2) + 2;
- }
- }
- if(Key.isDown(65))
- {
- if(carx2 < 300 and 95 < carx2 and cary2 < 105)
- {
- setProperty("/car2", _rotation, getProperty("/car2", _rotation) - 2);
- setProperty("/carspeed2", _rotation, getProperty("/carspeed2", _rotation) - 2);
- }
- else
- {
- setProperty("/car2", _rotation, getProperty("/car2", _rotation) - 8);
- setProperty("/carspeed2", _rotation, getProperty("/carspeed2", _rotation) - 8);
- }
- }
- if(Key.isDown(68))
- {
- if(carx2 < 300 and 95 < carx2 and cary2 < 105)
- {
- setProperty("/car2", _rotation, Number(getProperty("/car2", _rotation)) + 2);
- setProperty("/carspeed2", _rotation, Number(getProperty("/carspeed2", _rotation)) + 2);
- }
- else
- {
- setProperty("/car2", _rotation, Number(getProperty("/car2", _rotation)) + 8);
- setProperty("/carspeed2", _rotation, Number(getProperty("/carspeed2", _rotation)) + 8);
- }
- }
- if(Key.isDown(83))
- {
- if(0.1 < Number(hairline2))
- {
- hairline2 -= 2;
- }
- }
- if(90 >= Number(car_rotate2) and Number(car_rotate2) >= Number(-90))
- {
- setProperty("/car2", _Y, cary2 - ymov2);
- setProperty("/carspeed2", _Y, carspeedy2 - ymov2);
- }
- else
- {
- setProperty("/car2", _Y, Number(cary2) + Number(ymov2));
- setProperty("/carspeed2", _Y, Number(carspeedy2) + Number(ymov2));
- }
- if(Number(car_rotate2) < 0)
- {
- setProperty("/car2", _X, carx2 - xmov2);
- setProperty("/carspeed2", _X, carspeedx2 - xmov2);
- }
- else
- {
- setProperty("/car2", _X, Number(carx2) + Number(xmov2));
- setProperty("/carspeed2", _X, Number(carspeedx2) + Number(xmov2));
- }
- if(Number(cary2) < 40)
- {
- setProperty("/car2", _Y, 41);
- setProperty("/carspeed2", _Y, 41);
- hairline2 = 0.1;
- setProperty("_root.stat_car2health.bar2", _width, getProperty("_root.stat_car2health.bar2", _width) + 6.725);
- stat_car2health -= 5;
- tellTarget("_root.car2sounds")
- {
- gotoAndStop("crash1");
- play();
- }
- }
- else if(360 < Number(cary2))
- {
- setProperty("/car2", _Y, 359);
- setProperty("/carspeed2", _Y, 359);
- hairline = 0.1;
- setProperty("_root.stat_car2health.bar2", _width, getProperty("_root.stat_car2health.bar2", _width) + 6.725);
- stat_car2health -= 5;
- tellTarget("_root.car2sounds")
- {
- gotoAndStop("crash1");
- play();
- }
- }
- if(Number(carx2) < 20)
- {
- setProperty("/car2", _X, 21);
- setProperty("/carspeed2", _X, 21);
- hairline2 = 0.1;
- setProperty("_root.stat_car2health.bar2", _width, getProperty("_root.stat_car2health.bar2", _width) + 6.725);
- stat_car2health -= 5;
- tellTarget("_root.car2sounds")
- {
- gotoAndStop("crash1");
- play();
- }
- }
- else if(625 < Number(carx2))
- {
- setProperty("/car2", _X, 624);
- setProperty("/carspeed2", _X, 624);
- hairline2 = 0.1;
- setProperty("_root.stat_car2health.bar2", _width, getProperty("_root.stat_car2health.bar2", _width) + 6.725);
- stat_car2health -= 5;
- tellTarget("_root.car2sounds")
- {
- gotoAndStop("crash1");
- play();
- }
- }
- if(570 < carx2 and carx2 < 600 and cary2 < 50)
- {
- hairline2 = 0.1;
- setProperty("/car2", _Y, cary2 - ymov2);
- setProperty("/carspeed2", _Y, carx2 - xmov2);
- setProperty("_root.stat_car2health.bar2", _width, getProperty("_root.stat_car2health.bar2", _width) + 1.35);
- stat_car2health -= 1;
- tellTarget("_root.car2sounds")
- {
- gotoAndStop("crash1");
- play();
- }
- }
- if(125 < carx2 and carx2 < 488 and (145 < cary2 and cary2 < 165))
- {
- hairline2 = 0.1;
- setProperty("/car2", _Y, 144);
- setProperty("/carspeed2", _Y, 144);
- setProperty("_root.stat_car2health.bar2", _width, getProperty("_root.stat_car2health.bar2", _width) + 6.725);
- stat_car2health -= 5;
- tellTarget("_root.car2sounds")
- {
- gotoAndStop("crash1");
- play();
- }
- }
- if(125 < carx2 and carx2 < 488 and (170 < cary2 and cary2 < 205))
- {
- hairline2 = 0.1;
- setProperty("/car2", _Y, 206);
- setProperty("/carspeed2", _Y, 206);
- setProperty("_root.stat_car2health.bar2", _width, getProperty("_root.stat_car2health.bar2", _width) + 6.725);
- stat_car2health -= 5;
- tellTarget("_root.car2sounds")
- {
- gotoAndStop("crash1");
- play();
- }
- }
- if(125 < carx2 and carx2 < 250 and (250 < cary2 and cary2 < 280))
- {
- hairline2 = 0.1;
- setProperty("/car2", _Y, 281);
- setProperty("/carspeed2", _Y, 281);
- setProperty("_root.stat_car2health.bar2", _width, getProperty("_root.stat_car2health.bar2", _width) + 6.725);
- stat_car2health -= 5;
- tellTarget("_root.car2sounds")
- {
- gotoAndStop("crash1");
- play();
- }
- }
- if(448 < carx2 and carx2 < 495 and (220 < cary2 and cary2 < 260))
- {
- hairline2 = 0.1;
- setProperty("/car2", _Y, 261);
- setProperty("/carspeed2", _Y, 261);
- setProperty("_root.stat_car2health.bar2", _width, getProperty("_root.stat_car2health.bar2", _width) + 6.725);
- stat_car2health -= 5;
- tellTarget("_root.car2sounds")
- {
- gotoAndStop("crash1");
- play();
- }
- }
- if(120 < carx2 and carx2 < 165 and (155 < cary2 and cary2 < 270))
- {
- hairline2 = 0.1;
- setProperty("/car2", _X, carx2 - xmov2 * 1.5);
- setProperty("/carspeed2", _X, carx2 - xmov2 * 1.5);
- setProperty("_root.stat_car2health.bar2", _width, getProperty("_root.stat_car2health.bar2", _width) + 6.725);
- stat_car2health -= 5;
- tellTarget("_root.car2sounds")
- {
- gotoAndStop("crash1");
- play();
- }
- }
- if(455 < carx2 and carx2 < 470 and (200 < cary2 and cary2 < 245))
- {
- hairline2 = 0.1;
- setProperty("/car2", _X, carx2 - xmov2 * 1.5);
- setProperty("/carspeed2", _X, carx2 - xmov2 * 1.5);
- setProperty("_root.stat_car2health.bar2", _width, getProperty("_root.stat_car2health.bar2", _width) + 6.725);
- stat_car2health -= 5;
- tellTarget("_root.car2sounds")
- {
- gotoAndStop("crash1");
- play();
- }
- }
- if(470 < carx2 and carx2 < 505 and (160 < cary2 and cary2 < 245))
- {
- hairline2 = 0.1;
- setProperty("/car2", _X, 506);
- setProperty("/carspeed2", _X, 506);
- setProperty("_root.stat_car2health.bar2", _width, getProperty("_root.stat_car2health.bar2", _width) + 6.725);
- stat_car2health -= 5;
- tellTarget("_root.car2sounds")
- {
- gotoAndStop("crash1");
- play();
- }
- }
- if(200 < carx2 and carx2 < 255 and (180 < cary2 and cary2 < 270))
- {
- hairline2 = 0.1;
- setProperty("/car2", _X, 256);
- setProperty("/carspeed2", _X, 256);
- setProperty("_root.stat_car2health.bar2", _width, getProperty("_root.stat_car2health.bar2", _width) + 6.725);
- stat_car2health -= 5;
- tellTarget("_root.car2sounds")
- {
- gotoAndStop("crash1");
- play();
- }
- }
- if(330 < carx2 and carx2 < 410 and 295 < cary2)
- {
- hairline2 = 0.1;
- if(carx2 < 375)
- {
- setProperty("/car2", _X, carx2 - xmov2 * 1.5);
- setProperty("/carspeed2", _X, carx2 - xmov2 * 1.5);
- setProperty("/car2", _Y, cary2 - ymov2 * 1.5);
- setProperty("/carspeed2", _Y, cary2 - ymov2 * 1.5);
- }
- else if(375 < carx2)
- {
- setProperty("/car2", _X, carx2 + xmov2 * 1.5);
- setProperty("/carspeed2", _X, carx2 + xmov2 * 1.5);
- setProperty("/car2", _Y, cary2 - ymov2 * 1.5);
- setProperty("/carspeed2", _Y, cary2 - ymov2 * 1.5);
- }
- else if(cary2 < 285)
- {
- setProperty("/car2", _Y, cary2 - ymov2 * 1.5);
- setProperty("/carspeed2", _Y, cary2 - ymov2 * 1.5);
- }
- setProperty("_root.stat_car2health.bar2", _width, getProperty("_root.stat_car2health.bar2", _width) + 6.725);
- stat_car2health -= 5;
- tellTarget("_root.car2sounds")
- {
- gotoAndStop("crash1");
- play();
- }
- }
- if(400 < carx2 and carx2 < 475 and 110 < cary2 and cary2 < 140)
- {
- if(vroom2 < 3)
- {
- tellTarget("_root.car2sounds")
- {
- gotoAndStop("vroom");
- }
- }
- vroom2 = 3;
- }
- else if(1 < vroom2)
- {
- vroom2 -= 0.1;
- if(carx2 < 140)
- {
- vroom2 -= 0.5;
- }
- }
- else
- {
- vroom2 = 1;
- }
- }
- if(compdead != 1)
- {
- loopvar = 0;
- while(loopvar < compspeed)
- {
- loopvar += 1;
- tellTarget("comp1path")
- {
- nextFrame();
- }
- }
- if(1 >= compspeed)
- {
- compspeed += 0.01;
- }
- }
- if(car1dead != 1 and compdead != 1)
- {
- comp1x = getProperty("comp1path.comp1", _X) + getProperty("comp1path", _X);
- comp1y = getProperty("comp1path/comp1", _Y) + getProperty("comp1path", _Y);
- car1comp1_diffx = comp1x - carx;
- car1comp1_diffy = comp1y - cary;
- if(Number(car1comp1_diffx) < 0)
- {
- car1comp1_diffx *= -1;
- }
- if(Number(car1comp1_diffy) < 0)
- {
- car1comp1_diffy *= -1;
- }
- car1comp1 = Number(car1comp1_diffx) + Number(car1comp1_diffy);
- if(Number(car1comp1) < 30)
- {
- if(car1comp1collision < 1)
- {
- hairline = 0.01;
- compspeed = 0;
- car1comp1collision = 2;
- tellTarget("_root.sounds")
- {
- gotoAndStop("crash2");
- play();
- }
- setProperty("_root.stat_car1health.bar2", _width, getProperty("_root.stat_car1health.bar2", _width) + 13.5);
- stat_car1health -= 10;
- stat_comphealth -= 10;
- }
- }
- else
- {
- car1comp1collision = 0;
- }
- }
- if(car2dead != 1 and compdead != 1)
- {
- comp1x = getProperty("comp1path.comp1", _X) + getProperty("comp1path", _X);
- comp1y = getProperty("comp1path/comp1", _Y) + getProperty("comp1path", _Y);
- car2comp1_diffx = comp1x - carx2;
- car2comp1_diffy = comp1y - cary2;
- if(Number(car2comp1_diffx) < 0)
- {
- car2comp1_diffx *= -1;
- }
- if(Number(car2comp1_diffy) < 0)
- {
- car2comp1_diffy *= -1;
- }
- car2comp1 = Number(car2comp1_diffx) + Number(car2comp1_diffy);
- if(Number(car2comp1) < 30)
- {
- if(car2comp1collision < 1)
- {
- hairline2 = 0.01;
- compspeed = 0;
- car2comp1collision = 2;
- tellTarget("_root.sounds")
- {
- gotoAndStop("crash2");
- play();
- }
- setProperty("_root.stat_car2health.bar2", _width, getProperty("_root.stat_car2health.bar2", _width) + 13.5);
- stat_car2health -= 10;
- stat_comphealth -= 10;
- }
- }
- else
- {
- car2comp1collision = 0;
- }
- }
- if(car1dead != 1 and car2dead != 1)
- {
- car2car1_diffx = carx - carx2;
- car2car1_diffy = cary - cary2;
- if(Number(car2car1_diffx) < 0)
- {
- car2car1_diffx *= -1;
- }
- if(Number(car2car1_diffy) < 0)
- {
- car2car1_diffy *= -1;
- }
- car2car1 = Number(car2car1_diffx) + Number(car2car1_diffy);
- if(Number(car2car1) < 30)
- {
- if(car2car1collision < 1)
- {
- hairline2 = 0.01;
- hairline = 0.01;
- car2car1collision = 2;
- tellTarget("_root.sounds")
- {
- gotoAndStop("crash2");
- play();
- }
- setProperty("_root.stat_car1health.bar2", _width, getProperty("_root.stat_car1health.bar2", _width) + 13.5);
- stat_car1health -= 10;
- setProperty("_root.stat_car2health.bar2", _width, getProperty("_root.stat_car2health.bar2", _width) + 13.5);
- stat_car2health -= 10;
- }
- }
- else
- {
- car2car1collision = 0;
- }
- }
- if(damage == true)
- {
- if(0 >= stat_car1health and car1dead != 1)
- {
- car1dead = 1;
- tellTarget("_root.car")
- {
- gotoAndPlay(5);
- }
- stat_car1health = "";
- setProperty("_root.stat_car1health", _alpha, "25");
- setProperty("_root.stat_car1speed", _alpha, "25");
- }
- if(0 >= stat_car2health and car2dead != 1)
- {
- car2dead = 1;
- tellTarget("_root.car2")
- {
- gotoAndPlay(5);
- }
- stat_car2health = "";
- setProperty("_root.stat_car2health", _alpha, "25");
- setProperty("_root.stat_car2speed", _alpha, "25");
- }
- if(0 >= stat_comphealth and compdead != 1)
- {
- compdead = 1;
- tellTarget("_root.comp1path.comp1")
- {
- gotoAndPlay(5);
- }
- stat_comphealth = "";
- }
- }
- else
- {
- stat_car2health = 0;
- stat_car1health = 0;
- }
- if(car1lapcount == 1 and (carx < 150 and 185 < cary))
- {
- car1lapcount = 0;
- car1laps1 += 1;
- }
- if(500 < carx and cary < 200)
- {
- car1lapcount = 1;
- }
- if(car2lapcount == 1 and (carx2 < 150 and 185 < cary2))
- {
- car2lapcount = 0;
- car2laps1 += 1;
- }
- if(500 < carx2 and cary2 < 200)
- {
- car2lapcount = 1;
- }
- if(laps < car1laps1)
- {
- if(car1dead != 1)
- {
- car1position = position;
- position += 1;
- p1time = timer;
- car1dead = 1;
- setProperty("_root.car", _alpha, "40");
- }
- if(0 < hairline)
- {
- hairline -= 3;
- if(90 >= Number(car_rotate) and Number(car_rotate) >= Number(-90))
- {
- setProperty("/car", _Y, cary - ymov);
- setProperty("/carspeed", _Y, carspeedy - ymov);
- }
- else
- {
- setProperty("/car", _Y, Number(cary) + Number(ymov));
- setProperty("/carspeed", _Y, Number(carspeedy) + Number(ymov));
- }
- if(Number(car_rotate) < 0)
- {
- setProperty("/car", _X, carx - xmov);
- setProperty("/carspeed", _X, carspeedx - xmov);
- }
- else
- {
- setProperty("/car", _X, Number(carx) + Number(xmov));
- setProperty("/carspeed", _X, Number(carspeedx) + Number(xmov));
- }
- }
- else
- {
- hairline = 0;
- }
- }
- if(laps < car2laps1)
- {
- if(car2dead != 1)
- {
- car2position = position;
- position += 1;
- p2time = timer;
- car2dead = 1;
- setProperty("_root.car2", _alpha, "40");
- }
- if(0 < hairline2)
- {
- hairline2 -= 3;
- if(90 >= Number(car_rotate2) and Number(car_rotate2) >= Number(-90))
- {
- setProperty("/car2", _Y, cary2 - ymov2);
- setProperty("/carspeed2", _Y, carspeedy2 - ymov2);
- }
- else
- {
- setProperty("/car2", _Y, Number(cary2) + Number(ymov2));
- setProperty("/carspeed2", _Y, Number(carspeedy2) + Number(ymov2));
- }
- if(Number(car_rotate2) < 0)
- {
- setProperty("/car2", _X, carx2 - xmov2);
- setProperty("/carspeed2", _X, carspeedx2 - xmov2);
- }
- else
- {
- setProperty("/car2", _X, Number(carx2) + Number(xmov2));
- setProperty("/carspeed2", _X, Number(carspeedx2) + Number(xmov2));
- }
- }
- else
- {
- hairline2 = 0;
- }
- }
- if(laps < comp1laps1)
- {
- if(compdead != 1)
- {
- compposition = position;
- position += 1;
- comptime = timer;
- compdead = 1;
- setProperty("_root.comp1path", _alpha, "40");
- }
- if(0 < comspeed)
- {
- compspeed -= 0.1;
- }
- else
- {
- compspeed = 0;
- }
- }
- if(car1laps1 == laps or car2laps1 == laps or comp1laps1 == laps)
- {
- setProperty("_root.checkflag", _visible, true);
- }
- if(car1dead == 1 and car2dead == 1 and compdead == 1)
- {
- if(laps < car1laps1)
- {
- car1laps1 = laps;
- }
- else
- {
- p1time = "dnf";
- car1position = 5;
- }
- if(laps < car2laps1)
- {
- car2laps1 = laps;
- }
- else
- {
- p2time = "dnf";
- car2position = 5;
- }
- if(laps < comp1laps1)
- {
- comp1laps1 = laps;
- }
- else
- {
- comptime = "dnf";
- compposition = 5;
- }
- gotoAndPlay(262);
- }
-