Beispiel #1
0
        public DummyWorld(Controls controls)
        {
            mName = null;
            mLevel = null;

            Texture2D gridAlphaMap = new Texture2D(GraphicsManager.Device, HeightMapMesh.NUM_SIDE_VERTICES * HeightMapMesh.NUM_SIDE_TEXELS_PER_QUAD, HeightMapMesh.NUM_SIDE_VERTICES * HeightMapMesh.NUM_SIDE_TEXELS_PER_QUAD);
            HeightMapMesh gridMesh = new HeightMapMesh(new float[HeightMapMesh.NUM_SIDE_VERTICES, HeightMapMesh.NUM_SIDE_VERTICES], gridAlphaMap, new string[0], null, null);
            AssetLibrary.AddGrid("BLOCK_GRID", gridMesh);

            mGridRenderable = new GridRenderable("BLOCK_GRID");
        }
Beispiel #2
0
        public void Open(FileInfo fileInfo)
        {
            AssetLibrary.ClearHeightMaps();

            mLevel.IterateOverEveryBlock(RemoveBlockFromSpace, new object[] { Space });

            mName = fileInfo.Name;

            Tuple<Level, List<DummyObject>> loadedLevel = LevelFileLoader.LoadLevelFromFile(fileInfo);
            mLevel = new ModifiableLevel(loadedLevel.Item1, Space);

            mLevel.IterateOverEveryBlock(AddBlockToSpace, new object[] { Space });

            mDummies = loadedLevel.Item2;
        }
Beispiel #3
0
        public void New()
        {
            if (mLevel != null)
            {
                AssetLibrary.ClearHeightMaps();
                mLevel.IterateOverEveryBlock(RemoveBlockFromSpace, new object[] { Space });
            }

            mName = "default";
            mLevel = new ModifiableLevel(LevelFileLoader.GenerateNewLevel(mName, "default_terrain_detail"), Space);

            FileInfo fileInfo = new FileInfo(mName);

            mLevel.IterateOverEveryBlock(AddBlockToSpace, new object[] { Space });

            mSkyBox = new SkyBox("default");
            mWater = new Water("waterTexture", 0.1f);
        }