home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Acao / year_of_the_snake.swf / scripts / __Packages / Effect.as < prev    next >
Encoding:
Text File  |  2007-03-20  |  849 b   |  32 lines

  1. class Effect extends Entity
  2. {
  3.    var entity;
  4.    var x;
  5.    var y;
  6.    var z;
  7.    var animationtick;
  8.    static var EFFECTINDEX = 0;
  9.    function Effect(target, entityname, startx, starty, startz, startsize, collides)
  10.    {
  11.       super(target,entityname + Effect.EFFECTINDEX,startx,starty,startz,startsize,collides);
  12.       Effect.EFFECTINDEX = Effect.EFFECTINDEX + 1;
  13.       this.entity.instance = this;
  14.       this.entity.gotoAndStop(entityname);
  15.    }
  16.    function update()
  17.    {
  18.       this.entity._x = this.x;
  19.       this.entity._y = GameStage.GROUND_LEVEL + this.y / 3 - this.z;
  20.       this.animationtick += GameStage.TIME_STEP;
  21.       if(this.animationtick >= 1)
  22.       {
  23.          this.animationtick -= 1;
  24.          this.entity.anims.nextFrame();
  25.       }
  26.    }
  27.    function remove()
  28.    {
  29.       this.entity.removeMovieClip();
  30.    }
  31. }
  32.