home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Classicos / smashout.swf / scripts / __Packages / Game / Objects / GetReady.as < prev    next >
Encoding:
Text File  |  2005-11-09  |  1.3 KB  |  65 lines

  1. class Game.Objects.GetReady extends Engine.PongObject
  2. {
  3.    var target;
  4.    var __currentTime;
  5.    var assetID = "GetReady";
  6.    var __stageTime = 2;
  7.    var active = false;
  8.    function GetReady(myTime)
  9.    {
  10.       super();
  11.       if(myTime)
  12.       {
  13.          this.__stageTime = myTime;
  14.       }
  15.    }
  16.    function show()
  17.    {
  18.       if(this.target._currentframe < 2)
  19.       {
  20.          this.__currentTime = 0;
  21.          this.getUpdates();
  22.          this.target._visible = true;
  23.          this.target._xscale = this.target._yscale = 100;
  24.          this.target.gotoAndPlay(2);
  25.          this.moveTo(0,0,0);
  26.       }
  27.       this.active = true;
  28.    }
  29.    function hide()
  30.    {
  31.       if(this.target._currentframe > 1)
  32.       {
  33.          this.cancelUpdates();
  34.          this.target._visible = false;
  35.          this.target._xscale = this.target._yscale = 1;
  36.          this.target.gotoAndPlay(1);
  37.          this.moveTo(-100,-100,0);
  38.       }
  39.       this.active = false;
  40.    }
  41.    function onDisplay()
  42.    {
  43.    }
  44.    function onAddToScene()
  45.    {
  46.       if(this.active)
  47.       {
  48.          this.show();
  49.       }
  50.       else
  51.       {
  52.          this.hide();
  53.       }
  54.    }
  55.    function update(elapsed)
  56.    {
  57.       this.__currentTime += elapsed;
  58.       if(this.__currentTime < this.__stageTime)
  59.       {
  60.          return undefined;
  61.       }
  62.       this.hide();
  63.    }
  64. }
  65.