public override void VisitAlien(AlienGO a) { // Alien vs Wall-Bottom CollPair pColPair = CollPairManager.GetActiveCollPair(); pColPair.SetCollision(a, this); pColPair.NotifyListeners(); }
public override void VisitAlien(AlienGO a) { // Alien vs Shield-Brick Debug.WriteLine(" ---> GAAAAAHHHHHHHHH!!!!!!!!"); CollPair pColPair = CollPairManager.GetActiveCollPair(); pColPair.SetCollision(a, this); pColPair.NotifyListeners(); }
//---------------------------------------------------------------------------------- // Methods //---------------------------------------------------------------------------------- public GameObject Create(GameObject.Name theName, AlienCategory.Type type, float posx = 0.0f, float posy = 0.0f) { GameObject pGameObj = null; switch (type) { case AlienCategory.Type.AlienGrid: pGameObj = new AlienGrid(theName, GameSprite.Name.NullObject, posx, posy); ((AlienGrid)pGameObj).SetCanDropBombs(true); break; case AlienCategory.Type.Column: pGameObj = new AlienColumn(theName, GameSprite.Name.NullObject, posx, posy); break; case AlienCategory.Type.Alien: pGameObj = new AlienGO(theName, GameSprite.Name.Alien, 20, posx, posy); break; case AlienCategory.Type.Octopus: pGameObj = new AlienGO(theName, GameSprite.Name.Octopus, 10, posx, posy); break; case AlienCategory.Type.Squid: pGameObj = new AlienGO(theName, GameSprite.Name.Squid, 30, posx, posy); break; case AlienCategory.Type.UFOGrid: pGameObj = new AlienGrid(theName, GameSprite.Name.NullObject, posx, posy); ((AlienGrid)pGameObj).SetCanDropBombs(false); break; case AlienCategory.Type.Saucer: pGameObj = new AlienGO(theName, GameSprite.Name.Saucer, 100, posx, posy); break; default: Debug.WriteLine("Choose the Space Invader you want by name."); Debug.Assert(false); break; } // add it to the Game Object Manager Debug.Assert(pGameObj != null); // Should only attach root elements in the Scene // attach to the group pGameObj.ActivateGameSprite(this.pSpriteBatch); pGameObj.ActivateCollisionSprite(this.pCollisionSpriteBatch); return(pGameObj); }
//---------------------------------------------------------------------------------- // 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); } }
public override void VisitAlien(AlienGO a) { // Alien vs ShieldRoot CollPair.Collide(a, (GameObject)Iterator.GetChild(this)); }
public virtual void VisitAlien(AlienGO a) { // no differed to subcass Debug.WriteLine("Visit by Alien Game Object not implemented"); Debug.Assert(false); }