public override void MoveLeft(Ship pShip) { if ((pShip.x - 0.5 * (pShip.GetColObject().poColRect.width)) > 65) { pShip.x -= pShip.shipSpeed; } }
private static Ship ActivateShip(SpriteBatchMan pSpriteBatchMan) { ShipMan pShipMan = ShipMan.PrivInstance(); Debug.Assert(pShipMan != null); // copy over safe copy Ship pShip = new Ship(GameObject.Name.Ship, GameSprite.Name.Ship, 150, 50); pShipMan.pShip = pShip; // Attach the sprite to the correct sprite batch SpriteBatch pSB_Aliens = pSpriteBatchMan.Find(SpriteBatch.Name.Aliens); pSB_Aliens.Attach(pShip.poProxySprite); SpriteBatch pSB_Box = pSpriteBatchMan.Find(SpriteBatch.Name.Boxes); pSB_Box.Attach(pShip.GetColObject().pColSprite); // 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 override void MoveRight(Ship pShip) { if ((pShip.x + 0.5 * (pShip.GetColObject().poColRect.width)) < 831) { pShip.x += pShip.shipSpeed; } }