示例#1
0
文件: Game1.cs 项目: Paddyd19/Test
 /// <summary>
 /// Allows the game to perform any initialization it needs to before starting to run.
 /// This is where it can query for any required services and load any non-graphic
 /// related content.  Calling base.Initialize will enumerate through any components
 /// and initialize them as well.
 /// </summary>
 protected override void Initialize()
 {
     // TODO: Add your initialization logic here
     for (int i = 0; i < theShips.Length; i++)
     {
         theShips[i] = new AIShip();
     }
     for (int i = 0; i < thePlanets.Length; i++)
     {
         thePlanets[i] = new Planet();
     }
     base.Initialize();
 }
示例#2
0
 /// <summary>
 /// Allows the game to perform any initialization it needs to before starting to run.
 /// This is where it can query for any required services and load any non-graphic
 /// related content.  Calling base.Initialize will enumerate through any components
 /// and initialize them as well.
 /// </summary>
 protected override void Initialize()
 {
     // TODO: Add your initialization logic here
     for (int i = 0; i < 5; i++)
     {
         theShips.Add( new AIShip());
         theShips[i].maxSpeed = 280;
     }
     for (int i = 0; i < 10; i++)
     {
         theShipsType2.Add(new AIShip());
         theShipsType2[i].health = 30;
     }
     for (int i = 0; i < thePlanets.Length; i++)
     {
         thePlanets[i] = new Planet();
     }
     for (int i = 0; i < 5; i++)
     {
         myBullets.Add(new Bullet());
     }
     for (int i = 0; i < 10; i++)
     {
         enemyBullets.Add(new Bullet());
     }
     base.Initialize();
 }