Example #1
0
 public static TileMap LoadMap(int xLocation, int yLocation, Dimension dimension)
 {
     TileMap t = new TileMap();
     t.xLoc = xLocation;
     t.yLoc = yLocation;
     t.data = new byte[MapWidth][][];
     for (int x = 0; x < MapWidth; x++)
     {
         t.data[x] = new byte[MapHeight][];
         for (int y = 0; y < MapHeight; y++)
         {
             t.data[x][y] = new byte[MapDepth];
         }
     }
     FileStream fStream = new FileStream("Maps\\ovr" + ((yLocation * 16) + xLocation) + ".map", FileMode.Open);
     for (int y = 0; y < MapHeight; y++)
     {
         for (int x = 0; x < MapWidth; x++)
         {
             for (int z = 0; z < MapDepth; z++)
             {
                 t.data[x][y][z] = (byte)fStream.ReadByte();
             }
         }
     }
     fStream.Close();
     return t;
 }
Example #2
0
 public void ChangeRoom(Vector2 newPosition, int roomX, int roomY)
 {
     currentMap = TileMap.LoadMap(roomX, roomY, TileMap.Dimension.Overworld);
     ResetLevel();
     GenerateLavaSparkers();
     soul_list.Clear();
 }