home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Acao / boxe1.swf / scripts / DefineSprite_794 / frame_1 / DoAction.as
Encoding:
Text File  |  2006-06-13  |  1.6 KB  |  57 lines

  1. if("0" < eval("/:p2b"))
  2. {
  3.    radius1 = getProperty("/hit2", _width) / "2";
  4.    radius2 = getProperty("/block1", _width) / "2";
  5.    obj1_x = getProperty("/hit2", _X);
  6.    obj2_x = getProperty("/block1", _X);
  7.    delta_x = obj1_x - obj2_x;
  8.    obj1_y = getProperty("/hit2", _Y);
  9.    obj2_y = getProperty("/block1", _Y);
  10.    delta_y = obj1_y - obj2_y;
  11.    if((radius1 + radius2) * (radius1 + radius2) >= delta_x * delta_x + delta_y * delta_y)
  12.    {
  13.       setProperty("/hit2", _Y, "0");
  14.       if("0" < eval("/:supercount"))
  15.       {
  16.          set("/:supercount",eval("/:supercount") - "1");
  17.       }
  18.       if(eval("/:epunch") == "0")
  19.       {
  20.          tellTarget("/p")
  21.          {
  22.             gotoAndStop("hit4");
  23.             play();
  24.          }
  25.          set("/:p1b",eval("/:p1b") - (random("5") + "6"));
  26.          set("/:pl2",eval("/:pl2") + "1");
  27.          setProperty("/ouch", _visible, "1");
  28.       }
  29.       if(eval("/:epunch") == "1")
  30.       {
  31.          tellTarget("/p")
  32.          {
  33.             gotoAndStop("hitl");
  34.             play();
  35.          }
  36.          set("/:p1b",eval("/:p1b") - (random("5") + "2"));
  37.          set("/:pl2",eval("/:pl2") + "1");
  38.          setProperty("/ouch", _visible, "1");
  39.       }
  40.       if(eval("/:epunch") == "2")
  41.       {
  42.          tellTarget("/p")
  43.          {
  44.             gotoAndStop("hitr");
  45.             play();
  46.          }
  47.          set("/:p1b",eval("/:p1b") - (random("5") + "3"));
  48.          set("/:pl2",eval("/:pl2") + "1");
  49.          setProperty("/ouch", _visible, "1");
  50.       }
  51.    }
  52.    else
  53.    {
  54.       setProperty("/ouch", _visible, "0");
  55.    }
  56. }
  57.