Citrus 6 months ago
parent
commit
a824d0f7da
1 changed files with 48 additions and 9 deletions
  1. 48 9
      assets/Script/Map/MyMap.ts

+ 48 - 9
assets/Script/Map/MyMap.ts

@@ -261,17 +261,56 @@ export default class MyMap extends cc.Component {
         // bronMap.push({ x: MyIndex.x + 1, y: MyIndex.y - 1, Id: this.CurrentMapPosData.Id - this.MapjsonData.mapX + 1 })
 
 
-        bronMap.push({ x: MyIndex.x, y: MyIndex.y, Id: this.CurrentMapPosData.Id })
-        bronMap.push({ x: MyIndex.x, y: MyIndex.y + 1, Id: this.CurrentMapPosData.Id + this.MapjsonData.mapX })
-        bronMap.push({ x: MyIndex.x, y: MyIndex.y - 1, Id: this.CurrentMapPosData.Id - this.MapjsonData.mapX })
-        bronMap.push({ x: MyIndex.x - 1, y: MyIndex.y, Id: this.CurrentMapPosData.Id - 1 })
-        bronMap.push({ x: MyIndex.x + 1, y: MyIndex.y, Id: this.CurrentMapPosData.Id + 1 })
 
+        // 新增的上左、上、上右
+        bronMap.push({ x: MyIndex.x - 2, y: MyIndex.y + 2, Id: this.CurrentMapPosData.Id + this.MapjsonData.mapX * 2 - 2 });
+        bronMap.push({ x: MyIndex.x - 1, y: MyIndex.y + 2, Id: this.CurrentMapPosData.Id + this.MapjsonData.mapX * 2 - 1 });
+        bronMap.push({ x: MyIndex.x, y: MyIndex.y + 2, Id: this.CurrentMapPosData.Id + this.MapjsonData.mapX * 2 });
+        bronMap.push({ x: MyIndex.x + 1, y: MyIndex.y + 2, Id: this.CurrentMapPosData.Id + this.MapjsonData.mapX * 2 + 1 });
+        bronMap.push({ x: MyIndex.x + 2, y: MyIndex.y + 2, Id: this.CurrentMapPosData.Id + this.MapjsonData.mapX * 2 + 2 });
 
-        bronMap.push({ x: MyIndex.x - 1, y: MyIndex.y + 1, Id: this.CurrentMapPosData.Id + this.MapjsonData.mapX - 1 })
-        bronMap.push({ x: MyIndex.x + 1, y: MyIndex.y + 1, Id: this.CurrentMapPosData.Id + this.MapjsonData.mapX + 1 })
-        bronMap.push({ x: MyIndex.x - 1, y: MyIndex.y - 1, Id: this.CurrentMapPosData.Id - this.MapjsonData.mapX - 1 })
-        bronMap.push({ x: MyIndex.x + 1, y: MyIndex.y - 1, Id: this.CurrentMapPosData.Id - this.MapjsonData.mapX + 1 })
+        // 新增的左、中、右
+        bronMap.push({ x: MyIndex.x - 2, y: MyIndex.y + 1, Id: this.CurrentMapPosData.Id + this.MapjsonData.mapX - 2 });
+        bronMap.push({ x: MyIndex.x - 1, y: MyIndex.y + 1, Id: this.CurrentMapPosData.Id + this.MapjsonData.mapX - 1 });
+        bronMap.push({ x: MyIndex.x, y: MyIndex.y + 1, Id: this.CurrentMapPosData.Id + this.MapjsonData.mapX });
+        bronMap.push({ x: MyIndex.x + 1, y: MyIndex.y + 1, Id: this.CurrentMapPosData.Id + this.MapjsonData.mapX + 1 });
+        bronMap.push({ x: MyIndex.x + 2, y: MyIndex.y + 1, Id: this.CurrentMapPosData.Id + this.MapjsonData.mapX + 2 });
+
+        // 新增的下左、下、下右
+        bronMap.push({ x: MyIndex.x - 2, y: MyIndex.y, Id: this.CurrentMapPosData.Id - 2 });
+        bronMap.push({ x: MyIndex.x - 1, y: MyIndex.y, Id: this.CurrentMapPosData.Id - 1 });
+        bronMap.push({ x: MyIndex.x, y: MyIndex.y, Id: this.CurrentMapPosData.Id });
+        bronMap.push({ x: MyIndex.x + 1, y: MyIndex.y, Id: this.CurrentMapPosData.Id + 1 });
+        bronMap.push({ x: MyIndex.x + 2, y: MyIndex.y, Id: this.CurrentMapPosData.Id + 2 });
+
+        // 新增的下左、下、下右
+        bronMap.push({ x: MyIndex.x - 2, y: MyIndex.y - 1, Id: this.CurrentMapPosData.Id - this.MapjsonData.mapX - 2 });
+        bronMap.push({ x: MyIndex.x - 1, y: MyIndex.y - 1, Id: this.CurrentMapPosData.Id - this.MapjsonData.mapX - 1 });
+        bronMap.push({ x: MyIndex.x, y: MyIndex.y - 1, Id: this.CurrentMapPosData.Id - this.MapjsonData.mapX });
+        bronMap.push({ x: MyIndex.x + 1, y: MyIndex.y - 1, Id: this.CurrentMapPosData.Id - this.MapjsonData.mapX + 1 });
+        bronMap.push({ x: MyIndex.x + 2, y: MyIndex.y - 1, Id: this.CurrentMapPosData.Id - this.MapjsonData.mapX + 2 });
+
+        // 新增的下左、下、下右
+        bronMap.push({ x: MyIndex.x - 2, y: MyIndex.y - 2, Id: this.CurrentMapPosData.Id - this.MapjsonData.mapX * 2 - 2 });
+        bronMap.push({ x: MyIndex.x - 1, y: MyIndex.y - 2, Id: this.CurrentMapPosData.Id - this.MapjsonData.mapX * 2 - 1 });
+        bronMap.push({ x: MyIndex.x, y: MyIndex.y - 2, Id: this.CurrentMapPosData.Id - this.MapjsonData.mapX * 2 });
+        bronMap.push({ x: MyIndex.x + 1, y: MyIndex.y - 2, Id: this.CurrentMapPosData.Id - this.MapjsonData.mapX * 2 + 1 });
+        bronMap.push({ x: MyIndex.x + 2, y: MyIndex.y - 2, Id: this.CurrentMapPosData.Id - this.MapjsonData.mapX * 2 + 2 });
+
+
+
+
+        // bronMap.push({ x: MyIndex.x, y: MyIndex.y, Id: this.CurrentMapPosData.Id })
+        // bronMap.push({ x: MyIndex.x, y: MyIndex.y + 1, Id: this.CurrentMapPosData.Id + this.MapjsonData.mapX })
+        // bronMap.push({ x: MyIndex.x, y: MyIndex.y - 1, Id: this.CurrentMapPosData.Id - this.MapjsonData.mapX })
+        // bronMap.push({ x: MyIndex.x - 1, y: MyIndex.y, Id: this.CurrentMapPosData.Id - 1 })
+        // bronMap.push({ x: MyIndex.x + 1, y: MyIndex.y, Id: this.CurrentMapPosData.Id + 1 })
+
+
+        // bronMap.push({ x: MyIndex.x - 1, y: MyIndex.y + 1, Id: this.CurrentMapPosData.Id + this.MapjsonData.mapX - 1 })
+        // bronMap.push({ x: MyIndex.x + 1, y: MyIndex.y + 1, Id: this.CurrentMapPosData.Id + this.MapjsonData.mapX + 1 })
+        // bronMap.push({ x: MyIndex.x - 1, y: MyIndex.y - 1, Id: this.CurrentMapPosData.Id - this.MapjsonData.mapX - 1 })
+        // bronMap.push({ x: MyIndex.x + 1, y: MyIndex.y - 1, Id: this.CurrentMapPosData.Id - this.MapjsonData.mapX + 1 })