Пример #1
0
        public void CreateNew(int width, int height, int texSize)
        {
            TexSize = texSize;

            Layers.Clear();
            MapLayer layer = new MapLayer("New Layer");

            layer.CreateNew(width, height);
            Layers.Add(layer);

            Decorations.Clear();
            Decorations.Add(new AnimLayer("New Deco"));

            Entities.Clear();
            Entities.Add(new EntityLayer("New EntLayer"));

            int divSize = GraphicsManager.TEX_SIZE;

            obstacles = new GroundWall[width * TexSize][];
            for (int ii = 0; ii < obstacles.Length; ii++)
            {
                obstacles[ii] = new GroundWall[height * TexSize];
                for (int jj = 0; jj < obstacles[ii].Length; jj++)
                {
                    obstacles[ii][jj] = new GroundWall(ii * divSize, jj * divSize, divSize, divSize);
                }
            }

            this.grid = new AABB.Grid(width, height, GraphicsManager.TileSize);

            AddMapScriptEvent(LuaEngine.EMapCallbacks.Init);
            AddMapScriptEvent(LuaEngine.EMapCallbacks.Enter);
        }
Пример #2
0
        public void CreateNew(int width, int height, int texSize)
        {
            TexSize = texSize;

            Layers.Clear();
            MapLayer layer = new MapLayer("New Layer");

            layer.CreateNew(width, height);
            Layers.Add(layer);

            int divSize = GraphicsManager.TEX_SIZE;

            obstacles = new GroundWall[width * TexSize][];
            for (int ii = 0; ii < obstacles.Length; ii++)
            {
                obstacles[ii] = new GroundWall[height * TexSize];
                for (int jj = 0; jj < obstacles[ii].Length; jj++)
                {
                    obstacles[ii][jj] = new GroundWall(ii * divSize, jj * divSize, divSize, divSize);
                }
            }

            this.grid = new AABB.Grid(width, height, GraphicsManager.TileSize);
        }