home *** CD-ROM | disk | FTP | other *** search
/ 404 Jogos / CLJG.iso / Acao / Titans / robin.swf / scripts / DefineSprite_353 / frame_1 / DoAction.as
Encoding:
Text File  |  2006-01-05  |  990 b   |  68 lines

  1. space = 10;
  2. div = 1.01;
  3. divmax = 1.4;
  4. s.gotoAndStop("run");
  5. r.hit = 0;
  6. r.jump = 0;
  7. r.oldy = s._y;
  8. delete onmouseup;
  9. onenterframe = function()
  10. {
  11.    nx = r._xmouse;
  12.    ny = r._ymouse;
  13.    ceklimits();
  14.    dx = nx - s._x;
  15.    if(dx < - space)
  16.    {
  17.       r.hd = 1;
  18.    }
  19.    else if(dx > space)
  20.    {
  21.       r.hd = 2;
  22.    }
  23.    else
  24.    {
  25.       r.hd = 0;
  26.    }
  27.    if(div < divmax)
  28.    {
  29.       div += 0.01;
  30.    }
  31.    r.oldx = s._x;
  32.    r.oldy = s._y;
  33.    s._x = nx + (s._x - nx) / div;
  34.    s._y = ny + (s._y - ny) / div;
  35.    r.sx1 = s._x - 40;
  36.    r.sx2 = s._x + 20;
  37.    if(r.hit > 0)
  38.    {
  39.       if(!r.inv)
  40.       {
  41.          gotoAndPlay(12);
  42.       }
  43.       else
  44.       {
  45.          r.hit = 0;
  46.       }
  47.    }
  48.    if(r.jump and !r.inv)
  49.    {
  50.       gotoAndPlay(5);
  51.    }
  52.    if(r.finish)
  53.    {
  54.       gotoAndPlay(17);
  55.    }
  56. };
  57. onmousedown = function()
  58. {
  59.    r.autofire = 1;
  60.    r.noshot = 0;
  61. };
  62. onmouseup = function()
  63. {
  64.    r.autofire = 0;
  65.    r.noshot = 1;
  66. };
  67. stop();
  68.