home *** CD-ROM | disk | FTP | other *** search
/ 404 Jogos / CLJG.iso / Diversos / dragon.swf / scripts / DefineSprite_308_proj_enemy_fire / frame_1 / DoAction.as
Encoding:
Text File  |  2008-09-12  |  1.0 KB  |  48 lines

  1. function step()
  2. {
  3.    _X = _X + vx;
  4.    _Y = _Y + vy;
  5.    if(boundaryTimer-- < 0)
  6.    {
  7.       boundaryTimer = 50;
  8.       if(_X < xmin || _X > xmax || _Y < ymin || _Y > ymax)
  9.       {
  10.          this.unloadMovie();
  11.       }
  12.    }
  13.    if(flameDebrisTimer-- < 0)
  14.    {
  15.       flameDebrisTimer = 3;
  16.       var _loc3_ = _parent._parent.addObj("smoke_1",_parent._parent.debris_layer,_parent._parent.getNextDebrisLevel());
  17.       _loc3_._x = _X;
  18.       _loc3_._y = _Y;
  19.       _loc3_._rotation = _rotation;
  20.       _loc3_._xscale = _loc3_._yscale = 50;
  21.    }
  22.    _parent._parent.testHitDragon(this);
  23. }
  24. function destroy()
  25. {
  26.    this.unloadMovie();
  27. }
  28. m_type = "fire";
  29. xmax = _parent._parent.g_width + 50;
  30. xmin = -50;
  31. ymin = -50;
  32. ymax = _parent._parent.g_ground + 50;
  33. radians = Math.atan(vy / vx);
  34. if(vx > 0)
  35. {
  36.    _rotation = radians * 180 / 3.14159;
  37. }
  38. else
  39. {
  40.    _rotation = radians * 180 / 3.14159 + 180;
  41. }
  42. if(vx < 0.00001 && vx > -0.00001)
  43. {
  44.    _rotation = _rotation + 180;
  45. }
  46. var flameDebrisTimer = 0;
  47. boundaryTimer = 50;
  48.