home *** CD-ROM | disk | FTP | other *** search
/ 404 Jogos / CLJG.iso / Diversos / PrettyBang.swf / scripts / DefineSprite_122 / frame_5 / DoAction.as
Encoding:
Text File  |  2007-09-27  |  1.0 KB  |  35 lines

  1. var active = 1;
  2. if(Math.abs(this._x) > _parent.frame._width / 2)
  3. {
  4.    active = 0;
  5. }
  6. if(Math.abs(this._y) > _parent.frame._height / 2)
  7. {
  8.    active = 0;
  9. }
  10. if(this._visible != active)
  11. {
  12.    this._visible = active;
  13. }
  14. if(active)
  15. {
  16.    this._x = (_root.absloc(target).x - _parent._x) * 100 / _parent._xscale;
  17.    this._y = (_root.absloc(target).y - _parent._y) * 100 / _parent._yscale;
  18.    if(_parent.cur_balls < _parent.max_balls / 2)
  19.    {
  20.       if(!gun_delay)
  21.       {
  22.          _parent.new_ball(this._x,this._y,this._rotation + 180,_parent.max_speed / 2,2);
  23.          _parent.new_ball(this._x,this._y,this._rotation + 135,_parent.max_speed / 2,2);
  24.          _parent.new_ball(this._x,this._y,this._rotation - 135,_parent.max_speed / 2,2);
  25.          _parent.new_ball(this._x,this._y,this._rotation + 90,_parent.max_speed / 2,2);
  26.          _parent.new_ball(this._x,this._y,this._rotation - 90,_parent.max_speed / 2,2);
  27.          _root.shot_sfx.start();
  28.       }
  29.    }
  30. }
  31. gun_delay++;
  32. gun_delay %= 8;
  33. prevFrame();
  34. play();
  35.