home *** CD-ROM | disk | FTP | other *** search
/ 404 Jogos / CLJG.iso / Diversos / dragon.swf / scripts / DefineSprite_256_proj_enemy_steel / frame_1 / DoAction.as
Encoding:
Text File  |  2008-09-12  |  862 b   |  37 lines

  1. function step()
  2. {
  3.    _X = _X + vx;
  4.    _Y = _Y + vy;
  5.    body._rotation += rate;
  6.    if(boundaryTimer-- < 0)
  7.    {
  8.       boundaryTimer = 50;
  9.       if(_X < xmin || _X > xmax || _Y < ymin || _Y > ymax)
  10.       {
  11.          destroy();
  12.       }
  13.    }
  14.    _parent._parent.testHitDragon(this);
  15. }
  16. function takeDamage(amt, xp, yp)
  17. {
  18.    _parent._parent.addScore(50,_X,_Y);
  19.    var _loc2_ = _parent._parent.addObj("explosion_pow",_parent._parent.debris_layer,_parent._parent.getNextDebrisLevel());
  20.    _loc2_._x = _X;
  21.    _loc2_._y = _Y;
  22.    _loc2_._rotation = random(360);
  23.    _loc2_._xscale = _loc2_._yscale = _xscale * 1.5;
  24.    destroy();
  25. }
  26. function destroy()
  27. {
  28.    _parent._parent.removeEnemy(this);
  29. }
  30. m_type = "steel";
  31. rate = 11;
  32. xmax = _parent._parent.g_width + 50;
  33. xmin = -50;
  34. ymin = -50;
  35. ymax = _parent._parent.g_ground + 50;
  36. boundaryTimer = 50;
  37.