diff --git a/DungeonShooting_Godot/prefab/ui/TileSetEditorTerrain.tscn b/DungeonShooting_Godot/prefab/ui/TileSetEditorTerrain.tscn index edf1550..9bb5cd2 100644 --- a/DungeonShooting_Godot/prefab/ui/TileSetEditorTerrain.tscn +++ b/DungeonShooting_Godot/prefab/ui/TileSetEditorTerrain.tscn @@ -194,7 +194,7 @@ layout_mode = 1 offset_top = 80.0 offset_right = 64.0 -offset_bottom = 96.0 +offset_bottom = 112.0 mouse_filter = 2 texture = ExtResource("5_xabgh") diff --git a/DungeonShooting_Godot/resource/map/tileSet/TileSet1/Main.png b/DungeonShooting_Godot/resource/map/tileSet/TileSet1/Main.png index c3cbdb1..193d030 100644 --- a/DungeonShooting_Godot/resource/map/tileSet/TileSet1/Main.png +++ b/DungeonShooting_Godot/resource/map/tileSet/TileSet1/Main.png Binary files differ diff --git a/DungeonShooting_Godot/resource/map/tileSet/TileSet1/TileSet.json b/DungeonShooting_Godot/resource/map/tileSet/TileSet1/TileSet.json index 31e1b00..b8042c2 100644 --- a/DungeonShooting_Godot/resource/map/tileSet/TileSet1/TileSet.json +++ b/DungeonShooting_Godot/resource/map/tileSet/TileSet1/TileSet.json @@ -29,6 +29,22 @@ "0": [ 64, 64 + ], + "5": [ + 16, + 80 + ], + "6": [ + 32, + 80 + ], + "7": [ + 48, + 80 + ], + "4": [ + 64, + 80 ] }, "T": { diff --git a/DungeonShooting_Godot/resource/map/tileSet/TileSet2/TileSet.json b/DungeonShooting_Godot/resource/map/tileSet/TileSet2/TileSet.json index 3631e29..dfcd90e 100644 --- a/DungeonShooting_Godot/resource/map/tileSet/TileSet2/TileSet.json +++ b/DungeonShooting_Godot/resource/map/tileSet/TileSet2/TileSet.json @@ -222,7 +222,7 @@ ] }, "TerrainType": 0, - "Ready": true + "Ready": false }, { "Name": "Test2", diff --git a/DungeonShooting_Godot/resource/sprite/map/TerrainMask2.png b/DungeonShooting_Godot/resource/sprite/map/TerrainMask2.png index 0653e77..c45bc4d 100644 --- a/DungeonShooting_Godot/resource/sprite/map/TerrainMask2.png +++ b/DungeonShooting_Godot/resource/sprite/map/TerrainMask2.png Binary files differ diff --git a/DungeonShooting_Godot/src/framework/map/DungeonTileMap.cs b/DungeonShooting_Godot/src/framework/map/DungeonTileMap.cs index c5bbaa4..aaf9cb5 100644 --- a/DungeonShooting_Godot/src/framework/map/DungeonTileMap.cs +++ b/DungeonShooting_Godot/src/framework/map/DungeonTileMap.cs @@ -248,7 +248,7 @@ FillRect(MapLayer.AutoTopLayer, config.Wall_Out_RT, doorInfo.Cross + new Vector2(0, GameConfig.CorridorWidth - 1), Vector2.One); FillRect(MapLayer.AutoTopLayer, config.Wall_In_RT, doorInfo.Cross + new Vector2(GameConfig.CorridorWidth - 1, -1), Vector2.One); FillRect(MapLayer.AutoMiddleLayer, config.Wall_Top, doorInfo.Cross + new Vector2I(0, -1), new Vector2(GameConfig.CorridorWidth - 1, 1)); - FillRect(MapLayer.AutoMiddleLayer, config.Wall_Vertical_Center, doorInfo.Cross, new Vector2(GameConfig.CorridorWidth - 1, 1)); + FillRect(MapLayer.AutoMiddleLayer, config.Wall_Vertical_CenterTop, doorInfo.Cross, new Vector2(GameConfig.CorridorWidth - 1, 1)); FillRect(MapLayer.AutoTopLayer, config.Wall_Right, doorInfo.Cross + new Vector2(GameConfig.CorridorWidth - 1, 0), new Vector2(1, GameConfig.CorridorWidth)); FillRect(MapLayer.AutoTopLayer, config.TopMask, doorInfo.Cross - new Vector2I(0, 2), new Vector2(GameConfig.CorridorWidth + 1, 1)); @@ -258,7 +258,7 @@ (doorDir2 == DoorDirection.E && doorDir1 == DoorDirection.S)) { FillRect(MapLayer.AutoMiddleLayer, config.Wall_Out_RB, doorInfo.Cross + new Vector2I(0, -1), Vector2.One); - FillRect(MapLayer.AutoMiddleLayer, config.Wall_Vertical_Right, doorInfo.Cross, Vector2.One); + FillRect(MapLayer.AutoMiddleLayer, config.Wall_Vertical_RightTop, doorInfo.Cross, Vector2.One); FillRect(MapLayer.AutoTopLayer, config.Wall_In_RB, doorInfo.Cross + new Vector2(GameConfig.CorridorWidth - 1, GameConfig.CorridorWidth - 1), Vector2.One); FillRect(MapLayer.AutoTopLayer, config.Wall_Right, doorInfo.Cross + new Vector2(GameConfig.CorridorWidth - 1, -1), new Vector2(1, GameConfig.CorridorWidth)); FillRect(MapLayer.AutoTopLayer, config.Wall_Bottom, doorInfo.Cross + new Vector2(0, GameConfig.CorridorWidth - 1), new Vector2(GameConfig.CorridorWidth - 1, 1)); @@ -270,7 +270,7 @@ (doorDir2 == DoorDirection.S && doorDir1 == DoorDirection.W)) { FillRect(MapLayer.AutoMiddleLayer, config.Wall_Out_LB, doorInfo.Cross + new Vector2(GameConfig.CorridorWidth - 1, -1), Vector2.One); - FillRect(MapLayer.AutoMiddleLayer, config.Wall_Vertical_Left, doorInfo.Cross + new Vector2(GameConfig.CorridorWidth - 1, 0), Vector2.One); + FillRect(MapLayer.AutoMiddleLayer, config.Wall_Vertical_LeftTop, doorInfo.Cross + new Vector2(GameConfig.CorridorWidth - 1, 0), Vector2.One); FillRect(MapLayer.AutoTopLayer, config.Wall_In_LB, doorInfo.Cross + new Vector2(0, GameConfig.CorridorWidth - 1), Vector2.One); FillRect(MapLayer.AutoTopLayer, config.Wall_Left, doorInfo.Cross + new Vector2I(0, -1), new Vector2(1, GameConfig.CorridorWidth)); FillRect(MapLayer.AutoTopLayer, config.Wall_Bottom, doorInfo.Cross + new Vector2(1, GameConfig.CorridorWidth - 1), new Vector2(GameConfig.CorridorWidth - 1, 1)); @@ -284,7 +284,7 @@ FillRect(MapLayer.AutoTopLayer, config.Wall_Out_LT, doorInfo.Cross + new Vector2(GameConfig.CorridorWidth - 1, GameConfig.CorridorWidth - 1), Vector2.One); FillRect(MapLayer.AutoTopLayer, config.Wall_In_LT, doorInfo.Cross + new Vector2I(0, -1), Vector2.One); FillRect(MapLayer.AutoMiddleLayer, config.Wall_Top, doorInfo.Cross + new Vector2(1, -1), new Vector2(GameConfig.CorridorWidth - 1, 1)); - FillRect(MapLayer.AutoMiddleLayer, config.Wall_Vertical_Center, doorInfo.Cross + new Vector2(1, 0), new Vector2(GameConfig.CorridorWidth - 1, 1)); + FillRect(MapLayer.AutoMiddleLayer, config.Wall_Vertical_CenterTop, doorInfo.Cross + new Vector2(1, 0), new Vector2(GameConfig.CorridorWidth - 1, 1)); FillRect(MapLayer.AutoTopLayer, config.Wall_Left, doorInfo.Cross + new Vector2(0, 0), new Vector2(1, GameConfig.CorridorWidth)); FillRect(MapLayer.AutoTopLayer, config.TopMask, doorInfo.Cross - new Vector2I(1, 2), new Vector2(GameConfig.CorridorWidth + 1, 1)); @@ -476,7 +476,7 @@ FillRect(MapLayer.AutoTopLayer, config.TopMask, rect.Position - new Vector2(0, 2), new Vector2(rect.Size.X, 1)); FillRect(MapLayer.AutoTopLayer, config.TopMask, rect.Position + new Vector2(0, rect.Size.Y), new Vector2(rect.Size.X, 1)); FillRect(MapLayer.AutoMiddleLayer, config.Wall_Top, rect.Position - new Vector2(0, 1), new Vector2(rect.Size.X, 1)); - FillRect(MapLayer.AutoMiddleLayer, config.Wall_Vertical_Center, rect.Position, new Vector2(rect.Size.X, 1)); + FillRect(MapLayer.AutoMiddleLayer, config.Wall_Vertical_CenterTop, rect.Position, new Vector2(rect.Size.X, 1)); FillRect(MapLayer.AutoTopLayer, config.Wall_Bottom, rect.Position + new Vector2(0, rect.Size.Y - 1), new Vector2(rect.Size.X, 1)); } @@ -503,7 +503,7 @@ else { ClearRect(MapLayer.AutoTopLayer, rect.Position - new Vector2(1, 1), new Vector2(2, 4)); - FillRect(MapLayer.AutoMiddleLayer, config.Wall_Vertical_Left, rect.Position - new Vector2(1, 0), Vector2.One); + FillRect(MapLayer.AutoMiddleLayer, config.Wall_Vertical_LeftTop, rect.Position - new Vector2(1, 0), Vector2.One); FillRect(MapLayer.AutoMiddleLayer, config.Wall_Out_LB, rect.Position - new Vector2(1, 1), Vector2.One); FillRect(MapLayer.AutoTopLayer, config.Wall_Out_LT, rect.Position + new Vector2(-1, 3), Vector2.One); @@ -538,7 +538,7 @@ else { ClearRect(MapLayer.AutoTopLayer, rect.Position + new Vector2(rect.Size.X - 1, -1), new Vector2(2, 4)); - FillRect(MapLayer.AutoMiddleLayer, config.Wall_Vertical_Right, rect.Position + new Vector2(rect.Size.X, 0), Vector2.One); + FillRect(MapLayer.AutoMiddleLayer, config.Wall_Vertical_RightTop, rect.Position + new Vector2(rect.Size.X, 0), Vector2.One); FillRect(MapLayer.AutoMiddleLayer, config.Wall_Out_RB, rect.Position + new Vector2(rect.Size.X, -1), Vector2.One); FillRect(MapLayer.AutoTopLayer, config.Wall_Out_RT, rect.Position + new Vector2(rect.Size.X, 3), Vector2.One); @@ -611,9 +611,9 @@ ClearRect(MapLayer.AutoMiddleLayer, rect.Position + new Vector2(0, rect.Size.Y - 1), new Vector2(4, 2)); FillRect(MapLayer.AutoMiddleLayer, config.Wall_Out_RB, rect.Position + new Vector2(0, rect.Size.Y - 1), Vector2.One); - FillRect(MapLayer.AutoMiddleLayer, config.Wall_Vertical_Right, rect.Position + new Vector2(0, rect.Size.Y), Vector2.One); + FillRect(MapLayer.AutoMiddleLayer, config.Wall_Vertical_RightTop, rect.Position + new Vector2(0, rect.Size.Y), Vector2.One); FillRect(MapLayer.AutoMiddleLayer, config.Wall_Out_LB, rect.Position + new Vector2(rect.Size.X - 1, rect.Size.Y - 1), Vector2.One); - FillRect(MapLayer.AutoMiddleLayer, config.Wall_Vertical_Left, rect.Position + new Vector2(rect.Size.X - 1, rect.Size.Y), Vector2.One); + FillRect(MapLayer.AutoMiddleLayer, config.Wall_Vertical_LeftTop, rect.Position + new Vector2(rect.Size.X - 1, rect.Size.Y), Vector2.One); FillRect(MapLayer.AutoFloorLayer, config.Floor, rect.Position + new Vector2(1, rect.Size.Y), new Vector2(rect.Size.X - 2, 1)); //生成门的导航区域 diff --git a/DungeonShooting_Godot/src/framework/map/serialize/tileSet/TileSetTerrainInfo.cs b/DungeonShooting_Godot/src/framework/map/serialize/tileSet/TileSetTerrainInfo.cs index 85597b4..996c1db 100644 --- a/DungeonShooting_Godot/src/framework/map/serialize/tileSet/TileSetTerrainInfo.cs +++ b/DungeonShooting_Godot/src/framework/map/serialize/tileSet/TileSetTerrainInfo.cs @@ -26,7 +26,7 @@ [JsonInclude] public Dictionary F; /// - /// 侧方墙壁 (4块) type = 2 + /// 侧方墙壁 (8块) type = 2 /// [JsonInclude] public Dictionary M; @@ -86,7 +86,7 @@ { if (sourceIndex == 0 && terrainIndex == 0) { - Ready = T != null && T.Count == 47 && M != null && M.Count == 4 && F != null && F.Count == 1; + Ready = T != null && T.Count == 47 && M != null && M.Count == 8 && F != null && F.Count == 1; } else { @@ -350,6 +350,11 @@ case 1: M[1] = cellData; break; case 2: M[2] = cellData; break; case 3: M[3] = cellData; break; + + case 4: M[4] = cellData; break; + case 5: M[5] = cellData; break; + case 6: M[6] = cellData; break; + case 7: M[7] = cellData; break; } } else if (type == FloorLayerType) //地板 @@ -379,6 +384,11 @@ case 1: M.Remove(1); break; case 2: M.Remove(2); break; case 3: M.Remove(3); break; + + case 4: M.Remove(4); break; + case 5: M.Remove(5); break; + case 6: M.Remove(6); break; + case 7: M.Remove(7); break; } } else if (type == FloorLayerType) //地板 @@ -426,6 +436,27 @@ { if (M.TryGetValue(3, out var cellData)) return cellData; } + + break; + case 4: + { + if (M.TryGetValue(4, out var cellData)) return cellData; + } + break; + case 5: + { + if (M.TryGetValue(5, out var cellData)) return cellData; + } + break; + case 6: + { + if (M.TryGetValue(6, out var cellData)) return cellData; + } + break; + case 7: + { + if (M.TryGetValue(7, out var cellData)) return cellData; + } break; } } diff --git a/DungeonShooting_Godot/src/game/GameConfig.cs b/DungeonShooting_Godot/src/game/GameConfig.cs index f69bc4e..1874314 100644 --- a/DungeonShooting_Godot/src/game/GameConfig.cs +++ b/DungeonShooting_Godot/src/game/GameConfig.cs @@ -100,7 +100,7 @@ /// /// 地形掩码纹理大小, 侧方墙壁 /// - public static readonly Vector2I TerrainBitMiddle = new Vector2I(4, 1); + public static readonly Vector2I TerrainBitMiddle = new Vector2I(4, 2); /// /// 地形掩码纹理大小, 地板 /// diff --git a/DungeonShooting_Godot/src/game/room/AutoTileConfig.cs b/DungeonShooting_Godot/src/game/room/AutoTileConfig.cs index 58624c4..de5b29f 100644 --- a/DungeonShooting_Godot/src/game/room/AutoTileConfig.cs +++ b/DungeonShooting_Godot/src/game/room/AutoTileConfig.cs @@ -23,10 +23,15 @@ public TileCellData Wall_In_RT; public TileCellData Wall_In_RB; - public TileCellData Wall_Vertical_Left; - public TileCellData Wall_Vertical_Center; - public TileCellData Wall_Vertical_Right; - public TileCellData Wall_Vertical_Single; + public TileCellData Wall_Vertical_LeftTop; + public TileCellData Wall_Vertical_CenterTop; + public TileCellData Wall_Vertical_RightTop; + public TileCellData Wall_Vertical_SingleTop; + + public TileCellData Wall_Vertical_LeftBottom; + public TileCellData Wall_Vertical_CenterBottom; + public TileCellData Wall_Vertical_RightBottom; + public TileCellData Wall_Vertical_SingleBottom; //----------------------------- 所有自动图块数据 ----------------------------- //----------------------------- 命名规则: Auto_ + LT + T + RT + _ + L + C + R + _ + LB + B + RB @@ -121,19 +126,36 @@ int[] data; if (terrainInfo.M.TryGetValue(0, out data)) { - Wall_Vertical_Single = new TileCellData(sourceId, terrainInfo.GetPosition(data), 0, TileSetTerrainInfo.MiddleLayerType, MapLayer.AutoMiddleLayer); + Wall_Vertical_SingleTop = new TileCellData(sourceId, terrainInfo.GetPosition(data), 0, TileSetTerrainInfo.MiddleLayerType, MapLayer.AutoMiddleLayer); } if (terrainInfo.M.TryGetValue(1, out data)) { - Wall_Vertical_Left= new TileCellData(sourceId, terrainInfo.GetPosition(data), 1, TileSetTerrainInfo.MiddleLayerType, MapLayer.AutoMiddleLayer); + Wall_Vertical_LeftTop = new TileCellData(sourceId, terrainInfo.GetPosition(data), 1, TileSetTerrainInfo.MiddleLayerType, MapLayer.AutoMiddleLayer); } if (terrainInfo.M.TryGetValue(2, out data)) { - Wall_Vertical_Center= new TileCellData(sourceId, terrainInfo.GetPosition(data), 2, TileSetTerrainInfo.MiddleLayerType, MapLayer.AutoMiddleLayer); + Wall_Vertical_CenterTop = new TileCellData(sourceId, terrainInfo.GetPosition(data), 2, TileSetTerrainInfo.MiddleLayerType, MapLayer.AutoMiddleLayer); } if (terrainInfo.M.TryGetValue(3, out data)) { - Wall_Vertical_Right= new TileCellData(sourceId, terrainInfo.GetPosition(data), 3, TileSetTerrainInfo.MiddleLayerType, MapLayer.AutoMiddleLayer); + Wall_Vertical_RightTop = new TileCellData(sourceId, terrainInfo.GetPosition(data), 3, TileSetTerrainInfo.MiddleLayerType, MapLayer.AutoMiddleLayer); + } + + if (terrainInfo.M.TryGetValue(4, out data)) + { + Wall_Vertical_SingleBottom= new TileCellData(sourceId, terrainInfo.GetPosition(data), 4, TileSetTerrainInfo.MiddleLayerType, MapLayer.AutoMiddleLayer); + } + if (terrainInfo.M.TryGetValue(5, out data)) + { + Wall_Vertical_LeftBottom = new TileCellData(sourceId, terrainInfo.GetPosition(data), 5, TileSetTerrainInfo.MiddleLayerType, MapLayer.AutoMiddleLayer); + } + if (terrainInfo.M.TryGetValue(6, out data)) + { + Wall_Vertical_CenterBottom = new TileCellData(sourceId, terrainInfo.GetPosition(data), 6, TileSetTerrainInfo.MiddleLayerType, MapLayer.AutoMiddleLayer); + } + if (terrainInfo.M.TryGetValue(7, out data)) + { + Wall_Vertical_RightBottom = new TileCellData(sourceId, terrainInfo.GetPosition(data), 7, TileSetTerrainInfo.MiddleLayerType, MapLayer.AutoMiddleLayer); } } @@ -441,9 +463,13 @@ private void HandlerOtherCellMapping() { _mapping.Add(Floor.AutoTileCoords, Floor); - _mapping.Add(Wall_Vertical_Left.AutoTileCoords, Wall_Vertical_Left); - _mapping.Add(Wall_Vertical_Right.AutoTileCoords, Wall_Vertical_Right); - _mapping.Add(Wall_Vertical_Center.AutoTileCoords, Wall_Vertical_Center); - _mapping.Add(Wall_Vertical_Single.AutoTileCoords, Wall_Vertical_Single); + _mapping.Add(Wall_Vertical_LeftTop.AutoTileCoords, Wall_Vertical_LeftTop); + _mapping.Add(Wall_Vertical_RightTop.AutoTileCoords, Wall_Vertical_RightTop); + _mapping.Add(Wall_Vertical_CenterTop.AutoTileCoords, Wall_Vertical_CenterTop); + _mapping.Add(Wall_Vertical_SingleTop.AutoTileCoords, Wall_Vertical_SingleTop); + _mapping.Add(Wall_Vertical_LeftBottom.AutoTileCoords, Wall_Vertical_LeftBottom); + _mapping.Add(Wall_Vertical_CenterBottom.AutoTileCoords, Wall_Vertical_CenterBottom); + _mapping.Add(Wall_Vertical_RightBottom.AutoTileCoords, Wall_Vertical_RightBottom); + _mapping.Add(Wall_Vertical_SingleBottom.AutoTileCoords, Wall_Vertical_SingleBottom); } } \ No newline at end of file diff --git a/DungeonShooting_Godot/src/game/ui/mapEditor/tileView/EditorTileMap.cs b/DungeonShooting_Godot/src/game/ui/mapEditor/tileView/EditorTileMap.cs index 76a3d90..49807ce 100644 --- a/DungeonShooting_Godot/src/game/ui/mapEditor/tileView/EditorTileMap.cs +++ b/DungeonShooting_Godot/src/game/ui/mapEditor/tileView/EditorTileMap.cs @@ -1267,19 +1267,19 @@ TileCellData tileCellData; if (left && right) { - tileCellData = _autoTileConfig.Wall_Vertical_Single; + tileCellData = _autoTileConfig.Wall_Vertical_SingleTop; } else if (left) { - tileCellData = _autoTileConfig.Wall_Vertical_Left; + tileCellData = _autoTileConfig.Wall_Vertical_LeftTop; } else if (right) { - tileCellData = _autoTileConfig.Wall_Vertical_Right; + tileCellData = _autoTileConfig.Wall_Vertical_RightTop; } else { - tileCellData = _autoTileConfig.Wall_Vertical_Center; + tileCellData = _autoTileConfig.Wall_Vertical_CenterTop; } SetCell(MapLayer.AutoFloorLayer, new Vector2I(x, y - 1), tileCellData.SourceId, tileCellData.AutoTileCoords); }