コード例 #1
0
        private void GenerateLandscape()
        {
            List <GameObject> spawnedObjects = new List <GameObject>();

            m_house = new Hs_Building();

            ///
            ///	Backgrounds
            ///
            List <BackgroundObject> backgrounds;

            backgrounds = BackgroundObject.CreateBackgroundObjects((int)(ActiveTileCount * 1.25f), null, new Vector2(TotalLevelWidth, 1), new Vector2(50, 0), StyleManager.LevelStyle.Country, 0);
            for (int i = 0; i < backgrounds.Count; ++i)
            {
                backgrounds[i].Transform.PosY -= 20;
            }
            spawnedObjects.AddRange(backgrounds);

            backgrounds = BackgroundObject.CreateBackgroundObjects((int)(ActiveTileCount * 1.5f), null, new Vector2(TotalLevelWidth, 1), new Vector2(50, 0), StyleManager.LevelStyle.Country, 1);
            for (int i = 0; i < backgrounds.Count; ++i)
            {
                backgrounds[i].Transform.PosY -= 100;
            }
            spawnedObjects.AddRange(backgrounds);

            backgrounds = BackgroundObject.CreateBackgroundObjects(ActiveTileCount * 2, null, new Vector2(TotalLevelWidth, 1), new Vector2(50, 0), StyleManager.LevelStyle.Country, 2);
            for (int i = 0; i < backgrounds.Count; ++i)
            {
                backgrounds[i].Transform.PosY -= 200;
            }
            spawnedObjects.AddRange(backgrounds);

            m_levelObjects[(int)LevelObjectType.Backgrounds] = spawnedObjects;

            ///
            /// Earth Tiles
            ///
            spawnedObjects = new List <GameObject>();
            for (int i = 0; i < m_earthTiles.Length; ++i)
            {
                m_earthTiles[i] = new EarthTile(i);
                spawnedObjects.Add(m_earthTiles[i]);
            }
            m_levelObjects[(int)LevelObjectType.EarthTile] = spawnedObjects;
        }
コード例 #2
0
        private void GenerateLandscape()
        {
            List<GameObject> spawnedObjects = new List<GameObject>();

            m_house = new Hs_Building();

            ///
            ///	Backgrounds
            ///
            List<BackgroundObject> backgrounds;
            backgrounds = BackgroundObject.CreateBackgroundObjects((int)(ActiveTileCount * 1.25f), null, new Vector2(TotalLevelWidth, 1), new Vector2(50, 0), StyleManager.LevelStyle.Country, 0);
            for (int i = 0; i < backgrounds.Count; ++i)
                backgrounds[i].Transform.PosY -= 20;
            spawnedObjects.AddRange(backgrounds);

            backgrounds = BackgroundObject.CreateBackgroundObjects((int)(ActiveTileCount * 1.5f), null, new Vector2(TotalLevelWidth, 1), new Vector2(50, 0), StyleManager.LevelStyle.Country, 1);
            for (int i = 0; i < backgrounds.Count; ++i)
                backgrounds[i].Transform.PosY -= 100;
            spawnedObjects.AddRange(backgrounds);

            backgrounds = BackgroundObject.CreateBackgroundObjects(ActiveTileCount * 2, null, new Vector2(TotalLevelWidth, 1), new Vector2(50, 0), StyleManager.LevelStyle.Country, 2);
            for (int i = 0; i < backgrounds.Count; ++i)
                backgrounds[i].Transform.PosY -= 200;
            spawnedObjects.AddRange(backgrounds);

            m_levelObjects[(int)LevelObjectType.Backgrounds] = spawnedObjects;

            ///
            /// Earth Tiles
            ///
            spawnedObjects = new List<GameObject>();
            for (int i = 0; i < m_earthTiles.Length; ++i)
            {
                m_earthTiles[i] = new EarthTile(i);
                spawnedObjects.Add(m_earthTiles[i]);
            }
            m_levelObjects[(int)LevelObjectType.EarthTile] = spawnedObjects;
        }