Ejemplo n.º 1
0
        public AsteroidManager(Level level, RocketCommanderGame game)
        {
            this.level = level;
            this.game = game;

            // Create all asteroids
            for (int z = minSector; z <= maxSector; ++z)
            {
                for (int x = minSector; x <= maxSector; ++x)
                {
                    int iz = z + middleSector;
                    int ix = x + middleSector;
                    this.asteroids[iz, ix] = new List<Asteroid>();
                    GenerateAsteroids(this.asteroids[iz, ix], x, z);
                }
            }

            // Create smaller asteroids
            for (int z = minSmallSector; z <= maxSmallSector; ++z)
            {
                for (int x = minSmallSector; x <= maxSmallSector; ++x)
                {
                    int iz = z + smallMiddleSector;
                    int ix = x + smallMiddleSector;
                    this.smallAsteroids[iz, ix] = new List<SmallAsteroid>();
                    GenerateSmallAsteroids(this.smallAsteroids[iz, ix], this.asteroids[iz + smallSectorAdd, ix + smallSectorAdd].Count, x, z);
                }
            }

            // Precalculate visible sector stuff
            for (int z = minSector; z <= maxSector; ++z)
            {
                for (int x = minSector; x <= maxSector; ++x)
                {
                    int iz = z + middleSector;
                    int ix = x + middleSector;

                    this.sectorVisibleInRange[iz, ix] = MathUtils.Sqrt(x * x + z * z) < middleSector + 0.25f;
                    this.sectorDirection[iz, ix] = new Vector3(x, 0, z).Normalize();
                }
            }

            UpdateSectors();
        }
Ejemplo n.º 2
0
 public RoamingRocketScene(RocketCommanderGame game)
 {
     this.camera = new RoamingCamera(game.mouse, game.keyboard, game);
     this.rocket = new Rocket(game.framework);
     this.game = game;
 }
Ejemplo n.º 3
0
 public HelpScreen(RocketCommanderGame game, Framework framework)
     : base(game, framework)
 {
 }
Ejemplo n.º 4
0
 public MainMenuScreen(RocketCommanderGame game, Framework framework)
     : base(game, framework)
 {
 }
Ejemplo n.º 5
0
 public Screen(RocketCommanderGame game, Framework framework)
 {
     this.game = game;
     this.framework = framework;
 }
Ejemplo n.º 6
0
 public MissionSelectionScreen(RocketCommanderGame game, Framework framework)
     : base(game, framework)
 {
 }
Ejemplo n.º 7
0
 public void RocketCommanderGame_Run_Test()
 {
     var game = new RocketCommanderGame(1024, 768);
     game.Run();
 }