示例#1
0
文件: Game.cs 项目: cadahl/defense
        private void LoadMap(string path)
        {
            _camera = new Camera ();

            // Load map.
            Map = new Map(path);
            SetDimensions (Map.Width * 32, Map.Height * 32);

            // Tell renderer to load the tilemaps.
            var r = Application.Renderer;
            foreach (string tilemapName in Map.TilemapNames) {
                r.Tilemaps[tilemapName] = new Tilemap (tilemapName);
            }

            r.Backgrounds[0] = new Background (r, Map);
            r.Backgrounds[1] = new Background (r, "units", Map.Width, Map.Height);
            r.Backgrounds[1].Blended = true;
        }