示例#1
0
        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);
        }
示例#2
0
        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;
        }
示例#3
0
文件: ship.cs 项目: RcColes/Space
 public ship(Sector Sec)
 {
     Sec.DrawList.Add(this);
     SecPosition = Sec;
 }
示例#4
0
文件: ship.cs 项目: RcColes/Space
 public void Warp(WarpGate Gate)
 {
     this.SecPosition = Gate.EndSector;
     this.position = Gate.EndPosition;
     ObjectBody = BodyFactory.CreateCompoundPolygon(Gate.EndSector.SectorWorld,BodyData,1);
     Gate.EndSector.Enable();
 }
示例#5
0
文件: WarpGate.cs 项目: RcColes/Space
 public WarpGate(Sector Sec)
     : base(Sec)
 {
 }
示例#6
0
 public static void FillSector(Sector Sec,ContentManager Manager)
 {
     PopulateSectorShips(Sec,Manager);
 }
示例#7
0
文件: Entity.cs 项目: RcColes/Space
 public Entity(Sector Sec)
 {
     Game1.Drawinglist.Add(this);
     this.SecPosition = Sec;
 }