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

  1. speed = 0.7 * r.espeed;
  2. xs = speed;
  3. ys = 0;
  4. name = "bunny2";
  5. d = 30;
  6. if(_parent._name == "enemymap")
  7. {
  8.    initme();
  9. }
  10. else
  11. {
  12.    onenterframe = function()
  13.    {
  14.       d--;
  15.       if(d == 0)
  16.       {
  17.          dx = _X - s._x;
  18.          dy = _Y - s._y;
  19.          ang = math.atan2(dy,dx);
  20.          xs = speed * math.cos(ang);
  21.          ys = speed * math.sin(ang);
  22.          _rotation = deg(ang);
  23.       }
  24.       _X = _X + xs;
  25.       _Y = _Y + ys;
  26.       cekhit();
  27.       if(hit)
  28.       {
  29.          gotoAndPlay(5);
  30.       }
  31.       if(!r.inv)
  32.       {
  33.          if(s.hittest(_X,_Y,1))
  34.          {
  35.             r.hit = 1;
  36.             gotoAndPlay(5);
  37.          }
  38.       }
  39.       if(_X < -30)
  40.       {
  41.          this.removeMovieClip();
  42.       }
  43.    };
  44. }
  45. stop();
  46.