home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Acao / david.swf / scripts / __Packages / Ildkule.as < prev    next >
Encoding:
Text File  |  2007-03-28  |  1022 b   |  41 lines

  1. class Ildkule extends Figur
  2. {
  3.    var mc;
  4.    var dybde;
  5.    var brett_x;
  6.    var skjerm_x;
  7.    var skjerm_y;
  8.    var brett_y;
  9.    function Ildkule(mc, brett_x, brett_y, bredde, hogde)
  10.    {
  11.       super(mc,brett_x,brett_y,bredde,hogde);
  12.       Figur.figurliste.push(this);
  13.       this.mc.swapDepths(2500 + Figur.figurliste.length);
  14.       this.dybde = this.mc.getDepth();
  15.       this.fart_x = -20;
  16.    }
  17.    function vedTreff()
  18.    {
  19.       if(this.aktiv)
  20.       {
  21.          this.bliUsynlig();
  22.          this.aktiv = false;
  23.          Figur.helt.krokknock();
  24.       }
  25.    }
  26.    function oppdaterSkjermposisjon()
  27.    {
  28.       if(this.aktiv)
  29.       {
  30.          this.brett_x += this.fart_x;
  31.          this.skjerm_x = this.brett_x + this.offset_x - Speleobjekt.brett.origo_x;
  32.          this.skjerm_y = this.brett_y + this.offset_y - Speleobjekt.brett.origo_y;
  33.          if(this.brett_x < 2600 || this.skjerm_x < -25)
  34.          {
  35.             this.aktiv = false;
  36.             this.bliUsynlig();
  37.          }
  38.       }
  39.    }
  40. }
  41.