diff --git a/DungeonShooting_Godot/resource/map/tileMaps/GroupConfig.json b/DungeonShooting_Godot/resource/map/tileMaps/GroupConfig.json index a4acaf9..41a2530 100644 --- a/DungeonShooting_Godot/resource/map/tileMaps/GroupConfig.json +++ b/DungeonShooting_Godot/resource/map/tileMaps/GroupConfig.json @@ -7,8 +7,18 @@ "Path": "resource/map/tileMaps/Test1/battle/Battle1" } ], - "InletList": [], - "OutletList": [], + "InletList": [ + { + "ErrorType": 0, + "Path": "resource/map/tileMaps/Test1/inlet/Start1" + } + ], + "OutletList": [ + { + "ErrorType": 0, + "Path": "resource/map/tileMaps/Test1/outlet/End1" + } + ], "BossList": [], "RewardList": [], "ShopList": [], diff --git a/DungeonShooting_Godot/resource/map/tileMaps/Test1/battle/Battle1/Preview.png b/DungeonShooting_Godot/resource/map/tileMaps/Test1/battle/Battle1/Preview.png index 7db44f0..ad3a817 100644 --- a/DungeonShooting_Godot/resource/map/tileMaps/Test1/battle/Battle1/Preview.png +++ b/DungeonShooting_Godot/resource/map/tileMaps/Test1/battle/Battle1/Preview.png Binary files differ diff --git a/DungeonShooting_Godot/resource/map/tileMaps/Test1/battle/Battle1/Preview.png.import b/DungeonShooting_Godot/resource/map/tileMaps/Test1/battle/Battle1/Preview.png.import new file mode 100644 index 0000000..cfe8193 --- /dev/null +++ b/DungeonShooting_Godot/resource/map/tileMaps/Test1/battle/Battle1/Preview.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://wvfu2bwf6m7t" +path="res://.godot/imported/Preview.png-c3396b369b426836d0fe1b15b21c3825.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://resource/map/tileMaps/Test1/battle/Battle1/Preview.png" +dest_files=["res://.godot/imported/Preview.png-c3396b369b426836d0fe1b15b21c3825.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/DungeonShooting_Godot/resource/map/tileMaps/Test1/battle/Battle1/RoomInfo.json b/DungeonShooting_Godot/resource/map/tileMaps/Test1/battle/Battle1/RoomInfo.json index 5eac39c..e8c9e2f 100644 --- a/DungeonShooting_Godot/resource/map/tileMaps/Test1/battle/Battle1/RoomInfo.json +++ b/DungeonShooting_Godot/resource/map/tileMaps/Test1/battle/Battle1/RoomInfo.json @@ -1 +1 @@ -{"Position":{"X":-3,"Y":-5},"Size":{"X":10,"Y":10},"DoorAreaInfos":[],"GroupName":"Test1","RoomType":0,"RoomName":"Battle1","Weight":100,"Remark":""} \ No newline at end of file +{"Position":{"X":-4,"Y":-8},"Size":{"X":16,"Y":14},"DoorAreaInfos":[{"Direction":3,"Start":0,"End":128},{"Direction":1,"Start":0,"End":64},{"Direction":2,"Start":80,"End":192},{"Direction":0,"Start":80,"End":144}],"GroupName":"Test1","RoomType":0,"RoomName":"Battle1","Weight":100,"Remark":""} \ No newline at end of file diff --git a/DungeonShooting_Godot/resource/map/tileMaps/Test1/battle/Battle1/TileInfo.json b/DungeonShooting_Godot/resource/map/tileMaps/Test1/battle/Battle1/TileInfo.json index e06b107..0d1b78c 100644 --- a/DungeonShooting_Godot/resource/map/tileMaps/Test1/battle/Battle1/TileInfo.json +++ b/DungeonShooting_Godot/resource/map/tileMaps/Test1/battle/Battle1/TileInfo.json @@ -1 +1 @@ -{"NavigationVertices":[{"X":58,"Y":6},{"X":74,"Y":6},{"X":74,"Y":50},{"X":-10,"Y":50},{"X":-10,"Y":-26},{"X":58,"Y":-26}],"NavigationPolygon":[[0,1,2,3],[0,3,4,5]],"Floor":[-1,-1,0,3,-1,-2,0,3,0,-2,0,3,1,-2,0,3,2,-2,0,3,3,-2,0,3,3,-1,0,3,3,0,0,3,2,0,0,3,2,-1,0,3,1,-1,0,3,0,-1,0,3,0,0,0,3,-1,0,0,3,1,0,0,3,-1,1,0,3,0,1,0,3,1,1,0,3,2,1,0,3,3,1,0,3,4,1,0,3,4,2,0,3,3,2,0,3,2,2,0,3,1,2,0,3,0,2,0,3,-1,2,0,3,4,0,0,3],"Middle":[-1,-4,63,1,-1,-3,0,2,0,-4,63,1,0,-3,0,2,1,-4,63,1,1,-3,0,2,2,-4,63,1,2,-3,0,2,3,-4,63,1,3,-3,0,2,4,-2,54,1,4,-1,0,2],"Top":[-3,-5,511,1,-3,-4,511,1,-3,-3,511,1,-3,-2,511,1,-3,-1,511,1,-3,0,511,1,-3,1,511,1,-3,2,511,1,-3,3,511,1,-3,4,511,1,-2,-5,511,1,-2,-4,255,1,-2,-3,219,1,-2,-2,219,1,-2,-1,219,1,-2,0,219,1,-2,1,219,1,-2,2,219,1,-2,3,507,1,-2,4,511,1,-1,-5,511,1,-1,3,504,1,-1,4,511,1,0,-5,511,1,0,3,504,1,0,4,511,1,1,-5,511,1,1,3,504,1,1,4,511,1,2,-5,511,1,2,3,504,1,2,4,511,1,3,-5,511,1,3,3,504,1,3,4,511,1,4,-5,511,1,4,-4,447,1,4,-3,438,1,4,3,504,1,4,4,511,1,5,-5,511,1,5,-4,511,1,5,-3,511,1,5,-2,447,1,5,-1,438,1,5,0,438,1,5,1,438,1,5,2,438,1,5,3,510,1,5,4,511,1,6,-3,511,1,6,-2,511,1,6,-1,511,1,6,0,511,1,6,1,511,1,6,2,511,1,6,3,511,1,6,4,511,1]} \ No newline at end of file +{"NavigationVertices":[{"X":154,"Y":6},{"X":154,"Y":66},{"X":134,"Y":38},{"X":138,"Y":6},{"X":134,"Y":-30},{"X":138,"Y":-58},{"X":90,"Y":-58},{"X":74,"Y":-30},{"X":118,"Y":54},{"X":118,"Y":38},{"X":54,"Y":66},{"X":74,"Y":54},{"X":54,"Y":50},{"X":-10,"Y":50},{"X":-10,"Y":-14},{"X":-26,"Y":-14},{"X":-26,"Y":-74},{"X":90,"Y":-74}],"NavigationPolygon":[[0,1,2,3],[3,2,4,5],[6,5,4,7],[8,9,2,1],[8,1,10,11],[11,10,12,7],[12,13,14,7],[7,14,15,16,17,6]],"Floor":[-1,-1,0,3,3,-1,0,3,3,0,0,3,2,0,0,3,2,-1,0,3,1,-1,0,3,0,-1,0,3,0,0,0,3,-1,0,0,3,1,0,0,3,-1,1,0,3,0,1,0,3,1,1,0,3,2,1,0,3,3,1,0,3,4,1,0,3,4,2,0,3,3,2,0,3,2,2,0,3,1,2,0,3,0,2,0,3,-1,2,0,3,4,0,0,3,4,-1,0,3,4,-2,0,3,3,-2,0,3,2,-2,0,3,1,-2,0,3,0,-2,0,3,-1,-2,0,3,-1,-3,0,3,0,-3,0,3,1,-3,0,3,2,-3,0,3,3,-3,0,3,4,-3,0,3,5,-3,0,3,5,-4,0,3,5,-5,0,3,4,-5,0,3,3,-5,0,3,2,-5,0,3,1,-5,0,3,0,-5,0,3,-1,-5,0,3,-2,-5,0,3,-2,-4,0,3,-1,-4,0,3,0,-4,0,3,1,-4,0,3,2,-4,0,3,3,-4,0,3,4,-4,0,3,6,-4,0,3,7,-4,0,3,8,-4,0,3,8,-3,0,3,8,-2,0,3,7,-3,0,3,6,-3,0,3,8,-1,0,3,8,0,0,3,8,1,0,3,8,2,0,3,7,2,0,3,7,3,0,3,6,3,0,3,5,3,0,3,4,3,0,3,3,3,0,3,8,3,0,3,9,3,0,3,9,2,0,3,-2,-3,0,3,-2,-2,0,3,9,0,0,3,9,1,0,3],"Middle":[-2,-7,63,1,-2,-6,2,2,-1,-7,63,1,-1,-6,2,2,0,-7,63,1,0,-6,2,2,1,-7,63,1,1,-6,2,2,2,-7,63,1,2,-6,2,2,3,-7,63,1,3,-6,2,2,4,-7,63,1,4,-6,2,2,5,-7,63,1,5,-6,2,2,5,1,54,1,5,2,1,2,6,-6,54,1,6,-5,1,2,6,1,27,1,6,2,3,2,7,-6,63,1,7,-5,2,2,7,0,27,1,7,1,3,2,8,-6,63,1,8,-5,2,2,9,-2,54,1,9,-1,1,2],"Top":[-4,-8,511,1,-4,-7,511,1,-4,-6,511,1,-4,-5,511,1,-4,-4,511,1,-4,-3,511,1,-4,-2,511,1,-4,-1,511,1,-4,0,511,1,-3,-8,511,1,-3,-7,255,1,-3,-6,219,1,-3,-5,219,1,-3,-4,219,1,-3,-3,219,1,-3,-2,219,1,-3,-1,507,1,-3,0,511,1,-3,1,511,1,-3,2,511,1,-3,3,511,1,-3,4,511,1,-2,-8,511,1,-2,-1,216,1,-2,0,219,1,-2,1,219,1,-2,2,219,1,-2,3,507,1,-2,4,511,1,-1,-8,511,1,-1,3,504,1,-1,4,511,1,0,-8,511,1,0,3,504,1,0,4,511,1,1,-8,511,1,1,3,504,1,1,4,511,1,1,5,511,1,2,-8,511,1,2,3,216,1,2,4,507,1,2,5,511,1,3,-8,511,1,3,4,504,1,3,5,511,1,4,-8,511,1,4,4,504,1,4,5,511,1,5,-8,511,1,5,-2,432,1,5,-1,438,1,5,0,438,1,5,4,504,1,5,5,511,1,6,-8,511,1,6,-7,447,1,6,-2,504,1,6,-1,511,1,6,0,255,1,6,4,504,1,6,5,511,1,7,-8,511,1,7,-7,511,1,7,-2,216,1,7,-1,219,1,7,4,504,1,7,5,511,1,8,-7,511,1,8,4,504,1,8,5,511,1,9,-7,511,1,9,-6,447,1,9,-5,438,1,9,-4,438,1,9,-3,438,1,9,4,504,1,9,5,511,1,10,-7,511,1,10,-6,511,1,10,-5,511,1,10,-4,511,1,10,-3,511,1,10,-2,447,1,10,-1,438,1,10,0,438,1,10,1,438,1,10,2,438,1,10,3,438,1,10,4,510,1,10,5,511,1,11,-3,511,1,11,-2,511,1,11,-1,511,1,11,0,511,1,11,1,511,1,11,2,511,1,11,3,511,1,11,4,511,1,11,5,511,1]} \ No newline at end of file diff --git a/DungeonShooting_Godot/resource/map/tileMaps/Test1/inlet/Start1/Preinstall.json b/DungeonShooting_Godot/resource/map/tileMaps/Test1/inlet/Start1/Preinstall.json new file mode 100644 index 0000000..8f8adc3 --- /dev/null +++ b/DungeonShooting_Godot/resource/map/tileMaps/Test1/inlet/Start1/Preinstall.json @@ -0,0 +1 @@ +[{"Name":"Preinstall1","Weight":100,"Remark":"","WaveList":[[{"Position":{"X":0,"Y":0},"Size":{"X":0,"Y":0},"SpecialMarkType":1,"DelayTime":0,"MarkList":[]}]]}] \ No newline at end of file diff --git a/DungeonShooting_Godot/resource/map/tileMaps/Test1/inlet/Start1/Preview.png b/DungeonShooting_Godot/resource/map/tileMaps/Test1/inlet/Start1/Preview.png new file mode 100644 index 0000000..ccdc961 --- /dev/null +++ b/DungeonShooting_Godot/resource/map/tileMaps/Test1/inlet/Start1/Preview.png Binary files differ diff --git a/DungeonShooting_Godot/resource/map/tileMaps/Test1/inlet/Start1/Preview.png.import b/DungeonShooting_Godot/resource/map/tileMaps/Test1/inlet/Start1/Preview.png.import new file mode 100644 index 0000000..e748d06 --- /dev/null +++ b/DungeonShooting_Godot/resource/map/tileMaps/Test1/inlet/Start1/Preview.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://7m4jc30x73j0" +path="res://.godot/imported/Preview.png-4974b74c6afb3b83df9e34acaa9196c7.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://resource/map/tileMaps/Test1/inlet/Start1/Preview.png" +dest_files=["res://.godot/imported/Preview.png-4974b74c6afb3b83df9e34acaa9196c7.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/DungeonShooting_Godot/resource/map/tileMaps/Test1/inlet/Start1/RoomInfo.json b/DungeonShooting_Godot/resource/map/tileMaps/Test1/inlet/Start1/RoomInfo.json new file mode 100644 index 0000000..daafc6c --- /dev/null +++ b/DungeonShooting_Godot/resource/map/tileMaps/Test1/inlet/Start1/RoomInfo.json @@ -0,0 +1 @@ +{"Position":{"X":-4,"Y":-6},"Size":{"X":11,"Y":10},"DoorAreaInfos":[],"GroupName":"Test1","RoomType":1,"RoomName":"Start1","Weight":100,"Remark":""} \ No newline at end of file diff --git a/DungeonShooting_Godot/resource/map/tileMaps/Test1/inlet/Start1/TileInfo.json b/DungeonShooting_Godot/resource/map/tileMaps/Test1/inlet/Start1/TileInfo.json new file mode 100644 index 0000000..158475e --- /dev/null +++ b/DungeonShooting_Godot/resource/map/tileMaps/Test1/inlet/Start1/TileInfo.json @@ -0,0 +1 @@ +{"NavigationVertices":[{"X":74,"Y":34},{"X":-26,"Y":34},{"X":-26,"Y":-42},{"X":74,"Y":-42}],"NavigationPolygon":[[0,1,2,3]],"Floor":[4,-2,0,3,3,-2,0,3,2,-2,0,3,1,-2,0,3,0,-2,0,3,-1,-2,0,3,-2,-2,0,3,-2,-1,0,3,-1,-1,0,3,0,-1,0,3,1,-1,0,3,2,-1,0,3,3,-1,0,3,4,-1,0,3,4,0,0,3,3,0,0,3,2,0,0,3,1,0,0,3,0,0,0,3,-1,0,0,3,-2,0,0,3,-2,1,0,3,-1,1,0,3,0,1,0,3,1,1,0,3,2,1,0,3,3,1,0,3,4,1,0,3,4,-3,0,3,3,-3,0,3,2,-3,0,3,1,-3,0,3,0,-3,0,3,-1,-3,0,3,-2,-3,0,3],"Middle":[-2,-5,63,1,-2,-4,2,2,-1,-5,63,1,-1,-4,2,2,0,-5,63,1,0,-4,2,2,1,-5,63,1,1,-4,2,2,2,-5,63,1,2,-4,2,2,3,-5,63,1,3,-4,2,2,4,-5,63,1,4,-4,2,2],"Top":[-4,-6,511,1,-4,-5,511,1,-4,-4,511,1,-4,-3,511,1,-4,-2,511,1,-4,-1,511,1,-4,0,511,1,-4,1,511,1,-4,2,511,1,-4,3,511,1,-3,-6,511,1,-3,-5,255,1,-3,-4,219,1,-3,-3,219,1,-3,-2,219,1,-3,-1,219,1,-3,0,219,1,-3,1,219,1,-3,2,507,1,-3,3,511,1,-2,-6,511,1,-2,2,504,1,-2,3,511,1,-1,-6,511,1,-1,2,504,1,-1,3,511,1,0,-6,511,1,0,2,504,1,0,3,511,1,1,-6,511,1,1,2,504,1,1,3,511,1,2,-6,511,1,2,2,504,1,2,3,511,1,3,-6,511,1,3,2,504,1,3,3,511,1,4,-6,511,1,4,2,504,1,4,3,511,1,5,-6,511,1,5,-5,447,1,5,-4,438,1,5,-3,438,1,5,-2,438,1,5,-1,438,1,5,0,438,1,5,1,438,1,5,2,510,1,5,3,511,1,6,-6,511,1,6,-5,511,1,6,-4,511,1,6,-3,511,1,6,-2,511,1,6,-1,511,1,6,0,511,1,6,1,511,1,6,2,511,1,6,3,511,1]} \ No newline at end of file diff --git a/DungeonShooting_Godot/resource/map/tileMaps/Test1/outlet/End1/Preinstall.json b/DungeonShooting_Godot/resource/map/tileMaps/Test1/outlet/End1/Preinstall.json new file mode 100644 index 0000000..638cd69 --- /dev/null +++ b/DungeonShooting_Godot/resource/map/tileMaps/Test1/outlet/End1/Preinstall.json @@ -0,0 +1 @@ +[{"Name":"Preinstall1","Weight":100,"Remark":"","WaveList":[[]]}] \ No newline at end of file diff --git a/DungeonShooting_Godot/resource/map/tileMaps/Test1/outlet/End1/Preview.png b/DungeonShooting_Godot/resource/map/tileMaps/Test1/outlet/End1/Preview.png new file mode 100644 index 0000000..e2c6849 --- /dev/null +++ b/DungeonShooting_Godot/resource/map/tileMaps/Test1/outlet/End1/Preview.png Binary files differ diff --git a/DungeonShooting_Godot/resource/map/tileMaps/Test1/outlet/End1/Preview.png.import b/DungeonShooting_Godot/resource/map/tileMaps/Test1/outlet/End1/Preview.png.import new file mode 100644 index 0000000..d152c19 --- /dev/null +++ b/DungeonShooting_Godot/resource/map/tileMaps/Test1/outlet/End1/Preview.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bjbhmlfjo4fbt" +path="res://.godot/imported/Preview.png-4e96f70cfb64e3f150b72a9f4e2754f6.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://resource/map/tileMaps/Test1/outlet/End1/Preview.png" +dest_files=["res://.godot/imported/Preview.png-4e96f70cfb64e3f150b72a9f4e2754f6.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/DungeonShooting_Godot/resource/map/tileMaps/Test1/outlet/End1/RoomInfo.json b/DungeonShooting_Godot/resource/map/tileMaps/Test1/outlet/End1/RoomInfo.json new file mode 100644 index 0000000..c7f87ac --- /dev/null +++ b/DungeonShooting_Godot/resource/map/tileMaps/Test1/outlet/End1/RoomInfo.json @@ -0,0 +1 @@ +{"Position":{"X":-4,"Y":-6},"Size":{"X":9,"Y":10},"DoorAreaInfos":[],"GroupName":"Test1","RoomType":2,"RoomName":"End1","Weight":100,"Remark":""} \ No newline at end of file diff --git a/DungeonShooting_Godot/resource/map/tileMaps/Test1/outlet/End1/TileInfo.json b/DungeonShooting_Godot/resource/map/tileMaps/Test1/outlet/End1/TileInfo.json new file mode 100644 index 0000000..3d8ad82 --- /dev/null +++ b/DungeonShooting_Godot/resource/map/tileMaps/Test1/outlet/End1/TileInfo.json @@ -0,0 +1 @@ +{"NavigationVertices":[{"X":42,"Y":34},{"X":-26,"Y":34},{"X":-26,"Y":-42},{"X":42,"Y":-42}],"NavigationPolygon":[[0,1,2,3]],"Floor":[-2,-1,0,3,-2,-2,0,3,-1,-2,0,3,0,-2,0,3,1,-2,0,3,1,-1,0,3,2,-1,0,3,0,-1,0,3,-1,-1,0,3,-2,0,0,3,-2,1,0,3,-1,1,0,3,0,1,0,3,1,1,0,3,2,1,0,3,2,0,0,3,1,0,0,3,0,0,0,3,-1,0,0,3,2,-2,0,3,2,-3,0,3,1,-3,0,3,0,-3,0,3,-1,-3,0,3,-2,-3,0,3],"Middle":[-2,-5,63,1,-2,-4,2,2,-1,-5,63,1,-1,-4,2,2,0,-5,63,1,0,-4,2,2,1,-5,63,1,1,-4,2,2,2,-5,63,1,2,-4,2,2],"Top":[-4,-6,511,1,-4,-5,511,1,-4,-4,511,1,-4,-3,511,1,-4,-2,511,1,-4,-1,511,1,-4,0,511,1,-4,1,511,1,-4,2,511,1,-4,3,511,1,-3,-6,511,1,-3,-5,255,1,-3,-4,219,1,-3,-3,219,1,-3,-2,219,1,-3,-1,219,1,-3,0,219,1,-3,1,219,1,-3,2,507,1,-3,3,511,1,-2,-6,511,1,-2,2,504,1,-2,3,511,1,-1,-6,511,1,-1,2,504,1,-1,3,511,1,0,-6,511,1,0,2,504,1,0,3,511,1,1,-6,511,1,1,2,504,1,1,3,511,1,2,-6,511,1,2,2,504,1,2,3,511,1,3,-6,511,1,3,-5,447,1,3,-4,438,1,3,-3,438,1,3,-2,438,1,3,-1,438,1,3,0,438,1,3,1,438,1,3,2,510,1,3,3,511,1,4,-6,511,1,4,-5,511,1,4,-4,511,1,4,-3,511,1,4,-2,511,1,4,-1,511,1,4,0,511,1,4,1,511,1,4,2,511,1,4,3,511,1]} \ No newline at end of file diff --git a/DungeonShooting_Godot/resource/map/tileSet/TileSet1/Main.png b/DungeonShooting_Godot/resource/map/tileSet/TileSet1/Main.png index cb64efb..83a63c2 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/src/framework/map/DungeonTileMap.cs b/DungeonShooting_Godot/src/framework/map/DungeonTileMap.cs index 9d39372..1777a4a 100644 --- a/DungeonShooting_Godot/src/framework/map/DungeonTileMap.cs +++ b/DungeonShooting_Godot/src/framework/map/DungeonTileMap.cs @@ -85,7 +85,7 @@ var y = int.MaxValue; var x2 = int.MinValue; var y2 = int.MinValue; - for (var i = 0; i < tileInfo.Floor.Count; i += 5) + for (var i = 0; i < tileInfo.Floor.Count; i += 4) { var posX = tileInfo.Floor[i]; var posY = tileInfo.Floor[i + 1]; @@ -98,7 +98,7 @@ var image = Image.Create(x2 - x + 3, y2 - y + 3, false, Image.Format.Rgba8); //image.Fill(Colors.Green); //填充像素点 - for (var i = 0; i < tileInfo.Floor.Count; i += 5) + for (var i = 0; i < tileInfo.Floor.Count; i += 4) { var posX = tileInfo.Floor[i] - x + 1; var posY = tileInfo.Floor[i + 1] - y + 1; @@ -109,38 +109,47 @@ roomInfo.PreviewTexture = imageTexture; //---------------------- 填充tile操作 ---------------------- + var tileConfig = GameApplication.Instance.DungeonManager.AutoTileConfig; + var terrainInfo = tileConfig.TerrainInfo; + //底层 - for (var i = 0; i < tileInfo.Floor.Count; i += 5) + for (var i = 0; i < tileInfo.Floor.Count; i += 4) { var posX = tileInfo.Floor[i]; var posY = tileInfo.Floor[i + 1]; - var sourceId = tileInfo.Floor[i + 2]; - var atlasCoordsX = tileInfo.Floor[i + 3]; - var atlasCoordsY = tileInfo.Floor[i + 4]; var pos = new Vector2I(roomInfo.Position.X + posX - rectPos.X, roomInfo.Position.Y + posY - rectPos.Y); - _tileRoot.SetCell(GameConfig.FloorMapLayer, pos, sourceId, new Vector2I(atlasCoordsX, atlasCoordsY)); + var bit = (uint)tileInfo.Floor[i + 2]; + var type = (byte)tileInfo.Floor[i + 3]; + var index = terrainInfo.TerrainBitToIndex(bit, type); + var terrainCell = terrainInfo.GetTerrainCell(index, type); + var atlasCoords = terrainInfo.GetPosition(terrainCell); + _tileRoot.SetCell(GameConfig.FloorMapLayer, pos, tileConfig.SourceId, atlasCoords); } //中层 - for (var i = 0; i < tileInfo.Middle.Count; i += 5) + for (var i = 0; i < tileInfo.Middle.Count; i += 4) { var posX = tileInfo.Middle[i]; var posY = tileInfo.Middle[i + 1]; - var sourceId = tileInfo.Middle[i + 2]; - var atlasCoordsX = tileInfo.Middle[i + 3]; - var atlasCoordsY = tileInfo.Middle[i + 4]; var pos = new Vector2I(roomInfo.Position.X + posX - rectPos.X, roomInfo.Position.Y + posY - rectPos.Y); - _tileRoot.SetCell(GameConfig.MiddleMapLayer, pos, sourceId, new Vector2I(atlasCoordsX, atlasCoordsY)); + var bit = (uint)tileInfo.Middle[i + 2]; + var type = (byte)tileInfo.Middle[i + 3]; + var index = terrainInfo.TerrainBitToIndex(bit, type); + var terrainCell = terrainInfo.GetTerrainCell(index, type); + var atlasCoords = terrainInfo.GetPosition(terrainCell); + _tileRoot.SetCell(GameConfig.MiddleMapLayer, pos, tileConfig.SourceId, atlasCoords); } //顶层 - for (var i = 0; i < tileInfo.Top.Count; i += 5) + for (var i = 0; i < tileInfo.Top.Count; i += 4) { var posX = tileInfo.Top[i]; var posY = tileInfo.Top[i + 1]; - var sourceId = tileInfo.Top[i + 2]; - var atlasCoordsX = tileInfo.Top[i + 3]; - var atlasCoordsY = tileInfo.Top[i + 4]; var pos = new Vector2I(roomInfo.Position.X + posX - rectPos.X, roomInfo.Position.Y + posY - rectPos.Y); - _tileRoot.SetCell(GameConfig.TopMapLayer, pos, sourceId, new Vector2I(atlasCoordsX, atlasCoordsY)); + var bit = (uint)tileInfo.Top[i + 2]; + var type = (byte)tileInfo.Top[i + 3]; + var index = terrainInfo.TerrainBitToIndex(bit, type); + var terrainCell = terrainInfo.GetTerrainCell(index, type); + var atlasCoords = terrainInfo.GetPosition(terrainCell); + _tileRoot.SetCell(GameConfig.TopMapLayer, pos, tileConfig.SourceId, atlasCoords); } //寻找可用传送点 diff --git a/DungeonShooting_Godot/src/game/GameApplication.cs b/DungeonShooting_Godot/src/game/GameApplication.cs index e748120..21cc943 100644 --- a/DungeonShooting_Godot/src/game/GameApplication.cs +++ b/DungeonShooting_Godot/src/game/GameApplication.cs @@ -104,7 +104,7 @@ Enemy.InitEnemyAttribute(); DungeonConfig = new DungeonConfig(); - DungeonConfig.GroupName = "TestGroup2"; + DungeonConfig.GroupName = "Test1"; DungeonConfig.RoomCount = 20; } diff --git a/DungeonShooting_Godot/src/game/room/AutoTileConfig.cs b/DungeonShooting_Godot/src/game/room/AutoTileConfig.cs index 844db17..599edec 100644 --- a/DungeonShooting_Godot/src/game/room/AutoTileConfig.cs +++ b/DungeonShooting_Godot/src/game/room/AutoTileConfig.cs @@ -121,19 +121,19 @@ int[] data; if (terrainInfo.M.TryGetValue(0, out data)) { - Wall_Vertical_Single = new TileCellData(sourceId, terrainInfo.GetPosition(data), TerrainPeering.None, TileSetTerrainInfo.MiddleLayerType, GameConfig.MiddleMapLayer); + Wall_Vertical_Single = new TileCellData(sourceId, terrainInfo.GetPosition(data), 0, TileSetTerrainInfo.MiddleLayerType, GameConfig.MiddleMapLayer); } if (terrainInfo.M.TryGetValue(1, out data)) { - Wall_Vertical_Left= new TileCellData(sourceId, terrainInfo.GetPosition(data), TerrainPeering.None, TileSetTerrainInfo.MiddleLayerType, GameConfig.MiddleMapLayer); + Wall_Vertical_Left= new TileCellData(sourceId, terrainInfo.GetPosition(data), 1, TileSetTerrainInfo.MiddleLayerType, GameConfig.MiddleMapLayer); } if (terrainInfo.M.TryGetValue(2, out data)) { - Wall_Vertical_Center= new TileCellData(sourceId, terrainInfo.GetPosition(data), TerrainPeering.None, TileSetTerrainInfo.MiddleLayerType, GameConfig.MiddleMapLayer); + Wall_Vertical_Center= new TileCellData(sourceId, terrainInfo.GetPosition(data), 2, TileSetTerrainInfo.MiddleLayerType, GameConfig.MiddleMapLayer); } if (terrainInfo.M.TryGetValue(3, out data)) { - Wall_Vertical_Right= new TileCellData(sourceId, terrainInfo.GetPosition(data), TerrainPeering.None, TileSetTerrainInfo.MiddleLayerType, GameConfig.MiddleMapLayer); + Wall_Vertical_Right= new TileCellData(sourceId, terrainInfo.GetPosition(data), 3, TileSetTerrainInfo.MiddleLayerType, GameConfig.MiddleMapLayer); } } @@ -141,7 +141,7 @@ { if (terrainInfo.F.TryGetValue(0, out var data)) { - Floor = new TileCellData(sourceId, terrainInfo.GetPosition(data), TerrainPeering.None, TileSetTerrainInfo.FloorLayerType, GameConfig.FloorMapLayer); + Floor = new TileCellData(sourceId, terrainInfo.GetPosition(data), 0, TileSetTerrainInfo.FloorLayerType, GameConfig.FloorMapLayer); } }