Пример #1
0
 public void Add(Level level)
 {
     if (level != null)
     {
         levels.Add(level);
     }
 }
 public void CreateLevel(Level level, int tileSize, Point startPos)
 {
     camera.GameAreaTilesWidth = level.Cols;
     for (int row = 0; row < level.Rows; row++)
     {
         for (int col = 0; col < level.Cols; col++)
         {
             ObjectFactory(level.Get(row, col).GameObject, level.Get(row, col).Option, row, col, tileSize, startPos);
         }
     }
 }
Пример #3
0
        public List<Level> ReadFile()
        {
            List<Level> result = new List<Level>();

            StreamReader sr = new StreamReader(levelFilename);

            Level level = new Level();

            while (!sr.EndOfStream)
            {
                if (level.ReadLevel(sr))
                {
                    result.Add(level);
                }
                level = new Level();
            }
            sr.Close();
            return result;
        }
Пример #4
0
 private void StartHandleGame(Level level)
 {
     handlegame = new HandleGame(this, new HandleOptionDelegate(HandleMenuOption));
     handlegame.LoadContent();
     handlegame.CreateLevel(level, TILE_SIZE, new Point(0, 0));
 }