home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Acao / batman_cobble.swf / scripts / frame_16 / DoAction_19.as < prev    next >
Encoding:
Text File  |  2006-06-13  |  1014 b   |  40 lines

  1. _global.clockTimer = function()
  2. {
  3.    if(!this.startTimer && _root.playerState != "die")
  4.    {
  5.       this.startTimer = getTimer();
  6.       this.lastTimer = getTimer();
  7.       this.secs = 80;
  8.       this.millisecs = 99;
  9.    }
  10.    if(this.secs > 0)
  11.    {
  12.       this.curTimer = getTimer();
  13.       if(this.curTimer - this.lastTimer > 1000)
  14.       {
  15.          this.lastTimer = this.curTimer;
  16.          this.secs = this.secs - 1;
  17.       }
  18.       this.millisecs = this.curTimer % 100;
  19.       if(this.secs > 9)
  20.       {
  21.          this.display.text = [this.secs + " :" + this.millisecs];
  22.       }
  23.       else
  24.       {
  25.          this.display.text = ["0" + this.secs + " :" + this.millisecs];
  26.       }
  27.    }
  28.    else if(!this.exploded)
  29.    {
  30.       this.exploded = true;
  31.       this.display.text = "00 :00";
  32.       _root.playerHealth = 0;
  33.       _root.playerState = "die";
  34.       _root.explode.start();
  35.       _root.game.halo.gotoAndPlay("fire");
  36.       this.startTimer = false;
  37.       delete this.onEnterFrame;
  38.    }
  39. };
  40.