diff --git a/DungeonShooting_Godot/Silver.ttf b/DungeonShooting_Godot/Silver.ttf deleted file mode 100644 index 9d568c4..0000000 --- a/DungeonShooting_Godot/Silver.ttf +++ /dev/null Binary files differ diff --git a/DungeonShooting_Godot/Silver.ttf.import b/DungeonShooting_Godot/Silver.ttf.import deleted file mode 100644 index 0cb40e8..0000000 --- a/DungeonShooting_Godot/Silver.ttf.import +++ /dev/null @@ -1,33 +0,0 @@ -[remap] - -importer="font_data_dynamic" -type="FontFile" -uid="uid://byrf43x8my2ym" -path="res://.godot/imported/Silver.ttf-acf985a494ec9501dbab5d460c1c1e21.fontdata" - -[deps] - -source_file="res://Silver.ttf" -dest_files=["res://.godot/imported/Silver.ttf-acf985a494ec9501dbab5d460c1c1e21.fontdata"] - -[params] - -Rendering=null -antialiasing=1 -generate_mipmaps=false -multichannel_signed_distance_field=false -msdf_pixel_range=8 -msdf_size=48 -allow_system_fallback=true -force_autohinter=false -hinting=1 -subpixel_positioning=1 -oversampling=0.0 -Fallbacks=null -fallbacks=[] -Compress=null -compress=true -preload=[] -language_support={} -script_support={} -opentype_features={} diff --git a/DungeonShooting_Godot/SourceHanSerifCN-SemiBold.otf b/DungeonShooting_Godot/SourceHanSerifCN-SemiBold.otf deleted file mode 100644 index efa94cb..0000000 --- a/DungeonShooting_Godot/SourceHanSerifCN-SemiBold.otf +++ /dev/null Binary files differ diff --git a/DungeonShooting_Godot/SourceHanSerifCN-SemiBold.otf.import b/DungeonShooting_Godot/SourceHanSerifCN-SemiBold.otf.import deleted file mode 100644 index 3aed657..0000000 --- a/DungeonShooting_Godot/SourceHanSerifCN-SemiBold.otf.import +++ /dev/null @@ -1,33 +0,0 @@ -[remap] - -importer="font_data_dynamic" -type="FontFile" -uid="uid://cxje5ycy236ds" -path="res://.godot/imported/SourceHanSerifCN-SemiBold.otf-8dcf564a1a7bde5d3a872366b8020586.fontdata" - -[deps] - -source_file="res://SourceHanSerifCN-SemiBold.otf" -dest_files=["res://.godot/imported/SourceHanSerifCN-SemiBold.otf-8dcf564a1a7bde5d3a872366b8020586.fontdata"] - -[params] - -Rendering=null -antialiasing=1 -generate_mipmaps=false -multichannel_signed_distance_field=false -msdf_pixel_range=8 -msdf_size=48 -allow_system_fallback=true -force_autohinter=false -hinting=1 -subpixel_positioning=1 -oversampling=0.0 -Fallbacks=null -fallbacks=[] -Compress=null -compress=true -preload=[] -language_support={} -script_support={} -opentype_features={} diff --git a/DungeonShooting_Godot/prefab/Cursor.tscn b/DungeonShooting_Godot/prefab/Cursor.tscn index c228d62..728e892 100644 --- a/DungeonShooting_Godot/prefab/Cursor.tscn +++ b/DungeonShooting_Godot/prefab/Cursor.tscn @@ -1,9 +1,8 @@ -[gd_scene load_steps=4 format=3] +[gd_scene load_steps=4 format=3 uid="uid://d16r232hmj3ow"] -[ext_resource type="Texture2D" uid="uid://ct5v768lsf6nc" path="res://resource/sprite/ui/Cursor.png" id="1"] [ext_resource type="Script" path="res://src/game/Cursor.cs" id="2"] [ext_resource type="Texture2D" uid="uid://cjiiu86a42mnj" path="res://resource/sprite/ui/CursorCenter.png" id="2_2j135"] - +[ext_resource type="Texture2D" uid="uid://dta28v3fgkfru" path="res://resource/sprite/ui/cursors.png" id="3_ni3bs"] [node name="Cursor" type="Node2D"] z_index = 10 @@ -16,28 +15,36 @@ [node name="LT" type="Sprite2D" parent="."] scale = Vector2(4, 4) -texture = ExtResource("1") +texture = ExtResource("3_ni3bs") offset = Vector2(-2, -2) region_enabled = true -region_rect = Rect2(0, 0, 4, 4) +region_rect = Rect2(67, 35, 4, 4) [node name="LB" type="Sprite2D" parent="."] scale = Vector2(4, 4) -texture = ExtResource("1") +texture = ExtResource("3_ni3bs") offset = Vector2(-2, 2) region_enabled = true -region_rect = Rect2(0, 4, 4, 4) +region_rect = Rect2(67, 41, 4, 4) [node name="RT" type="Sprite2D" parent="."] scale = Vector2(4, 4) -texture = ExtResource("1") +texture = ExtResource("3_ni3bs") offset = Vector2(2, -2) region_enabled = true -region_rect = Rect2(4, 0, 4, 4) +region_rect = Rect2(73, 35, 4, 4) [node name="RB" type="Sprite2D" parent="."] scale = Vector2(4, 4) -texture = ExtResource("1") +texture = ExtResource("3_ni3bs") offset = Vector2(2, 2) region_enabled = true -region_rect = Rect2(4, 4, 4, 4) +region_rect = Rect2(73, 41, 4, 4) + +[node name="Finger" type="Sprite2D" parent="."] +visible = false +position = Vector2(8, 6) +scale = Vector2(4, 4) +texture = ExtResource("3_ni3bs") +region_enabled = true +region_rect = Rect2(68, 21, 7, 9) diff --git a/DungeonShooting_Godot/prefab/ui/Main.tscn b/DungeonShooting_Godot/prefab/ui/Main.tscn new file mode 100644 index 0000000..860fe85 --- /dev/null +++ b/DungeonShooting_Godot/prefab/ui/Main.tscn @@ -0,0 +1,81 @@ +[gd_scene load_steps=3 format=3 uid="uid://cd7hl6b2mn5c8"] + +[ext_resource type="Script" path="res://src/game/ui/main/MainPanel.cs" id="1_s44xr"] +[ext_resource type="Theme" uid="uid://drb1ajgvcih7p" path="res://resource/theme/theme1.tres" id="2_bbd6i"] + +[node name="Main" type="Control"] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +script = ExtResource("1_s44xr") + +[node name="Title" type="Label" parent="."] +layout_mode = 1 +anchors_preset = 10 +anchor_right = 1.0 +offset_top = 172.0 +offset_bottom = 405.0 +grow_horizontal = 2 +theme_override_font_sizes/font_size = 160 +text = "Program dungeon" +horizontal_alignment = 1 +vertical_alignment = 1 + +[node name="ButtonList" type="VBoxContainer" parent="."] +layout_mode = 1 +anchors_preset = 7 +anchor_left = 0.5 +anchor_top = 1.0 +anchor_right = 0.5 +anchor_bottom = 1.0 +offset_left = -96.0 +offset_top = -641.0 +offset_right = 96.0 +grow_horizontal = 2 +grow_vertical = 0 +alignment = 1 + +[node name="Start" type="Button" parent="ButtonList"] +custom_minimum_size = Vector2(0, 50) +layout_mode = 2 +focus_neighbor_top = NodePath("../Exit") +focus_neighbor_bottom = NodePath("../Setting") +theme = ExtResource("2_bbd6i") +text = "开始游戏 +" + +[node name="Setting" type="Button" parent="ButtonList"] +custom_minimum_size = Vector2(0, 50) +layout_mode = 2 +focus_neighbor_top = NodePath("../Start") +focus_neighbor_bottom = NodePath("../Exit") +theme = ExtResource("2_bbd6i") +theme_override_font_sizes/font_size = 32 +text = "设置" + +[node name="Exit" type="Button" parent="ButtonList"] +custom_minimum_size = Vector2(0, 50) +layout_mode = 2 +focus_neighbor_top = NodePath("../Setting") +focus_neighbor_bottom = NodePath("../Start") +theme = ExtResource("2_bbd6i") +text = "退出" + +[node name="Version" type="Label" parent="."] +layout_mode = 1 +anchors_preset = 3 +anchor_left = 1.0 +anchor_top = 1.0 +anchor_right = 1.0 +anchor_bottom = 1.0 +offset_left = -195.0 +offset_top = -53.0 +offset_right = -10.0 +offset_bottom = -1.0 +grow_horizontal = 0 +grow_vertical = 0 +text = "v0.01" +horizontal_alignment = 2 diff --git a/DungeonShooting_Godot/prefab/ui/RoomUI.tscn b/DungeonShooting_Godot/prefab/ui/RoomUI.tscn index 22dc29c..c202ded 100644 --- a/DungeonShooting_Godot/prefab/ui/RoomUI.tscn +++ b/DungeonShooting_Godot/prefab/ui/RoomUI.tscn @@ -23,6 +23,7 @@ anchor_bottom = 1.0 grow_horizontal = 2 grow_vertical = 2 +mouse_filter = 2 script = ExtResource("1_u48k1") [node name="InteractiveTipBar" type="Node2D" parent="."] @@ -64,6 +65,7 @@ offset_top = 20.0 offset_right = -20.0 offset_bottom = -20.0 +mouse_filter = 2 [node name="HealthBar" type="TextureRect" parent="Control"] layout_mode = 0 diff --git a/DungeonShooting_Godot/project.godot b/DungeonShooting_Godot/project.godot index d16c3b7..3e53d71 100644 --- a/DungeonShooting_Godot/project.godot +++ b/DungeonShooting_Godot/project.godot @@ -37,7 +37,6 @@ [gui] theme/custom="res://resource/theme/mainTheme.tres" -theme/custom_font="res://resource/font/cn_font_36.tres" [importer_defaults] diff --git a/DungeonShooting_Godot/resource/font/DinkieBitmap-7pxDemo.ttf b/DungeonShooting_Godot/resource/font/DinkieBitmap-7pxDemo.ttf new file mode 100644 index 0000000..55cbdf8 --- /dev/null +++ b/DungeonShooting_Godot/resource/font/DinkieBitmap-7pxDemo.ttf Binary files differ diff --git a/DungeonShooting_Godot/resource/font/DinkieBitmap-7pxDemo.ttf.import b/DungeonShooting_Godot/resource/font/DinkieBitmap-7pxDemo.ttf.import new file mode 100644 index 0000000..2d42770 --- /dev/null +++ b/DungeonShooting_Godot/resource/font/DinkieBitmap-7pxDemo.ttf.import @@ -0,0 +1,33 @@ +[remap] + +importer="font_data_dynamic" +type="FontFile" +uid="uid://c6ro3d4a83wcm" +path="res://.godot/imported/DinkieBitmap-7pxDemo.ttf-6bafb17be9ea4a6ad6662aafec72411d.fontdata" + +[deps] + +source_file="res://resource/font/DinkieBitmap-7pxDemo.ttf" +dest_files=["res://.godot/imported/DinkieBitmap-7pxDemo.ttf-6bafb17be9ea4a6ad6662aafec72411d.fontdata"] + +[params] + +Rendering=null +antialiasing=1 +generate_mipmaps=false +multichannel_signed_distance_field=false +msdf_pixel_range=8 +msdf_size=48 +allow_system_fallback=true +force_autohinter=false +hinting=1 +subpixel_positioning=1 +oversampling=0.0 +Fallbacks=null +fallbacks=[] +Compress=null +compress=true +preload=[] +language_support={} +script_support={} +opentype_features={} diff --git a/DungeonShooting_Godot/resource/font/DinkieBitmap-9pxDemo.ttf b/DungeonShooting_Godot/resource/font/DinkieBitmap-9pxDemo.ttf new file mode 100644 index 0000000..aedb541 --- /dev/null +++ b/DungeonShooting_Godot/resource/font/DinkieBitmap-9pxDemo.ttf Binary files differ diff --git a/DungeonShooting_Godot/resource/font/DinkieBitmap-9pxDemo.ttf.import b/DungeonShooting_Godot/resource/font/DinkieBitmap-9pxDemo.ttf.import new file mode 100644 index 0000000..71a2d7e --- /dev/null +++ b/DungeonShooting_Godot/resource/font/DinkieBitmap-9pxDemo.ttf.import @@ -0,0 +1,33 @@ +[remap] + +importer="font_data_dynamic" +type="FontFile" +uid="uid://xxfml3spcbee" +path="res://.godot/imported/DinkieBitmap-9pxDemo.ttf-15ad6b126041d3ee0dea32e690612521.fontdata" + +[deps] + +source_file="res://resource/font/DinkieBitmap-9pxDemo.ttf" +dest_files=["res://.godot/imported/DinkieBitmap-9pxDemo.ttf-15ad6b126041d3ee0dea32e690612521.fontdata"] + +[params] + +Rendering=null +antialiasing=1 +generate_mipmaps=false +multichannel_signed_distance_field=false +msdf_pixel_range=8 +msdf_size=48 +allow_system_fallback=true +force_autohinter=false +hinting=1 +subpixel_positioning=1 +oversampling=0.0 +Fallbacks=null +fallbacks=[] +Compress=null +compress=true +preload=[] +language_support={} +script_support={} +opentype_features={} diff --git a/DungeonShooting_Godot/resource/font/DinkieBitmap-9pxItalicDemo.ttf b/DungeonShooting_Godot/resource/font/DinkieBitmap-9pxItalicDemo.ttf new file mode 100644 index 0000000..e7675bb --- /dev/null +++ b/DungeonShooting_Godot/resource/font/DinkieBitmap-9pxItalicDemo.ttf Binary files differ diff --git a/DungeonShooting_Godot/resource/font/DinkieBitmap-9pxItalicDemo.ttf.import b/DungeonShooting_Godot/resource/font/DinkieBitmap-9pxItalicDemo.ttf.import new file mode 100644 index 0000000..36f4326 --- /dev/null +++ b/DungeonShooting_Godot/resource/font/DinkieBitmap-9pxItalicDemo.ttf.import @@ -0,0 +1,33 @@ +[remap] + +importer="font_data_dynamic" +type="FontFile" +uid="uid://lqhvyvsai0w8" +path="res://.godot/imported/DinkieBitmap-9pxItalicDemo.ttf-24f0ecfb4d0dfb2b13392a341f4c8e14.fontdata" + +[deps] + +source_file="res://resource/font/DinkieBitmap-9pxItalicDemo.ttf" +dest_files=["res://.godot/imported/DinkieBitmap-9pxItalicDemo.ttf-24f0ecfb4d0dfb2b13392a341f4c8e14.fontdata"] + +[params] + +Rendering=null +antialiasing=1 +generate_mipmaps=false +multichannel_signed_distance_field=false +msdf_pixel_range=8 +msdf_size=48 +allow_system_fallback=true +force_autohinter=false +hinting=1 +subpixel_positioning=1 +oversampling=0.0 +Fallbacks=null +fallbacks=[] +Compress=null +compress=true +preload=[] +language_support={} +script_support={} +opentype_features={} diff --git a/DungeonShooting_Godot/resource/font/VonwaonBitmap-12px.ttf b/DungeonShooting_Godot/resource/font/VonwaonBitmap-12px.ttf new file mode 100644 index 0000000..d337c4d --- /dev/null +++ b/DungeonShooting_Godot/resource/font/VonwaonBitmap-12px.ttf Binary files differ diff --git a/DungeonShooting_Godot/resource/font/VonwaonBitmap-12px.ttf.import b/DungeonShooting_Godot/resource/font/VonwaonBitmap-12px.ttf.import new file mode 100644 index 0000000..5bf5d21 --- /dev/null +++ b/DungeonShooting_Godot/resource/font/VonwaonBitmap-12px.ttf.import @@ -0,0 +1,33 @@ +[remap] + +importer="font_data_dynamic" +type="FontFile" +uid="uid://c7pjgpbp28igq" +path="res://.godot/imported/VonwaonBitmap-12px.ttf-f0c6f7ea0d11709c60f005cec9d12691.fontdata" + +[deps] + +source_file="res://resource/font/VonwaonBitmap-12px.ttf" +dest_files=["res://.godot/imported/VonwaonBitmap-12px.ttf-f0c6f7ea0d11709c60f005cec9d12691.fontdata"] + +[params] + +Rendering=null +antialiasing=1 +generate_mipmaps=false +multichannel_signed_distance_field=false +msdf_pixel_range=8 +msdf_size=48 +allow_system_fallback=true +force_autohinter=false +hinting=1 +subpixel_positioning=1 +oversampling=0.0 +Fallbacks=null +fallbacks=[] +Compress=null +compress=true +preload=[] +language_support={} +script_support={} +opentype_features={} diff --git a/DungeonShooting_Godot/resource/font/VonwaonBitmap-16px.ttf b/DungeonShooting_Godot/resource/font/VonwaonBitmap-16px.ttf new file mode 100644 index 0000000..a956053 --- /dev/null +++ b/DungeonShooting_Godot/resource/font/VonwaonBitmap-16px.ttf Binary files differ diff --git a/DungeonShooting_Godot/resource/font/VonwaonBitmap-16px.ttf.import b/DungeonShooting_Godot/resource/font/VonwaonBitmap-16px.ttf.import new file mode 100644 index 0000000..4c35ce8 --- /dev/null +++ b/DungeonShooting_Godot/resource/font/VonwaonBitmap-16px.ttf.import @@ -0,0 +1,33 @@ +[remap] + +importer="font_data_dynamic" +type="FontFile" +uid="uid://cad0in7dtweo5" +path="res://.godot/imported/VonwaonBitmap-16px.ttf-45ba1c29e0693eadade28feaced5d034.fontdata" + +[deps] + +source_file="res://resource/font/VonwaonBitmap-16px.ttf" +dest_files=["res://.godot/imported/VonwaonBitmap-16px.ttf-45ba1c29e0693eadade28feaced5d034.fontdata"] + +[params] + +Rendering=null +antialiasing=1 +generate_mipmaps=false +multichannel_signed_distance_field=false +msdf_pixel_range=8 +msdf_size=48 +allow_system_fallback=true +force_autohinter=false +hinting=1 +subpixel_positioning=1 +oversampling=0.0 +Fallbacks=null +fallbacks=[] +Compress=null +compress=true +preload=[] +language_support={} +script_support={} +opentype_features={} diff --git a/DungeonShooting_Godot/resource/font/cn_font_12.tres b/DungeonShooting_Godot/resource/font/cn_font_12.tres deleted file mode 100644 index df37088..0000000 --- a/DungeonShooting_Godot/resource/font/cn_font_12.tres +++ /dev/null @@ -1,9 +0,0 @@ -[gd_resource type="FontFile" load_steps=2 format=2] - -[ext_resource path="res://Silver.ttf" type="FontFile" id=1] - -[resource] -size = 12 -extra_spacing_top = -2 -extra_spacing_bottom = -2 -font_data = ExtResource( 1 ) diff --git a/DungeonShooting_Godot/resource/font/cn_font_18.tres b/DungeonShooting_Godot/resource/font/cn_font_18.tres deleted file mode 100644 index 8b55445..0000000 --- a/DungeonShooting_Godot/resource/font/cn_font_18.tres +++ /dev/null @@ -1,7 +0,0 @@ -[gd_resource type="FontFile" load_steps=2 format=2] - -[ext_resource path="res://Silver.ttf" type="FontFile" id=1] - -[resource] -size = 18 -font_data = ExtResource( 1 ) diff --git a/DungeonShooting_Godot/resource/font/cn_font_36.tres b/DungeonShooting_Godot/resource/font/cn_font_36.tres deleted file mode 100644 index c7f99f1..0000000 --- a/DungeonShooting_Godot/resource/font/cn_font_36.tres +++ /dev/null @@ -1,7 +0,0 @@ -[gd_resource type="FontFile" load_steps=2 format=2] - -[ext_resource path="res://Silver.ttf" type="FontFile" id=1] - -[resource] -size = 36 -font_data = ExtResource( 1 ) diff --git a/DungeonShooting_Godot/resource/sprite/ui/Cursor.png b/DungeonShooting_Godot/resource/sprite/ui/Cursor.png deleted file mode 100644 index 068c198..0000000 --- a/DungeonShooting_Godot/resource/sprite/ui/Cursor.png +++ /dev/null Binary files differ diff --git a/DungeonShooting_Godot/resource/sprite/ui/Cursor.png.import b/DungeonShooting_Godot/resource/sprite/ui/Cursor.png.import deleted file mode 100644 index 611d10f..0000000 --- a/DungeonShooting_Godot/resource/sprite/ui/Cursor.png.import +++ /dev/null @@ -1,34 +0,0 @@ -[remap] - -importer="texture" -type="CompressedTexture2D" -uid="uid://ct5v768lsf6nc" -path="res://.godot/imported/Cursor.png-8fd0f20a3d3b122868ba81366de2aaf6.ctex" -metadata={ -"vram_texture": false -} - -[deps] - -source_file="res://resource/sprite/ui/Cursor.png" -dest_files=["res://.godot/imported/Cursor.png-8fd0f20a3d3b122868ba81366de2aaf6.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/ui/GUI.png b/DungeonShooting_Godot/resource/sprite/ui/GUI.png new file mode 100644 index 0000000..56475ca --- /dev/null +++ b/DungeonShooting_Godot/resource/sprite/ui/GUI.png Binary files differ diff --git a/DungeonShooting_Godot/resource/sprite/ui/GUI.png.import b/DungeonShooting_Godot/resource/sprite/ui/GUI.png.import new file mode 100644 index 0000000..6ae4ae9 --- /dev/null +++ b/DungeonShooting_Godot/resource/sprite/ui/GUI.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://5adiy3ycqyxw" +path="res://.godot/imported/GUI.png-56ce605f877ce7100610e88d3451eb06.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://resource/sprite/ui/GUI.png" +dest_files=["res://.godot/imported/GUI.png-56ce605f877ce7100610e88d3451eb06.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/ui/cursors.png b/DungeonShooting_Godot/resource/sprite/ui/cursors.png new file mode 100644 index 0000000..b40cfe5 --- /dev/null +++ b/DungeonShooting_Godot/resource/sprite/ui/cursors.png Binary files differ diff --git a/DungeonShooting_Godot/resource/sprite/ui/cursors.png.import b/DungeonShooting_Godot/resource/sprite/ui/cursors.png.import new file mode 100644 index 0000000..2460561 --- /dev/null +++ b/DungeonShooting_Godot/resource/sprite/ui/cursors.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dta28v3fgkfru" +path="res://.godot/imported/cursors.png-39228cc5284ece278357dbc1a5b6c668.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://resource/sprite/ui/cursors.png" +dest_files=["res://.godot/imported/cursors.png-39228cc5284ece278357dbc1a5b6c668.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/theme/mainTheme.tres b/DungeonShooting_Godot/resource/theme/mainTheme.tres index f0db64e..66396a6 100644 --- a/DungeonShooting_Godot/resource/theme/mainTheme.tres +++ b/DungeonShooting_Godot/resource/theme/mainTheme.tres @@ -1,6 +1,6 @@ -[gd_resource type="Theme" load_steps=78 format=3 uid="uid://cyfdqgfonv22k"] +[gd_resource type="Theme" load_steps=78 format=3 uid="uid://ds668te2rph30"] -[ext_resource type="FontFile" uid="uid://byrf43x8my2ym" path="res://Silver.ttf" id="1_cylyq"] +[ext_resource type="FontFile" uid="uid://cad0in7dtweo5" path="res://resource/font/VonwaonBitmap-16px.ttf" id="1_sqmbn"] [sub_resource type="StyleBoxFlat" id="1"] content_margin_left = 6.0 @@ -352,7 +352,7 @@ [sub_resource type="ImageTexture" id="58"] -[sub_resource type="Image" id="Image_151oh"] +[sub_resource type="Image" id="Image_ej516"] data = { "data": PackedByteArray(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 1, 255, 255, 255, 39, 255, 255, 255, 67, 255, 255, 255, 67, 255, 255, 255, 39, 255, 255, 255, 1, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 39, 255, 255, 255, 75, 255, 255, 255, 75, 255, 255, 255, 75, 255, 255, 255, 75, 255, 255, 255, 39, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 66, 255, 255, 255, 75, 255, 255, 255, 75, 255, 255, 255, 75, 255, 255, 255, 75, 255, 255, 255, 66, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 66, 255, 255, 255, 75, 255, 255, 255, 75, 255, 255, 255, 75, 255, 255, 255, 75, 255, 255, 255, 66, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 39, 255, 255, 255, 75, 255, 255, 255, 75, 255, 255, 255, 75, 255, 255, 255, 75, 255, 255, 255, 39, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 1, 255, 255, 255, 39, 255, 255, 255, 67, 255, 255, 255, 67, 255, 255, 255, 39, 255, 255, 255, 1, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), "format": "RGBA8", @@ -362,7 +362,7 @@ } [sub_resource type="ImageTexture" id="60"] -image = SubResource("Image_151oh") +image = SubResource("Image_ej516") [sub_resource type="StyleBoxTexture" id="61"] content_margin_left = 2.0 @@ -372,7 +372,7 @@ texture = SubResource("60") region_rect = Rect2(0, 0, 12, 12) -[sub_resource type="Image" id="Image_ev2o0"] +[sub_resource type="Image" id="Image_irjg3"] data = { "data": PackedByteArray(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 191, 191, 191, 0, 247, 247, 247, 0, 248, 248, 248, 0, 248, 248, 248, 0, 247, 247, 247, 0, 191, 191, 191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 191, 191, 191, 0, 191, 191, 191, 4, 247, 247, 247, 98, 248, 248, 248, 167, 248, 248, 248, 167, 247, 247, 247, 98, 191, 191, 191, 4, 191, 191, 191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 247, 247, 247, 0, 247, 247, 247, 97, 248, 248, 248, 186, 248, 248, 248, 186, 248, 248, 248, 186, 248, 248, 248, 186, 247, 247, 247, 97, 247, 247, 247, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 248, 248, 248, 0, 248, 248, 248, 164, 248, 248, 248, 186, 248, 248, 248, 186, 248, 248, 248, 186, 248, 248, 248, 186, 248, 248, 248, 164, 248, 248, 248, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 248, 248, 248, 0, 248, 248, 248, 164, 248, 248, 248, 186, 248, 248, 248, 186, 248, 248, 248, 186, 248, 248, 248, 186, 248, 248, 248, 164, 248, 248, 248, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 247, 247, 247, 0, 247, 247, 247, 97, 248, 248, 248, 186, 248, 248, 248, 186, 248, 248, 248, 186, 248, 248, 248, 186, 247, 247, 247, 97, 247, 247, 247, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 191, 191, 191, 0, 191, 191, 191, 4, 247, 247, 247, 98, 248, 248, 248, 167, 248, 248, 248, 167, 247, 247, 247, 98, 191, 191, 191, 4, 191, 191, 191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 191, 191, 191, 0, 247, 247, 247, 0, 248, 248, 248, 0, 248, 248, 248, 0, 247, 247, 247, 0, 191, 191, 191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), "format": "RGBA8", @@ -382,7 +382,7 @@ } [sub_resource type="ImageTexture" id="63"] -image = SubResource("Image_ev2o0") +image = SubResource("Image_irjg3") [sub_resource type="StyleBoxTexture" id="64"] content_margin_left = 2.0 @@ -392,7 +392,7 @@ texture = SubResource("63") region_rect = Rect2(0, 0, 12, 12) -[sub_resource type="Image" id="Image_22as7"] +[sub_resource type="Image" id="Image_lj2yv"] data = { "data": PackedByteArray(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 127, 127, 127, 0, 173, 173, 173, 0, 173, 173, 173, 0, 173, 173, 173, 0, 173, 173, 173, 0, 127, 127, 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 127, 127, 127, 0, 127, 127, 127, 4, 173, 173, 173, 97, 173, 173, 173, 166, 173, 173, 173, 166, 173, 173, 173, 97, 127, 127, 127, 4, 127, 127, 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 172, 172, 172, 0, 172, 172, 172, 96, 173, 173, 173, 185, 173, 173, 173, 185, 173, 173, 173, 185, 173, 173, 173, 185, 172, 172, 172, 96, 172, 172, 172, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 173, 173, 173, 0, 173, 173, 173, 163, 173, 173, 173, 185, 173, 173, 173, 185, 173, 173, 173, 185, 173, 173, 173, 185, 173, 173, 173, 163, 173, 173, 173, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 173, 173, 173, 0, 173, 173, 173, 163, 173, 173, 173, 185, 173, 173, 173, 185, 173, 173, 173, 185, 173, 173, 173, 185, 173, 173, 173, 163, 173, 173, 173, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 172, 172, 172, 0, 172, 172, 172, 96, 173, 173, 173, 185, 173, 173, 173, 185, 173, 173, 173, 185, 173, 173, 173, 185, 172, 172, 172, 96, 172, 172, 172, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 127, 127, 127, 0, 127, 127, 127, 4, 173, 173, 173, 97, 173, 173, 173, 166, 173, 173, 173, 166, 173, 173, 173, 97, 127, 127, 127, 4, 127, 127, 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 127, 127, 127, 0, 173, 173, 173, 0, 173, 173, 173, 0, 173, 173, 173, 0, 173, 173, 173, 0, 127, 127, 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), "format": "RGBA8", @@ -402,7 +402,7 @@ } [sub_resource type="ImageTexture" id="66"] -image = SubResource("Image_22as7") +image = SubResource("Image_lj2yv") [sub_resource type="StyleBoxTexture" id="67"] content_margin_left = 2.0 @@ -412,7 +412,7 @@ texture = SubResource("66") region_rect = Rect2(0, 0, 12, 12) -[sub_resource type="Image" id="Image_xsoii"] +[sub_resource type="Image" id="Image_1x5ku"] data = { "data": PackedByteArray(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 4, 255, 255, 255, 16, 255, 255, 255, 16, 255, 255, 255, 4, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 16, 255, 255, 255, 21, 255, 255, 255, 21, 255, 255, 255, 16, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 16, 255, 255, 255, 21, 255, 255, 255, 21, 255, 255, 255, 16, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 4, 255, 255, 255, 16, 255, 255, 255, 16, 255, 255, 255, 4, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), "format": "RGBA8", @@ -422,7 +422,7 @@ } [sub_resource type="ImageTexture" id="69"] -image = SubResource("Image_xsoii") +image = SubResource("Image_1x5ku") [sub_resource type="StyleBoxTexture" id="70"] content_margin_left = 0.0 @@ -446,7 +446,7 @@ content_margin_right = 4.0 content_margin_bottom = 4.0 -[sub_resource type="Image" id="Image_g5uvy"] +[sub_resource type="Image" id="Image_caf60"] data = { "data": PackedByteArray(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 76, 255, 255, 255, 17, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 17, 255, 255, 255, 76, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 76, 255, 255, 255, 228, 255, 255, 255, 188, 255, 255, 255, 17, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 17, 255, 255, 255, 188, 255, 255, 255, 228, 255, 255, 255, 76, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 18, 255, 255, 255, 188, 255, 255, 255, 229, 255, 255, 255, 187, 255, 255, 255, 17, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 17, 255, 255, 255, 187, 255, 255, 255, 229, 255, 255, 255, 188, 255, 255, 255, 18, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 19, 255, 255, 255, 188, 255, 255, 255, 229, 255, 255, 255, 185, 255, 255, 255, 17, 255, 255, 255, 17, 255, 255, 255, 186, 255, 255, 255, 229, 255, 255, 255, 188, 255, 255, 255, 19, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 19, 255, 255, 255, 190, 255, 255, 255, 229, 255, 255, 255, 185, 255, 255, 255, 185, 255, 255, 255, 229, 255, 255, 255, 189, 255, 255, 255, 19, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 19, 255, 255, 255, 191, 255, 255, 255, 229, 255, 255, 255, 229, 255, 255, 255, 190, 255, 255, 255, 19, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 17, 255, 255, 255, 188, 255, 255, 255, 229, 255, 255, 255, 229, 255, 255, 255, 188, 255, 255, 255, 17, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 17, 255, 255, 255, 188, 255, 255, 255, 229, 255, 255, 255, 188, 255, 255, 255, 188, 255, 255, 255, 229, 255, 255, 255, 187, 255, 255, 255, 17, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 17, 255, 255, 255, 187, 255, 255, 255, 229, 255, 255, 255, 188, 255, 255, 255, 18, 255, 255, 255, 19, 255, 255, 255, 188, 255, 255, 255, 229, 255, 255, 255, 186, 255, 255, 255, 17, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 17, 255, 255, 255, 185, 255, 255, 255, 229, 255, 255, 255, 189, 255, 255, 255, 19, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 19, 255, 255, 255, 189, 255, 255, 255, 229, 255, 255, 255, 185, 255, 255, 255, 17, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 76, 255, 255, 255, 229, 255, 255, 255, 190, 255, 255, 255, 19, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 19, 255, 255, 255, 190, 255, 255, 255, 229, 255, 255, 255, 76, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 77, 255, 255, 255, 19, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 19, 255, 255, 255, 77, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), "format": "RGBA8", @@ -456,7 +456,7 @@ } [sub_resource type="ImageTexture" id="56"] -image = SubResource("Image_g5uvy") +image = SubResource("Image_caf60") [sub_resource type="StyleBoxFlat" id="57"] content_margin_left = 6.0 @@ -506,8 +506,8 @@ region_rect = Rect2(0, 0, 12, 12) [resource] -default_font = ExtResource("1_cylyq") -default_font_size = 36 +default_font = ExtResource("1_sqmbn") +default_font_size = 32 Button/colors/font_color = Color(0.780392, 0.780392, 0.780392, 1) Button/colors/font_color_disabled = Color(1, 1, 1, 0.3) Button/colors/font_color_focus = Color(0.868235, 0.868235, 0.868235, 1) @@ -516,7 +516,7 @@ Button/colors/icon_color_hover = Color(1.15, 1.15, 1.15, 1) Button/colors/icon_color_pressed = Color(0.135294, 0.496079, 1.04176, 1) Button/constants/hseparation = 2 -Button/fonts/font = ExtResource("1_cylyq") +Button/fonts/font = ExtResource("1_sqmbn") Button/styles/disabled = SubResource("1") Button/styles/focus = SubResource("2") Button/styles/hover = SubResource("3") @@ -618,7 +618,7 @@ Label/constants/shadow_as_outline = 0 Label/constants/shadow_offset_x = 1 Label/constants/shadow_offset_y = 1 -Label/fonts/font = ExtResource("1_cylyq") +Label/fonts/font = ExtResource("1_sqmbn") Label/styles/normal = SubResource("54") LineEdit/colors/clear_button_color = Color(0.780392, 0.780392, 0.780392, 1) LineEdit/colors/clear_button_color_pressed = Color(0.117647, 0.431373, 0.905882, 1) @@ -629,7 +629,7 @@ LineEdit/colors/read_only = Color(1, 1, 1, 0.3) LineEdit/colors/selection_color = Color(0.117647, 0.431373, 0.905882, 0.4) LineEdit/constants/minimum_spaces = 12 -LineEdit/fonts/font = ExtResource("1_cylyq") +LineEdit/fonts/font = ExtResource("1_sqmbn") LineEdit/icons/clear = SubResource("56") LineEdit/styles/focus = SubResource("2") LineEdit/styles/normal = SubResource("4") diff --git a/DungeonShooting_Godot/resource/theme/theme1.tres b/DungeonShooting_Godot/resource/theme/theme1.tres new file mode 100644 index 0000000..b7e11f2 --- /dev/null +++ b/DungeonShooting_Godot/resource/theme/theme1.tres @@ -0,0 +1,23 @@ +[gd_resource type="Theme" load_steps=6 format=3 uid="uid://drb1ajgvcih7p"] + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_hp72k"] +bg_color = Color(1, 1, 1, 0) + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_s1akm"] +bg_color = Color(1, 1, 1, 0) + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_d8v3b"] +bg_color = Color(1, 1, 1, 0) + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_8y7k3"] +bg_color = Color(1, 1, 1, 0) + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_2imip"] +bg_color = Color(1, 1, 1, 0) + +[resource] +Button/styles/disabled = SubResource("StyleBoxFlat_hp72k") +Button/styles/focus = SubResource("StyleBoxFlat_s1akm") +Button/styles/hover = SubResource("StyleBoxFlat_d8v3b") +Button/styles/normal = SubResource("StyleBoxFlat_8y7k3") +Button/styles/pressed = SubResource("StyleBoxFlat_2imip") diff --git a/DungeonShooting_Godot/scene/Room.tscn b/DungeonShooting_Godot/scene/Room.tscn deleted file mode 100644 index cfa9de3..0000000 --- a/DungeonShooting_Godot/scene/Room.tscn +++ /dev/null @@ -1,53 +0,0 @@ -[gd_scene load_steps=4 format=3 uid="uid://bqf2vks5ggnsp"] - -[ext_resource type="Script" path="res://src/game/room/RoomManager.cs" id="1_3w1c7"] -[ext_resource type="TileSet" uid="uid://b00g22o1cqhe8" path="res://resource/map/tileset/TileSet1.tres" id="2_30rar"] - -[sub_resource type="Environment" id="Environment_ji6mi"] -background_mode = 3 -glow_enabled = true -glow_intensity = 4.74 - -[node name="Room" type="Node2D" node_paths=PackedStringArray("NormalLayer", "YSortLayer", "TileRoot")] -script = ExtResource("1_3w1c7") -NormalLayer = NodePath("NormalLayer") -YSortLayer = NodePath("YSortLayer") -TileRoot = NodePath("TileRoot") -metadata/_edit_vertical_guides_ = [] - -[node name="WorldEnvironment" type="WorldEnvironment" parent="."] -environment = SubResource("Environment_ji6mi") - -[node name="TileRoot" type="TileMap" parent="."] -y_sort_enabled = true -tile_set = ExtResource("2_30rar") -format = 2 -layer_0/name = "Floor" -layer_0/z_index = -10 -layer_1/name = "Middle" -layer_1/enabled = true -layer_1/modulate = Color(1, 1, 1, 1) -layer_1/y_sort_enabled = false -layer_1/y_sort_origin = 0 -layer_1/z_index = 0 -layer_1/tile_data = PackedInt32Array() -layer_2/name = "Top" -layer_2/enabled = true -layer_2/modulate = Color(1, 1, 1, 1) -layer_2/y_sort_enabled = false -layer_2/y_sort_origin = 0 -layer_2/z_index = 10 -layer_2/tile_data = PackedInt32Array() -layer_3/name = "AisleFloor" -layer_3/enabled = true -layer_3/modulate = Color(1, 1, 1, 1) -layer_3/y_sort_enabled = true -layer_3/y_sort_origin = 0 -layer_3/z_index = -10 -layer_3/tile_data = PackedInt32Array() - -[node name="NormalLayer" type="Node2D" parent="."] -z_index = -1 - -[node name="YSortLayer" type="Node2D" parent="."] -y_sort_enabled = true diff --git a/DungeonShooting_Godot/scene/World.tscn b/DungeonShooting_Godot/scene/World.tscn new file mode 100644 index 0000000..6fc6f5b --- /dev/null +++ b/DungeonShooting_Godot/scene/World.tscn @@ -0,0 +1,53 @@ +[gd_scene load_steps=4 format=3 uid="uid://bqf2vks5ggnsp"] + +[ext_resource type="Script" path="res://src/game/room/World.cs" id="1_xc5pm"] +[ext_resource type="TileSet" uid="uid://b00g22o1cqhe8" path="res://resource/map/tileset/TileSet1.tres" id="2_n61nn"] + +[sub_resource type="Environment" id="Environment_ji6mi"] +background_mode = 3 +glow_enabled = true +glow_intensity = 4.74 + +[node name="World" type="Node2D" node_paths=PackedStringArray("NormalLayer", "YSortLayer", "TileRoot")] +script = ExtResource("1_xc5pm") +NormalLayer = NodePath("NormalLayer") +YSortLayer = NodePath("YSortLayer") +TileRoot = NodePath("TileRoot") +metadata/_edit_vertical_guides_ = [] + +[node name="WorldEnvironment" type="WorldEnvironment" parent="."] +environment = SubResource("Environment_ji6mi") + +[node name="TileRoot" type="TileMap" parent="."] +y_sort_enabled = true +tile_set = ExtResource("2_n61nn") +format = 2 +layer_0/name = "Floor" +layer_0/z_index = -10 +layer_1/name = "Middle" +layer_1/enabled = true +layer_1/modulate = Color(1, 1, 1, 1) +layer_1/y_sort_enabled = false +layer_1/y_sort_origin = 0 +layer_1/z_index = 0 +layer_1/tile_data = PackedInt32Array() +layer_2/name = "Top" +layer_2/enabled = true +layer_2/modulate = Color(1, 1, 1, 1) +layer_2/y_sort_enabled = false +layer_2/y_sort_origin = 0 +layer_2/z_index = 10 +layer_2/tile_data = PackedInt32Array() +layer_3/name = "AisleFloor" +layer_3/enabled = true +layer_3/modulate = Color(1, 1, 1, 1) +layer_3/y_sort_enabled = true +layer_3/y_sort_origin = 0 +layer_3/z_index = -10 +layer_3/tile_data = PackedInt32Array() + +[node name="NormalLayer" type="Node2D" parent="."] +z_index = -1 + +[node name="YSortLayer" type="Node2D" parent="."] +y_sort_enabled = true diff --git a/DungeonShooting_Godot/src/framework/activity/ActivityObject.cs b/DungeonShooting_Godot/src/framework/activity/ActivityObject.cs index 33060d8..7e73d3c 100644 --- a/DungeonShooting_Godot/src/framework/activity/ActivityObject.cs +++ b/DungeonShooting_Godot/src/framework/activity/ActivityObject.cs @@ -511,7 +511,7 @@ { _currLayer = layer; var parent = GetParent(); - var root = GameApplication.Instance.RoomManager.GetRoomLayer(layer); + var root = GameApplication.Instance.World.GetRoomLayer(layer); if (parent != root) { if (parent != null) @@ -564,12 +564,12 @@ var parent = GetParent(); if (parent == null) { - GameApplication.Instance.RoomManager.YSortLayer.AddChild(this); + GameApplication.Instance.World.YSortLayer.AddChild(this); } - else if (parent != GameApplication.Instance.RoomManager.YSortLayer) + else if (parent != GameApplication.Instance.World.YSortLayer) { parent.RemoveChild(this); - GameApplication.Instance.RoomManager.YSortLayer.AddChild(this); + GameApplication.Instance.World.YSortLayer.AddChild(this); } Altitude = altitude; @@ -1063,7 +1063,7 @@ { this.AddToActivityRoot(RoomLayerEnum.YSortLayer); } - else if (parent == GameApplication.Instance.RoomManager.NormalLayer) + else if (parent == GameApplication.Instance.World.NormalLayer) { parent.RemoveChild(this); this.AddToActivityRoot(RoomLayerEnum.YSortLayer); @@ -1149,7 +1149,7 @@ private void ThrowOver() { var parent = GetParent(); - var roomLayer = GameApplication.Instance.RoomManager.GetRoomLayer(_currLayer); + var roomLayer = GameApplication.Instance.World.GetRoomLayer(_currLayer); if (parent != roomLayer) { parent.RemoveChild(this); diff --git a/DungeonShooting_Godot/src/framework/common/NodeExtend.cs b/DungeonShooting_Godot/src/framework/common/NodeExtend.cs index 3f77676..f9bea2d 100644 --- a/DungeonShooting_Godot/src/framework/common/NodeExtend.cs +++ b/DungeonShooting_Godot/src/framework/common/NodeExtend.cs @@ -47,6 +47,6 @@ /// 放入的层 public static void AddToActivityRoot(this Node2D node, RoomLayerEnum layer) { - GameApplication.Instance.RoomManager.GetRoomLayer(layer).AddChild(node); + GameApplication.Instance.World.GetRoomLayer(layer).AddChild(node); } } \ No newline at end of file diff --git a/DungeonShooting_Godot/src/framework/map/DungeonConfig.cs b/DungeonShooting_Godot/src/framework/map/DungeonConfig.cs new file mode 100644 index 0000000..e38ebbf --- /dev/null +++ b/DungeonShooting_Godot/src/framework/map/DungeonConfig.cs @@ -0,0 +1,12 @@ + +/// +/// 生成地牢的配置 +/// +public class DungeonConfig +{ + /// + /// 地牢组名称 + /// + public string GroupName; + +} \ No newline at end of file diff --git a/DungeonShooting_Godot/src/framework/map/DungeonGenerator.cs b/DungeonShooting_Godot/src/framework/map/DungeonGenerator.cs index 0d581c1..2978531 100644 --- a/DungeonShooting_Godot/src/framework/map/DungeonGenerator.cs +++ b/DungeonShooting_Godot/src/framework/map/DungeonGenerator.cs @@ -60,8 +60,8 @@ //最大尝试次数 private int _maxTryCount = 10; - //房间组名称 - private string _groupName; + //地牢配置 + private DungeonConfig _config; private DungeonRoomGroup _roomGroup; //指定只能生成的房间 @@ -92,26 +92,26 @@ } #endif - public DungeonGenerator(string groupName) + public DungeonGenerator(DungeonConfig config) { - _groupName = groupName; - _roomGroup = GameApplication.Instance.RoomConfig[_groupName]; + _config = config; + _roomGroup = GameApplication.Instance.RoomConfig[config.GroupName]; //验证该组是否满足生成地牢的条件 if (_roomGroup.InletList.Count == 0) { - throw new Exception("当前组'" + groupName + "'中没有起始房间, 不能生成地牢!"); + throw new Exception("当前组'" + config.GroupName + "'中没有起始房间, 不能生成地牢!"); } //没有指定房间 if (_designatedRoom == null || _designatedRoom.Count == 0) { if (_roomGroup.OutletList.Count == 0) { - throw new Exception("当前组'" + groupName + "'中没有结束房间, 不能生成地牢!"); + throw new Exception("当前组'" + config.GroupName + "'中没有结束房间, 不能生成地牢!"); } else if (_roomGroup.BattleList.Count == 0) { - throw new Exception("当前组'" + groupName + "'中没有战斗房间, 不能生成地牢!"); + throw new Exception("当前组'" + config.GroupName + "'中没有战斗房间, 不能生成地牢!"); } } diff --git a/DungeonShooting_Godot/src/framework/map/mark/ActivityMark.cs b/DungeonShooting_Godot/src/framework/map/mark/ActivityMark.cs index 7c71e58..ca86d01 100644 --- a/DungeonShooting_Godot/src/framework/map/mark/ActivityMark.cs +++ b/DungeonShooting_Godot/src/framework/map/mark/ActivityMark.cs @@ -80,9 +80,6 @@ private float _timer = 0; private RoomInfo _tempRoom; - //绘制的字体 - private static Font _drawFont; - //已经计算好要生成的物体 private Dictionary _currentExpression = new Dictionary(); @@ -271,12 +268,8 @@ { DrawRect(new Rect2(-BirthRect / 2, BirthRect), drawColor, false, 0.5f); } - - if (_drawFont == null) - { - _drawFont = ResourceManager.Load(ResourcePath.Silver_ttf); - } - DrawString(_drawFont, new Vector2(-14, 12), WaveNumber.ToString(), HorizontalAlignment.Center, 28, 14); + + DrawString(ResourceManager.DefaultFont, new Vector2(-14, 12), WaveNumber.ToString(), HorizontalAlignment.Center, 28, 14); } } #endif diff --git a/DungeonShooting_Godot/src/game/Cursor.cs b/DungeonShooting_Godot/src/game/Cursor.cs index 639c7cd..12d0c5d 100644 --- a/DungeonShooting_Godot/src/game/Cursor.cs +++ b/DungeonShooting_Godot/src/game/Cursor.cs @@ -5,6 +5,36 @@ /// public partial class Cursor : Node2D { + public enum CursorStyle + { + /// + /// 手指 + /// + Finger, + /// + /// 准心模式 + /// + Sight, + } + + /// + /// 准心样式 + /// + public CursorStyle Style + { + get => _style; + set + { + if (_style != value) + { + _style = value; + SetStyle(value); + } + } + } + + private CursorStyle _style; + /// /// 是否是GUI模式 /// @@ -20,6 +50,7 @@ private Sprite2D lb; private Sprite2D rt; private Sprite2D rb; + private Sprite2D finger; public override void _Ready() { @@ -28,24 +59,29 @@ lb = GetNode("LB"); rt = GetNode("RT"); rb = GetNode("RB"); + finger = GetNode("Finger"); + SetStyle(CursorStyle.Finger); } public override void _Process(double delta) { - if (_isGuiMode) + if (_style == CursorStyle.Sight) { - SetScope(0, null); - } - else - { - var targetGun = _mountRole?.Holster.ActiveWeapon; - if (targetGun != null) + if (_isGuiMode) { - SetScope(targetGun.CurrScatteringRange, targetGun); + SetScope(0, null); } else { - SetScope(0, null); + var targetGun = _mountRole?.Holster.ActiveWeapon; + if (targetGun != null) + { + SetScope(targetGun.CurrScatteringRange, targetGun); + } + else + { + SetScope(0, null); + } } } @@ -84,6 +120,26 @@ return _mountRole; } + private void SetStyle(CursorStyle style) + { + if (style == CursorStyle.Finger) //手指 + { + lt.Visible = false; + lb.Visible = false; + rt.Visible = false; + rb.Visible = false; + finger.Visible = true; + } + else if (style == CursorStyle.Sight) //准心 + { + lt.Visible = true; + lb.Visible = true; + rt.Visible = true; + rb.Visible = true; + finger.Visible = false; + } + } + /// /// 设置光标半径范围 /// diff --git a/DungeonShooting_Godot/src/game/GameApplication.cs b/DungeonShooting_Godot/src/game/GameApplication.cs index 2c7388e..1112ec3 100644 --- a/DungeonShooting_Godot/src/game/GameApplication.cs +++ b/DungeonShooting_Godot/src/game/GameApplication.cs @@ -47,11 +47,16 @@ public Cursor Cursor { get; private set; } /// - /// 游戏房间 + /// 游戏世界 /// - public RoomManager RoomManager { get; private set; } + public World World { get; private set; } /// + /// 地牢管理器 + /// + public DungeonManager DungeonManager { get; private set; } + + /// /// 房间配置 /// public Dictionary RoomConfig { get; private set; } @@ -101,24 +106,19 @@ #if TOOLS InitDesignatedRoom(); #endif - //初始化ui UiManager.Init(); - // 初始化鼠标 - Input.MouseMode = Input.MouseModeEnum.Hidden; - Cursor = ResourceManager.Load(ResourcePath.prefab_Cursor_tscn).Instantiate(); - var cursorLayer = new CanvasLayer(); - cursorLayer.Name = "CursorLayer"; - cursorLayer.Layer = UiManager.GetUiLayer(UiLayer.Pop).Layer + 10; - AddChild(cursorLayer); - cursorLayer.AddChild(Cursor); - - //打开ui - UiManager.Open_RoomUI(); - - RoomManager = ResourceManager.Load(ResourcePath.scene_Room_tscn).Instantiate(); - SceneRoot.AddChild(RoomManager); + InitCursor(); + //加载世界场景 + World = ResourceManager.LoadAndInstantiate(ResourcePath.scene_World_tscn); + SceneRoot.AddChild(World); + //地牢管理器 + DungeonManager = new DungeonManager(); + DungeonManager.Name = "DungeonManager"; + World.AddChild(DungeonManager); + //打开主菜单Ui + UiManager.Open_Main(); } public override void _Process(double delta) @@ -218,6 +218,18 @@ SubViewportContainer.Size = s; } + //初始化鼠标 + private void InitCursor() + { + Input.MouseMode = Input.MouseModeEnum.Hidden; + Cursor = ResourceManager.LoadAndInstantiate(ResourcePath.prefab_Cursor_tscn); + var cursorLayer = new CanvasLayer(); + cursorLayer.Name = "CursorLayer"; + cursorLayer.Layer = UiManager.GetUiLayer(UiLayer.Pop).Layer + 10; + AddChild(cursorLayer); + cursorLayer.AddChild(Cursor); + } + #if TOOLS //调试模式下, 指定生成哪些房间 private void InitDesignatedRoom() diff --git a/DungeonShooting_Godot/src/game/item/weapon/Weapon.cs b/DungeonShooting_Godot/src/game/item/weapon/Weapon.cs index e416aae..be603f9 100644 --- a/DungeonShooting_Godot/src/game/item/weapon/Weapon.cs +++ b/DungeonShooting_Godot/src/game/item/weapon/Weapon.cs @@ -430,7 +430,7 @@ /// public bool IsInGround() { - return Master == null && GetParent() == GameApplication.Instance.RoomManager.NormalLayer; + return Master == null && GetParent() == GameApplication.Instance.World.NormalLayer; } /// diff --git a/DungeonShooting_Godot/src/game/item/weapon/gun/Gun.cs b/DungeonShooting_Godot/src/game/item/weapon/gun/Gun.cs index fa902fc..f7e6c32 100644 --- a/DungeonShooting_Godot/src/game/item/weapon/gun/Gun.cs +++ b/DungeonShooting_Godot/src/game/item/weapon/gun/Gun.cs @@ -109,7 +109,7 @@ shell.InheritVelocity(Master); shell.Throw(startPos, startHeight, verticalSpeed, velocity, rotate); - if (Master == GameApplication.Instance.RoomManager.Player) + if (Master == Player.Current) { //创建抖动 GameCamera.Main.DirectionalShake(Vector2.Right.Rotated(GlobalRotation) * 2f); diff --git a/DungeonShooting_Godot/src/game/item/weapon/gun/Shotgun.cs b/DungeonShooting_Godot/src/game/item/weapon/gun/Shotgun.cs index 4ee5e6e..0c66caa 100644 --- a/DungeonShooting_Godot/src/game/item/weapon/gun/Shotgun.cs +++ b/DungeonShooting_Godot/src/game/item/weapon/gun/Shotgun.cs @@ -73,7 +73,7 @@ shell.InheritVelocity(Master); shell.Throw(startPos, startHeight, verticalSpeed, velocity, rotate); - if (Master == GameApplication.Instance.RoomManager.Player) + if (Master == Player.Current) { //创建抖动 GameCamera.Main.DirectionalShake(Vector2.Right.Rotated(GlobalRotation) * 2f); diff --git a/DungeonShooting_Godot/src/game/item/weapon/knife/Knife.cs b/DungeonShooting_Godot/src/game/item/weapon/knife/Knife.cs index 3bd5f31..350cab4 100644 --- a/DungeonShooting_Godot/src/game/item/weapon/knife/Knife.cs +++ b/DungeonShooting_Godot/src/game/item/weapon/knife/Knife.cs @@ -94,7 +94,7 @@ } - if (Master == GameApplication.Instance.RoomManager.Player) + if (Master == Player.Current) { //创建抖动 //GameCamera.Main.ProcessDirectionalShake(Vector2.Right.Rotated(GlobalRotation - Mathf.Pi * 0.5f) * 1.5f); diff --git a/DungeonShooting_Godot/src/game/manager/ResourceManager.cs b/DungeonShooting_Godot/src/game/manager/ResourceManager.cs index 41dfc21..42331c2 100644 --- a/DungeonShooting_Godot/src/game/manager/ResourceManager.cs +++ b/DungeonShooting_Godot/src/game/manager/ResourceManager.cs @@ -15,7 +15,7 @@ { if (_shadowMaterial == null) { - _shadowMaterial = ResourceLoader.Load(ResourcePath.resource_material_Blend_tres); + _shadowMaterial = Load(ResourcePath.resource_material_Blend_tres); } return _shadowMaterial; @@ -33,7 +33,7 @@ { if (_shadowShader == null) { - _shadowShader = ResourceLoader.Load(ResourcePath.resource_material_Blend_tres); + _shadowShader = Load(ResourcePath.resource_material_Blend_tres); } return _shadowShader; @@ -42,6 +42,24 @@ private static Shader _shadowShader; + /// + /// 默认字体资源 + /// + public static Font DefaultFont + { + get + { + if (_defaultFont == null) + { + _defaultFont = Load(ResourcePath.resource_font_VonwaonBitmap16px_ttf); + } + + return _defaultFont; + } + } + private static Font _defaultFont; + + //缓存的资源 private static readonly Dictionary CachePack = new Dictionary(); /// diff --git a/DungeonShooting_Godot/src/game/manager/ResourcePath.cs b/DungeonShooting_Godot/src/game/manager/ResourcePath.cs index 299b36b..0f65d6c 100644 --- a/DungeonShooting_Godot/src/game/manager/ResourcePath.cs +++ b/DungeonShooting_Godot/src/game/manager/ResourcePath.cs @@ -20,6 +20,7 @@ public const string prefab_test_MoveComponent_tscn = "res://prefab/test/MoveComponent.tscn"; public const string prefab_test_TestActivity_tscn = "res://prefab/test/TestActivity.tscn"; public const string prefab_ui_EditorTools_tscn = "res://prefab/ui/EditorTools.tscn"; + public const string prefab_ui_Main_tscn = "res://prefab/ui/Main.tscn"; public const string prefab_ui_RoomUI_tscn = "res://prefab/ui/RoomUI.tscn"; public const string prefab_weapon_Knife_tscn = "res://prefab/weapon/Knife.tscn"; public const string prefab_weapon_Weapon_tscn = "res://prefab/weapon/Weapon.tscn"; @@ -36,13 +37,17 @@ public const string resource_effects_ShotFire_png = "res://resource/effects/ShotFire.png"; public const string resource_effects_Smoke_png = "res://resource/effects/Smoke.png"; public const string resource_effects_activityObject_Enemy0001_Debris_png = "res://resource/effects/activityObject/Enemy0001_Debris.png"; - public const string resource_font_cn_font_12_tres = "res://resource/font/cn_font_12.tres"; - public const string resource_font_cn_font_18_tres = "res://resource/font/cn_font_18.tres"; - public const string resource_font_cn_font_36_tres = "res://resource/font/cn_font_36.tres"; + public const string resource_font_DinkieBitmap7pxDemo_ttf = "res://resource/font/DinkieBitmap-7pxDemo.ttf"; + public const string resource_font_DinkieBitmap9pxDemo_ttf = "res://resource/font/DinkieBitmap-9pxDemo.ttf"; + public const string resource_font_DinkieBitmap9pxItalicDemo_ttf = "res://resource/font/DinkieBitmap-9pxItalicDemo.ttf"; + public const string resource_font_VonwaonBitmap12px_ttf = "res://resource/font/VonwaonBitmap-12px.ttf"; + public const string resource_font_VonwaonBitmap16px_ttf = "res://resource/font/VonwaonBitmap-16px.ttf"; public const string resource_map_RoomConfig_json = "res://resource/map/RoomConfig.json"; + public const string resource_map_tiledata_testGroup_battle_Room1_json = "res://resource/map/tiledata/testGroup/battle/Room1.json"; public const string resource_map_tiledata_testGroup_battle_Room8_json = "res://resource/map/tiledata/testGroup/battle/Room8.json"; public const string resource_map_tiledata_testGroup_inlet_Room1_json = "res://resource/map/tiledata/testGroup/inlet/Room1.json"; public const string resource_map_tiledata_testGroup_outlet_Room1_json = "res://resource/map/tiledata/testGroup/outlet/Room1.json"; + public const string resource_map_tileMaps_testGroup_battle_Room1_tscn = "res://resource/map/tileMaps/testGroup/battle/Room1.tscn"; public const string resource_map_tileMaps_testGroup_battle_Room8_tscn = "res://resource/map/tileMaps/testGroup/battle/Room8.tscn"; public const string resource_map_tileMaps_testGroup_inlet_Room1_tscn = "res://resource/map/tileMaps/testGroup/inlet/Room1.tscn"; public const string resource_map_tileMaps_testGroup_outlet_Room1_tscn = "res://resource/map/tileMaps/testGroup/outlet/Room1.tscn"; @@ -251,6 +256,7 @@ public const string resource_sprite_ui_Cursor_png = "res://resource/sprite/ui/Cursor.png"; public const string resource_sprite_ui_CursorCenter_png = "res://resource/sprite/ui/CursorCenter.png"; public const string resource_sprite_ui_font_bg_png = "res://resource/sprite/ui/font_bg.png"; + public const string resource_sprite_ui_GUI_png = "res://resource/sprite/ui/GUI.png"; public const string resource_sprite_ui_healthBar_png = "res://resource/sprite/ui/healthBar.png"; public const string resource_sprite_ui_hpBar_png = "res://resource/sprite/ui/hpBar.png"; public const string resource_sprite_ui_hpSlot_png = "res://resource/sprite/ui/hpSlot.png"; @@ -266,9 +272,10 @@ public const string resource_sprite_ui_icon_icon_replace_png = "res://resource/sprite/ui/icon/icon_replace.png"; public const string resource_sprite_ui_keyboard_e_png = "res://resource/sprite/ui/keyboard/e.png"; public const string resource_theme_mainTheme_tres = "res://resource/theme/mainTheme.tres"; + public const string resource_theme_theme1_tres = "res://resource/theme/theme1.tres"; public const string scene_EditorDemo_tscn = "res://scene/EditorDemo.tscn"; public const string scene_Main_tscn = "res://scene/Main.tscn"; - public const string scene_Room_tscn = "res://scene/Room.tscn"; + public const string scene_World_tscn = "res://scene/World.tscn"; public const string scene_test_TestCommpont_tscn = "res://scene/test/TestCommpont.tscn"; public const string scene_test_TestExpression_tscn = "res://scene/test/TestExpression.tscn"; public const string scene_test_TestGenerateDungeon_tscn = "res://scene/test/TestGenerateDungeon.tscn"; @@ -280,6 +287,4 @@ public const string default_bus_layout_tres = "res://default_bus_layout.tres"; public const string default_env_tres = "res://default_env.tres"; public const string icon_png = "res://icon.png"; - public const string Silver_ttf = "res://Silver.ttf"; - public const string SourceHanSerifCNSemiBold_otf = "res://SourceHanSerifCN-SemiBold.otf"; } \ No newline at end of file diff --git a/DungeonShooting_Godot/src/game/manager/UiManager_Methods.cs b/DungeonShooting_Godot/src/game/manager/UiManager_Methods.cs index 91aaa92..7a6b33c 100644 --- a/DungeonShooting_Godot/src/game/manager/UiManager_Methods.cs +++ b/DungeonShooting_Godot/src/game/manager/UiManager_Methods.cs @@ -7,6 +7,7 @@ public static class UiName { public const string EditorTools = "EditorTools"; + public const string Main = "Main"; public const string RoomUI = "RoomUI"; } @@ -27,6 +28,22 @@ } /// + /// 打开 Main, 并返回UI实例 + /// + public static UI.Main.MainPanel Open_Main() + { + return OpenUi(UiName.Main); + } + + /// + /// 获取所有 Main 的实例, 如果没有实例, 则返回一个空数组 + /// + public static UI.Main.MainPanel[] Get_Main_Instance() + { + return GetUiInstance(nameof(UI.Main.Main)); + } + + /// /// 打开 RoomUI, 并返回UI实例 /// public static UI.RoomUI.RoomUIPanel Open_RoomUI() diff --git a/DungeonShooting_Godot/src/game/role/Player.cs b/DungeonShooting_Godot/src/game/role/Player.cs index 0946c07..6687cca 100644 --- a/DungeonShooting_Godot/src/game/role/Player.cs +++ b/DungeonShooting_Godot/src/game/role/Player.cs @@ -10,7 +10,7 @@ /// /// 获取当前操作的角色 /// - public static Player Current => GameApplication.Instance.RoomManager.Player; + public static Player Current { get; private set; } /// /// 移动加速度 @@ -21,6 +21,14 @@ /// 移动摩擦力 /// public float Friction { get; set; } = 800f; + + /// + /// 设置当前操作的玩家对象 + /// + public static void SetCurrentPlayer(Player player) + { + Current = player; + } public override void OnInit() { diff --git a/DungeonShooting_Godot/src/game/role/enemy/state/AiFollowUpState.cs b/DungeonShooting_Godot/src/game/role/enemy/state/AiFollowUpState.cs index fd6850a..ee828ad 100644 --- a/DungeonShooting_Godot/src/game/role/enemy/state/AiFollowUpState.cs +++ b/DungeonShooting_Godot/src/game/role/enemy/state/AiFollowUpState.cs @@ -120,7 +120,7 @@ public override void DebugDraw() { - var playerPos = GameApplication.Instance.RoomManager.Player.GetCenterPosition(); + var playerPos = Player.Current.GetCenterPosition(); Master.DrawLine(new Vector2(0, -8), Master.ToLocal(playerPos), Colors.Red); } } \ No newline at end of file diff --git a/DungeonShooting_Godot/src/game/role/enemy/state/AiLeaveForState.cs b/DungeonShooting_Godot/src/game/role/enemy/state/AiLeaveForState.cs index 7823d03..6d01f73 100644 --- a/DungeonShooting_Godot/src/game/role/enemy/state/AiLeaveForState.cs +++ b/DungeonShooting_Godot/src/game/role/enemy/state/AiLeaveForState.cs @@ -68,7 +68,7 @@ Master.BasisVelocity = Vector2.Zero; } - var playerPos = GameApplication.Instance.RoomManager.Player.GetCenterPosition(); + var playerPos = Player.Current.GetCenterPosition(); //检测玩家是否在视野内, 如果在, 则切换到 AiTargetInView 状态 if (Master.IsInTailAfterViewRange(playerPos)) { diff --git a/DungeonShooting_Godot/src/game/role/enemy/state/AiNormalState.cs b/DungeonShooting_Godot/src/game/role/enemy/state/AiNormalState.cs index d0f9b01..0ebfd40 100644 --- a/DungeonShooting_Godot/src/game/role/enemy/state/AiNormalState.cs +++ b/DungeonShooting_Godot/src/game/role/enemy/state/AiNormalState.cs @@ -61,7 +61,7 @@ else //没有找到玩家 { //检测玩家 - var player = GameApplication.Instance.RoomManager.Player; + var player = Player.Current; //玩家中心点坐标 var playerPos = player.GetCenterPosition(); diff --git a/DungeonShooting_Godot/src/game/role/enemy/state/AiTailAfterState.cs b/DungeonShooting_Godot/src/game/role/enemy/state/AiTailAfterState.cs index f965f41..769f06f 100644 --- a/DungeonShooting_Godot/src/game/role/enemy/state/AiTailAfterState.cs +++ b/DungeonShooting_Godot/src/game/role/enemy/state/AiTailAfterState.cs @@ -44,7 +44,7 @@ { //这个状态下不会有攻击事件, 所以没必要每一帧检查是否弹药耗尽 - var playerPos = GameApplication.Instance.RoomManager.Player.GetCenterPosition(); + var playerPos = Player.Current.GetCenterPosition(); //更新玩家位置 if (_navigationUpdateTimer <= 0) @@ -112,7 +112,7 @@ public override void DebugDraw() { - var playerPos = GameApplication.Instance.RoomManager.Player.GetCenterPosition(); + var playerPos = Player.Current.GetCenterPosition(); if (_isInViewRange) { Master.DrawLine(new Vector2(0, -8), Master.ToLocal(playerPos), Colors.Orange); diff --git a/DungeonShooting_Godot/src/game/room/DungeonManager.cs b/DungeonShooting_Godot/src/game/room/DungeonManager.cs new file mode 100644 index 0000000..582634f --- /dev/null +++ b/DungeonShooting_Godot/src/game/room/DungeonManager.cs @@ -0,0 +1,316 @@ + +using System; +using System.Collections.Generic; +using System.Linq; +using Godot; + +/// +/// 地牢管理器 +/// +public partial class DungeonManager : Node2D +{ + /// + /// 起始房间 + /// + public RoomInfo StartRoom => _dungeonGenerator.StartRoom; + + /// + /// 当前玩家所在的房间 + /// + public RoomInfo ActiveRoom => Player.Current?.Affiliation?.RoomInfo; + + /// + /// 当前玩家所在的区域 + /// + public AffiliationArea ActiveAffiliation => Player.Current?.Affiliation; + + /// + /// 地图根节点 + /// + public TileMap TileRoot => GameApplication.Instance.World.TileRoot; + + private DungeonTile _dungeonTile; + private AutoTileConfig _autoTileConfig; + private DungeonGenerator _dungeonGenerator; + private int _affiliationIndex = 0; + private float _checkEnemyTimer = 0; + + //房间内所有静态导航网格数据 + private static List _roomStaticNavigationList = new List(); + + /// + /// 加载地牢 + /// + public void LoadDungeon(DungeonConfig config) + { + //绑定事件 + EventManager.AddEventListener(EventEnum.OnPlayerFirstEnterRoom, OnPlayerFirstEnterRoom); + EventManager.AddEventListener(EventEnum.OnPlayerEnterRoom, OnPlayerEnterRoom); + + var nowTicks = DateTime.Now.Ticks; + //生成地牢房间 + _dungeonGenerator = new DungeonGenerator(config); + _dungeonGenerator.Generate(); + + //填充地牢 + _autoTileConfig = new AutoTileConfig(); + _dungeonTile = new DungeonTile(TileRoot); + _dungeonTile.AutoFillRoomTile(_autoTileConfig, _dungeonGenerator.StartRoom); + + //生成寻路网格, 这一步操作只生成过道的导航 + _dungeonTile.GenerateNavigationPolygon(GameConfig.AisleFloorMapLayer); + //挂载过道导航区域 + _dungeonTile.MountNavigationPolygon(this); + //过道导航区域数据 + _roomStaticNavigationList.AddRange(_dungeonTile.GetPolygonData()); + //门导航区域数据 + _roomStaticNavigationList.AddRange(_dungeonTile.GetConnectDoorPolygonData()); + //初始化所有房间 + _dungeonGenerator.EachRoom(InitRoom); + + GD.Print("生成地牢用时: " + (DateTime.Now.Ticks - nowTicks) / 10000 + "毫秒"); + + //播放bgm + //SoundManager.PlayMusic(ResourcePath.resource_sound_bgm_Intro_ogg, -17f); + + //初始房间创建玩家标记 + var playerBirthMark = StartRoom.ActivityMarks.FirstOrDefault(mark => mark.Type == ActivityIdPrefix.ActivityPrefixType.Player); + //创建玩家 + var player = ActivityObject.Create(ActivityIdPrefix.Role + "0001"); + Player.SetCurrentPlayer(player); + if (playerBirthMark != null) + { + player.Position = playerBirthMark.Position; + } + player.Name = "Player"; + player.PutDown(RoomLayerEnum.YSortLayer); + player.PickUpWeapon(ActivityObject.Create(ActivityIdPrefix.Weapon + "0001")); + + //相机跟随玩家 + GameCamera.Main.SetFollowTarget(player); + + //鼠标指针挂载到玩家身上 + var cursor = GameApplication.Instance.Cursor; + cursor.Style = Cursor.CursorStyle.Sight; + cursor.SetGuiMode(false); + cursor.SetMountRole(player); + + //打开游戏中的ui + UiManager.Open_RoomUI(); + } + + public override void _PhysicsProcess(double delta) + { + _checkEnemyTimer += (float)delta; + if (_checkEnemyTimer >= 1) + { + _checkEnemyTimer %= 1; + //检查房间内的敌人存活状况 + OnCheckEnemy(); + } + } + + public override void _Process(double delta) + { + Enemy.UpdateEnemiesView(); + if (GameApplication.Instance.Debug) + { + QueueRedraw(); + } + } + + // 初始化房间 + private void InitRoom(RoomInfo roomInfo) + { + //挂载房间导航区域 + MountNavFromRoomInfo(roomInfo); + //创建门 + CreateDoor(roomInfo); + //创建房间归属区域 + CreateRoomAisleAffiliation(roomInfo); + } + + //挂载房间导航区域 + private void MountNavFromRoomInfo(RoomInfo roomInfo) + { + var polygonArray = roomInfo.RoomSplit.RoomInfo.NavigationList.ToArray(); + var polygon = new NavigationPolygon(); + var offset = roomInfo.GetOffsetPosition(); + for (var i = 0; i < polygonArray.Length; i++) + { + var navigationPolygonData = polygonArray[i]; + var polygonPointArray = navigationPolygonData.ConvertPointsToVector2Array(); + //这里的位置需要加上房间位置 + for (var j = 0; j < polygonPointArray.Length; j++) + { + polygonPointArray[j] = polygonPointArray[j] + roomInfo.GetWorldPosition() - offset; + } + polygon.AddOutline(polygonPointArray); + + var points = new List(); + for (var j = 0; j < polygonPointArray.Length; j++) + { + points.Add(new SerializeVector2(polygonPointArray[j])); + } + + //存入汇总列表 + _roomStaticNavigationList.Add(new NavigationPolygonData(navigationPolygonData.Type, points)); + } + polygon.MakePolygonsFromOutlines(); + var navigationPolygon = new NavigationRegion2D(); + navigationPolygon.Name = "NavigationRegion" + (GetChildCount() + 1); + navigationPolygon.NavigationPolygon = polygon; + AddChild(navigationPolygon); + } + + //创建门 + private void CreateDoor(RoomInfo roomInfo) + { + foreach (var doorInfo in roomInfo.Doors) + { + var door = ActivityObject.Create(ActivityIdPrefix.Other + "0001"); + doorInfo.Door = door; + Vector2 offset; + switch (doorInfo.Direction) + { + case DoorDirection.E: + offset = new Vector2(0.5f, 2); + break; + case DoorDirection.W: + offset = new Vector2(-0.5f, 2); + break; + case DoorDirection.S: + offset = new Vector2(2f, 1.5f); + break; + case DoorDirection.N: + offset = new Vector2(2f, -0.5f); + break; + default: offset = new Vector2(); + break; + } + door.Position = (doorInfo.OriginPosition + offset) * GameConfig.TileCellSize; + door.Init(doorInfo); + door.PutDown(RoomLayerEnum.NormalLayer, false); + } + } + + //创建房间归属区域 + private void CreateRoomAisleAffiliation(RoomInfo roomInfo) + { + var affiliation = new AffiliationArea(); + affiliation.Name = "AffiliationArea" + (_affiliationIndex++); + affiliation.Init(roomInfo, new Rect2( + roomInfo.GetWorldPosition() + new Vector2(GameConfig.TileCellSize, GameConfig.TileCellSize), + (roomInfo.Size - new Vector2I(2, 2)) * GameConfig.TileCellSize)); + + roomInfo.Affiliation = affiliation; + TileRoot.AddChild(affiliation); + } + + /// + /// 玩家第一次进入某个房间回调 + /// + private void OnPlayerFirstEnterRoom(object o) + { + var room = (RoomInfo)o; + room.BeReady(); + } + + /// + /// 玩家进入某个房间回调 + /// + private void OnPlayerEnterRoom(object o) + { + } + + /// + /// 检测当前房间敌人是否已经消灭干净, 应当每秒执行一次 + /// + private void OnCheckEnemy() + { + var activeRoom = ActiveRoom; + if (activeRoom != null)// && //activeRoom.IsSeclusion) + { + if (activeRoom.IsCurrWaveOver()) //所有标记执行完成 + { + //存活敌人数量 + var count = ActiveAffiliation.FindIncludeItemsCount( + activityObject => activityObject.CollisionWithMask(PhysicsLayer.Enemy) + ); + GD.Print("当前房间存活数量: " + count); + if (count == 0) + { + activeRoom.OnClearRoom(); + } + } + } + } + + public override void _Draw() + { + if (GameApplication.Instance.Debug) + { + if (_dungeonTile != null) + { + //绘制ai寻路区域 + Utils.DrawNavigationPolygon(this, _roomStaticNavigationList.ToArray()); + } + //绘制房间区域 + //DrawRoomInfo(_generateDungeon.StartRoom); + } + } + + //绘制房间区域, debug 用 + private void DrawRoomInfo(RoomInfo room) + { + var cellSize = TileRoot.CellQuadrantSize; + var pos1 = (room.Position + room.Size / 2) * cellSize; + + //绘制下一个房间 + foreach (var nextRoom in room.Next) + { + var pos2 = (nextRoom.Position + nextRoom.Size / 2) * cellSize; + DrawLine(pos1, pos2, Colors.Red); + DrawRoomInfo(nextRoom); + } + + DrawString(ResourceManager.DefaultFont, pos1, room.Id.ToString()); + + //绘制门 + foreach (var roomDoor in room.Doors) + { + var originPos = roomDoor.OriginPosition * cellSize; + switch (roomDoor.Direction) + { + case DoorDirection.E: + DrawLine(originPos, originPos + new Vector2(3, 0) * cellSize, Colors.Yellow); + DrawLine(originPos + new Vector2(0, 4) * cellSize, originPos + new Vector2(3, 4) * cellSize, + Colors.Yellow); + break; + case DoorDirection.W: + DrawLine(originPos, originPos - new Vector2(3, 0) * cellSize, Colors.Yellow); + DrawLine(originPos + new Vector2(0, 4) * cellSize, originPos - new Vector2(3, -4) * cellSize, + Colors.Yellow); + break; + case DoorDirection.S: + DrawLine(originPos, originPos + new Vector2(0, 3) * cellSize, Colors.Yellow); + DrawLine(originPos + new Vector2(4, 0) * cellSize, originPos + new Vector2(4, 3) * cellSize, + Colors.Yellow); + break; + case DoorDirection.N: + DrawLine(originPos, originPos - new Vector2(0, 3) * cellSize, Colors.Yellow); + DrawLine(originPos + new Vector2(4, 0) * cellSize, originPos - new Vector2(-4, 3) * cellSize, + Colors.Yellow); + break; + } + + //绘制房间区域 + DrawRect(new Rect2(room.Position * cellSize, room.Size * cellSize), Colors.Blue, false); + + if (roomDoor.HasCross && roomDoor.RoomInfo.Id < roomDoor.ConnectRoom.Id) + { + DrawRect(new Rect2(roomDoor.Cross * cellSize, new Vector2(cellSize * 4, cellSize * 4)), Colors.Yellow, false); + } + } + } +} \ No newline at end of file diff --git a/DungeonShooting_Godot/src/game/room/RoomManager.cs b/DungeonShooting_Godot/src/game/room/RoomManager.cs deleted file mode 100644 index daf7a79..0000000 --- a/DungeonShooting_Godot/src/game/room/RoomManager.cs +++ /dev/null @@ -1,358 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using Godot; - -/// -/// 房间管理器 -/// -public partial class RoomManager : Node2D -{ - /// - /// //对象根节点 - /// - [Export] public Node2D NormalLayer; - - /// - /// 对象根节点, 带y轴排序功能 - /// - [Export] public Node2D YSortLayer; - - /// - /// 地图根节点 - /// - [Export] public TileMap TileRoot; - - /// - /// 玩家对象 - /// - public Player Player { get; private set; } - - /// - /// 起始房间 - /// - public RoomInfo StartRoom => _dungeonGenerator.StartRoom; - - /// - /// 当前玩家所在的房间 - /// - public RoomInfo ActiveRoom => Player?.Affiliation?.RoomInfo; - - /// - /// 当前玩家所在的区域 - /// - public AffiliationArea ActiveAffiliation => Player?.Affiliation; - - private DungeonTile _dungeonTile; - private AutoTileConfig _autoTileConfig; - - private Font _font; - private DungeonGenerator _dungeonGenerator; - - private int _affiliationIndex = 0; - - private float _checkEnemyTimer = 0; - - //房间内所有静态导航网格数据 - private static List _roomStaticNavigationList = new List(); - - public override void _Ready() - { - TileRoot.YSortEnabled = false; - - _font = ResourceManager.Load(ResourcePath.resource_font_cn_font_36_tres); - - //绑定事件 - EventManager.AddEventListener(EventEnum.OnPlayerFirstEnterRoom, OnPlayerFirstEnterRoom); - EventManager.AddEventListener(EventEnum.OnPlayerEnterRoom, OnPlayerEnterRoom); - - var nowTicks = DateTime.Now.Ticks; - //生成地牢房间 - _dungeonGenerator = new DungeonGenerator("testGroup"); - _dungeonGenerator.Generate(); - - //填充地牢 - _autoTileConfig = new AutoTileConfig(); - _dungeonTile = new DungeonTile(TileRoot); - _dungeonTile.AutoFillRoomTile(_autoTileConfig, _dungeonGenerator.StartRoom); - - //生成寻路网格, 这一步操作只生成过道的导航 - _dungeonTile.GenerateNavigationPolygon(GameConfig.AisleFloorMapLayer); - //挂载过道导航区域 - _dungeonTile.MountNavigationPolygon(this); - //过道导航区域数据 - _roomStaticNavigationList.AddRange(_dungeonTile.GetPolygonData()); - //门导航区域数据 - _roomStaticNavigationList.AddRange(_dungeonTile.GetConnectDoorPolygonData()); - //初始化所有房间 - _dungeonGenerator.EachRoom(InitRoom); - - GD.Print("生成地牢用时: " + (DateTime.Now.Ticks - nowTicks) / 10000 + "毫秒"); - - //播放bgm - //SoundManager.PlayMusic(ResourcePath.resource_sound_bgm_Intro_ogg, -17f); - - //初始房间创建玩家标记 - var playerBirthMark = StartRoom.ActivityMarks.FirstOrDefault(mark => mark.Type == ActivityIdPrefix.ActivityPrefixType.Player); - //创建玩家 - Player = ActivityObject.Create(ActivityIdPrefix.Role + "0001"); - if (playerBirthMark != null) - { - Player.Position = playerBirthMark.Position; - } - Player.Name = "Player"; - Player.PutDown(RoomLayerEnum.YSortLayer); - Player.PickUpWeapon(ActivityObject.Create(ActivityIdPrefix.Weapon + "0001")); - - // var weapon = ActivityObject.Create(ActivityIdPrefix.Test + "0001"); - // weapon.PutDown(new Vector2(200, 200), RoomLayerEnum.NormalLayer); - // //weapon.Altitude = 50; - - // for (int i = 0; i < 10; i++) - // { - // var enemy = ActivityObject.Create(ActivityIdPrefix.Enemy + "0001"); - // enemy.PutDown(new Vector2(100 + i * 20, 100), RoomLayerEnum.YSortLayer); - // enemy.PickUpWeapon(ActivityObject.Create(ActivityIdPrefix.Weapon + Utils.RandomChoose("0001", "0002", "0003"))); - // } - - //相机跟随玩家 - GameCamera.Main.SetFollowTarget(Player); - - //修改鼠标指针 - var cursor = GameApplication.Instance.Cursor; - cursor.SetGuiMode(false); - cursor.SetMountRole(Player); - } - - public override void _PhysicsProcess(double delta) - { - _checkEnemyTimer += (float)delta; - if (_checkEnemyTimer >= 1) - { - _checkEnemyTimer %= 1; - //检查房间内的敌人存活状况 - OnCheckEnemy(); - } - } - - /// - /// 获取指定层级根节点 - /// - public Node2D GetRoomLayer(RoomLayerEnum layerEnum) - { - switch (layerEnum) - { - case RoomLayerEnum.NormalLayer: - return NormalLayer; - case RoomLayerEnum.YSortLayer: - return YSortLayer; - } - - return null; - } - - public override void _Process(double delta) - { - Enemy.UpdateEnemiesView(); - if (GameApplication.Instance.Debug) - { - QueueRedraw(); - } - } - - public override void _Draw() - { - if (GameApplication.Instance.Debug) - { - if (_dungeonTile != null) - { - //绘制ai寻路区域 - Utils.DrawNavigationPolygon(this, _roomStaticNavigationList.ToArray()); - } - //绘制房间区域 - //DrawRoomInfo(_generateDungeon.StartRoom); - } - } - - // 初始化房间 - private void InitRoom(RoomInfo roomInfo) - { - //挂载房间导航区域 - MountNavFromRoomInfo(roomInfo); - //创建门 - CreateDoor(roomInfo); - - //创建房间归属区域 - CreateRoomAisleAffiliation(roomInfo); - } - - //挂载房间导航区域 - private void MountNavFromRoomInfo(RoomInfo roomInfo) - { - var polygonArray = roomInfo.RoomSplit.RoomInfo.NavigationList.ToArray(); - var polygon = new NavigationPolygon(); - var offset = roomInfo.GetOffsetPosition(); - for (var i = 0; i < polygonArray.Length; i++) - { - var navigationPolygonData = polygonArray[i]; - var polygonPointArray = navigationPolygonData.ConvertPointsToVector2Array(); - //这里的位置需要加上房间位置 - for (var j = 0; j < polygonPointArray.Length; j++) - { - polygonPointArray[j] = polygonPointArray[j] + roomInfo.GetWorldPosition() - offset; - } - polygon.AddOutline(polygonPointArray); - - var points = new List(); - for (var j = 0; j < polygonPointArray.Length; j++) - { - points.Add(new SerializeVector2(polygonPointArray[j])); - } - - //存入汇总列表 - _roomStaticNavigationList.Add(new NavigationPolygonData(navigationPolygonData.Type, points)); - } - polygon.MakePolygonsFromOutlines(); - var navigationPolygon = new NavigationRegion2D(); - navigationPolygon.Name = "NavigationRegion" + (GetChildCount() + 1); - navigationPolygon.NavigationPolygon = polygon; - AddChild(navigationPolygon); - } - - //创建门 - private void CreateDoor(RoomInfo roomInfo) - { - foreach (var doorInfo in roomInfo.Doors) - { - var door = ActivityObject.Create(ActivityIdPrefix.Other + "0001"); - doorInfo.Door = door; - Vector2 offset; - switch (doorInfo.Direction) - { - case DoorDirection.E: - offset = new Vector2(0.5f, 2); - break; - case DoorDirection.W: - offset = new Vector2(-0.5f, 2); - break; - case DoorDirection.S: - offset = new Vector2(2f, 1.5f); - break; - case DoorDirection.N: - offset = new Vector2(2f, -0.5f); - break; - default: offset = new Vector2(); - break; - } - door.Position = (doorInfo.OriginPosition + offset) * GameConfig.TileCellSize; - door.Init(doorInfo); - door.PutDown(RoomLayerEnum.NormalLayer, false); - } - } - - //创建房间归属区域 - private void CreateRoomAisleAffiliation(RoomInfo roomInfo) - { - var affiliation = new AffiliationArea(); - affiliation.Name = "AffiliationArea" + (_affiliationIndex++); - affiliation.Init(roomInfo, new Rect2( - roomInfo.GetWorldPosition() + new Vector2(GameConfig.TileCellSize, GameConfig.TileCellSize), - (roomInfo.Size - new Vector2I(2, 2)) * GameConfig.TileCellSize)); - - roomInfo.Affiliation = affiliation; - TileRoot.AddChild(affiliation); - } - - /// - /// 玩家第一次进入某个房间回调 - /// - private void OnPlayerFirstEnterRoom(object o) - { - var room = (RoomInfo)o; - room.BeReady(); - } - - /// - /// 玩家进入某个房间回调 - /// - private void OnPlayerEnterRoom(object o) - { - } - - /// - /// 检测当前房间敌人是否已经消灭干净, 应当每秒执行一次 - /// - private void OnCheckEnemy() - { - var activeRoom = ActiveRoom; - if (activeRoom != null)// && //activeRoom.IsSeclusion) - { - if (activeRoom.IsCurrWaveOver()) //所有标记执行完成 - { - //存活敌人数量 - var count = ActiveAffiliation.FindIncludeItemsCount( - activityObject => activityObject.CollisionWithMask(PhysicsLayer.Enemy) - ); - GD.Print("当前房间存活数量: " + count); - if (count == 0) - { - activeRoom.OnClearRoom(); - } - } - } - } - - //绘制房间区域, debug 用 - private void DrawRoomInfo(RoomInfo room) - { - var cellSize = TileRoot.CellQuadrantSize; - var pos1 = (room.Position + room.Size / 2) * cellSize; - - //绘制下一个房间 - foreach (var nextRoom in room.Next) - { - var pos2 = (nextRoom.Position + nextRoom.Size / 2) * cellSize; - DrawLine(pos1, pos2, Colors.Red); - DrawRoomInfo(nextRoom); - } - - DrawString(_font, pos1, room.Id.ToString()); - - //绘制门 - foreach (var roomDoor in room.Doors) - { - var originPos = roomDoor.OriginPosition * cellSize; - switch (roomDoor.Direction) - { - case DoorDirection.E: - DrawLine(originPos, originPos + new Vector2(3, 0) * cellSize, Colors.Yellow); - DrawLine(originPos + new Vector2(0, 4) * cellSize, originPos + new Vector2(3, 4) * cellSize, - Colors.Yellow); - break; - case DoorDirection.W: - DrawLine(originPos, originPos - new Vector2(3, 0) * cellSize, Colors.Yellow); - DrawLine(originPos + new Vector2(0, 4) * cellSize, originPos - new Vector2(3, -4) * cellSize, - Colors.Yellow); - break; - case DoorDirection.S: - DrawLine(originPos, originPos + new Vector2(0, 3) * cellSize, Colors.Yellow); - DrawLine(originPos + new Vector2(4, 0) * cellSize, originPos + new Vector2(4, 3) * cellSize, - Colors.Yellow); - break; - case DoorDirection.N: - DrawLine(originPos, originPos - new Vector2(0, 3) * cellSize, Colors.Yellow); - DrawLine(originPos + new Vector2(4, 0) * cellSize, originPos - new Vector2(-4, 3) * cellSize, - Colors.Yellow); - break; - } - - //绘制房间区域 - DrawRect(new Rect2(room.Position * cellSize, room.Size * cellSize), Colors.Blue, false); - - if (roomDoor.HasCross && roomDoor.RoomInfo.Id < roomDoor.ConnectRoom.Id) - { - DrawRect(new Rect2(roomDoor.Cross * cellSize, new Vector2(cellSize * 4, cellSize * 4)), Colors.Yellow, false); - } - } - } -} \ No newline at end of file diff --git a/DungeonShooting_Godot/src/game/room/SceneManager.cs b/DungeonShooting_Godot/src/game/room/SceneManager.cs new file mode 100644 index 0000000..9ebf743 --- /dev/null +++ b/DungeonShooting_Godot/src/game/room/SceneManager.cs @@ -0,0 +1,19 @@ + +using Godot; + +/// +/// 场景管理器 +/// +public static class SceneManager +{ + + /// + /// 加载场景 + /// + /// 场景路径 + public static void LoadScene(string path) + { + //var packedScene = ResourceManager.Load(ResourcePath.scene_Room_tscn).Instantiate(); + //SceneRoot.AddChild(RoomManager); + } +} \ No newline at end of file diff --git a/DungeonShooting_Godot/src/game/room/World.cs b/DungeonShooting_Godot/src/game/room/World.cs new file mode 100644 index 0000000..72145db --- /dev/null +++ b/DungeonShooting_Godot/src/game/room/World.cs @@ -0,0 +1,44 @@ +using Godot; + +/// +/// 游戏世界 +/// +public partial class World : Node2D +{ + /// + /// //对象根节点 + /// + [Export] public Node2D NormalLayer; + + /// + /// 对象根节点, 带y轴排序功能 + /// + [Export] public Node2D YSortLayer; + + /// + /// 地图根节点 + /// + [Export] public TileMap TileRoot; + + public override void _Ready() + { + TileRoot.YSortEnabled = false; + } + + /// + /// 获取指定层级根节点 + /// + public Node2D GetRoomLayer(RoomLayerEnum layerEnum) + { + switch (layerEnum) + { + case RoomLayerEnum.NormalLayer: + return NormalLayer; + case RoomLayerEnum.YSortLayer: + return YSortLayer; + } + + return null; + } + +} \ No newline at end of file diff --git a/DungeonShooting_Godot/src/game/ui/main/Main.cs b/DungeonShooting_Godot/src/game/ui/main/Main.cs new file mode 100644 index 0000000..0c77b81 --- /dev/null +++ b/DungeonShooting_Godot/src/game/ui/main/Main.cs @@ -0,0 +1,145 @@ +namespace UI.Main; + +/// +/// Ui代码, 该类是根据ui场景自动生成的, 请不要手动编辑该类, 以免造成代码丢失 +/// +public abstract partial class Main : UiBase +{ + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: Main.Title + /// + public UiNode_Title L_Title + { + get + { + if (_L_Title == null) _L_Title = new UiNode_Title(GetNodeOrNull("Title")); + return _L_Title; + } + } + private UiNode_Title _L_Title; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: Main.ButtonList + /// + public UiNode_ButtonList L_ButtonList + { + get + { + if (_L_ButtonList == null) _L_ButtonList = new UiNode_ButtonList(GetNodeOrNull("ButtonList")); + return _L_ButtonList; + } + } + private UiNode_ButtonList _L_ButtonList; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: Main.Version + /// + public UiNode_Version L_Version + { + get + { + if (_L_Version == null) _L_Version = new UiNode_Version(GetNodeOrNull("Version")); + return _L_Version; + } + } + private UiNode_Version _L_Version; + + + public Main() : base(nameof(Main)) + { + } + + /// + /// 类型: , 路径: Main.Title + /// + public class UiNode_Title : IUiNode + { + public UiNode_Title(Godot.Label node) : base(node) { } + public override UiNode_Title Clone() => new ((Godot.Label)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: Main.ButtonList.Start + /// + public class UiNode_Start : IUiNode + { + public UiNode_Start(Godot.Button node) : base(node) { } + public override UiNode_Start Clone() => new ((Godot.Button)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: Main.ButtonList.Setting + /// + public class UiNode_Setting : IUiNode + { + public UiNode_Setting(Godot.Button node) : base(node) { } + public override UiNode_Setting Clone() => new ((Godot.Button)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: Main.ButtonList.Exit + /// + public class UiNode_Exit : IUiNode + { + public UiNode_Exit(Godot.Button node) : base(node) { } + public override UiNode_Exit Clone() => new ((Godot.Button)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: Main.ButtonList + /// + public class UiNode_ButtonList : IUiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: Main.Start + /// + public UiNode_Start L_Start + { + get + { + if (_L_Start == null) _L_Start = new UiNode_Start(Instance.GetNodeOrNull("Start")); + return _L_Start; + } + } + private UiNode_Start _L_Start; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: Main.Setting + /// + public UiNode_Setting L_Setting + { + get + { + if (_L_Setting == null) _L_Setting = new UiNode_Setting(Instance.GetNodeOrNull("Setting")); + return _L_Setting; + } + } + private UiNode_Setting _L_Setting; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: Main.Exit + /// + public UiNode_Exit L_Exit + { + get + { + if (_L_Exit == null) _L_Exit = new UiNode_Exit(Instance.GetNodeOrNull("Exit")); + return _L_Exit; + } + } + private UiNode_Exit _L_Exit; + + public UiNode_ButtonList(Godot.VBoxContainer node) : base(node) { } + public override UiNode_ButtonList Clone() => new ((Godot.VBoxContainer)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: Main.Version + /// + public class UiNode_Version : IUiNode + { + public UiNode_Version(Godot.Label node) : base(node) { } + public override UiNode_Version Clone() => new ((Godot.Label)Instance.Duplicate()); + } + +} diff --git a/DungeonShooting_Godot/src/game/ui/main/MainPanel.cs b/DungeonShooting_Godot/src/game/ui/main/MainPanel.cs new file mode 100644 index 0000000..4d740d1 --- /dev/null +++ b/DungeonShooting_Godot/src/game/ui/main/MainPanel.cs @@ -0,0 +1,35 @@ +using Godot; + +namespace UI.Main; + +public partial class MainPanel : Main +{ + + public override void OnShowUi() + { + L_ButtonList.L_Start.Instance.Pressed += OnStartGameClick; + L_ButtonList.L_Exit.Instance.Pressed += OnExitClick; + } + + public override void OnHideUi() + { + L_ButtonList.L_Start.Instance.Pressed -= OnStartGameClick; + L_ButtonList.L_Exit.Instance.Pressed -= OnExitClick; + } + + + //点击开始游戏 + private void OnStartGameClick() + { + var config = new DungeonConfig(); + config.GroupName = "testGroup"; + GameApplication.Instance.DungeonManager.LoadDungeon(config); + HideUi(); + } + + //退出游戏 + private void OnExitClick() + { + GetTree().Quit(); + } +}