home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Acao / kung_fu.swf / scripts / __Packages / com / KidFighting / objects / CItem.as < prev    next >
Encoding:
Text File  |  2006-06-13  |  1.1 KB  |  52 lines

  1. class com.KidFighting.objects.CItem extends MovieClip
  2. {
  3.    var area;
  4.    var _twnF;
  5.    var name;
  6.    var breakable = true;
  7.    function CItem()
  8.    {
  9.       super();
  10.       if(this.area != undefined)
  11.       {
  12.          this.hitArea = this.area;
  13.       }
  14.       this.reset();
  15.       this.hide();
  16.    }
  17.    function movBreak()
  18.    {
  19.       if(this.breakable)
  20.       {
  21.          this.breakable = false;
  22.          this._twnF = new ds.transitions.Tween(this,"_currentframe",null,1,this._totalframes,this._totalframes);
  23.          ds.controls.SoundPlayer.playSound("Crashing_" + this.name);
  24.       }
  25.    }
  26.    function reset()
  27.    {
  28.       this.breakable = true;
  29.       this.gotoAndStop(1);
  30.    }
  31.    function fightActivated(evtObj)
  32.    {
  33.       if(this._visible && this.breakable)
  34.       {
  35.          var _loc2_ = evtObj.activer.opponent;
  36.          if(this.hitTest(_loc2_.ani) && (_loc2_.status == "hurt" || _loc2_.status == "thrown" || _loc2_.status == "lose"))
  37.          {
  38.             this.movBreak();
  39.          }
  40.       }
  41.    }
  42.    function show()
  43.    {
  44.       this.reset();
  45.       this._visible = true;
  46.    }
  47.    function hide()
  48.    {
  49.       this._visible = false;
  50.    }
  51. }
  52.