public static void Update() { for (DLinkedNode rootNode = _objectMan.GetActive().GetHead(); rootNode != null; rootNode = rootNode.Next) { GameObjectNode root = (GameObjectNode)rootNode; ReverseIterator rIt = new ReverseIterator(root.GameObj); Component first = rIt.First(); while (!rIt.IsDone()) { GameObject pGameObj = (GameObject)first; pGameObj.Update(); first = rIt.Next(); } root.Update(); } }
public override void Execute() { // Let the gameObject deal with this... //this.pAlien.Remove(); GameObject pA = (GameObject)this.pAlien; GameObject pB = (GameObject)Iterator.GetParent(pA); pA.Remove(); // TODO: Need a better way... if (privCheckParent(pB) == true) { GameObject pC = (GameObject)Iterator.GetParent(pB); pB.Remove(); if (privCheckParent(pC) == true) { //pC.Remove(); // Recreate Grid on last alien delete AlienGrid pGrid = (AlienGrid)pC; pGrid.GenerateAlien(GameObjectMan.GetActive()); pGrid.ResetSpeed(); this.scenePlay.AddLife(); } } // TODO: update score - may need a better way (maybe an observer) SceneContext sc = SceneContext.GetInstance(); sc.GetState().UpdateScore(this.pAlien.scoreValue); // TODO: Splat Alien - needs a better way this.pSplat = new Splat(GameObject.Name.Splat, GameSprite.Name.SplatAlien, pAlien.x, pAlien.y); pSplat.ActivateCollisionSprite(this.pSB_Boxes); pSplat.ActivateGameSprite(this.pSB_Aliens); GameObject pSplatbRoot = GameObjectMan.Find(GameObject.Name.SplatRoot); Debug.Assert(pSplatbRoot != null); pSplatbRoot.Add(pSplat); TimerMan.Add(TimeEvent.Name.SplatRemoveAlien, new SplatRemoveEvent(this.pSplat), 0.5f); }