//---------------------------------------------------------------------------------- // Methods //---------------------------------------------------------------------------------- public override void Execute(float deltaTime) { this.pUfoGrid.SetDelta(1.0f); // Grab the UFO inside the Alien Grid AlienGO pUfo = ((AlienGO)this.pUfoGrid.GetFirstChild()); pUfo.SetCoords(100.0f, 870.0f); pUfo.Update(); Debug.WriteLine("UFO Appeared!!"); // Set in Motion this.pUfoGrid.bMarkForDeath = false; this.pUfoGrid.MoveGrid(); TimerManager.Add(TimeEvent.Name.MoveUFO, new MoveUFO(this.pUfoGrid), this.pUfoGrid.movementTimeInterval); }
//---------------------------------------------------------------------------------- // Methods //---------------------------------------------------------------------------------- public override void Execute(float deltaTime) { if (this.pUfoGrid.GetIsOnWall()) { // Teleport the UFO above the game AlienGO pUfo = ((AlienGO)this.pUfoGrid.GetFirstChild()); pUfo.SetCoords(100.0f, 1200.0f); pUfo.Update(); this.pUfoGrid.SetIsOnWall(false); Debug.WriteLine("... UFO Hidden"); // Stop Moving?? // Get a random float spawnAgain = (float)Appear.Next(25, 45); TimerManager.Add(TimeEvent.Name.SpawnUFO, new SpawnUFO(this.pUfoGrid), spawnAgain); } }