home *** CD-ROM | disk | FTP | other *** search
- class Game.Objects.GetReady extends Engine.PongObject
- {
- var target;
- var __currentTime;
- var assetID = "GetReady";
- var __stageTime = 2;
- var active = false;
- function GetReady(myTime)
- {
- super();
- if(myTime)
- {
- this.__stageTime = myTime;
- }
- }
- function show()
- {
- if(this.target._currentframe < 2)
- {
- this.__currentTime = 0;
- this.getUpdates();
- this.target._visible = true;
- this.target._xscale = this.target._yscale = 100;
- this.target.gotoAndPlay(2);
- this.moveTo(0,0,0);
- }
- this.active = true;
- }
- function hide()
- {
- if(this.target._currentframe > 1)
- {
- this.cancelUpdates();
- this.target._visible = false;
- this.target._xscale = this.target._yscale = 1;
- this.target.gotoAndPlay(1);
- this.moveTo(-100,-100,0);
- }
- this.active = false;
- }
- function onDisplay()
- {
- }
- function onAddToScene()
- {
- if(this.active)
- {
- this.show();
- }
- else
- {
- this.hide();
- }
- }
- function update(elapsed)
- {
- this.__currentTime += elapsed;
- if(this.__currentTime < this.__stageTime)
- {
- return undefined;
- }
- this.hide();
- }
- }
-