public static List<ship> PopulateSectorShips(Sector Sec,ContentManager Manager) { List<ship> Generatedships = new List<ship>(); Random random = new Random(); // int hostile = random.Next(Sec.Difficulty - 4, Sec.Difficulty + 4); int hostile = 2; int neutral = hostile * 2; for (int I = 0; I < hostile; I++) { Generatedships.Add(new ship(Sec)); Generatedships[I].Allegiance = "HOSTILE"; Generatedships[I].loadcontent(Manager, ShipContent[random.Next(0, ShipContent.Count)]); Generatedships[I].PhysInit(); Generatedships[I].move(new Vector2(random.Next(1600), random.Next(900))); } for (int I = 0; I < neutral; I++) { Generatedships.Add(new ship(Sec)); Generatedships[I + hostile].Allegiance = "NEUTRAL"; Generatedships[I + hostile].loadcontent(Manager, ShipContent[random.Next(0, ShipContent.Count)]); Generatedships[I + hostile].PhysInit(); Generatedships[I + hostile].move(new Vector2(random.Next(11200), random.Next(6300))); } return(Generatedships); }
public static Sector[,] GenerateSectors(ContentManager Manager) { Sector[,] SecArray = new Sector[5, 5]; for(int I = 0;I < 5;I++) { for(int J =0;J < 5;J++) { SecArray[I,J] = new Sector(); FillSector(SecArray[I,J],Manager); SecArray[I, J].Disable(); } } return SecArray; }
public ship(Sector Sec) { Sec.DrawList.Add(this); SecPosition = Sec; }
public void Warp(WarpGate Gate) { this.SecPosition = Gate.EndSector; this.position = Gate.EndPosition; ObjectBody = BodyFactory.CreateCompoundPolygon(Gate.EndSector.SectorWorld,BodyData,1); Gate.EndSector.Enable(); }
public WarpGate(Sector Sec) : base(Sec) { }
public static void FillSector(Sector Sec,ContentManager Manager) { PopulateSectorShips(Sec,Manager); }
public Entity(Sector Sec) { Game1.Drawinglist.Add(this); this.SecPosition = Sec; }