Пример #1
0
        public override void VisitAlienColumn(AliensColumn c)
        {
            // AliensCol vs MissileGroup
            Debug.WriteLine("         collide:  {0} <-> {1}", c.GetName(), this.GetName());

            // Missile vs AliensCol
            ColPair.Collide((GameObject)this.GetFirstChild(), (GameObject)this.GetFirstChild());
        }
Пример #2
0
        public GameObject Create(GameObject.Name name, AlienCategory.Type type, float posX = 0.0f, float posY = 0.0f)
        {
            GameObject pGameObj = null;

            switch (type)
            {
            case AlienCategory.Type.Squid:
                pGameObj = new Alien(GameSprite.Name.Sprite_Squid, name, posX, posY);
                break;

            case AlienCategory.Type.Crab:
                pGameObj = new Alien(GameSprite.Name.Sprite_Crab, name, posX, posY);
                break;

            case AlienCategory.Type.Octopus:
                pGameObj = new Alien(GameSprite.Name.Sprite_Octopus, name, posX, posY);
                break;

            case AlienCategory.Type.Grid:
                pGameObj = new AliensGrid(name);
                break;

            case AlienCategory.Type.Column:
                pGameObj = new AliensColumn(name);

                break;

            default:
                // something is wrong
                Debug.Assert(false);
                break;
            }

            // add it to the gameObjectManager
            Debug.Assert(pGameObj != null);
            // GameObjectMan.Attach(pGameObj);

            // Attached to Group
            pGameObj.ActivateGameSprite(this.pSpriteBatch);
            pGameObj.ActivateCollisionSprite(pBoxBatch);

            return(pGameObj);
        }
Пример #3
0
 public virtual void VisitAlienColumn(AliensColumn c)
 {
     // no differed to subcass
     Debug.WriteLine("Visit by Aliens not implemented");
     Debug.Assert(false);
 }