private Ship playerShip; // Move player and/or enemy ships to a controlling class? #endregion Fields #region Constructors public SpaceManager() { curLevel = null; playerShip = new Ship(); enemyShips = new List<Ship>(); }
public void SetupNewLevel(ContentManager cm, ScreenInfo screenInfo) { if (playerShip == null) playerShip = new Ship(); playerShip.Load(cm, "Art\\Vehicles\\SampleShip", true); Vector2 newShipPos = screenInfo.curScreenCenter; // Go from the center of the screen to the ship position, top left of it. newShipPos.X -= playerShip.GetSize().X / 2; newShipPos.Y -= playerShip.GetSize().Y / 2; playerShip.Reset(newShipPos); camera.StartFollow(playerShip); // Load enemies Ship tempShip = new Ship(); tempShip.Load(cm, "Art\\Vehicles\\2dAlienUfo", false); tempShip.SetPosition(new Vector2(3000, 2500)); enemyShips.Add(tempShip); /* tempShip = new Ship(); tempShip.Load(Content, "Art\\Vehicles\\2dAlienUfo", false); tempShip.SetPosition(new Vector2(3050, 2200)); enemyShips.Add(tempShip); */ #if DEBUG //playerShip.DebugSetup(new Vector2(2890.771f, 2477.647f), new Vector2(0.8470135f, -0.5315714f), Vector2.Zero, -5.27282f, 0.002f); #endif }