Exemple #1
0
        public void CreateMapFromFile()
        {
            string line;
            string randomMap = GetRandomMapName();

            try
            {
                //NormalCells
                System.IO.StreamReader srNormalCells = new System.IO.StreamReader(randomMap + @"\NormalCellList.txt");
                while ((line = srNormalCells.ReadLine()) != null)
                {
                    Cell = new NormalCell(ConvertLineToPoint(line), CellSize);
                    AddCellToCellArray(line);
                }
                srNormalCells.Close();

                //WallCells
                System.IO.StreamReader srWallCells = new System.IO.StreamReader(randomMap + @"\WallCellList.txt");
                while ((line = srWallCells.ReadLine()) != null)
                {
                    Cell = new WallCell(ConvertLineToPoint(line), CellSize);
                    AddCellToCellArray(line);
                }
                srWallCells.Close();
            }
            catch (FileNotFoundException e)
            {
                throw new Exceptions.CreateMapException(e.Message);
            }
            SpawnPowerUps();
        }
Exemple #2
0
 public void CreateBlankMap()
 {
     for (int x = 0; x < cellXAxisRowCount; x++)
     {
         for (int y = 0; y < cellYAxisRowCount; y++)
         {
             Cell            = new NormalCell(new Point(x * CellSize.Width, y * CellSize.Height), CellSize);
             CellArray[x, y] = Cell;
         }
     }
 }
Exemple #3
0
        public Map(World world)
        {
            this.world = world;

            cellXAxisRowCount = 27;
            cellYAxisRowCount = 16;
            CellSize          = new Size(30, 30);
            CellArray         = new Cells.Cell[cellXAxisRowCount, cellYAxisRowCount];

            PowerUpsOnMapList = new List <PowerUp>();
        }
Exemple #4
0
 // ---
 public Enemy(World world, Cells.Cell cell)
 {
     this.world     = world;
     LocationOnCell = cell;
 }