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); }
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(); }
public PositionHoder(float x, float y, SndObserver pSn) : base() { this.x = x; this.y = y; this.pSn = pSn; }
public override void Execute() { ((UFO)this.pUFO).StopSound(); SndObserver down = new SndObserver(SceneStateGame.sndEngine, SndObserver.Name.UFOFlyLow); down.PlaySound(); this.pUFO.Remove(); }
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; }
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; }
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); }
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); }
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); }
public void SetShootSound(SndObserver pSnd) { }
public void SetSnd(SndObserver newSnd) { this.pSn = newSnd; }