コード例 #1
0
ファイル: ShipMan.cs プロジェクト: Carsonq/SpaceInvaders
        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
ファイル: UFO.cs プロジェクト: Carsonq/SpaceInvaders
 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
ファイル: Ship.cs プロジェクト: Carsonq/SpaceInvaders
        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
ファイル: UFOMan.cs プロジェクト: Carsonq/SpaceInvaders
        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
ファイル: ShipMan.cs プロジェクト: Carsonq/SpaceInvaders
        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
ファイル: UFOMan.cs プロジェクト: Carsonq/SpaceInvaders
        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
ファイル: ShipRoot.cs プロジェクト: Carsonq/SpaceInvaders
 public void SetShootSound(SndObserver pSnd)
 {
 }
コード例 #11
0
 public void SetSnd(SndObserver newSnd)
 {
     this.pSn = newSnd;
 }