Example #1
0
        public static void Start()
        {
            if (!Directory.Exists("assets"))
            {
                Directory.CreateDirectory("assets");
            }
            if (!File.Exists(shapeManifestPath))
            {
                File.Create(shapeManifestPath);
            }
            if (!File.Exists(soundManifestPath))
            {
                File.Create(soundManifestPath);
            }

            // load shapes
            string[] shapeManifest = File.ReadAllLines(shapeManifestPath);
            foreach (string line in shapeManifest)
            {
                // ignore comments
                if (line.StartsWith("#"))
                {
                    continue;
                }

                string[] lineData = line.Split(':');
                string   name     = lineData[0];
                string   path     = lineData[1];
                shapes[name] = MultiPolygon.FromString(File.ReadAllText(path));
            }

            // load sounds
            string[] soundManifest = File.ReadAllLines(soundManifestPath);
            foreach (string line in soundManifest)
            {
                // ignore comments
                if (line.StartsWith("#"))
                {
                    continue;
                }

                string[] lineData = line.Split(':');
                string   name     = lineData[0];
                string   path     = lineData[1];
                sounds[name] = path;
            }
        }