示例#1
0
 public GrowSlot(Game game, Closet closet, Vector2 start)
     : base(game, start)
 {
     // TODO: Construct any child components here
 }
        private void LoadNextLevel()
        {
            // move to the next level
            levelIndex = (levelIndex + 1) % numberOfLevels;

            // Unloads the content for the current level before loading the next one.
            if (_closet != null)
                _closet.Dispose();

            // Load the level.
            string s = Directory.GetCurrentDirectory();

            string levelPath = string.Format("Content/Levels/{0}.txt", levelIndex);
            if (File.Exists(levelPath))
            {
                using (Stream fileStream = TitleContainer.OpenStream(levelPath))
                    _closet = new Closet(this, new Vector2(0,0), Services, fileStream, levelIndex);
            }
        }