以上節地圖為例,載入並繪製所有障礙物:

導出得 XML 障礙物資料:<Item ID="Obstruction" Value="240_0,241_0,238_1,239_1,240_1,236_2,237..." />
開啟遊戲專案 Config.xml,找到 <Map Sign="1"> 節點,加 Obstruction 屬性貼上 Value 值:
<Map Sign="1" Obstruction="240_0,241_0,238_1,239_1,240_1,236_2,237..." />
byte[,] FixedObstruction = new byte[256, 256], VaryObstruction;
private void InitObstruction()
{
for (int y = 0; y < FixedObstruction.GetUpperBound(1); y++)
for (int x = 0; x < FixedObstruction.GetUpperBound(0); x++)
FixedObstruction[x, y] = 1;
string[] obstruction = Super.GetTreeNode(Super.SystemConfig, "Map", "Sign", "1").Attribute("Obstruction").Value.Split(',');
string[] str;
for (int i = 0; i < obstruction.Count(); i++)
{
str = obstruction[i].Split('_');
FixedObstruction[Convert.ToInt32(str[0]), Convert.ToInt32(str[1])] = 0;
}
VaryObstruction = (byte[,])FixedObstruction.Clone();
}
預設 1 可通行,0 障礙。解析 XML 資料標記障礙點,最後複製給動態陣列。