Beispiel #1
0
        private static GameLevel EmptyLevel()
        {
            int numObjects = System.Enum.GetNames(typeof(ObjectType)).Length;

            float[]     scrollSpeeds = new float[numObjects];
            SpawnTime[] spawnTimes   = new SpawnTime[numObjects];

            return(new GameLevel(scrollSpeeds, spawnTimes));
        }
Beispiel #2
0
        public static void InitLevels()
        {
            if (initialized)
            {
                return;
            }
            initialized = true;

            // Put all these here for ease of editing. Scroll speeds are easier to
            // edit so I left them in the invidiual level creation methods.
            characterSpawnTimes = new SpawnTime[numLevels];
            obstacleSpawnTimes  = new SpawnTime[numLevels];
            powerSpawnTimes     = new SpawnTime[numLevels];

            characterSpawnTimes[0] = new SpawnTime(1f, 3f);
            characterSpawnTimes[1] = new SpawnTime(1f, 3f);
            characterSpawnTimes[2] = new SpawnTime(1f, 3f);
            characterSpawnTimes[3] = new SpawnTime(1f, 3f);
            characterSpawnTimes[4] = new SpawnTime(1f, 2.5f);

            obstacleSpawnTimes[0] = new SpawnTime(noSpawnTime, noSpawnTime);
            obstacleSpawnTimes[1] = new SpawnTime(3f, 6f);
            obstacleSpawnTimes[2] = new SpawnTime(2f, 5f);
            obstacleSpawnTimes[3] = new SpawnTime(1f, 4f);
            obstacleSpawnTimes[4] = new SpawnTime(0.5f, 3f);

            powerSpawnTimes[0] = new SpawnTime(noSpawnTime, noSpawnTime);
            powerSpawnTimes[1] = new SpawnTime(5f, 15f);
            powerSpawnTimes[2] = new SpawnTime(5f, 15f);
            powerSpawnTimes[3] = new SpawnTime(5f, 15f);
            powerSpawnTimes[4] = new SpawnTime(5f, 15f);

            levels     = new GameLevel[numLevels];
            levels [0] = Level0();
            levels [1] = Level1();
            levels [2] = Level2();
            levels [3] = Level3();
            levels [4] = Level3();
        }