home *** CD-ROM | disk | FTP | other *** search
/ Champak 43 / Vol 43.iso / games / penguin.swf / scripts / __Packages / Class / Bullet_target.as < prev    next >
Encoding:
Text File  |  2007-06-26  |  1.5 KB  |  67 lines

  1. class Class.Bullet_target extends Class.Bullet
  2. {
  3.    var Vx;
  4.    var Vy;
  5.    var onEnterFrame;
  6.    var x;
  7.    var y;
  8.    var Vg;
  9.    function Bullet_target()
  10.    {
  11.       super();
  12.    }
  13.    function hitAway(_Vx, _Vy)
  14.    {
  15.       this._visible = true;
  16.       this.Vx = _Vx;
  17.       this.Vy = _Vy;
  18.       var _loc4_ = ExtMath.atan2D(this.Vy,this.Vx);
  19.       this._rotation = _loc4_;
  20.       var _loc3_ = _root.playControl.wind_lv;
  21.       var wind_Vx = _loc3_ * 5;
  22.       ┬º┬ºpush(this.gotoAndPlay("fly"));
  23.       if(isNaN(wind_Vx))
  24.       {
  25.          wind_Vx = 0;
  26.       }
  27.       var hight = 0;
  28.       this.onEnterFrame = function()
  29.       {
  30.          this.x += this.Vx;
  31.          if(wind_Vx != 0)
  32.          {
  33.             this.x += wind_Vx;
  34.          }
  35.          this.y += this.Vy;
  36.          if(this.Vy < 0)
  37.          {
  38.             hight -= this.Vy;
  39.             _root.UI_mc.setHight(int(hight * 25) / 100);
  40.          }
  41.          this.Vy += this.Vg;
  42.          _root.mc.make3D(this);
  43.          this.checkHit();
  44.          if(this.y >= _root.mc.role.y)
  45.          {
  46.             this.y = _root.mc.role.y;
  47.             delete this.onEnterFrame;
  48.             this.stick();
  49.          }
  50.       };
  51.    }
  52.    function checkHit()
  53.    {
  54.    }
  55.    function hit()
  56.    {
  57.    }
  58.    function moveStop()
  59.    {
  60.       _root.mc.addObj("bulletStick",this.x,this.y + 20,3 + int(Math.random() * 3));
  61.       this._visible = false;
  62.       this.gotoAndStop(1);
  63.       _root.playControl.onShootEnd();
  64.       _root.soundStart("hit2_snd");
  65.    }
  66. }
  67.