home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Corrida / Rally2100.swf / scripts / DefineSprite_187 / frame_1 / DoAction.as
Encoding:
Text File  |  2001-07-07  |  846 b   |  50 lines

  1. x1 = getProperty("/car1", _X);
  2. y1 = getProperty("/car1", _Y);
  3. x2 = getProperty("/1", _X);
  4. y2 = getProperty("/1", _Y);
  5. x3 = getProperty("/2", _X);
  6. y3 = getProperty("/2", _Y);
  7. if(x2 < x1)
  8. {
  9.    xDistance = x1 - x2;
  10. }
  11. else
  12. {
  13.    xDistance = x2 - x1;
  14. }
  15. if(y2 < y1)
  16. {
  17.    yDistance = y1 - y2;
  18. }
  19. else
  20. {
  21.    yDistance = y2 - y1;
  22. }
  23. if(eval("/:w1") / "2" + eval("/:w2") / "2" >= xDistance and eval("/:h1") / "2" + eval("/:h2") / "2" >= yDistance)
  24. {
  25.    tellTarget("/car1")
  26.    {
  27.       nextFrame();
  28.    }
  29. }
  30. if(x3 < x1)
  31. {
  32.    xDistance2 = x1 - x3;
  33. }
  34. else
  35. {
  36.    xDistance2 = x3 - x1;
  37. }
  38. if(y3 < y1)
  39. {
  40.    yDistance2 = y1 - y3;
  41. }
  42. else
  43. {
  44.    yDistance2 = y3 - y1;
  45. }
  46. if(eval("/:w1") / "3" + eval("/:w3") / "3" >= xDistance2 and eval("/:h1") / "3" + eval("/:h3") / "3" >= yDistance2)
  47. {
  48.    set("../sc:score",score + "500");
  49. }
  50.