diff --git a/DungeonShooting_Godot/addons/dungeonShooting_plugin/Plugin.cs b/DungeonShooting_Godot/addons/dungeonShooting_plugin/Plugin.cs index f78f577..a5f7853 100644 --- a/DungeonShooting_Godot/addons/dungeonShooting_plugin/Plugin.cs +++ b/DungeonShooting_Godot/addons/dungeonShooting_plugin/Plugin.cs @@ -42,18 +42,18 @@ //自定义节点 private CustomTypeInfo[] _customTypeInfos = new CustomTypeInfo[] { - new CustomTypeInfo( - "ActivityMark", - "Node2D", - "res://src/framework/map/mark/ActivityMark.cs", - "res://addons/dungeonShooting_plugin/Mark.svg" - ), - new CustomTypeInfo( - "EnemyMark", - "Node2D", - "res://src/framework/map/mark/EnemyMark.cs", - "res://addons/dungeonShooting_plugin/Mark.svg" - ), + // new CustomTypeInfo( + // "ActivityMark", + // "Node2D", + // "res://src/framework/map/mark/ActivityMark.cs", + // "res://addons/dungeonShooting_plugin/Mark.svg" + // ), + // new CustomTypeInfo( + // "EnemyMark", + // "Node2D", + // "res://src/framework/map/mark/EnemyMark.cs", + // "res://addons/dungeonShooting_plugin/Mark.svg" + // ), }; public override void _Process(double delta) diff --git a/DungeonShooting_Godot/prefab/ui/Main.tscn b/DungeonShooting_Godot/prefab/ui/Main.tscn index 3138727..6bae01b 100644 --- a/DungeonShooting_Godot/prefab/ui/Main.tscn +++ b/DungeonShooting_Godot/prefab/ui/Main.tscn @@ -12,6 +12,15 @@ grow_vertical = 2 script = ExtResource("1_s44xr") +[node name="ColorRect" type="ColorRect" parent="."] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +color = Color(0.109804, 0.0666667, 0.0901961, 1) + [node name="Title" type="Label" parent="."] layout_mode = 1 anchors_preset = 10 diff --git a/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/battle/Battle3/Preview.png b/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/battle/Battle3/Preview.png index 95d5f00..d6290c0 100644 --- a/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/battle/Battle3/Preview.png +++ b/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/battle/Battle3/Preview.png Binary files differ diff --git a/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/battle/Battle3/TileInfo.json b/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/battle/Battle3/TileInfo.json index 6e7dcaa..c0ec3fa 100644 --- a/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/battle/Battle3/TileInfo.json +++ b/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/battle/Battle3/TileInfo.json @@ -1 +1 @@ -{"NavigationList":[{"Type":0,"Points":[184,120,376,120,376,152,440,152,440,216,520,216,520,384,456,384,456,464,312,464,312,480,184,480]},{"Type":1,"Points":[264,240,392,240,392,272,424,272,424,344,408,344,408,392,360,392,360,312,312,312,312,328,296,328,296,392,248,392,248,256,264,256]}],"Floor":[32,23,0,0,8,32,22,0,0,8,32,21,0,0,8,32,20,0,0,8,32,19,0,0,8,32,18,0,0,8,32,17,0,0,8,32,16,0,0,8,32,15,0,0,8,32,14,0,0,8,32,13,0,0,8,31,23,0,0,8,31,22,0,0,8,31,21,0,0,8,31,20,0,0,8,31,19,0,0,8,31,18,0,0,8,31,17,0,0,8,31,16,0,0,8,31,15,0,0,8,31,14,0,0,8,31,13,0,0,8,30,23,0,0,8,30,22,0,0,8,30,21,0,0,8,30,20,0,0,8,30,19,0,0,8,30,18,0,0,8,30,17,0,0,8,30,16,0,0,8,30,15,0,0,8,30,14,0,0,8,30,13,0,0,8,29,23,0,0,8,29,22,0,0,8,29,21,0,0,8,29,20,0,0,8,29,19,0,0,8,29,18,0,0,8,29,17,0,0,8,29,16,0,0,8,29,15,0,0,8,29,14,0,0,8,29,13,0,0,8,28,28,0,0,8,28,27,0,0,8,28,26,0,0,8,28,25,0,0,8,28,24,0,0,8,28,23,0,0,8,28,22,0,0,8,28,21,0,0,8,28,20,0,0,8,28,19,0,0,8,28,18,0,0,8,28,17,0,0,8,28,16,0,0,8,28,15,0,0,8,28,14,0,0,8,28,13,0,0,8,27,28,0,0,8,27,27,0,0,8,27,26,0,0,8,27,25,0,0,8,27,24,0,0,8,27,23,0,0,8,27,22,0,0,8,27,21,0,0,8,27,20,0,0,8,27,19,0,0,8,27,18,0,0,8,27,17,0,0,8,27,16,0,0,8,27,15,0,0,8,27,14,0,0,8,27,13,0,0,8,27,9,0,0,8,27,10,0,0,8,27,11,0,0,8,27,12,0,0,8,26,28,0,0,8,26,27,0,0,8,26,26,0,0,8,26,25,0,0,8,26,24,0,0,8,26,23,0,0,8,26,22,0,0,8,26,21,0,0,8,26,20,0,0,8,26,19,0,0,8,26,18,0,0,8,26,17,0,0,8,26,16,0,0,8,26,15,0,0,8,26,14,0,0,8,26,13,0,0,8,26,9,0,0,8,26,10,0,0,8,26,11,0,0,8,26,12,0,0,8,25,28,0,0,8,25,27,0,0,8,25,26,0,0,8,25,25,0,0,8,25,24,0,0,8,25,23,0,0,8,25,22,0,0,8,25,21,0,0,8,25,16,0,0,8,25,15,0,0,8,25,14,0,0,8,25,13,0,0,8,25,9,0,0,8,25,10,0,0,8,25,11,0,0,8,25,12,0,0,8,24,28,0,0,8,24,27,0,0,8,24,26,0,0,8,24,25,0,0,8,24,24,0,0,8,24,16,0,0,8,24,15,0,0,8,24,14,0,0,8,24,13,0,0,8,24,9,0,0,8,24,10,0,0,8,24,11,0,0,8,24,12,0,0,8,23,28,0,0,8,23,27,0,0,8,23,26,0,0,8,23,25,0,0,8,23,24,0,0,8,23,14,0,0,8,23,13,0,0,8,23,7,0,0,8,23,8,0,0,8,23,9,0,0,8,23,10,0,0,8,23,11,0,0,8,23,12,0,0,8,22,28,0,0,8,22,27,0,0,8,22,26,0,0,8,22,25,0,0,8,22,24,0,0,8,22,23,0,0,8,22,22,0,0,8,22,21,0,0,8,22,20,0,0,8,22,19,0,0,8,22,7,0,0,8,22,8,0,0,8,22,9,0,0,8,22,10,0,0,8,22,11,0,0,8,22,12,0,0,8,22,13,0,0,8,22,14,0,0,8,21,28,0,0,8,21,27,0,0,8,21,26,0,0,8,21,25,0,0,8,21,24,0,0,8,21,23,0,0,8,21,22,0,0,8,21,21,0,0,8,21,20,0,0,8,21,19,0,0,8,21,7,0,0,8,21,8,0,0,8,21,9,0,0,8,21,10,0,0,8,21,11,0,0,8,21,12,0,0,8,21,13,0,0,8,21,14,0,0,8,20,28,0,0,8,20,27,0,0,8,20,26,0,0,8,20,25,0,0,8,20,24,0,0,8,20,23,0,0,8,20,22,0,0,8,20,21,0,0,8,20,20,0,0,8,20,19,0,0,8,20,7,0,0,8,20,8,0,0,8,20,9,0,0,8,20,10,0,0,8,20,11,0,0,8,20,12,0,0,8,20,13,0,0,8,20,14,0,0,8,19,29,0,0,8,19,28,0,0,8,19,27,0,0,8,19,26,0,0,8,19,25,0,0,8,19,24,0,0,8,19,23,0,0,8,19,22,0,0,8,19,21,0,0,8,19,20,0,0,8,19,19,0,0,8,19,7,0,0,8,19,8,0,0,8,19,9,0,0,8,19,10,0,0,8,19,11,0,0,8,19,12,0,0,8,19,13,0,0,8,19,14,0,0,8,18,29,0,0,8,18,28,0,0,8,18,27,0,0,8,18,26,0,0,8,18,25,0,0,8,18,24,0,0,8,18,23,0,0,8,18,22,0,0,8,18,21,0,0,8,18,20,0,0,8,18,7,0,0,8,18,8,0,0,8,18,9,0,0,8,18,10,0,0,8,18,11,0,0,8,18,12,0,0,8,18,13,0,0,8,18,14,0,0,8,17,29,0,0,8,17,28,0,0,8,17,27,0,0,8,17,26,0,0,8,17,25,0,0,8,17,24,0,0,8,17,7,0,0,8,17,8,0,0,8,17,9,0,0,8,17,10,0,0,8,17,11,0,0,8,17,12,0,0,8,17,13,0,0,8,17,14,0,0,8,16,29,0,0,8,16,28,0,0,8,16,27,0,0,8,16,26,0,0,8,16,25,0,0,8,16,24,0,0,8,16,7,0,0,8,16,8,0,0,8,16,9,0,0,8,16,10,0,0,8,16,11,0,0,8,16,12,0,0,8,16,13,0,0,8,16,14,0,0,8,16,15,0,0,8,15,29,0,0,8,15,28,0,0,8,15,27,0,0,8,15,26,0,0,8,15,25,0,0,8,15,24,0,0,8,15,23,0,0,8,15,22,0,0,8,15,21,0,0,8,15,20,0,0,8,15,7,0,0,8,15,8,0,0,8,15,9,0,0,8,15,10,0,0,8,15,11,0,0,8,15,12,0,0,8,15,13,0,0,8,15,14,0,0,8,15,15,0,0,8,15,16,0,0,8,15,17,0,0,8,15,18,0,0,8,15,19,0,0,8,14,29,0,0,8,14,28,0,0,8,14,27,0,0,8,14,26,0,0,8,14,25,0,0,8,14,24,0,0,8,14,23,0,0,8,14,22,0,0,8,14,21,0,0,8,14,20,0,0,8,14,7,0,0,8,14,8,0,0,8,14,9,0,0,8,14,10,0,0,8,14,11,0,0,8,14,12,0,0,8,14,13,0,0,8,14,14,0,0,8,14,15,0,0,8,14,16,0,0,8,14,17,0,0,8,14,18,0,0,8,14,19,0,0,8,13,29,0,0,8,13,28,0,0,8,13,27,0,0,8,13,26,0,0,8,13,25,0,0,8,13,24,0,0,8,13,23,0,0,8,13,22,0,0,8,13,21,0,0,8,13,20,0,0,8,13,7,0,0,8,13,8,0,0,8,13,9,0,0,8,13,10,0,0,8,13,11,0,0,8,13,12,0,0,8,13,13,0,0,8,13,14,0,0,8,13,15,0,0,8,13,16,0,0,8,13,17,0,0,8,13,18,0,0,8,13,19,0,0,8,12,29,0,0,8,12,28,0,0,8,12,27,0,0,8,12,26,0,0,8,12,25,0,0,8,12,24,0,0,8,12,23,0,0,8,12,22,0,0,8,12,21,0,0,8,12,20,0,0,8,12,7,0,0,8,12,8,0,0,8,12,9,0,0,8,12,10,0,0,8,12,11,0,0,8,12,12,0,0,8,12,13,0,0,8,12,14,0,0,8,12,15,0,0,8,12,16,0,0,8,12,17,0,0,8,12,18,0,0,8,12,19,0,0,8,11,29,0,0,8,11,28,0,0,8,11,27,0,0,8,11,26,0,0,8,11,25,0,0,8,11,24,0,0,8,11,23,0,0,8,11,22,0,0,8,11,21,0,0,8,11,20,0,0,8,11,7,0,0,8,11,8,0,0,8,11,9,0,0,8,11,10,0,0,8,11,11,0,0,8,11,12,0,0,8,11,13,0,0,8,11,14,0,0,8,11,15,0,0,8,11,16,0,0,8,11,17,0,0,8,11,18,0,0,8,11,19,0,0,8],"Middle":[11,6,0,2,7,12,6,0,2,7,13,6,0,2,7,14,6,0,2,7,15,6,0,2,7,16,6,0,2,7,16,23,0,1,7,17,6,0,2,7,17,23,0,3,7,18,6,0,2,7,18,19,0,3,7,19,6,0,2,7,19,18,0,2,7,20,6,0,2,7,20,18,0,2,7,21,6,0,2,7,21,18,0,2,7,22,6,0,2,7,22,18,0,2,7,23,6,0,2,7,23,23,0,1,7,24,8,0,1,7,24,23,0,3,7,25,8,0,2,7,25,20,0,3,7,26,8,0,2,7,27,8,0,2,7,28,12,0,1,7,29,12,0,2,7,30,12,0,2,7,31,12,0,2,7,32,12,0,2,7],"Top":[10,6,0,3,4,10,7,0,3,3,10,8,0,3,3,10,9,0,3,3,10,10,0,3,3,10,11,0,3,3,10,12,0,3,3,10,13,0,3,3,10,14,0,3,3,10,15,0,3,3,10,16,0,3,3,10,17,0,3,3,10,18,0,3,3,10,19,0,3,3,10,20,0,3,3,10,21,0,3,3,10,22,0,3,3,10,23,0,3,3,10,24,0,3,3,10,25,0,3,3,10,26,0,3,3,10,27,0,3,3,10,28,0,3,3,10,29,0,3,3,10,30,0,11,2,11,30,0,2,2,12,30,0,2,2,13,30,0,2,2,14,30,0,2,2,15,30,0,2,2,16,16,0,1,2,16,17,0,1,3,16,18,0,1,3,16,19,0,1,3,16,20,0,1,3,16,21,0,1,3,16,22,0,1,3,16,30,0,2,2,17,15,0,1,2,17,16,0,13,2,17,19,0,3,4,17,20,0,3,3,17,21,0,3,3,17,22,0,3,3,17,30,0,2,2,18,15,0,2,2,18,18,0,3,4,18,30,0,2,2,19,15,0,2,2,19,30,0,2,2,20,15,0,2,2,20,29,0,1,2,20,30,0,13,2,21,15,0,2,2,21,29,0,2,2,22,15,0,2,2,22,29,0,2,2,23,15,0,3,2,23,16,0,3,3,23,17,0,11,2,23,18,0,1,4,23,19,0,1,3,23,20,0,1,3,23,21,0,1,3,23,22,0,1,3,23,29,0,2,2,24,6,0,1,4,24,7,0,1,3,24,17,0,2,2,24,20,0,3,4,24,21,0,3,3,24,22,0,3,3,24,29,0,2,2,25,17,0,3,2,25,18,0,3,3,25,19,0,3,3,25,29,0,2,2,26,29,0,2,2,27,29,0,2,2,28,8,0,1,4,28,9,0,1,3,28,10,0,1,3,28,11,0,1,3,28,29,0,2,2,29,24,0,1,2,29,25,0,1,3,29,26,0,1,3,29,27,0,1,3,29,28,0,1,3,29,29,0,13,2,30,24,0,2,2,31,24,0,2,2,32,24,0,2,2,33,12,0,1,4,33,13,0,1,3,33,14,0,1,3,33,15,0,1,3,33,16,0,1,3,33,17,0,1,3,33,18,0,1,3,33,19,0,1,3,33,20,0,1,3,33,21,0,1,3,33,22,0,1,3,33,23,0,1,3,33,24,0,13,2]} \ No newline at end of file +{"NavigationList":[{"Type":0,"Points":[184,120,376,120,376,152,440,152,440,216,520,216,520,384,456,384,456,464,312,464,312,480,184,480]},{"Type":1,"Points":[264,240,392,240,392,256,408,256,408,272,424,272,424,344,408,344,408,392,360,392,360,328,296,328,296,312,280,312,280,392,232,392,232,272,248,272,248,256,264,256]}],"Floor":[32,23,0,0,8,32,22,0,0,8,32,21,0,0,8,32,20,0,0,8,32,19,0,0,8,32,18,0,0,8,32,17,0,0,8,32,16,0,0,8,32,15,0,0,8,32,14,0,0,8,32,13,0,0,8,31,23,0,0,8,31,22,0,0,8,31,21,0,0,8,31,20,0,0,8,31,19,0,0,8,31,18,0,0,8,31,17,0,0,8,31,16,0,0,8,31,15,0,0,8,31,14,0,0,8,31,13,0,0,8,30,23,0,0,8,30,22,0,0,8,30,21,0,0,8,30,20,0,0,8,30,19,0,0,8,30,18,0,0,8,30,17,0,0,8,30,16,0,0,8,30,15,0,0,8,30,14,0,0,8,30,13,0,0,8,29,23,0,0,8,29,22,0,0,8,29,21,0,0,8,29,20,0,0,8,29,19,0,0,8,29,18,0,0,8,29,17,0,0,8,29,16,0,0,8,29,15,0,0,8,29,14,0,0,8,29,13,0,0,8,28,28,0,0,8,28,27,0,0,8,28,26,0,0,8,28,25,0,0,8,28,24,0,0,8,28,23,0,0,8,28,22,0,0,8,28,21,0,0,8,28,20,0,0,8,28,19,0,0,8,28,18,0,0,8,28,17,0,0,8,28,16,0,0,8,28,15,0,0,8,28,14,0,0,8,28,13,0,0,8,27,28,0,0,8,27,27,0,0,8,27,26,0,0,8,27,25,0,0,8,27,24,0,0,8,27,23,0,0,8,27,22,0,0,8,27,21,0,0,8,27,20,0,0,8,27,19,0,0,8,27,18,0,0,8,27,17,0,0,8,27,16,0,0,8,27,15,0,0,8,27,14,0,0,8,27,13,0,0,8,27,9,0,0,8,27,10,0,0,8,27,11,0,0,8,27,12,0,0,8,26,28,0,0,8,26,27,0,0,8,26,26,0,0,8,26,25,0,0,8,26,24,0,0,8,26,23,0,0,8,26,22,0,0,8,26,21,0,0,8,26,20,0,0,8,26,19,0,0,8,26,18,0,0,8,26,17,0,0,8,26,16,0,0,8,26,15,0,0,8,26,14,0,0,8,26,13,0,0,8,26,9,0,0,8,26,10,0,0,8,26,11,0,0,8,26,12,0,0,8,25,28,0,0,8,25,27,0,0,8,25,26,0,0,8,25,25,0,0,8,25,24,0,0,8,25,23,0,0,8,25,22,0,0,8,25,21,0,0,8,25,16,0,0,8,25,15,0,0,8,25,14,0,0,8,25,13,0,0,8,25,9,0,0,8,25,10,0,0,8,25,11,0,0,8,25,12,0,0,8,24,28,0,0,8,24,27,0,0,8,24,26,0,0,8,24,25,0,0,8,24,24,0,0,8,24,15,0,0,8,24,14,0,0,8,24,13,0,0,8,24,9,0,0,8,24,10,0,0,8,24,11,0,0,8,24,12,0,0,8,23,28,0,0,8,23,27,0,0,8,23,26,0,0,8,23,25,0,0,8,23,24,0,0,8,23,14,0,0,8,23,13,0,0,8,23,7,0,0,8,23,8,0,0,8,23,9,0,0,8,23,10,0,0,8,23,11,0,0,8,23,12,0,0,8,22,28,0,0,8,22,27,0,0,8,22,26,0,0,8,22,25,0,0,8,22,24,0,0,8,22,23,0,0,8,22,22,0,0,8,22,21,0,0,8,22,20,0,0,8,22,7,0,0,8,22,8,0,0,8,22,9,0,0,8,22,10,0,0,8,22,11,0,0,8,22,12,0,0,8,22,13,0,0,8,22,14,0,0,8,21,28,0,0,8,21,27,0,0,8,21,26,0,0,8,21,25,0,0,8,21,24,0,0,8,21,23,0,0,8,21,22,0,0,8,21,21,0,0,8,21,20,0,0,8,21,7,0,0,8,21,8,0,0,8,21,9,0,0,8,21,10,0,0,8,21,11,0,0,8,21,12,0,0,8,21,13,0,0,8,21,14,0,0,8,20,28,0,0,8,20,27,0,0,8,20,26,0,0,8,20,25,0,0,8,20,24,0,0,8,20,23,0,0,8,20,22,0,0,8,20,21,0,0,8,20,20,0,0,8,20,7,0,0,8,20,8,0,0,8,20,9,0,0,8,20,10,0,0,8,20,11,0,0,8,20,12,0,0,8,20,13,0,0,8,20,14,0,0,8,19,29,0,0,8,19,28,0,0,8,19,27,0,0,8,19,26,0,0,8,19,25,0,0,8,19,24,0,0,8,19,23,0,0,8,19,22,0,0,8,19,21,0,0,8,19,20,0,0,8,19,7,0,0,8,19,8,0,0,8,19,9,0,0,8,19,10,0,0,8,19,11,0,0,8,19,12,0,0,8,19,13,0,0,8,19,14,0,0,8,18,19,0,0,8,18,29,0,0,8,18,28,0,0,8,18,27,0,0,8,18,26,0,0,8,18,25,0,0,8,18,24,0,0,8,18,23,0,0,8,18,22,0,0,8,18,21,0,0,8,18,20,0,0,8,18,7,0,0,8,18,8,0,0,8,18,9,0,0,8,18,10,0,0,8,18,11,0,0,8,18,12,0,0,8,18,13,0,0,8,18,14,0,0,8,17,19,0,0,8,17,23,0,0,8,17,22,0,0,8,17,21,0,0,8,17,20,0,0,8,17,29,0,0,8,17,28,0,0,8,17,27,0,0,8,17,26,0,0,8,17,25,0,0,8,17,24,0,0,8,17,7,0,0,8,17,8,0,0,8,17,9,0,0,8,17,10,0,0,8,17,11,0,0,8,17,12,0,0,8,17,13,0,0,8,17,14,0,0,8,16,29,0,0,8,16,28,0,0,8,16,27,0,0,8,16,26,0,0,8,16,25,0,0,8,16,24,0,0,8,16,7,0,0,8,16,8,0,0,8,16,9,0,0,8,16,10,0,0,8,16,11,0,0,8,16,12,0,0,8,16,13,0,0,8,16,14,0,0,8,16,15,0,0,8,15,29,0,0,8,15,28,0,0,8,15,27,0,0,8,15,26,0,0,8,15,25,0,0,8,15,24,0,0,8,15,7,0,0,8,15,8,0,0,8,15,9,0,0,8,15,10,0,0,8,15,11,0,0,8,15,12,0,0,8,15,13,0,0,8,15,14,0,0,8,15,15,0,0,8,15,16,0,0,8,14,29,0,0,8,14,28,0,0,8,14,27,0,0,8,14,26,0,0,8,14,25,0,0,8,14,24,0,0,8,14,23,0,0,8,14,22,0,0,8,14,21,0,0,8,14,20,0,0,8,14,7,0,0,8,14,8,0,0,8,14,9,0,0,8,14,10,0,0,8,14,11,0,0,8,14,12,0,0,8,14,13,0,0,8,14,14,0,0,8,14,15,0,0,8,14,16,0,0,8,14,17,0,0,8,14,18,0,0,8,14,19,0,0,8,13,29,0,0,8,13,28,0,0,8,13,27,0,0,8,13,26,0,0,8,13,25,0,0,8,13,24,0,0,8,13,23,0,0,8,13,22,0,0,8,13,21,0,0,8,13,20,0,0,8,13,7,0,0,8,13,8,0,0,8,13,9,0,0,8,13,10,0,0,8,13,11,0,0,8,13,12,0,0,8,13,13,0,0,8,13,14,0,0,8,13,15,0,0,8,13,16,0,0,8,13,17,0,0,8,13,18,0,0,8,13,19,0,0,8,12,29,0,0,8,12,28,0,0,8,12,27,0,0,8,12,26,0,0,8,12,25,0,0,8,12,24,0,0,8,12,23,0,0,8,12,22,0,0,8,12,21,0,0,8,12,20,0,0,8,12,7,0,0,8,12,8,0,0,8,12,9,0,0,8,12,10,0,0,8,12,11,0,0,8,12,12,0,0,8,12,13,0,0,8,12,14,0,0,8,12,15,0,0,8,12,16,0,0,8,12,17,0,0,8,12,18,0,0,8,12,19,0,0,8,11,29,0,0,8,11,28,0,0,8,11,27,0,0,8,11,26,0,0,8,11,25,0,0,8,11,24,0,0,8,11,23,0,0,8,11,22,0,0,8,11,21,0,0,8,11,20,0,0,8,11,7,0,0,8,11,8,0,0,8,11,9,0,0,8,11,10,0,0,8,11,11,0,0,8,11,12,0,0,8,11,13,0,0,8,11,14,0,0,8,11,15,0,0,8,11,16,0,0,8,11,17,0,0,8,11,18,0,0,8,11,19,0,0,8],"Middle":[11,6,0,2,7,12,6,0,2,7,13,6,0,2,7,14,6,0,2,7,15,6,0,2,7,15,23,0,1,7,16,6,0,2,7,16,23,0,3,7,17,6,0,2,7,17,18,0,2,7,18,6,0,2,7,18,18,0,2,7,19,6,0,2,7,19,19,0,1,7,20,6,0,2,7,20,19,0,2,7,21,6,0,2,7,21,19,0,2,7,22,6,0,2,7,22,19,0,2,7,23,6,0,2,7,23,23,0,1,7,24,8,0,1,7,24,23,0,3,7,25,8,0,2,7,25,20,0,3,7,26,8,0,2,7,27,8,0,2,7,28,12,0,1,7,29,12,0,2,7,30,12,0,2,7,31,12,0,2,7,32,12,0,2,7],"Top":[10,6,0,3,4,10,7,0,3,3,10,8,0,3,3,10,9,0,3,3,10,10,0,3,3,10,11,0,3,3,10,12,0,3,3,10,13,0,3,3,10,14,0,3,3,10,15,0,3,3,10,16,0,3,3,10,17,0,3,3,10,18,0,3,3,10,19,0,3,3,10,20,0,3,3,10,21,0,3,3,10,22,0,3,3,10,23,0,3,3,10,24,0,3,3,10,25,0,3,3,10,26,0,3,3,10,27,0,3,3,10,28,0,3,3,10,29,0,3,3,10,30,0,11,2,11,30,0,2,2,12,30,0,2,2,13,30,0,2,2,14,30,0,2,2,15,17,0,1,2,15,18,0,1,3,15,19,0,1,3,15,20,0,1,3,15,21,0,1,3,15,22,0,1,3,15,30,0,2,2,16,16,0,1,2,16,17,0,13,2,16,18,0,3,4,16,19,0,3,3,16,20,0,3,3,16,21,0,3,3,16,22,0,3,3,16,30,0,2,2,17,15,0,1,2,17,16,0,13,2,17,30,0,2,2,18,15,0,2,2,18,30,0,2,2,19,15,0,2,2,19,18,0,1,4,19,30,0,2,2,20,15,0,2,2,20,29,0,1,2,20,30,0,13,2,21,15,0,2,2,21,29,0,2,2,22,15,0,2,2,22,29,0,2,2,23,15,0,3,2,23,16,0,11,2,23,19,0,1,4,23,20,0,1,3,23,21,0,1,3,23,22,0,1,3,23,29,0,2,2,24,6,0,1,4,24,7,0,1,3,24,16,0,3,2,24,17,0,11,2,24,20,0,3,4,24,21,0,3,3,24,22,0,3,3,24,29,0,2,2,25,17,0,3,2,25,18,0,3,3,25,19,0,3,3,25,29,0,2,2,26,29,0,2,2,27,29,0,2,2,28,8,0,1,4,28,9,0,1,3,28,10,0,1,3,28,11,0,1,3,28,29,0,2,2,29,24,0,1,2,29,25,0,1,3,29,26,0,1,3,29,27,0,1,3,29,28,0,1,3,29,29,0,13,2,30,24,0,2,2,31,24,0,2,2,32,24,0,2,2,33,12,0,1,4,33,13,0,1,3,33,14,0,1,3,33,15,0,1,3,33,16,0,1,3,33,17,0,1,3,33,18,0,1,3,33,19,0,1,3,33,20,0,1,3,33,21,0,1,3,33,22,0,1,3,33,23,0,1,3,33,24,0,13,2]} \ No newline at end of file diff --git a/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/inlet/Start1/Preinstall.json b/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/inlet/Start1/Preinstall.json index 30d1488..fd75129 100644 --- a/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/inlet/Start1/Preinstall.json +++ b/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/inlet/Start1/Preinstall.json @@ -1 +1 @@ -[{"Name":"test1","Weight":100,"Remark":"","WaveList":[[{"Position":{"X":19,"Y":2},"Size":{"X":0,"Y":0},"SpecialMarkType":1,"DelayTime":0,"MarkList":[]},{"Position":{"X":-38,"Y":41},"Size":{"X":0,"Y":0},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"weapon0001","Weight":100,"Attr":{"CurrAmmon":"30","ResidueAmmo":"210"},"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":-38,"Y":55},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"weapon0002","Weight":100,"Attr":{"CurrAmmon":"7","ResidueAmmo":"70"},"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":-38,"Y":11},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"weapon0004","Weight":100,"Attr":{"CurrAmmon":"180","ResidueAmmo":"90"},"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":-39,"Y":69},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"weapon0005","Weight":100,"Attr":{"CurrAmmon":"10","ResidueAmmo":"40"},"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":-38,"Y":-8},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"weapon0003","Weight":100,"Attr":{"CurrAmmon":"12","ResidueAmmo":"90"},"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":-38,"Y":27},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"weapon0006","Weight":100,"Attr":{"CurrAmmon":"20","ResidueAmmo":"300"},"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":-38,"Y":-28},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"weapon0007","Weight":100,"Attr":{"CurrAmmon":"60","ResidueAmmo":"300"},"Altitude":8,"VerticalSpeed":0}]}],[{"Position":{"X":55,"Y":67},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"prop0003","Weight":100,"Attr":null,"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":56,"Y":24},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0.5,"MarkList":[{"Id":"prop5000","Weight":100,"Attr":null,"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":56,"Y":0},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":1,"MarkList":[{"Id":"prop5001","Weight":100,"Attr":null,"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":34,"Y":23},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":1.5,"MarkList":[{"Id":"prop0002","Weight":100,"Attr":null,"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":55,"Y":44},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"prop5001","Weight":100,"Attr":null,"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":56,"Y":-24},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"prop5001","Weight":100,"Attr":null,"Altitude":8,"VerticalSpeed":0}]}]]}] \ No newline at end of file +[{"Name":"test1","Weight":100,"Remark":"","WaveList":[[{"Position":{"X":19,"Y":2},"Size":{"X":0,"Y":0},"SpecialMarkType":1,"DelayTime":0,"MarkList":[]},{"Position":{"X":-76,"Y":35},"Size":{"X":0,"Y":0},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"weapon0001","Weight":100,"Attr":{"CurrAmmon":"30","ResidueAmmo":"210"},"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":-79,"Y":46},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"weapon0002","Weight":100,"Attr":{"CurrAmmon":"7","ResidueAmmo":"70"},"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":-75,"Y":2},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"weapon0004","Weight":100,"Attr":{"CurrAmmon":"180","ResidueAmmo":"90"},"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":-75,"Y":67},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"weapon0005","Weight":100,"Attr":{"CurrAmmon":"10","ResidueAmmo":"40"},"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":-73,"Y":-18},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"weapon0003","Weight":100,"Attr":{"CurrAmmon":"12","ResidueAmmo":"90"},"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":-76,"Y":21},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"weapon0006","Weight":100,"Attr":{"CurrAmmon":"20","ResidueAmmo":"300"},"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":-74,"Y":-30},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"weapon0007","Weight":100,"Attr":{"CurrAmmon":"60","ResidueAmmo":"300"},"Altitude":8,"VerticalSpeed":0}]}],[{"Position":{"X":55,"Y":67},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"prop0003","Weight":100,"Attr":null,"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":56,"Y":24},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0.5,"MarkList":[{"Id":"prop5000","Weight":100,"Attr":null,"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":56,"Y":0},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":1,"MarkList":[{"Id":"prop5001","Weight":100,"Attr":null,"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":34,"Y":23},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":1.5,"MarkList":[{"Id":"prop0002","Weight":100,"Attr":null,"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":55,"Y":44},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"prop5001","Weight":100,"Attr":null,"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":56,"Y":-24},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"prop5001","Weight":100,"Attr":null,"Altitude":8,"VerticalSpeed":0}]}]]}] \ No newline at end of file diff --git a/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/inlet/Start1/Preview.png b/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/inlet/Start1/Preview.png index 3f0900c..d64d95a 100644 --- a/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/inlet/Start1/Preview.png +++ b/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/inlet/Start1/Preview.png Binary files differ diff --git a/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/inlet/Start1/RoomInfo.json b/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/inlet/Start1/RoomInfo.json index 4285d01..6005b11 100644 --- a/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/inlet/Start1/RoomInfo.json +++ b/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/inlet/Start1/RoomInfo.json @@ -1 +1 @@ -{"Position":{"X":-5,"Y":-4},"Size":{"X":11,"Y":10},"DoorAreaInfos":[],"GroupName":"TestGroup1","RoomType":1,"RoomName":"Start1","Weight":100,"Remark":""} \ No newline at end of file +{"Position":{"X":-8,"Y":-4},"Size":{"X":15,"Y":10},"DoorAreaInfos":[{"Direction":3,"Start":0,"End":208},{"Direction":0,"Start":0,"End":128},{"Direction":2,"Start":128,"End":208},{"Direction":1,"Start":0,"End":128},{"Direction":2,"Start":0,"End":64}],"GroupName":"TestGroup1","RoomType":1,"RoomName":"Start1","Weight":100,"Remark":""} \ No newline at end of file diff --git a/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/inlet/Start1/TileInfo.json b/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/inlet/Start1/TileInfo.json index 22e1c00..68ed08e 100644 --- a/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/inlet/Start1/TileInfo.json +++ b/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/inlet/Start1/TileInfo.json @@ -1 +1 @@ -{"NavigationList":[{"Type":0,"Points":[-56,-40,72,-40,72,80,-56,80]}],"Floor":[-4,-3,0,0,8,-4,-2,0,0,8,-4,-1,0,0,8,-4,0,0,0,8,-4,1,0,0,8,-4,2,0,0,8,-4,3,0,0,8,-4,4,0,0,8,-3,-3,0,0,8,-3,-2,0,0,8,-3,-1,0,0,8,-3,0,0,0,8,-3,1,0,0,8,-3,2,0,0,8,-3,3,0,0,8,-3,4,0,0,8,-2,-3,0,0,8,-2,-2,0,0,8,-2,-1,0,0,8,-2,0,0,0,8,-2,1,0,0,8,-2,2,0,0,8,-2,3,0,0,8,-2,4,0,0,8,-1,-3,0,0,8,-1,-2,0,0,8,-1,-1,0,0,8,-1,0,0,0,8,-1,1,0,0,8,-1,2,0,0,8,-1,3,0,0,8,-1,4,0,0,8,0,-3,0,0,8,0,-2,0,0,8,0,-1,0,0,8,0,0,0,0,8,0,1,0,0,8,0,2,0,0,8,0,3,0,0,8,0,4,0,0,8,4,-3,0,0,8,4,-2,0,0,8,4,-1,0,0,8,4,0,0,0,8,4,1,0,0,8,4,2,0,0,8,4,3,0,0,8,4,4,0,0,8,3,-3,0,0,8,3,-2,0,0,8,3,-1,0,0,8,3,0,0,0,8,3,1,0,0,8,3,2,0,0,8,3,3,0,0,8,3,4,0,0,8,2,-3,0,0,8,2,-2,0,0,8,2,-1,0,0,8,2,0,0,0,8,2,1,0,0,8,2,2,0,0,8,2,3,0,0,8,2,4,0,0,8,1,-3,0,0,8,1,-2,0,0,8,1,-1,0,0,8,1,0,0,0,8,1,1,0,0,8,1,2,0,0,8,1,3,0,0,8,1,4,0,0,8],"Middle":[-4,-4,0,2,7,-3,-4,0,2,7,-2,-4,0,2,7,-1,-4,0,2,7,0,-4,0,2,7,1,-4,0,2,7,2,-4,0,2,7,3,-4,0,2,7,4,-4,0,2,7],"Top":[-5,-4,0,3,4,-5,-3,0,3,3,-5,-2,0,3,3,-5,-1,0,3,3,-5,0,0,3,3,-5,1,0,3,3,-5,2,0,3,3,-5,3,0,3,3,-5,4,0,3,3,-5,5,0,11,2,-4,5,0,2,2,-3,5,0,2,2,-2,5,0,2,2,-1,5,0,2,2,0,5,0,2,2,1,5,0,2,2,2,5,0,2,2,3,5,0,2,2,4,5,0,2,2,5,-4,0,1,4,5,-3,0,1,3,5,-2,0,1,3,5,-1,0,1,3,5,0,0,1,3,5,1,0,1,3,5,2,0,1,3,5,3,0,1,3,5,4,0,1,3,5,5,0,13,2]} \ No newline at end of file +{"NavigationList":[{"Type":0,"Points":[-104,-40,88,-40,88,80,24,80,24,48,-56,48,-56,80,-104,80]}],"Floor":[-7,-3,0,0,8,-7,-2,0,0,8,-7,-1,0,0,8,-7,0,0,0,8,-7,1,0,0,8,-7,2,0,0,8,-7,3,0,0,8,-7,4,0,0,8,-6,-3,0,0,8,-6,-2,0,0,8,-6,-1,0,0,8,-6,0,0,0,8,-6,1,0,0,8,-6,2,0,0,8,-6,3,0,0,8,-6,4,0,0,8,5,-1,0,0,8,5,0,0,0,8,5,1,0,0,8,5,2,0,0,8,5,3,0,0,8,5,4,0,0,8,5,-2,0,0,8,5,-3,0,0,8,-5,-3,0,0,8,-5,-2,0,0,8,-5,-1,0,0,8,-5,0,0,0,8,-5,1,0,0,8,-5,2,0,0,8,-5,3,0,0,8,-5,4,0,0,8,1,4,0,0,8,1,3,0,0,8,1,2,0,0,8,1,1,0,0,8,1,0,0,0,8,1,-1,0,0,8,1,-2,0,0,8,1,-3,0,0,8,2,4,0,0,8,2,3,0,0,8,2,2,0,0,8,2,1,0,0,8,2,0,0,0,8,2,-1,0,0,8,2,-2,0,0,8,2,-3,0,0,8,3,4,0,0,8,3,3,0,0,8,3,2,0,0,8,3,1,0,0,8,3,0,0,0,8,3,-1,0,0,8,3,-2,0,0,8,3,-3,0,0,8,4,4,0,0,8,4,3,0,0,8,4,2,0,0,8,4,1,0,0,8,4,0,0,0,8,4,-1,0,0,8,4,-2,0,0,8,4,-3,0,0,8,0,2,0,0,8,0,1,0,0,8,0,0,0,0,8,0,-1,0,0,8,0,-2,0,0,8,0,-3,0,0,8,-1,2,0,0,8,-1,1,0,0,8,-1,0,0,0,8,-1,-1,0,0,8,-1,-2,0,0,8,-1,-3,0,0,8,-2,2,0,0,8,-2,1,0,0,8,-2,0,0,0,8,-2,-1,0,0,8,-2,-2,0,0,8,-2,-3,0,0,8,-3,2,0,0,8,-3,1,0,0,8,-3,0,0,0,8,-3,-1,0,0,8,-3,-2,0,0,8,-3,-3,0,0,8,-4,4,0,0,8,-4,3,0,0,8,-4,2,0,0,8,-4,1,0,0,8,-4,0,0,0,8,-4,-1,0,0,8,-4,-2,0,0,8,-4,-3,0,0,8],"Middle":[-7,-4,0,2,7,-6,-4,0,2,7,-5,-4,0,2,7,-4,-4,0,2,7,-3,-4,0,2,7,-2,-4,0,2,7,-1,-4,0,2,7,0,-4,0,2,7,1,-4,0,2,7,2,-4,0,2,7,3,-4,0,2,7,4,-4,0,2,7,5,-4,0,2,7],"Top":[-8,-4,0,3,4,-8,-3,0,3,3,-8,-2,0,3,3,-8,-1,0,3,3,-8,0,0,3,3,-8,1,0,3,3,-8,2,0,3,3,-8,3,0,3,3,-8,4,0,3,3,-8,5,0,11,2,-7,5,0,2,2,-6,5,0,2,2,-5,5,0,2,2,-4,5,0,2,2,-3,3,0,1,2,-3,4,0,1,3,-3,5,0,13,2,-2,3,0,2,2,-1,3,0,2,2,0,3,0,3,2,0,4,0,3,3,0,5,0,11,2,1,5,0,2,2,2,5,0,2,2,3,5,0,2,2,4,5,0,2,2,5,5,0,2,2,6,-4,0,1,4,6,-3,0,1,3,6,-2,0,1,3,6,-1,0,1,3,6,0,0,1,3,6,1,0,1,3,6,2,0,1,3,6,3,0,1,3,6,4,0,1,3,6,5,0,13,2]} \ No newline at end of file diff --git a/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/inlet/Start2/Preview.png b/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/inlet/Start2/Preview.png index dbbb1d3..6d2fd01 100644 --- a/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/inlet/Start2/Preview.png +++ b/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/inlet/Start2/Preview.png Binary files differ diff --git a/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/inlet/Start2/TileInfo.json b/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/inlet/Start2/TileInfo.json index 8ba5c2f..60689b8 100644 --- a/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/inlet/Start2/TileInfo.json +++ b/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/inlet/Start2/TileInfo.json @@ -1 +1 @@ -{"NavigationList":[{"Type":0,"Points":[-56,-56,56,-56,56,96,40,96,40,48,-40,48,-40,96,-56,96]}],"Floor":[3,5,0,0,8,3,4,0,0,8,3,3,0,0,8,3,2,0,0,8,3,1,0,0,8,3,0,0,0,8,3,-1,0,0,8,3,-2,0,0,8,3,-3,0,0,8,3,-4,0,0,8,-4,5,0,0,8,-4,4,0,0,8,-4,3,0,0,8,-4,2,0,0,8,-4,1,0,0,8,-4,0,0,0,8,-4,-1,0,0,8,-4,-2,0,0,8,-4,-3,0,0,8,-4,-4,0,0,8,2,5,0,0,8,2,4,0,0,8,2,3,0,0,8,2,2,0,0,8,2,0,0,0,8,2,-1,0,0,8,2,-2,0,0,8,2,-3,0,0,8,2,-4,0,0,8,2,1,0,0,8,1,2,0,0,8,1,0,0,0,8,1,-1,0,0,8,1,-2,0,0,8,1,-3,0,0,8,1,-4,0,0,8,1,1,0,0,8,0,2,0,0,8,0,1,0,0,8,0,-1,0,0,8,0,-2,0,0,8,0,-3,0,0,8,0,-4,0,0,8,0,0,0,0,8,-1,2,0,0,8,-1,1,0,0,8,-1,0,0,0,8,-1,-2,0,0,8,-1,-3,0,0,8,-1,-4,0,0,8,-1,-1,0,0,8,-2,2,0,0,8,-2,1,0,0,8,-2,0,0,0,8,-2,-1,0,0,8,-2,-3,0,0,8,-2,-4,0,0,8,-2,-2,0,0,8,-3,5,0,0,8,-3,4,0,0,8,-3,3,0,0,8,-3,2,0,0,8,-3,1,0,0,8,-3,0,0,0,8,-3,-1,0,0,8,-3,-2,0,0,8,-3,-3,0,0,8,-3,-4,0,0,8],"Middle":[-4,-5,0,2,7,-3,-5,0,2,7,-2,-5,0,2,7,-1,-5,0,2,7,0,-5,0,2,7,1,-5,0,2,7,2,-5,0,2,7,3,-5,0,2,7],"Top":[-5,-5,0,3,4,-5,-4,0,3,3,-5,-3,0,3,3,-5,-2,0,3,3,-5,-1,0,3,3,-5,0,0,3,3,-5,1,0,3,3,-5,2,0,3,3,-5,3,0,3,3,-5,4,0,3,3,-5,5,0,3,3,-5,6,0,11,2,-4,6,0,2,2,-3,6,0,2,2,-2,3,0,1,2,-2,4,0,1,3,-2,5,0,1,3,-2,6,0,13,2,-1,3,0,2,2,0,3,0,2,2,1,3,0,3,2,1,4,0,3,3,1,5,0,3,3,1,6,0,11,2,2,6,0,2,2,3,6,0,2,2,4,-5,0,1,4,4,-4,0,1,3,4,-3,0,1,3,4,-2,0,1,3,4,-1,0,1,3,4,0,0,1,3,4,1,0,1,3,4,2,0,1,3,4,3,0,1,3,4,4,0,1,3,4,5,0,1,3,4,6,0,13,2]} \ No newline at end of file +{"NavigationList":[{"Type":0,"Points":[-56,-56,56,-56,56,96,40,96,40,48,-40,48,-40,96,-56,96]}],"Floor":[-3,-4,0,0,8,-3,-3,0,0,8,-3,-2,0,0,8,-3,-1,0,0,8,-3,0,0,0,8,-3,1,0,0,8,-3,2,0,0,8,-3,3,0,0,8,-3,4,0,0,8,-3,5,0,0,8,-2,-2,0,0,8,-2,-4,0,0,8,-2,-3,0,0,8,-2,-1,0,0,8,-2,0,0,0,8,-2,1,0,0,8,-2,2,0,0,8,-1,-1,0,0,8,-1,-4,0,0,8,-1,-3,0,0,8,-1,-2,0,0,8,-1,0,0,0,8,-1,1,0,0,8,-1,2,0,0,8,0,0,0,0,8,0,-4,0,0,8,0,-3,0,0,8,0,-2,0,0,8,0,-1,0,0,8,0,1,0,0,8,0,2,0,0,8,1,1,0,0,8,1,-4,0,0,8,1,-3,0,0,8,1,-2,0,0,8,1,-1,0,0,8,1,0,0,0,8,1,2,0,0,8,2,1,0,0,8,2,-4,0,0,8,2,-3,0,0,8,2,-2,0,0,8,2,-1,0,0,8,2,0,0,0,8,2,2,0,0,8,2,3,0,0,8,2,4,0,0,8,2,5,0,0,8,-4,-4,0,0,8,-4,-3,0,0,8,-4,-2,0,0,8,-4,-1,0,0,8,-4,0,0,0,8,-4,1,0,0,8,-4,2,0,0,8,-4,3,0,0,8,-4,4,0,0,8,-4,5,0,0,8,3,-4,0,0,8,3,-3,0,0,8,3,-2,0,0,8,3,-1,0,0,8,3,0,0,0,8,3,1,0,0,8,3,2,0,0,8,3,3,0,0,8,3,4,0,0,8,3,5,0,0,8],"Middle":[-4,-5,0,2,7,-3,-5,0,2,7,-2,-5,0,2,7,-1,-5,0,2,7,0,-5,0,2,7,1,-5,0,2,7,2,-5,0,2,7,3,-5,0,2,7],"Top":[-5,-5,0,3,4,-5,-4,0,3,3,-5,-3,0,3,3,-5,-2,0,3,3,-5,-1,0,3,3,-5,0,0,3,3,-5,1,0,3,3,-5,2,0,3,3,-5,3,0,3,3,-5,4,0,3,3,-5,5,0,3,3,-5,6,0,11,2,-4,6,0,2,2,-3,6,0,2,2,-2,3,0,1,2,-2,4,0,1,3,-2,5,0,1,3,-2,6,0,13,2,-1,3,0,2,2,0,3,0,2,2,1,3,0,3,2,1,4,0,3,3,1,5,0,3,3,1,6,0,11,2,2,6,0,2,2,3,6,0,2,2,4,-5,0,1,4,4,-4,0,1,3,4,-3,0,1,3,4,-2,0,1,3,4,-1,0,1,3,4,0,0,1,3,4,1,0,1,3,4,2,0,1,3,4,3,0,1,3,4,4,0,1,3,4,5,0,1,3,4,6,0,13,2]} \ No newline at end of file diff --git a/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/outlet/End1/Preview.png b/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/outlet/End1/Preview.png index 8e0a47a..6224d08 100644 --- a/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/outlet/End1/Preview.png +++ b/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/outlet/End1/Preview.png Binary files differ diff --git a/DungeonShooting_Godot/resource/sprite/map/WallTransition1.png b/DungeonShooting_Godot/resource/sprite/map/WallTransition1.png new file mode 100644 index 0000000..420ef2c --- /dev/null +++ b/DungeonShooting_Godot/resource/sprite/map/WallTransition1.png Binary files differ diff --git a/DungeonShooting_Godot/resource/sprite/map/WallTransition1.png.import b/DungeonShooting_Godot/resource/sprite/map/WallTransition1.png.import new file mode 100644 index 0000000..7141f43 --- /dev/null +++ b/DungeonShooting_Godot/resource/sprite/map/WallTransition1.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://ddkx5x25fges7" +path="res://.godot/imported/WallTransition1.png-290006472c94b57424b8ec3bd229ce8b.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://resource/sprite/map/WallTransition1.png" +dest_files=["res://.godot/imported/WallTransition1.png-290006472c94b57424b8ec3bd229ce8b.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/DungeonShooting_Godot/resource/sprite/map/WallTransition2.png b/DungeonShooting_Godot/resource/sprite/map/WallTransition2.png new file mode 100644 index 0000000..f01f30b --- /dev/null +++ b/DungeonShooting_Godot/resource/sprite/map/WallTransition2.png Binary files differ diff --git a/DungeonShooting_Godot/resource/sprite/map/WallTransition2.png.import b/DungeonShooting_Godot/resource/sprite/map/WallTransition2.png.import new file mode 100644 index 0000000..5f256b8 --- /dev/null +++ b/DungeonShooting_Godot/resource/sprite/map/WallTransition2.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://b751rowqecctj" +path="res://.godot/imported/WallTransition2.png-43446d8d92d11ce7c994737780ed01a3.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://resource/sprite/map/WallTransition2.png" +dest_files=["res://.godot/imported/WallTransition2.png-43446d8d92d11ce7c994737780ed01a3.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/DungeonShooting_Godot/resource/sprite/map/WallTransition3.png b/DungeonShooting_Godot/resource/sprite/map/WallTransition3.png new file mode 100644 index 0000000..430aba3 --- /dev/null +++ b/DungeonShooting_Godot/resource/sprite/map/WallTransition3.png Binary files differ diff --git a/DungeonShooting_Godot/resource/sprite/map/WallTransition3.png.import b/DungeonShooting_Godot/resource/sprite/map/WallTransition3.png.import new file mode 100644 index 0000000..1bbeb6d --- /dev/null +++ b/DungeonShooting_Godot/resource/sprite/map/WallTransition3.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://civvboe078gcc" +path="res://.godot/imported/WallTransition3.png-db21c2408170d6ada2e3c9da5f2912c8.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://resource/sprite/map/WallTransition3.png" +dest_files=["res://.godot/imported/WallTransition3.png-db21c2408170d6ada2e3c9da5f2912c8.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/DungeonShooting_Godot/scene/World.tscn b/DungeonShooting_Godot/scene/World.tscn index 5a92afa..f9bbfa7 100644 --- a/DungeonShooting_Godot/scene/World.tscn +++ b/DungeonShooting_Godot/scene/World.tscn @@ -10,13 +10,15 @@ glow_strength = 1.05 glow_blend_mode = 1 -[node name="World" type="Node2D" node_paths=PackedStringArray("NormalLayer", "YSortLayer", "TileRoot", "StaticSpriteRoot", "AffiliationAreaRoot")] +[node name="World" type="CanvasModulate" node_paths=PackedStringArray("NormalLayer", "YSortLayer", "TileRoot", "StaticSpriteRoot", "AffiliationAreaRoot", "FogMaskRoot")] +color = Color(0, 0, 0, 1) script = ExtResource("1_kt3mm") NormalLayer = NodePath("NormalLayer") YSortLayer = NodePath("YSortLayer") TileRoot = NodePath("TileRoot") StaticSpriteRoot = NodePath("StaticSpriteRoot") AffiliationAreaRoot = NodePath("AffiliationAreaRoot") +FogMaskRoot = NodePath("FogMaskRoot") metadata/_edit_vertical_guides_ = [] [node name="WorldEnvironment" type="WorldEnvironment" parent="."] @@ -59,3 +61,5 @@ y_sort_enabled = true [node name="AffiliationAreaRoot" type="Node2D" parent="."] + +[node name="FogMaskRoot" type="Node2D" parent="."] diff --git a/DungeonShooting_Godot/scene/test/TestRoomFog.tscn b/DungeonShooting_Godot/scene/test/TestRoomFog.tscn new file mode 100644 index 0000000..87a0c1e --- /dev/null +++ b/DungeonShooting_Godot/scene/test/TestRoomFog.tscn @@ -0,0 +1,31 @@ +[gd_scene load_steps=3 format=3 uid="uid://bgbjg8virrams"] + +[ext_resource type="Texture2D" uid="uid://h7hkgbwj1li" path="res://resource/sprite/effects/common/Smoke.png" id="1_bty2r"] +[ext_resource type="Texture2D" uid="uid://uhhfgdhpk7i4" path="res://icon.png" id="1_d62vx"] + +[node name="TestRoomFog" type="Node2D"] + +[node name="PointLight2D" type="PointLight2D" parent="."] +position = Vector2(705, -196) +scale = Vector2(50, 50) +color = Color(1, 1, 1, 0.180392) +blend_mode = 2 +range_item_cull_mask = 3 +texture = ExtResource("1_bty2r") + +[node name="PointLight2D2" type="PointLight2D" parent="."] +position = Vector2(372, 65) +scale = Vector2(50, 50) +blend_mode = 2 +texture = ExtResource("1_bty2r") + +[node name="CanvasModulate" type="CanvasModulate" parent="."] +light_mask = 3 +position = Vector2(-16, 33) +color = Color(0, 0, 0, 1) + +[node name="Sprite2D" type="Sprite2D" parent="CanvasModulate"] +light_mask = 3 +position = Vector2(117, 318) +scale = Vector2(50, 46.168) +texture = ExtResource("1_d62vx") diff --git a/DungeonShooting_Godot/src/framework/coroutine/ProxyCoroutineHandler.cs b/DungeonShooting_Godot/src/framework/coroutine/ProxyCoroutineHandler.cs index 97abea5..ed04749 100644 --- a/DungeonShooting_Godot/src/framework/coroutine/ProxyCoroutineHandler.cs +++ b/DungeonShooting_Godot/src/framework/coroutine/ProxyCoroutineHandler.cs @@ -81,17 +81,7 @@ if (item.Enumerator.MoveNext()) { var next = item.Enumerator.Current; - if (next is IEnumerable enumerable) //嵌套协程 - { - if (item.EnumeratorStack == null) - { - item.EnumeratorStack = new Stack(); - } - - item.EnumeratorStack.Push(item.Enumerator); - item.Enumerator = enumerable.GetEnumerator(); - } - else if (next is IEnumerator enumerator) //嵌套协程 + if (next is IEnumerator enumerator) //嵌套协程 { if (item.EnumeratorStack == null) { @@ -101,6 +91,16 @@ item.EnumeratorStack.Push(item.Enumerator); item.Enumerator = enumerator; } + else if (next is IEnumerable enumerable) //嵌套协程 + { + if (item.EnumeratorStack == null) + { + item.EnumeratorStack = new Stack(); + } + + item.EnumeratorStack.Push(item.Enumerator); + item.Enumerator = enumerable.GetEnumerator(); + } else if (next is WaitForSeconds seconds) //等待秒数 { item.WaitFor(seconds); diff --git a/DungeonShooting_Godot/src/framework/map/AffiliationArea.cs b/DungeonShooting_Godot/src/framework/map/AffiliationArea.cs index a2cb922..e627e82 100644 --- a/DungeonShooting_Godot/src/framework/map/AffiliationArea.cs +++ b/DungeonShooting_Godot/src/framework/map/AffiliationArea.cs @@ -37,7 +37,7 @@ /// /// 根据矩形区域初始化归属区域 /// - public void Init(RoomInfo roomInfo, Rect2 rect2) + public void Init(RoomInfo roomInfo, Rect2I rect2) { if (_init) { diff --git a/DungeonShooting_Godot/src/framework/map/DungeonGenerator.cs b/DungeonShooting_Godot/src/framework/map/DungeonGenerator.cs index 5c83e0b..08beefa 100644 --- a/DungeonShooting_Godot/src/framework/map/DungeonGenerator.cs +++ b/DungeonShooting_Godot/src/framework/map/DungeonGenerator.cs @@ -1,5 +1,6 @@ using System; +using System.Collections; using System.Collections.Generic; using Godot; @@ -27,11 +28,11 @@ /// boss房间 /// public List BossRoom { get; } = new List(); - + /// /// 随机数对象 /// - public SeedRandom Random { get; } + private SeedRandom _random; //用于标记地图上的坐标是否被占用 private Grid _roomGrid { get; } = new Grid(); @@ -86,9 +87,10 @@ // NoProperDoor, } - public DungeonGenerator(DungeonConfig config) + public DungeonGenerator(DungeonConfig config, SeedRandom seedRandom) { _config = config; + _random = seedRandom; _roomGroup = GameApplication.Instance.RoomConfig[config.GroupName]; //验证该组是否满足生成地牢的条件 @@ -98,9 +100,8 @@ throw new Exception("当前组'" + config.GroupName + "'" + result.ErrorMessage + ", 不能生成地牢!"); } - Random = new SeedRandom(); - GD.Print("创建地牢生成器, 随机种子: " + Random.Seed); - _roomGroup.InitWeight(Random); + GD.Print("创建地牢生成器, 随机种子: " + _random.Seed); + _roomGroup.InitWeight(_random); } /// @@ -124,6 +125,28 @@ EachRoom(next, cb); } } + + /// + /// 用于协程中的遍历所有房间 + /// + public IEnumerator EachRoomCoroutine(Action cb) + { + return EachRoomCoroutine(StartRoomInfo, cb); + } + + private IEnumerator EachRoomCoroutine(RoomInfo roomInfo, Action cb) + { + if (roomInfo == null) + { + yield break; + } + + cb(roomInfo); + foreach (var next in roomInfo.Next) + { + yield return EachRoomCoroutine(next, cb); + } + } /// /// 生成房间 @@ -175,12 +198,12 @@ } else { - tempPrevRoomInfo = Random.RandomChoose(RoomInfos); + tempPrevRoomInfo = _random.RandomChoose(RoomInfos); } } else { - tempPrevRoomInfo = Random.RandomChoose(RoomInfos); + tempPrevRoomInfo = _random.RandomChoose(RoomInfos); } //生成下一个房间 @@ -205,7 +228,7 @@ else if (nextRoomType == DungeonRoomType.Battle) { chainTryCount = 0; - chainMaxTryCount = Random.RandomRangeInt(1, 3); + chainMaxTryCount = _random.RandomRangeInt(1, 3); } prevRoomInfo = nextRoom; CalcNextRoomType(prevRoomInfo); @@ -269,7 +292,7 @@ DungeonRoomSplit roomSplit; if (_config.HasDesignatedRoom && _config.DesignatedType == roomType) //执行指定了房间 { - roomSplit = Random.RandomChoose(_config.DesignatedRoom); + roomSplit = _random.RandomChoose(_config.DesignatedRoom); } else //没有指定房间 { @@ -310,19 +333,19 @@ } for (; tryCount < maxTryCount; tryCount++) { - var direction = Random.RandomRangeInt(0, 3); + var direction = _random.RandomRangeInt(0, 3); //房间间隔 - var space = Random.RandomRangeInt(_roomMinInterval, _roomMaxInterval); + var space = _random.RandomRangeInt(_roomMinInterval, _roomMaxInterval); //中心偏移 int offset; if (direction == 0 || direction == 2) { - offset = Random.RandomRangeInt(-(int)(prevRoomInfo.Size.X * _roomVerticalMinDispersion), + offset = _random.RandomRangeInt(-(int)(prevRoomInfo.Size.X * _roomVerticalMinDispersion), (int)(prevRoomInfo.Size.X * _roomVerticalMaxDispersion)); } else { - offset = Random.RandomRangeInt(-(int)(prevRoomInfo.Size.Y * _roomHorizontalMinDispersion), + offset = _random.RandomRangeInt(-(int)(prevRoomInfo.Size.Y * _roomHorizontalMinDispersion), (int)(prevRoomInfo.Size.Y * _roomHorizontalMaxDispersion)); } @@ -521,7 +544,7 @@ } } - return Random.RandomChoose(list); + return _random.RandomChoose(list); } /// @@ -540,7 +563,7 @@ nextRoomDoor.ConnectDoor = roomDoor; //先寻找直通门 - if (Random.RandomBoolean()) + if (_random.RandomBoolean()) { //直行通道, 优先横轴 if (TryConnectHorizontalDoor(roomInfo, roomDoor, nextRoomInfo, nextRoomDoor) @@ -580,8 +603,8 @@ while (rangeList.Count > 0) { //找到重叠区域 - var range = Random.RandomChooseAndRemove(rangeList); - var x = Random.RandomRangeInt(range.X, range.Y); + var range = _random.RandomChooseAndRemove(rangeList); + var x = _random.RandomRangeInt(range.X, range.Y); if (roomInfo.GetVerticalStart() < nextRoomInfo.GetVerticalStart()) //room在上, nextRoom在下 { @@ -632,8 +655,8 @@ while (rangeList.Count > 0) { //找到重叠区域 - var range = Random.RandomChooseAndRemove(rangeList); - var y = Random.RandomRangeInt(range.X, range.Y); + var range = _random.RandomChooseAndRemove(rangeList); + var y = _random.RandomRangeInt(range.X, range.Y); if (roomInfo.GetHorizontalStart() < nextRoomInfo.GetHorizontalStart()) //room在左, nextRoom在右 { @@ -679,7 +702,7 @@ { if (roomInfo.GetVerticalStart() > nextRoomInfo.GetVerticalStart()) { - if (Random.RandomBoolean()) //↑ //→ + if (_random.RandomBoolean()) //↑ //→ { if (!TryConnect_NE_Door(roomInfo, nextRoomInfo, roomDoor, nextRoomDoor, ref cross) && !TryConnect_WS_Door(roomInfo, nextRoomInfo, roomDoor, nextRoomDoor, ref cross)) @@ -698,7 +721,7 @@ } else { - if (Random.RandomBoolean()) //↓ //→ + if (_random.RandomBoolean()) //↓ //→ { if (!TryConnect_SE_Door(roomInfo, nextRoomInfo, roomDoor, nextRoomDoor, ref cross) && !TryConnect_WN_Door(roomInfo, nextRoomInfo, roomDoor, nextRoomDoor, ref cross)) @@ -720,7 +743,7 @@ { if (roomInfo.GetVerticalStart() > nextRoomInfo.GetVerticalStart()) //→ //↓ { - if (Random.RandomBoolean()) + if (_random.RandomBoolean()) { if (!TryConnect_ES_Door(roomInfo, nextRoomInfo, roomDoor, nextRoomDoor, ref cross) && !TryConnect_NW_Door(roomInfo, nextRoomInfo, roomDoor, nextRoomDoor, ref cross)) @@ -739,7 +762,7 @@ } else { - if (Random.RandomBoolean()) //→ //↑ + if (_random.RandomBoolean()) //→ //↑ { if (!TryConnect_EN_Door(roomInfo, nextRoomInfo, roomDoor, nextRoomDoor, ref cross) && !TryConnect_SW_Door(roomInfo, nextRoomInfo, roomDoor, nextRoomDoor, ref cross)) diff --git a/DungeonShooting_Godot/src/framework/map/DungeonTileMap.cs b/DungeonShooting_Godot/src/framework/map/DungeonTileMap.cs index 4e0addf..c35c107 100644 --- a/DungeonShooting_Godot/src/framework/map/DungeonTileMap.cs +++ b/DungeonShooting_Godot/src/framework/map/DungeonTileMap.cs @@ -1,4 +1,5 @@ +using System.Collections; using System.Collections.Generic; using System.Linq; using Godot; @@ -33,23 +34,23 @@ } /// - /// 根据 startRoom 和 config 数据自动填充 tileMap 参数中的地图数据 + /// 根据 startRoom 和 config 数据自动填充 tileMap 参数中的地图数据, 该函数为协程函数 /// - public void AutoFillRoomTile(AutoTileConfig config, RoomInfo startRoomInfo, SeedRandom random) + public IEnumerator AutoFillRoomTile(AutoTileConfig config, RoomInfo startRoomInfo, SeedRandom random) { _connectNavigationItemList.Clear(); - _AutoFillRoomTile(config, startRoomInfo, random); + yield return _AutoFillRoomTile(config, startRoomInfo, random); } - private void _AutoFillRoomTile(AutoTileConfig config, RoomInfo roomInfo, SeedRandom random) + private IEnumerator _AutoFillRoomTile(AutoTileConfig config, RoomInfo roomInfo, SeedRandom random) { foreach (var info in roomInfo.Next) { - _AutoFillRoomTile(config, info, random); + yield return _AutoFillRoomTile(config, info, random); } //铺房间 - if (roomInfo.RoomSplit == null) + if (roomInfo.RoomSplit == null) //自动填充的矩形房间, 现已经弃用 { FillRect(GameConfig.FloorMapLayer, config.Floor, roomInfo.Position + Vector2.One, roomInfo.Size - new Vector2(2, 2)); @@ -79,6 +80,7 @@ //填充tile操作 var tileInfo = roomInfo.RoomSplit.TileInfo; + //底层 for (var i = 0; i < tileInfo.Floor.Count; i += 5) { var posX = tileInfo.Floor[i]; @@ -89,6 +91,7 @@ var pos = new Vector2I(roomInfo.Position.X + posX - rectPos.X, roomInfo.Position.Y + posY - rectPos.Y); _tileRoot.SetCell(GameConfig.FloorMapLayer, pos, sourceId, new Vector2I(atlasCoordsX, atlasCoordsY)); } + //中层 for (var i = 0; i < tileInfo.Middle.Count; i += 5) { var posX = tileInfo.Middle[i]; @@ -99,6 +102,7 @@ var pos = new Vector2I(roomInfo.Position.X + posX - rectPos.X, roomInfo.Position.Y + posY - rectPos.Y); _tileRoot.SetCell(GameConfig.MiddleMapLayer, pos, sourceId, new Vector2I(atlasCoordsX, atlasCoordsY)); } + //顶层 for (var i = 0; i < tileInfo.Top.Count; i += 5) { var posX = tileInfo.Top[i]; @@ -109,6 +113,7 @@ var pos = new Vector2I(roomInfo.Position.X + posX - rectPos.X, roomInfo.Position.Y + posY - rectPos.Y); _tileRoot.SetCell(GameConfig.TopMapLayer, pos, sourceId, new Vector2I(atlasCoordsX, atlasCoordsY)); } + //随机选择预设 RoomPreinstallInfo preinstallInfo; if (EditorPlayManager.IsPlay && roomInfo.RoomType == GameApplication.Instance.DungeonManager.CurrConfig.DesignatedType) //编辑器模式, 指定预设 @@ -188,7 +193,7 @@ // { // // 在 Godot 4.0 中使用以下这段代码区分层级, 会导致游戏关闭时有概率报错卡死, 目前尚不清楚原因 // //获取自定义层级 - // // var customData = tileInstance.GetCellTileData(0, coords).GetCustomData(CustomTileLayerName); + // // var customData = tileInstance.GetCellSourceId(0, coords).GetCustomData(CustomTileLayerName); // // var layer = customData.AsInt32(); // // layer = Mathf.Clamp(layer, GameConfig.FloorMapLayer, GameConfig.TopMapLayer); // @@ -467,6 +472,83 @@ } } + /// + /// 给TileMap添加轮廓, 该函数为协程函数 + /// + /// 描轮廓的Tile + public IEnumerator AddOutlineTile(TileCellInfo tileCellInfo) + { + var c = 0; + var rect = _tileRoot.GetUsedRect(); + var endX = rect.End.X + 1; + var endY = rect.End.Y + 1; + for (int x = rect.Position.X - 1; x <= endX; x++) + { + for (int y = rect.Position.Y - 1; y <= endY; y++) + { + if (c++ > 1000) //份帧处理, 不要挤在一帧 + { + c = 0; + yield return 0; + } + var pos = new Vector2I(x, y); + var flag1 = _tileRoot.GetCellSourceId(GameConfig.FloorMapLayer, pos) != -1 || + _tileRoot.GetCellSourceId(GameConfig.MiddleMapLayer, pos) != -1 || + _tileRoot.GetCellSourceId(GameConfig.AisleFloorMapLayer, pos) != -1 || + (_tileRoot.GetCellSourceId(GameConfig.TopMapLayer, pos) != -1 && _tileRoot.GetCellAtlasCoords(GameConfig.TopMapLayer, pos) != tileCellInfo.AutoTileCoord); + if (!flag1) //空地 + { + var posDown = new Vector2I(pos.X, pos.Y + 1); + var posTop = new Vector2I(pos.X, pos.Y - 1); + var posLeft = new Vector2I(pos.X - 1, pos.Y); + var posRight = new Vector2I(pos.X + 1, pos.Y); + + var posLD = new Vector2I(pos.X - 1, pos.Y + 1); + var posLT = new Vector2I(pos.X - 1, pos.Y - 1); + var posRD = new Vector2I(pos.X + 1, pos.Y + 1); + var posRT = new Vector2I(pos.X + 1, pos.Y - 1); + + var flag2 = _tileRoot.GetCellSourceId(GameConfig.FloorMapLayer, posDown) != -1 || + _tileRoot.GetCellSourceId(GameConfig.MiddleMapLayer, posDown) != -1 || + (_tileRoot.GetCellSourceId(GameConfig.TopMapLayer, posDown) != -1 && _tileRoot.GetCellAtlasCoords(GameConfig.TopMapLayer, posDown) != tileCellInfo.AutoTileCoord) || + + _tileRoot.GetCellSourceId(GameConfig.FloorMapLayer, posTop) != -1 || + _tileRoot.GetCellSourceId(GameConfig.MiddleMapLayer, posTop) != -1 || + (_tileRoot.GetCellSourceId(GameConfig.TopMapLayer, posTop) != -1 && _tileRoot.GetCellAtlasCoords(GameConfig.TopMapLayer, posTop) != tileCellInfo.AutoTileCoord) || + + _tileRoot.GetCellSourceId(GameConfig.FloorMapLayer, posLeft) != -1 || + _tileRoot.GetCellSourceId(GameConfig.MiddleMapLayer, posLeft) != -1 || + (_tileRoot.GetCellSourceId(GameConfig.TopMapLayer, posLeft) != -1 && _tileRoot.GetCellAtlasCoords(GameConfig.TopMapLayer, posLeft) != tileCellInfo.AutoTileCoord) || + + _tileRoot.GetCellSourceId(GameConfig.FloorMapLayer, posRight) != -1 || + _tileRoot.GetCellSourceId(GameConfig.MiddleMapLayer, posRight) != -1 || + (_tileRoot.GetCellSourceId(GameConfig.TopMapLayer, posRight) != -1 && _tileRoot.GetCellAtlasCoords(GameConfig.TopMapLayer, posRight) != tileCellInfo.AutoTileCoord) || + // + _tileRoot.GetCellSourceId(GameConfig.FloorMapLayer, posLD) != -1 || + _tileRoot.GetCellSourceId(GameConfig.MiddleMapLayer, posLD) != -1 || + (_tileRoot.GetCellSourceId(GameConfig.TopMapLayer, posLD) != -1 && _tileRoot.GetCellAtlasCoords(GameConfig.TopMapLayer, posLD) != tileCellInfo.AutoTileCoord) || + + _tileRoot.GetCellSourceId(GameConfig.FloorMapLayer, posLT) != -1 || + _tileRoot.GetCellSourceId(GameConfig.MiddleMapLayer, posLT) != -1 || + (_tileRoot.GetCellSourceId(GameConfig.TopMapLayer, posLT) != -1 && _tileRoot.GetCellAtlasCoords(GameConfig.TopMapLayer, posLT) != tileCellInfo.AutoTileCoord) || + + _tileRoot.GetCellSourceId(GameConfig.FloorMapLayer, posRD) != -1 || + _tileRoot.GetCellSourceId(GameConfig.MiddleMapLayer, posRD) != -1 || + (_tileRoot.GetCellSourceId(GameConfig.TopMapLayer, posRD) != -1 && _tileRoot.GetCellAtlasCoords(GameConfig.TopMapLayer, posRD) != tileCellInfo.AutoTileCoord) || + + _tileRoot.GetCellSourceId(GameConfig.FloorMapLayer, posRT) != -1 || + _tileRoot.GetCellSourceId(GameConfig.MiddleMapLayer, posRT) != -1 || + (_tileRoot.GetCellSourceId(GameConfig.TopMapLayer, posRT) != -1 && _tileRoot.GetCellAtlasCoords(GameConfig.TopMapLayer, posRT) != tileCellInfo.AutoTileCoord); + + if (flag2) //非空地, 那么说明这个点需要填充 WALL_BLOCK + { + _tileRoot.SetCell(GameConfig.TopMapLayer, pos, tileCellInfo.Id, tileCellInfo.AutoTileCoord); + } + } + } + } + } + //填充tile区域 private void FillRect(int layer, TileCellInfo info, Vector2 pos, Vector2 size) { @@ -824,7 +906,7 @@ { if (_floorAtlasCoords == null || _floorAtlasCoords.Count == 0) { - return _tileRoot.GetCellTileData(layer, new Vector2I(x, y)) != null; + return _tileRoot.GetCellSourceId(layer, new Vector2I(x, y)) != -1; } var result = _tileRoot.GetCellAtlasCoords(layer, new Vector2I(x, y)); diff --git a/DungeonShooting_Godot/src/framework/map/TileCellInfo.cs b/DungeonShooting_Godot/src/framework/map/TileCellInfo.cs index b892d38..bd120a6 100644 --- a/DungeonShooting_Godot/src/framework/map/TileCellInfo.cs +++ b/DungeonShooting_Godot/src/framework/map/TileCellInfo.cs @@ -13,7 +13,7 @@ } /// - /// 在TileSet中的图块id + /// 在TileSet中的图块id, 也就是sourceId /// public int Id; diff --git a/DungeonShooting_Godot/src/framework/map/fog/RoomFogMask.cs b/DungeonShooting_Godot/src/framework/map/fog/RoomFogMask.cs new file mode 100644 index 0000000..3a60d80 --- /dev/null +++ b/DungeonShooting_Godot/src/framework/map/fog/RoomFogMask.cs @@ -0,0 +1,243 @@ + +using Godot; + +/// +/// 迷雾遮罩 +/// +public partial class RoomFogMask : PointLight2D, IDestroy +{ + public int Width { get; private set; } + public int Height { get; private set; } + + public bool IsDestroyed { get; private set; } + private bool _init = false; + + private static Image _leftTransition; + private static Image _rightTransition; + private static Image _topTransition; + private static Image _downTransition; + + private static Image _leftTopTransition; + private static Image _rightTopTransition; + private static Image _leftDownTransition; + private static Image _rightDownTransition; + + private static Image _inLeftTopTransition; + private static Image _inRightTopTransition; + private static Image _inLeftDownTransition; + private static Image _inRightDownTransition; + + private static bool _initSprite = false; + + private static void InitSprite() + { + if (_initSprite) + { + return; + } + _initSprite = false; + + var temp = ResourceManager.Load(ResourcePath.resource_sprite_map_WallTransition1_png, false); + _leftTransition = temp.GetImage(); + _rightTransition = temp.GetImage(); + _rightTransition.Rotate180(); + _topTransition = temp.GetImage(); + _topTransition.Rotate90(ClockDirection.Clockwise); + _downTransition = temp.GetImage(); + _downTransition.Rotate90(ClockDirection.Counterclockwise); + + var temp2 = ResourceManager.Load(ResourcePath.resource_sprite_map_WallTransition2_png, false); + _leftDownTransition = temp2.GetImage(); + _leftTopTransition = temp2.GetImage(); + _leftTopTransition.Rotate90(ClockDirection.Clockwise); + _rightDownTransition = temp2.GetImage(); + _rightDownTransition.Rotate90(ClockDirection.Counterclockwise); + _rightTopTransition = temp2.GetImage(); + _rightTopTransition.Rotate180(); + + var temp3 = ResourceManager.Load(ResourcePath.resource_sprite_map_WallTransition3_png, false); + _inLeftDownTransition = temp3.GetImage(); + _inLeftTopTransition = temp3.GetImage(); + _inLeftTopTransition.Rotate90(ClockDirection.Clockwise); + _inRightDownTransition = temp3.GetImage(); + _inRightDownTransition.Rotate90(ClockDirection.Counterclockwise); + _inRightTopTransition = temp3.GetImage(); + _inRightTopTransition.Rotate180(); + } + + /// + /// 初始化贩房间迷雾遮罩 + /// + /// 房间对象 + /// 迷雾所占区域 + public void Init(RoomInfo roomInfo, Rect2I rect2) + { + if (_init) + { + return; + } + InitSprite(); + GlobalPosition = rect2.Position + rect2.Size / 2; + + //创建光纹理 + Width = rect2.Size.X; + Height = rect2.Size.Y; + var img = Image.Create(Width, Height, false, Image.Format.Rgba8); + img.Fill(Colors.White); + + //处理边缘过渡 + HandlerTransition(roomInfo, img); + + Texture = ImageTexture.CreateFromImage(img); + } + + public void Destroy() + { + if (IsDestroyed) + { + return; + } + + IsDestroyed = true; + QueueFree(); + } + + private void HandlerTransition(RoomInfo roomInfo, Image image) + { + var tileMap = GameApplication.Instance.World.TileRoot; + var autoConfig = GameApplication.Instance.DungeonManager.AutoTileConfig; + var wallCoord = autoConfig.WALL_BLOCK.AutoTileCoord; + var (x, y) = roomInfo.Position; + var (width, height) = roomInfo.Size; + x -= 1; + y -= 1; + width += 2; + height += 2; + for (int i = 0; i < width; i++) + { + for (int j = 0; j < height; j++) + { + var pos = new Vector2I(i + x, j + y); + //说明是外层墙壁 + if (tileMap.GetCellAtlasCoords(GameConfig.TopMapLayer, pos) == wallCoord) + { + var left = IsEmptyCell(tileMap, new Vector2I(pos.X - 1, pos.Y)); + var right = IsEmptyCell(tileMap, new Vector2I(pos.X + 1, pos.Y)); + var top = IsEmptyCell(tileMap, new Vector2I(pos.X, pos.Y - 1)); + var down = IsEmptyCell(tileMap, new Vector2I(pos.X, pos.Y + 1)); + + var leftTop = IsEmptyCell(tileMap, new Vector2I(pos.X - 1, pos.Y - 1)); + var leftDown = IsEmptyCell(tileMap, new Vector2I(pos.X - 1, pos.Y + 1)); + var rightTop = IsEmptyCell(tileMap, new Vector2I(pos.X + 1, pos.Y - 1)); + var rightDown = IsEmptyCell(tileMap, new Vector2I(pos.X + 1, pos.Y + 1)); + + if (!left && !right && !top && !down && !leftTop && !leftDown && !rightTop && !rightDown) + { + continue; + } + else if (leftTop && left && top) //外轮廓, 左上 + { + FillTransitionImage(i, j, image, _leftTopTransition); + } + else if (leftDown && left && down) //外轮廓, 左下 + { + FillTransitionImage(i, j, image, _leftDownTransition); + } + else if (rightTop && right && top) //外轮廓, 右上 + { + FillTransitionImage(i, j, image, _rightTopTransition); + } + else if (rightDown && right && down) //外轮廓, 右下 + { + FillTransitionImage(i, j, image, _rightDownTransition); + } + //------------------------- + else if (left) //左 + { + FillTransitionImage(i, j, image, _leftTransition); + } + else if (right) //右 + { + FillTransitionImage(i, j, image, _rightTransition); + } + else if (top) //上 + { + FillTransitionImage(i, j, image, _topTransition); + } + else if (down) //下 + { + FillTransitionImage(i, j, image, _downTransition); + } + //-------------------------- + else if (leftTop) //内轮廓, 左上 + { + FillTransitionImage(i, j, image, _inLeftTopTransition); + } + else if (leftDown) //内轮廓, 左下 + { + FillTransitionImage(i, j, image, _inLeftDownTransition); + } + else if (rightTop) //内轮廓, 右上 + { + FillTransitionImage(i, j, image, _inRightTopTransition); + } + else if (rightDown) //内轮廓, 右下 + { + FillTransitionImage(i, j, image, _inRightDownTransition); + } + //------------------------ + else //全黑 + { + FillBlock(i, j, image); + } + } + } + } + } + + //填充一个16*16像素的区域 + private void FillBlock(int x, int y, Image image) + { + var endX = (x + 1) * GameConfig.TileCellSize; + var endY = (y + 1) * GameConfig.TileCellSize; + for (int i = x * GameConfig.TileCellSize; i < endX; i++) + { + for (int j = y * GameConfig.TileCellSize; j < endY; j++) + { + image.SetPixel(i, j, new Color(1, 1, 1, 0)); + } + } + } + + private void FillTransitionImage(int x, int y, Image image, Image transitionImage) + { + image.BlitRect(transitionImage, + new Rect2I(Vector2I.Zero, 16, 16), + new Vector2I(x * GameConfig.TileCellSize, y * GameConfig.TileCellSize) + ); + } + + private bool IsEmptyCell(TileMap tileMap, Vector2I pos) + { + return tileMap.GetCellSourceId(GameConfig.TopMapLayer, pos) == -1 && + tileMap.GetCellSourceId(GameConfig.MiddleMapLayer, pos) == -1; + } + + //判断是否是墙壁 + private bool IsNotWallCell(TileMap tileMap, Vector2I pos, Vector2I wallCoord) + { + return tileMap.GetCellAtlasCoords(GameConfig.TopMapLayer, pos) != wallCoord && + tileMap.GetCellAtlasCoords(GameConfig.MiddleMapLayer, pos) != wallCoord && + (tileMap.GetCellSourceId(GameConfig.TopMapLayer, pos) != -1 || + tileMap.GetCellSourceId(GameConfig.MiddleMapLayer, pos) != -1); + } + + //判断是否是任意类型的图块 + private bool IsAnyCell(TileMap tileMap, Vector2I pos) + { + return tileMap.GetCellSourceId(GameConfig.FloorMapLayer, pos) != -1 || + tileMap.GetCellSourceId(GameConfig.MiddleMapLayer, pos) != -1 || + tileMap.GetCellSourceId(GameConfig.TopMapLayer, pos) != -1 || + tileMap.GetCellSourceId(GameConfig.AisleFloorMapLayer, pos) != -1; + } +} \ No newline at end of file diff --git a/DungeonShooting_Godot/src/framework/map/room/RoomInfo.cs b/DungeonShooting_Godot/src/framework/map/room/RoomInfo.cs index 1d3b34a..317a424 100644 --- a/DungeonShooting_Godot/src/framework/map/room/RoomInfo.cs +++ b/DungeonShooting_Godot/src/framework/map/room/RoomInfo.cs @@ -80,6 +80,16 @@ public RoomStaticImageCanvas StaticImageCanvas; /// + /// 房间迷雾 + /// + public RoomFogMask RoomFogMask; + + /// + /// 房间算上连接通道所占用的区域 + /// + public Rect2I OuterRange { get; private set; } + + /// /// 是否处于闭关状态, 也就是房间门没有主动打开 /// public bool IsSeclusion { get; private set; } = false; @@ -94,6 +104,96 @@ //private List _currActivityMarks = new List(); /// + /// 重新计算占用的区域 + /// + public void CalcOuterRange() + { + var worldPos = GetWorldPosition(); + var pos = new Vector2I((int)worldPos.X, (int)worldPos.Y); + int minX = pos.X; + int minY = pos.Y; + int maxX = minX + GetWidth(); + int maxY = minY + GetHeight(); + + //遍历每一个连接的门, 计算计算canvas覆盖范围 + foreach (var doorInfo in Doors) + { + var connectDoor = doorInfo.ConnectDoor; + switch (connectDoor.Direction) + { + case DoorDirection.E: + case DoorDirection.W: + { + var (px1, py1) = connectDoor.GetWorldOriginPosition(); + var py2 = py1 + 4 * GameConfig.TileCellSize; + if (px1 < minX) + { + minX = px1; + } + else if (px1 > maxX) + { + maxX = px1; + } + + if (py1 < minY) + { + minY = py1; + } + else if (py1 > maxY) + { + maxY = py1; + } + + if (py2 < minY) + { + minY = py2; + } + else if (py2 > maxY) + { + maxY = py2; + } + } + break; + case DoorDirection.S: + case DoorDirection.N: + { + var (px1, py1) = connectDoor.GetWorldOriginPosition(); + var px2 = px1 + 4 * GameConfig.TileCellSize; + if (px1 < minX) + { + minX = px1; + } + else if (px1 > maxX) + { + maxX = px1; + } + + if (py1 < minY) + { + minY = py1; + } + else if (py1 > maxY) + { + maxY = py1; + } + + if (px2 < minX) + { + minX = px2; + } + else if (px2 > maxX) + { + maxX = px2; + } + } + break; + } + } + + OuterRange = new Rect2I(minX, minY, maxX - minX, maxY - minY); + } + + /// /// 获取房间的全局坐标, 单位: 像素 /// public Vector2I GetWorldPosition() @@ -186,6 +286,11 @@ StaticImageCanvas.Destroy(); } + if (RoomFogMask != null) + { + RoomFogMask.Destroy(); + } + if (AffiliationArea != null) { AffiliationArea.Destroy(); diff --git a/DungeonShooting_Godot/src/game/GameApplication.cs b/DungeonShooting_Godot/src/game/GameApplication.cs index 01d2434..f66b1d9 100644 --- a/DungeonShooting_Godot/src/game/GameApplication.cs +++ b/DungeonShooting_Godot/src/game/GameApplication.cs @@ -96,11 +96,13 @@ DungeonConfig = new DungeonConfig(); DungeonConfig.GroupName = RoomConfig.FirstOrDefault().Key; - DungeonConfig.RoomCount = 20; + DungeonConfig.RoomCount = 0; } public override void _EnterTree() { + //背景颜色 + RenderingServer.SetDefaultClearColor(new Color(0, 0, 0, 1)); //随机化种子 //GD.Randomize(); //固定帧率 diff --git a/DungeonShooting_Godot/src/game/manager/ResourcePath.cs b/DungeonShooting_Godot/src/game/manager/ResourcePath.cs index 96f692b..18d78c3 100644 --- a/DungeonShooting_Godot/src/game/manager/ResourcePath.cs +++ b/DungeonShooting_Godot/src/game/manager/ResourcePath.cs @@ -145,6 +145,9 @@ public const string resource_sprite_effects_weapon_KnifeHit1_png = "res://resource/sprite/effects/weapon/KnifeHit1.png"; public const string resource_sprite_effects_weapon_MeleeAttack1_png = "res://resource/sprite/effects/weapon/MeleeAttack1.png"; public const string resource_sprite_effects_weapon_ShotFire_png = "res://resource/sprite/effects/weapon/ShotFire.png"; + public const string resource_sprite_map_WallTransition1_png = "res://resource/sprite/map/WallTransition1.png"; + public const string resource_sprite_map_WallTransition2_png = "res://resource/sprite/map/WallTransition2.png"; + public const string resource_sprite_map_WallTransition3_png = "res://resource/sprite/map/WallTransition3.png"; public const string resource_sprite_map_map1_16x16dungeoniiwallreconfigv04spritesheet_png = "res://resource/sprite/map/map1/16x16 dungeon ii wall reconfig v04 spritesheet.png"; public const string resource_sprite_map_map1_door1_down_png = "res://resource/sprite/map/map1/door1_down.png"; public const string resource_sprite_map_map1_website_txt = "res://resource/sprite/map/map1/website.txt"; @@ -312,5 +315,6 @@ public const string scene_test_TestOptimizeSprite_tscn = "res://scene/test/TestOptimizeSprite.tscn"; public const string scene_test_TestOutline_tscn = "res://scene/test/TestOutline.tscn"; public const string scene_test_TestReadExcel_tscn = "res://scene/test/TestReadExcel.tscn"; + public const string scene_test_TestRoomFog_tscn = "res://scene/test/TestRoomFog.tscn"; public const string scene_test_TestTileLayer_tscn = "res://scene/test/TestTileLayer.tscn"; } \ No newline at end of file diff --git a/DungeonShooting_Godot/src/game/room/AutoTileConfig.cs b/DungeonShooting_Godot/src/game/room/AutoTileConfig.cs index 07bcf9d..968d8f3 100644 --- a/DungeonShooting_Godot/src/game/room/AutoTileConfig.cs +++ b/DungeonShooting_Godot/src/game/room/AutoTileConfig.cs @@ -22,6 +22,8 @@ public TileCellInfo OUT_RT = new TileCellInfo(0, new Vector2I(3, 2)); public TileCellInfo OUT_RB = new TileCellInfo(0, new Vector2I(3, 7)); + public TileCellInfo WALL_BLOCK = new TileCellInfo(0, new Vector2I(2, 3)); + private List _middleLayerAtlasCoords = new List() { new Vector2I(1, 6), diff --git a/DungeonShooting_Godot/src/game/room/DungeonManager.cs b/DungeonShooting_Godot/src/game/room/DungeonManager.cs index c0b9834..b4c2840 100644 --- a/DungeonShooting_Godot/src/game/room/DungeonManager.cs +++ b/DungeonShooting_Godot/src/game/room/DungeonManager.cs @@ -43,10 +43,14 @@ /// 当前使用的世界对象 /// public World World { get; private set; } + + /// + /// 自动图块配置 + /// + public AutoTileConfig AutoTileConfig { get; private set; } private UiBase _prevUi; private DungeonTileMap _dungeonTileMap; - private AutoTileConfig _autoTileConfig; private DungeonGenerator _dungeonGenerator; //房间内所有静态导航网格数据 private List _roomStaticNavigationList; @@ -191,17 +195,18 @@ yield return 0; //创建世界场景 World = GameApplication.Instance.CreateNewWorld(); - yield return new WaitForFixedProcess(10); + yield return 0; //生成地牢房间 - _dungeonGenerator = new DungeonGenerator(CurrConfig); + var random = new SeedRandom(1); + _dungeonGenerator = new DungeonGenerator(CurrConfig, random); _dungeonGenerator.Generate(); yield return 0; //填充地牢 - _autoTileConfig = new AutoTileConfig(); + AutoTileConfig = new AutoTileConfig(); _dungeonTileMap = new DungeonTileMap(World.TileRoot); - _dungeonTileMap.AutoFillRoomTile(_autoTileConfig, _dungeonGenerator.StartRoomInfo, _dungeonGenerator.Random); - yield return 0; + yield return _dungeonTileMap.AutoFillRoomTile(AutoTileConfig, _dungeonGenerator.StartRoomInfo, random); + yield return _dungeonTileMap.AddOutlineTile(AutoTileConfig.WALL_BLOCK); //生成寻路网格, 这一步操作只生成过道的导航 _dungeonTileMap.GenerateNavigationPolygon(GameConfig.AisleFloorMapLayer); @@ -215,14 +220,15 @@ yield return 0; //门导航区域数据 _roomStaticNavigationList.AddRange(_dungeonTileMap.GetConnectDoorPolygonData()); - yield return new WaitForFixedProcess(10); //初始化所有房间 - _dungeonGenerator.EachRoom(InitRoom); - yield return new WaitForFixedProcess(10); + yield return _dungeonGenerator.EachRoomCoroutine(InitRoom); //播放bgm //SoundManager.PlayMusic(ResourcePath.resource_sound_bgm_Intro_ogg, -17f); + //地牢加载即将完成 + yield return _dungeonGenerator.EachRoomCoroutine(info => info.OnReady()); + //初始房间创建玩家标记 var playerBirthMark = StartRoomInfo.RoomPreinstall.GetPlayerBirthMark(); //创建玩家 @@ -235,9 +241,7 @@ player.Name = "Player"; player.PutDown(RoomLayerEnum.YSortLayer); Player.SetCurrentPlayer(player); - - //地牢加载即将完成 - _dungeonGenerator.EachRoom(info => info.OnReady()); + yield return 0; //玩家手上添加武器 //player.PickUpWeapon(ActivityObject.Create(ActivityObject.Ids.Id_weapon0001)); @@ -269,6 +273,7 @@ } } + //执行退出地牢流程 private IEnumerator RunExitDungeonCoroutine(Action finish) { //打开 loading UI @@ -279,17 +284,17 @@ _dungeonGenerator.EachRoom(DisposeRoomInfo); yield return 0; _dungeonTileMap = null; - _autoTileConfig = null; + AutoTileConfig = null; _dungeonGenerator = null; _roomStaticNavigationList.Clear(); _roomStaticNavigationList = null; UiManager.Hide_RoomUI(); - yield return new WaitForFixedProcess(10); + yield return 0; Player.SetCurrentPlayer(null); World = null; GameApplication.Instance.DestroyWorld(); - yield return new WaitForFixedProcess(10); + yield return 0; QueueRedraw(); //鼠标还原 GameApplication.Instance.Cursor.SetGuiMode(true); @@ -307,6 +312,7 @@ // 初始化房间 private void InitRoom(RoomInfo roomInfo) { + roomInfo.CalcOuterRange(); //挂载房间导航区域 MountNavFromRoomInfo(roomInfo); //创建门 @@ -315,6 +321,8 @@ CreateRoomAffiliation(roomInfo); //创建静态精灵画布 CreateRoomStaticSpriteCanvas(roomInfo); + //创建迷雾遮罩 + CreateRoomFogMask(roomInfo); } //挂载房间导航区域 @@ -389,8 +397,8 @@ { var affiliation = new AffiliationArea(); affiliation.Name = "AffiliationArea" + roomInfo.Id; - affiliation.Init(roomInfo, new Rect2( - roomInfo.GetWorldPosition() + new Vector2(GameConfig.TileCellSize, GameConfig.TileCellSize), + affiliation.Init(roomInfo, new Rect2I( + roomInfo.GetWorldPosition() + GameConfig.TileCellSizeVector2I, (roomInfo.Size - new Vector2I(2, 2)) * GameConfig.TileCellSize)); roomInfo.AffiliationArea = affiliation; @@ -401,92 +409,13 @@ private void CreateRoomStaticSpriteCanvas(RoomInfo roomInfo) { var worldPos = roomInfo.GetWorldPosition(); - var pos = new Vector2I((int)worldPos.X, (int)worldPos.Y); - - int minX = pos.X; - int minY = pos.Y; - int maxX = minX + roomInfo.GetWidth(); - int maxY = minY + roomInfo.GetHeight(); + var rect = roomInfo.OuterRange; - //遍历每一个连接的门, 计算计算canvas覆盖范围 - foreach (var doorInfo in roomInfo.Doors) - { - var connectDoor = doorInfo.ConnectDoor; - switch (connectDoor.Direction) - { - case DoorDirection.E: - case DoorDirection.W: - { - var (px1, py1) = connectDoor.GetWorldOriginPosition(); - var py2 = py1 + 4 * GameConfig.TileCellSize; - if (px1 < minX) - { - minX = px1; - } - else if (px1 > maxX) - { - maxX = px1; - } + int minX = rect.Position.X - GameConfig.TileCellSize; + int minY = rect.Position.Y - GameConfig.TileCellSize; + int maxX = rect.End.X + GameConfig.TileCellSize; + int maxY = rect.End.Y + GameConfig.TileCellSize; - if (py1 < minY) - { - minY = py1; - } - else if (py1 > maxY) - { - maxY = py1; - } - - if (py2 < minY) - { - minY = py2; - } - else if (py2 > maxY) - { - maxY = py2; - } - } - break; - case DoorDirection.S: - case DoorDirection.N: - { - var (px1, py1) = connectDoor.GetWorldOriginPosition(); - var px2 = px1 + 4 * GameConfig.TileCellSize; - if (px1 < minX) - { - minX = px1; - } - else if (px1 > maxX) - { - maxX = px1; - } - - if (py1 < minY) - { - minY = py1; - } - else if (py1 > maxY) - { - maxY = py1; - } - - if (px2 < minX) - { - minX = px2; - } - else if (px2 > maxX) - { - maxX = px2; - } - } - break; - } - } - - minX -= GameConfig.TileCellSize; - minY -= GameConfig.TileCellSize; - maxX += GameConfig.TileCellSize; - maxY += GameConfig.TileCellSize; var staticSpriteCanvas = new RoomStaticImageCanvas( World.StaticSpriteRoot, new Vector2I(minX, minY), @@ -496,6 +425,19 @@ roomInfo.StaticImageCanvas = staticSpriteCanvas; } + //创建迷雾遮罩 + private void CreateRoomFogMask(RoomInfo roomInfo) + { + var roomFog = new RoomFogMask(); + roomFog.Name = "FogMask" + roomFog.IsDestroyed; + roomInfo.RoomFogMask = roomFog; + roomFog.Init(roomInfo, new Rect2I( + roomInfo.GetWorldPosition() - GameConfig.TileCellSizeVector2I, + (roomInfo.Size + new Vector2I(2, 2)) * GameConfig.TileCellSize) + ); + World.FogMaskRoot.AddChild(roomFog); + } + /// /// 玩家第一次进入某个房间回调 /// diff --git a/DungeonShooting_Godot/src/game/room/World.cs b/DungeonShooting_Godot/src/game/room/World.cs index a11e2fd..650d3da 100644 --- a/DungeonShooting_Godot/src/game/room/World.cs +++ b/DungeonShooting_Godot/src/game/room/World.cs @@ -5,7 +5,7 @@ /// /// 游戏世界 /// -public partial class World : Node2D, ICoroutine +public partial class World : CanvasModulate, ICoroutine { /// /// //对象根节点 @@ -24,6 +24,7 @@ [Export] public Node2D StaticSpriteRoot; [Export] public Node2D AffiliationAreaRoot; + [Export] public Node2D FogMaskRoot; /// /// 是否暂停 diff --git a/DungeonShooting_Godot/src/game/ui/main/Main.cs b/DungeonShooting_Godot/src/game/ui/main/Main.cs index fe49dfb..3db6d93 100644 --- a/DungeonShooting_Godot/src/game/ui/main/Main.cs +++ b/DungeonShooting_Godot/src/game/ui/main/Main.cs @@ -6,198 +6,230 @@ public abstract partial class Main : UiBase { /// - /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: Main.Title + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: Main.ColorRect /// - public Main_Title L_Title + public ColorRect L_ColorRect { get { - if (_L_Title == null) _L_Title = new Main_Title(this, GetNodeOrNull("Title")); + if (_L_ColorRect == null) _L_ColorRect = new ColorRect((MainPanel)this, GetNode("ColorRect")); + return _L_ColorRect; + } + } + private ColorRect _L_ColorRect; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: Main.Title + /// + public Title L_Title + { + get + { + if (_L_Title == null) _L_Title = new Title((MainPanel)this, GetNode("Title")); return _L_Title; } } - private Main_Title _L_Title; + private Title _L_Title; /// /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: Main.ButtonList /// - public Main_ButtonList L_ButtonList + public ButtonList L_ButtonList { get { - if (_L_ButtonList == null) _L_ButtonList = new Main_ButtonList(this, GetNodeOrNull("ButtonList")); + if (_L_ButtonList == null) _L_ButtonList = new ButtonList((MainPanel)this, GetNode("ButtonList")); return _L_ButtonList; } } - private Main_ButtonList _L_ButtonList; + private ButtonList _L_ButtonList; /// /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: Main.Version /// - public Main_Version L_Version + public Version L_Version { get { - if (_L_Version == null) _L_Version = new Main_Version(this, GetNodeOrNull("Version")); + if (_L_Version == null) _L_Version = new Version((MainPanel)this, GetNode("Version")); return _L_Version; } } - private Main_Version _L_Version; + private Version _L_Version; public Main() : base(nameof(Main)) { } + public sealed override void OnInitNestedUi() + { + + } + + /// + /// 类型: , 路径: Main.ColorRect + /// + public class ColorRect : UiNode + { + public ColorRect(MainPanel uiPanel, Godot.ColorRect node) : base(uiPanel, node) { } + public override ColorRect Clone() => new (UiPanel, (Godot.ColorRect)Instance.Duplicate()); + } + /// /// 类型: , 路径: Main.Title /// - public class Main_Title : UiNode + public class Title : UiNode { - public Main_Title(Main uiPanel, Godot.Label node) : base(uiPanel, node) { } - public override Main_Title Clone() => new (UiPanel, (Godot.Label)Instance.Duplicate()); + public Title(MainPanel uiPanel, Godot.Label node) : base(uiPanel, node) { } + public override Title Clone() => new (UiPanel, (Godot.Label)Instance.Duplicate()); } /// /// 类型: , 路径: Main.ButtonList.Start /// - public class Main_Start : UiNode + public class Start : UiNode { - public Main_Start(Main uiPanel, Godot.Button node) : base(uiPanel, node) { } - public override Main_Start Clone() => new (UiPanel, (Godot.Button)Instance.Duplicate()); + public Start(MainPanel uiPanel, Godot.Button node) : base(uiPanel, node) { } + public override Start Clone() => new (UiPanel, (Godot.Button)Instance.Duplicate()); } /// /// 类型: , 路径: Main.ButtonList.Tools /// - public class Main_Tools : UiNode + public class Tools : UiNode { - public Main_Tools(Main uiPanel, Godot.Button node) : base(uiPanel, node) { } - public override Main_Tools Clone() => new (UiPanel, (Godot.Button)Instance.Duplicate()); + public Tools(MainPanel uiPanel, Godot.Button node) : base(uiPanel, node) { } + public override Tools Clone() => new (UiPanel, (Godot.Button)Instance.Duplicate()); } /// /// 类型: , 路径: Main.ButtonList.Setting /// - public class Main_Setting : UiNode + public class Setting : UiNode { - public Main_Setting(Main uiPanel, Godot.Button node) : base(uiPanel, node) { } - public override Main_Setting Clone() => new (UiPanel, (Godot.Button)Instance.Duplicate()); + public Setting(MainPanel uiPanel, Godot.Button node) : base(uiPanel, node) { } + public override Setting Clone() => new (UiPanel, (Godot.Button)Instance.Duplicate()); } /// /// 类型: , 路径: Main.ButtonList.Exit /// - public class Main_Exit : UiNode + public class Exit : UiNode { - public Main_Exit(Main uiPanel, Godot.Button node) : base(uiPanel, node) { } - public override Main_Exit Clone() => new (UiPanel, (Godot.Button)Instance.Duplicate()); + public Exit(MainPanel uiPanel, Godot.Button node) : base(uiPanel, node) { } + public override Exit Clone() => new (UiPanel, (Godot.Button)Instance.Duplicate()); } /// /// 类型: , 路径: Main.ButtonList /// - public class Main_ButtonList : UiNode + public class ButtonList : UiNode { /// /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: Main.Start /// - public Main_Start L_Start + public Start L_Start { get { - if (_L_Start == null) _L_Start = new Main_Start(UiPanel, Instance.GetNodeOrNull("Start")); + if (_L_Start == null) _L_Start = new Start(UiPanel, Instance.GetNode("Start")); return _L_Start; } } - private Main_Start _L_Start; + private Start _L_Start; /// /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: Main.Tools /// - public Main_Tools L_Tools + public Tools L_Tools { get { - if (_L_Tools == null) _L_Tools = new Main_Tools(UiPanel, Instance.GetNodeOrNull("Tools")); + if (_L_Tools == null) _L_Tools = new Tools(UiPanel, Instance.GetNode("Tools")); return _L_Tools; } } - private Main_Tools _L_Tools; + private Tools _L_Tools; /// /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: Main.Setting /// - public Main_Setting L_Setting + public Setting L_Setting { get { - if (_L_Setting == null) _L_Setting = new Main_Setting(UiPanel, Instance.GetNode("Setting")); + if (_L_Setting == null) _L_Setting = new Setting(UiPanel, Instance.GetNode("Setting")); return _L_Setting; } } - private Main_Setting _L_Setting; + private Setting _L_Setting; /// /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: Main.Exit /// - public Main_Exit L_Exit + public Exit L_Exit { get { - if (_L_Exit == null) _L_Exit = new Main_Exit(UiPanel, Instance.GetNodeOrNull("Exit")); + if (_L_Exit == null) _L_Exit = new Exit(UiPanel, Instance.GetNode("Exit")); return _L_Exit; } } - private Main_Exit _L_Exit; + private Exit _L_Exit; - public Main_ButtonList(Main uiPanel, Godot.VBoxContainer node) : base(uiPanel, node) { } - public override Main_ButtonList Clone() => new (UiPanel, (Godot.VBoxContainer)Instance.Duplicate()); + public ButtonList(MainPanel uiPanel, Godot.VBoxContainer node) : base(uiPanel, node) { } + public override ButtonList Clone() => new (UiPanel, (Godot.VBoxContainer)Instance.Duplicate()); } /// /// 类型: , 路径: Main.Version /// - public class Main_Version : UiNode + public class Version : UiNode { - public Main_Version(Main uiPanel, Godot.Label node) : base(uiPanel, node) { } - public override Main_Version Clone() => new (UiPanel, (Godot.Label)Instance.Duplicate()); + public Version(MainPanel uiPanel, Godot.Label node) : base(uiPanel, node) { } + public override Version Clone() => new (UiPanel, (Godot.Label)Instance.Duplicate()); } /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: Main.ColorRect + /// + public ColorRect S_ColorRect => L_ColorRect; + + /// /// 场景中唯一名称的节点, 节点类型: , 节点路径: Main.Title /// - public Main_Title S_Title => L_Title; + public Title S_Title => L_Title; /// /// 场景中唯一名称的节点, 节点类型: , 节点路径: Main.ButtonList.Start /// - public Main_Start S_Start => L_ButtonList.L_Start; + public Start S_Start => L_ButtonList.L_Start; /// /// 场景中唯一名称的节点, 节点类型: , 节点路径: Main.ButtonList.Tools /// - public Main_Tools S_Tools => L_ButtonList.L_Tools; + public Tools S_Tools => L_ButtonList.L_Tools; /// /// 场景中唯一名称的节点, 节点类型: , 节点路径: Main.ButtonList.Setting /// - public Main_Setting S_Setting => L_ButtonList.L_Setting; + public Setting S_Setting => L_ButtonList.L_Setting; /// /// 场景中唯一名称的节点, 节点类型: , 节点路径: Main.ButtonList.Exit /// - public Main_Exit S_Exit => L_ButtonList.L_Exit; + public Exit S_Exit => L_ButtonList.L_Exit; /// /// 场景中唯一名称的节点, 节点类型: , 节点路径: Main.ButtonList /// - public Main_ButtonList S_ButtonList => L_ButtonList; + public ButtonList S_ButtonList => L_ButtonList; /// /// 场景中唯一名称的节点, 节点类型: , 节点路径: Main.Version /// - public Main_Version S_Version => L_Version; + public Version S_Version => L_Version; } diff --git a/DungeonShooting_Godot/src/game/ui/mapEditor/tileView/EditorTileMap.cs b/DungeonShooting_Godot/src/game/ui/mapEditor/tileView/EditorTileMap.cs index 9294497..686b15a 100644 --- a/DungeonShooting_Godot/src/game/ui/mapEditor/tileView/EditorTileMap.cs +++ b/DungeonShooting_Godot/src/game/ui/mapEditor/tileView/EditorTileMap.cs @@ -1,7 +1,5 @@ using System; using System.Collections.Generic; -using System.IO; -using System.Text.Json; using Godot; using Godot.Collections; using UI.MapEditorTools;