Ejemplo n.º 1
0
        public static UFOState GetState(State state)
        {
            UFOMan pUFOMan = UFOMan.PrivInstance();

            Debug.Assert(pUFOMan != null);

            UFOState pUFOState = null;

            switch (state)
            {
            case UFOMan.State.Ready:
                pUFOState = pUFOMan.pStateReady;
                break;

            case UFOMan.State.Flying:
                pUFOState = pUFOMan.pStateFlying;
                break;

            case UFOMan.State.End:
                pUFOState = pUFOMan.pStateEnd;
                break;

            case UFOMan.State.Dropping:
                pUFOState = pUFOMan.pStateDropping;
                break;

            default:
                Debug.Assert(false);
                break;
            }

            return(pUFOState);
        }
Ejemplo n.º 2
0
        public static Bomb ActivateBomb(UFOCategory pUFO)
        {
            UFOMan pUFOMan = UFOMan.PrivInstance();

            Debug.Assert(pUFOMan != null);

            Bomb pBombObj = new Bomb(GameObject.Name.Bomb, GameSprite.Name.BombFork, new FallTuning(), pUFO.x, pUFO.y, pUFO);

            pUFOMan.pBomb = pBombObj;

            SpriteBatch pSB_Aliens = SpriteBatchMan.Find(SpriteBatch.Name.Aliens);
            SpriteBatch pSB_Box    = SpriteBatchMan.Find(SpriteBatch.Name.Boxes);

            pBombObj.ActivateCollisionSprite(pSB_Box);
            pBombObj.ActivateGameSprite(pSB_Aliens);

            // Attach the missile to the missile root
            GameObject pBombRoot = GameObjectMan.Find(GameObject.Name.BombRoot);

            Debug.Assert(pBombRoot != null);

            // Add to GameObject Tree - {update and collisions}
            pBombRoot.Add(pUFOMan.pBomb);

            return(pUFOMan.pBomb);
        }
Ejemplo n.º 3
0
        public static UFO GetUFO()
        {
            UFOMan pUFOMan = UFOMan.PrivInstance();

            Debug.Assert(pUFOMan != null);
            Debug.Assert(pUFOMan.pUFO != null);

            return(pUFOMan.pUFO);
        }
Ejemplo n.º 4
0
        private static UFO ActivateUFO(SndObserver pSnd)
        {
            UFOMan pUFOMan = UFOMan.PrivInstance();

            Debug.Assert(pUFOMan != null);

            UFO pUFO = new UFO(GameObject.Name.UFO, GameSprite.Name.UFO, 690, 650, pSnd);

            pUFOMan.pUFO = pUFO;

            SpriteBatch pSB_Aliens = SpriteBatchMan.Find(SpriteBatch.Name.Aliens);
            SpriteBatch pSB_Boxes  = SpriteBatchMan.Find(SpriteBatch.Name.Boxes);

            pUFO.ActivateCollisionSprite(pSB_Boxes);
            pUFO.ActivateGameSprite(pSB_Aliens);

            GameObject pUFORoot = GameObjectMan.Find(GameObject.Name.UFORoot);

            Debug.Assert(pUFORoot != null);

            pUFORoot.Add(pUFOMan.pUFO);

            return(pUFOMan.pUFO);
        }