예제 #1
0
        private static Ship ActivateShip(SndObserver pSnd)
        {
            ShipMan pShipMan = ShipMan.PrivInstance();

            Debug.Assert(pShipMan != null);

            // copy over safe copy
            Ship pShip = new Ship(GameObject.Name.Ship, GameSprite.Name.Ship, 300, 55, pSnd);

            pShipMan.pShip = pShip;

            // Attach the sprite to the correct sprite batch
            //SpriteBatch pSB_Aliens = SpriteBatchMan.Find(SpriteBatch.Name.Aliens);
            //pSB_Aliens.Attach(pShip.pProxySprite);

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

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

            // Attach the missile to the missile root
            GameObject pShipRoot = GameObjectMan.Find(GameObject.Name.ShipRoot);

            Debug.Assert(pShipRoot != null);

            // Add to GameObject Tree - {update and collisions}
            pShipRoot.Add(pShipMan.pShip);

            return(pShipMan.pShip);
        }
예제 #2
0
 public UFO(GameObject.Name gOName, GameSprite.Name gSeName, float x, float y, SndObserver pSndObs)
     : base(gOName, gSeName, UFOCategory.Type.UFO)
 {
     this.SetXY(x, y);
     this.pSnd  = pSndObs;
     this.state = new UFOStateEnd();
 }
예제 #3
0
 public PositionHoder(float x, float y, SndObserver pSn)
     : base()
 {
     this.x   = x;
     this.y   = y;
     this.pSn = pSn;
 }
예제 #4
0
        public override void Execute()
        {
            ((UFO)this.pUFO).StopSound();
            SndObserver down = new SndObserver(SceneStateGame.sndEngine, SndObserver.Name.UFOFlyLow);

            down.PlaySound();

            this.pUFO.Remove();
        }
예제 #5
0
        public void Attach(float x, float y, SndObserver pSn)
        {
            PositionHoder pPositionHoder = null;

            pPositionHoder = new PositionHoder(x, y, pSn);
            Debug.Assert(pPositionHoder != null);

            SLink.AddToFront(ref this.poHead, pPositionHoder);
            this.pCurr = pPositionHoder;
        }
예제 #6
0
        public Ship(GameObject.Name name, GameSprite.Name spriteName, float posX, float posY, SndObserver pSndObs)
            : base(name, spriteName, ShipCategory.Type.Ship)
        {
            this.x = posX;
            this.y = posY;

            this.shipSpeed = 3.0f;
            this.state     = null;
            this.moveState = null;
            this.pSnd      = pSndObs;
        }
예제 #7
0
        public static void Create(SndObserver pSnd)
        {
            // make sure its the first time
            // Debug.Assert(instance == null);

            // Do the initialization
            if (instance == null)
            {
                instance = new UFOMan();
            }

            Debug.Assert(instance != null);

            // Stuff to initialize after the instance was created
            instance.pUFO = ActivateUFO(pSnd);
            instance.pUFO.SetState(UFOMan.State.Ready);
        }
예제 #8
0
        public static void Create(SndObserver pSnd)
        {
            // make sure its the first time
            // Debug.Assert(instance == null);

            // Do the initialization
            if (instance == null)
            {
                instance = new ShipMan();
            }

            Debug.Assert(instance != null);

            // Stuff to initialize after the instance was created
            instance.pShip = ActivateShip(pSnd);
            instance.pShip.SetState(ShipMan.State.Ready);
            instance.pShip.SetMoveState(ShipMan.State.MoveBoth);
        }
예제 #9
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);
        }
예제 #10
0
 public void SetShootSound(SndObserver pSnd)
 {
 }
예제 #11
0
 public void SetSnd(SndObserver newSnd)
 {
     this.pSn = newSnd;
 }