home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Corrida / ArcadeCAR.swf / scripts / DefineSprite_248 / frame_1 / DoAction.as
Encoding:
Text File  |  2001-07-07  |  1.5 KB  |  83 lines

  1. if(_root.robot.hitTest(_root.fire))
  2. {
  3.    tellTarget("/:power")
  4.    {
  5.       nextFrame();
  6.    }
  7. }
  8. if(_root.robot.hitTest(_root.car))
  9. {
  10.    tellTarget("/:carpower")
  11.    {
  12.       nextFrame();
  13.    }
  14. }
  15. if(_root.car.hitTest(_root.fire2))
  16. {
  17.    tellTarget("/:carpower")
  18.    {
  19.       nextFrame();
  20.    }
  21. }
  22. if(_root.roket.hitTest(_root.fire))
  23. {
  24.    tellTarget("/:roket")
  25.    {
  26.       gotoAndPlay(20);
  27.    }
  28. }
  29. if(_root.yer.hitTest(_root.car))
  30. {
  31.    tellTarget("/:carpower")
  32.    {
  33.       nextFrame();
  34.    }
  35. }
  36. if(_root.car.hitTest(_root.roket))
  37. {
  38.    tellTarget("/:carpower")
  39.    {
  40.       nextFrame();
  41.       nextFrame();
  42.       nextFrame();
  43.       nextFrame();
  44.       nextFrame();
  45.    }
  46.    tellTarget("/:roket")
  47.    {
  48.       gotoAndStop(15);
  49.    }
  50.    tellTarget("/:car")
  51.    {
  52.       play();
  53.    }
  54. }
  55. robox = getProperty("/:robot", _X);
  56. roboy = getProperty("/:robot", _Y);
  57. roborot = getProperty("/:robot", _rotation);
  58. setProperty("/:fire2", _X, robox);
  59. setProperty("/:fire2", _Y, roboy);
  60. setProperty("/:fire2", _rotation, roborot);
  61. carx = getProperty("/:car", _X);
  62. roketx = getProperty("/:roket", _X);
  63. aralikx = carx - roketx;
  64. incx = aralikx / 8;
  65. if(Number(incx) < 0)
  66. {
  67.    incx = - incx;
  68. }
  69. if(Number(-8) < Number(aralikx) and Number(aralikx) < 8)
  70. {
  71.    set("/:lock","MISSILE IS LOCK");
  72. }
  73. else if(Number(aralikx) < 0)
  74. {
  75.    setProperty("/:roket", _X, roketx - 1 - incx);
  76.    set("/:lock","Danger");
  77. }
  78. else
  79. {
  80.    setProperty("/:roket", _X, Number(Number(roketx) + 1) + Number(incx));
  81.    set("/:lock","Danger");
  82. }
  83.