diff --git a/DungeonShooting_Godot/prefab/ui/MapEditor.tscn b/DungeonShooting_Godot/prefab/ui/MapEditor.tscn index d3ded4f..0d36e86 100644 --- a/DungeonShooting_Godot/prefab/ui/MapEditor.tscn +++ b/DungeonShooting_Godot/prefab/ui/MapEditor.tscn @@ -1,7 +1,7 @@ [gd_scene load_steps=8 format=3 uid="uid://csbxfkdupsckv"] [ext_resource type="Script" path="res://src/game/ui/mapEditor/MapEditorPanel.cs" id="1_5s7a0"] -[ext_resource type="TileSet" uid="uid://b00g22o1cqhe8" path="res://resource/map/tileset/TileSet1.tres" id="2_nr5lp"] +[ext_resource type="TileSet" uid="uid://b00g22o1cqhe8" path="res://resource/map/tileset/TileSet1.tres" id="2_vrg60"] [ext_resource type="Script" path="res://src/game/ui/mapEditor/TileView/EditorTileMap.cs" id="2_waq8f"] [ext_resource type="Texture2D" uid="uid://0878uloew5jo" path="res://resource/sprite/ui/mapEditor/ErrorCell.png" id="4_465u2"] @@ -113,7 +113,7 @@ [node name="TileMap" type="TileMap" parent="Bg/HSplitContainer/Left/MapView/SubViewport"] position = Vector2(500, 540) scale = Vector2(4, 4) -tile_set = ExtResource("2_nr5lp") +tile_set = ExtResource("2_vrg60") format = 2 script = ExtResource("2_waq8f") diff --git a/DungeonShooting_Godot/resource/map/RoomConfig.json b/DungeonShooting_Godot/resource/map/RoomConfig.json index c718336..d761905 100644 --- a/DungeonShooting_Godot/resource/map/RoomConfig.json +++ b/DungeonShooting_Godot/resource/map/RoomConfig.json @@ -4,49 +4,49 @@ "BattleList": [ { "ScenePath": "res://resource/map/tileMaps/testGroup/battle/Room1.tscn", - "ConfigPath": "res://resource/map/tiledata/testGroup/battle/Room1.json" + "RoomPath": "res://resource/map/tiledata/testGroup/battle/Room1.json" }, { "ScenePath": "res://resource/map/tileMaps/testGroup/battle/Room2.tscn", - "ConfigPath": "res://resource/map/tiledata/testGroup/battle/Room2.json" + "RoomPath": "res://resource/map/tiledata/testGroup/battle/Room2.json" }, { "ScenePath": "res://resource/map/tileMaps/testGroup/battle/Room3.tscn", - "ConfigPath": "res://resource/map/tiledata/testGroup/battle/Room3.json" + "RoomPath": "res://resource/map/tiledata/testGroup/battle/Room3.json" }, { "ScenePath": "res://resource/map/tileMaps/testGroup/battle/Room4.tscn", - "ConfigPath": "res://resource/map/tiledata/testGroup/battle/Room4.json" + "RoomPath": "res://resource/map/tiledata/testGroup/battle/Room4.json" }, { "ScenePath": "res://resource/map/tileMaps/testGroup/battle/Room5.tscn", - "ConfigPath": "res://resource/map/tiledata/testGroup/battle/Room5.json" + "RoomPath": "res://resource/map/tiledata/testGroup/battle/Room5.json" }, { "ScenePath": "res://resource/map/tileMaps/testGroup/battle/Room6.tscn", - "ConfigPath": "res://resource/map/tiledata/testGroup/battle/Room6.json" + "RoomPath": "res://resource/map/tiledata/testGroup/battle/Room6.json" }, { "ScenePath": "res://resource/map/tileMaps/testGroup/battle/Room8.tscn", - "ConfigPath": "res://resource/map/tiledata/testGroup/battle/Room8.json" + "RoomPath": "res://resource/map/tiledata/testGroup/battle/Room8.json" } ], "InletList": [ { "ScenePath": "res://resource/map/tileMaps/testGroup/inlet/Room1.tscn", - "ConfigPath": "res://resource/map/tiledata/testGroup/inlet/Room1.json" + "RoomPath": "res://resource/map/tiledata/testGroup/inlet/Room1.json" } ], "OutletList": [ { "ScenePath": "res://resource/map/tileMaps/testGroup/outlet/Room1.tscn", - "ConfigPath": "res://resource/map/tiledata/testGroup/outlet/Room1.json" + "RoomPath": "res://resource/map/tiledata/testGroup/outlet/Room1.json" } ], "BossList": [ { "ScenePath": "res://resource/map/tileMaps/testGroup/boss/Room1.tscn", - "ConfigPath": "res://resource/map/tiledata/testGroup/boss/Room1.json" + "RoomPath": "res://resource/map/tiledata/testGroup/boss/Room1.json" } ], "RewardList": [], diff --git a/DungeonShooting_Godot/resource/map/tileData/testGroup/battle/Room1.json b/DungeonShooting_Godot/resource/map/tileData/testGroup/battle/Room1.json new file mode 100644 index 0000000..1b6dd17 --- /dev/null +++ b/DungeonShooting_Godot/resource/map/tileData/testGroup/battle/Room1.json @@ -0,0 +1,96 @@ +{ + "Position": { + "X": -5, + "Y": -6 + }, + "Size": { + "X": 24, + "Y": 15 + }, + "DoorAreaInfos": [], + "NavigationList": [ + { + "Type": 0, + "Points": [ + { + "X": -56, + "Y": -72 + }, + { + "X": 280, + "Y": -72 + }, + { + "X": 280, + "Y": 128 + }, + { + "X": -56, + "Y": 128 + } + ] + }, + { + "Type": 1, + "Points": [ + { + "X": -24, + "Y": -32 + }, + { + "X": 56, + "Y": -32 + }, + { + "X": 56, + "Y": 8 + }, + { + "X": 24, + "Y": 8 + }, + { + "X": 24, + "Y": 24 + }, + { + "X": -24, + "Y": 24 + } + ] + }, + { + "Type": 1, + "Points": [ + { + "X": 200, + "Y": 32 + }, + { + "X": 248, + "Y": 32 + }, + { + "X": 248, + "Y": 88 + }, + { + "X": 168, + "Y": 88 + }, + { + "X": 168, + "Y": 48 + }, + { + "X": 200, + "Y": 48 + } + ] + } + ], + "GroupName": "testGroup", + "RoomType": 0, + "FileName": "Room1", + "Weight": 100 +} \ No newline at end of file diff --git a/DungeonShooting_Godot/resource/map/tileData/testGroup/battle/Room2.json b/DungeonShooting_Godot/resource/map/tileData/testGroup/battle/Room2.json new file mode 100644 index 0000000..ea48daf --- /dev/null +++ b/DungeonShooting_Godot/resource/map/tileData/testGroup/battle/Room2.json @@ -0,0 +1,154 @@ +{ + "Position": { + "X": -5, + "Y": -6 + }, + "Size": { + "X": 31, + "Y": 24 + }, + "DoorAreaInfos": [ + { + "Direction": 3, + "Start": 144, + "End": 432 + }, + { + "Direction": 1, + "Start": 48, + "End": 176 + }, + { + "Direction": 1, + "Start": 256, + "End": 368 + }, + { + "Direction": 2, + "Start": 16, + "End": 128 + }, + { + "Direction": 2, + "Start": 256, + "End": 480 + }, + { + "Direction": 0, + "Start": 272, + "End": 368 + } + ], + "NavigationList": [ + { + "Type": 0, + "Points": [ + { + "X": 72, + "Y": -72 + }, + { + "X": 344, + "Y": -72 + }, + { + "X": 344, + "Y": 32 + }, + { + "X": 248, + "Y": 32 + }, + { + "X": 248, + "Y": 120 + }, + { + "X": 344, + "Y": 120 + }, + { + "X": 344, + "Y": 200 + }, + { + "X": 392, + "Y": 200 + }, + { + "X": 392, + "Y": 272 + }, + { + "X": 184, + "Y": 272 + }, + { + "X": 184, + "Y": 208 + }, + { + "X": 40, + "Y": 208 + }, + { + "X": 40, + "Y": 272 + }, + { + "X": -56, + "Y": 272 + }, + { + "X": -56, + "Y": 184 + }, + { + "X": -8, + "Y": 184 + }, + { + "X": -8, + "Y": 80 + }, + { + "X": -56, + "Y": 80 + }, + { + "X": -56, + "Y": -24 + }, + { + "X": 72, + "Y": -24 + } + ] + }, + { + "Type": 1, + "Points": [ + { + "X": 56, + "Y": 48 + }, + { + "X": 168, + "Y": 48 + }, + { + "X": 168, + "Y": 136 + }, + { + "X": 56, + "Y": 136 + } + ] + } + ], + "GroupName": "testGroup", + "RoomType": 0, + "FileName": "Room2", + "Weight": 100 +} \ No newline at end of file diff --git a/DungeonShooting_Godot/resource/map/tileData/testGroup/battle/Room3.json b/DungeonShooting_Godot/resource/map/tileData/testGroup/battle/Room3.json new file mode 100644 index 0000000..c8f0091 --- /dev/null +++ b/DungeonShooting_Godot/resource/map/tileData/testGroup/battle/Room3.json @@ -0,0 +1,117 @@ +{ + "Position": { + "X": -1, + "Y": -1 + }, + "Size": { + "X": 26, + "Y": 20 + }, + "DoorAreaInfos": [ + { + "Direction": 3, + "Start": 16, + "End": 128 + }, + { + "Direction": 3, + "Start": 208, + "End": 320 + }, + { + "Direction": 1, + "Start": 16, + "End": 224 + }, + { + "Direction": 2, + "Start": 96, + "End": 192 + }, + { + "Direction": 2, + "Start": 288, + "End": 400 + }, + { + "Direction": 0, + "Start": 96, + "End": 304 + } + ], + "NavigationList": [ + { + "Type": 0, + "Points": [ + { + "X": 8, + "Y": 8 + }, + { + "X": 104, + "Y": 8 + }, + { + "X": 104, + "Y": 88 + }, + { + "X": 200, + "Y": 88 + }, + { + "X": 200, + "Y": 8 + }, + { + "X": 296, + "Y": 8 + }, + { + "X": 296, + "Y": 88 + }, + { + "X": 376, + "Y": 88 + }, + { + "X": 376, + "Y": 288 + }, + { + "X": 280, + "Y": 288 + }, + { + "X": 280, + "Y": 208 + }, + { + "X": 168, + "Y": 208 + }, + { + "X": 168, + "Y": 288 + }, + { + "X": 88, + "Y": 288 + }, + { + "X": 88, + "Y": 208 + }, + { + "X": 8, + "Y": 208 + } + ] + } + ], + "GroupName": "testGroup", + "RoomType": 0, + "FileName": "Room3", + "Weight": 100 +} \ No newline at end of file diff --git a/DungeonShooting_Godot/resource/map/tileData/testGroup/battle/Room4.json b/DungeonShooting_Godot/resource/map/tileData/testGroup/battle/Room4.json new file mode 100644 index 0000000..464869f --- /dev/null +++ b/DungeonShooting_Godot/resource/map/tileData/testGroup/battle/Room4.json @@ -0,0 +1,259 @@ +{ + "Position": { + "X": -5, + "Y": -5 + }, + "Size": { + "X": 32, + "Y": 29 + }, + "DoorAreaInfos": [ + { + "Direction": 3, + "Start": 16, + "End": 176 + }, + { + "Direction": 1, + "Start": 16, + "End": 176 + }, + { + "Direction": 1, + "Start": 304, + "End": 448 + }, + { + "Direction": 2, + "Start": 16, + "End": 144 + }, + { + "Direction": 2, + "Start": 352, + "End": 496 + }, + { + "Direction": 0, + "Start": 304, + "End": 448 + }, + { + "Direction": 0, + "Start": 16, + "End": 176 + }, + { + "Direction": 3, + "Start": 336, + "End": 496 + } + ], + "NavigationList": [ + { + "Type": 0, + "Points": [ + { + "X": -56, + "Y": -56 + }, + { + "X": 88, + "Y": -56 + }, + { + "X": 88, + "Y": 8 + }, + { + "X": 264, + "Y": 8 + }, + { + "X": 264, + "Y": -56 + }, + { + "X": 408, + "Y": -56 + }, + { + "X": 408, + "Y": 96 + }, + { + "X": 344, + "Y": 96 + }, + { + "X": 344, + "Y": 232 + }, + { + "X": 408, + "Y": 232 + }, + { + "X": 408, + "Y": 368 + }, + { + "X": 264, + "Y": 368 + }, + { + "X": 264, + "Y": 304 + }, + { + "X": 88, + "Y": 304 + }, + { + "X": 88, + "Y": 368 + }, + { + "X": -56, + "Y": 368 + }, + { + "X": -56, + "Y": 232 + }, + { + "X": 8, + "Y": 232 + }, + { + "X": 8, + "Y": 96 + }, + { + "X": -56, + "Y": 96 + } + ] + }, + { + "Type": 1, + "Points": [ + { + "X": 88, + "Y": 32 + }, + { + "X": 136, + "Y": 32 + }, + { + "X": 136, + "Y": 136 + }, + { + "X": 24, + "Y": 136 + }, + { + "X": 24, + "Y": 96 + }, + { + "X": 88, + "Y": 96 + } + ] + }, + { + "Type": 1, + "Points": [ + { + "X": 216, + "Y": 32 + }, + { + "X": 264, + "Y": 32 + }, + { + "X": 264, + "Y": 96 + }, + { + "X": 328, + "Y": 96 + }, + { + "X": 328, + "Y": 136 + }, + { + "X": 216, + "Y": 136 + } + ] + }, + { + "Type": 1, + "Points": [ + { + "X": 24, + "Y": 192 + }, + { + "X": 136, + "Y": 192 + }, + { + "X": 136, + "Y": 280 + }, + { + "X": 88, + "Y": 280 + }, + { + "X": 88, + "Y": 232 + }, + { + "X": 24, + "Y": 232 + } + ] + }, + { + "Type": 1, + "Points": [ + { + "X": 216, + "Y": 192 + }, + { + "X": 328, + "Y": 192 + }, + { + "X": 328, + "Y": 232 + }, + { + "X": 264, + "Y": 232 + }, + { + "X": 264, + "Y": 280 + }, + { + "X": 216, + "Y": 280 + } + ] + } + ], + "GroupName": "testGroup", + "RoomType": 0, + "FileName": "Room4", + "Weight": 100 +} \ No newline at end of file diff --git a/DungeonShooting_Godot/resource/map/tileData/testGroup/battle/Room5.json b/DungeonShooting_Godot/resource/map/tileData/testGroup/battle/Room5.json new file mode 100644 index 0000000..5e6371c --- /dev/null +++ b/DungeonShooting_Godot/resource/map/tileData/testGroup/battle/Room5.json @@ -0,0 +1,154 @@ +{ + "Position": { + "X": -3, + "Y": -6 + }, + "Size": { + "X": 21, + "Y": 18 + }, + "DoorAreaInfos": [ + { + "Direction": 0, + "Start": 16, + "End": 192 + }, + { + "Direction": 3, + "Start": 80, + "End": 320 + }, + { + "Direction": 1, + "Start": 64, + "End": 240 + }, + { + "Direction": 2, + "Start": 96, + "End": 240 + } + ], + "NavigationList": [ + { + "Type": 0, + "Points": [ + { + "X": 40, + "Y": -72 + }, + { + "X": 264, + "Y": -72 + }, + { + "X": 264, + "Y": 96 + }, + { + "X": 232, + "Y": 96 + }, + { + "X": 232, + "Y": 144 + }, + { + "X": 184, + "Y": 144 + }, + { + "X": 184, + "Y": 176 + }, + { + "X": 56, + "Y": 176 + }, + { + "X": 56, + "Y": 144 + }, + { + "X": -24, + "Y": 144 + }, + { + "X": -24, + "Y": -24 + }, + { + "X": 40, + "Y": -24 + } + ] + }, + { + "Type": 1, + "Points": [ + { + "X": 72, + "Y": -48 + }, + { + "X": 200, + "Y": -48 + }, + { + "X": 200, + "Y": 8 + }, + { + "X": 72, + "Y": 8 + } + ] + }, + { + "Type": 1, + "Points": [ + { + "X": -8, + "Y": 32 + }, + { + "X": 72, + "Y": 32 + }, + { + "X": 72, + "Y": 88 + }, + { + "X": -8, + "Y": 88 + } + ] + }, + { + "Type": 1, + "Points": [ + { + "X": 136, + "Y": 48 + }, + { + "X": 216, + "Y": 48 + }, + { + "X": 216, + "Y": 104 + }, + { + "X": 136, + "Y": 104 + } + ] + } + ], + "GroupName": "testGroup", + "RoomType": 0, + "FileName": "Room5", + "Weight": 100 +} \ No newline at end of file diff --git a/DungeonShooting_Godot/resource/map/tileData/testGroup/battle/Room6.json b/DungeonShooting_Godot/resource/map/tileData/testGroup/battle/Room6.json new file mode 100644 index 0000000..7d83388 --- /dev/null +++ b/DungeonShooting_Godot/resource/map/tileData/testGroup/battle/Room6.json @@ -0,0 +1,186 @@ +{ + "Position": { + "X": -3, + "Y": -6 + }, + "Size": { + "X": 24, + "Y": 14 + }, + "DoorAreaInfos": [ + { + "Direction": 3, + "Start": 16, + "End": 368 + }, + { + "Direction": 0, + "Start": 16, + "End": 128 + }, + { + "Direction": 2, + "Start": 32, + "End": 272 + }, + { + "Direction": 1, + "Start": 16, + "End": 128 + } + ], + "NavigationList": [ + { + "Type": 0, + "Points": [ + { + "X": -24, + "Y": -72 + }, + { + "X": 312, + "Y": -72 + }, + { + "X": 312, + "Y": 32 + }, + { + "X": 280, + "Y": 32 + }, + { + "X": 280, + "Y": 80 + }, + { + "X": 248, + "Y": 80 + }, + { + "X": 248, + "Y": 112 + }, + { + "X": -8, + "Y": 112 + }, + { + "X": -8, + "Y": 32 + }, + { + "X": -24, + "Y": 32 + } + ] + }, + { + "Type": 1, + "Points": [ + { + "X": 56, + "Y": -48 + }, + { + "X": 136, + "Y": -48 + }, + { + "X": 136, + "Y": -32 + }, + { + "X": 184, + "Y": -32 + }, + { + "X": 184, + "Y": 8 + }, + { + "X": 88, + "Y": 8 + }, + { + "X": 88, + "Y": 40 + }, + { + "X": 24, + "Y": 40 + }, + { + "X": 24, + "Y": -32 + }, + { + "X": 56, + "Y": -32 + } + ] + }, + { + "Type": 1, + "Points": [ + { + "X": 216, + "Y": -48 + }, + { + "X": 280, + "Y": -48 + }, + { + "X": 280, + "Y": 8 + }, + { + "X": 216, + "Y": 8 + } + ] + }, + { + "Type": 1, + "Points": [ + { + "X": 104, + "Y": 32 + }, + { + "X": 216, + "Y": 32 + }, + { + "X": 216, + "Y": 72 + }, + { + "X": 184, + "Y": 72 + }, + { + "X": 184, + "Y": 88 + }, + { + "X": 136, + "Y": 88 + }, + { + "X": 136, + "Y": 72 + }, + { + "X": 104, + "Y": 72 + } + ] + } + ], + "GroupName": "testGroup", + "RoomType": 0, + "FileName": "Room6", + "Weight": 100 +} \ No newline at end of file diff --git a/DungeonShooting_Godot/resource/map/tileData/testGroup/battle/Room8.json b/DungeonShooting_Godot/resource/map/tileData/testGroup/battle/Room8.json new file mode 100644 index 0000000..6cd97e7 --- /dev/null +++ b/DungeonShooting_Godot/resource/map/tileData/testGroup/battle/Room8.json @@ -0,0 +1,38 @@ +{ + "Position": { + "X": -5, + "Y": -3 + }, + "Size": { + "X": 25, + "Y": 16 + }, + "DoorAreaInfos": [], + "NavigationList": [ + { + "Type": 0, + "Points": [ + { + "X": -56, + "Y": -24 + }, + { + "X": 296, + "Y": -24 + }, + { + "X": 296, + "Y": 192 + }, + { + "X": -56, + "Y": 192 + } + ] + } + ], + "GroupName": "testGroup", + "RoomType": 0, + "FileName": "Room8", + "Weight": 100 +} \ No newline at end of file diff --git a/DungeonShooting_Godot/resource/map/tileData/testGroup/boss/Room1.json b/DungeonShooting_Godot/resource/map/tileData/testGroup/boss/Room1.json new file mode 100644 index 0000000..d2d0c0e --- /dev/null +++ b/DungeonShooting_Godot/resource/map/tileData/testGroup/boss/Room1.json @@ -0,0 +1,91 @@ +{ + "Position": { + "X": -5, + "Y": -6 + }, + "Size": { + "X": 39, + "Y": 25 + }, + "DoorAreaInfos": [], + "NavigationList": [ + { + "Type": 0, + "Points": [ + { + "X": -56, + "Y": -72 + }, + { + "X": 520, + "Y": -72 + }, + { + "X": 520, + "Y": 288 + }, + { + "X": -56, + "Y": 288 + } + ] + }, + { + "Type": 1, + "Points": [ + { + "X": 200, + "Y": 0 + }, + { + "X": 280, + "Y": 0 + }, + { + "X": 280, + "Y": 64 + }, + { + "X": 344, + "Y": 64 + }, + { + "X": 344, + "Y": 136 + }, + { + "X": 280, + "Y": 136 + }, + { + "X": 280, + "Y": 200 + }, + { + "X": 200, + "Y": 200 + }, + { + "X": 200, + "Y": 136 + }, + { + "X": 136, + "Y": 136 + }, + { + "X": 136, + "Y": 64 + }, + { + "X": 200, + "Y": 64 + } + ] + } + ], + "GroupName": "testGroup", + "RoomType": 3, + "FileName": "Room1", + "Weight": 100 +} \ No newline at end of file diff --git a/DungeonShooting_Godot/resource/map/tileData/testGroup/inlet/Room1.json b/DungeonShooting_Godot/resource/map/tileData/testGroup/inlet/Room1.json new file mode 100644 index 0000000..6c3fba1 --- /dev/null +++ b/DungeonShooting_Godot/resource/map/tileData/testGroup/inlet/Room1.json @@ -0,0 +1,38 @@ +{ + "Position": { + "X": -1, + "Y": -1 + }, + "Size": { + "X": 12, + "Y": 8 + }, + "DoorAreaInfos": [], + "NavigationList": [ + { + "Type": 0, + "Points": [ + { + "X": 8, + "Y": 8 + }, + { + "X": 152, + "Y": 8 + }, + { + "X": 152, + "Y": 96 + }, + { + "X": 8, + "Y": 96 + } + ] + } + ], + "GroupName": "testGroup", + "RoomType": 1, + "FileName": "Room1", + "Weight": 100 +} \ No newline at end of file diff --git a/DungeonShooting_Godot/resource/map/tileData/testGroup/outlet/Room1.json b/DungeonShooting_Godot/resource/map/tileData/testGroup/outlet/Room1.json new file mode 100644 index 0000000..d69b1f8 --- /dev/null +++ b/DungeonShooting_Godot/resource/map/tileData/testGroup/outlet/Room1.json @@ -0,0 +1,75 @@ +{ + "Position": { + "X": -4, + "Y": -4 + }, + "Size": { + "X": 15, + "Y": 12 + }, + "DoorAreaInfos": [], + "NavigationList": [ + { + "Type": 0, + "Points": [ + { + "X": -40, + "Y": -40 + }, + { + "X": 152, + "Y": -40 + }, + { + "X": 152, + "Y": 112 + }, + { + "X": -40, + "Y": 112 + } + ] + }, + { + "Type": 1, + "Points": [ + { + "X": -8, + "Y": 0 + }, + { + "X": 120, + "Y": 0 + }, + { + "X": 120, + "Y": 72 + }, + { + "X": 72, + "Y": 72 + }, + { + "X": 72, + "Y": 40 + }, + { + "X": 40, + "Y": 40 + }, + { + "X": 40, + "Y": 72 + }, + { + "X": -8, + "Y": 72 + } + ] + } + ], + "GroupName": "testGroup", + "RoomType": 2, + "FileName": "Room1", + "Weight": 100 +} \ No newline at end of file diff --git a/DungeonShooting_Godot/resource/map/tileMaps/testGroup/battle/Room1.tscn b/DungeonShooting_Godot/resource/map/tileMaps/testGroup/battle/Room1.tscn index 34a463c..6c22abc 100644 --- a/DungeonShooting_Godot/resource/map/tileMaps/testGroup/battle/Room1.tscn +++ b/DungeonShooting_Godot/resource/map/tileMaps/testGroup/battle/Room1.tscn @@ -1,10 +1,11 @@ [gd_scene load_steps=5 format=3 uid="uid://bltvbn3urhy1q"] -[ext_resource type="TileSet" uid="uid://b00g22o1cqhe8" path="res://resource/map/tileset/TileSet1.tres" id="1_qn8qv"] +[ext_resource type="TileSet" uid="uid://b00g22o1cqhe8" path="res://resource/map/tileSet/TileSet1.tres" id="1_qn8qv"] [ext_resource type="Script" path="res://src/framework/map/mark/EnemyMark.cs" id="3_68nmn"] [ext_resource type="Script" path="res://src/framework/map/mark/ActivityMark.cs" id="4_vkqhy"] [ext_resource type="Script" path="res://src/framework/map/DungeonRoomTemplate.cs" id="dungeonRoomTemplate"] + [node name="Room1" type="TileMap"] tile_set = ExtResource("1_qn8qv") format = 2 diff --git a/DungeonShooting_Godot/resource/map/tileMaps/testGroup/battle/Room2.tscn b/DungeonShooting_Godot/resource/map/tileMaps/testGroup/battle/Room2.tscn index f8bc58c..5a98f2c 100644 --- a/DungeonShooting_Godot/resource/map/tileMaps/testGroup/battle/Room2.tscn +++ b/DungeonShooting_Godot/resource/map/tileMaps/testGroup/battle/Room2.tscn @@ -1,9 +1,10 @@ [gd_scene load_steps=4 format=3 uid="uid://bnlsfk3dahtos"] -[ext_resource type="TileSet" uid="uid://b00g22o1cqhe8" path="res://resource/map/tileset/TileSet1.tres" id="1_ar45p"] +[ext_resource type="TileSet" uid="uid://b00g22o1cqhe8" path="res://resource/map/tileSet/TileSet1.tres" id="1_ar45p"] [ext_resource type="Script" path="res://src/framework/map/mark/EnemyMark.cs" id="3_v71xh"] [ext_resource type="Script" path="res://src/framework/map/DungeonRoomTemplate.cs" id="dungeonRoomTemplate"] + [node name="Room2" type="TileMap"] tile_set = ExtResource("1_ar45p") format = 2 diff --git a/DungeonShooting_Godot/resource/map/tileMaps/testGroup/battle/Room3.tscn b/DungeonShooting_Godot/resource/map/tileMaps/testGroup/battle/Room3.tscn index 5499714..a01dd51 100644 --- a/DungeonShooting_Godot/resource/map/tileMaps/testGroup/battle/Room3.tscn +++ b/DungeonShooting_Godot/resource/map/tileMaps/testGroup/battle/Room3.tscn @@ -1,9 +1,10 @@ [gd_scene load_steps=4 format=3 uid="uid://wvv4lbvlarod"] -[ext_resource type="TileSet" uid="uid://b00g22o1cqhe8" path="res://resource/map/tileset/TileSet1.tres" id="1_jjauj"] +[ext_resource type="TileSet" uid="uid://b00g22o1cqhe8" path="res://resource/map/tileSet/TileSet1.tres" id="1_jjauj"] [ext_resource type="Script" path="res://src/framework/map/mark/EnemyMark.cs" id="3_u8a04"] [ext_resource type="Script" path="res://src/framework/map/DungeonRoomTemplate.cs" id="dungeonRoomTemplate"] + [node name="Room3" type="TileMap"] tile_set = ExtResource("1_jjauj") format = 2 diff --git a/DungeonShooting_Godot/resource/map/tileMaps/testGroup/battle/Room4.tscn b/DungeonShooting_Godot/resource/map/tileMaps/testGroup/battle/Room4.tscn index aa32fb9..30ee565 100644 --- a/DungeonShooting_Godot/resource/map/tileMaps/testGroup/battle/Room4.tscn +++ b/DungeonShooting_Godot/resource/map/tileMaps/testGroup/battle/Room4.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=4 format=3 uid="uid://bunl6nluxu3qn"] -[ext_resource type="TileSet" uid="uid://b00g22o1cqhe8" path="res://resource/map/tileset/TileSet1.tres" id="1_k1pu4"] +[ext_resource type="TileSet" uid="uid://b00g22o1cqhe8" path="res://resource/map/tileSet/TileSet1.tres" id="1_k1pu4"] [ext_resource type="Script" path="res://src/framework/map/mark/EnemyMark.cs" id="3_tkueb"] [ext_resource type="Script" path="res://src/framework/map/DungeonRoomTemplate.cs" id="dungeonRoomTemplate"] diff --git a/DungeonShooting_Godot/resource/map/tileMaps/testGroup/battle/Room5.tscn b/DungeonShooting_Godot/resource/map/tileMaps/testGroup/battle/Room5.tscn index 001a211..6e521fa 100644 --- a/DungeonShooting_Godot/resource/map/tileMaps/testGroup/battle/Room5.tscn +++ b/DungeonShooting_Godot/resource/map/tileMaps/testGroup/battle/Room5.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=4 format=3 uid="uid://cllr044e4g3cg"] -[ext_resource type="TileSet" uid="uid://b00g22o1cqhe8" path="res://resource/map/tileset/TileSet1.tres" id="1_657ry"] +[ext_resource type="TileSet" uid="uid://b00g22o1cqhe8" path="res://resource/map/tileSet/TileSet1.tres" id="1_657ry"] [ext_resource type="Script" path="res://src/framework/map/mark/EnemyMark.cs" id="3_epa54"] [ext_resource type="Script" path="res://src/framework/map/DungeonRoomTemplate.cs" id="dungeonRoomTemplate"] diff --git a/DungeonShooting_Godot/resource/map/tileMaps/testGroup/battle/Room6.tscn b/DungeonShooting_Godot/resource/map/tileMaps/testGroup/battle/Room6.tscn index 31f9ee9..7bb1aff 100644 --- a/DungeonShooting_Godot/resource/map/tileMaps/testGroup/battle/Room6.tscn +++ b/DungeonShooting_Godot/resource/map/tileMaps/testGroup/battle/Room6.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=4 format=3 uid="uid://d1os2i60rnd0i"] -[ext_resource type="TileSet" uid="uid://b00g22o1cqhe8" path="res://resource/map/tileset/TileSet1.tres" id="1_83m2u"] +[ext_resource type="TileSet" uid="uid://b00g22o1cqhe8" path="res://resource/map/tileSet/TileSet1.tres" id="1_83m2u"] [ext_resource type="Script" path="res://src/framework/map/mark/EnemyMark.cs" id="3_g5jtq"] [ext_resource type="Script" path="res://src/framework/map/DungeonRoomTemplate.cs" id="dungeonRoomTemplate"] diff --git a/DungeonShooting_Godot/resource/map/tileMaps/testGroup/battle/Room8.tscn b/DungeonShooting_Godot/resource/map/tileMaps/testGroup/battle/Room8.tscn index fecb878..97c3076 100644 --- a/DungeonShooting_Godot/resource/map/tileMaps/testGroup/battle/Room8.tscn +++ b/DungeonShooting_Godot/resource/map/tileMaps/testGroup/battle/Room8.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=5 format=3 uid="uid://da8uytgy0hroo"] -[ext_resource type="TileSet" uid="uid://b00g22o1cqhe8" path="res://resource/map/tileset/TileSet1.tres" id="1_n27nn"] +[ext_resource type="TileSet" uid="uid://b00g22o1cqhe8" path="res://resource/map/tileSet/TileSet1.tres" id="1_n27nn"] [ext_resource type="Script" path="res://src/framework/map/mark/EnemyMark.cs" id="3_y6it6"] [ext_resource type="Script" path="res://src/framework/map/mark/ActivityMark.cs" id="4_5ha7k"] [ext_resource type="Script" path="res://src/framework/map/DungeonRoomTemplate.cs" id="dungeonRoomTemplate"] diff --git a/DungeonShooting_Godot/resource/map/tileMaps/testGroup/boss/Room1.tscn b/DungeonShooting_Godot/resource/map/tileMaps/testGroup/boss/Room1.tscn index 3ce4628..a99b278 100644 --- a/DungeonShooting_Godot/resource/map/tileMaps/testGroup/boss/Room1.tscn +++ b/DungeonShooting_Godot/resource/map/tileMaps/testGroup/boss/Room1.tscn @@ -1,9 +1,10 @@ [gd_scene load_steps=4 format=3 uid="uid://bm1820vfwqf52"] -[ext_resource type="TileSet" uid="uid://b00g22o1cqhe8" path="res://resource/map/tileset/TileSet1.tres" id="1_k0vyv"] +[ext_resource type="TileSet" uid="uid://b00g22o1cqhe8" path="res://resource/map/tileSet/TileSet1.tres" id="1_k0vyv"] [ext_resource type="Script" path="res://src/framework/map/mark/EnemyMark.cs" id="3_enrje"] [ext_resource type="Script" path="res://src/framework/map/DungeonRoomTemplate.cs" id="dungeonRoomTemplate"] + [node name="Room1" type="TileMap"] tile_set = ExtResource("1_k0vyv") format = 2 diff --git a/DungeonShooting_Godot/resource/map/tileMaps/testGroup/inlet/Room1.tscn b/DungeonShooting_Godot/resource/map/tileMaps/testGroup/inlet/Room1.tscn index 381e5d5..c37e50b 100644 --- a/DungeonShooting_Godot/resource/map/tileMaps/testGroup/inlet/Room1.tscn +++ b/DungeonShooting_Godot/resource/map/tileMaps/testGroup/inlet/Room1.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=4 format=3 uid="uid://dmeb88jotqro6"] -[ext_resource type="TileSet" uid="uid://b00g22o1cqhe8" path="res://resource/map/tileset/TileSet1.tres" id="1_osa3n"] +[ext_resource type="TileSet" uid="uid://b00g22o1cqhe8" path="res://resource/map/tileSet/TileSet1.tres" id="1_osa3n"] [ext_resource type="Script" path="res://src/framework/map/DungeonRoomTemplate.cs" id="2_erhdx"] [ext_resource type="Script" path="res://src/framework/map/mark/ActivityMark.cs" id="3_m4jrh"] diff --git a/DungeonShooting_Godot/resource/map/tileMaps/testGroup/outlet/Room1.tscn b/DungeonShooting_Godot/resource/map/tileMaps/testGroup/outlet/Room1.tscn index ee24274..4fbd0c4 100644 --- a/DungeonShooting_Godot/resource/map/tileMaps/testGroup/outlet/Room1.tscn +++ b/DungeonShooting_Godot/resource/map/tileMaps/testGroup/outlet/Room1.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=3 format=3 uid="uid://d0klitsroayqh"] -[ext_resource type="TileSet" uid="uid://b00g22o1cqhe8" path="res://resource/map/tileset/TileSet1.tres" id="1_fhl21"] +[ext_resource type="TileSet" uid="uid://b00g22o1cqhe8" path="res://resource/map/tileSet/TileSet1.tres" id="1_fhl21"] [ext_resource type="Script" path="res://src/framework/map/DungeonRoomTemplate.cs" id="dungeonRoomTemplate"] [node name="Room1" type="TileMap"] diff --git a/DungeonShooting_Godot/resource/map/tileSet/TileSet1.tres b/DungeonShooting_Godot/resource/map/tileSet/TileSet1.tres new file mode 100644 index 0000000..5173fe2 --- /dev/null +++ b/DungeonShooting_Godot/resource/map/tileSet/TileSet1.tres @@ -0,0 +1,609 @@ +[gd_resource type="TileSet" load_steps=3 format=3 uid="uid://b00g22o1cqhe8"] + +[ext_resource type="Texture2D" uid="uid://dj8nrd5od4fcl" path="res://resource/sprite/map/map1/16x16 dungeon ii wall reconfig v04 spritesheet.png" id="1_e0f3i"] + +[sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_yvgyd"] +texture = ExtResource("1_e0f3i") +0:0/0 = 0 +0:0/0/physics_layer_0/linear_velocity = Vector2(0, 0) +0:0/0/physics_layer_0/angular_velocity = 0.0 +1:0/0 = 0 +1:0/0/physics_layer_0/linear_velocity = Vector2(0, 0) +1:0/0/physics_layer_0/angular_velocity = 0.0 +2:0/0 = 0 +2:0/0/physics_layer_0/linear_velocity = Vector2(0, 0) +2:0/0/physics_layer_0/angular_velocity = 0.0 +3:0/0 = 0 +3:0/0/physics_layer_0/linear_velocity = Vector2(0, 0) +3:0/0/physics_layer_0/angular_velocity = 0.0 +4:0/0 = 0 +4:0/0/physics_layer_0/linear_velocity = Vector2(0, 0) +4:0/0/physics_layer_0/angular_velocity = 0.0 +5:0/0 = 0 +5:0/0/physics_layer_0/linear_velocity = Vector2(0, 0) +5:0/0/physics_layer_0/angular_velocity = 0.0 +6:0/0 = 0 +6:0/0/physics_layer_0/linear_velocity = Vector2(0, 0) +6:0/0/physics_layer_0/angular_velocity = 0.0 +7:0/0 = 0 +7:0/0/physics_layer_0/linear_velocity = Vector2(0, 0) +7:0/0/physics_layer_0/angular_velocity = 0.0 +8:0/0 = 0 +8:0/0/physics_layer_0/linear_velocity = Vector2(0, 0) +8:0/0/physics_layer_0/angular_velocity = 0.0 +9:0/0 = 0 +9:0/0/physics_layer_0/linear_velocity = Vector2(0, 0) +9:0/0/physics_layer_0/angular_velocity = 0.0 +10:0/0 = 0 +10:0/0/physics_layer_0/linear_velocity = Vector2(0, 0) +10:0/0/physics_layer_0/angular_velocity = 0.0 +11:0/next_alternative_id = 2 +11:0/0 = 0 +11:0/0/physics_layer_0/linear_velocity = Vector2(0, 0) +11:0/0/physics_layer_0/angular_velocity = 0.0 +12:0/0 = 0 +12:0/0/physics_layer_0/linear_velocity = Vector2(0, 0) +12:0/0/physics_layer_0/angular_velocity = 0.0 +13:0/next_alternative_id = 2 +13:0/0 = 0 +13:0/0/physics_layer_0/linear_velocity = Vector2(0, 0) +13:0/0/physics_layer_0/angular_velocity = 0.0 +14:0/0 = 0 +14:0/0/physics_layer_0/linear_velocity = Vector2(0, 0) +14:0/0/physics_layer_0/angular_velocity = 0.0 +15:0/0 = 0 +15:0/0/physics_layer_0/linear_velocity = Vector2(0, 0) +15:0/0/physics_layer_0/angular_velocity = 0.0 +0:1/0 = 0 +0:1/0/physics_layer_0/linear_velocity = Vector2(0, 0) +0:1/0/physics_layer_0/angular_velocity = 0.0 +1:1/0 = 0 +1:1/0/physics_layer_0/linear_velocity = Vector2(0, 0) +1:1/0/physics_layer_0/angular_velocity = 0.0 +2:1/0 = 0 +2:1/0/physics_layer_0/linear_velocity = Vector2(0, 0) +2:1/0/physics_layer_0/angular_velocity = 0.0 +3:1/0 = 0 +3:1/0/physics_layer_0/linear_velocity = Vector2(0, 0) +3:1/0/physics_layer_0/angular_velocity = 0.0 +4:1/0 = 0 +4:1/0/physics_layer_0/linear_velocity = Vector2(0, 0) +4:1/0/physics_layer_0/angular_velocity = 0.0 +5:1/0 = 0 +5:1/0/physics_layer_0/linear_velocity = Vector2(0, 0) +5:1/0/physics_layer_0/angular_velocity = 0.0 +6:1/0 = 0 +6:1/0/physics_layer_0/linear_velocity = Vector2(0, 0) +6:1/0/physics_layer_0/angular_velocity = 0.0 +7:1/0 = 0 +7:1/0/physics_layer_0/linear_velocity = Vector2(0, 0) +7:1/0/physics_layer_0/angular_velocity = 0.0 +8:1/0 = 0 +8:1/0/physics_layer_0/linear_velocity = Vector2(0, 0) +8:1/0/physics_layer_0/angular_velocity = 0.0 +9:1/0 = 0 +9:1/0/physics_layer_0/linear_velocity = Vector2(0, 0) +9:1/0/physics_layer_0/angular_velocity = 0.0 +10:1/0 = 0 +10:1/0/physics_layer_0/linear_velocity = Vector2(0, 0) +10:1/0/physics_layer_0/angular_velocity = 0.0 +11:1/0 = 0 +11:1/0/physics_layer_0/linear_velocity = Vector2(0, 0) +11:1/0/physics_layer_0/angular_velocity = 0.0 +12:1/0 = 0 +12:1/0/physics_layer_0/linear_velocity = Vector2(0, 0) +12:1/0/physics_layer_0/angular_velocity = 0.0 +13:1/0 = 0 +13:1/0/physics_layer_0/linear_velocity = Vector2(0, 0) +13:1/0/physics_layer_0/angular_velocity = 0.0 +14:1/0 = 0 +14:1/0/physics_layer_0/linear_velocity = Vector2(0, 0) +14:1/0/physics_layer_0/angular_velocity = 0.0 +15:1/0 = 0 +15:1/0/physics_layer_0/linear_velocity = Vector2(0, 0) +15:1/0/physics_layer_0/angular_velocity = 0.0 +0:2/0 = 0 +0:2/0/physics_layer_0/linear_velocity = Vector2(0, 0) +0:2/0/physics_layer_0/angular_velocity = 0.0 +1:2/0 = 0 +1:2/0/terrain_set = 0 +1:2/0/physics_layer_0/linear_velocity = Vector2(0, 0) +1:2/0/physics_layer_0/angular_velocity = 0.0 +1:2/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, 0, 8, 0, 8, 8, -8, 8) +1:2/0/terrains_peering_bit/bottom_left_corner = 0 +1:2/0/terrains_peering_bit/top_left_corner = 0 +1:2/0/terrains_peering_bit/top_right_corner = 0 +2:2/0 = 0 +2:2/0/terrain_set = 0 +2:2/0/physics_layer_0/linear_velocity = Vector2(0, 0) +2:2/0/physics_layer_0/angular_velocity = 0.0 +2:2/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, 0, 8, 0, 8, 8, -8, 8) +2:2/0/terrains_peering_bit/top_left_corner = 0 +2:2/0/terrains_peering_bit/top_right_corner = 0 +3:2/0 = 0 +3:2/0/terrain_set = 0 +3:2/0/physics_layer_0/linear_velocity = Vector2(0, 0) +3:2/0/physics_layer_0/angular_velocity = 0.0 +3:2/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, 0, 8, 0, 8, 8, -8, 8) +3:2/0/terrains_peering_bit/bottom_right_corner = 0 +3:2/0/terrains_peering_bit/top_left_corner = 0 +3:2/0/terrains_peering_bit/top_right_corner = 0 +4:2/0 = 0 +4:2/0/physics_layer_0/linear_velocity = Vector2(0, 0) +4:2/0/physics_layer_0/angular_velocity = 0.0 +5:2/0 = 0 +5:2/0/physics_layer_0/linear_velocity = Vector2(0, 0) +5:2/0/physics_layer_0/angular_velocity = 0.0 +6:2/0 = 0 +6:2/0/physics_layer_0/linear_velocity = Vector2(0, 0) +6:2/0/physics_layer_0/angular_velocity = 0.0 +7:2/0 = 0 +7:2/0/physics_layer_0/linear_velocity = Vector2(0, 0) +7:2/0/physics_layer_0/angular_velocity = 0.0 +8:2/0 = 0 +8:2/0/physics_layer_0/linear_velocity = Vector2(0, 0) +8:2/0/physics_layer_0/angular_velocity = 0.0 +9:2/0 = 0 +9:2/0/physics_layer_0/linear_velocity = Vector2(0, 0) +9:2/0/physics_layer_0/angular_velocity = 0.0 +10:2/0 = 0 +10:2/0/physics_layer_0/linear_velocity = Vector2(0, 0) +10:2/0/physics_layer_0/angular_velocity = 0.0 +11:2/0 = 0 +11:2/0/terrain_set = 0 +11:2/0/physics_layer_0/linear_velocity = Vector2(0, 0) +11:2/0/physics_layer_0/angular_velocity = 0.0 +11:2/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8) +11:2/0/terrains_peering_bit/top_right_corner = 0 +12:2/0 = 0 +12:2/0/physics_layer_0/linear_velocity = Vector2(0, 0) +12:2/0/physics_layer_0/angular_velocity = 0.0 +13:2/0 = 0 +13:2/0/terrain_set = 0 +13:2/0/physics_layer_0/linear_velocity = Vector2(0, 0) +13:2/0/physics_layer_0/angular_velocity = 0.0 +13:2/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8) +13:2/0/terrains_peering_bit/top_left_corner = 0 +14:2/0 = 0 +14:2/0/physics_layer_0/linear_velocity = Vector2(0, 0) +14:2/0/physics_layer_0/angular_velocity = 0.0 +15:2/0 = 0 +15:2/0/physics_layer_0/linear_velocity = Vector2(0, 0) +15:2/0/physics_layer_0/angular_velocity = 0.0 +0:3/0 = 0 +0:3/0/physics_layer_0/linear_velocity = Vector2(0, 0) +0:3/0/physics_layer_0/angular_velocity = 0.0 +1:3/0 = 0 +1:3/0/terrain_set = 0 +1:3/0/physics_layer_0/linear_velocity = Vector2(0, 0) +1:3/0/physics_layer_0/angular_velocity = 0.0 +1:3/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8) +1:3/0/terrains_peering_bit/bottom_left_corner = 0 +1:3/0/terrains_peering_bit/top_left_corner = 0 +2:3/0 = 0 +2:3/0/physics_layer_0/linear_velocity = Vector2(0, 0) +2:3/0/physics_layer_0/angular_velocity = 0.0 +2:3/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8) +3:3/0 = 0 +3:3/0/terrain_set = 0 +3:3/0/physics_layer_0/linear_velocity = Vector2(0, 0) +3:3/0/physics_layer_0/angular_velocity = 0.0 +3:3/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8) +3:3/0/terrains_peering_bit/bottom_right_corner = 0 +3:3/0/terrains_peering_bit/top_right_corner = 0 +4:3/0 = 0 +4:3/0/physics_layer_0/linear_velocity = Vector2(0, 0) +4:3/0/physics_layer_0/angular_velocity = 0.0 +5:3/0 = 0 +5:3/0/physics_layer_0/linear_velocity = Vector2(0, 0) +5:3/0/physics_layer_0/angular_velocity = 0.0 +6:3/0 = 0 +6:3/0/physics_layer_0/linear_velocity = Vector2(0, 0) +6:3/0/physics_layer_0/angular_velocity = 0.0 +7:3/0 = 0 +7:3/0/physics_layer_0/linear_velocity = Vector2(0, 0) +7:3/0/physics_layer_0/angular_velocity = 0.0 +8:3/0 = 0 +8:3/0/physics_layer_0/linear_velocity = Vector2(0, 0) +8:3/0/physics_layer_0/angular_velocity = 0.0 +9:3/0 = 0 +9:3/0/physics_layer_0/linear_velocity = Vector2(0, 0) +9:3/0/physics_layer_0/angular_velocity = 0.0 +10:3/0 = 0 +10:3/0/physics_layer_0/linear_velocity = Vector2(0, 0) +10:3/0/physics_layer_0/angular_velocity = 0.0 +11:3/0 = 0 +11:3/0/physics_layer_0/linear_velocity = Vector2(0, 0) +11:3/0/physics_layer_0/angular_velocity = 0.0 +12:3/0 = 0 +12:3/0/physics_layer_0/linear_velocity = Vector2(0, 0) +12:3/0/physics_layer_0/angular_velocity = 0.0 +13:3/0 = 0 +13:3/0/physics_layer_0/linear_velocity = Vector2(0, 0) +13:3/0/physics_layer_0/angular_velocity = 0.0 +14:3/0 = 0 +14:3/0/physics_layer_0/linear_velocity = Vector2(0, 0) +14:3/0/physics_layer_0/angular_velocity = 0.0 +15:3/0 = 0 +15:3/0/physics_layer_0/linear_velocity = Vector2(0, 0) +15:3/0/physics_layer_0/angular_velocity = 0.0 +0:4/0 = 0 +0:4/0/physics_layer_0/linear_velocity = Vector2(0, 0) +0:4/0/physics_layer_0/angular_velocity = 0.0 +1:4/0 = 0 +1:4/0/terrain_set = 0 +1:4/0/physics_layer_0/linear_velocity = Vector2(0, 0) +1:4/0/physics_layer_0/angular_velocity = 0.0 +1:4/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8) +1:4/0/terrains_peering_bit/bottom_left_corner = 0 +2:4/0 = 0 +2:4/0/physics_layer_0/linear_velocity = Vector2(0, 0) +2:4/0/physics_layer_0/angular_velocity = 0.0 +2:4/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8) +3:4/0 = 0 +3:4/0/terrain_set = 0 +3:4/0/physics_layer_0/linear_velocity = Vector2(0, 0) +3:4/0/physics_layer_0/angular_velocity = 0.0 +3:4/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8) +3:4/0/terrains_peering_bit/bottom_right_corner = 0 +4:4/0 = 0 +4:4/0/physics_layer_0/linear_velocity = Vector2(0, 0) +4:4/0/physics_layer_0/angular_velocity = 0.0 +5:4/0 = 0 +5:4/0/physics_layer_0/linear_velocity = Vector2(0, 0) +5:4/0/physics_layer_0/angular_velocity = 0.0 +6:4/0 = 0 +6:4/0/physics_layer_0/linear_velocity = Vector2(0, 0) +6:4/0/physics_layer_0/angular_velocity = 0.0 +7:4/0 = 0 +7:4/0/physics_layer_0/linear_velocity = Vector2(0, 0) +7:4/0/physics_layer_0/angular_velocity = 0.0 +8:4/0 = 0 +8:4/0/physics_layer_0/linear_velocity = Vector2(0, 0) +8:4/0/physics_layer_0/angular_velocity = 0.0 +9:4/0 = 0 +9:4/0/physics_layer_0/linear_velocity = Vector2(0, 0) +9:4/0/physics_layer_0/angular_velocity = 0.0 +10:4/0 = 0 +10:4/0/physics_layer_0/linear_velocity = Vector2(0, 0) +10:4/0/physics_layer_0/angular_velocity = 0.0 +11:4/0 = 0 +11:4/0/physics_layer_0/linear_velocity = Vector2(0, 0) +11:4/0/physics_layer_0/angular_velocity = 0.0 +12:4/0 = 0 +12:4/0/physics_layer_0/linear_velocity = Vector2(0, 0) +12:4/0/physics_layer_0/angular_velocity = 0.0 +13:4/0 = 0 +13:4/0/physics_layer_0/linear_velocity = Vector2(0, 0) +13:4/0/physics_layer_0/angular_velocity = 0.0 +14:4/0 = 0 +14:4/0/physics_layer_0/linear_velocity = Vector2(0, 0) +14:4/0/physics_layer_0/angular_velocity = 0.0 +15:4/0 = 0 +15:4/0/physics_layer_0/linear_velocity = Vector2(0, 0) +15:4/0/physics_layer_0/angular_velocity = 0.0 +0:5/0 = 0 +0:5/0/physics_layer_0/linear_velocity = Vector2(0, 0) +0:5/0/physics_layer_0/angular_velocity = 0.0 +1:5/0 = 0 +1:5/0/physics_layer_0/linear_velocity = Vector2(0, 0) +1:5/0/physics_layer_0/angular_velocity = 0.0 +1:5/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8) +2:5/0 = 0 +2:5/0/physics_layer_0/linear_velocity = Vector2(0, 0) +2:5/0/physics_layer_0/angular_velocity = 0.0 +2:5/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8) +3:5/0 = 0 +3:5/0/physics_layer_0/linear_velocity = Vector2(0, 0) +3:5/0/physics_layer_0/angular_velocity = 0.0 +3:5/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8) +4:5/0 = 0 +4:5/0/physics_layer_0/linear_velocity = Vector2(0, 0) +4:5/0/physics_layer_0/angular_velocity = 0.0 +5:5/0 = 0 +5:5/0/physics_layer_0/linear_velocity = Vector2(0, 0) +5:5/0/physics_layer_0/angular_velocity = 0.0 +6:5/0 = 0 +6:5/0/physics_layer_0/linear_velocity = Vector2(0, 0) +6:5/0/physics_layer_0/angular_velocity = 0.0 +7:5/0 = 0 +7:5/0/physics_layer_0/linear_velocity = Vector2(0, 0) +7:5/0/physics_layer_0/angular_velocity = 0.0 +8:5/0 = 0 +8:5/0/physics_layer_0/linear_velocity = Vector2(0, 0) +8:5/0/physics_layer_0/angular_velocity = 0.0 +9:5/0 = 0 +9:5/0/physics_layer_0/linear_velocity = Vector2(0, 0) +9:5/0/physics_layer_0/angular_velocity = 0.0 +10:5/0 = 0 +10:5/0/physics_layer_0/linear_velocity = Vector2(0, 0) +10:5/0/physics_layer_0/angular_velocity = 0.0 +11:5/0 = 0 +11:5/0/physics_layer_0/linear_velocity = Vector2(0, 0) +11:5/0/physics_layer_0/angular_velocity = 0.0 +12:5/0 = 0 +12:5/0/physics_layer_0/linear_velocity = Vector2(0, 0) +12:5/0/physics_layer_0/angular_velocity = 0.0 +13:5/0 = 0 +13:5/0/physics_layer_0/linear_velocity = Vector2(0, 0) +13:5/0/physics_layer_0/angular_velocity = 0.0 +14:5/0 = 0 +14:5/0/physics_layer_0/linear_velocity = Vector2(0, 0) +14:5/0/physics_layer_0/angular_velocity = 0.0 +15:5/0 = 0 +15:5/0/physics_layer_0/linear_velocity = Vector2(0, 0) +15:5/0/physics_layer_0/angular_velocity = 0.0 +0:6/0 = 0 +0:6/0/physics_layer_0/linear_velocity = Vector2(0, 0) +0:6/0/physics_layer_0/angular_velocity = 0.0 +1:6/next_alternative_id = 3 +1:6/0 = 0 +1:6/0/physics_layer_0/linear_velocity = Vector2(0, 0) +1:6/0/physics_layer_0/angular_velocity = 0.0 +1:6/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8) +2:6/next_alternative_id = 3 +2:6/0 = 0 +2:6/0/physics_layer_0/linear_velocity = Vector2(0, 0) +2:6/0/physics_layer_0/angular_velocity = 0.0 +2:6/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8) +3:6/next_alternative_id = 3 +3:6/0 = 0 +3:6/0/physics_layer_0/linear_velocity = Vector2(0, 0) +3:6/0/physics_layer_0/angular_velocity = 0.0 +3:6/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8) +4:6/0 = 0 +4:6/0/physics_layer_0/linear_velocity = Vector2(0, 0) +4:6/0/physics_layer_0/angular_velocity = 0.0 +5:6/0 = 0 +5:6/0/physics_layer_0/linear_velocity = Vector2(0, 0) +5:6/0/physics_layer_0/angular_velocity = 0.0 +6:6/0 = 0 +6:6/0/physics_layer_0/linear_velocity = Vector2(0, 0) +6:6/0/physics_layer_0/angular_velocity = 0.0 +7:6/0 = 0 +7:6/0/physics_layer_0/linear_velocity = Vector2(0, 0) +7:6/0/physics_layer_0/angular_velocity = 0.0 +8:6/0 = 0 +8:6/0/physics_layer_0/linear_velocity = Vector2(0, 0) +8:6/0/physics_layer_0/angular_velocity = 0.0 +9:6/0 = 0 +9:6/0/physics_layer_0/linear_velocity = Vector2(0, 0) +9:6/0/physics_layer_0/angular_velocity = 0.0 +10:6/0 = 0 +10:6/0/physics_layer_0/linear_velocity = Vector2(0, 0) +10:6/0/physics_layer_0/angular_velocity = 0.0 +11:6/0 = 0 +11:6/0/physics_layer_0/linear_velocity = Vector2(0, 0) +11:6/0/physics_layer_0/angular_velocity = 0.0 +12:6/0 = 0 +12:6/0/physics_layer_0/linear_velocity = Vector2(0, 0) +12:6/0/physics_layer_0/angular_velocity = 0.0 +13:6/0 = 0 +13:6/0/physics_layer_0/linear_velocity = Vector2(0, 0) +13:6/0/physics_layer_0/angular_velocity = 0.0 +14:6/0 = 0 +14:6/0/physics_layer_0/linear_velocity = Vector2(0, 0) +14:6/0/physics_layer_0/angular_velocity = 0.0 +15:6/0 = 0 +15:6/0/physics_layer_0/linear_velocity = Vector2(0, 0) +15:6/0/physics_layer_0/angular_velocity = 0.0 +0:7/0 = 0 +0:7/0/physics_layer_0/linear_velocity = Vector2(0, 0) +0:7/0/physics_layer_0/angular_velocity = 0.0 +1:7/0 = 0 +1:7/0/terrain_set = 0 +1:7/0/physics_layer_0/linear_velocity = Vector2(0, 0) +1:7/0/physics_layer_0/angular_velocity = 0.0 +1:7/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8) +1:7/0/terrains_peering_bit/bottom_right_corner = 0 +1:7/0/terrains_peering_bit/bottom_left_corner = 0 +1:7/0/terrains_peering_bit/top_left_corner = 0 +2:7/0 = 0 +2:7/0/terrain_set = 0 +2:7/0/physics_layer_0/linear_velocity = Vector2(0, 0) +2:7/0/physics_layer_0/angular_velocity = 0.0 +2:7/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8) +2:7/0/terrains_peering_bit/bottom_right_corner = 0 +2:7/0/terrains_peering_bit/bottom_left_corner = 0 +3:7/0 = 0 +3:7/0/terrain_set = 0 +3:7/0/physics_layer_0/linear_velocity = Vector2(0, 0) +3:7/0/physics_layer_0/angular_velocity = 0.0 +3:7/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8) +3:7/0/terrains_peering_bit/bottom_right_corner = 0 +3:7/0/terrains_peering_bit/bottom_left_corner = 0 +3:7/0/terrains_peering_bit/top_right_corner = 0 +4:7/0 = 0 +4:7/0/physics_layer_0/linear_velocity = Vector2(0, 0) +4:7/0/physics_layer_0/angular_velocity = 0.0 +5:7/0 = 0 +5:7/0/physics_layer_0/linear_velocity = Vector2(0, 0) +5:7/0/physics_layer_0/angular_velocity = 0.0 +6:7/0 = 0 +6:7/0/physics_layer_0/linear_velocity = Vector2(0, 0) +6:7/0/physics_layer_0/angular_velocity = 0.0 +7:7/0 = 0 +7:7/0/physics_layer_0/linear_velocity = Vector2(0, 0) +7:7/0/physics_layer_0/angular_velocity = 0.0 +8:7/0 = 0 +8:7/0/physics_layer_0/linear_velocity = Vector2(0, 0) +8:7/0/physics_layer_0/angular_velocity = 0.0 +9:7/0 = 0 +9:7/0/physics_layer_0/linear_velocity = Vector2(0, 0) +9:7/0/physics_layer_0/angular_velocity = 0.0 +10:7/0 = 0 +10:7/0/physics_layer_0/linear_velocity = Vector2(0, 0) +10:7/0/physics_layer_0/angular_velocity = 0.0 +11:7/0 = 0 +11:7/0/physics_layer_0/linear_velocity = Vector2(0, 0) +11:7/0/physics_layer_0/angular_velocity = 0.0 +12:7/0 = 0 +12:7/0/physics_layer_0/linear_velocity = Vector2(0, 0) +12:7/0/physics_layer_0/angular_velocity = 0.0 +13:7/0 = 0 +13:7/0/physics_layer_0/linear_velocity = Vector2(0, 0) +13:7/0/physics_layer_0/angular_velocity = 0.0 +14:7/0 = 0 +14:7/0/physics_layer_0/linear_velocity = Vector2(0, 0) +14:7/0/physics_layer_0/angular_velocity = 0.0 +15:7/0 = 0 +15:7/0/physics_layer_0/linear_velocity = Vector2(0, 0) +15:7/0/physics_layer_0/angular_velocity = 0.0 +0:8/0 = 0 +0:8/0/terrain_set = 0 +0:8/0/terrain = 0 +0:8/0/physics_layer_0/linear_velocity = Vector2(0, 0) +0:8/0/physics_layer_0/angular_velocity = 0.0 +0:8/0/terrains_peering_bit/bottom_right_corner = 0 +0:8/0/terrains_peering_bit/bottom_left_corner = 0 +0:8/0/terrains_peering_bit/top_left_corner = 0 +0:8/0/terrains_peering_bit/top_right_corner = 0 +1:8/0 = 0 +1:8/0/physics_layer_0/linear_velocity = Vector2(0, 0) +1:8/0/physics_layer_0/angular_velocity = 0.0 +2:8/0 = 0 +2:8/0/physics_layer_0/linear_velocity = Vector2(0, 0) +2:8/0/physics_layer_0/angular_velocity = 0.0 +3:8/0 = 0 +3:8/0/physics_layer_0/linear_velocity = Vector2(0, 0) +3:8/0/physics_layer_0/angular_velocity = 0.0 +4:8/0 = 0 +4:8/0/physics_layer_0/linear_velocity = Vector2(0, 0) +4:8/0/physics_layer_0/angular_velocity = 0.0 +5:8/0 = 0 +5:8/0/physics_layer_0/linear_velocity = Vector2(0, 0) +5:8/0/physics_layer_0/angular_velocity = 0.0 +6:8/0 = 0 +6:8/0/physics_layer_0/linear_velocity = Vector2(0, 0) +6:8/0/physics_layer_0/angular_velocity = 0.0 +7:8/0 = 0 +7:8/0/physics_layer_0/linear_velocity = Vector2(0, 0) +7:8/0/physics_layer_0/angular_velocity = 0.0 +8:8/0 = 0 +8:8/0/physics_layer_0/linear_velocity = Vector2(0, 0) +8:8/0/physics_layer_0/angular_velocity = 0.0 +9:8/0 = 0 +9:8/0/physics_layer_0/linear_velocity = Vector2(0, 0) +9:8/0/physics_layer_0/angular_velocity = 0.0 +10:8/0 = 0 +10:8/0/physics_layer_0/linear_velocity = Vector2(0, 0) +10:8/0/physics_layer_0/angular_velocity = 0.0 +11:8/0 = 0 +11:8/0/physics_layer_0/linear_velocity = Vector2(0, 0) +11:8/0/physics_layer_0/angular_velocity = 0.0 +12:8/0 = 0 +12:8/0/physics_layer_0/linear_velocity = Vector2(0, 0) +12:8/0/physics_layer_0/angular_velocity = 0.0 +13:8/0 = 0 +13:8/0/physics_layer_0/linear_velocity = Vector2(0, 0) +13:8/0/physics_layer_0/angular_velocity = 0.0 +14:8/0 = 0 +14:8/0/physics_layer_0/linear_velocity = Vector2(0, 0) +14:8/0/physics_layer_0/angular_velocity = 0.0 +15:8/0 = 0 +15:8/0/physics_layer_0/linear_velocity = Vector2(0, 0) +15:8/0/physics_layer_0/angular_velocity = 0.0 +0:9/0 = 0 +0:9/0/physics_layer_0/linear_velocity = Vector2(0, 0) +0:9/0/physics_layer_0/angular_velocity = 0.0 +1:9/0 = 0 +1:9/0/physics_layer_0/linear_velocity = Vector2(0, 0) +1:9/0/physics_layer_0/angular_velocity = 0.0 +2:9/0 = 0 +2:9/0/physics_layer_0/linear_velocity = Vector2(0, 0) +2:9/0/physics_layer_0/angular_velocity = 0.0 +3:9/0 = 0 +3:9/0/physics_layer_0/linear_velocity = Vector2(0, 0) +3:9/0/physics_layer_0/angular_velocity = 0.0 +4:9/0 = 0 +4:9/0/physics_layer_0/linear_velocity = Vector2(0, 0) +4:9/0/physics_layer_0/angular_velocity = 0.0 +5:9/0 = 0 +5:9/0/physics_layer_0/linear_velocity = Vector2(0, 0) +5:9/0/physics_layer_0/angular_velocity = 0.0 +6:9/0 = 0 +6:9/0/physics_layer_0/linear_velocity = Vector2(0, 0) +6:9/0/physics_layer_0/angular_velocity = 0.0 +7:9/0 = 0 +7:9/0/physics_layer_0/linear_velocity = Vector2(0, 0) +7:9/0/physics_layer_0/angular_velocity = 0.0 +10:9/0 = 0 +10:9/0/physics_layer_0/linear_velocity = Vector2(0, 0) +10:9/0/physics_layer_0/angular_velocity = 0.0 +11:9/0 = 0 +11:9/0/physics_layer_0/linear_velocity = Vector2(0, 0) +11:9/0/physics_layer_0/angular_velocity = 0.0 +12:9/0 = 0 +12:9/0/physics_layer_0/linear_velocity = Vector2(0, 0) +12:9/0/physics_layer_0/angular_velocity = 0.0 +13:9/0 = 0 +13:9/0/physics_layer_0/linear_velocity = Vector2(0, 0) +13:9/0/physics_layer_0/angular_velocity = 0.0 +14:9/0 = 0 +14:9/0/physics_layer_0/linear_velocity = Vector2(0, 0) +14:9/0/physics_layer_0/angular_velocity = 0.0 +15:9/0 = 0 +15:9/0/physics_layer_0/linear_velocity = Vector2(0, 0) +15:9/0/physics_layer_0/angular_velocity = 0.0 +0:10/0 = 0 +0:10/0/physics_layer_0/linear_velocity = Vector2(0, 0) +0:10/0/physics_layer_0/angular_velocity = 0.0 +1:10/0 = 0 +1:10/0/physics_layer_0/linear_velocity = Vector2(0, 0) +1:10/0/physics_layer_0/angular_velocity = 0.0 +2:10/0 = 0 +2:10/0/physics_layer_0/linear_velocity = Vector2(0, 0) +2:10/0/physics_layer_0/angular_velocity = 0.0 +3:10/0 = 0 +3:10/0/physics_layer_0/linear_velocity = Vector2(0, 0) +3:10/0/physics_layer_0/angular_velocity = 0.0 +5:10/0 = 0 +5:10/0/physics_layer_0/linear_velocity = Vector2(0, 0) +5:10/0/physics_layer_0/angular_velocity = 0.0 +6:10/0 = 0 +6:10/0/physics_layer_0/linear_velocity = Vector2(0, 0) +6:10/0/physics_layer_0/angular_velocity = 0.0 +7:10/0 = 0 +7:10/0/physics_layer_0/linear_velocity = Vector2(0, 0) +7:10/0/physics_layer_0/angular_velocity = 0.0 +13:10/0 = 0 +13:10/0/physics_layer_0/linear_velocity = Vector2(0, 0) +13:10/0/physics_layer_0/angular_velocity = 0.0 +14:10/0 = 0 +14:10/0/physics_layer_0/linear_velocity = Vector2(0, 0) +14:10/0/physics_layer_0/angular_velocity = 0.0 +15:10/0 = 0 +15:10/0/physics_layer_0/linear_velocity = Vector2(0, 0) +15:10/0/physics_layer_0/angular_velocity = 0.0 +0:11/0 = 0 +0:11/0/physics_layer_0/linear_velocity = Vector2(0, 0) +0:11/0/physics_layer_0/angular_velocity = 0.0 +1:11/0 = 0 +1:11/0/physics_layer_0/linear_velocity = Vector2(0, 0) +1:11/0/physics_layer_0/angular_velocity = 0.0 +2:11/0 = 0 +2:11/0/physics_layer_0/linear_velocity = Vector2(0, 0) +2:11/0/physics_layer_0/angular_velocity = 0.0 +3:11/0 = 0 +3:11/0/physics_layer_0/linear_velocity = Vector2(0, 0) +3:11/0/physics_layer_0/angular_velocity = 0.0 +4:11/0 = 0 +4:11/0/physics_layer_0/linear_velocity = Vector2(0, 0) +4:11/0/physics_layer_0/angular_velocity = 0.0 +13:11/0 = 0 +13:11/0/physics_layer_0/linear_velocity = Vector2(0, 0) +13:11/0/physics_layer_0/angular_velocity = 0.0 +14:11/0 = 0 +14:11/0/physics_layer_0/linear_velocity = Vector2(0, 0) +14:11/0/physics_layer_0/angular_velocity = 0.0 +15:11/0 = 0 +15:11/0/physics_layer_0/linear_velocity = Vector2(0, 0) +15:11/0/physics_layer_0/angular_velocity = 0.0 + +[resource] +physics_layer_0/collision_layer = 1 +physics_layer_0/collision_mask = 0 +terrain_set_0/mode = 1 +terrain_set_0/terrain_0/name = "Terrain 0" +terrain_set_0/terrain_0/color = Color(0.886275, 0.0980392, 0.0980392, 1) +sources/0 = SubResource("TileSetAtlasSource_yvgyd") diff --git a/DungeonShooting_Godot/resource/map/tileSet/TileSet_old.tres b/DungeonShooting_Godot/resource/map/tileSet/TileSet_old.tres new file mode 100644 index 0000000..b082db6 --- /dev/null +++ b/DungeonShooting_Godot/resource/map/tileSet/TileSet_old.tres @@ -0,0 +1,559 @@ +[gd_resource type="TileSet" load_steps=3 format=3 uid="uid://bn21mn0gu6jel"] + +[ext_resource type="Texture2D" uid="uid://dj8nrd5od4fcl" path="res://resource/sprite/map/map1/16x16 dungeon ii wall reconfig v04 spritesheet.png" id="1_vqd0o"] + +[sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_rkmbu"] +texture = ExtResource("1_vqd0o") +0:0/0 = 0 +0:0/0/physics_layer_0/linear_velocity = Vector2(0, 0) +0:0/0/physics_layer_0/angular_velocity = 0.0 +1:0/0 = 0 +1:0/0/physics_layer_0/linear_velocity = Vector2(0, 0) +1:0/0/physics_layer_0/angular_velocity = 0.0 +2:0/0 = 0 +2:0/0/physics_layer_0/linear_velocity = Vector2(0, 0) +2:0/0/physics_layer_0/angular_velocity = 0.0 +3:0/0 = 0 +3:0/0/physics_layer_0/linear_velocity = Vector2(0, 0) +3:0/0/physics_layer_0/angular_velocity = 0.0 +4:0/0 = 0 +4:0/0/physics_layer_0/linear_velocity = Vector2(0, 0) +4:0/0/physics_layer_0/angular_velocity = 0.0 +5:0/0 = 0 +5:0/0/physics_layer_0/linear_velocity = Vector2(0, 0) +5:0/0/physics_layer_0/angular_velocity = 0.0 +6:0/0 = 0 +6:0/0/physics_layer_0/linear_velocity = Vector2(0, 0) +6:0/0/physics_layer_0/angular_velocity = 0.0 +7:0/0 = 0 +7:0/0/physics_layer_0/linear_velocity = Vector2(0, 0) +7:0/0/physics_layer_0/angular_velocity = 0.0 +8:0/0 = 0 +8:0/0/physics_layer_0/linear_velocity = Vector2(0, 0) +8:0/0/physics_layer_0/angular_velocity = 0.0 +9:0/0 = 0 +9:0/0/physics_layer_0/linear_velocity = Vector2(0, 0) +9:0/0/physics_layer_0/angular_velocity = 0.0 +10:0/0 = 0 +10:0/0/physics_layer_0/linear_velocity = Vector2(0, 0) +10:0/0/physics_layer_0/angular_velocity = 0.0 +11:0/0 = 0 +11:0/0/physics_layer_0/linear_velocity = Vector2(0, 0) +11:0/0/physics_layer_0/angular_velocity = 0.0 +12:0/0 = 0 +12:0/0/physics_layer_0/linear_velocity = Vector2(0, 0) +12:0/0/physics_layer_0/angular_velocity = 0.0 +13:0/0 = 0 +13:0/0/physics_layer_0/linear_velocity = Vector2(0, 0) +13:0/0/physics_layer_0/angular_velocity = 0.0 +14:0/0 = 0 +14:0/0/physics_layer_0/linear_velocity = Vector2(0, 0) +14:0/0/physics_layer_0/angular_velocity = 0.0 +15:0/0 = 0 +15:0/0/physics_layer_0/linear_velocity = Vector2(0, 0) +15:0/0/physics_layer_0/angular_velocity = 0.0 +0:1/0 = 0 +0:1/0/physics_layer_0/linear_velocity = Vector2(0, 0) +0:1/0/physics_layer_0/angular_velocity = 0.0 +1:1/0 = 0 +1:1/0/physics_layer_0/linear_velocity = Vector2(0, 0) +1:1/0/physics_layer_0/angular_velocity = 0.0 +2:1/0 = 0 +2:1/0/physics_layer_0/linear_velocity = Vector2(0, 0) +2:1/0/physics_layer_0/angular_velocity = 0.0 +3:1/0 = 0 +3:1/0/physics_layer_0/linear_velocity = Vector2(0, 0) +3:1/0/physics_layer_0/angular_velocity = 0.0 +4:1/0 = 0 +4:1/0/physics_layer_0/linear_velocity = Vector2(0, 0) +4:1/0/physics_layer_0/angular_velocity = 0.0 +5:1/0 = 0 +5:1/0/physics_layer_0/linear_velocity = Vector2(0, 0) +5:1/0/physics_layer_0/angular_velocity = 0.0 +6:1/0 = 0 +6:1/0/physics_layer_0/linear_velocity = Vector2(0, 0) +6:1/0/physics_layer_0/angular_velocity = 0.0 +7:1/0 = 0 +7:1/0/physics_layer_0/linear_velocity = Vector2(0, 0) +7:1/0/physics_layer_0/angular_velocity = 0.0 +8:1/0 = 0 +8:1/0/physics_layer_0/linear_velocity = Vector2(0, 0) +8:1/0/physics_layer_0/angular_velocity = 0.0 +9:1/0 = 0 +9:1/0/physics_layer_0/linear_velocity = Vector2(0, 0) +9:1/0/physics_layer_0/angular_velocity = 0.0 +10:1/0 = 0 +10:1/0/physics_layer_0/linear_velocity = Vector2(0, 0) +10:1/0/physics_layer_0/angular_velocity = 0.0 +11:1/0 = 0 +11:1/0/physics_layer_0/linear_velocity = Vector2(0, 0) +11:1/0/physics_layer_0/angular_velocity = 0.0 +12:1/0 = 0 +12:1/0/physics_layer_0/linear_velocity = Vector2(0, 0) +12:1/0/physics_layer_0/angular_velocity = 0.0 +13:1/0 = 0 +13:1/0/physics_layer_0/linear_velocity = Vector2(0, 0) +13:1/0/physics_layer_0/angular_velocity = 0.0 +14:1/0 = 0 +14:1/0/physics_layer_0/linear_velocity = Vector2(0, 0) +14:1/0/physics_layer_0/angular_velocity = 0.0 +15:1/0 = 0 +15:1/0/physics_layer_0/linear_velocity = Vector2(0, 0) +15:1/0/physics_layer_0/angular_velocity = 0.0 +0:2/0 = 0 +0:2/0/physics_layer_0/linear_velocity = Vector2(0, 0) +0:2/0/physics_layer_0/angular_velocity = 0.0 +1:2/0 = 0 +1:2/0/physics_layer_0/linear_velocity = Vector2(0, 0) +1:2/0/physics_layer_0/angular_velocity = 0.0 +1:2/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, 0, 8, 0, 8, 8, -8, 8) +2:2/0 = 0 +2:2/0/physics_layer_0/linear_velocity = Vector2(0, 0) +2:2/0/physics_layer_0/angular_velocity = 0.0 +2:2/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, 0, 8, 0, 8, 8, -8, 8) +3:2/0 = 0 +3:2/0/physics_layer_0/linear_velocity = Vector2(0, 0) +3:2/0/physics_layer_0/angular_velocity = 0.0 +3:2/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, 0, 8, 0, 8, 8, -8, 8) +4:2/0 = 0 +4:2/0/physics_layer_0/linear_velocity = Vector2(0, 0) +4:2/0/physics_layer_0/angular_velocity = 0.0 +5:2/0 = 0 +5:2/0/physics_layer_0/linear_velocity = Vector2(0, 0) +5:2/0/physics_layer_0/angular_velocity = 0.0 +6:2/0 = 0 +6:2/0/physics_layer_0/linear_velocity = Vector2(0, 0) +6:2/0/physics_layer_0/angular_velocity = 0.0 +7:2/0 = 0 +7:2/0/physics_layer_0/linear_velocity = Vector2(0, 0) +7:2/0/physics_layer_0/angular_velocity = 0.0 +8:2/0 = 0 +8:2/0/physics_layer_0/linear_velocity = Vector2(0, 0) +8:2/0/physics_layer_0/angular_velocity = 0.0 +9:2/0 = 0 +9:2/0/physics_layer_0/linear_velocity = Vector2(0, 0) +9:2/0/physics_layer_0/angular_velocity = 0.0 +10:2/0 = 0 +10:2/0/physics_layer_0/linear_velocity = Vector2(0, 0) +10:2/0/physics_layer_0/angular_velocity = 0.0 +11:2/0 = 0 +11:2/0/physics_layer_0/linear_velocity = Vector2(0, 0) +11:2/0/physics_layer_0/angular_velocity = 0.0 +11:2/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8) +12:2/0 = 0 +12:2/0/physics_layer_0/linear_velocity = Vector2(0, 0) +12:2/0/physics_layer_0/angular_velocity = 0.0 +13:2/0 = 0 +13:2/0/physics_layer_0/linear_velocity = Vector2(0, 0) +13:2/0/physics_layer_0/angular_velocity = 0.0 +13:2/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8) +14:2/0 = 0 +14:2/0/physics_layer_0/linear_velocity = Vector2(0, 0) +14:2/0/physics_layer_0/angular_velocity = 0.0 +15:2/0 = 0 +15:2/0/physics_layer_0/linear_velocity = Vector2(0, 0) +15:2/0/physics_layer_0/angular_velocity = 0.0 +0:3/0 = 0 +0:3/0/physics_layer_0/linear_velocity = Vector2(0, 0) +0:3/0/physics_layer_0/angular_velocity = 0.0 +1:3/0 = 0 +1:3/0/physics_layer_0/linear_velocity = Vector2(0, 0) +1:3/0/physics_layer_0/angular_velocity = 0.0 +1:3/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8) +2:3/0 = 0 +2:3/0/physics_layer_0/linear_velocity = Vector2(0, 0) +2:3/0/physics_layer_0/angular_velocity = 0.0 +2:3/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8) +3:3/0 = 0 +3:3/0/physics_layer_0/linear_velocity = Vector2(0, 0) +3:3/0/physics_layer_0/angular_velocity = 0.0 +3:3/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8) +4:3/0 = 0 +4:3/0/physics_layer_0/linear_velocity = Vector2(0, 0) +4:3/0/physics_layer_0/angular_velocity = 0.0 +5:3/0 = 0 +5:3/0/physics_layer_0/linear_velocity = Vector2(0, 0) +5:3/0/physics_layer_0/angular_velocity = 0.0 +6:3/0 = 0 +6:3/0/physics_layer_0/linear_velocity = Vector2(0, 0) +6:3/0/physics_layer_0/angular_velocity = 0.0 +7:3/0 = 0 +7:3/0/physics_layer_0/linear_velocity = Vector2(0, 0) +7:3/0/physics_layer_0/angular_velocity = 0.0 +8:3/0 = 0 +8:3/0/physics_layer_0/linear_velocity = Vector2(0, 0) +8:3/0/physics_layer_0/angular_velocity = 0.0 +9:3/0 = 0 +9:3/0/physics_layer_0/linear_velocity = Vector2(0, 0) +9:3/0/physics_layer_0/angular_velocity = 0.0 +10:3/0 = 0 +10:3/0/physics_layer_0/linear_velocity = Vector2(0, 0) +10:3/0/physics_layer_0/angular_velocity = 0.0 +11:3/0 = 0 +11:3/0/physics_layer_0/linear_velocity = Vector2(0, 0) +11:3/0/physics_layer_0/angular_velocity = 0.0 +12:3/0 = 0 +12:3/0/physics_layer_0/linear_velocity = Vector2(0, 0) +12:3/0/physics_layer_0/angular_velocity = 0.0 +13:3/0 = 0 +13:3/0/physics_layer_0/linear_velocity = Vector2(0, 0) +13:3/0/physics_layer_0/angular_velocity = 0.0 +14:3/0 = 0 +14:3/0/physics_layer_0/linear_velocity = Vector2(0, 0) +14:3/0/physics_layer_0/angular_velocity = 0.0 +15:3/0 = 0 +15:3/0/physics_layer_0/linear_velocity = Vector2(0, 0) +15:3/0/physics_layer_0/angular_velocity = 0.0 +0:4/0 = 0 +0:4/0/physics_layer_0/linear_velocity = Vector2(0, 0) +0:4/0/physics_layer_0/angular_velocity = 0.0 +1:4/0 = 0 +1:4/0/physics_layer_0/linear_velocity = Vector2(0, 0) +1:4/0/physics_layer_0/angular_velocity = 0.0 +1:4/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8) +2:4/0 = 0 +2:4/0/physics_layer_0/linear_velocity = Vector2(0, 0) +2:4/0/physics_layer_0/angular_velocity = 0.0 +2:4/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8) +3:4/0 = 0 +3:4/0/physics_layer_0/linear_velocity = Vector2(0, 0) +3:4/0/physics_layer_0/angular_velocity = 0.0 +3:4/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8) +4:4/0 = 0 +4:4/0/physics_layer_0/linear_velocity = Vector2(0, 0) +4:4/0/physics_layer_0/angular_velocity = 0.0 +5:4/0 = 0 +5:4/0/physics_layer_0/linear_velocity = Vector2(0, 0) +5:4/0/physics_layer_0/angular_velocity = 0.0 +6:4/0 = 0 +6:4/0/physics_layer_0/linear_velocity = Vector2(0, 0) +6:4/0/physics_layer_0/angular_velocity = 0.0 +7:4/0 = 0 +7:4/0/physics_layer_0/linear_velocity = Vector2(0, 0) +7:4/0/physics_layer_0/angular_velocity = 0.0 +8:4/0 = 0 +8:4/0/physics_layer_0/linear_velocity = Vector2(0, 0) +8:4/0/physics_layer_0/angular_velocity = 0.0 +9:4/0 = 0 +9:4/0/physics_layer_0/linear_velocity = Vector2(0, 0) +9:4/0/physics_layer_0/angular_velocity = 0.0 +10:4/0 = 0 +10:4/0/physics_layer_0/linear_velocity = Vector2(0, 0) +10:4/0/physics_layer_0/angular_velocity = 0.0 +11:4/0 = 0 +11:4/0/physics_layer_0/linear_velocity = Vector2(0, 0) +11:4/0/physics_layer_0/angular_velocity = 0.0 +12:4/0 = 0 +12:4/0/physics_layer_0/linear_velocity = Vector2(0, 0) +12:4/0/physics_layer_0/angular_velocity = 0.0 +13:4/0 = 0 +13:4/0/physics_layer_0/linear_velocity = Vector2(0, 0) +13:4/0/physics_layer_0/angular_velocity = 0.0 +14:4/0 = 0 +14:4/0/physics_layer_0/linear_velocity = Vector2(0, 0) +14:4/0/physics_layer_0/angular_velocity = 0.0 +15:4/0 = 0 +15:4/0/physics_layer_0/linear_velocity = Vector2(0, 0) +15:4/0/physics_layer_0/angular_velocity = 0.0 +0:5/0 = 0 +0:5/0/physics_layer_0/linear_velocity = Vector2(0, 0) +0:5/0/physics_layer_0/angular_velocity = 0.0 +1:5/0 = 0 +1:5/0/physics_layer_0/linear_velocity = Vector2(0, 0) +1:5/0/physics_layer_0/angular_velocity = 0.0 +1:5/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8) +2:5/0 = 0 +2:5/0/physics_layer_0/linear_velocity = Vector2(0, 0) +2:5/0/physics_layer_0/angular_velocity = 0.0 +2:5/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8) +3:5/0 = 0 +3:5/0/physics_layer_0/linear_velocity = Vector2(0, 0) +3:5/0/physics_layer_0/angular_velocity = 0.0 +3:5/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8) +4:5/0 = 0 +4:5/0/physics_layer_0/linear_velocity = Vector2(0, 0) +4:5/0/physics_layer_0/angular_velocity = 0.0 +5:5/0 = 0 +5:5/0/physics_layer_0/linear_velocity = Vector2(0, 0) +5:5/0/physics_layer_0/angular_velocity = 0.0 +6:5/0 = 0 +6:5/0/physics_layer_0/linear_velocity = Vector2(0, 0) +6:5/0/physics_layer_0/angular_velocity = 0.0 +7:5/0 = 0 +7:5/0/physics_layer_0/linear_velocity = Vector2(0, 0) +7:5/0/physics_layer_0/angular_velocity = 0.0 +8:5/0 = 0 +8:5/0/physics_layer_0/linear_velocity = Vector2(0, 0) +8:5/0/physics_layer_0/angular_velocity = 0.0 +9:5/0 = 0 +9:5/0/physics_layer_0/linear_velocity = Vector2(0, 0) +9:5/0/physics_layer_0/angular_velocity = 0.0 +10:5/0 = 0 +10:5/0/physics_layer_0/linear_velocity = Vector2(0, 0) +10:5/0/physics_layer_0/angular_velocity = 0.0 +11:5/0 = 0 +11:5/0/physics_layer_0/linear_velocity = Vector2(0, 0) +11:5/0/physics_layer_0/angular_velocity = 0.0 +12:5/0 = 0 +12:5/0/physics_layer_0/linear_velocity = Vector2(0, 0) +12:5/0/physics_layer_0/angular_velocity = 0.0 +13:5/0 = 0 +13:5/0/physics_layer_0/linear_velocity = Vector2(0, 0) +13:5/0/physics_layer_0/angular_velocity = 0.0 +14:5/0 = 0 +14:5/0/physics_layer_0/linear_velocity = Vector2(0, 0) +14:5/0/physics_layer_0/angular_velocity = 0.0 +15:5/0 = 0 +15:5/0/physics_layer_0/linear_velocity = Vector2(0, 0) +15:5/0/physics_layer_0/angular_velocity = 0.0 +0:6/0 = 0 +0:6/0/physics_layer_0/linear_velocity = Vector2(0, 0) +0:6/0/physics_layer_0/angular_velocity = 0.0 +1:6/0 = 0 +1:6/0/physics_layer_0/linear_velocity = Vector2(0, 0) +1:6/0/physics_layer_0/angular_velocity = 0.0 +1:6/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8) +2:6/0 = 0 +2:6/0/physics_layer_0/linear_velocity = Vector2(0, 0) +2:6/0/physics_layer_0/angular_velocity = 0.0 +2:6/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8) +3:6/0 = 0 +3:6/0/physics_layer_0/linear_velocity = Vector2(0, 0) +3:6/0/physics_layer_0/angular_velocity = 0.0 +3:6/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8) +4:6/0 = 0 +4:6/0/physics_layer_0/linear_velocity = Vector2(0, 0) +4:6/0/physics_layer_0/angular_velocity = 0.0 +5:6/0 = 0 +5:6/0/physics_layer_0/linear_velocity = Vector2(0, 0) +5:6/0/physics_layer_0/angular_velocity = 0.0 +6:6/0 = 0 +6:6/0/physics_layer_0/linear_velocity = Vector2(0, 0) +6:6/0/physics_layer_0/angular_velocity = 0.0 +7:6/0 = 0 +7:6/0/physics_layer_0/linear_velocity = Vector2(0, 0) +7:6/0/physics_layer_0/angular_velocity = 0.0 +8:6/0 = 0 +8:6/0/physics_layer_0/linear_velocity = Vector2(0, 0) +8:6/0/physics_layer_0/angular_velocity = 0.0 +9:6/0 = 0 +9:6/0/physics_layer_0/linear_velocity = Vector2(0, 0) +9:6/0/physics_layer_0/angular_velocity = 0.0 +10:6/0 = 0 +10:6/0/physics_layer_0/linear_velocity = Vector2(0, 0) +10:6/0/physics_layer_0/angular_velocity = 0.0 +11:6/0 = 0 +11:6/0/physics_layer_0/linear_velocity = Vector2(0, 0) +11:6/0/physics_layer_0/angular_velocity = 0.0 +12:6/0 = 0 +12:6/0/physics_layer_0/linear_velocity = Vector2(0, 0) +12:6/0/physics_layer_0/angular_velocity = 0.0 +13:6/0 = 0 +13:6/0/physics_layer_0/linear_velocity = Vector2(0, 0) +13:6/0/physics_layer_0/angular_velocity = 0.0 +14:6/0 = 0 +14:6/0/physics_layer_0/linear_velocity = Vector2(0, 0) +14:6/0/physics_layer_0/angular_velocity = 0.0 +15:6/0 = 0 +15:6/0/physics_layer_0/linear_velocity = Vector2(0, 0) +15:6/0/physics_layer_0/angular_velocity = 0.0 +0:7/0 = 0 +0:7/0/physics_layer_0/linear_velocity = Vector2(0, 0) +0:7/0/physics_layer_0/angular_velocity = 0.0 +1:7/0 = 0 +1:7/0/physics_layer_0/linear_velocity = Vector2(0, 0) +1:7/0/physics_layer_0/angular_velocity = 0.0 +1:7/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8) +2:7/0 = 0 +2:7/0/physics_layer_0/linear_velocity = Vector2(0, 0) +2:7/0/physics_layer_0/angular_velocity = 0.0 +2:7/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8) +3:7/0 = 0 +3:7/0/physics_layer_0/linear_velocity = Vector2(0, 0) +3:7/0/physics_layer_0/angular_velocity = 0.0 +3:7/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8) +4:7/0 = 0 +4:7/0/physics_layer_0/linear_velocity = Vector2(0, 0) +4:7/0/physics_layer_0/angular_velocity = 0.0 +5:7/0 = 0 +5:7/0/physics_layer_0/linear_velocity = Vector2(0, 0) +5:7/0/physics_layer_0/angular_velocity = 0.0 +6:7/0 = 0 +6:7/0/physics_layer_0/linear_velocity = Vector2(0, 0) +6:7/0/physics_layer_0/angular_velocity = 0.0 +7:7/0 = 0 +7:7/0/physics_layer_0/linear_velocity = Vector2(0, 0) +7:7/0/physics_layer_0/angular_velocity = 0.0 +8:7/0 = 0 +8:7/0/physics_layer_0/linear_velocity = Vector2(0, 0) +8:7/0/physics_layer_0/angular_velocity = 0.0 +9:7/0 = 0 +9:7/0/physics_layer_0/linear_velocity = Vector2(0, 0) +9:7/0/physics_layer_0/angular_velocity = 0.0 +10:7/0 = 0 +10:7/0/physics_layer_0/linear_velocity = Vector2(0, 0) +10:7/0/physics_layer_0/angular_velocity = 0.0 +11:7/0 = 0 +11:7/0/physics_layer_0/linear_velocity = Vector2(0, 0) +11:7/0/physics_layer_0/angular_velocity = 0.0 +12:7/0 = 0 +12:7/0/physics_layer_0/linear_velocity = Vector2(0, 0) +12:7/0/physics_layer_0/angular_velocity = 0.0 +13:7/0 = 0 +13:7/0/physics_layer_0/linear_velocity = Vector2(0, 0) +13:7/0/physics_layer_0/angular_velocity = 0.0 +14:7/0 = 0 +14:7/0/physics_layer_0/linear_velocity = Vector2(0, 0) +14:7/0/physics_layer_0/angular_velocity = 0.0 +15:7/0 = 0 +15:7/0/physics_layer_0/linear_velocity = Vector2(0, 0) +15:7/0/physics_layer_0/angular_velocity = 0.0 +0:8/0 = 0 +0:8/0/physics_layer_0/linear_velocity = Vector2(0, 0) +0:8/0/physics_layer_0/angular_velocity = 0.0 +1:8/0 = 0 +1:8/0/physics_layer_0/linear_velocity = Vector2(0, 0) +1:8/0/physics_layer_0/angular_velocity = 0.0 +2:8/0 = 0 +2:8/0/physics_layer_0/linear_velocity = Vector2(0, 0) +2:8/0/physics_layer_0/angular_velocity = 0.0 +3:8/0 = 0 +3:8/0/physics_layer_0/linear_velocity = Vector2(0, 0) +3:8/0/physics_layer_0/angular_velocity = 0.0 +4:8/0 = 0 +4:8/0/physics_layer_0/linear_velocity = Vector2(0, 0) +4:8/0/physics_layer_0/angular_velocity = 0.0 +5:8/0 = 0 +5:8/0/physics_layer_0/linear_velocity = Vector2(0, 0) +5:8/0/physics_layer_0/angular_velocity = 0.0 +6:8/0 = 0 +6:8/0/physics_layer_0/linear_velocity = Vector2(0, 0) +6:8/0/physics_layer_0/angular_velocity = 0.0 +7:8/0 = 0 +7:8/0/physics_layer_0/linear_velocity = Vector2(0, 0) +7:8/0/physics_layer_0/angular_velocity = 0.0 +8:8/0 = 0 +8:8/0/physics_layer_0/linear_velocity = Vector2(0, 0) +8:8/0/physics_layer_0/angular_velocity = 0.0 +9:8/0 = 0 +9:8/0/physics_layer_0/linear_velocity = Vector2(0, 0) +9:8/0/physics_layer_0/angular_velocity = 0.0 +10:8/0 = 0 +10:8/0/physics_layer_0/linear_velocity = Vector2(0, 0) +10:8/0/physics_layer_0/angular_velocity = 0.0 +11:8/0 = 0 +11:8/0/physics_layer_0/linear_velocity = Vector2(0, 0) +11:8/0/physics_layer_0/angular_velocity = 0.0 +12:8/0 = 0 +12:8/0/physics_layer_0/linear_velocity = Vector2(0, 0) +12:8/0/physics_layer_0/angular_velocity = 0.0 +13:8/0 = 0 +13:8/0/physics_layer_0/linear_velocity = Vector2(0, 0) +13:8/0/physics_layer_0/angular_velocity = 0.0 +14:8/0 = 0 +14:8/0/physics_layer_0/linear_velocity = Vector2(0, 0) +14:8/0/physics_layer_0/angular_velocity = 0.0 +15:8/0 = 0 +15:8/0/physics_layer_0/linear_velocity = Vector2(0, 0) +15:8/0/physics_layer_0/angular_velocity = 0.0 +0:9/0 = 0 +0:9/0/physics_layer_0/linear_velocity = Vector2(0, 0) +0:9/0/physics_layer_0/angular_velocity = 0.0 +1:9/0 = 0 +1:9/0/physics_layer_0/linear_velocity = Vector2(0, 0) +1:9/0/physics_layer_0/angular_velocity = 0.0 +2:9/0 = 0 +2:9/0/physics_layer_0/linear_velocity = Vector2(0, 0) +2:9/0/physics_layer_0/angular_velocity = 0.0 +3:9/0 = 0 +3:9/0/physics_layer_0/linear_velocity = Vector2(0, 0) +3:9/0/physics_layer_0/angular_velocity = 0.0 +4:9/0 = 0 +4:9/0/physics_layer_0/linear_velocity = Vector2(0, 0) +4:9/0/physics_layer_0/angular_velocity = 0.0 +5:9/0 = 0 +5:9/0/physics_layer_0/linear_velocity = Vector2(0, 0) +5:9/0/physics_layer_0/angular_velocity = 0.0 +6:9/0 = 0 +6:9/0/physics_layer_0/linear_velocity = Vector2(0, 0) +6:9/0/physics_layer_0/angular_velocity = 0.0 +7:9/0 = 0 +7:9/0/physics_layer_0/linear_velocity = Vector2(0, 0) +7:9/0/physics_layer_0/angular_velocity = 0.0 +10:9/0 = 0 +10:9/0/physics_layer_0/linear_velocity = Vector2(0, 0) +10:9/0/physics_layer_0/angular_velocity = 0.0 +11:9/0 = 0 +11:9/0/physics_layer_0/linear_velocity = Vector2(0, 0) +11:9/0/physics_layer_0/angular_velocity = 0.0 +12:9/0 = 0 +12:9/0/physics_layer_0/linear_velocity = Vector2(0, 0) +12:9/0/physics_layer_0/angular_velocity = 0.0 +13:9/0 = 0 +13:9/0/physics_layer_0/linear_velocity = Vector2(0, 0) +13:9/0/physics_layer_0/angular_velocity = 0.0 +14:9/0 = 0 +14:9/0/physics_layer_0/linear_velocity = Vector2(0, 0) +14:9/0/physics_layer_0/angular_velocity = 0.0 +15:9/0 = 0 +15:9/0/physics_layer_0/linear_velocity = Vector2(0, 0) +15:9/0/physics_layer_0/angular_velocity = 0.0 +0:10/0 = 0 +0:10/0/physics_layer_0/linear_velocity = Vector2(0, 0) +0:10/0/physics_layer_0/angular_velocity = 0.0 +1:10/0 = 0 +1:10/0/physics_layer_0/linear_velocity = Vector2(0, 0) +1:10/0/physics_layer_0/angular_velocity = 0.0 +2:10/0 = 0 +2:10/0/physics_layer_0/linear_velocity = Vector2(0, 0) +2:10/0/physics_layer_0/angular_velocity = 0.0 +3:10/0 = 0 +3:10/0/physics_layer_0/linear_velocity = Vector2(0, 0) +3:10/0/physics_layer_0/angular_velocity = 0.0 +5:10/0 = 0 +5:10/0/physics_layer_0/linear_velocity = Vector2(0, 0) +5:10/0/physics_layer_0/angular_velocity = 0.0 +6:10/0 = 0 +6:10/0/physics_layer_0/linear_velocity = Vector2(0, 0) +6:10/0/physics_layer_0/angular_velocity = 0.0 +7:10/0 = 0 +7:10/0/physics_layer_0/linear_velocity = Vector2(0, 0) +7:10/0/physics_layer_0/angular_velocity = 0.0 +13:10/0 = 0 +13:10/0/physics_layer_0/linear_velocity = Vector2(0, 0) +13:10/0/physics_layer_0/angular_velocity = 0.0 +14:10/0 = 0 +14:10/0/physics_layer_0/linear_velocity = Vector2(0, 0) +14:10/0/physics_layer_0/angular_velocity = 0.0 +15:10/0 = 0 +15:10/0/physics_layer_0/linear_velocity = Vector2(0, 0) +15:10/0/physics_layer_0/angular_velocity = 0.0 +0:11/0 = 0 +0:11/0/physics_layer_0/linear_velocity = Vector2(0, 0) +0:11/0/physics_layer_0/angular_velocity = 0.0 +1:11/0 = 0 +1:11/0/physics_layer_0/linear_velocity = Vector2(0, 0) +1:11/0/physics_layer_0/angular_velocity = 0.0 +2:11/0 = 0 +2:11/0/physics_layer_0/linear_velocity = Vector2(0, 0) +2:11/0/physics_layer_0/angular_velocity = 0.0 +3:11/0 = 0 +3:11/0/physics_layer_0/linear_velocity = Vector2(0, 0) +3:11/0/physics_layer_0/angular_velocity = 0.0 +4:11/0 = 0 +4:11/0/physics_layer_0/linear_velocity = Vector2(0, 0) +4:11/0/physics_layer_0/angular_velocity = 0.0 +13:11/0 = 0 +13:11/0/physics_layer_0/linear_velocity = Vector2(0, 0) +13:11/0/physics_layer_0/angular_velocity = 0.0 +14:11/0 = 0 +14:11/0/physics_layer_0/linear_velocity = Vector2(0, 0) +14:11/0/physics_layer_0/angular_velocity = 0.0 +15:11/0 = 0 +15:11/0/physics_layer_0/linear_velocity = Vector2(0, 0) +15:11/0/physics_layer_0/angular_velocity = 0.0 + +[resource] +physics_layer_0/collision_layer = 1 +physics_layer_0/collision_mask = 0 +sources/1 = SubResource("TileSetAtlasSource_rkmbu") diff --git a/DungeonShooting_Godot/resource/map/tiledata/testGroup/battle/Room1.json b/DungeonShooting_Godot/resource/map/tiledata/testGroup/battle/Room1.json deleted file mode 100644 index 1b6dd17..0000000 --- a/DungeonShooting_Godot/resource/map/tiledata/testGroup/battle/Room1.json +++ /dev/null @@ -1,96 +0,0 @@ -{ - "Position": { - "X": -5, - "Y": -6 - }, - "Size": { - "X": 24, - "Y": 15 - }, - "DoorAreaInfos": [], - "NavigationList": [ - { - "Type": 0, - "Points": [ - { - "X": -56, - "Y": -72 - }, - { - "X": 280, - "Y": -72 - }, - { - "X": 280, - "Y": 128 - }, - { - "X": -56, - "Y": 128 - } - ] - }, - { - "Type": 1, - "Points": [ - { - "X": -24, - "Y": -32 - }, - { - "X": 56, - "Y": -32 - }, - { - "X": 56, - "Y": 8 - }, - { - "X": 24, - "Y": 8 - }, - { - "X": 24, - "Y": 24 - }, - { - "X": -24, - "Y": 24 - } - ] - }, - { - "Type": 1, - "Points": [ - { - "X": 200, - "Y": 32 - }, - { - "X": 248, - "Y": 32 - }, - { - "X": 248, - "Y": 88 - }, - { - "X": 168, - "Y": 88 - }, - { - "X": 168, - "Y": 48 - }, - { - "X": 200, - "Y": 48 - } - ] - } - ], - "GroupName": "testGroup", - "RoomType": 0, - "FileName": "Room1", - "Weight": 100 -} \ No newline at end of file diff --git a/DungeonShooting_Godot/resource/map/tiledata/testGroup/battle/Room2.json b/DungeonShooting_Godot/resource/map/tiledata/testGroup/battle/Room2.json deleted file mode 100644 index ea48daf..0000000 --- a/DungeonShooting_Godot/resource/map/tiledata/testGroup/battle/Room2.json +++ /dev/null @@ -1,154 +0,0 @@ -{ - "Position": { - "X": -5, - "Y": -6 - }, - "Size": { - "X": 31, - "Y": 24 - }, - "DoorAreaInfos": [ - { - "Direction": 3, - "Start": 144, - "End": 432 - }, - { - "Direction": 1, - "Start": 48, - "End": 176 - }, - { - "Direction": 1, - "Start": 256, - "End": 368 - }, - { - "Direction": 2, - "Start": 16, - "End": 128 - }, - { - "Direction": 2, - "Start": 256, - "End": 480 - }, - { - "Direction": 0, - "Start": 272, - "End": 368 - } - ], - "NavigationList": [ - { - "Type": 0, - "Points": [ - { - "X": 72, - "Y": -72 - }, - { - "X": 344, - "Y": -72 - }, - { - "X": 344, - "Y": 32 - }, - { - "X": 248, - "Y": 32 - }, - { - "X": 248, - "Y": 120 - }, - { - "X": 344, - "Y": 120 - }, - { - "X": 344, - "Y": 200 - }, - { - "X": 392, - "Y": 200 - }, - { - "X": 392, - "Y": 272 - }, - { - "X": 184, - "Y": 272 - }, - { - "X": 184, - "Y": 208 - }, - { - "X": 40, - "Y": 208 - }, - { - "X": 40, - "Y": 272 - }, - { - "X": -56, - "Y": 272 - }, - { - "X": -56, - "Y": 184 - }, - { - "X": -8, - "Y": 184 - }, - { - "X": -8, - "Y": 80 - }, - { - "X": -56, - "Y": 80 - }, - { - "X": -56, - "Y": -24 - }, - { - "X": 72, - "Y": -24 - } - ] - }, - { - "Type": 1, - "Points": [ - { - "X": 56, - "Y": 48 - }, - { - "X": 168, - "Y": 48 - }, - { - "X": 168, - "Y": 136 - }, - { - "X": 56, - "Y": 136 - } - ] - } - ], - "GroupName": "testGroup", - "RoomType": 0, - "FileName": "Room2", - "Weight": 100 -} \ No newline at end of file diff --git a/DungeonShooting_Godot/resource/map/tiledata/testGroup/battle/Room3.json b/DungeonShooting_Godot/resource/map/tiledata/testGroup/battle/Room3.json deleted file mode 100644 index c8f0091..0000000 --- a/DungeonShooting_Godot/resource/map/tiledata/testGroup/battle/Room3.json +++ /dev/null @@ -1,117 +0,0 @@ -{ - "Position": { - "X": -1, - "Y": -1 - }, - "Size": { - "X": 26, - "Y": 20 - }, - "DoorAreaInfos": [ - { - "Direction": 3, - "Start": 16, - "End": 128 - }, - { - "Direction": 3, - "Start": 208, - "End": 320 - }, - { - "Direction": 1, - "Start": 16, - "End": 224 - }, - { - "Direction": 2, - "Start": 96, - "End": 192 - }, - { - "Direction": 2, - "Start": 288, - "End": 400 - }, - { - "Direction": 0, - "Start": 96, - "End": 304 - } - ], - "NavigationList": [ - { - "Type": 0, - "Points": [ - { - "X": 8, - "Y": 8 - }, - { - "X": 104, - "Y": 8 - }, - { - "X": 104, - "Y": 88 - }, - { - "X": 200, - "Y": 88 - }, - { - "X": 200, - "Y": 8 - }, - { - "X": 296, - "Y": 8 - }, - { - "X": 296, - "Y": 88 - }, - { - "X": 376, - "Y": 88 - }, - { - "X": 376, - "Y": 288 - }, - { - "X": 280, - "Y": 288 - }, - { - "X": 280, - "Y": 208 - }, - { - "X": 168, - "Y": 208 - }, - { - "X": 168, - "Y": 288 - }, - { - "X": 88, - "Y": 288 - }, - { - "X": 88, - "Y": 208 - }, - { - "X": 8, - "Y": 208 - } - ] - } - ], - "GroupName": "testGroup", - "RoomType": 0, - "FileName": "Room3", - "Weight": 100 -} \ No newline at end of file diff --git a/DungeonShooting_Godot/resource/map/tiledata/testGroup/battle/Room4.json b/DungeonShooting_Godot/resource/map/tiledata/testGroup/battle/Room4.json deleted file mode 100644 index 464869f..0000000 --- a/DungeonShooting_Godot/resource/map/tiledata/testGroup/battle/Room4.json +++ /dev/null @@ -1,259 +0,0 @@ -{ - "Position": { - "X": -5, - "Y": -5 - }, - "Size": { - "X": 32, - "Y": 29 - }, - "DoorAreaInfos": [ - { - "Direction": 3, - "Start": 16, - "End": 176 - }, - { - "Direction": 1, - "Start": 16, - "End": 176 - }, - { - "Direction": 1, - "Start": 304, - "End": 448 - }, - { - "Direction": 2, - "Start": 16, - "End": 144 - }, - { - "Direction": 2, - "Start": 352, - "End": 496 - }, - { - "Direction": 0, - "Start": 304, - "End": 448 - }, - { - "Direction": 0, - "Start": 16, - "End": 176 - }, - { - "Direction": 3, - "Start": 336, - "End": 496 - } - ], - "NavigationList": [ - { - "Type": 0, - "Points": [ - { - "X": -56, - "Y": -56 - }, - { - "X": 88, - "Y": -56 - }, - { - "X": 88, - "Y": 8 - }, - { - "X": 264, - "Y": 8 - }, - { - "X": 264, - "Y": -56 - }, - { - "X": 408, - "Y": -56 - }, - { - "X": 408, - "Y": 96 - }, - { - "X": 344, - "Y": 96 - }, - { - "X": 344, - "Y": 232 - }, - { - "X": 408, - "Y": 232 - }, - { - "X": 408, - "Y": 368 - }, - { - "X": 264, - "Y": 368 - }, - { - "X": 264, - "Y": 304 - }, - { - "X": 88, - "Y": 304 - }, - { - "X": 88, - "Y": 368 - }, - { - "X": -56, - "Y": 368 - }, - { - "X": -56, - "Y": 232 - }, - { - "X": 8, - "Y": 232 - }, - { - "X": 8, - "Y": 96 - }, - { - "X": -56, - "Y": 96 - } - ] - }, - { - "Type": 1, - "Points": [ - { - "X": 88, - "Y": 32 - }, - { - "X": 136, - "Y": 32 - }, - { - "X": 136, - "Y": 136 - }, - { - "X": 24, - "Y": 136 - }, - { - "X": 24, - "Y": 96 - }, - { - "X": 88, - "Y": 96 - } - ] - }, - { - "Type": 1, - "Points": [ - { - "X": 216, - "Y": 32 - }, - { - "X": 264, - "Y": 32 - }, - { - "X": 264, - "Y": 96 - }, - { - "X": 328, - "Y": 96 - }, - { - "X": 328, - "Y": 136 - }, - { - "X": 216, - "Y": 136 - } - ] - }, - { - "Type": 1, - "Points": [ - { - "X": 24, - "Y": 192 - }, - { - "X": 136, - "Y": 192 - }, - { - "X": 136, - "Y": 280 - }, - { - "X": 88, - "Y": 280 - }, - { - "X": 88, - "Y": 232 - }, - { - "X": 24, - "Y": 232 - } - ] - }, - { - "Type": 1, - "Points": [ - { - "X": 216, - "Y": 192 - }, - { - "X": 328, - "Y": 192 - }, - { - "X": 328, - "Y": 232 - }, - { - "X": 264, - "Y": 232 - }, - { - "X": 264, - "Y": 280 - }, - { - "X": 216, - "Y": 280 - } - ] - } - ], - "GroupName": "testGroup", - "RoomType": 0, - "FileName": "Room4", - "Weight": 100 -} \ No newline at end of file diff --git a/DungeonShooting_Godot/resource/map/tiledata/testGroup/battle/Room5.json b/DungeonShooting_Godot/resource/map/tiledata/testGroup/battle/Room5.json deleted file mode 100644 index 5e6371c..0000000 --- a/DungeonShooting_Godot/resource/map/tiledata/testGroup/battle/Room5.json +++ /dev/null @@ -1,154 +0,0 @@ -{ - "Position": { - "X": -3, - "Y": -6 - }, - "Size": { - "X": 21, - "Y": 18 - }, - "DoorAreaInfos": [ - { - "Direction": 0, - "Start": 16, - "End": 192 - }, - { - "Direction": 3, - "Start": 80, - "End": 320 - }, - { - "Direction": 1, - "Start": 64, - "End": 240 - }, - { - "Direction": 2, - "Start": 96, - "End": 240 - } - ], - "NavigationList": [ - { - "Type": 0, - "Points": [ - { - "X": 40, - "Y": -72 - }, - { - "X": 264, - "Y": -72 - }, - { - "X": 264, - "Y": 96 - }, - { - "X": 232, - "Y": 96 - }, - { - "X": 232, - "Y": 144 - }, - { - "X": 184, - "Y": 144 - }, - { - "X": 184, - "Y": 176 - }, - { - "X": 56, - "Y": 176 - }, - { - "X": 56, - "Y": 144 - }, - { - "X": -24, - "Y": 144 - }, - { - "X": -24, - "Y": -24 - }, - { - "X": 40, - "Y": -24 - } - ] - }, - { - "Type": 1, - "Points": [ - { - "X": 72, - "Y": -48 - }, - { - "X": 200, - "Y": -48 - }, - { - "X": 200, - "Y": 8 - }, - { - "X": 72, - "Y": 8 - } - ] - }, - { - "Type": 1, - "Points": [ - { - "X": -8, - "Y": 32 - }, - { - "X": 72, - "Y": 32 - }, - { - "X": 72, - "Y": 88 - }, - { - "X": -8, - "Y": 88 - } - ] - }, - { - "Type": 1, - "Points": [ - { - "X": 136, - "Y": 48 - }, - { - "X": 216, - "Y": 48 - }, - { - "X": 216, - "Y": 104 - }, - { - "X": 136, - "Y": 104 - } - ] - } - ], - "GroupName": "testGroup", - "RoomType": 0, - "FileName": "Room5", - "Weight": 100 -} \ No newline at end of file diff --git a/DungeonShooting_Godot/resource/map/tiledata/testGroup/battle/Room6.json b/DungeonShooting_Godot/resource/map/tiledata/testGroup/battle/Room6.json deleted file mode 100644 index 7d83388..0000000 --- a/DungeonShooting_Godot/resource/map/tiledata/testGroup/battle/Room6.json +++ /dev/null @@ -1,186 +0,0 @@ -{ - "Position": { - "X": -3, - "Y": -6 - }, - "Size": { - "X": 24, - "Y": 14 - }, - "DoorAreaInfos": [ - { - "Direction": 3, - "Start": 16, - "End": 368 - }, - { - "Direction": 0, - "Start": 16, - "End": 128 - }, - { - "Direction": 2, - "Start": 32, - "End": 272 - }, - { - "Direction": 1, - "Start": 16, - "End": 128 - } - ], - "NavigationList": [ - { - "Type": 0, - "Points": [ - { - "X": -24, - "Y": -72 - }, - { - "X": 312, - "Y": -72 - }, - { - "X": 312, - "Y": 32 - }, - { - "X": 280, - "Y": 32 - }, - { - "X": 280, - "Y": 80 - }, - { - "X": 248, - "Y": 80 - }, - { - "X": 248, - "Y": 112 - }, - { - "X": -8, - "Y": 112 - }, - { - "X": -8, - "Y": 32 - }, - { - "X": -24, - "Y": 32 - } - ] - }, - { - "Type": 1, - "Points": [ - { - "X": 56, - "Y": -48 - }, - { - "X": 136, - "Y": -48 - }, - { - "X": 136, - "Y": -32 - }, - { - "X": 184, - "Y": -32 - }, - { - "X": 184, - "Y": 8 - }, - { - "X": 88, - "Y": 8 - }, - { - "X": 88, - "Y": 40 - }, - { - "X": 24, - "Y": 40 - }, - { - "X": 24, - "Y": -32 - }, - { - "X": 56, - "Y": -32 - } - ] - }, - { - "Type": 1, - "Points": [ - { - "X": 216, - "Y": -48 - }, - { - "X": 280, - "Y": -48 - }, - { - "X": 280, - "Y": 8 - }, - { - "X": 216, - "Y": 8 - } - ] - }, - { - "Type": 1, - "Points": [ - { - "X": 104, - "Y": 32 - }, - { - "X": 216, - "Y": 32 - }, - { - "X": 216, - "Y": 72 - }, - { - "X": 184, - "Y": 72 - }, - { - "X": 184, - "Y": 88 - }, - { - "X": 136, - "Y": 88 - }, - { - "X": 136, - "Y": 72 - }, - { - "X": 104, - "Y": 72 - } - ] - } - ], - "GroupName": "testGroup", - "RoomType": 0, - "FileName": "Room6", - "Weight": 100 -} \ No newline at end of file diff --git a/DungeonShooting_Godot/resource/map/tiledata/testGroup/battle/Room8.json b/DungeonShooting_Godot/resource/map/tiledata/testGroup/battle/Room8.json deleted file mode 100644 index 6cd97e7..0000000 --- a/DungeonShooting_Godot/resource/map/tiledata/testGroup/battle/Room8.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "Position": { - "X": -5, - "Y": -3 - }, - "Size": { - "X": 25, - "Y": 16 - }, - "DoorAreaInfos": [], - "NavigationList": [ - { - "Type": 0, - "Points": [ - { - "X": -56, - "Y": -24 - }, - { - "X": 296, - "Y": -24 - }, - { - "X": 296, - "Y": 192 - }, - { - "X": -56, - "Y": 192 - } - ] - } - ], - "GroupName": "testGroup", - "RoomType": 0, - "FileName": "Room8", - "Weight": 100 -} \ No newline at end of file diff --git a/DungeonShooting_Godot/resource/map/tiledata/testGroup/boss/Room1.json b/DungeonShooting_Godot/resource/map/tiledata/testGroup/boss/Room1.json deleted file mode 100644 index d2d0c0e..0000000 --- a/DungeonShooting_Godot/resource/map/tiledata/testGroup/boss/Room1.json +++ /dev/null @@ -1,91 +0,0 @@ -{ - "Position": { - "X": -5, - "Y": -6 - }, - "Size": { - "X": 39, - "Y": 25 - }, - "DoorAreaInfos": [], - "NavigationList": [ - { - "Type": 0, - "Points": [ - { - "X": -56, - "Y": -72 - }, - { - "X": 520, - "Y": -72 - }, - { - "X": 520, - "Y": 288 - }, - { - "X": -56, - "Y": 288 - } - ] - }, - { - "Type": 1, - "Points": [ - { - "X": 200, - "Y": 0 - }, - { - "X": 280, - "Y": 0 - }, - { - "X": 280, - "Y": 64 - }, - { - "X": 344, - "Y": 64 - }, - { - "X": 344, - "Y": 136 - }, - { - "X": 280, - "Y": 136 - }, - { - "X": 280, - "Y": 200 - }, - { - "X": 200, - "Y": 200 - }, - { - "X": 200, - "Y": 136 - }, - { - "X": 136, - "Y": 136 - }, - { - "X": 136, - "Y": 64 - }, - { - "X": 200, - "Y": 64 - } - ] - } - ], - "GroupName": "testGroup", - "RoomType": 3, - "FileName": "Room1", - "Weight": 100 -} \ No newline at end of file diff --git a/DungeonShooting_Godot/resource/map/tiledata/testGroup/inlet/Room1.json b/DungeonShooting_Godot/resource/map/tiledata/testGroup/inlet/Room1.json deleted file mode 100644 index 6c3fba1..0000000 --- a/DungeonShooting_Godot/resource/map/tiledata/testGroup/inlet/Room1.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "Position": { - "X": -1, - "Y": -1 - }, - "Size": { - "X": 12, - "Y": 8 - }, - "DoorAreaInfos": [], - "NavigationList": [ - { - "Type": 0, - "Points": [ - { - "X": 8, - "Y": 8 - }, - { - "X": 152, - "Y": 8 - }, - { - "X": 152, - "Y": 96 - }, - { - "X": 8, - "Y": 96 - } - ] - } - ], - "GroupName": "testGroup", - "RoomType": 1, - "FileName": "Room1", - "Weight": 100 -} \ No newline at end of file diff --git a/DungeonShooting_Godot/resource/map/tiledata/testGroup/outlet/Room1.json b/DungeonShooting_Godot/resource/map/tiledata/testGroup/outlet/Room1.json deleted file mode 100644 index d69b1f8..0000000 --- a/DungeonShooting_Godot/resource/map/tiledata/testGroup/outlet/Room1.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "Position": { - "X": -4, - "Y": -4 - }, - "Size": { - "X": 15, - "Y": 12 - }, - "DoorAreaInfos": [], - "NavigationList": [ - { - "Type": 0, - "Points": [ - { - "X": -40, - "Y": -40 - }, - { - "X": 152, - "Y": -40 - }, - { - "X": 152, - "Y": 112 - }, - { - "X": -40, - "Y": 112 - } - ] - }, - { - "Type": 1, - "Points": [ - { - "X": -8, - "Y": 0 - }, - { - "X": 120, - "Y": 0 - }, - { - "X": 120, - "Y": 72 - }, - { - "X": 72, - "Y": 72 - }, - { - "X": 72, - "Y": 40 - }, - { - "X": 40, - "Y": 40 - }, - { - "X": 40, - "Y": 72 - }, - { - "X": -8, - "Y": 72 - } - ] - } - ], - "GroupName": "testGroup", - "RoomType": 2, - "FileName": "Room1", - "Weight": 100 -} \ No newline at end of file diff --git a/DungeonShooting_Godot/scene/World.tscn b/DungeonShooting_Godot/scene/World.tscn index 2be89e7..23a0ef2 100644 --- a/DungeonShooting_Godot/scene/World.tscn +++ b/DungeonShooting_Godot/scene/World.tscn @@ -1,7 +1,7 @@ [gd_scene load_steps=3 format=3 uid="uid://bqf2vks5ggnsp"] [ext_resource type="Script" path="res://src/game/room/World.cs" id="1_kt3mm"] -[ext_resource type="TileSet" uid="uid://b00g22o1cqhe8" path="res://resource/map/tileset/TileSet1.tres" id="2_p6iui"] +[ext_resource type="TileSet" uid="uid://b00g22o1cqhe8" path="res://resource/map/tileSet/TileSet1.tres" id="2_p6iui"] [node name="World" type="Node2D" node_paths=PackedStringArray("NormalLayer", "YSortLayer", "TileRoot", "StaticSpriteRoot", "AffiliationAreaRoot")] script = ExtResource("1_kt3mm") diff --git a/DungeonShooting_Godot/scene/test/TestNewTileMap.tscn b/DungeonShooting_Godot/scene/test/TestNewTileMap.tscn index 00086de..357fb18 100644 --- a/DungeonShooting_Godot/scene/test/TestNewTileMap.tscn +++ b/DungeonShooting_Godot/scene/test/TestNewTileMap.tscn @@ -1,6 +1,7 @@ [gd_scene load_steps=3 format=3 uid="uid://dr72ij0rwlafo"] -[ext_resource type="TileSet" uid="uid://b00g22o1cqhe8" path="res://resource/map/tileset/TileSet1.tres" id="1_oisp3"] +[ext_resource type="TileSet" uid="uid://b00g22o1cqhe8" path="res://resource/map/tileSet/TileSet1.tres" id="1_oisp3"] + [sub_resource type="CircleShape2D" id="CircleShape2D_wsquq"] diff --git a/DungeonShooting_Godot/src/framework/generator/DungeonRoomGenerator.cs b/DungeonShooting_Godot/src/framework/generator/DungeonRoomGenerator.cs index 73409c4..55ec247 100644 --- a/DungeonShooting_Godot/src/framework/generator/DungeonRoomGenerator.cs +++ b/DungeonShooting_Godot/src/framework/generator/DungeonRoomGenerator.cs @@ -178,7 +178,7 @@ { var dungeonRoomTemplate = packedScene.Instantiate(); var usedRect = dungeonRoomTemplate.GetUsedRect(); - var dungeonTile = new DungeonTile(dungeonRoomTemplate); + var dungeonTile = new DungeonTileMap(dungeonRoomTemplate); dungeonTile.SetFloorAtlasCoords(new List() { new Vector2I(0, 8) }); //计算导航网格 dungeonTile.GenerateNavigationPolygon(0); @@ -200,7 +200,7 @@ var configPath = tileDataDir + path + ".json"; var split = new DungeonRoomSplit(); split.ScenePath = ToResPath(tileDir + path + ".tscn"); - split.ConfigPath = ToResPath(configPath); + split.RoomPath = ToResPath(configPath); if (!roomGroupMap.TryGetValue(item.Value.GroupName, out var group)) { diff --git a/DungeonShooting_Godot/src/framework/map/DoorAreaInfo.cs b/DungeonShooting_Godot/src/framework/map/DoorAreaInfo.cs deleted file mode 100644 index 8d2263c..0000000 --- a/DungeonShooting_Godot/src/framework/map/DoorAreaInfo.cs +++ /dev/null @@ -1,71 +0,0 @@ - -using System.Text.Json.Serialization; -using Godot; - -/// -/// 用于描述门生成区域 -/// -public class DoorAreaInfo -{ - /// - /// 门方向 - /// - [JsonInclude] - public DoorDirection Direction; - /// - /// 起始位置, 相对 tilemap 的横/纵轴原点, 单位: 像素 - /// - [JsonInclude] - public float Start = 0; - /// - /// 结束位置, 相对 tilemap 的横/纵轴原点, 单位: 像素 - /// - [JsonInclude] - public float End = 16; - - /// - /// 起始点坐标, 该坐标为模板场景的世界坐标, 单位: 像素, 不参与序列化与反序列化 - /// - public Vector2 StartPosition; - /// - /// 结束点坐标, 该坐标为模板场景的世界坐标, 单位: 像素, 不参与序列化与反序列化 - /// - public Vector2 EndPosition; - - public DoorAreaInfo() - { - } - - public DoorAreaInfo(DoorDirection direction, float start, float end) - { - Direction = direction; - Start = start; - End = end; - } - - /// - /// 自动计算 startPosition 和 endPosition - /// - public void CalcPosition(Vector2 rootPosition, Vector2 rootSize) - { - switch (Direction) - { - case DoorDirection.E: - StartPosition = new Vector2(rootPosition.X, rootPosition.Y + Start); - EndPosition = new Vector2(rootPosition.X, rootPosition.Y + End); - break; - case DoorDirection.W: - StartPosition = new Vector2(rootPosition.X + rootSize.X, rootPosition.Y + Start); - EndPosition = new Vector2(rootPosition.X + rootSize.X, rootPosition.Y + End); - break; - case DoorDirection.S: - StartPosition = new Vector2(rootPosition.X + Start, rootPosition.Y + rootSize.Y); - EndPosition = new Vector2(rootPosition.X + End, rootPosition.Y + rootSize.Y); - break; - case DoorDirection.N: - StartPosition = new Vector2(rootPosition.X + Start, rootPosition.Y); - EndPosition = new Vector2(rootPosition.X + End, rootPosition.Y); - break; - } - } -} \ No newline at end of file diff --git a/DungeonShooting_Godot/src/framework/map/DungeonRoomGroup.cs b/DungeonShooting_Godot/src/framework/map/DungeonRoomGroup.cs deleted file mode 100644 index 5d47401..0000000 --- a/DungeonShooting_Godot/src/framework/map/DungeonRoomGroup.cs +++ /dev/null @@ -1,133 +0,0 @@ - -using System; -using System.Collections.Generic; -using System.Text.Json.Serialization; -using Godot; - -/// -/// 房间组数据 -/// -public class DungeonRoomGroup -{ - /// - /// 组名称 - /// - [JsonInclude] - public string GroupName; - - /// - /// 普通战斗房间, 进入该房间时会关上门, 并刷出若干波敌人, 消灭所有敌人后开门 - /// - [JsonInclude] - public List BattleList = new List(); - - /// - /// 起始房间, 由上一层地牢的结束房间进入该房间, 每层包含一个起始房间 - /// - [JsonInclude] - public List InletList = new List(); - - /// - /// 结束房间, 进入另一层地牢, 每层只是包含一个结束房间 - /// - [JsonInclude] - public List OutletList = new List(); - - /// - /// boss战房间, 进入房间时会关上没, 刷出boss, 消灭boss后开门 - /// - [JsonInclude] - public List BossList = new List(); - - /// - /// 奖励房间, 给予玩家武器或者道具奖励的房间 - /// - [JsonInclude] - public List RewardList = new List(); - - /// - /// 商店, 玩家买卖道具装备的房间 - /// - [JsonInclude] - public List ShopList = new List(); - - /// - /// 事件房间, 触发剧情或者解锁NPC的房间 - /// - [JsonInclude] - public List EventList = new List(); - - private bool _init = false; - private Dictionary _weightRandomMap; - - /// - /// 获取指定类型房间集合 - /// - public List GetRoomList(DungeonRoomType roomType) - { - switch (roomType) - { - case DungeonRoomType.Battle: return BattleList; - case DungeonRoomType.Inlet: return InletList; - case DungeonRoomType.Outlet: return OutletList; - case DungeonRoomType.Boss: return BossList; - case DungeonRoomType.Reward: return RewardList; - case DungeonRoomType.Shop: return ShopList; - case DungeonRoomType.Event: return EventList; - } - - return null; - } - - /// - /// 初始化权重处理 - /// - public void InitWeight(SeedRandom random) - { - if (_init) - { - return; - } - - _init = true; - _weightRandomMap = new Dictionary(); - - foreach (var roomType in Enum.GetValues()) - { - InitAdRewardWeight(roomType, random); - } - } - - private void InitAdRewardWeight(DungeonRoomType roomType, SeedRandom random) - { - var dungeonRoomSplits = GetRoomList(roomType); - var weightRandom = new WeightRandom(random); - _weightRandomMap.Add(roomType, weightRandom); - - var list = new List(); - foreach (var roomSplit in dungeonRoomSplits) - { - list.Add(roomSplit.RoomInfo.Weight); - } - weightRandom.InitAdRewardWeight(list.ToArray()); - } - - /// - /// 根据房间类型和权重获取随机房间 - /// - public DungeonRoomSplit GetRandomRoom(DungeonRoomType roomType) - { - if (!_init) - { - GD.PrintErr("未调用DungeonRoomGroup.InitWeight()来初始化权重!"); - return null; - } - - if (_weightRandomMap.TryGetValue(roomType, out var weightRandom)) - { - return GetRoomList(roomType)[weightRandom.GetRandomIndex()]; - } - - return null; - } -} \ No newline at end of file diff --git a/DungeonShooting_Godot/src/framework/map/DungeonRoomInfo.cs b/DungeonShooting_Godot/src/framework/map/DungeonRoomInfo.cs deleted file mode 100644 index 72a8801..0000000 --- a/DungeonShooting_Godot/src/framework/map/DungeonRoomInfo.cs +++ /dev/null @@ -1,57 +0,0 @@ - -using System.Collections.Generic; -using System.Text.Json.Serialization; - -/// -/// 房间配置数据 -/// -public class DungeonRoomInfo -{ - /// - /// 房间位置, 在tile坐标系中的位置, 单位: 格 - /// - [JsonInclude] - public SerializeVector2 Position; - - /// - /// 房间大小, 在tile坐标系中占用的格子, 单位: 格 - /// - [JsonInclude] - public SerializeVector2 Size; - - /// - /// 房间连通门 - /// - [JsonInclude] - public List DoorAreaInfos; - - /// - /// 导航数据 - /// - [JsonInclude] - public List NavigationList; - - /// - /// 当前房间所属分组的名称 - /// - [JsonInclude] - public string GroupName = "unclaimed"; - - /// - /// 房间类型 - /// - [JsonInclude] - public DungeonRoomType RoomType = DungeonRoomType.Battle; - - /// - /// 房间文件名称 - /// - [JsonInclude] - public string FileName; - - /// - /// 房间权重, 值越大, 生成地牢是越容易出现该房间 - /// - [JsonInclude] - public int Weight = DungeonRoomTemplate.DefaultWeight; -} \ No newline at end of file diff --git a/DungeonShooting_Godot/src/framework/map/DungeonRoomSplit.cs b/DungeonShooting_Godot/src/framework/map/DungeonRoomSplit.cs deleted file mode 100644 index 32f00c7..0000000 --- a/DungeonShooting_Godot/src/framework/map/DungeonRoomSplit.cs +++ /dev/null @@ -1,54 +0,0 @@ - -using System.Text.Json; -using System.Text.Json.Serialization; -using FileAccess = Godot.FileAccess; - -/// -/// 房间配置文件相关信息, 将会在 RoomConfig.json 中汇总 -/// -public class DungeonRoomSplit -{ - /// - /// 房间场景路径 - /// - [JsonInclude] - public string ScenePath; - - /// - /// 房间配置路径 - /// - [JsonInclude] - public string ConfigPath; - - /// - /// 房间配置数据, 第一次获取会要在资源中加载数据 - /// - [JsonIgnore] - public DungeonRoomInfo RoomInfo - { - get - { - if (_roomInfo == null) - { - var file = FileAccess.Open(ConfigPath, FileAccess.ModeFlags.Read); - var asText = file.GetAsText(); - _roomInfo = JsonSerializer.Deserialize(asText); - file.Dispose(); - - //需要处理 DoorAreaInfos 长度为 0 的房间, 并为其配置默认值 - var areaInfos = _roomInfo.DoorAreaInfos; - if (areaInfos.Count == 0) - { - areaInfos.Add(new DoorAreaInfo(DoorDirection.N, GameConfig.TileCellSize, (_roomInfo.Size.X - 1) * GameConfig.TileCellSize)); - areaInfos.Add(new DoorAreaInfo(DoorDirection.S, GameConfig.TileCellSize, (_roomInfo.Size.X - 1) * GameConfig.TileCellSize)); - areaInfos.Add(new DoorAreaInfo(DoorDirection.W, GameConfig.TileCellSize, (_roomInfo.Size.Y - 1) * GameConfig.TileCellSize)); - areaInfos.Add(new DoorAreaInfo(DoorDirection.E, GameConfig.TileCellSize, (_roomInfo.Size.Y - 1) * GameConfig.TileCellSize)); - } - } - - return _roomInfo; - } - } - - private DungeonRoomInfo _roomInfo; -} \ No newline at end of file diff --git a/DungeonShooting_Godot/src/framework/map/DungeonRoomTemplate.cs b/DungeonShooting_Godot/src/framework/map/DungeonRoomTemplate.cs index 74a3748..ce62edd 100644 --- a/DungeonShooting_Godot/src/framework/map/DungeonRoomTemplate.cs +++ b/DungeonShooting_Godot/src/framework/map/DungeonRoomTemplate.cs @@ -69,7 +69,7 @@ //是否能是否按下 private bool _clickSave = false; - private DungeonTile _dungeonTile; + private DungeonTileMap _dungeonTileMap; private TileDrawHandler _tileDrawHandler; //计算导航的计时器 @@ -213,14 +213,14 @@ } //绘制导航, 现在有点问题, 绘制的内容会被自身的 tile 所挡住 - if (RoomTemplate._dungeonTile != null) + if (RoomTemplate._dungeonTileMap != null) { - var result = RoomTemplate._dungeonTile.GetGenerateNavigationResult(); + var result = RoomTemplate._dungeonTileMap.GetGenerateNavigationResult(); if (result != null) { if (result.Success) { - var polygonData = RoomTemplate._dungeonTile.GetPolygonData(); + var polygonData = RoomTemplate._dungeonTileMap.GetPolygonData(); Utils.DrawNavigationPolygon(this, polygonData, 2); } else @@ -260,10 +260,10 @@ return; } - if (_dungeonTile == null) + if (_dungeonTileMap == null) { - _dungeonTile = new DungeonTile(this); - _dungeonTile.SetFloorAtlasCoords(new List() { new Vector2I(0, 8) }); + _dungeonTileMap = new DungeonTileMap(this); + _dungeonTileMap.SetFloorAtlasCoords(new List() { new Vector2I(0, 8) }); OnTileChanged(); var callable = new Callable(this, nameof(OnTileChanged)); if (!IsConnected("changed", callable)) @@ -296,7 +296,7 @@ //重新计算导航 if (_calcTileNavTimer <= 0) { - _dungeonTile.GenerateNavigationPolygon(0); + _dungeonTileMap.GenerateNavigationPolygon(0); } } @@ -808,8 +808,8 @@ return; } //计算导航网格 - _dungeonTile.GenerateNavigationPolygon(0); - var polygonData = _dungeonTile.GetPolygonData(); + _dungeonTileMap.GenerateNavigationPolygon(0); + var polygonData = _dungeonTileMap.GetPolygonData(); var rect = GetUsedRect(); SaveConfig(_dungeonRoomInfo.DoorAreaInfos, rect.Position, rect.Size, polygonData.ToList(), _dungeonRoomInfo.GroupName, _dungeonRoomInfo.RoomType, Name, Weight); diff --git a/DungeonShooting_Godot/src/framework/map/DungeonTile.cs b/DungeonShooting_Godot/src/framework/map/DungeonTile.cs deleted file mode 100644 index 6065788..0000000 --- a/DungeonShooting_Godot/src/framework/map/DungeonTile.cs +++ /dev/null @@ -1,1265 +0,0 @@ - -using System.Collections.Generic; -using Godot; - -/// -/// 地牢地砖管理类, 提供一些操作 TileMap 和计算导航的接口 -/// -public class DungeonTile -{ - //--------------------- 导航 ------------------------- - - //已经标记过的点 - private readonly HashSet _usePoints = new HashSet(); - - //导航区域数据 - private readonly List _polygonDataList = new List(); - - //连接门的导航区域 - private readonly List _connectNavigationItemList = new List(); - - //---------------------------------------------------- - - private TileMap _tileRoot; - //地面地砖在 Atlas 的位置 - private List _floorAtlasCoords; - //生成导航的结果 - private GenerateNavigationResult _generateNavigationResult; - - public DungeonTile(TileMap tileRoot) - { - _tileRoot = tileRoot; - } - - /// - /// 根据 startRoom 和 config 数据自动填充 tileMap 参数中的地图数据 - /// - public void AutoFillRoomTile(AutoTileConfig config, RoomInfo startRoom, SeedRandom random) - { - _connectNavigationItemList.Clear(); - _AutoFillRoomTile(config, startRoom, random); - } - - private void _AutoFillRoomTile(AutoTileConfig config, RoomInfo roomInfo, SeedRandom random) - { - foreach (var info in roomInfo.Next) - { - _AutoFillRoomTile(config, info, random); - } - - //铺房间 - if (roomInfo.RoomSplit == null) - { - FillRect(GameConfig.FloorMapLayer, config.Floor, roomInfo.Position + Vector2.One, - roomInfo.Size - new Vector2(2, 2)); - - FillRect(GameConfig.TopMapLayer, config.IN_LT, roomInfo.Position, Vector2.One); - FillRect(GameConfig.TopMapLayer, config.L, roomInfo.Position + new Vector2(0, 1), - new Vector2(1, roomInfo.Size.Y - 2)); - FillRect(GameConfig.TopMapLayer, config.IN_LB, roomInfo.Position + new Vector2(0, roomInfo.Size.Y - 1), - new Vector2(1, 1)); - FillRect(GameConfig.TopMapLayer, config.B, roomInfo.Position + new Vector2(1, roomInfo.Size.Y - 1), - new Vector2(roomInfo.Size.X - 2, 1)); - FillRect(GameConfig.TopMapLayer, config.IN_RB, - roomInfo.Position + new Vector2(roomInfo.Size.X - 1, roomInfo.Size.Y - 1), - Vector2.One); - FillRect(GameConfig.TopMapLayer, config.R, roomInfo.Position + new Vector2(roomInfo.Size.X - 1, 1), - new Vector2(1, roomInfo.Size.Y - 2)); - FillRect(GameConfig.TopMapLayer, config.IN_RT, roomInfo.Position + new Vector2(roomInfo.Size.X - 1, 0), - Vector2.One); - FillRect(GameConfig.MiddleMapLayer, config.T, roomInfo.Position + Vector2.Right, - new Vector2(roomInfo.Size.X - 2, 1)); - } - else - { - var rectSize = roomInfo.RoomSplit.RoomInfo.Size; - var rectPos = roomInfo.RoomSplit.RoomInfo.Position; - var template = ResourceManager.Load(roomInfo.RoomSplit.ScenePath); - var tileInstance = template.Instantiate(); - var offset = roomInfo.GetOffsetPosition(); - - //其它物体 - var childCount = tileInstance.GetChildCount(); - for (var i = 0; i < childCount; i++) - { - var item = tileInstance.GetChild(i); - if (!(item is ActivityMark)) - { - item.GetParent().RemoveChild(item); - item.Owner = null; - _tileRoot.AddChild(item); - if (item is Node2D node) - { - node.Position = roomInfo.GetWorldPosition() + (node.GlobalPosition - offset); - } - - i--; - childCount--; - } - } - - //物体标记 - var activityMarks = tileInstance.GetMarks(); - foreach (var activityMark in activityMarks) - { - var pos = activityMark.Position; - activityMark.GetParent().RemoveChild(activityMark); - activityMark.Owner = null; - //_tileRoot.AddChild(activityMark); - activityMark.Position = roomInfo.GetWorldPosition() + (pos - offset); - activityMark.TileRoot = _tileRoot; - //执行预处理操作 - activityMark.Pretreatment(random); - } - roomInfo.ActivityMarks.AddRange(activityMarks); - - //填充tile操作 - for (int i = 0; i < rectSize.X; i++) - { - for (int j = 0; j < rectSize.Y; j++) - { - var coords = new Vector2I((int)(rectPos.X + i), (int)(rectPos.Y + j)); - var atlasCoords = tileInstance.GetCellAtlasCoords(0, coords); - if (atlasCoords.X != -1 && atlasCoords.Y != -1) - { - // 在 Godot 4.0 中使用以下这段代码区分层级, 会导致游戏关闭时有概率报错卡死, 目前尚不清楚原因 - //获取自定义层级 - // var customData = tileInstance.GetCellTileData(0, coords).GetCustomData(CustomTileLayerName); - // var layer = customData.AsInt32(); - // layer = Mathf.Clamp(layer, GameConfig.FloorMapLayer, GameConfig.TopMapLayer); - - var layer = config.GetLayer(atlasCoords); - _tileRoot.SetCell(layer, new Vector2I(roomInfo.Position.X + i, roomInfo.Position.Y + j), - 0, atlasCoords); - } - } - } - - tileInstance.CallDeferred(Node.MethodName.QueueFree); - } - - //铺过道 - foreach (var doorInfo in roomInfo.Doors) - { - if (doorInfo.ConnectRoom.Id > roomInfo.Id) - { - //普通的直线连接 - var doorDir1 = doorInfo.Direction; - var doorDir2 = doorInfo.ConnectDoor.Direction; - if (!doorInfo.HasCross) - { - var rect = Utils.CalcRect( - doorInfo.OriginPosition.X, - doorInfo.OriginPosition.Y, - doorInfo.ConnectDoor.OriginPosition.X, - doorInfo.ConnectDoor.OriginPosition.Y - ); - - switch (doorDir1) - { - case DoorDirection.E: - rect.Size = new Vector2(rect.Size.X, GameConfig.CorridorWidth); - FullHorizontalAisle(config, rect); - FullHorizontalAisleLeft(config, rect, doorInfo); - FullHorizontalAisleRight(config, rect, doorInfo.ConnectDoor); - break; - case DoorDirection.W: - rect.Size = new Vector2(rect.Size.X, GameConfig.CorridorWidth); - FullHorizontalAisle(config, rect); - FullHorizontalAisleLeft(config, rect, doorInfo.ConnectDoor); - FullHorizontalAisleRight(config, rect, doorInfo); - break; - - case DoorDirection.S: - rect.Size = new Vector2(GameConfig.CorridorWidth, rect.Size.Y); - FullVerticalAisle(config, rect); - FullVerticalAisleUp(config, rect, doorInfo); - FullVerticalAisleDown(config, rect, doorInfo.ConnectDoor); - break; - case DoorDirection.N: - rect.Size = new Vector2(GameConfig.CorridorWidth, rect.Size.Y); - FullVerticalAisle(config, rect); - FullVerticalAisleUp(config, rect, doorInfo.ConnectDoor); - FullVerticalAisleDown(config, rect, doorInfo); - break; - } - } - else //带交叉点 - { - //方向, 0横向, 1纵向 - var dir1 = 0; - var dir2 = 0; - - Rect2 rect; - Rect2 rect2; - - //计算范围 - switch (doorDir1) - { - case DoorDirection.E: //→ - rect = new Rect2( - doorInfo.OriginPosition.X, - doorInfo.OriginPosition.Y, - doorInfo.Cross.X - doorInfo.OriginPosition.X, - GameConfig.CorridorWidth - ); - break; - case DoorDirection.W: //← - rect = new Rect2( - doorInfo.Cross.X + GameConfig.CorridorWidth, - doorInfo.Cross.Y, - doorInfo.OriginPosition.X - (doorInfo.Cross.X + GameConfig.CorridorWidth), - GameConfig.CorridorWidth - ); - break; - case DoorDirection.S: //↓ - dir1 = 1; - rect = new Rect2( - doorInfo.OriginPosition.X, - doorInfo.OriginPosition.Y, - GameConfig.CorridorWidth, - doorInfo.Cross.Y - doorInfo.OriginPosition.Y - ); - break; - case DoorDirection.N: //↑ - dir1 = 1; - rect = new Rect2( - doorInfo.Cross.X, - doorInfo.Cross.Y + GameConfig.CorridorWidth, - GameConfig.CorridorWidth, - doorInfo.OriginPosition.Y - (doorInfo.Cross.Y + GameConfig.CorridorWidth) - ); - break; - default: - rect = new Rect2(); - break; - } - - switch (doorDir2) - { - case DoorDirection.E: //→ - rect2 = new Rect2( - doorInfo.ConnectDoor.OriginPosition.X, - doorInfo.ConnectDoor.OriginPosition.Y, - doorInfo.Cross.X - doorInfo.ConnectDoor.OriginPosition.X, - GameConfig.CorridorWidth - ); - break; - case DoorDirection.W: //← - rect2 = new Rect2( - doorInfo.Cross.X + GameConfig.CorridorWidth, - doorInfo.Cross.Y, - doorInfo.ConnectDoor.OriginPosition.X - - (doorInfo.Cross.X + GameConfig.CorridorWidth), - GameConfig.CorridorWidth - ); - break; - case DoorDirection.S: //↓ - dir2 = 1; - rect2 = new Rect2( - doorInfo.ConnectDoor.OriginPosition.X, - doorInfo.ConnectDoor.OriginPosition.Y, - GameConfig.CorridorWidth, - doorInfo.Cross.Y - doorInfo.ConnectDoor.OriginPosition.Y - ); - break; - case DoorDirection.N: //↑ - dir2 = 1; - rect2 = new Rect2( - doorInfo.Cross.X, - doorInfo.Cross.Y + GameConfig.CorridorWidth, - GameConfig.CorridorWidth, - doorInfo.ConnectDoor.OriginPosition.Y - - (doorInfo.Cross.Y + GameConfig.CorridorWidth) - ); - break; - default: - rect2 = new Rect2(); - break; - } - - FillRect(GameConfig.AisleFloorMapLayer, config.Floor, doorInfo.Cross + Vector2.One, - new Vector2(GameConfig.CorridorWidth - 2, GameConfig.CorridorWidth - 2)); - - //墙壁, 0横向, 1纵向 - if (dir1 == 0) - { - FullHorizontalAisle(config, rect); - FullHorizontalAisleLeft(config, rect, doorDir1 == DoorDirection.E ? doorInfo : null); - FullHorizontalAisleRight(config, rect, doorDir1 == DoorDirection.W ? doorInfo : null); - } - else - { - FullVerticalAisle(config, rect); - FullVerticalAisleUp(config, rect, doorDir1 == DoorDirection.S ? doorInfo : null); - FullVerticalAisleDown(config, rect, doorDir1 == DoorDirection.N ? doorInfo : null); - } - - if (dir2 == 0) - { - FullHorizontalAisle(config, rect2); - FullHorizontalAisleLeft(config, rect2, doorDir2 == DoorDirection.E ? doorInfo.ConnectDoor : null); - FullHorizontalAisleRight(config, rect2, doorDir2 == DoorDirection.W ? doorInfo.ConnectDoor : null); - } - else - { - FullVerticalAisle(config, rect2); - FullVerticalAisleUp(config, rect2, doorDir2 == DoorDirection.S ? doorInfo.ConnectDoor : null); - FullVerticalAisleDown(config, rect2, doorDir2 == DoorDirection.N ? doorInfo.ConnectDoor : null); - } - - if ((doorDir1 == DoorDirection.N && doorDir2 == DoorDirection.E) || //↑→ - (doorDir2 == DoorDirection.N && doorDir1 == DoorDirection.E)) - { - FillRect(GameConfig.TopMapLayer, config.OUT_RT, - doorInfo.Cross + new Vector2(0, GameConfig.CorridorWidth - 1), - Vector2.One); - FillRect(GameConfig.TopMapLayer, config.IN_RT, doorInfo.Cross + new Vector2(GameConfig.CorridorWidth - 1, 0), - Vector2.One); - FillRect(GameConfig.MiddleMapLayer, config.T, doorInfo.Cross, new Vector2(GameConfig.CorridorWidth - 1, 1)); - FillRect(GameConfig.TopMapLayer, config.R, doorInfo.Cross + new Vector2(GameConfig.CorridorWidth - 1, 1), - new Vector2(1, GameConfig.CorridorWidth - 1)); - } - else if ((doorDir1 == DoorDirection.E && doorDir2 == DoorDirection.S) || //→↓ - (doorDir2 == DoorDirection.E && doorDir1 == DoorDirection.S)) - { - FillRect(GameConfig.MiddleMapLayer, config.OUT_RB, doorInfo.Cross, Vector2.One); - FillRect(GameConfig.TopMapLayer, config.IN_RB, - doorInfo.Cross + new Vector2(GameConfig.CorridorWidth - 1, - GameConfig.CorridorWidth - 1), - Vector2.One); - FillRect(GameConfig.TopMapLayer, config.R, doorInfo.Cross + new Vector2(GameConfig.CorridorWidth - 1, 0), - new Vector2(1, GameConfig.CorridorWidth - 1)); - FillRect(GameConfig.TopMapLayer, config.B, doorInfo.Cross + new Vector2(0, GameConfig.CorridorWidth - 1), - new Vector2(GameConfig.CorridorWidth - 1, 1)); - } - else if ((doorDir1 == DoorDirection.S && doorDir2 == DoorDirection.W) || //↓← - (doorDir2 == DoorDirection.S && doorDir1 == DoorDirection.W)) - { - FillRect(GameConfig.MiddleMapLayer, config.OUT_LB, - doorInfo.Cross + new Vector2(GameConfig.CorridorWidth - 1, 0), Vector2.One); - FillRect(GameConfig.TopMapLayer, config.IN_LB, doorInfo.Cross + new Vector2(0, GameConfig.CorridorWidth - 1), - Vector2.One); - FillRect(GameConfig.TopMapLayer, config.L, doorInfo.Cross, new Vector2(1, GameConfig.CorridorWidth - 1)); - FillRect(GameConfig.TopMapLayer, config.B, doorInfo.Cross + new Vector2(1, GameConfig.CorridorWidth - 1), - new Vector2(GameConfig.CorridorWidth - 1, 1)); - } - else if ((doorDir1 == DoorDirection.W && doorDir2 == DoorDirection.N) || //←↑ - (doorDir2 == DoorDirection.W && doorDir1 == DoorDirection.N)) - { - FillRect(GameConfig.TopMapLayer, config.OUT_LT, - doorInfo.Cross + new Vector2(GameConfig.CorridorWidth - 1, - GameConfig.CorridorWidth - 1), - Vector2.One); - FillRect(GameConfig.TopMapLayer, config.IN_LT, doorInfo.Cross, Vector2.One); - FillRect(GameConfig.MiddleMapLayer, config.T, doorInfo.Cross + new Vector2(1, 0), - new Vector2(GameConfig.CorridorWidth - 1, 1)); - FillRect(GameConfig.TopMapLayer, config.L, doorInfo.Cross + new Vector2(0, 1), - new Vector2(1, GameConfig.CorridorWidth - 1)); - } - - //在房间墙上开洞 - switch (doorDir1) - { - case DoorDirection.E: //→ - ClearRect(GameConfig.TopMapLayer, doorInfo.OriginPosition + new Vector2(-1, 1), - new Vector2(1, rect.Size.Y - 2)); - break; - case DoorDirection.W: //← - ClearRect(GameConfig.TopMapLayer, doorInfo.OriginPosition + new Vector2(0, 1), - new Vector2(1, rect.Size.Y - 2)); - break; - case DoorDirection.S: //↓ - ClearRect(GameConfig.TopMapLayer, doorInfo.OriginPosition + new Vector2(1, -1), - new Vector2(rect.Size.X - 2, 1)); - break; - case DoorDirection.N: //↑ - ClearRect(GameConfig.MiddleMapLayer, doorInfo.OriginPosition + new Vector2(1, 2), - new Vector2(rect.Size.X - 2, 1)); - break; - } - - switch (doorDir2) - { - case DoorDirection.E: //→ - ClearRect(GameConfig.TopMapLayer, doorInfo.ConnectDoor.OriginPosition + new Vector2(-1, 1), - new Vector2(1, rect2.Size.Y - 2)); - break; - case DoorDirection.W: //← - ClearRect(GameConfig.TopMapLayer, doorInfo.ConnectDoor.OriginPosition + new Vector2(0, 1), - new Vector2(1, rect2.Size.Y - 2)); - break; - case DoorDirection.S: //↓ - ClearRect(GameConfig.TopMapLayer, doorInfo.ConnectDoor.OriginPosition + new Vector2(1, -1), - new Vector2(rect2.Size.X - 2, 1)); - break; - case DoorDirection.N: //↑ - ClearRect(GameConfig.MiddleMapLayer, doorInfo.ConnectDoor.OriginPosition + new Vector2(1, 0), - new Vector2(rect2.Size.X - 2, 1)); - break; - } - } - } - } - } - - //填充tile区域 - private void FillRect(int layer, TileCellInfo info, Vector2 pos, Vector2 size) - { - for (int i = 0; i < size.X; i++) - { - for (int j = 0; j < size.Y; j++) - { - _tileRoot.SetCell(layer, new Vector2I((int)pos.X + i, (int)pos.Y + j), 0, info.AutoTileCoord); - } - } - } - - //清除tile区域 - private void ClearRect(int layer, Vector2 pos, Vector2 size) - { - for (int i = 0; i < size.X; i++) - { - for (int j = 0; j < size.Y; j++) - { - _tileRoot.SetCell(layer, new Vector2I((int)pos.X + i, (int)pos.Y + j), 0); - } - } - } - - //横向过道 - private void FullHorizontalAisle(AutoTileConfig config, Rect2 rect) - { - FillRect(GameConfig.AisleFloorMapLayer, config.Floor, rect.Position + new Vector2(0, 1), rect.Size - new Vector2(0, 2)); - FillRect(GameConfig.MiddleMapLayer, config.T, rect.Position, new Vector2(rect.Size.X, 1)); - FillRect(GameConfig.TopMapLayer, config.B, rect.Position + new Vector2(0, rect.Size.Y - 1), new Vector2(rect.Size.X, 1)); - } - - //纵向过道 - private void FullVerticalAisle(AutoTileConfig config, Rect2 rect) - { - FillRect(GameConfig.AisleFloorMapLayer, config.Floor, rect.Position + new Vector2(1, 0), rect.Size - new Vector2(2, 0)); - FillRect(GameConfig.TopMapLayer, config.L, rect.Position, new Vector2(1, rect.Size.Y)); - FillRect(GameConfig.TopMapLayer, config.R, rect.Position + new Vector2(rect.Size.X - 1, 0), new Vector2(1, rect.Size.Y)); - } - - //横向过道, 门朝右, 连接方向向左 - private void FullHorizontalAisleLeft(AutoTileConfig config, Rect2 rect, RoomDoorInfo doorInfo = null) - { - //左 - ClearRect(GameConfig.TopMapLayer, rect.Position + new Vector2(-1, 1), new Vector2(1, rect.Size.Y - 2)); - if (doorInfo == null) - { - FillRect(GameConfig.AisleFloorMapLayer, config.Floor, rect.Position + new Vector2(-1, 1), - new Vector2(1, rect.Size.Y - 2)); - } - else - { - ClearRect(GameConfig.TopMapLayer, rect.Position + new Vector2(-1, 0), Vector2.One); - FillRect(GameConfig.MiddleMapLayer, config.OUT_LB, rect.Position + new Vector2(-1, 0), Vector2.One); - FillRect(GameConfig.TopMapLayer, config.OUT_LT, rect.Position + new Vector2(-1, 3), Vector2.One); - - FillRect(GameConfig.FloorMapLayer, config.Floor, rect.Position + new Vector2(-1, 1), new Vector2(1, rect.Size.Y - 2)); - //生成门的导航区域 - var x = rect.Position.X * GameConfig.TileCellSize; - var y = rect.Position.Y * GameConfig.TileCellSize; - - var op1 = new SerializeVector2(x - GameConfig.TileCellSize * 1.5f, y + GameConfig.TileCellSize * 1.5f); - var op2 = new SerializeVector2(x + GameConfig.TileCellSize * 0.5f, y + GameConfig.TileCellSize * 1.5f); - var op3 = new SerializeVector2(x + GameConfig.TileCellSize * 0.5f, y + GameConfig.TileCellSize * 3f); - var op4 = new SerializeVector2(x - GameConfig.TileCellSize * 1.5f, y + GameConfig.TileCellSize * 3f); - AddDoorNavigation( - doorInfo, op1, op2, op3, op4, - new SerializeVector2(op1), - new SerializeVector2(op1.X + GameConfig.TileCellSize, op2.Y), - new SerializeVector2(op1.X + GameConfig.TileCellSize, op3.Y), - new SerializeVector2(op4) - ); - } - } - - //横向过道, 门朝左, 连接方向向右 - private void FullHorizontalAisleRight(AutoTileConfig config, Rect2 rect, RoomDoorInfo doorInfo = null) - { - //右 - ClearRect(GameConfig.TopMapLayer, rect.Position + new Vector2(rect.Size.X, 1), new Vector2(1, rect.Size.Y - 2)); - if (doorInfo == null) - { - FillRect(GameConfig.AisleFloorMapLayer, config.Floor, rect.Position + new Vector2(rect.Size.X, 1), new Vector2(1, rect.Size.Y - 2)); - } - else - { - ClearRect(GameConfig.TopMapLayer, rect.Position + new Vector2(rect.Size.X, 0), Vector2.One); - FillRect(GameConfig.MiddleMapLayer, config.OUT_RB, rect.Position + new Vector2(rect.Size.X, 0), Vector2.One); - FillRect(GameConfig.TopMapLayer, config.OUT_RT, rect.Position + new Vector2(rect.Size.X, 3), Vector2.One); - - FillRect(GameConfig.FloorMapLayer, config.Floor, rect.Position + new Vector2(rect.Size.X, 1), new Vector2(1, rect.Size.Y - 2)); - //生成门的导航区域 - var x = rect.Position.X * GameConfig.TileCellSize; - var y = rect.Position.Y * GameConfig.TileCellSize; - - var op1 = new SerializeVector2(x - GameConfig.TileCellSize * 1.5f + (rect.Size.X + 1) * GameConfig.TileCellSize, y + GameConfig.TileCellSize * 1.5f); - var op2 = new SerializeVector2(x + GameConfig.TileCellSize * 0.5f + (rect.Size.X + 1) * GameConfig.TileCellSize, y + GameConfig.TileCellSize * 1.5f); - var op3 = new SerializeVector2(x + GameConfig.TileCellSize * 0.5f + (rect.Size.X + 1) * GameConfig.TileCellSize, y + GameConfig.TileCellSize * 3f); - var op4 = new SerializeVector2(x - GameConfig.TileCellSize * 1.5f + (rect.Size.X + 1) * GameConfig.TileCellSize, y + GameConfig.TileCellSize * 3f); - AddDoorNavigation( - doorInfo, op1, op2, op3, op4, - new SerializeVector2(op2.X - GameConfig.TileCellSize, op1.Y), - new SerializeVector2(op2), - new SerializeVector2(op3), - new SerializeVector2(op2.X - GameConfig.TileCellSize, op4.Y) - ); - } - } - - //纵向过道, 门朝下, 连接方向向上 - private void FullVerticalAisleUp(AutoTileConfig config, Rect2 rect, RoomDoorInfo doorInfo = null) - { - //上 - ClearRect(GameConfig.TopMapLayer, rect.Position + new Vector2(1, -1), new Vector2(rect.Size.X - 2, 1)); - if (doorInfo == null) - { - FillRect(GameConfig.AisleFloorMapLayer, config.Floor, rect.Position + new Vector2(1, -1), - new Vector2(rect.Size.X - 2, 1)); - } - else - { - FillRect(GameConfig.TopMapLayer, config.OUT_RT, rect.Position + new Vector2(0, -1), Vector2.One); - FillRect(GameConfig.TopMapLayer, config.OUT_LT, rect.Position + new Vector2(3, -1), Vector2.One); - - FillRect(GameConfig.FloorMapLayer, config.Floor, rect.Position + new Vector2(1, -1), new Vector2(rect.Size.X - 2, 1)); - //生成门的导航区域 - var x = rect.Position.X * GameConfig.TileCellSize; - var y = rect.Position.Y * GameConfig.TileCellSize; - - var op1 = new SerializeVector2(x + GameConfig.TileCellSize * 1.5f, y - GameConfig.TileCellSize * 1f); - var op2 = new SerializeVector2(x + GameConfig.TileCellSize * 2.5f, y - GameConfig.TileCellSize * 1f); - var op3 = new SerializeVector2(x + GameConfig.TileCellSize * 2.5f, y + GameConfig.TileCellSize * 0.5f); - var op4 = new SerializeVector2(x + GameConfig.TileCellSize * 1.5f, y + GameConfig.TileCellSize * 0.5f); - AddDoorNavigation( - doorInfo, op1, op2, op3, op4, - new SerializeVector2(op1), - new SerializeVector2(op2), - new SerializeVector2(op3.X, op1.Y + GameConfig.TileCellSize), - new SerializeVector2(op4.X, op1.Y + GameConfig.TileCellSize) - ); - } - } - - //纵向过道, 门朝上, 连接方向向下 - private void FullVerticalAisleDown(AutoTileConfig config, Rect2 rect, RoomDoorInfo doorInfo = null) - { - //下 - ClearRect(GameConfig.MiddleMapLayer, rect.Position + new Vector2(1, rect.Size.Y), new Vector2(rect.Size.X - 2, 1)); - if (doorInfo == null) - { - FillRect(GameConfig.AisleFloorMapLayer, config.Floor, rect.Position + new Vector2(1, rect.Size.Y), new Vector2(rect.Size.X - 2, 1)); - } - else - { - FillRect(GameConfig.MiddleMapLayer, config.OUT_RB, rect.Position + new Vector2(0, rect.Size.Y), Vector2.One); - FillRect(GameConfig.MiddleMapLayer, config.OUT_LB, rect.Position + new Vector2(3, rect.Size.Y), Vector2.One); - - FillRect(GameConfig.FloorMapLayer, config.Floor, rect.Position + new Vector2(1, rect.Size.Y), new Vector2(rect.Size.X - 2, 1)); - //生成门的导航区域 - var x = rect.Position.X * GameConfig.TileCellSize; - var y = rect.Position.Y * GameConfig.TileCellSize; - - var op1 = new SerializeVector2(x + GameConfig.TileCellSize * 1.5f, y - GameConfig.TileCellSize * 1f + (rect.Size.Y + 1) * GameConfig.TileCellSize); - var op2 = new SerializeVector2(x + GameConfig.TileCellSize * 2.5f, y - GameConfig.TileCellSize * 1f + (rect.Size.Y + 1) * GameConfig.TileCellSize); - var op3 = new SerializeVector2(x + GameConfig.TileCellSize * 2.5f, y + GameConfig.TileCellSize * 0.5f + (rect.Size.Y + 1) * GameConfig.TileCellSize); - var op4 = new SerializeVector2(x + GameConfig.TileCellSize * 1.5f, y + GameConfig.TileCellSize * 0.5f + (rect.Size.Y + 1) * GameConfig.TileCellSize); - AddDoorNavigation( - doorInfo, op1, op2, op3, op4, - new SerializeVector2(op1.X, op3.Y - GameConfig.TileCellSize), - new SerializeVector2(op2.X, op3.Y - GameConfig.TileCellSize), - new SerializeVector2(op3), - new SerializeVector2(op4) - ); - } - } - - /// - /// 添加房间 - /// - private void AddDoorNavigation(RoomDoorInfo doorInfo, - SerializeVector2 op1, SerializeVector2 op2, SerializeVector2 op3, SerializeVector2 op4, - SerializeVector2 cp1, SerializeVector2 cp2, SerializeVector2 cp3, SerializeVector2 cp4) - { - var openPolygonData = new NavigationPolygonData(); - openPolygonData.Type = NavigationPolygonType.Out; - openPolygonData.Points.Add(op1); - openPolygonData.Points.Add(op2); - openPolygonData.Points.Add(op3); - openPolygonData.Points.Add(op4); - - var closePolygonData = new NavigationPolygonData(); - closePolygonData.Type = NavigationPolygonType.Out; - closePolygonData.Points.Add(cp1); - closePolygonData.Points.Add(cp2); - closePolygonData.Points.Add(cp3); - closePolygonData.Points.Add(cp4); - - _connectNavigationItemList.Add(new DoorNavigationInfo(doorInfo, openPolygonData, closePolygonData)); - } - - //报错数据 - // private void TestData() - // { - // _polygonDataList.Clear(); - // _polygonDataList.Add(new NavigationPolygonData(){Type = NavigationPolygonType.Out, Points = new List(new []{ new SerializeVector2(-456, 712), new SerializeVector2(-440, 712), new SerializeVector2(-440, 792), new SerializeVector2(-456, 792) })}); - // _polygonDataList.Add(new NavigationPolygonData(){Type = NavigationPolygonType.In, Points = new List(new []{ new SerializeVector2(-1048, 744), new SerializeVector2(-840, 744), new SerializeVector2(-840, 840), new SerializeVector2(-1048, 840) })}); - // _polygonDataList.Add(new NavigationPolygonData(){Type = NavigationPolygonType.Out, Points = new List(new []{ new SerializeVector2(488, 920), new SerializeVector2(504, 920), new SerializeVector2(504, 1128), new SerializeVector2(488, 1128) })}); - // _polygonDataList.Add(new NavigationPolygonData(){Type = NavigationPolygonType.Out, Points = new List(new []{ new SerializeVector2(1320, 984), new SerializeVector2(1352, 984), new SerializeVector2(1352, 1096), new SerializeVector2(1432, 1096), new SerializeVector2(1432, 984), new SerializeVector2(1576, 984), new SerializeVector2(1576, 1128), new SerializeVector2(1544, 1128), new SerializeVector2(1544, 1000), new SerializeVector2(1464, 1000), new SerializeVector2(1464, 1128), new SerializeVector2(1320, 1128) })}); - // _polygonDataList.Add(new NavigationPolygonData(){Type = NavigationPolygonType.Out, Points = new List(new []{ new SerializeVector2(712, 1432), new SerializeVector2(984, 1432), new SerializeVector2(984, 1592), new SerializeVector2(712, 1592) })}); - // } - - /// - /// 计算并动生成导航区域, layer 为需要计算的层级,如果没有设置 floorAtlasCoords,则该 layer 下不为空的地砖都将视为可行走区域 - /// - public void GenerateNavigationPolygon(int layer) - { - _usePoints.Clear(); - _polygonDataList.Clear(); - - try - { - var size = new Vector2(_tileRoot.CellQuadrantSize, _tileRoot.CellQuadrantSize); - - var rect = _tileRoot.GetUsedRect(); - - var x = rect.Position.X; - var y = rect.Position.Y; - var w = rect.Size.X; - var h = rect.Size.Y; - - for (int j = y; j < h; j++) - { - for (int i = x; i < w; i++) - { - if (IsWayTile(layer, i, j)) - { - if (!_usePoints.Contains(new Vector2I(i, j))) - { - NavigationPolygonData polygonData = null; - - if (!IsWayTile(layer, i, j - 1)) - { - polygonData = CalcOutline(layer, i, j, size); - } - else if (!IsWayTile(layer, i, j + 1)) - { - polygonData = CalcInline(layer, i, j, size); - } - - if (polygonData != null) - { - _polygonDataList.Add(polygonData); - } - } - } - } - } - - _generateNavigationResult = new GenerateNavigationResult(true); - } - catch (NavigationPointInterleavingException e) - { - _usePoints.Clear(); - _polygonDataList.Clear(); - GD.Print(e.Message); - _generateNavigationResult = new GenerateNavigationResult(false, e); - } - } - - /// - /// 获取生成导航区域操作的结果, 如果没有调用过 GenerateNavigationPolygon() 函数, 则返回 null - /// - /// - public GenerateNavigationResult GetGenerateNavigationResult() - { - return _generateNavigationResult; - } - - /// - /// 将导航区域挂载到 navigationRoot 上 - /// - public void MountNavigationPolygon(Node2D navigationRoot) - { - //TestData(); - // 在 Godot4.0_rc6 中 如果将所有点都放在 NavigationPolygon 里面, 即使点是对的, 但调用 MakePolygonsFromOutlines 还是可能会报错, 这应该是个bug - - //通过 GenerateNavigationPolygon() 计算出来的导航区域 - for (var i = 0; i < _polygonDataList.Count; i++) - { - var polygonData = _polygonDataList[i]; - CreateNavigationRegion(navigationRoot, polygonData); - } - - //门占用区域的导航区域 - for (var i = 0; i < _connectNavigationItemList.Count; i++) - { - var item = _connectNavigationItemList[i]; - item.CloseNavigationNode = CreateNavigationRegion(navigationRoot, item.CloseNavigationData); - item.OpenNavigationNode = CreateNavigationRegion(navigationRoot, item.OpenNavigationData); - item.CloseNavigationNode.Enabled = false; - item.OpenNavigationNode.Enabled = false; - item.DoorInfo.Navigation = item; - } - } - - private NavigationRegion2D CreateNavigationRegion(Node2D navigationRoot, NavigationPolygonData polygonData) - { - var polygon = new NavigationPolygon(); - polygon.AddOutline(polygonData.ConvertPointsToVector2Array()); - polygon.MakePolygonsFromOutlines(); - var navigationPolygon = new NavigationRegion2D(); - navigationPolygon.Name = "NavigationRegion" + (navigationRoot.GetChildCount() + 1); - navigationPolygon.NavigationPolygon = polygon; - navigationRoot.AddChild(navigationPolygon); - return navigationPolygon; - } - - /// - /// 获取房间内的导航点数据 - /// - public NavigationPolygonData[] GetPolygonData() - { - return _polygonDataList.ToArray(); - } - - /// - /// 获取连接门导航数据, 必须要调用 AutoFillRoomTile() 函数才有数据 - /// - public NavigationPolygonData[] GetConnectDoorPolygonData() - { - var array = new NavigationPolygonData[_connectNavigationItemList.Count]; - for (var i = 0; i < _connectNavigationItemList.Count; i++) - { - array[i] = _connectNavigationItemList[i].OpenNavigationData; - } - return array; - } - - /// - /// 设置地面的地砖,将影响导航网格计算 - /// - public void SetFloorAtlasCoords(List floorAtlasCoords) - { - _floorAtlasCoords = floorAtlasCoords; - } - - /// - /// 返回指定位置的Tile是否为可以行走 - /// - private bool IsWayTile(int layer, int x, int y) - { - if (_floorAtlasCoords == null || _floorAtlasCoords.Count == 0) - { - return _tileRoot.GetCellTileData(layer, new Vector2I(x, y)) != null; - } - - var result = _tileRoot.GetCellAtlasCoords(layer, new Vector2I(x, y)); - return _floorAtlasCoords.Contains(result); - } - - //计算导航网格外轮廓 - private NavigationPolygonData CalcOutline(int layer, int i, int j, Vector2 size) - { - var polygonData = new NavigationPolygonData(); - polygonData.Type = NavigationPolygonType.Out; - var points = polygonData.Points; - // 0:右, 1:下, 2:左, 3:上 - var dir = 0; - var offset = new Vector2(size.X * 0.5f, size.Y * 0.5f); - //找到路, 向右开始找边界 - var startPos = new Vector2I(i, j); - - var tempI = i; - var tempJ = j; - - while (true) - { - switch (dir) - { - case 0: //右 - { - if (IsWayTile(layer, tempI, tempJ - 1)) //先向上找 - { - dir = 3; - - var pos = new Vector2I(tempI, tempJ); - if (points.Count > 1 && pos == startPos) - { - return polygonData; - } - - points.Add(new SerializeVector2(tempI * size.X + offset.X, tempJ * size.Y + offset.Y)); - PutUsePoint(pos); - - tempJ--; - break; - } - else if (IsWayTile(layer, tempI + 1, tempJ)) //再向右找 - { - if (points.Count == 0) - { - points.Add(new SerializeVector2(tempI * size.X + offset.X, tempJ * size.Y + offset.Y)); - } - - var pos = new Vector2I(tempI, tempJ); - if (points.Count > 1 && pos == startPos) - { - return polygonData; - } - - PutUsePoint(new Vector2I(tempI, tempJ)); - tempI++; - break; - } - else if (IsWayTile(layer, tempI, tempJ + 1)) //向下找 - { - dir = 1; - - var pos = new Vector2I(tempI, tempJ); - if (points.Count > 1 && pos == startPos) - { - return polygonData; - } - - points.Add(new SerializeVector2(tempI * size.X + offset.X, tempJ * size.Y + offset.Y)); - PutUsePoint(pos); - - tempJ++; - break; - } - - throw new NavigationPointInterleavingException(new Vector2I(tempI, tempJ), "生成导航多边形发生错误! 点: " + new Vector2I(tempI, tempJ) + "发生交错!"); - } - case 1: //下 - { - if (IsWayTile(layer, tempI + 1, tempJ)) //先向右找 - { - dir = 0; - - var pos = new Vector2I(tempI, tempJ); - if (points.Count > 1 && pos == startPos) - { - return polygonData; - } - - points.Add(new SerializeVector2(tempI * size.X + offset.X, tempJ * size.Y + offset.Y)); - PutUsePoint(pos); - - tempI++; - break; - } - else if (IsWayTile(layer, tempI, tempJ + 1)) //再向下找 - { - if (points.Count == 0) - { - points.Add(new SerializeVector2(tempI * size.X + offset.X, tempJ * size.Y + offset.Y)); - } - - var pos = new Vector2I(tempI, tempJ); - if (points.Count > 1 && pos == startPos) - { - return polygonData; - } - - PutUsePoint(new Vector2I(tempI, tempJ)); - tempJ++; - break; - } - else if (IsWayTile(layer, tempI - 1, tempJ)) //向左找 - { - dir = 2; - - var pos = new Vector2I(tempI, tempJ); - if (points.Count > 1 && pos == startPos) - { - return polygonData; - } - - //points.Add(new SerializeVector2(tempI * size.X + offset.X, tempJ * size.Y + offset.Y)); - points.Add(new SerializeVector2(tempI * size.X + offset.X, tempJ * size.Y + offset.Y * 2)); - PutUsePoint(pos); - - tempI--; - break; - } - - throw new NavigationPointInterleavingException(new Vector2I(tempI, tempJ), "生成导航多边形发生错误! 点: " + new Vector2I(tempI, tempJ) + "发生交错!"); - } - case 2: //左 - { - if (IsWayTile(layer, tempI, tempJ + 1)) //先向下找 - { - dir = 1; - - var pos = new Vector2I(tempI, tempJ); - if (points.Count > 1 && pos == startPos) - { - return polygonData; - } - - //points.Add(new SerializeVector2(tempI * size.X + offset.X, tempJ * size.Y + offset.Y)); - points.Add(new SerializeVector2(tempI * size.X + offset.X, tempJ * size.Y + offset.Y * 2)); - PutUsePoint(pos); - - tempJ++; - break; - } - else if (IsWayTile(layer, tempI - 1, tempJ)) //再向左找 - { - if (points.Count == 0) - { - //points.Add(new SerializeVector2(tempI * size.X + offset.X, tempJ * size.Y + offset.Y)); - points.Add(new SerializeVector2(tempI * size.X + offset.X, tempJ * size.Y + offset.Y * 2)); - } - - var pos = new Vector2I(tempI, tempJ); - if (points.Count > 1 && pos == startPos) - { - return polygonData; - } - - PutUsePoint(new Vector2I(tempI, tempJ)); - tempI--; - break; - } - else if (IsWayTile(layer, tempI, tempJ - 1)) //向上找 - { - dir = 3; - - var pos = new Vector2I(tempI, tempJ); - if (points.Count > 1 && pos == startPos) - { - return polygonData; - } - - //points.Add(new SerializeVector2(tempI * size.X + offset.X, tempJ * size.Y + offset.Y)); - points.Add(new SerializeVector2(tempI * size.X + offset.X, tempJ * size.Y + offset.Y * 2)); - PutUsePoint(pos); - - tempJ--; - break; - } - - throw new NavigationPointInterleavingException(new Vector2I(tempI, tempJ), "生成导航多边形发生错误! 点: " + new Vector2I(tempI, tempJ) + "发生交错!"); - } - case 3: //上 - { - if (IsWayTile(layer, tempI - 1, tempJ)) //先向左找 - { - dir = 2; - - var pos = new Vector2I(tempI, tempJ); - if (points.Count > 1 && pos == startPos) - { - return polygonData; - } - - //points.Add(new SerializeVector2(tempI * size.X + offset.X, tempJ * size.Y + offset.Y)); - points.Add(new SerializeVector2(tempI * size.X + offset.X, tempJ * size.Y + offset.Y * 2)); - PutUsePoint(pos); - - tempI--; - break; - } - else if (IsWayTile(layer, tempI, tempJ - 1)) //再向上找 - { - if (points.Count == 0) - { - points.Add(new SerializeVector2(tempI * size.X + offset.X, tempJ * size.Y + offset.Y)); - } - - var pos = new Vector2I(tempI, tempJ); - if (points.Count > 1 && pos == startPos) - { - return polygonData; - } - - PutUsePoint(new Vector2I(tempI, tempJ)); - tempJ--; - break; - } - else if (IsWayTile(layer, tempI + 1, tempJ)) //向右找 - { - dir = 0; - - var pos = new Vector2I(tempI, tempJ); - if (points.Count > 1 && pos == startPos) - { - return polygonData; - } - - points.Add(new SerializeVector2(tempI * size.X + offset.X, tempJ * size.Y + offset.Y)); - PutUsePoint(pos); - - tempI++; - break; - } - - throw new NavigationPointInterleavingException(new Vector2I(tempI, tempJ), "生成导航多边形发生错误! 点: " + new Vector2I(tempI, tempJ) + "发生交错!"); - } - } - } - } - - //计算导航网格内轮廓 - private NavigationPolygonData CalcInline(int layer, int i, int j, Vector2 size) - { - var polygonData = new NavigationPolygonData(); - polygonData.Type = NavigationPolygonType.In; - var points = polygonData.Points; - // 0:右, 1:下, 2:左, 3:上 - var dir = 0; - var offset = new Vector2(size.X * 0.5f, size.Y * 0.5f); - //找到路, 向右开始找边界 - var startPos = new Vector2I(i - 1, j); - PutUsePoint(startPos); - - var tempI = i; - var tempJ = j; - - while (true) - { - switch (dir) - { - case 0: //右 - { - if (IsWayTile(layer, tempI, tempJ + 1)) //向下找 - { - dir = 1; - - var pos = new Vector2I(tempI, tempJ); - if (points.Count > 1 && pos == startPos) - { - return polygonData; - } - - //points.Add(new SerializeVector2(tempI * size.X + offset.X, tempJ * size.Y + offset.Y)); - points.Add(new SerializeVector2(tempI * size.X + offset.X, tempJ * size.Y + offset.Y * 2)); - PutUsePoint(pos); - - tempJ++; - break; - } - else if (IsWayTile(layer, tempI + 1, tempJ)) //再向右找 - { - if (points.Count == 0) - { - //points.Add(new SerializeVector2((tempI - 1) * size.X + offset.X, tempJ * size.Y + offset.Y)); - points.Add(new SerializeVector2((tempI - 1) * size.X + offset.X, tempJ * size.Y + offset.Y * 2)); - } - - var pos = new Vector2I(tempI, tempJ); - if (points.Count > 1 && pos == startPos) - { - return polygonData; - } - - PutUsePoint(new Vector2I(tempI, tempJ)); - tempI++; - break; - } - else if (IsWayTile(layer, tempI, tempJ - 1)) //先向上找 - { - dir = 3; - - var pos = new Vector2I(tempI, tempJ); - if (points.Count > 1 && pos == startPos) - { - return polygonData; - } - - //points.Add(new SerializeVector2(tempI * size.X + offset.X, tempJ * size.Y + offset.Y)); - points.Add(new SerializeVector2(tempI * size.X + offset.X, tempJ * size.Y + offset.Y * 2)); - PutUsePoint(pos); - - tempJ--; - break; - } - - throw new NavigationPointInterleavingException(new Vector2I(tempI, tempJ), "生成导航多边形发生错误! 点: " + new Vector2I(tempI, tempJ) + "发生交错!"); - } - case 1: //下 - { - if (IsWayTile(layer, tempI - 1, tempJ)) //向左找 - { - dir = 2; - - var pos = new Vector2I(tempI, tempJ); - if (points.Count > 1 && pos == startPos) - { - return polygonData; - } - - points.Add(new SerializeVector2(tempI * size.X + offset.X, tempJ * size.Y + offset.Y)); - PutUsePoint(pos); - - tempI--; - break; - } - else if (IsWayTile(layer, tempI, tempJ + 1)) //再向下找 - { - if (points.Count == 0) - { - points.Add(new SerializeVector2((tempI - 1) * size.X + offset.X, tempJ * size.Y + offset.Y)); - } - - var pos = new Vector2I(tempI, tempJ); - if (points.Count > 1 && pos == startPos) - { - return polygonData; - } - - PutUsePoint(new Vector2I(tempI, tempJ)); - tempJ++; - break; - } - else if (IsWayTile(layer, tempI + 1, tempJ)) //先向右找 - { - dir = 0; - - var pos = new Vector2I(tempI, tempJ); - if (points.Count > 1 && pos == startPos) - { - return polygonData; - } - - //points.Add(new SerializeVector2(tempI * size.X + offset.X, tempJ * size.Y + offset.Y)); - points.Add(new SerializeVector2(tempI * size.X + offset.X, tempJ * size.Y + offset.Y * 2)); - PutUsePoint(pos); - - tempI++; - break; - } - - throw new NavigationPointInterleavingException(new Vector2I(tempI, tempJ), "生成导航多边形发生错误! 点: " + new Vector2I(tempI, tempJ) + "发生交错!"); - } - case 2: //左 - { - if (IsWayTile(layer, tempI, tempJ - 1)) //向上找 - { - dir = 3; - - var pos = new Vector2I(tempI, tempJ); - if (points.Count > 1 && pos == startPos) - { - return polygonData; - } - - points.Add(new SerializeVector2(tempI * size.X + offset.X, tempJ * size.Y + offset.Y)); - PutUsePoint(pos); - - tempJ--; - break; - } - else if (IsWayTile(layer, tempI - 1, tempJ)) //再向左找 - { - if (points.Count == 0) - { - points.Add(new SerializeVector2((tempI - 1) * size.X + offset.X, tempJ * size.Y + offset.Y)); - } - - var pos = new Vector2I(tempI, tempJ); - if (points.Count > 1 && pos == startPos) - { - return polygonData; - } - - PutUsePoint(new Vector2I(tempI, tempJ)); - tempI--; - break; - } - else if (IsWayTile(layer, tempI, tempJ + 1)) //先向下找 - { - dir = 1; - - var pos = new Vector2I(tempI, tempJ); - if (points.Count > 1 && pos == startPos) - { - return polygonData; - } - - points.Add(new SerializeVector2(tempI * size.X + offset.X, tempJ * size.Y + offset.Y)); - PutUsePoint(pos); - - tempJ++; - break; - } - - throw new NavigationPointInterleavingException(new Vector2I(tempI, tempJ), "生成导航多边形发生错误! 点: " + new Vector2I(tempI, tempJ) + "发生交错!"); - } - case 3: //上 - { - if (IsWayTile(layer, tempI + 1, tempJ)) //向右找 - { - dir = 0; - - var pos = new Vector2I(tempI, tempJ); - if (points.Count > 1 && pos == startPos) - { - return polygonData; - } - - //points.Add(new SerializeVector2(tempI * size.X + offset.X, tempJ * size.Y + offset.Y)); - points.Add(new SerializeVector2(tempI * size.X + offset.X, tempJ * size.Y + offset.Y * 2)); - PutUsePoint(pos); - - tempI++; - break; - } - else if (IsWayTile(layer, tempI, tempJ - 1)) //再向上找 - { - if (points.Count == 0) - { - points.Add(new SerializeVector2((tempI - 1) * size.X + offset.X, tempJ * size.Y + offset.Y)); - } - - var pos = new Vector2I(tempI, tempJ); - if (points.Count > 1 && pos == startPos) - { - return polygonData; - } - - PutUsePoint(new Vector2I(tempI, tempJ)); - tempJ--; - break; - } - else if (IsWayTile(layer, tempI - 1, tempJ)) //先向左找 - { - dir = 2; - - var pos = new Vector2I(tempI, tempJ); - if (points.Count > 1 && pos == startPos) - { - return polygonData; - } - - points.Add(new SerializeVector2(tempI * size.X + offset.X, tempJ * size.Y + offset.Y)); - PutUsePoint(pos); - - tempI--; - break; - } - - throw new NavigationPointInterleavingException(new Vector2I(tempI, tempJ), "生成导航多边形发生错误! 点: " + new Vector2I(tempI, tempJ) + "发生交错!"); - } - } - } - } - - //记录导航网格中已经使用过的坐标 - private void PutUsePoint(Vector2I pos) - { - if (_usePoints.Contains(pos)) - { - throw new NavigationPointInterleavingException(pos, "生成导航多边形发生错误! 点: " + pos + "发生交错!"); - } - - _usePoints.Add(pos); - } -} \ No newline at end of file diff --git a/DungeonShooting_Godot/src/framework/map/DungeonTileMap.cs b/DungeonShooting_Godot/src/framework/map/DungeonTileMap.cs new file mode 100644 index 0000000..776ac19 --- /dev/null +++ b/DungeonShooting_Godot/src/framework/map/DungeonTileMap.cs @@ -0,0 +1,1265 @@ + +using System.Collections.Generic; +using Godot; + +/// +/// 地牢地砖管理类, 提供一些操作 TileMap 和计算导航的接口 +/// +public class DungeonTileMap +{ + //--------------------- 导航 ------------------------- + + //已经标记过的点 + private readonly HashSet _usePoints = new HashSet(); + + //导航区域数据 + private readonly List _polygonDataList = new List(); + + //连接门的导航区域 + private readonly List _connectNavigationItemList = new List(); + + //---------------------------------------------------- + + private TileMap _tileRoot; + //地面地砖在 Atlas 的位置 + private List _floorAtlasCoords; + //生成导航的结果 + private GenerateNavigationResult _generateNavigationResult; + + public DungeonTileMap(TileMap tileRoot) + { + _tileRoot = tileRoot; + } + + /// + /// 根据 startRoom 和 config 数据自动填充 tileMap 参数中的地图数据 + /// + public void AutoFillRoomTile(AutoTileConfig config, RoomInfo startRoom, SeedRandom random) + { + _connectNavigationItemList.Clear(); + _AutoFillRoomTile(config, startRoom, random); + } + + private void _AutoFillRoomTile(AutoTileConfig config, RoomInfo roomInfo, SeedRandom random) + { + foreach (var info in roomInfo.Next) + { + _AutoFillRoomTile(config, info, random); + } + + //铺房间 + if (roomInfo.RoomSplit == null) + { + FillRect(GameConfig.FloorMapLayer, config.Floor, roomInfo.Position + Vector2.One, + roomInfo.Size - new Vector2(2, 2)); + + FillRect(GameConfig.TopMapLayer, config.IN_LT, roomInfo.Position, Vector2.One); + FillRect(GameConfig.TopMapLayer, config.L, roomInfo.Position + new Vector2(0, 1), + new Vector2(1, roomInfo.Size.Y - 2)); + FillRect(GameConfig.TopMapLayer, config.IN_LB, roomInfo.Position + new Vector2(0, roomInfo.Size.Y - 1), + new Vector2(1, 1)); + FillRect(GameConfig.TopMapLayer, config.B, roomInfo.Position + new Vector2(1, roomInfo.Size.Y - 1), + new Vector2(roomInfo.Size.X - 2, 1)); + FillRect(GameConfig.TopMapLayer, config.IN_RB, + roomInfo.Position + new Vector2(roomInfo.Size.X - 1, roomInfo.Size.Y - 1), + Vector2.One); + FillRect(GameConfig.TopMapLayer, config.R, roomInfo.Position + new Vector2(roomInfo.Size.X - 1, 1), + new Vector2(1, roomInfo.Size.Y - 2)); + FillRect(GameConfig.TopMapLayer, config.IN_RT, roomInfo.Position + new Vector2(roomInfo.Size.X - 1, 0), + Vector2.One); + FillRect(GameConfig.MiddleMapLayer, config.T, roomInfo.Position + Vector2.Right, + new Vector2(roomInfo.Size.X - 2, 1)); + } + else + { + var rectSize = roomInfo.RoomSplit.RoomInfo.Size; + var rectPos = roomInfo.RoomSplit.RoomInfo.Position; + var template = ResourceManager.Load(roomInfo.RoomSplit.ScenePath); + var tileInstance = template.Instantiate(); + var offset = roomInfo.GetOffsetPosition(); + + //其它物体 + var childCount = tileInstance.GetChildCount(); + for (var i = 0; i < childCount; i++) + { + var item = tileInstance.GetChild(i); + if (!(item is ActivityMark)) + { + item.GetParent().RemoveChild(item); + item.Owner = null; + _tileRoot.AddChild(item); + if (item is Node2D node) + { + node.Position = roomInfo.GetWorldPosition() + (node.GlobalPosition - offset); + } + + i--; + childCount--; + } + } + + //物体标记 + var activityMarks = tileInstance.GetMarks(); + foreach (var activityMark in activityMarks) + { + var pos = activityMark.Position; + activityMark.GetParent().RemoveChild(activityMark); + activityMark.Owner = null; + //_tileRoot.AddChild(activityMark); + activityMark.Position = roomInfo.GetWorldPosition() + (pos - offset); + activityMark.TileRoot = _tileRoot; + //执行预处理操作 + activityMark.Pretreatment(random); + } + roomInfo.ActivityMarks.AddRange(activityMarks); + + //填充tile操作 + for (int i = 0; i < rectSize.X; i++) + { + for (int j = 0; j < rectSize.Y; j++) + { + var coords = new Vector2I((int)(rectPos.X + i), (int)(rectPos.Y + j)); + var atlasCoords = tileInstance.GetCellAtlasCoords(0, coords); + if (atlasCoords.X != -1 && atlasCoords.Y != -1) + { + // 在 Godot 4.0 中使用以下这段代码区分层级, 会导致游戏关闭时有概率报错卡死, 目前尚不清楚原因 + //获取自定义层级 + // var customData = tileInstance.GetCellTileData(0, coords).GetCustomData(CustomTileLayerName); + // var layer = customData.AsInt32(); + // layer = Mathf.Clamp(layer, GameConfig.FloorMapLayer, GameConfig.TopMapLayer); + + var layer = config.GetLayer(atlasCoords); + _tileRoot.SetCell(layer, new Vector2I(roomInfo.Position.X + i, roomInfo.Position.Y + j), + 0, atlasCoords); + } + } + } + + tileInstance.CallDeferred(Node.MethodName.QueueFree); + } + + //铺过道 + foreach (var doorInfo in roomInfo.Doors) + { + if (doorInfo.ConnectRoom.Id > roomInfo.Id) + { + //普通的直线连接 + var doorDir1 = doorInfo.Direction; + var doorDir2 = doorInfo.ConnectDoor.Direction; + if (!doorInfo.HasCross) + { + var rect = Utils.CalcRect( + doorInfo.OriginPosition.X, + doorInfo.OriginPosition.Y, + doorInfo.ConnectDoor.OriginPosition.X, + doorInfo.ConnectDoor.OriginPosition.Y + ); + + switch (doorDir1) + { + case DoorDirection.E: + rect.Size = new Vector2(rect.Size.X, GameConfig.CorridorWidth); + FullHorizontalAisle(config, rect); + FullHorizontalAisleLeft(config, rect, doorInfo); + FullHorizontalAisleRight(config, rect, doorInfo.ConnectDoor); + break; + case DoorDirection.W: + rect.Size = new Vector2(rect.Size.X, GameConfig.CorridorWidth); + FullHorizontalAisle(config, rect); + FullHorizontalAisleLeft(config, rect, doorInfo.ConnectDoor); + FullHorizontalAisleRight(config, rect, doorInfo); + break; + + case DoorDirection.S: + rect.Size = new Vector2(GameConfig.CorridorWidth, rect.Size.Y); + FullVerticalAisle(config, rect); + FullVerticalAisleUp(config, rect, doorInfo); + FullVerticalAisleDown(config, rect, doorInfo.ConnectDoor); + break; + case DoorDirection.N: + rect.Size = new Vector2(GameConfig.CorridorWidth, rect.Size.Y); + FullVerticalAisle(config, rect); + FullVerticalAisleUp(config, rect, doorInfo.ConnectDoor); + FullVerticalAisleDown(config, rect, doorInfo); + break; + } + } + else //带交叉点 + { + //方向, 0横向, 1纵向 + var dir1 = 0; + var dir2 = 0; + + Rect2 rect; + Rect2 rect2; + + //计算范围 + switch (doorDir1) + { + case DoorDirection.E: //→ + rect = new Rect2( + doorInfo.OriginPosition.X, + doorInfo.OriginPosition.Y, + doorInfo.Cross.X - doorInfo.OriginPosition.X, + GameConfig.CorridorWidth + ); + break; + case DoorDirection.W: //← + rect = new Rect2( + doorInfo.Cross.X + GameConfig.CorridorWidth, + doorInfo.Cross.Y, + doorInfo.OriginPosition.X - (doorInfo.Cross.X + GameConfig.CorridorWidth), + GameConfig.CorridorWidth + ); + break; + case DoorDirection.S: //↓ + dir1 = 1; + rect = new Rect2( + doorInfo.OriginPosition.X, + doorInfo.OriginPosition.Y, + GameConfig.CorridorWidth, + doorInfo.Cross.Y - doorInfo.OriginPosition.Y + ); + break; + case DoorDirection.N: //↑ + dir1 = 1; + rect = new Rect2( + doorInfo.Cross.X, + doorInfo.Cross.Y + GameConfig.CorridorWidth, + GameConfig.CorridorWidth, + doorInfo.OriginPosition.Y - (doorInfo.Cross.Y + GameConfig.CorridorWidth) + ); + break; + default: + rect = new Rect2(); + break; + } + + switch (doorDir2) + { + case DoorDirection.E: //→ + rect2 = new Rect2( + doorInfo.ConnectDoor.OriginPosition.X, + doorInfo.ConnectDoor.OriginPosition.Y, + doorInfo.Cross.X - doorInfo.ConnectDoor.OriginPosition.X, + GameConfig.CorridorWidth + ); + break; + case DoorDirection.W: //← + rect2 = new Rect2( + doorInfo.Cross.X + GameConfig.CorridorWidth, + doorInfo.Cross.Y, + doorInfo.ConnectDoor.OriginPosition.X - + (doorInfo.Cross.X + GameConfig.CorridorWidth), + GameConfig.CorridorWidth + ); + break; + case DoorDirection.S: //↓ + dir2 = 1; + rect2 = new Rect2( + doorInfo.ConnectDoor.OriginPosition.X, + doorInfo.ConnectDoor.OriginPosition.Y, + GameConfig.CorridorWidth, + doorInfo.Cross.Y - doorInfo.ConnectDoor.OriginPosition.Y + ); + break; + case DoorDirection.N: //↑ + dir2 = 1; + rect2 = new Rect2( + doorInfo.Cross.X, + doorInfo.Cross.Y + GameConfig.CorridorWidth, + GameConfig.CorridorWidth, + doorInfo.ConnectDoor.OriginPosition.Y - + (doorInfo.Cross.Y + GameConfig.CorridorWidth) + ); + break; + default: + rect2 = new Rect2(); + break; + } + + FillRect(GameConfig.AisleFloorMapLayer, config.Floor, doorInfo.Cross + Vector2.One, + new Vector2(GameConfig.CorridorWidth - 2, GameConfig.CorridorWidth - 2)); + + //墙壁, 0横向, 1纵向 + if (dir1 == 0) + { + FullHorizontalAisle(config, rect); + FullHorizontalAisleLeft(config, rect, doorDir1 == DoorDirection.E ? doorInfo : null); + FullHorizontalAisleRight(config, rect, doorDir1 == DoorDirection.W ? doorInfo : null); + } + else + { + FullVerticalAisle(config, rect); + FullVerticalAisleUp(config, rect, doorDir1 == DoorDirection.S ? doorInfo : null); + FullVerticalAisleDown(config, rect, doorDir1 == DoorDirection.N ? doorInfo : null); + } + + if (dir2 == 0) + { + FullHorizontalAisle(config, rect2); + FullHorizontalAisleLeft(config, rect2, doorDir2 == DoorDirection.E ? doorInfo.ConnectDoor : null); + FullHorizontalAisleRight(config, rect2, doorDir2 == DoorDirection.W ? doorInfo.ConnectDoor : null); + } + else + { + FullVerticalAisle(config, rect2); + FullVerticalAisleUp(config, rect2, doorDir2 == DoorDirection.S ? doorInfo.ConnectDoor : null); + FullVerticalAisleDown(config, rect2, doorDir2 == DoorDirection.N ? doorInfo.ConnectDoor : null); + } + + if ((doorDir1 == DoorDirection.N && doorDir2 == DoorDirection.E) || //↑→ + (doorDir2 == DoorDirection.N && doorDir1 == DoorDirection.E)) + { + FillRect(GameConfig.TopMapLayer, config.OUT_RT, + doorInfo.Cross + new Vector2(0, GameConfig.CorridorWidth - 1), + Vector2.One); + FillRect(GameConfig.TopMapLayer, config.IN_RT, doorInfo.Cross + new Vector2(GameConfig.CorridorWidth - 1, 0), + Vector2.One); + FillRect(GameConfig.MiddleMapLayer, config.T, doorInfo.Cross, new Vector2(GameConfig.CorridorWidth - 1, 1)); + FillRect(GameConfig.TopMapLayer, config.R, doorInfo.Cross + new Vector2(GameConfig.CorridorWidth - 1, 1), + new Vector2(1, GameConfig.CorridorWidth - 1)); + } + else if ((doorDir1 == DoorDirection.E && doorDir2 == DoorDirection.S) || //→↓ + (doorDir2 == DoorDirection.E && doorDir1 == DoorDirection.S)) + { + FillRect(GameConfig.MiddleMapLayer, config.OUT_RB, doorInfo.Cross, Vector2.One); + FillRect(GameConfig.TopMapLayer, config.IN_RB, + doorInfo.Cross + new Vector2(GameConfig.CorridorWidth - 1, + GameConfig.CorridorWidth - 1), + Vector2.One); + FillRect(GameConfig.TopMapLayer, config.R, doorInfo.Cross + new Vector2(GameConfig.CorridorWidth - 1, 0), + new Vector2(1, GameConfig.CorridorWidth - 1)); + FillRect(GameConfig.TopMapLayer, config.B, doorInfo.Cross + new Vector2(0, GameConfig.CorridorWidth - 1), + new Vector2(GameConfig.CorridorWidth - 1, 1)); + } + else if ((doorDir1 == DoorDirection.S && doorDir2 == DoorDirection.W) || //↓← + (doorDir2 == DoorDirection.S && doorDir1 == DoorDirection.W)) + { + FillRect(GameConfig.MiddleMapLayer, config.OUT_LB, + doorInfo.Cross + new Vector2(GameConfig.CorridorWidth - 1, 0), Vector2.One); + FillRect(GameConfig.TopMapLayer, config.IN_LB, doorInfo.Cross + new Vector2(0, GameConfig.CorridorWidth - 1), + Vector2.One); + FillRect(GameConfig.TopMapLayer, config.L, doorInfo.Cross, new Vector2(1, GameConfig.CorridorWidth - 1)); + FillRect(GameConfig.TopMapLayer, config.B, doorInfo.Cross + new Vector2(1, GameConfig.CorridorWidth - 1), + new Vector2(GameConfig.CorridorWidth - 1, 1)); + } + else if ((doorDir1 == DoorDirection.W && doorDir2 == DoorDirection.N) || //←↑ + (doorDir2 == DoorDirection.W && doorDir1 == DoorDirection.N)) + { + FillRect(GameConfig.TopMapLayer, config.OUT_LT, + doorInfo.Cross + new Vector2(GameConfig.CorridorWidth - 1, + GameConfig.CorridorWidth - 1), + Vector2.One); + FillRect(GameConfig.TopMapLayer, config.IN_LT, doorInfo.Cross, Vector2.One); + FillRect(GameConfig.MiddleMapLayer, config.T, doorInfo.Cross + new Vector2(1, 0), + new Vector2(GameConfig.CorridorWidth - 1, 1)); + FillRect(GameConfig.TopMapLayer, config.L, doorInfo.Cross + new Vector2(0, 1), + new Vector2(1, GameConfig.CorridorWidth - 1)); + } + + //在房间墙上开洞 + switch (doorDir1) + { + case DoorDirection.E: //→ + ClearRect(GameConfig.TopMapLayer, doorInfo.OriginPosition + new Vector2(-1, 1), + new Vector2(1, rect.Size.Y - 2)); + break; + case DoorDirection.W: //← + ClearRect(GameConfig.TopMapLayer, doorInfo.OriginPosition + new Vector2(0, 1), + new Vector2(1, rect.Size.Y - 2)); + break; + case DoorDirection.S: //↓ + ClearRect(GameConfig.TopMapLayer, doorInfo.OriginPosition + new Vector2(1, -1), + new Vector2(rect.Size.X - 2, 1)); + break; + case DoorDirection.N: //↑ + ClearRect(GameConfig.MiddleMapLayer, doorInfo.OriginPosition + new Vector2(1, 2), + new Vector2(rect.Size.X - 2, 1)); + break; + } + + switch (doorDir2) + { + case DoorDirection.E: //→ + ClearRect(GameConfig.TopMapLayer, doorInfo.ConnectDoor.OriginPosition + new Vector2(-1, 1), + new Vector2(1, rect2.Size.Y - 2)); + break; + case DoorDirection.W: //← + ClearRect(GameConfig.TopMapLayer, doorInfo.ConnectDoor.OriginPosition + new Vector2(0, 1), + new Vector2(1, rect2.Size.Y - 2)); + break; + case DoorDirection.S: //↓ + ClearRect(GameConfig.TopMapLayer, doorInfo.ConnectDoor.OriginPosition + new Vector2(1, -1), + new Vector2(rect2.Size.X - 2, 1)); + break; + case DoorDirection.N: //↑ + ClearRect(GameConfig.MiddleMapLayer, doorInfo.ConnectDoor.OriginPosition + new Vector2(1, 0), + new Vector2(rect2.Size.X - 2, 1)); + break; + } + } + } + } + } + + //填充tile区域 + private void FillRect(int layer, TileCellInfo info, Vector2 pos, Vector2 size) + { + for (int i = 0; i < size.X; i++) + { + for (int j = 0; j < size.Y; j++) + { + _tileRoot.SetCell(layer, new Vector2I((int)pos.X + i, (int)pos.Y + j), 0, info.AutoTileCoord); + } + } + } + + //清除tile区域 + private void ClearRect(int layer, Vector2 pos, Vector2 size) + { + for (int i = 0; i < size.X; i++) + { + for (int j = 0; j < size.Y; j++) + { + _tileRoot.SetCell(layer, new Vector2I((int)pos.X + i, (int)pos.Y + j), 0); + } + } + } + + //横向过道 + private void FullHorizontalAisle(AutoTileConfig config, Rect2 rect) + { + FillRect(GameConfig.AisleFloorMapLayer, config.Floor, rect.Position + new Vector2(0, 1), rect.Size - new Vector2(0, 2)); + FillRect(GameConfig.MiddleMapLayer, config.T, rect.Position, new Vector2(rect.Size.X, 1)); + FillRect(GameConfig.TopMapLayer, config.B, rect.Position + new Vector2(0, rect.Size.Y - 1), new Vector2(rect.Size.X, 1)); + } + + //纵向过道 + private void FullVerticalAisle(AutoTileConfig config, Rect2 rect) + { + FillRect(GameConfig.AisleFloorMapLayer, config.Floor, rect.Position + new Vector2(1, 0), rect.Size - new Vector2(2, 0)); + FillRect(GameConfig.TopMapLayer, config.L, rect.Position, new Vector2(1, rect.Size.Y)); + FillRect(GameConfig.TopMapLayer, config.R, rect.Position + new Vector2(rect.Size.X - 1, 0), new Vector2(1, rect.Size.Y)); + } + + //横向过道, 门朝右, 连接方向向左 + private void FullHorizontalAisleLeft(AutoTileConfig config, Rect2 rect, RoomDoorInfo doorInfo = null) + { + //左 + ClearRect(GameConfig.TopMapLayer, rect.Position + new Vector2(-1, 1), new Vector2(1, rect.Size.Y - 2)); + if (doorInfo == null) + { + FillRect(GameConfig.AisleFloorMapLayer, config.Floor, rect.Position + new Vector2(-1, 1), + new Vector2(1, rect.Size.Y - 2)); + } + else + { + ClearRect(GameConfig.TopMapLayer, rect.Position + new Vector2(-1, 0), Vector2.One); + FillRect(GameConfig.MiddleMapLayer, config.OUT_LB, rect.Position + new Vector2(-1, 0), Vector2.One); + FillRect(GameConfig.TopMapLayer, config.OUT_LT, rect.Position + new Vector2(-1, 3), Vector2.One); + + FillRect(GameConfig.FloorMapLayer, config.Floor, rect.Position + new Vector2(-1, 1), new Vector2(1, rect.Size.Y - 2)); + //生成门的导航区域 + var x = rect.Position.X * GameConfig.TileCellSize; + var y = rect.Position.Y * GameConfig.TileCellSize; + + var op1 = new SerializeVector2(x - GameConfig.TileCellSize * 1.5f, y + GameConfig.TileCellSize * 1.5f); + var op2 = new SerializeVector2(x + GameConfig.TileCellSize * 0.5f, y + GameConfig.TileCellSize * 1.5f); + var op3 = new SerializeVector2(x + GameConfig.TileCellSize * 0.5f, y + GameConfig.TileCellSize * 3f); + var op4 = new SerializeVector2(x - GameConfig.TileCellSize * 1.5f, y + GameConfig.TileCellSize * 3f); + AddDoorNavigation( + doorInfo, op1, op2, op3, op4, + new SerializeVector2(op1), + new SerializeVector2(op1.X + GameConfig.TileCellSize, op2.Y), + new SerializeVector2(op1.X + GameConfig.TileCellSize, op3.Y), + new SerializeVector2(op4) + ); + } + } + + //横向过道, 门朝左, 连接方向向右 + private void FullHorizontalAisleRight(AutoTileConfig config, Rect2 rect, RoomDoorInfo doorInfo = null) + { + //右 + ClearRect(GameConfig.TopMapLayer, rect.Position + new Vector2(rect.Size.X, 1), new Vector2(1, rect.Size.Y - 2)); + if (doorInfo == null) + { + FillRect(GameConfig.AisleFloorMapLayer, config.Floor, rect.Position + new Vector2(rect.Size.X, 1), new Vector2(1, rect.Size.Y - 2)); + } + else + { + ClearRect(GameConfig.TopMapLayer, rect.Position + new Vector2(rect.Size.X, 0), Vector2.One); + FillRect(GameConfig.MiddleMapLayer, config.OUT_RB, rect.Position + new Vector2(rect.Size.X, 0), Vector2.One); + FillRect(GameConfig.TopMapLayer, config.OUT_RT, rect.Position + new Vector2(rect.Size.X, 3), Vector2.One); + + FillRect(GameConfig.FloorMapLayer, config.Floor, rect.Position + new Vector2(rect.Size.X, 1), new Vector2(1, rect.Size.Y - 2)); + //生成门的导航区域 + var x = rect.Position.X * GameConfig.TileCellSize; + var y = rect.Position.Y * GameConfig.TileCellSize; + + var op1 = new SerializeVector2(x - GameConfig.TileCellSize * 1.5f + (rect.Size.X + 1) * GameConfig.TileCellSize, y + GameConfig.TileCellSize * 1.5f); + var op2 = new SerializeVector2(x + GameConfig.TileCellSize * 0.5f + (rect.Size.X + 1) * GameConfig.TileCellSize, y + GameConfig.TileCellSize * 1.5f); + var op3 = new SerializeVector2(x + GameConfig.TileCellSize * 0.5f + (rect.Size.X + 1) * GameConfig.TileCellSize, y + GameConfig.TileCellSize * 3f); + var op4 = new SerializeVector2(x - GameConfig.TileCellSize * 1.5f + (rect.Size.X + 1) * GameConfig.TileCellSize, y + GameConfig.TileCellSize * 3f); + AddDoorNavigation( + doorInfo, op1, op2, op3, op4, + new SerializeVector2(op2.X - GameConfig.TileCellSize, op1.Y), + new SerializeVector2(op2), + new SerializeVector2(op3), + new SerializeVector2(op2.X - GameConfig.TileCellSize, op4.Y) + ); + } + } + + //纵向过道, 门朝下, 连接方向向上 + private void FullVerticalAisleUp(AutoTileConfig config, Rect2 rect, RoomDoorInfo doorInfo = null) + { + //上 + ClearRect(GameConfig.TopMapLayer, rect.Position + new Vector2(1, -1), new Vector2(rect.Size.X - 2, 1)); + if (doorInfo == null) + { + FillRect(GameConfig.AisleFloorMapLayer, config.Floor, rect.Position + new Vector2(1, -1), + new Vector2(rect.Size.X - 2, 1)); + } + else + { + FillRect(GameConfig.TopMapLayer, config.OUT_RT, rect.Position + new Vector2(0, -1), Vector2.One); + FillRect(GameConfig.TopMapLayer, config.OUT_LT, rect.Position + new Vector2(3, -1), Vector2.One); + + FillRect(GameConfig.FloorMapLayer, config.Floor, rect.Position + new Vector2(1, -1), new Vector2(rect.Size.X - 2, 1)); + //生成门的导航区域 + var x = rect.Position.X * GameConfig.TileCellSize; + var y = rect.Position.Y * GameConfig.TileCellSize; + + var op1 = new SerializeVector2(x + GameConfig.TileCellSize * 1.5f, y - GameConfig.TileCellSize * 1f); + var op2 = new SerializeVector2(x + GameConfig.TileCellSize * 2.5f, y - GameConfig.TileCellSize * 1f); + var op3 = new SerializeVector2(x + GameConfig.TileCellSize * 2.5f, y + GameConfig.TileCellSize * 0.5f); + var op4 = new SerializeVector2(x + GameConfig.TileCellSize * 1.5f, y + GameConfig.TileCellSize * 0.5f); + AddDoorNavigation( + doorInfo, op1, op2, op3, op4, + new SerializeVector2(op1), + new SerializeVector2(op2), + new SerializeVector2(op3.X, op1.Y + GameConfig.TileCellSize), + new SerializeVector2(op4.X, op1.Y + GameConfig.TileCellSize) + ); + } + } + + //纵向过道, 门朝上, 连接方向向下 + private void FullVerticalAisleDown(AutoTileConfig config, Rect2 rect, RoomDoorInfo doorInfo = null) + { + //下 + ClearRect(GameConfig.MiddleMapLayer, rect.Position + new Vector2(1, rect.Size.Y), new Vector2(rect.Size.X - 2, 1)); + if (doorInfo == null) + { + FillRect(GameConfig.AisleFloorMapLayer, config.Floor, rect.Position + new Vector2(1, rect.Size.Y), new Vector2(rect.Size.X - 2, 1)); + } + else + { + FillRect(GameConfig.MiddleMapLayer, config.OUT_RB, rect.Position + new Vector2(0, rect.Size.Y), Vector2.One); + FillRect(GameConfig.MiddleMapLayer, config.OUT_LB, rect.Position + new Vector2(3, rect.Size.Y), Vector2.One); + + FillRect(GameConfig.FloorMapLayer, config.Floor, rect.Position + new Vector2(1, rect.Size.Y), new Vector2(rect.Size.X - 2, 1)); + //生成门的导航区域 + var x = rect.Position.X * GameConfig.TileCellSize; + var y = rect.Position.Y * GameConfig.TileCellSize; + + var op1 = new SerializeVector2(x + GameConfig.TileCellSize * 1.5f, y - GameConfig.TileCellSize * 1f + (rect.Size.Y + 1) * GameConfig.TileCellSize); + var op2 = new SerializeVector2(x + GameConfig.TileCellSize * 2.5f, y - GameConfig.TileCellSize * 1f + (rect.Size.Y + 1) * GameConfig.TileCellSize); + var op3 = new SerializeVector2(x + GameConfig.TileCellSize * 2.5f, y + GameConfig.TileCellSize * 0.5f + (rect.Size.Y + 1) * GameConfig.TileCellSize); + var op4 = new SerializeVector2(x + GameConfig.TileCellSize * 1.5f, y + GameConfig.TileCellSize * 0.5f + (rect.Size.Y + 1) * GameConfig.TileCellSize); + AddDoorNavigation( + doorInfo, op1, op2, op3, op4, + new SerializeVector2(op1.X, op3.Y - GameConfig.TileCellSize), + new SerializeVector2(op2.X, op3.Y - GameConfig.TileCellSize), + new SerializeVector2(op3), + new SerializeVector2(op4) + ); + } + } + + /// + /// 添加房间 + /// + private void AddDoorNavigation(RoomDoorInfo doorInfo, + SerializeVector2 op1, SerializeVector2 op2, SerializeVector2 op3, SerializeVector2 op4, + SerializeVector2 cp1, SerializeVector2 cp2, SerializeVector2 cp3, SerializeVector2 cp4) + { + var openPolygonData = new NavigationPolygonData(); + openPolygonData.Type = NavigationPolygonType.Out; + openPolygonData.Points.Add(op1); + openPolygonData.Points.Add(op2); + openPolygonData.Points.Add(op3); + openPolygonData.Points.Add(op4); + + var closePolygonData = new NavigationPolygonData(); + closePolygonData.Type = NavigationPolygonType.Out; + closePolygonData.Points.Add(cp1); + closePolygonData.Points.Add(cp2); + closePolygonData.Points.Add(cp3); + closePolygonData.Points.Add(cp4); + + _connectNavigationItemList.Add(new DoorNavigationInfo(doorInfo, openPolygonData, closePolygonData)); + } + + //报错数据 + // private void TestData() + // { + // _polygonDataList.Clear(); + // _polygonDataList.Add(new NavigationPolygonData(){Type = NavigationPolygonType.Out, Points = new List(new []{ new SerializeVector2(-456, 712), new SerializeVector2(-440, 712), new SerializeVector2(-440, 792), new SerializeVector2(-456, 792) })}); + // _polygonDataList.Add(new NavigationPolygonData(){Type = NavigationPolygonType.In, Points = new List(new []{ new SerializeVector2(-1048, 744), new SerializeVector2(-840, 744), new SerializeVector2(-840, 840), new SerializeVector2(-1048, 840) })}); + // _polygonDataList.Add(new NavigationPolygonData(){Type = NavigationPolygonType.Out, Points = new List(new []{ new SerializeVector2(488, 920), new SerializeVector2(504, 920), new SerializeVector2(504, 1128), new SerializeVector2(488, 1128) })}); + // _polygonDataList.Add(new NavigationPolygonData(){Type = NavigationPolygonType.Out, Points = new List(new []{ new SerializeVector2(1320, 984), new SerializeVector2(1352, 984), new SerializeVector2(1352, 1096), new SerializeVector2(1432, 1096), new SerializeVector2(1432, 984), new SerializeVector2(1576, 984), new SerializeVector2(1576, 1128), new SerializeVector2(1544, 1128), new SerializeVector2(1544, 1000), new SerializeVector2(1464, 1000), new SerializeVector2(1464, 1128), new SerializeVector2(1320, 1128) })}); + // _polygonDataList.Add(new NavigationPolygonData(){Type = NavigationPolygonType.Out, Points = new List(new []{ new SerializeVector2(712, 1432), new SerializeVector2(984, 1432), new SerializeVector2(984, 1592), new SerializeVector2(712, 1592) })}); + // } + + /// + /// 计算并动生成导航区域, layer 为需要计算的层级,如果没有设置 floorAtlasCoords,则该 layer 下不为空的地砖都将视为可行走区域 + /// + public void GenerateNavigationPolygon(int layer) + { + _usePoints.Clear(); + _polygonDataList.Clear(); + + try + { + var size = new Vector2(_tileRoot.CellQuadrantSize, _tileRoot.CellQuadrantSize); + + var rect = _tileRoot.GetUsedRect(); + + var x = rect.Position.X; + var y = rect.Position.Y; + var w = rect.Size.X; + var h = rect.Size.Y; + + for (int j = y; j < h; j++) + { + for (int i = x; i < w; i++) + { + if (IsWayTile(layer, i, j)) + { + if (!_usePoints.Contains(new Vector2I(i, j))) + { + NavigationPolygonData polygonData = null; + + if (!IsWayTile(layer, i, j - 1)) + { + polygonData = CalcOutline(layer, i, j, size); + } + else if (!IsWayTile(layer, i, j + 1)) + { + polygonData = CalcInline(layer, i, j, size); + } + + if (polygonData != null) + { + _polygonDataList.Add(polygonData); + } + } + } + } + } + + _generateNavigationResult = new GenerateNavigationResult(true); + } + catch (NavigationPointInterleavingException e) + { + _usePoints.Clear(); + _polygonDataList.Clear(); + GD.Print(e.Message); + _generateNavigationResult = new GenerateNavigationResult(false, e); + } + } + + /// + /// 获取生成导航区域操作的结果, 如果没有调用过 GenerateNavigationPolygon() 函数, 则返回 null + /// + /// + public GenerateNavigationResult GetGenerateNavigationResult() + { + return _generateNavigationResult; + } + + /// + /// 将导航区域挂载到 navigationRoot 上 + /// + public void MountNavigationPolygon(Node2D navigationRoot) + { + //TestData(); + // 在 Godot4.0_rc6 中 如果将所有点都放在 NavigationPolygon 里面, 即使点是对的, 但调用 MakePolygonsFromOutlines 还是可能会报错, 这应该是个bug + + //通过 GenerateNavigationPolygon() 计算出来的导航区域 + for (var i = 0; i < _polygonDataList.Count; i++) + { + var polygonData = _polygonDataList[i]; + CreateNavigationRegion(navigationRoot, polygonData); + } + + //门占用区域的导航区域 + for (var i = 0; i < _connectNavigationItemList.Count; i++) + { + var item = _connectNavigationItemList[i]; + item.CloseNavigationNode = CreateNavigationRegion(navigationRoot, item.CloseNavigationData); + item.OpenNavigationNode = CreateNavigationRegion(navigationRoot, item.OpenNavigationData); + item.CloseNavigationNode.Enabled = false; + item.OpenNavigationNode.Enabled = false; + item.DoorInfo.Navigation = item; + } + } + + private NavigationRegion2D CreateNavigationRegion(Node2D navigationRoot, NavigationPolygonData polygonData) + { + var polygon = new NavigationPolygon(); + polygon.AddOutline(polygonData.ConvertPointsToVector2Array()); + polygon.MakePolygonsFromOutlines(); + var navigationPolygon = new NavigationRegion2D(); + navigationPolygon.Name = "NavigationRegion" + (navigationRoot.GetChildCount() + 1); + navigationPolygon.NavigationPolygon = polygon; + navigationRoot.AddChild(navigationPolygon); + return navigationPolygon; + } + + /// + /// 获取房间内的导航点数据 + /// + public NavigationPolygonData[] GetPolygonData() + { + return _polygonDataList.ToArray(); + } + + /// + /// 获取连接门导航数据, 必须要调用 AutoFillRoomTile() 函数才有数据 + /// + public NavigationPolygonData[] GetConnectDoorPolygonData() + { + var array = new NavigationPolygonData[_connectNavigationItemList.Count]; + for (var i = 0; i < _connectNavigationItemList.Count; i++) + { + array[i] = _connectNavigationItemList[i].OpenNavigationData; + } + return array; + } + + /// + /// 设置地面的地砖,将影响导航网格计算 + /// + public void SetFloorAtlasCoords(List floorAtlasCoords) + { + _floorAtlasCoords = floorAtlasCoords; + } + + /// + /// 返回指定位置的Tile是否为可以行走 + /// + private bool IsWayTile(int layer, int x, int y) + { + if (_floorAtlasCoords == null || _floorAtlasCoords.Count == 0) + { + return _tileRoot.GetCellTileData(layer, new Vector2I(x, y)) != null; + } + + var result = _tileRoot.GetCellAtlasCoords(layer, new Vector2I(x, y)); + return _floorAtlasCoords.Contains(result); + } + + //计算导航网格外轮廓 + private NavigationPolygonData CalcOutline(int layer, int i, int j, Vector2 size) + { + var polygonData = new NavigationPolygonData(); + polygonData.Type = NavigationPolygonType.Out; + var points = polygonData.Points; + // 0:右, 1:下, 2:左, 3:上 + var dir = 0; + var offset = new Vector2(size.X * 0.5f, size.Y * 0.5f); + //找到路, 向右开始找边界 + var startPos = new Vector2I(i, j); + + var tempI = i; + var tempJ = j; + + while (true) + { + switch (dir) + { + case 0: //右 + { + if (IsWayTile(layer, tempI, tempJ - 1)) //先向上找 + { + dir = 3; + + var pos = new Vector2I(tempI, tempJ); + if (points.Count > 1 && pos == startPos) + { + return polygonData; + } + + points.Add(new SerializeVector2(tempI * size.X + offset.X, tempJ * size.Y + offset.Y)); + PutUsePoint(pos); + + tempJ--; + break; + } + else if (IsWayTile(layer, tempI + 1, tempJ)) //再向右找 + { + if (points.Count == 0) + { + points.Add(new SerializeVector2(tempI * size.X + offset.X, tempJ * size.Y + offset.Y)); + } + + var pos = new Vector2I(tempI, tempJ); + if (points.Count > 1 && pos == startPos) + { + return polygonData; + } + + PutUsePoint(new Vector2I(tempI, tempJ)); + tempI++; + break; + } + else if (IsWayTile(layer, tempI, tempJ + 1)) //向下找 + { + dir = 1; + + var pos = new Vector2I(tempI, tempJ); + if (points.Count > 1 && pos == startPos) + { + return polygonData; + } + + points.Add(new SerializeVector2(tempI * size.X + offset.X, tempJ * size.Y + offset.Y)); + PutUsePoint(pos); + + tempJ++; + break; + } + + throw new NavigationPointInterleavingException(new Vector2I(tempI, tempJ), "生成导航多边形发生错误! 点: " + new Vector2I(tempI, tempJ) + "发生交错!"); + } + case 1: //下 + { + if (IsWayTile(layer, tempI + 1, tempJ)) //先向右找 + { + dir = 0; + + var pos = new Vector2I(tempI, tempJ); + if (points.Count > 1 && pos == startPos) + { + return polygonData; + } + + points.Add(new SerializeVector2(tempI * size.X + offset.X, tempJ * size.Y + offset.Y)); + PutUsePoint(pos); + + tempI++; + break; + } + else if (IsWayTile(layer, tempI, tempJ + 1)) //再向下找 + { + if (points.Count == 0) + { + points.Add(new SerializeVector2(tempI * size.X + offset.X, tempJ * size.Y + offset.Y)); + } + + var pos = new Vector2I(tempI, tempJ); + if (points.Count > 1 && pos == startPos) + { + return polygonData; + } + + PutUsePoint(new Vector2I(tempI, tempJ)); + tempJ++; + break; + } + else if (IsWayTile(layer, tempI - 1, tempJ)) //向左找 + { + dir = 2; + + var pos = new Vector2I(tempI, tempJ); + if (points.Count > 1 && pos == startPos) + { + return polygonData; + } + + //points.Add(new SerializeVector2(tempI * size.X + offset.X, tempJ * size.Y + offset.Y)); + points.Add(new SerializeVector2(tempI * size.X + offset.X, tempJ * size.Y + offset.Y * 2)); + PutUsePoint(pos); + + tempI--; + break; + } + + throw new NavigationPointInterleavingException(new Vector2I(tempI, tempJ), "生成导航多边形发生错误! 点: " + new Vector2I(tempI, tempJ) + "发生交错!"); + } + case 2: //左 + { + if (IsWayTile(layer, tempI, tempJ + 1)) //先向下找 + { + dir = 1; + + var pos = new Vector2I(tempI, tempJ); + if (points.Count > 1 && pos == startPos) + { + return polygonData; + } + + //points.Add(new SerializeVector2(tempI * size.X + offset.X, tempJ * size.Y + offset.Y)); + points.Add(new SerializeVector2(tempI * size.X + offset.X, tempJ * size.Y + offset.Y * 2)); + PutUsePoint(pos); + + tempJ++; + break; + } + else if (IsWayTile(layer, tempI - 1, tempJ)) //再向左找 + { + if (points.Count == 0) + { + //points.Add(new SerializeVector2(tempI * size.X + offset.X, tempJ * size.Y + offset.Y)); + points.Add(new SerializeVector2(tempI * size.X + offset.X, tempJ * size.Y + offset.Y * 2)); + } + + var pos = new Vector2I(tempI, tempJ); + if (points.Count > 1 && pos == startPos) + { + return polygonData; + } + + PutUsePoint(new Vector2I(tempI, tempJ)); + tempI--; + break; + } + else if (IsWayTile(layer, tempI, tempJ - 1)) //向上找 + { + dir = 3; + + var pos = new Vector2I(tempI, tempJ); + if (points.Count > 1 && pos == startPos) + { + return polygonData; + } + + //points.Add(new SerializeVector2(tempI * size.X + offset.X, tempJ * size.Y + offset.Y)); + points.Add(new SerializeVector2(tempI * size.X + offset.X, tempJ * size.Y + offset.Y * 2)); + PutUsePoint(pos); + + tempJ--; + break; + } + + throw new NavigationPointInterleavingException(new Vector2I(tempI, tempJ), "生成导航多边形发生错误! 点: " + new Vector2I(tempI, tempJ) + "发生交错!"); + } + case 3: //上 + { + if (IsWayTile(layer, tempI - 1, tempJ)) //先向左找 + { + dir = 2; + + var pos = new Vector2I(tempI, tempJ); + if (points.Count > 1 && pos == startPos) + { + return polygonData; + } + + //points.Add(new SerializeVector2(tempI * size.X + offset.X, tempJ * size.Y + offset.Y)); + points.Add(new SerializeVector2(tempI * size.X + offset.X, tempJ * size.Y + offset.Y * 2)); + PutUsePoint(pos); + + tempI--; + break; + } + else if (IsWayTile(layer, tempI, tempJ - 1)) //再向上找 + { + if (points.Count == 0) + { + points.Add(new SerializeVector2(tempI * size.X + offset.X, tempJ * size.Y + offset.Y)); + } + + var pos = new Vector2I(tempI, tempJ); + if (points.Count > 1 && pos == startPos) + { + return polygonData; + } + + PutUsePoint(new Vector2I(tempI, tempJ)); + tempJ--; + break; + } + else if (IsWayTile(layer, tempI + 1, tempJ)) //向右找 + { + dir = 0; + + var pos = new Vector2I(tempI, tempJ); + if (points.Count > 1 && pos == startPos) + { + return polygonData; + } + + points.Add(new SerializeVector2(tempI * size.X + offset.X, tempJ * size.Y + offset.Y)); + PutUsePoint(pos); + + tempI++; + break; + } + + throw new NavigationPointInterleavingException(new Vector2I(tempI, tempJ), "生成导航多边形发生错误! 点: " + new Vector2I(tempI, tempJ) + "发生交错!"); + } + } + } + } + + //计算导航网格内轮廓 + private NavigationPolygonData CalcInline(int layer, int i, int j, Vector2 size) + { + var polygonData = new NavigationPolygonData(); + polygonData.Type = NavigationPolygonType.In; + var points = polygonData.Points; + // 0:右, 1:下, 2:左, 3:上 + var dir = 0; + var offset = new Vector2(size.X * 0.5f, size.Y * 0.5f); + //找到路, 向右开始找边界 + var startPos = new Vector2I(i - 1, j); + PutUsePoint(startPos); + + var tempI = i; + var tempJ = j; + + while (true) + { + switch (dir) + { + case 0: //右 + { + if (IsWayTile(layer, tempI, tempJ + 1)) //向下找 + { + dir = 1; + + var pos = new Vector2I(tempI, tempJ); + if (points.Count > 1 && pos == startPos) + { + return polygonData; + } + + //points.Add(new SerializeVector2(tempI * size.X + offset.X, tempJ * size.Y + offset.Y)); + points.Add(new SerializeVector2(tempI * size.X + offset.X, tempJ * size.Y + offset.Y * 2)); + PutUsePoint(pos); + + tempJ++; + break; + } + else if (IsWayTile(layer, tempI + 1, tempJ)) //再向右找 + { + if (points.Count == 0) + { + //points.Add(new SerializeVector2((tempI - 1) * size.X + offset.X, tempJ * size.Y + offset.Y)); + points.Add(new SerializeVector2((tempI - 1) * size.X + offset.X, tempJ * size.Y + offset.Y * 2)); + } + + var pos = new Vector2I(tempI, tempJ); + if (points.Count > 1 && pos == startPos) + { + return polygonData; + } + + PutUsePoint(new Vector2I(tempI, tempJ)); + tempI++; + break; + } + else if (IsWayTile(layer, tempI, tempJ - 1)) //先向上找 + { + dir = 3; + + var pos = new Vector2I(tempI, tempJ); + if (points.Count > 1 && pos == startPos) + { + return polygonData; + } + + //points.Add(new SerializeVector2(tempI * size.X + offset.X, tempJ * size.Y + offset.Y)); + points.Add(new SerializeVector2(tempI * size.X + offset.X, tempJ * size.Y + offset.Y * 2)); + PutUsePoint(pos); + + tempJ--; + break; + } + + throw new NavigationPointInterleavingException(new Vector2I(tempI, tempJ), "生成导航多边形发生错误! 点: " + new Vector2I(tempI, tempJ) + "发生交错!"); + } + case 1: //下 + { + if (IsWayTile(layer, tempI - 1, tempJ)) //向左找 + { + dir = 2; + + var pos = new Vector2I(tempI, tempJ); + if (points.Count > 1 && pos == startPos) + { + return polygonData; + } + + points.Add(new SerializeVector2(tempI * size.X + offset.X, tempJ * size.Y + offset.Y)); + PutUsePoint(pos); + + tempI--; + break; + } + else if (IsWayTile(layer, tempI, tempJ + 1)) //再向下找 + { + if (points.Count == 0) + { + points.Add(new SerializeVector2((tempI - 1) * size.X + offset.X, tempJ * size.Y + offset.Y)); + } + + var pos = new Vector2I(tempI, tempJ); + if (points.Count > 1 && pos == startPos) + { + return polygonData; + } + + PutUsePoint(new Vector2I(tempI, tempJ)); + tempJ++; + break; + } + else if (IsWayTile(layer, tempI + 1, tempJ)) //先向右找 + { + dir = 0; + + var pos = new Vector2I(tempI, tempJ); + if (points.Count > 1 && pos == startPos) + { + return polygonData; + } + + //points.Add(new SerializeVector2(tempI * size.X + offset.X, tempJ * size.Y + offset.Y)); + points.Add(new SerializeVector2(tempI * size.X + offset.X, tempJ * size.Y + offset.Y * 2)); + PutUsePoint(pos); + + tempI++; + break; + } + + throw new NavigationPointInterleavingException(new Vector2I(tempI, tempJ), "生成导航多边形发生错误! 点: " + new Vector2I(tempI, tempJ) + "发生交错!"); + } + case 2: //左 + { + if (IsWayTile(layer, tempI, tempJ - 1)) //向上找 + { + dir = 3; + + var pos = new Vector2I(tempI, tempJ); + if (points.Count > 1 && pos == startPos) + { + return polygonData; + } + + points.Add(new SerializeVector2(tempI * size.X + offset.X, tempJ * size.Y + offset.Y)); + PutUsePoint(pos); + + tempJ--; + break; + } + else if (IsWayTile(layer, tempI - 1, tempJ)) //再向左找 + { + if (points.Count == 0) + { + points.Add(new SerializeVector2((tempI - 1) * size.X + offset.X, tempJ * size.Y + offset.Y)); + } + + var pos = new Vector2I(tempI, tempJ); + if (points.Count > 1 && pos == startPos) + { + return polygonData; + } + + PutUsePoint(new Vector2I(tempI, tempJ)); + tempI--; + break; + } + else if (IsWayTile(layer, tempI, tempJ + 1)) //先向下找 + { + dir = 1; + + var pos = new Vector2I(tempI, tempJ); + if (points.Count > 1 && pos == startPos) + { + return polygonData; + } + + points.Add(new SerializeVector2(tempI * size.X + offset.X, tempJ * size.Y + offset.Y)); + PutUsePoint(pos); + + tempJ++; + break; + } + + throw new NavigationPointInterleavingException(new Vector2I(tempI, tempJ), "生成导航多边形发生错误! 点: " + new Vector2I(tempI, tempJ) + "发生交错!"); + } + case 3: //上 + { + if (IsWayTile(layer, tempI + 1, tempJ)) //向右找 + { + dir = 0; + + var pos = new Vector2I(tempI, tempJ); + if (points.Count > 1 && pos == startPos) + { + return polygonData; + } + + //points.Add(new SerializeVector2(tempI * size.X + offset.X, tempJ * size.Y + offset.Y)); + points.Add(new SerializeVector2(tempI * size.X + offset.X, tempJ * size.Y + offset.Y * 2)); + PutUsePoint(pos); + + tempI++; + break; + } + else if (IsWayTile(layer, tempI, tempJ - 1)) //再向上找 + { + if (points.Count == 0) + { + points.Add(new SerializeVector2((tempI - 1) * size.X + offset.X, tempJ * size.Y + offset.Y)); + } + + var pos = new Vector2I(tempI, tempJ); + if (points.Count > 1 && pos == startPos) + { + return polygonData; + } + + PutUsePoint(new Vector2I(tempI, tempJ)); + tempJ--; + break; + } + else if (IsWayTile(layer, tempI - 1, tempJ)) //先向左找 + { + dir = 2; + + var pos = new Vector2I(tempI, tempJ); + if (points.Count > 1 && pos == startPos) + { + return polygonData; + } + + points.Add(new SerializeVector2(tempI * size.X + offset.X, tempJ * size.Y + offset.Y)); + PutUsePoint(pos); + + tempI--; + break; + } + + throw new NavigationPointInterleavingException(new Vector2I(tempI, tempJ), "生成导航多边形发生错误! 点: " + new Vector2I(tempI, tempJ) + "发生交错!"); + } + } + } + } + + //记录导航网格中已经使用过的坐标 + private void PutUsePoint(Vector2I pos) + { + if (_usePoints.Contains(pos)) + { + throw new NavigationPointInterleavingException(pos, "生成导航多边形发生错误! 点: " + pos + "发生交错!"); + } + + _usePoints.Add(pos); + } +} \ No newline at end of file diff --git a/DungeonShooting_Godot/src/framework/map/NavigationPolygonData.cs b/DungeonShooting_Godot/src/framework/map/NavigationPolygonData.cs deleted file mode 100644 index 5273a1e..0000000 --- a/DungeonShooting_Godot/src/framework/map/NavigationPolygonData.cs +++ /dev/null @@ -1,81 +0,0 @@ - -using System.Collections.Generic; -using System.Text.Json.Serialization; -using Godot; - -public enum NavigationPolygonType -{ - /// - /// 外轮廓 - /// - Out, - /// - /// 内轮廓 - /// - In, -} - -/// -/// 描述导航多边形数据 -/// -public class NavigationPolygonData -{ - /// - /// 导航轮廓类型 - /// - [JsonInclude] public NavigationPolygonType Type; - - /// - /// 多边形的顶点, 单位: 像素 - /// - [JsonInclude] public List Points = new List(); - - public NavigationPolygonData() - { - } - - public NavigationPolygonData(NavigationPolygonType type, List points) - { - Type = type; - Points = points; - } - - /// - /// 将 Points 字段转为 Vector2[] 类型数据并返回 - /// - public Vector2[] ConvertPointsToVector2Array() - { - if (Points == null) - { - return null; - } - - var array = new Vector2[Points.Count]; - for (var i = 0; i < Points.Count; i++) - { - array[i] = Points[i].AsVector2(); - } - - return array; - } - - /// - /// 将 Points 字段转为 Vector2I[] 类型数据并返回 - /// - public Vector2I[] ConvertPointsToVector2IArray() - { - if (Points == null) - { - return null; - } - - var array = new Vector2I[Points.Count]; - for (var i = 0; i < Points.Count; i++) - { - array[i] = Points[i].AsVector2I(); - } - - return array; - } - -} \ No newline at end of file diff --git a/DungeonShooting_Godot/src/framework/map/RoomStaticImageCanvas.cs b/DungeonShooting_Godot/src/framework/map/RoomStaticImageCanvas.cs deleted file mode 100644 index a21a7c1..0000000 --- a/DungeonShooting_Godot/src/framework/map/RoomStaticImageCanvas.cs +++ /dev/null @@ -1,41 +0,0 @@ - -using Godot; - -public class RoomStaticImageCanvas : IDestroy -{ - public bool IsDestroyed { get; private set; } - /// - /// 画布节点实例 - /// - public ImageCanvas CanvasSprite { get; } - /// - /// 房间坐标相对于画布坐标偏移量, 单位: 像素 - /// - public Vector2I RoomOffset { get; set; } - - public RoomStaticImageCanvas(Node root, Vector2I position, int width, int height) - { - CanvasSprite = new ImageCanvas(width, height); - //CanvasSprite.Clear(new Color(1, 1, 1, 0.2f)); - CanvasSprite.GlobalPosition = position; - root.AddChild(CanvasSprite); - } - - /// - /// 将世界坐标转为画布下的坐标 - /// - public Vector2 ToImageCanvasPosition(Vector2 pos) - { - return pos - CanvasSprite.GlobalPosition; - } - - public void Destroy() - { - if (IsDestroyed) - { - return; - } - - IsDestroyed = true; - } -} \ No newline at end of file diff --git a/DungeonShooting_Godot/src/framework/map/TileCellInfo.cs b/DungeonShooting_Godot/src/framework/map/TileCellInfo.cs index 20de93f..b892d38 100644 --- a/DungeonShooting_Godot/src/framework/map/TileCellInfo.cs +++ b/DungeonShooting_Godot/src/framework/map/TileCellInfo.cs @@ -6,7 +6,7 @@ /// public class TileCellInfo { - public TileCellInfo(int id, Vector2I? autoTileCoord) + public TileCellInfo(int id, Vector2I autoTileCoord) { Id = id; AutoTileCoord = autoTileCoord; @@ -20,5 +20,5 @@ /// /// 如果是图块集, 该属性就表示在图块集的位置 /// - public Vector2I? AutoTileCoord; + public Vector2I AutoTileCoord; } \ No newline at end of file diff --git a/DungeonShooting_Godot/src/framework/map/data/DoorAreaInfo.cs b/DungeonShooting_Godot/src/framework/map/data/DoorAreaInfo.cs new file mode 100644 index 0000000..8d2263c --- /dev/null +++ b/DungeonShooting_Godot/src/framework/map/data/DoorAreaInfo.cs @@ -0,0 +1,71 @@ + +using System.Text.Json.Serialization; +using Godot; + +/// +/// 用于描述门生成区域 +/// +public class DoorAreaInfo +{ + /// + /// 门方向 + /// + [JsonInclude] + public DoorDirection Direction; + /// + /// 起始位置, 相对 tilemap 的横/纵轴原点, 单位: 像素 + /// + [JsonInclude] + public float Start = 0; + /// + /// 结束位置, 相对 tilemap 的横/纵轴原点, 单位: 像素 + /// + [JsonInclude] + public float End = 16; + + /// + /// 起始点坐标, 该坐标为模板场景的世界坐标, 单位: 像素, 不参与序列化与反序列化 + /// + public Vector2 StartPosition; + /// + /// 结束点坐标, 该坐标为模板场景的世界坐标, 单位: 像素, 不参与序列化与反序列化 + /// + public Vector2 EndPosition; + + public DoorAreaInfo() + { + } + + public DoorAreaInfo(DoorDirection direction, float start, float end) + { + Direction = direction; + Start = start; + End = end; + } + + /// + /// 自动计算 startPosition 和 endPosition + /// + public void CalcPosition(Vector2 rootPosition, Vector2 rootSize) + { + switch (Direction) + { + case DoorDirection.E: + StartPosition = new Vector2(rootPosition.X, rootPosition.Y + Start); + EndPosition = new Vector2(rootPosition.X, rootPosition.Y + End); + break; + case DoorDirection.W: + StartPosition = new Vector2(rootPosition.X + rootSize.X, rootPosition.Y + Start); + EndPosition = new Vector2(rootPosition.X + rootSize.X, rootPosition.Y + End); + break; + case DoorDirection.S: + StartPosition = new Vector2(rootPosition.X + Start, rootPosition.Y + rootSize.Y); + EndPosition = new Vector2(rootPosition.X + End, rootPosition.Y + rootSize.Y); + break; + case DoorDirection.N: + StartPosition = new Vector2(rootPosition.X + Start, rootPosition.Y); + EndPosition = new Vector2(rootPosition.X + End, rootPosition.Y); + break; + } + } +} \ No newline at end of file diff --git a/DungeonShooting_Godot/src/framework/map/data/DungeonRoomGroup.cs b/DungeonShooting_Godot/src/framework/map/data/DungeonRoomGroup.cs new file mode 100644 index 0000000..5d47401 --- /dev/null +++ b/DungeonShooting_Godot/src/framework/map/data/DungeonRoomGroup.cs @@ -0,0 +1,133 @@ + +using System; +using System.Collections.Generic; +using System.Text.Json.Serialization; +using Godot; + +/// +/// 房间组数据 +/// +public class DungeonRoomGroup +{ + /// + /// 组名称 + /// + [JsonInclude] + public string GroupName; + + /// + /// 普通战斗房间, 进入该房间时会关上门, 并刷出若干波敌人, 消灭所有敌人后开门 + /// + [JsonInclude] + public List BattleList = new List(); + + /// + /// 起始房间, 由上一层地牢的结束房间进入该房间, 每层包含一个起始房间 + /// + [JsonInclude] + public List InletList = new List(); + + /// + /// 结束房间, 进入另一层地牢, 每层只是包含一个结束房间 + /// + [JsonInclude] + public List OutletList = new List(); + + /// + /// boss战房间, 进入房间时会关上没, 刷出boss, 消灭boss后开门 + /// + [JsonInclude] + public List BossList = new List(); + + /// + /// 奖励房间, 给予玩家武器或者道具奖励的房间 + /// + [JsonInclude] + public List RewardList = new List(); + + /// + /// 商店, 玩家买卖道具装备的房间 + /// + [JsonInclude] + public List ShopList = new List(); + + /// + /// 事件房间, 触发剧情或者解锁NPC的房间 + /// + [JsonInclude] + public List EventList = new List(); + + private bool _init = false; + private Dictionary _weightRandomMap; + + /// + /// 获取指定类型房间集合 + /// + public List GetRoomList(DungeonRoomType roomType) + { + switch (roomType) + { + case DungeonRoomType.Battle: return BattleList; + case DungeonRoomType.Inlet: return InletList; + case DungeonRoomType.Outlet: return OutletList; + case DungeonRoomType.Boss: return BossList; + case DungeonRoomType.Reward: return RewardList; + case DungeonRoomType.Shop: return ShopList; + case DungeonRoomType.Event: return EventList; + } + + return null; + } + + /// + /// 初始化权重处理 + /// + public void InitWeight(SeedRandom random) + { + if (_init) + { + return; + } + + _init = true; + _weightRandomMap = new Dictionary(); + + foreach (var roomType in Enum.GetValues()) + { + InitAdRewardWeight(roomType, random); + } + } + + private void InitAdRewardWeight(DungeonRoomType roomType, SeedRandom random) + { + var dungeonRoomSplits = GetRoomList(roomType); + var weightRandom = new WeightRandom(random); + _weightRandomMap.Add(roomType, weightRandom); + + var list = new List(); + foreach (var roomSplit in dungeonRoomSplits) + { + list.Add(roomSplit.RoomInfo.Weight); + } + weightRandom.InitAdRewardWeight(list.ToArray()); + } + + /// + /// 根据房间类型和权重获取随机房间 + /// + public DungeonRoomSplit GetRandomRoom(DungeonRoomType roomType) + { + if (!_init) + { + GD.PrintErr("未调用DungeonRoomGroup.InitWeight()来初始化权重!"); + return null; + } + + if (_weightRandomMap.TryGetValue(roomType, out var weightRandom)) + { + return GetRoomList(roomType)[weightRandom.GetRandomIndex()]; + } + + return null; + } +} \ No newline at end of file diff --git a/DungeonShooting_Godot/src/framework/map/data/DungeonRoomInfo.cs b/DungeonShooting_Godot/src/framework/map/data/DungeonRoomInfo.cs new file mode 100644 index 0000000..72a8801 --- /dev/null +++ b/DungeonShooting_Godot/src/framework/map/data/DungeonRoomInfo.cs @@ -0,0 +1,57 @@ + +using System.Collections.Generic; +using System.Text.Json.Serialization; + +/// +/// 房间配置数据 +/// +public class DungeonRoomInfo +{ + /// + /// 房间位置, 在tile坐标系中的位置, 单位: 格 + /// + [JsonInclude] + public SerializeVector2 Position; + + /// + /// 房间大小, 在tile坐标系中占用的格子, 单位: 格 + /// + [JsonInclude] + public SerializeVector2 Size; + + /// + /// 房间连通门 + /// + [JsonInclude] + public List DoorAreaInfos; + + /// + /// 导航数据 + /// + [JsonInclude] + public List NavigationList; + + /// + /// 当前房间所属分组的名称 + /// + [JsonInclude] + public string GroupName = "unclaimed"; + + /// + /// 房间类型 + /// + [JsonInclude] + public DungeonRoomType RoomType = DungeonRoomType.Battle; + + /// + /// 房间文件名称 + /// + [JsonInclude] + public string FileName; + + /// + /// 房间权重, 值越大, 生成地牢是越容易出现该房间 + /// + [JsonInclude] + public int Weight = DungeonRoomTemplate.DefaultWeight; +} \ No newline at end of file diff --git a/DungeonShooting_Godot/src/framework/map/data/DungeonRoomSplit.cs b/DungeonShooting_Godot/src/framework/map/data/DungeonRoomSplit.cs new file mode 100644 index 0000000..f5cdb4b --- /dev/null +++ b/DungeonShooting_Godot/src/framework/map/data/DungeonRoomSplit.cs @@ -0,0 +1,57 @@ + +using System.Text.Json; +using System.Text.Json.Serialization; + +/// +/// 房间配置文件相关信息, 将会在 RoomConfig.json 中汇总 +/// +public class DungeonRoomSplit +{ + /// + /// 房间场景路径 + /// + [JsonInclude] + public string ScenePath; + + /// + /// 房间配置路径 + /// + [JsonInclude] + public string RoomPath; + + /// + /// 房间地块配置数据 + /// + [JsonInclude] + public string TilePath; + + /// + /// 房间配置数据, 第一次获取会要在资源中加载数据 + /// + [JsonIgnore] + public DungeonRoomInfo RoomInfo + { + get + { + if (_roomInfo == null) + { + var asText = ResourceManager.LoadText(RoomPath); + _roomInfo = JsonSerializer.Deserialize(asText); + + //需要处理 DoorAreaInfos 长度为 0 的房间, 并为其配置默认值 + var areaInfos = _roomInfo.DoorAreaInfos; + if (areaInfos.Count == 0) + { + areaInfos.Add(new DoorAreaInfo(DoorDirection.N, GameConfig.TileCellSize, (_roomInfo.Size.X - 1) * GameConfig.TileCellSize)); + areaInfos.Add(new DoorAreaInfo(DoorDirection.S, GameConfig.TileCellSize, (_roomInfo.Size.X - 1) * GameConfig.TileCellSize)); + areaInfos.Add(new DoorAreaInfo(DoorDirection.W, GameConfig.TileCellSize, (_roomInfo.Size.Y - 1) * GameConfig.TileCellSize)); + areaInfos.Add(new DoorAreaInfo(DoorDirection.E, GameConfig.TileCellSize, (_roomInfo.Size.Y - 1) * GameConfig.TileCellSize)); + } + } + + return _roomInfo; + } + } + + private DungeonRoomInfo _roomInfo; +} \ No newline at end of file diff --git a/DungeonShooting_Godot/src/framework/map/data/DungeonTileInfo.cs b/DungeonShooting_Godot/src/framework/map/data/DungeonTileInfo.cs new file mode 100644 index 0000000..c4003b4 --- /dev/null +++ b/DungeonShooting_Godot/src/framework/map/data/DungeonTileInfo.cs @@ -0,0 +1,30 @@ + +using System.Collections.Generic; +using System.Text.Json.Serialization; + +public class DungeonTileInfo +{ + /// + /// 导航数据 + /// + [JsonInclude] + public List NavigationList; + + /// + /// 底层数据, 五个一组, 分别为: 地图x坐标, 地图y坐标, 资源id, 图集x坐标, 图集y坐标 + /// + [JsonInclude] + public List Floor; + + /// + /// 中层数据, 五个一组, 分别为: 地图x坐标, 地图y坐标, 资源id, 图集x坐标, 图集y坐标 + /// + [JsonInclude] + public List Middle; + + /// + /// 顶层数据, 五个一组, 分别为: 地图x坐标, 地图y坐标, 资源id, 图集x坐标, 图集y坐标 + /// + [JsonInclude] + public List Top; +} \ No newline at end of file diff --git a/DungeonShooting_Godot/src/framework/map/data/NavigationPolygonData.cs b/DungeonShooting_Godot/src/framework/map/data/NavigationPolygonData.cs new file mode 100644 index 0000000..5273a1e --- /dev/null +++ b/DungeonShooting_Godot/src/framework/map/data/NavigationPolygonData.cs @@ -0,0 +1,81 @@ + +using System.Collections.Generic; +using System.Text.Json.Serialization; +using Godot; + +public enum NavigationPolygonType +{ + /// + /// 外轮廓 + /// + Out, + /// + /// 内轮廓 + /// + In, +} + +/// +/// 描述导航多边形数据 +/// +public class NavigationPolygonData +{ + /// + /// 导航轮廓类型 + /// + [JsonInclude] public NavigationPolygonType Type; + + /// + /// 多边形的顶点, 单位: 像素 + /// + [JsonInclude] public List Points = new List(); + + public NavigationPolygonData() + { + } + + public NavigationPolygonData(NavigationPolygonType type, List points) + { + Type = type; + Points = points; + } + + /// + /// 将 Points 字段转为 Vector2[] 类型数据并返回 + /// + public Vector2[] ConvertPointsToVector2Array() + { + if (Points == null) + { + return null; + } + + var array = new Vector2[Points.Count]; + for (var i = 0; i < Points.Count; i++) + { + array[i] = Points[i].AsVector2(); + } + + return array; + } + + /// + /// 将 Points 字段转为 Vector2I[] 类型数据并返回 + /// + public Vector2I[] ConvertPointsToVector2IArray() + { + if (Points == null) + { + return null; + } + + var array = new Vector2I[Points.Count]; + for (var i = 0; i < Points.Count; i++) + { + array[i] = Points[i].AsVector2I(); + } + + return array; + } + +} \ No newline at end of file diff --git a/DungeonShooting_Godot/src/framework/map/image/RoomStaticImageCanvas.cs b/DungeonShooting_Godot/src/framework/map/image/RoomStaticImageCanvas.cs new file mode 100644 index 0000000..a21a7c1 --- /dev/null +++ b/DungeonShooting_Godot/src/framework/map/image/RoomStaticImageCanvas.cs @@ -0,0 +1,41 @@ + +using Godot; + +public class RoomStaticImageCanvas : IDestroy +{ + public bool IsDestroyed { get; private set; } + /// + /// 画布节点实例 + /// + public ImageCanvas CanvasSprite { get; } + /// + /// 房间坐标相对于画布坐标偏移量, 单位: 像素 + /// + public Vector2I RoomOffset { get; set; } + + public RoomStaticImageCanvas(Node root, Vector2I position, int width, int height) + { + CanvasSprite = new ImageCanvas(width, height); + //CanvasSprite.Clear(new Color(1, 1, 1, 0.2f)); + CanvasSprite.GlobalPosition = position; + root.AddChild(CanvasSprite); + } + + /// + /// 将世界坐标转为画布下的坐标 + /// + public Vector2 ToImageCanvasPosition(Vector2 pos) + { + return pos - CanvasSprite.GlobalPosition; + } + + public void Destroy() + { + if (IsDestroyed) + { + return; + } + + IsDestroyed = true; + } +} \ No newline at end of file diff --git a/DungeonShooting_Godot/src/game/GameApplication.cs b/DungeonShooting_Godot/src/game/GameApplication.cs index b542aa5..00afea1 100644 --- a/DungeonShooting_Godot/src/game/GameApplication.cs +++ b/DungeonShooting_Godot/src/game/GameApplication.cs @@ -218,10 +218,8 @@ private void InitRoomConfig() { //加载房间配置信息 - var file = FileAccess.Open(ResourcePath.resource_map_RoomConfig_json, FileAccess.ModeFlags.Read); - var asText = file.GetAsText(); + var asText = ResourceManager.LoadText(ResourcePath.resource_map_RoomConfig_json); RoomConfig = JsonSerializer.Deserialize>(asText); - file.Dispose(); //初始化RoomConfigMap RoomConfigMap = new Dictionary(); diff --git a/DungeonShooting_Godot/src/game/GameConfig.cs b/DungeonShooting_Godot/src/game/GameConfig.cs index 0591a7d..a689a31 100644 --- a/DungeonShooting_Godot/src/game/GameConfig.cs +++ b/DungeonShooting_Godot/src/game/GameConfig.cs @@ -37,7 +37,7 @@ /// /// 地图描述数据路径 /// - public const string RoomTileDataDir = "resource/map/tiledata/"; + public const string RoomTileDataDir = "resource/map/tileData/"; /// /// 房间配置汇总数据路径 /// diff --git a/DungeonShooting_Godot/src/game/manager/ResourceManager.cs b/DungeonShooting_Godot/src/game/manager/ResourceManager.cs index 6352e1c..8d39f9b 100644 --- a/DungeonShooting_Godot/src/game/manager/ResourceManager.cs +++ b/DungeonShooting_Godot/src/game/manager/ResourceManager.cs @@ -126,4 +126,17 @@ var packedScene = Load(path); return packedScene.Instantiate(); } + + /// + /// 读取文本资源 + /// + public static string LoadText(string path) + { + string text; + using (var fileAccess = FileAccess.Open(path, FileAccess.ModeFlags.Read)) + { + text = fileAccess.GetAsText(); + } + return text; + } } \ No newline at end of file diff --git a/DungeonShooting_Godot/src/game/room/DungeonManager.cs b/DungeonShooting_Godot/src/game/room/DungeonManager.cs index 0506bb5..d02378d 100644 --- a/DungeonShooting_Godot/src/game/room/DungeonManager.cs +++ b/DungeonShooting_Godot/src/game/room/DungeonManager.cs @@ -32,7 +32,7 @@ public bool IsInDungeon { get; private set; } private DungeonConfig _config; - private DungeonTile _dungeonTile; + private DungeonTileMap _dungeonTileMap; private AutoTileConfig _autoTileConfig; private DungeonGenerator _dungeonGenerator; //房间内所有静态导航网格数据 @@ -110,22 +110,22 @@ //填充地牢 _autoTileConfig = new AutoTileConfig(); - _dungeonTile = new DungeonTile(_world.TileRoot); - _dungeonTile.AutoFillRoomTile(_autoTileConfig, _dungeonGenerator.StartRoom, _dungeonGenerator.Random); + _dungeonTileMap = new DungeonTileMap(_world.TileRoot); + _dungeonTileMap.AutoFillRoomTile(_autoTileConfig, _dungeonGenerator.StartRoom, _dungeonGenerator.Random); yield return 0; //生成寻路网格, 这一步操作只生成过道的导航 - _dungeonTile.GenerateNavigationPolygon(GameConfig.AisleFloorMapLayer); + _dungeonTileMap.GenerateNavigationPolygon(GameConfig.AisleFloorMapLayer); yield return 0; //挂载过道导航区域 - _dungeonTile.MountNavigationPolygon(_world.TileRoot); + _dungeonTileMap.MountNavigationPolygon(_world.TileRoot); yield return 0; //过道导航区域数据 _roomStaticNavigationList = new List(); - _roomStaticNavigationList.AddRange(_dungeonTile.GetPolygonData()); + _roomStaticNavigationList.AddRange(_dungeonTileMap.GetPolygonData()); yield return 0; //门导航区域数据 - _roomStaticNavigationList.AddRange(_dungeonTile.GetConnectDoorPolygonData()); + _roomStaticNavigationList.AddRange(_dungeonTileMap.GetConnectDoorPolygonData()); yield return new WaitForFixedProcess(10); //初始化所有房间 _dungeonGenerator.EachRoom(InitRoom); @@ -185,7 +185,7 @@ yield return 0; _dungeonGenerator.EachRoom(DisposeRoomInfo); yield return 0; - _dungeonTile = null; + _dungeonTileMap = null; _autoTileConfig = null; _dungeonGenerator = null; _roomStaticNavigationList.Clear(); @@ -496,7 +496,7 @@ { if (GameApplication.Instance.Debug) { - if (_dungeonTile != null) + if (_dungeonTileMap != null) { //绘制ai寻路区域 Utils.DrawNavigationPolygon(this, _roomStaticNavigationList.ToArray()); diff --git a/DungeonShooting_Godot/src/game/ui/mapEditor/TileView/EditorTileMap.cs b/DungeonShooting_Godot/src/game/ui/mapEditor/TileView/EditorTileMap.cs index 8291f94..f42c4e7 100644 --- a/DungeonShooting_Godot/src/game/ui/mapEditor/TileView/EditorTileMap.cs +++ b/DungeonShooting_Godot/src/game/ui/mapEditor/TileView/EditorTileMap.cs @@ -1,4 +1,8 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text.Json; using Godot; using Godot.Collections; @@ -58,7 +62,7 @@ //负责存储自动图块数据 private Grid _autoCellLayerGrid = new Grid(); //用于生成导航网格 - private DungeonTile _dungeonTile; + private DungeonTileMap _dungeonTileMap; //停止绘制多久后开始执行生成操作 private float _generateInterval = 3f; //生成自动图块和导航网格的计时器 @@ -74,7 +78,6 @@ private int _sourceId = 0; private int _terrainSet = 0; private int _terrain = 0; - private Vector2I _floorAtlasCoords = new Vector2I(0, 8); private AutoTileConfig _autoTileConfig = new AutoTileConfig(); //------------------------------- @@ -92,8 +95,8 @@ AddLayer(CustomTopLayer); SetLayerZIndex(CustomTopLayer, CustomTopLayer); - _dungeonTile = new DungeonTile(this); - _dungeonTile.SetFloorAtlasCoords(new List(new []{ _floorAtlasCoords })); + _dungeonTileMap = new DungeonTileMap(this); + _dungeonTileMap.SetFloorAtlasCoords(new List(new []{ _autoTileConfig.Floor.AutoTileCoord })); } public override void _Process(double delta) @@ -181,10 +184,10 @@ if (_checkTerrainFlag) //已经通过地形检测 { //绘制导航网格 - var result = _dungeonTile.GetGenerateNavigationResult(); + var result = _dungeonTileMap.GetGenerateNavigationResult(); if (result != null && result.Success) { - var polygonData = _dungeonTile.GetPolygonData(); + var polygonData = _dungeonTileMap.GetPolygonData(); Utils.DrawNavigationPolygon(canvasItem, polygonData, 1); } } @@ -206,11 +209,11 @@ } var pos = cellPos * size; - canvasItem.DrawRect(new Rect2(pos, _mousePosition - pos + temp), Colors.Wheat, false); + canvasItem.DrawRect(new Rect2(pos, _mousePosition - pos + temp), Colors.White, false, 2f / Scale.X); } else //绘制单格 { - canvasItem.DrawRect(new Rect2(_mousePosition, TileSet.TileSize), Colors.Wheat, false); + canvasItem.DrawRect(new Rect2(_mousePosition, TileSet.TileSize), Colors.White, false, 2f / Scale.X); } } @@ -273,6 +276,56 @@ } } } + else if (@event is InputEventKey eventKey) + { + if (eventKey.Pressed && eventKey.Keycode == Key.M) + { + GD.Print("测试保存地牢房间数据..."); + var tileInfo = new DungeonTileInfo(); + tileInfo.NavigationList = _dungeonTileMap.GetPolygonData().ToList(); + tileInfo.Floor = new List(); + tileInfo.Middle = new List(); + tileInfo.Top = new List(); + + var floor = GetUsedCellsById(AutoFloorLayer, _sourceId); + foreach (var pos in floor) + { + var atlasCoords = GetCellAtlasCoords(AutoFloorLayer, pos); + tileInfo.Floor.Add(pos.X); + tileInfo.Floor.Add(pos.Y); + tileInfo.Floor.Add(_sourceId); + tileInfo.Floor.Add(atlasCoords.X); + tileInfo.Floor.Add(atlasCoords.Y); + } + + var middle = GetUsedCellsById(AutoMiddleLayer, _sourceId); + foreach (var pos in middle) + { + var atlasCoords = GetCellAtlasCoords(AutoMiddleLayer, pos); + tileInfo.Middle.Add(pos.X); + tileInfo.Middle.Add(pos.Y); + tileInfo.Middle.Add(_sourceId); + tileInfo.Middle.Add(atlasCoords.X); + tileInfo.Middle.Add(atlasCoords.Y); + } + + var top = GetUsedCellsById(AutoTopLayer, _sourceId); + foreach (var pos in top) + { + var atlasCoords = GetCellAtlasCoords(AutoTopLayer, pos); + tileInfo.Top.Add(pos.X); + tileInfo.Top.Add(pos.Y); + tileInfo.Top.Add(_sourceId); + tileInfo.Top.Add(atlasCoords.X); + tileInfo.Top.Add(atlasCoords.Y); + } + + // var config = new JsonSerializerOptions(); + // config.WriteIndented = true; + var jsonStr = JsonSerializer.Serialize(tileInfo); + File.WriteAllText("D:\\test.json", jsonStr); + } + } } //缩小 @@ -310,7 +363,7 @@ //绘制单个自动贴图 private void SetSingleAutoCell(Vector2I position) { - SetCell(GetFloorLayer(), position, _sourceId, _floorAtlasCoords); + SetCell(GetFloorLayer(), position, _sourceId, _autoTileConfig.Floor.AutoTileCoord); if (!_autoCellLayerGrid.Contains(position.X, position.Y)) { ResetGenerateTimer(); @@ -342,7 +395,7 @@ { for (var j = 0; j < height; j++) { - SetCell(GetFloorLayer(), new Vector2I(start.X + i, start.Y + j), _sourceId, _floorAtlasCoords); + SetCell(GetFloorLayer(), new Vector2I(start.X + i, start.Y + j), _sourceId, _autoTileConfig.Floor.AutoTileCoord); } } @@ -498,8 +551,8 @@ //生成导航网格 private bool GenerateNavigation() { - _dungeonTile.GenerateNavigationPolygon(AutoFloorLayer); - var result = _dungeonTile.GetGenerateNavigationResult(); + _dungeonTileMap.GenerateNavigationPolygon(AutoFloorLayer); + var result = _dungeonTileMap.GetGenerateNavigationResult(); if (result.Success) { CloseErrorCell();