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

  1. class Hjerterad
  2. {
  3.    var mc;
  4.    var liv = 3;
  5.    function Hjerterad(mc, skjerm_x, skjerm_y)
  6.    {
  7.       this.mc = mc;
  8.       this.mc._x = skjerm_x;
  9.       this.mc._y = skjerm_y;
  10.       this.settLiv(3);
  11.    }
  12.    function mistLiv()
  13.    {
  14.       this.liv -= 1;
  15.       if(this.liv < 1)
  16.       {
  17.          this.liv = 0;
  18.       }
  19.       this.mc.gotoAndStop(this.liv + 1);
  20.    }
  21.    function gameOver()
  22.    {
  23.       _root.nedelling.stoppNedtelling();
  24.       _root.helt.iLufta = false;
  25.       _root.helt.mc._alpha = 0;
  26.       _root.frys = true;
  27.       _root.fjernObjekt();
  28.       _root.poengtelling.mc._visible = false;
  29.       _root.nedtelling.mc._visible = false;
  30.       _root.sauetelling.mc._visible = false;
  31.       _root.vapenv.mc._visible = false;
  32.       this.mc._visible = false;
  33.       _root.gotoAndPlay("game_over");
  34.    }
  35.    function faaLiv()
  36.    {
  37.       this.liv += 1;
  38.       this.mc.gotoAndStop(this.liv + 1);
  39.    }
  40.    function settLiv(liv)
  41.    {
  42.       this.liv = liv;
  43.       this.mc.gotoAndStop(this.liv + 1);
  44.    }
  45. }
  46.