优化项目架构

This commit is contained in:
2025-09-15 19:10:37 +08:00
parent 4119ed3445
commit 26b856d74e
1361 changed files with 4 additions and 0 deletions

View File

@@ -0,0 +1,267 @@
[gd_scene load_steps=7 format=3 uid="uid://hesp70n3ondo"]
[ext_resource type="Script" uid="uid://mtfp0ct42nrx" path="res://Script/BigPanel/CropStorePanel.gd" id="1_ehof8"]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_8kysg"]
bg_color = Color(0.9, 0.85, 0.75, 0.95)
border_width_left = 8
border_width_top = 8
border_width_right = 8
border_width_bottom = 8
border_color = Color(0.5, 0.3, 0.1, 1)
corner_radius_top_left = 25
corner_radius_top_right = 25
corner_radius_bottom_right = 25
corner_radius_bottom_left = 25
shadow_color = Color(0.3, 0.2, 0.1, 0.4)
shadow_size = 15
shadow_offset = Vector2(3, 3)
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_button_hover"]
bg_color = Color(0.85, 0.7, 0.5, 1)
border_width_left = 2
border_width_top = 2
border_width_right = 2
border_width_bottom = 2
border_color = Color(0.5, 0.4, 0.2, 1)
corner_radius_top_left = 12
corner_radius_top_right = 12
corner_radius_bottom_right = 12
corner_radius_bottom_left = 12
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_button_pressed"]
bg_color = Color(0.65, 0.5, 0.3, 1)
border_width_left = 2
border_width_top = 2
border_width_right = 2
border_width_bottom = 2
border_color = Color(0.3, 0.2, 0.05, 1)
corner_radius_top_left = 12
corner_radius_top_right = 12
corner_radius_bottom_right = 12
corner_radius_bottom_left = 12
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_button"]
bg_color = Color(0.75, 0.6, 0.4, 1)
border_width_left = 2
border_width_top = 2
border_width_right = 2
border_width_bottom = 2
border_color = Color(0.4, 0.3, 0.1, 1)
corner_radius_top_left = 12
corner_radius_top_right = 12
corner_radius_bottom_right = 12
corner_radius_bottom_left = 12
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_uc6q1"]
bg_color = Color(0.95, 0.92, 0.85, 0.9)
border_width_left = 3
border_width_top = 3
border_width_right = 3
border_width_bottom = 3
border_color = Color(0.6, 0.4, 0.2, 0.8)
corner_radius_top_left = 15
corner_radius_top_right = 15
corner_radius_bottom_right = 15
corner_radius_bottom_left = 15
corner_detail = 20
[node name="CropStorePanel" type="Panel"]
offset_left = 81.0
offset_top = 70.0
offset_right = 1640.0
offset_bottom = 790.0
scale = Vector2(0.8, 0.8)
size_flags_horizontal = 3
size_flags_vertical = 3
theme_override_styles/panel = SubResource("StyleBoxFlat_8kysg")
script = ExtResource("1_ehof8")
[node name="TMBackGround" type="ColorRect" parent="."]
layout_mode = 0
offset_left = -101.0
offset_top = -87.0
offset_right = 1655.0
offset_bottom = 811.0
color = Color(0.901961, 0.8, 0.6, 0.262745)
[node name="Title" type="Label" parent="."]
layout_mode = 2
offset_right = 1519.0
offset_bottom = 69.0
size_flags_horizontal = 3
theme_override_colors/font_color = Color(0.4, 0.2, 0.1, 1)
theme_override_colors/font_shadow_color = Color(1, 0.9, 0.7, 0.8)
theme_override_colors/font_outline_color = Color(0.7, 0.5, 0.3, 1)
theme_override_constants/shadow_offset_x = 2
theme_override_constants/shadow_offset_y = 2
theme_override_constants/outline_size = 3
theme_override_constants/shadow_outline_size = 8
theme_override_font_sizes/font_size = 50
text = "🌱 种子商店 🌱"
horizontal_alignment = 1
[node name="SortContainer" type="HBoxContainer" parent="."]
layout_mode = 0
offset_left = 13.0
offset_top = 78.0
offset_right = 1540.0
offset_bottom = 141.0
alignment = 1
[node name="FilterLabel" type="Label" parent="SortContainer"]
modulate = Color(0.439216, 0.560784, 1, 1)
layout_mode = 2
theme_override_colors/font_shadow_color = Color(1, 0.9, 0.7, 0.6)
theme_override_constants/shadow_offset_x = 1
theme_override_constants/shadow_offset_y = 1
theme_override_font_sizes/font_size = 30
text = "🔍 筛选:"
[node name="Sort_All" type="Button" parent="SortContainer"]
layout_mode = 2
theme_override_colors/font_color = Color(0.3, 0.2, 0.1, 1)
theme_override_font_sizes/font_size = 28
theme_override_styles/hover = SubResource("StyleBoxFlat_button_hover")
theme_override_styles/pressed = SubResource("StyleBoxFlat_button_pressed")
theme_override_styles/normal = SubResource("StyleBoxFlat_button")
text = "🌾 全部"
[node name="Sort_Common" type="Button" parent="SortContainer"]
layout_mode = 2
theme_override_colors/font_color = Color(1, 1, 1, 1)
theme_override_font_sizes/font_size = 28
theme_override_styles/hover = SubResource("StyleBoxFlat_button_hover")
theme_override_styles/pressed = SubResource("StyleBoxFlat_button_pressed")
theme_override_styles/normal = SubResource("StyleBoxFlat_button")
text = "⚪ 普通"
[node name="Sort_Superior" type="Button" parent="SortContainer"]
layout_mode = 2
theme_override_colors/font_color = Color(0, 0.823529, 0.415686, 1)
theme_override_font_sizes/font_size = 28
theme_override_styles/hover = SubResource("StyleBoxFlat_button_hover")
theme_override_styles/pressed = SubResource("StyleBoxFlat_button_pressed")
theme_override_styles/normal = SubResource("StyleBoxFlat_button")
text = "🟢 优良"
[node name="Sort_Rare" type="Button" parent="SortContainer"]
layout_mode = 2
theme_override_colors/font_color = Color(0, 0.454902, 0.729412, 1)
theme_override_font_sizes/font_size = 28
theme_override_styles/hover = SubResource("StyleBoxFlat_button_hover")
theme_override_styles/pressed = SubResource("StyleBoxFlat_button_pressed")
theme_override_styles/normal = SubResource("StyleBoxFlat_button")
text = "🔵 稀有"
[node name="Sort_Epic" type="Button" parent="SortContainer"]
layout_mode = 2
theme_override_colors/font_color = Color(0.552941, 0.396078, 0.772549, 1)
theme_override_font_sizes/font_size = 28
theme_override_styles/hover = SubResource("StyleBoxFlat_button_hover")
theme_override_styles/pressed = SubResource("StyleBoxFlat_button_pressed")
theme_override_styles/normal = SubResource("StyleBoxFlat_button")
text = "🟣 史诗"
[node name="Sort_Legendary" type="Button" parent="SortContainer"]
layout_mode = 2
theme_override_colors/font_color = Color(0.988235, 0.835294, 0.247059, 1)
theme_override_font_sizes/font_size = 28
theme_override_styles/hover = SubResource("StyleBoxFlat_button_hover")
theme_override_styles/pressed = SubResource("StyleBoxFlat_button_pressed")
theme_override_styles/normal = SubResource("StyleBoxFlat_button")
text = "🟡 传奇"
[node name="SortLabel" type="Label" parent="SortContainer"]
modulate = Color(0.439216, 0.560784, 1, 1)
layout_mode = 2
theme_override_colors/font_shadow_color = Color(1, 0.9, 0.7, 0.6)
theme_override_constants/shadow_offset_x = 1
theme_override_constants/shadow_offset_y = 1
theme_override_font_sizes/font_size = 30
text = "📊 排序:"
[node name="Sort_Price" type="Button" parent="SortContainer"]
layout_mode = 2
theme_override_colors/font_color = Color(0.2, 0.4, 0.1, 1)
theme_override_font_sizes/font_size = 28
theme_override_styles/hover = SubResource("StyleBoxFlat_button_hover")
theme_override_styles/pressed = SubResource("StyleBoxFlat_button_pressed")
theme_override_styles/normal = SubResource("StyleBoxFlat_button")
text = "💰 按价格"
[node name="Sort_GrowTime" type="Button" parent="SortContainer"]
layout_mode = 2
theme_override_colors/font_color = Color(0.2, 0.4, 0.1, 1)
theme_override_font_sizes/font_size = 28
theme_override_styles/hover = SubResource("StyleBoxFlat_button_hover")
theme_override_styles/pressed = SubResource("StyleBoxFlat_button_pressed")
theme_override_styles/normal = SubResource("StyleBoxFlat_button")
text = "⏰ 按生长时间"
[node name="Sort_Profit" type="Button" parent="SortContainer"]
layout_mode = 2
theme_override_colors/font_color = Color(0.2, 0.4, 0.1, 1)
theme_override_font_sizes/font_size = 28
theme_override_styles/hover = SubResource("StyleBoxFlat_button_hover")
theme_override_styles/pressed = SubResource("StyleBoxFlat_button_pressed")
theme_override_styles/normal = SubResource("StyleBoxFlat_button")
text = "📈 按收益"
[node name="Sort_Level" type="Button" parent="SortContainer"]
layout_mode = 2
theme_override_colors/font_color = Color(0.2, 0.4, 0.1, 1)
theme_override_font_sizes/font_size = 28
theme_override_styles/hover = SubResource("StyleBoxFlat_button_hover")
theme_override_styles/pressed = SubResource("StyleBoxFlat_button_pressed")
theme_override_styles/normal = SubResource("StyleBoxFlat_button")
text = "⭐ 按等级"
[node name="ScrollContainer" type="ScrollContainer" parent="."]
layout_mode = 2
offset_left = 19.0
offset_top = 151.0
offset_right = 3810.0
offset_bottom = 1540.0
scale = Vector2(0.4, 0.4)
size_flags_vertical = 3
theme_override_styles/panel = SubResource("StyleBoxFlat_uc6q1")
horizontal_scroll_mode = 0
vertical_scroll_mode = 2
scroll_deadzone = -10
[node name="Crop_Grid" type="GridContainer" parent="ScrollContainer"]
layout_mode = 2
size_flags_horizontal = 6
size_flags_vertical = 3
columns = 8
[node name="QuitButton" type="Button" parent="."]
custom_minimum_size = Vector2(60, 60)
layout_mode = 2
offset_left = 1478.75
offset_top = 15.0
offset_right = 1538.75
offset_bottom = 78.0
theme_override_colors/font_color = Color(0.8, 0.2, 0.2, 1)
theme_override_font_sizes/font_size = 35
theme_override_styles/hover = SubResource("StyleBoxFlat_button_hover")
theme_override_styles/pressed = SubResource("StyleBoxFlat_button_pressed")
theme_override_styles/normal = SubResource("StyleBoxFlat_button")
text = "❌"
[node name="RefreshButton" type="Button" parent="."]
custom_minimum_size = Vector2(88, 60)
layout_mode = 2
offset_left = 13.0
offset_top = 11.0
offset_right = 101.0
offset_bottom = 74.0
theme_override_colors/font_color = Color(0.3, 0.2, 0.1, 1)
theme_override_font_sizes/font_size = 28
theme_override_styles/hover = SubResource("StyleBoxFlat_button_hover")
theme_override_styles/pressed = SubResource("StyleBoxFlat_button_pressed")
theme_override_styles/normal = SubResource("StyleBoxFlat_button")
text = "🔄 刷新"
[connection signal="pressed" from="RefreshButton" to="." method="_on_refresh_button_pressed"]

View File

@@ -0,0 +1,266 @@
[gd_scene load_steps=7 format=3 uid="uid://drw18a6mcr2of"]
[ext_resource type="Script" uid="uid://ptdj0qmobihd" path="res://Script/BigPanel/CropWarehousePanel.gd" id="1_24g1t"]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_8kysg"]
bg_color = Color(0.9, 0.85, 0.75, 0.95)
border_width_left = 8
border_width_top = 8
border_width_right = 8
border_width_bottom = 8
border_color = Color(0.5, 0.3, 0.1, 1)
corner_radius_top_left = 25
corner_radius_top_right = 25
corner_radius_bottom_right = 25
corner_radius_bottom_left = 25
shadow_color = Color(0.3, 0.2, 0.1, 0.4)
shadow_size = 15
shadow_offset = Vector2(3, 3)
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_button_hover"]
bg_color = Color(0.85, 0.7, 0.5, 1)
border_width_left = 2
border_width_top = 2
border_width_right = 2
border_width_bottom = 2
border_color = Color(0.5, 0.4, 0.2, 1)
corner_radius_top_left = 12
corner_radius_top_right = 12
corner_radius_bottom_right = 12
corner_radius_bottom_left = 12
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_button_pressed"]
bg_color = Color(0.65, 0.5, 0.3, 1)
border_width_left = 2
border_width_top = 2
border_width_right = 2
border_width_bottom = 2
border_color = Color(0.3, 0.2, 0.05, 1)
corner_radius_top_left = 12
corner_radius_top_right = 12
corner_radius_bottom_right = 12
corner_radius_bottom_left = 12
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_button"]
bg_color = Color(0.75, 0.6, 0.4, 1)
border_width_left = 2
border_width_top = 2
border_width_right = 2
border_width_bottom = 2
border_color = Color(0.4, 0.3, 0.1, 1)
corner_radius_top_left = 12
corner_radius_top_right = 12
corner_radius_bottom_right = 12
corner_radius_bottom_left = 12
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_uc6q1"]
bg_color = Color(0.95, 0.92, 0.85, 0.9)
border_width_left = 3
border_width_top = 3
border_width_right = 3
border_width_bottom = 3
border_color = Color(0.6, 0.4, 0.2, 0.8)
corner_radius_top_left = 15
corner_radius_top_right = 15
corner_radius_bottom_right = 15
corner_radius_bottom_left = 15
corner_detail = 20
[node name="CropWarehousePanel" type="Panel"]
offset_left = 58.0
offset_top = 77.0
offset_right = 1624.0
offset_bottom = 797.0
scale = Vector2(0.8, 0.8)
size_flags_horizontal = 3
size_flags_vertical = 3
theme_override_styles/panel = SubResource("StyleBoxFlat_8kysg")
script = ExtResource("1_24g1t")
[node name="TMBackGround" type="ColorRect" parent="."]
layout_mode = 0
offset_left = -72.0
offset_top = -95.0
offset_right = 1678.0
offset_bottom = 804.0
color = Color(0.9, 0.8, 0.6, 0.3)
[node name="Title" type="Label" parent="."]
layout_mode = 2
offset_top = 13.0
offset_right = 1566.0
offset_bottom = 98.0
size_flags_horizontal = 3
theme_override_colors/font_color = Color(0.4, 0.2, 0.1, 1)
theme_override_colors/font_shadow_color = Color(1, 0.9, 0.7, 0.8)
theme_override_colors/font_outline_color = Color(0.7, 0.5, 0.3, 1)
theme_override_constants/shadow_offset_x = 2
theme_override_constants/shadow_offset_y = 2
theme_override_constants/outline_size = 3
theme_override_constants/shadow_outline_size = 8
theme_override_font_sizes/font_size = 45
text = "🌾 作物仓库 🌾"
horizontal_alignment = 1
[node name="SortContainer" type="HBoxContainer" parent="."]
layout_mode = 0
offset_left = 10.0
offset_top = 97.5
offset_right = 1576.0
offset_bottom = 160.5
alignment = 1
[node name="FilterLabel" type="Label" parent="SortContainer"]
self_modulate = Color(0.439216, 0.560784, 1, 1)
layout_mode = 2
theme_override_colors/font_shadow_color = Color(1, 0.9, 0.7, 0.6)
theme_override_constants/shadow_offset_x = 1
theme_override_constants/shadow_offset_y = 1
theme_override_font_sizes/font_size = 30
text = "🔍 筛选:"
[node name="Sort_All" type="Button" parent="SortContainer"]
layout_mode = 2
theme_override_colors/font_color = Color(0.3, 0.2, 0.1, 1)
theme_override_font_sizes/font_size = 28
theme_override_styles/hover = SubResource("StyleBoxFlat_button_hover")
theme_override_styles/pressed = SubResource("StyleBoxFlat_button_pressed")
theme_override_styles/normal = SubResource("StyleBoxFlat_button")
text = "🌾全部"
[node name="Sort_Common" type="Button" parent="SortContainer"]
layout_mode = 2
theme_override_colors/font_color = Color(1, 1, 1, 1)
theme_override_font_sizes/font_size = 28
theme_override_styles/hover = SubResource("StyleBoxFlat_button_hover")
theme_override_styles/pressed = SubResource("StyleBoxFlat_button_pressed")
theme_override_styles/normal = SubResource("StyleBoxFlat_button")
text = "⚪普通"
[node name="Sort_Superior" type="Button" parent="SortContainer"]
layout_mode = 2
theme_override_colors/font_color = Color(0, 0.823529, 0.415686, 1)
theme_override_font_sizes/font_size = 28
theme_override_styles/hover = SubResource("StyleBoxFlat_button_hover")
theme_override_styles/pressed = SubResource("StyleBoxFlat_button_pressed")
theme_override_styles/normal = SubResource("StyleBoxFlat_button")
text = "🟢优良"
[node name="Sort_Rare" type="Button" parent="SortContainer"]
layout_mode = 2
theme_override_colors/font_color = Color(0, 0.454902, 0.729412, 1)
theme_override_font_sizes/font_size = 28
theme_override_styles/hover = SubResource("StyleBoxFlat_button_hover")
theme_override_styles/pressed = SubResource("StyleBoxFlat_button_pressed")
theme_override_styles/normal = SubResource("StyleBoxFlat_button")
text = "🔵稀有"
[node name="Sort_Epic" type="Button" parent="SortContainer"]
layout_mode = 2
theme_override_colors/font_color = Color(0.552941, 0.396078, 0.772549, 1)
theme_override_font_sizes/font_size = 28
theme_override_styles/hover = SubResource("StyleBoxFlat_button_hover")
theme_override_styles/pressed = SubResource("StyleBoxFlat_button_pressed")
theme_override_styles/normal = SubResource("StyleBoxFlat_button")
text = "🟣史诗"
[node name="Sort_Legendary" type="Button" parent="SortContainer"]
layout_mode = 2
theme_override_colors/font_color = Color(0.988235, 0.835294, 0.247059, 1)
theme_override_font_sizes/font_size = 28
theme_override_styles/hover = SubResource("StyleBoxFlat_button_hover")
theme_override_styles/pressed = SubResource("StyleBoxFlat_button_pressed")
theme_override_styles/normal = SubResource("StyleBoxFlat_button")
text = "🟡传奇"
[node name="SortLabel" type="Label" parent="SortContainer"]
self_modulate = Color(0.439216, 0.560784, 1, 1)
layout_mode = 2
theme_override_colors/font_shadow_color = Color(1, 0.9, 0.7, 0.6)
theme_override_constants/shadow_offset_x = 1
theme_override_constants/shadow_offset_y = 1
theme_override_font_sizes/font_size = 30
text = "📊 排序:"
[node name="Sort_Price" type="Button" parent="SortContainer"]
layout_mode = 2
theme_override_colors/font_color = Color(0.3, 0.2, 0.1, 1)
theme_override_font_sizes/font_size = 28
theme_override_styles/hover = SubResource("StyleBoxFlat_button_hover")
theme_override_styles/pressed = SubResource("StyleBoxFlat_button_pressed")
theme_override_styles/normal = SubResource("StyleBoxFlat_button")
text = "💰 按价格"
[node name="Sort_GrowTime" type="Button" parent="SortContainer"]
layout_mode = 2
theme_override_colors/font_color = Color(0.3, 0.2, 0.1, 1)
theme_override_font_sizes/font_size = 28
theme_override_styles/hover = SubResource("StyleBoxFlat_button_hover")
theme_override_styles/pressed = SubResource("StyleBoxFlat_button_pressed")
theme_override_styles/normal = SubResource("StyleBoxFlat_button")
text = "⏰按生长时间"
[node name="Sort_Profit" type="Button" parent="SortContainer"]
layout_mode = 2
theme_override_colors/font_color = Color(0.3, 0.2, 0.1, 1)
theme_override_font_sizes/font_size = 28
theme_override_styles/hover = SubResource("StyleBoxFlat_button_hover")
theme_override_styles/pressed = SubResource("StyleBoxFlat_button_pressed")
theme_override_styles/normal = SubResource("StyleBoxFlat_button")
text = "📈按收益"
[node name="Sort_Level" type="Button" parent="SortContainer"]
layout_mode = 2
theme_override_colors/font_color = Color(0.3, 0.2, 0.1, 1)
theme_override_font_sizes/font_size = 28
theme_override_styles/hover = SubResource("StyleBoxFlat_button_hover")
theme_override_styles/pressed = SubResource("StyleBoxFlat_button_pressed")
theme_override_styles/normal = SubResource("StyleBoxFlat_button")
text = "⭐ 按等级"
[node name="ScrollContainer" type="ScrollContainer" parent="."]
layout_mode = 2
offset_left = 9.0
offset_top = 179.0
offset_right = 3890.0
offset_bottom = 1502.0
scale = Vector2(0.4, 0.4)
size_flags_vertical = 3
theme_override_styles/panel = SubResource("StyleBoxFlat_uc6q1")
horizontal_scroll_mode = 0
vertical_scroll_mode = 2
scroll_deadzone = -10
[node name="Warehouse_Grid" type="GridContainer" parent="ScrollContainer"]
layout_mode = 2
size_flags_horizontal = 6
size_flags_vertical = 3
columns = 8
[node name="QuitButton" type="Button" parent="."]
custom_minimum_size = Vector2(60, 60)
layout_mode = 2
offset_left = 1482.5
offset_top = 27.5
offset_right = 1542.5
offset_bottom = 90.5
theme_override_colors/font_color = Color(0.8, 0.2, 0.2, 1)
theme_override_font_sizes/font_size = 35
theme_override_styles/hover = SubResource("StyleBoxFlat_button_hover")
theme_override_styles/pressed = SubResource("StyleBoxFlat_button_pressed")
theme_override_styles/normal = SubResource("StyleBoxFlat_button")
text = "❌"
[node name="RefreshButton" type="Button" parent="."]
custom_minimum_size = Vector2(88, 60)
layout_mode = 2
offset_left = 13.0
offset_top = 13.0
offset_right = 117.0
offset_bottom = 76.0
theme_override_colors/font_color = Color(0.3, 0.2, 0.1, 1)
theme_override_font_sizes/font_size = 28
theme_override_styles/hover = SubResource("StyleBoxFlat_button_hover")
theme_override_styles/pressed = SubResource("StyleBoxFlat_button_pressed")
theme_override_styles/normal = SubResource("StyleBoxFlat_button")
text = "🔄刷新"

View File

@@ -0,0 +1,112 @@
[gd_scene load_steps=4 format=3 uid="uid://smypui0vyso5"]
[ext_resource type="Script" uid="uid://c0jfbtkh0mj5b" path="res://Script/BigPanel/DailyCheckInPanel.gd" id="1_fj7a7"]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_217t6"]
border_width_left = 15
border_width_top = 15
border_width_right = 15
border_width_bottom = 15
corner_detail = 20
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_4gvib"]
[node name="DailyCheckInPanel" type="Panel"]
offset_left = 441.0
offset_right = 1041.0
offset_bottom = 720.0
theme_override_styles/panel = SubResource("StyleBoxFlat_217t6")
script = ExtResource("1_fj7a7")
[node name="Title" type="Label" parent="."]
layout_mode = 0
offset_top = 20.0
offset_right = 600.0
offset_bottom = 69.0
theme_override_colors/font_color = Color(0.624759, 0.8051, 0.828302, 1)
theme_override_colors/font_shadow_color = Color(0, 0, 0, 1)
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
theme_override_constants/shadow_offset_x = 3
theme_override_constants/shadow_offset_y = 3
theme_override_constants/outline_size = 10
theme_override_constants/shadow_outline_size = 10
theme_override_font_sizes/font_size = 35
text = "📅每日签到📅"
horizontal_alignment = 1
[node name="Label" type="Label" parent="."]
layout_mode = 0
offset_left = 23.0
offset_top = 360.0
offset_right = 585.0
offset_bottom = 409.0
theme_override_colors/font_shadow_color = Color(0, 0, 0, 1)
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
theme_override_constants/shadow_offset_x = 2
theme_override_constants/shadow_offset_y = 2
theme_override_constants/outline_size = 15
theme_override_constants/shadow_outline_size = 10
theme_override_font_sizes/font_size = 30
theme_override_styles/normal = SubResource("StyleBoxFlat_4gvib")
text = "🎉签到奖励🎉"
horizontal_alignment = 1
vertical_alignment = 1
[node name="QuitButton" type="Button" parent="."]
custom_minimum_size = Vector2(57, 57)
layout_mode = 0
offset_left = 520.0
offset_top = 22.0
offset_right = 577.0
offset_bottom = 79.0
theme_override_font_sizes/font_size = 35
text = "X"
[node name="DailyCheckInButton" type="Button" parent="."]
modulate = Color(1, 1, 0.52549, 1)
custom_minimum_size = Vector2(150, 70)
layout_mode = 0
offset_left = 239.0
offset_top = 630.0
offset_right = 389.0
offset_bottom = 700.0
theme_override_font_sizes/font_size = 35
text = "签到"
[node name="Scroll" type="ScrollContainer" parent="."]
layout_mode = 0
offset_left = 23.0
offset_top = 77.0
offset_right = 577.0
offset_bottom = 360.0
[node name="DailyCheckInHistory" type="RichTextLabel" parent="Scroll"]
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 3
bbcode_enabled = true
threaded = true
[node name="DailyCheckInReward" type="RichTextLabel" parent="."]
layout_mode = 0
offset_left = 23.0
offset_top = 409.0
offset_right = 577.0
offset_bottom = 630.0
theme_override_font_sizes/normal_font_size = 20
bbcode_enabled = true
text = "+500 经验,+400 钱币,+5 普通-番茄种子,+1 传奇-火龙果种子 "
horizontal_alignment = 1
[node name="ConfirmDialog" type="ConfirmationDialog" parent="."]
title = "标题"
initial_position = 3
size = Vector2i(450, 350)
current_screen = 0
ok_button_text = "✅ 确定"
dialog_text = "弹窗内容"
dialog_autowrap = true
cancel_button_text = "❌ 取消"
[connection signal="pressed" from="QuitButton" to="." method="_on_quit_button_pressed"]
[connection signal="pressed" from="DailyCheckInButton" to="." method="_on_daily_check_in_button_pressed"]

View File

@@ -0,0 +1,210 @@
[gd_scene load_steps=7 format=3 uid="uid://cehw5sx5pgmmc"]
[ext_resource type="Script" uid="uid://b701r833vse3u" path="res://Script/BigPanel/ItemBagPanel.gd" id="1_ixe68"]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_8kysg"]
bg_color = Color(0.9, 0.85, 0.75, 0.95)
border_width_left = 8
border_width_top = 8
border_width_right = 8
border_width_bottom = 8
border_color = Color(0.5, 0.3, 0.1, 1)
corner_radius_top_left = 25
corner_radius_top_right = 25
corner_radius_bottom_right = 25
corner_radius_bottom_left = 25
shadow_color = Color(0.3, 0.2, 0.1, 0.4)
shadow_size = 15
shadow_offset = Vector2(3, 3)
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_button_hover"]
bg_color = Color(0.85, 0.7, 0.5, 1)
border_width_left = 2
border_width_top = 2
border_width_right = 2
border_width_bottom = 2
border_color = Color(0.5, 0.4, 0.2, 1)
corner_radius_top_left = 12
corner_radius_top_right = 12
corner_radius_bottom_right = 12
corner_radius_bottom_left = 12
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_button_pressed"]
bg_color = Color(0.65, 0.5, 0.3, 1)
border_width_left = 2
border_width_top = 2
border_width_right = 2
border_width_bottom = 2
border_color = Color(0.3, 0.2, 0.05, 1)
corner_radius_top_left = 12
corner_radius_top_right = 12
corner_radius_bottom_right = 12
corner_radius_bottom_left = 12
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_button"]
bg_color = Color(0.75, 0.6, 0.4, 1)
border_width_left = 2
border_width_top = 2
border_width_right = 2
border_width_bottom = 2
border_color = Color(0.4, 0.3, 0.1, 1)
corner_radius_top_left = 12
corner_radius_top_right = 12
corner_radius_bottom_right = 12
corner_radius_bottom_left = 12
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_ixe68"]
bg_color = Color(0.95, 0.92, 0.85, 0.9)
border_width_left = 3
border_width_top = 3
border_width_right = 3
border_width_bottom = 3
border_color = Color(0.6, 0.4, 0.2, 0.8)
corner_radius_top_left = 15
corner_radius_top_right = 15
corner_radius_bottom_right = 15
corner_radius_bottom_left = 15
corner_detail = 20
[node name="ItemBagPanel" type="Panel"]
offset_left = 69.0
offset_top = 56.0
offset_right = 1635.0
offset_bottom = 836.0
scale = Vector2(0.8, 0.8)
size_flags_horizontal = 3
size_flags_vertical = 3
theme_override_styles/panel = SubResource("StyleBoxFlat_8kysg")
script = ExtResource("1_ixe68")
[node name="TMBackGround" type="ColorRect" parent="."]
layout_mode = 0
offset_left = -90.0
offset_top = -71.0
offset_right = 1672.0
offset_bottom = 831.0
color = Color(0.9, 0.8, 0.6, 0.3)
[node name="Title" type="Label" parent="."]
layout_mode = 2
offset_top = 13.75
offset_right = 1566.0
offset_bottom = 82.75
size_flags_horizontal = 3
theme_override_colors/font_color = Color(0.4, 0.2, 0.1, 1)
theme_override_colors/font_shadow_color = Color(1, 0.9, 0.7, 0.8)
theme_override_colors/font_outline_color = Color(0.7, 0.5, 0.3, 1)
theme_override_constants/shadow_offset_x = 2
theme_override_constants/shadow_offset_y = 2
theme_override_constants/outline_size = 3
theme_override_constants/shadow_outline_size = 8
theme_override_font_sizes/font_size = 45
text = "🎒 道具背包 🎒"
horizontal_alignment = 1
[node name="QuitButton" type="Button" parent="."]
custom_minimum_size = Vector2(60, 60)
layout_mode = 2
offset_left = 1478.75
offset_top = 20.0
offset_right = 1538.75
offset_bottom = 83.0
theme_override_colors/font_color = Color(0.8, 0.2, 0.2, 1)
theme_override_font_sizes/font_size = 35
theme_override_styles/hover = SubResource("StyleBoxFlat_button_hover")
theme_override_styles/pressed = SubResource("StyleBoxFlat_button_pressed")
theme_override_styles/normal = SubResource("StyleBoxFlat_button")
text = "❌"
[node name="RefreshButton" type="Button" parent="."]
custom_minimum_size = Vector2(60, 60)
layout_mode = 2
offset_left = 27.5
offset_top = 16.25
offset_right = 115.5
offset_bottom = 79.25
theme_override_colors/font_color = Color(0.3, 0.2, 0.1, 1)
theme_override_font_sizes/font_size = 28
theme_override_styles/hover = SubResource("StyleBoxFlat_button_hover")
theme_override_styles/pressed = SubResource("StyleBoxFlat_button_pressed")
theme_override_styles/normal = SubResource("StyleBoxFlat_button")
text = "🔄刷新"
[node name="All_Filter" type="Button" parent="."]
custom_minimum_size = Vector2(60, 60)
layout_mode = 0
offset_left = 188.75
offset_top = 16.25
offset_right = 286.75
offset_bottom = 79.25
theme_override_colors/font_color = Color(0.3, 0.2, 0.1, 1)
theme_override_font_sizes/font_size = 28
theme_override_styles/hover = SubResource("StyleBoxFlat_button_hover")
theme_override_styles/pressed = SubResource("StyleBoxFlat_button_pressed")
theme_override_styles/normal = SubResource("StyleBoxFlat_button")
text = "🎒全部"
[node name="Pet_Filter" type="Button" parent="."]
custom_minimum_size = Vector2(60, 60)
layout_mode = 0
offset_left = 297.5
offset_top = 15.0
offset_right = 395.5
offset_bottom = 78.0
theme_override_colors/font_color = Color(0.3, 0.2, 0.1, 1)
theme_override_font_sizes/font_size = 28
theme_override_styles/hover = SubResource("StyleBoxFlat_button_hover")
theme_override_styles/pressed = SubResource("StyleBoxFlat_button_pressed")
theme_override_styles/normal = SubResource("StyleBoxFlat_button")
text = "🐾宠物"
[node name="Crop_Filter" type="Button" parent="."]
custom_minimum_size = Vector2(60, 60)
layout_mode = 0
offset_left = 410.0
offset_top = 13.75
offset_right = 508.0
offset_bottom = 76.75
theme_override_colors/font_color = Color(0.3, 0.2, 0.1, 1)
theme_override_font_sizes/font_size = 28
theme_override_styles/hover = SubResource("StyleBoxFlat_button_hover")
theme_override_styles/pressed = SubResource("StyleBoxFlat_button_pressed")
theme_override_styles/normal = SubResource("StyleBoxFlat_button")
text = "🌾作物"
[node name="Farm_Filter" type="Button" parent="."]
custom_minimum_size = Vector2(60, 60)
layout_mode = 0
offset_left = 521.25
offset_top = 16.25
offset_right = 619.25
offset_bottom = 79.25
theme_override_colors/font_color = Color(0.3, 0.2, 0.1, 1)
theme_override_font_sizes/font_size = 28
theme_override_styles/hover = SubResource("StyleBoxFlat_button_hover")
theme_override_styles/pressed = SubResource("StyleBoxFlat_button_pressed")
theme_override_styles/normal = SubResource("StyleBoxFlat_button")
text = "🏡农场"
[node name="ScrollContainer" type="ScrollContainer" parent="."]
offset_left = 51.0
offset_top = 88.0
offset_right = 3663.0
offset_bottom = 1687.0
scale = Vector2(0.4, 0.4)
size_flags_vertical = 3
theme_override_styles/panel = SubResource("StyleBoxFlat_ixe68")
horizontal_scroll_mode = 0
[node name="Bag_Grid" type="GridContainer" parent="ScrollContainer"]
layout_mode = 2
size_flags_horizontal = 6
size_flags_vertical = 3
columns = 8
[connection signal="pressed" from="QuitButton" to="." method="_on_quit_button_pressed"]
[connection signal="pressed" from="RefreshButton" to="." method="_on_refresh_button_pressed"]
[connection signal="pressed" from="All_Filter" to="." method="_on_all_filter_pressed"]
[connection signal="pressed" from="Pet_Filter" to="." method="_on_pet_filter_pressed"]
[connection signal="pressed" from="Crop_Filter" to="." method="_on_crop_filter_pressed"]
[connection signal="pressed" from="Farm_Filter" to="." method="_on_farm_filter_pressed"]

View File

@@ -0,0 +1,210 @@
[gd_scene load_steps=7 format=3 uid="uid://j4ft87o7jk14"]
[ext_resource type="Script" uid="uid://bruqwi63myl1m" path="res://Script/BigPanel/ItemStorePanel.gd" id="1_vx1qn"]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_8kysg"]
bg_color = Color(0.9, 0.85, 0.75, 0.95)
border_width_left = 8
border_width_top = 8
border_width_right = 8
border_width_bottom = 8
border_color = Color(0.5, 0.3, 0.1, 1)
corner_radius_top_left = 25
corner_radius_top_right = 25
corner_radius_bottom_right = 25
corner_radius_bottom_left = 25
shadow_color = Color(0.3, 0.2, 0.1, 0.4)
shadow_size = 15
shadow_offset = Vector2(3, 3)
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_uc6q1"]
bg_color = Color(0.95, 0.92, 0.85, 0.9)
border_width_left = 3
border_width_top = 3
border_width_right = 3
border_width_bottom = 3
border_color = Color(0.6, 0.4, 0.2, 0.8)
corner_radius_top_left = 15
corner_radius_top_right = 15
corner_radius_bottom_right = 15
corner_radius_bottom_left = 15
corner_detail = 20
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_button_hover"]
bg_color = Color(0.85, 0.7, 0.5, 1)
border_width_left = 2
border_width_top = 2
border_width_right = 2
border_width_bottom = 2
border_color = Color(0.5, 0.4, 0.2, 1)
corner_radius_top_left = 12
corner_radius_top_right = 12
corner_radius_bottom_right = 12
corner_radius_bottom_left = 12
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_button_pressed"]
bg_color = Color(0.65, 0.5, 0.3, 1)
border_width_left = 2
border_width_top = 2
border_width_right = 2
border_width_bottom = 2
border_color = Color(0.3, 0.2, 0.05, 1)
corner_radius_top_left = 12
corner_radius_top_right = 12
corner_radius_bottom_right = 12
corner_radius_bottom_left = 12
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_button"]
bg_color = Color(0.75, 0.6, 0.4, 1)
border_width_left = 2
border_width_top = 2
border_width_right = 2
border_width_bottom = 2
border_color = Color(0.4, 0.3, 0.1, 1)
corner_radius_top_left = 12
corner_radius_top_right = 12
corner_radius_bottom_right = 12
corner_radius_bottom_left = 12
[node name="ItemStorePanel" type="Panel"]
offset_left = 58.0
offset_top = 79.0
offset_right = 1598.0
offset_bottom = 799.0
scale = Vector2(0.8, 0.8)
size_flags_horizontal = 3
size_flags_vertical = 3
theme_override_styles/panel = SubResource("StyleBoxFlat_8kysg")
script = ExtResource("1_vx1qn")
[node name="TMBackGround" type="ColorRect" parent="."]
layout_mode = 0
offset_left = -85.0
offset_top = -129.0
offset_right = 1690.0
offset_bottom = 820.0
color = Color(0.9, 0.8, 0.6, 0.3)
[node name="ScrollContainer" type="ScrollContainer" parent="."]
layout_mode = 2
offset_left = 51.0
offset_top = 88.0
offset_right = 3663.0
offset_bottom = 1571.0
scale = Vector2(0.4, 0.4)
size_flags_vertical = 3
theme_override_styles/panel = SubResource("StyleBoxFlat_uc6q1")
horizontal_scroll_mode = 0
[node name="Store_Grid" type="GridContainer" parent="ScrollContainer"]
layout_mode = 2
size_flags_horizontal = 6
size_flags_vertical = 3
columns = 8
[node name="Title" type="Label" parent="."]
layout_mode = 2
offset_right = 1540.0
offset_bottom = 75.0
size_flags_horizontal = 3
theme_override_colors/font_color = Color(0.4, 0.2, 0.1, 1)
theme_override_colors/font_shadow_color = Color(1, 0.9, 0.7, 0.8)
theme_override_colors/font_outline_color = Color(0.7, 0.5, 0.3, 1)
theme_override_constants/shadow_offset_x = 2
theme_override_constants/shadow_offset_y = 2
theme_override_constants/outline_size = 3
theme_override_constants/shadow_outline_size = 8
theme_override_font_sizes/font_size = 45
text = "🏪 道具商店 🏪"
horizontal_alignment = 1
vertical_alignment = 1
[node name="QuitButton" type="Button" parent="."]
custom_minimum_size = Vector2(60, 60)
layout_mode = 2
offset_left = 1457.5
offset_top = 13.75
offset_right = 1517.5
offset_bottom = 76.75
theme_override_colors/font_color = Color(0.8, 0.2, 0.2, 1)
theme_override_font_sizes/font_size = 35
theme_override_styles/hover = SubResource("StyleBoxFlat_button_hover")
theme_override_styles/pressed = SubResource("StyleBoxFlat_button_pressed")
theme_override_styles/normal = SubResource("StyleBoxFlat_button")
text = "❌"
[node name="RefreshButton" type="Button" parent="."]
custom_minimum_size = Vector2(60, 60)
layout_mode = 2
offset_left = 12.5
offset_top = 12.5
offset_right = 100.5
offset_bottom = 75.5
theme_override_colors/font_color = Color(0.3, 0.2, 0.1, 1)
theme_override_font_sizes/font_size = 28
theme_override_styles/hover = SubResource("StyleBoxFlat_button_hover")
theme_override_styles/pressed = SubResource("StyleBoxFlat_button_pressed")
theme_override_styles/normal = SubResource("StyleBoxFlat_button")
text = "🔄刷新"
[node name="All_Filter" type="Button" parent="."]
custom_minimum_size = Vector2(60, 60)
layout_mode = 2
offset_left = 161.25
offset_top = 13.75
offset_right = 259.25
offset_bottom = 76.75
theme_override_colors/font_color = Color(0.3, 0.2, 0.1, 1)
theme_override_font_sizes/font_size = 28
theme_override_styles/hover = SubResource("StyleBoxFlat_button_hover")
theme_override_styles/pressed = SubResource("StyleBoxFlat_button_pressed")
theme_override_styles/normal = SubResource("StyleBoxFlat_button")
text = "🏪全部"
[node name="Pet_Filter" type="Button" parent="."]
custom_minimum_size = Vector2(60, 60)
layout_mode = 2
offset_left = 277.5
offset_top = 13.75
offset_right = 375.5
offset_bottom = 76.75
theme_override_colors/font_color = Color(0.3, 0.2, 0.1, 1)
theme_override_font_sizes/font_size = 28
theme_override_styles/hover = SubResource("StyleBoxFlat_button_hover")
theme_override_styles/pressed = SubResource("StyleBoxFlat_button_pressed")
theme_override_styles/normal = SubResource("StyleBoxFlat_button")
text = "🐾宠物"
[node name="Crop_Filter" type="Button" parent="."]
custom_minimum_size = Vector2(60, 60)
layout_mode = 2
offset_left = 391.25
offset_top = 12.5
offset_right = 489.25
offset_bottom = 75.5
theme_override_colors/font_color = Color(0.3, 0.2, 0.1, 1)
theme_override_font_sizes/font_size = 28
theme_override_styles/hover = SubResource("StyleBoxFlat_button_hover")
theme_override_styles/pressed = SubResource("StyleBoxFlat_button_pressed")
theme_override_styles/normal = SubResource("StyleBoxFlat_button")
text = "🌾作物"
[node name="Farm_Filter" type="Button" parent="."]
custom_minimum_size = Vector2(60, 60)
layout_mode = 2
offset_left = 507.5
offset_top = 12.5
offset_right = 605.5
offset_bottom = 75.5
theme_override_colors/font_color = Color(0.3, 0.2, 0.1, 1)
theme_override_font_sizes/font_size = 28
theme_override_styles/hover = SubResource("StyleBoxFlat_button_hover")
theme_override_styles/pressed = SubResource("StyleBoxFlat_button_pressed")
theme_override_styles/normal = SubResource("StyleBoxFlat_button")
text = "🏡农场"
[connection signal="pressed" from="RefreshButton" to="." method="_on_refresh_button_pressed"]
[connection signal="pressed" from="All_Filter" to="." method="_on_all_filter_pressed"]
[connection signal="pressed" from="Pet_Filter" to="." method="_on_pet_filter_pressed"]
[connection signal="pressed" from="Crop_Filter" to="." method="_on_crop_filter_pressed"]
[connection signal="pressed" from="Farm_Filter" to="." method="_on_farm_filter_pressed"]

View File

@@ -0,0 +1,358 @@
[gd_scene load_steps=3 format=3 uid="uid://cbhitturvihqj"]
[ext_resource type="Script" uid="uid://cka0r4g8tbf0" path="res://Script/BigPanel/LoginPanel.gd" id="1_xnwaq"]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_n8m38"]
bg_color = Color(0.454902, 0.321569, 0.188235, 0.85098)
border_width_left = 5
border_width_top = 5
border_width_right = 5
border_width_bottom = 5
border_color = Color(0.8, 0.6, 0.4, 1)
corner_radius_top_left = 20
corner_radius_top_right = 20
corner_radius_bottom_right = 20
corner_radius_bottom_left = 20
[node name="LoginPanel" type="PanelContainer"]
offset_left = 343.0
offset_top = 5.0
offset_right = 1093.0
offset_bottom = 795.0
scale = Vector2(0.9, 0.9)
theme_override_styles/panel = SubResource("StyleBoxFlat_n8m38")
script = ExtResource("1_xnwaq")
[node name="LoginVBox" type="VBoxContainer" parent="."]
layout_mode = 2
[node name="Title" type="Label" parent="LoginVBox"]
modulate = Color(1, 1, 0.537255, 1)
layout_mode = 2
theme_override_colors/font_shadow_color = Color(0, 0, 0, 1)
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
theme_override_constants/shadow_offset_x = 5
theme_override_constants/shadow_offset_y = 5
theme_override_constants/outline_size = 15
theme_override_constants/shadow_outline_size = 15
theme_override_font_sizes/font_size = 40
text = "🌾登录 🌾"
horizontal_alignment = 1
vertical_alignment = 1
[node name="UserName" type="HBoxContainer" parent="LoginVBox"]
layout_mode = 2
[node name="Label" type="Label" parent="LoginVBox/UserName"]
layout_mode = 2
theme_override_font_sizes/font_size = 30
text = "账号🔒"
horizontal_alignment = 1
vertical_alignment = 1
[node name="username_input" type="LineEdit" parent="LoginVBox/UserName"]
layout_mode = 2
size_flags_horizontal = 3
theme_override_font_sizes/font_size = 30
placeholder_text = "请输入QQ号"
metadata/_edit_use_anchors_ = true
[node name="Password" type="HBoxContainer" parent="LoginVBox"]
layout_mode = 2
[node name="Label2" type="Label" parent="LoginVBox/Password"]
layout_mode = 2
theme_override_font_sizes/font_size = 30
text = "密码🔑"
horizontal_alignment = 1
vertical_alignment = 1
[node name="password_input" type="LineEdit" parent="LoginVBox/Password"]
layout_mode = 2
size_flags_horizontal = 3
theme_override_font_sizes/font_size = 30
placeholder_text = "请输入密码"
[node name="LoginButton" type="Button" parent="LoginVBox"]
layout_mode = 2
theme_override_font_sizes/font_size = 30
text = "登录 🚪"
[node name="RegisterButton" type="Button" parent="LoginVBox"]
layout_mode = 2
theme_override_font_sizes/font_size = 30
text = "注册🆕"
[node name="ForgetPasswdButton" type="Button" parent="LoginVBox"]
layout_mode = 2
theme_override_font_sizes/font_size = 30
text = "忘记密码🤔"
[node name="Note" type="Label" parent="LoginVBox"]
modulate = Color(1, 0.552941, 1, 1)
layout_mode = 2
theme_override_font_sizes/font_size = 30
text = "⚠️注意:首次游玩游戏需要注册账号,
账号请直接输入您的QQ号系统会直接向您的QQ
邮箱发送一串验证码进行注册验证,密码请设置的复杂一
点,以免被暴力破解("
horizontal_alignment = 1
vertical_alignment = 1
[node name="status_label" type="Label" parent="LoginVBox"]
layout_mode = 2
theme_override_font_sizes/font_size = 30
text = "连接状态"
horizontal_alignment = 1
[node name="RegisterVbox" type="VBoxContainer" parent="."]
visible = false
layout_mode = 2
[node name="Title" type="Label" parent="RegisterVbox"]
modulate = Color(1, 1, 0.537255, 1)
layout_mode = 2
theme_override_colors/font_shadow_color = Color(0, 0, 0, 1)
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
theme_override_constants/shadow_offset_x = 5
theme_override_constants/shadow_offset_y = 5
theme_override_constants/outline_size = 15
theme_override_constants/shadow_outline_size = 15
theme_override_font_sizes/font_size = 40
text = "🏡注册🏡"
horizontal_alignment = 1
vertical_alignment = 1
[node name="RegisterUserName" type="HBoxContainer" parent="RegisterVbox"]
layout_mode = 2
[node name="Label" type="Label" parent="RegisterVbox/RegisterUserName"]
layout_mode = 2
theme_override_font_sizes/font_size = 30
text = "账号🔒"
horizontal_alignment = 1
vertical_alignment = 1
[node name="username_input" type="LineEdit" parent="RegisterVbox/RegisterUserName"]
layout_mode = 2
size_flags_horizontal = 3
theme_override_font_sizes/font_size = 30
placeholder_text = "请输入QQ号"
metadata/_edit_use_anchors_ = true
[node name="Password1" type="HBoxContainer" parent="RegisterVbox"]
layout_mode = 2
[node name="Label2" type="Label" parent="RegisterVbox/Password1"]
layout_mode = 2
theme_override_font_sizes/font_size = 30
text = "密码🔑"
horizontal_alignment = 1
vertical_alignment = 1
[node name="password_input" type="LineEdit" parent="RegisterVbox/Password1"]
layout_mode = 2
size_flags_horizontal = 3
theme_override_font_sizes/font_size = 30
placeholder_text = "请输入密码"
[node name="Password2" type="HBoxContainer" parent="RegisterVbox"]
layout_mode = 2
[node name="Label2" type="Label" parent="RegisterVbox/Password2"]
layout_mode = 2
theme_override_font_sizes/font_size = 30
text = "确认密码 🔑"
horizontal_alignment = 1
vertical_alignment = 1
[node name="password_input2" type="LineEdit" parent="RegisterVbox/Password2"]
layout_mode = 2
size_flags_horizontal = 3
theme_override_font_sizes/font_size = 30
placeholder_text = "请再次输入您的密码"
[node name="PlayerName" type="HBoxContainer" parent="RegisterVbox"]
layout_mode = 2
[node name="Label2" type="Label" parent="RegisterVbox/PlayerName"]
layout_mode = 2
theme_override_font_sizes/font_size = 30
text = "玩家昵称 🧑‍🌾"
horizontal_alignment = 1
vertical_alignment = 1
[node name="playername_input" type="LineEdit" parent="RegisterVbox/PlayerName"]
layout_mode = 2
size_flags_horizontal = 3
theme_override_font_sizes/font_size = 30
placeholder_text = "给自己取个好听的名字吧!"
[node name="FarmName" type="HBoxContainer" parent="RegisterVbox"]
layout_mode = 2
[node name="Label" type="Label" parent="RegisterVbox/FarmName"]
layout_mode = 2
theme_override_font_sizes/font_size = 30
text = "农场名称 🏞️"
horizontal_alignment = 1
vertical_alignment = 1
[node name="farmname_input" type="LineEdit" parent="RegisterVbox/FarmName"]
layout_mode = 2
size_flags_horizontal = 3
theme_override_font_sizes/font_size = 30
placeholder_text = "给你的农场取个名字吧!"
metadata/_edit_use_anchors_ = true
[node name="VerificationCode" type="HBoxContainer" parent="RegisterVbox"]
layout_mode = 2
[node name="Label" type="Label" parent="RegisterVbox/VerificationCode"]
layout_mode = 2
theme_override_font_sizes/font_size = 30
text = "验证码📧"
horizontal_alignment = 1
vertical_alignment = 1
[node name="verificationcode_input" type="LineEdit" parent="RegisterVbox/VerificationCode"]
layout_mode = 2
size_flags_horizontal = 3
theme_override_font_sizes/font_size = 30
placeholder_text = "请输入您的QQ邮箱收到的验证码"
metadata/_edit_use_anchors_ = true
[node name="SendButton" type="Button" parent="RegisterVbox/VerificationCode"]
layout_mode = 2
theme_override_font_sizes/font_size = 30
text = "发送验证码"
[node name="RegisterButton2" type="Button" parent="RegisterVbox"]
layout_mode = 2
theme_override_font_sizes/font_size = 30
text = "注册🆕"
[node name="Register2LoginButton" type="Button" parent="RegisterVbox"]
layout_mode = 2
theme_override_font_sizes/font_size = 30
text = "返回登录🚪"
[node name="Note" type="Label" parent="RegisterVbox"]
modulate = Color(1, 0.552941, 1, 1)
layout_mode = 2
theme_override_font_sizes/font_size = 30
text = "⚠️注意:首次游玩游戏需要注册账号,
账号请直接输入您的QQ号系统会直接向您的QQ
邮箱发送一串验证码进行注册验证,密码请设置的复杂一
点,以免被暴力破解("
horizontal_alignment = 1
vertical_alignment = 1
[node name="status_label2" type="Label" parent="RegisterVbox"]
layout_mode = 2
theme_override_font_sizes/font_size = 30
text = "连接状态"
horizontal_alignment = 1
[node name="ForgetPasswordVbox" type="VBoxContainer" parent="."]
visible = false
layout_mode = 2
[node name="Title" type="Label" parent="ForgetPasswordVbox"]
modulate = Color(1, 1, 0.537255, 1)
layout_mode = 2
theme_override_colors/font_shadow_color = Color(0, 0, 0, 1)
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
theme_override_constants/shadow_offset_x = 5
theme_override_constants/shadow_offset_y = 5
theme_override_constants/outline_size = 15
theme_override_constants/shadow_outline_size = 15
theme_override_font_sizes/font_size = 40
text = "🧐找回密码🧐"
horizontal_alignment = 1
vertical_alignment = 1
[node name="ForgetPasswordUserName" type="HBoxContainer" parent="ForgetPasswordVbox"]
layout_mode = 2
[node name="Label" type="Label" parent="ForgetPasswordVbox/ForgetPasswordUserName"]
layout_mode = 2
theme_override_font_sizes/font_size = 30
text = "账号🔒"
horizontal_alignment = 1
vertical_alignment = 1
[node name="username_input" type="LineEdit" parent="ForgetPasswordVbox/ForgetPasswordUserName"]
layout_mode = 2
size_flags_horizontal = 3
theme_override_font_sizes/font_size = 30
placeholder_text = "请输入QQ号"
metadata/_edit_use_anchors_ = true
[node name="NewPassword" type="HBoxContainer" parent="ForgetPasswordVbox"]
layout_mode = 2
[node name="Label2" type="Label" parent="ForgetPasswordVbox/NewPassword"]
layout_mode = 2
theme_override_font_sizes/font_size = 30
text = "新密码 🔑"
horizontal_alignment = 1
vertical_alignment = 1
[node name="password_input" type="LineEdit" parent="ForgetPasswordVbox/NewPassword"]
layout_mode = 2
size_flags_horizontal = 3
theme_override_font_sizes/font_size = 30
placeholder_text = "请设置您的新密码"
[node name="VerificationCode2" type="HBoxContainer" parent="ForgetPasswordVbox"]
layout_mode = 2
[node name="Label" type="Label" parent="ForgetPasswordVbox/VerificationCode2"]
layout_mode = 2
theme_override_font_sizes/font_size = 30
text = "验证码📧"
horizontal_alignment = 1
vertical_alignment = 1
[node name="verificationcode_input" type="LineEdit" parent="ForgetPasswordVbox/VerificationCode2"]
layout_mode = 2
size_flags_horizontal = 3
theme_override_font_sizes/font_size = 30
placeholder_text = "请输入您的QQ邮箱收到的验证码"
metadata/_edit_use_anchors_ = true
[node name="SendButton" type="Button" parent="ForgetPasswordVbox/VerificationCode2"]
layout_mode = 2
theme_override_font_sizes/font_size = 30
text = "发送验证码"
[node name="Forget2LoginButton" type="Button" parent="ForgetPasswordVbox"]
layout_mode = 2
theme_override_font_sizes/font_size = 30
text = "确认"
[node name="ForgetPasswordButton" type="Button" parent="ForgetPasswordVbox"]
layout_mode = 2
theme_override_font_sizes/font_size = 30
text = "确认"
[node name="Note" type="Label" parent="ForgetPasswordVbox"]
modulate = Color(1, 0.552941, 1, 1)
layout_mode = 2
theme_override_font_sizes/font_size = 30
text = "注意:首次游玩游戏需要注册账号,
账号请直接输入您的QQ号系统会直接向您的QQ
邮箱发送一串验证码进行注册验证,密码请设置的复杂一
点,以免被暴力破解("
horizontal_alignment = 1
vertical_alignment = 1
[node name="status_label3" type="Label" parent="ForgetPasswordVbox"]
layout_mode = 2
theme_override_font_sizes/font_size = 30
text = "连接状态"
horizontal_alignment = 1
[connection signal="pressed" from="RegisterVbox/Register2LoginButton" to="." method="_on_register_2_login_button_pressed"]
[connection signal="pressed" from="ForgetPasswordVbox/Forget2LoginButton" to="." method="_on_forget_2_login_button_pressed"]

View File

@@ -0,0 +1,133 @@
[gd_scene load_steps=3 format=3 uid="uid://bndf1e4sgdjr6"]
[ext_resource type="Script" uid="uid://65e0rl31fx0i" path="res://Script/BigPanel/LuckyDrawPanel.gd" id="1_dcmen"]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_ynokl"]
border_width_left = 15
border_width_top = 15
border_width_right = 15
border_width_bottom = 15
corner_detail = 20
[node name="LuckyDrawPanel" type="Panel"]
offset_left = 373.0
offset_top = 1.0
offset_right = 1045.0
offset_bottom = 721.0
theme_override_styles/panel = SubResource("StyleBoxFlat_ynokl")
script = ExtResource("1_dcmen")
[node name="Title" type="Label" parent="."]
layout_mode = 0
offset_top = 19.0
offset_right = 669.0
offset_bottom = 78.0
theme_override_colors/font_color = Color(0.624759, 0.8051, 0.828302, 1)
theme_override_colors/font_shadow_color = Color(0, 0, 0, 1)
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
theme_override_constants/shadow_offset_x = 3
theme_override_constants/shadow_offset_y = 3
theme_override_constants/outline_size = 10
theme_override_constants/shadow_outline_size = 10
theme_override_font_sizes/font_size = 35
text = "幸运抽奖"
horizontal_alignment = 1
vertical_alignment = 1
[node name="Label" type="Label" parent="."]
modulate = Color(0.642982, 0.510828, 1, 1)
layout_mode = 0
offset_top = 419.0
offset_right = 671.0
offset_bottom = 468.0
theme_override_font_sizes/font_size = 30
text = "🎉获得奖励🎉"
horizontal_alignment = 1
vertical_alignment = 1
[node name="QuitButton" type="Button" parent="."]
custom_minimum_size = Vector2(57, 57)
layout_mode = 0
offset_left = 595.0
offset_top = 21.0
offset_right = 652.0
offset_bottom = 78.0
theme_override_font_sizes/font_size = 35
text = "X"
[node name="LuckyDrawReward" type="RichTextLabel" parent="."]
layout_mode = 0
offset_left = 16.0
offset_top = 481.0
offset_right = 671.0
offset_bottom = 633.0
theme_override_font_sizes/normal_font_size = 20
bbcode_enabled = true
text = "+500 经验,+400 钱币,+5 普通-番茄种子,+1 传奇-火龙果种子 "
horizontal_alignment = 1
[node name="Grid" type="GridContainer" parent="."]
layout_mode = 0
offset_left = 16.0
offset_top = 85.0
offset_right = 657.0
offset_bottom = 419.0
columns = 5
[node name="RewardItem" type="RichTextLabel" parent="Grid"]
custom_minimum_size = Vector2(120, 120)
layout_mode = 2
theme_override_constants/outline_size = 15
theme_override_font_sizes/normal_font_size = 17
bbcode_enabled = true
text = "+50钱币
+100经验
+4番茄种子
+3火龙果种子"
horizontal_alignment = 1
vertical_alignment = 1
threaded = true
[node name="HBox" type="HBoxContainer" parent="."]
layout_mode = 0
offset_left = -2.0
offset_top = 633.0
offset_right = 671.0
offset_bottom = 703.0
alignment = 1
[node name="FiveLuckyDrawButton" type="Button" parent="HBox"]
modulate = Color(0.623529, 1, 0.996078, 1)
custom_minimum_size = Vector2(150, 70)
layout_mode = 2
theme_override_font_sizes/font_size = 35
text = "五连抽"
[node name="TenLuckyDrawButton" type="Button" parent="HBox"]
modulate = Color(0.690196, 1, 0.52549, 1)
custom_minimum_size = Vector2(150, 70)
layout_mode = 2
theme_override_font_sizes/font_size = 35
text = "十连抽"
[node name="LuckyDrawButton" type="Button" parent="HBox"]
modulate = Color(1, 1, 0.52549, 1)
custom_minimum_size = Vector2(150, 70)
layout_mode = 2
theme_override_font_sizes/font_size = 35
text = "抽奖"
[node name="ConfirmDialog" type="ConfirmationDialog" parent="."]
title = "标题"
initial_position = 3
size = Vector2i(450, 350)
current_screen = 0
ok_button_text = "🎲 确定抽奖"
dialog_text = "弹窗内容"
dialog_autowrap = true
cancel_button_text = "❌ 取消"
[connection signal="pressed" from="QuitButton" to="." method="_on_quit_button_pressed"]
[connection signal="pressed" from="HBox/FiveLuckyDrawButton" to="." method="_on_five_lucky_draw_button_pressed"]
[connection signal="pressed" from="HBox/TenLuckyDrawButton" to="." method="_on_ten_lucky_draw_button_pressed"]
[connection signal="pressed" from="HBox/LuckyDrawButton" to="." method="_on_lucky_draw_button_pressed"]

View File

@@ -0,0 +1,150 @@
[gd_scene load_steps=7 format=3 uid="uid://bnf1u6re1r1if"]
[ext_resource type="Script" uid="uid://bdhwvqsmakna2" path="res://Script/BigPanel/PetBagPanel.gd" id="1_m60ti"]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_8kysg"]
bg_color = Color(0.9, 0.85, 0.75, 0.95)
border_width_left = 8
border_width_top = 8
border_width_right = 8
border_width_bottom = 8
border_color = Color(0.5, 0.3, 0.1, 1)
corner_radius_top_left = 25
corner_radius_top_right = 25
corner_radius_bottom_right = 25
corner_radius_bottom_left = 25
shadow_color = Color(0.3, 0.2, 0.1, 0.4)
shadow_size = 15
shadow_offset = Vector2(3, 3)
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_uc6q1"]
bg_color = Color(0.95, 0.92, 0.85, 0.9)
border_width_left = 3
border_width_top = 3
border_width_right = 3
border_width_bottom = 3
border_color = Color(0.6, 0.4, 0.2, 0.8)
corner_radius_top_left = 15
corner_radius_top_right = 15
corner_radius_bottom_right = 15
corner_radius_bottom_left = 15
corner_detail = 20
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_button_hover"]
bg_color = Color(0.85, 0.7, 0.5, 1)
border_width_left = 2
border_width_top = 2
border_width_right = 2
border_width_bottom = 2
border_color = Color(0.5, 0.4, 0.2, 1)
corner_radius_top_left = 12
corner_radius_top_right = 12
corner_radius_bottom_right = 12
corner_radius_bottom_left = 12
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_button_pressed"]
bg_color = Color(0.65, 0.5, 0.3, 1)
border_width_left = 2
border_width_top = 2
border_width_right = 2
border_width_bottom = 2
border_color = Color(0.3, 0.2, 0.05, 1)
corner_radius_top_left = 12
corner_radius_top_right = 12
corner_radius_bottom_right = 12
corner_radius_bottom_left = 12
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_button"]
bg_color = Color(0.75, 0.6, 0.4, 1)
border_width_left = 2
border_width_top = 2
border_width_right = 2
border_width_bottom = 2
border_color = Color(0.4, 0.3, 0.1, 1)
corner_radius_top_left = 12
corner_radius_top_right = 12
corner_radius_bottom_right = 12
corner_radius_bottom_left = 12
[node name="PetBagPanel" type="Panel"]
offset_left = 58.0
offset_top = 77.0
offset_right = 1624.0
offset_bottom = 797.0
scale = Vector2(0.8, 0.8)
size_flags_horizontal = 3
size_flags_vertical = 3
theme_override_styles/panel = SubResource("StyleBoxFlat_8kysg")
script = ExtResource("1_m60ti")
[node name="TMBackGround" type="ColorRect" parent="."]
layout_mode = 0
offset_left = -72.0
offset_top = -95.0
offset_right = 1678.0
offset_bottom = 804.0
color = Color(0.9, 0.8, 0.6, 0.3)
[node name="ScrollContainer" type="ScrollContainer" parent="."]
layout_mode = 2
offset_left = 40.0
offset_top = 100.0
offset_right = 3753.0
offset_bottom = 1532.0
scale = Vector2(0.4, 0.4)
size_flags_vertical = 3
theme_override_styles/panel = SubResource("StyleBoxFlat_uc6q1")
horizontal_scroll_mode = 0
vertical_scroll_mode = 2
scroll_deadzone = -10
[node name="Bag_Grid" type="GridContainer" parent="ScrollContainer"]
layout_mode = 2
size_flags_horizontal = 6
size_flags_vertical = 3
columns = 8
[node name="Title" type="Label" parent="."]
layout_mode = 2
offset_top = 13.0
offset_right = 1566.0
offset_bottom = 98.0
size_flags_horizontal = 3
theme_override_colors/font_color = Color(0.4, 0.2, 0.1, 1)
theme_override_colors/font_shadow_color = Color(1, 0.9, 0.7, 0.8)
theme_override_colors/font_outline_color = Color(0.7, 0.5, 0.3, 1)
theme_override_constants/shadow_offset_x = 2
theme_override_constants/shadow_offset_y = 2
theme_override_constants/outline_size = 3
theme_override_constants/shadow_outline_size = 8
theme_override_font_sizes/font_size = 45
text = "🐾 宠物背包 🐾"
horizontal_alignment = 1
[node name="QuitButton" type="Button" parent="."]
custom_minimum_size = Vector2(60, 60)
layout_mode = 2
offset_left = 1482.5
offset_top = 27.5
offset_right = 1542.5
offset_bottom = 90.5
theme_override_colors/font_color = Color(0.8, 0.2, 0.2, 1)
theme_override_font_sizes/font_size = 35
theme_override_styles/hover = SubResource("StyleBoxFlat_button_hover")
theme_override_styles/pressed = SubResource("StyleBoxFlat_button_pressed")
theme_override_styles/normal = SubResource("StyleBoxFlat_button")
text = "❌"
[node name="RefreshButton" type="Button" parent="."]
custom_minimum_size = Vector2(88, 60)
layout_mode = 2
offset_left = 13.0
offset_top = 13.0
offset_right = 117.0
offset_bottom = 76.0
theme_override_colors/font_color = Color(0.3, 0.2, 0.1, 1)
theme_override_font_sizes/font_size = 28
theme_override_styles/hover = SubResource("StyleBoxFlat_button_hover")
theme_override_styles/pressed = SubResource("StyleBoxFlat_button_pressed")
theme_override_styles/normal = SubResource("StyleBoxFlat_button")
text = "🔄刷新"

View File

@@ -0,0 +1,150 @@
[gd_scene load_steps=7 format=3 uid="uid://cnjidcwuv4nn4"]
[ext_resource type="Script" uid="uid://dc1pmi1ubd2cf" path="res://Script/BigPanel/PetStorePanel.gd" id="1_pfdc7"]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_8kysg"]
bg_color = Color(0.9, 0.85, 0.75, 0.95)
border_width_left = 8
border_width_top = 8
border_width_right = 8
border_width_bottom = 8
border_color = Color(0.5, 0.3, 0.1, 1)
corner_radius_top_left = 25
corner_radius_top_right = 25
corner_radius_bottom_right = 25
corner_radius_bottom_left = 25
shadow_color = Color(0.3, 0.2, 0.1, 0.4)
shadow_size = 15
shadow_offset = Vector2(3, 3)
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_uc6q1"]
bg_color = Color(0.95, 0.92, 0.85, 0.9)
border_width_left = 3
border_width_top = 3
border_width_right = 3
border_width_bottom = 3
border_color = Color(0.6, 0.4, 0.2, 0.8)
corner_radius_top_left = 15
corner_radius_top_right = 15
corner_radius_bottom_right = 15
corner_radius_bottom_left = 15
corner_detail = 20
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_button_hover"]
bg_color = Color(0.85, 0.7, 0.5, 1)
border_width_left = 2
border_width_top = 2
border_width_right = 2
border_width_bottom = 2
border_color = Color(0.5, 0.4, 0.2, 1)
corner_radius_top_left = 12
corner_radius_top_right = 12
corner_radius_bottom_right = 12
corner_radius_bottom_left = 12
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_button_pressed"]
bg_color = Color(0.65, 0.5, 0.3, 1)
border_width_left = 2
border_width_top = 2
border_width_right = 2
border_width_bottom = 2
border_color = Color(0.3, 0.2, 0.05, 1)
corner_radius_top_left = 12
corner_radius_top_right = 12
corner_radius_bottom_right = 12
corner_radius_bottom_left = 12
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_button"]
bg_color = Color(0.75, 0.6, 0.4, 1)
border_width_left = 2
border_width_top = 2
border_width_right = 2
border_width_bottom = 2
border_color = Color(0.4, 0.3, 0.1, 1)
corner_radius_top_left = 12
corner_radius_top_right = 12
corner_radius_bottom_right = 12
corner_radius_bottom_left = 12
[node name="PetStorePanel" type="Panel"]
offset_left = 58.0
offset_top = 77.0
offset_right = 1624.0
offset_bottom = 797.0
scale = Vector2(0.8, 0.8)
size_flags_horizontal = 3
size_flags_vertical = 3
theme_override_styles/panel = SubResource("StyleBoxFlat_8kysg")
script = ExtResource("1_pfdc7")
[node name="TMBackGround" type="ColorRect" parent="."]
layout_mode = 0
offset_left = -72.0
offset_top = -95.0
offset_right = 1678.0
offset_bottom = 804.0
color = Color(0.9, 0.8, 0.6, 0.3)
[node name="ScrollContainer" type="ScrollContainer" parent="."]
layout_mode = 2
offset_left = 59.0
offset_top = 110.0
offset_right = 3709.0
offset_bottom = 1511.0
scale = Vector2(0.4, 0.4)
size_flags_vertical = 3
theme_override_styles/panel = SubResource("StyleBoxFlat_uc6q1")
horizontal_scroll_mode = 0
vertical_scroll_mode = 2
scroll_deadzone = -10
[node name="Store_Grid" type="GridContainer" parent="ScrollContainer"]
layout_mode = 2
size_flags_horizontal = 6
size_flags_vertical = 3
columns = 8
[node name="Title" type="Label" parent="."]
layout_mode = 2
offset_top = 13.0
offset_right = 1566.0
offset_bottom = 98.0
size_flags_horizontal = 3
theme_override_colors/font_color = Color(0.4, 0.2, 0.1, 1)
theme_override_colors/font_shadow_color = Color(1, 0.9, 0.7, 0.8)
theme_override_colors/font_outline_color = Color(0.7, 0.5, 0.3, 1)
theme_override_constants/shadow_offset_x = 2
theme_override_constants/shadow_offset_y = 2
theme_override_constants/outline_size = 3
theme_override_constants/shadow_outline_size = 8
theme_override_font_sizes/font_size = 45
text = "🏪 宠物商店 🏪"
horizontal_alignment = 1
[node name="QuitButton" type="Button" parent="."]
custom_minimum_size = Vector2(60, 60)
layout_mode = 2
offset_left = 1482.5
offset_top = 27.5
offset_right = 1542.5
offset_bottom = 90.5
theme_override_colors/font_color = Color(0.8, 0.2, 0.2, 1)
theme_override_font_sizes/font_size = 35
theme_override_styles/hover = SubResource("StyleBoxFlat_button_hover")
theme_override_styles/pressed = SubResource("StyleBoxFlat_button_pressed")
theme_override_styles/normal = SubResource("StyleBoxFlat_button")
text = "❌"
[node name="RefreshButton" type="Button" parent="."]
custom_minimum_size = Vector2(88, 60)
layout_mode = 2
offset_left = 13.0
offset_top = 13.0
offset_right = 117.0
offset_bottom = 76.0
theme_override_colors/font_color = Color(0.3, 0.2, 0.1, 1)
theme_override_font_sizes/font_size = 28
theme_override_styles/hover = SubResource("StyleBoxFlat_button_hover")
theme_override_styles/pressed = SubResource("StyleBoxFlat_button_pressed")
theme_override_styles/normal = SubResource("StyleBoxFlat_button")
text = "🔄刷新"

View File

@@ -0,0 +1,450 @@
[gd_scene load_steps=9 format=3 uid="uid://jjlgdnoo8e52"]
[ext_resource type="Script" uid="uid://dvaah0n1ia1a3" path="res://Script/BigPanel/PlayGamePanel.gd" id="1_i6cj7"]
[ext_resource type="Texture2D" uid="uid://ywdg7xgq7hm8" path="res://assets/装饰物图片/道具背包.webp" id="2_wlugc"]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_7i23t"]
bg_color = Color(0.752836, 0.587098, 0.400951, 0.9)
border_width_left = 8
border_width_top = 8
border_width_right = 8
border_width_bottom = 8
border_color = Color(0.364706, 0.254902, 0.156863, 1)
corner_radius_top_left = 25
corner_radius_top_right = 25
corner_radius_bottom_right = 25
corner_radius_bottom_left = 25
corner_detail = 20
shadow_color = Color(0.2, 0.15, 0.1, 0.5)
shadow_size = 25
shadow_offset = Vector2(5, 5)
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_ScrollContainer"]
bg_color = Color(0.945056, 0.846293, 0.608526, 1)
corner_radius_top_left = 10
corner_radius_top_right = 10
corner_radius_bottom_right = 10
corner_radius_bottom_left = 10
corner_detail = 20
shadow_color = Color(0.0823529, 0.0823529, 0.0823529, 1)
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_Button_Hover"]
bg_color = Color(0.8, 0.65098, 0.470588, 1)
border_width_left = 3
border_width_top = 3
border_width_right = 3
border_width_bottom = 3
border_color = Color(0.45098, 0.364706, 0.254902, 1)
corner_radius_top_left = 15
corner_radius_top_right = 15
corner_radius_bottom_right = 15
corner_radius_bottom_left = 15
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_Button_Pressed"]
bg_color = Color(0.564706, 0.45098, 0.317647, 1)
border_width_left = 3
border_width_top = 3
border_width_right = 3
border_width_bottom = 3
border_color = Color(0.364706, 0.294118, 0.203922, 1)
corner_radius_top_left = 15
corner_radius_top_right = 15
corner_radius_bottom_right = 15
corner_radius_bottom_left = 15
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_Button_Normal"]
bg_color = Color(0.678431, 0.54902, 0.392157, 1)
border_width_left = 3
border_width_top = 3
border_width_right = 3
border_width_bottom = 3
border_color = Color(0.45098, 0.364706, 0.254902, 1)
corner_radius_top_left = 15
corner_radius_top_right = 15
corner_radius_bottom_right = 15
corner_radius_bottom_left = 15
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_CloseButton"]
bg_color = Color(0.8, 0.2, 0.2, 0.9)
border_width_left = 2
border_width_top = 2
border_width_right = 2
border_width_bottom = 2
border_color = Color(0.6, 0.15, 0.15, 1)
corner_radius_top_left = 10
corner_radius_top_right = 10
corner_radius_bottom_right = 10
corner_radius_bottom_left = 10
[node name="PlayGamePanel" type="Panel"]
offset_right = 1399.0
offset_bottom = 720.0
theme_override_styles/panel = SubResource("StyleBoxFlat_7i23t")
script = ExtResource("1_i6cj7")
[node name="Title" type="Label" parent="."]
layout_mode = 0
offset_top = 17.0
offset_right = 1401.0
offset_bottom = 86.0
theme_override_colors/font_color = Color(1, 0.901961, 0.498039, 1)
theme_override_colors/font_shadow_color = Color(0, 0, 0, 1)
theme_override_colors/font_outline_color = Color(0.180392, 0.121569, 0.0745098, 1)
theme_override_constants/shadow_offset_x = 3
theme_override_constants/shadow_offset_y = 3
theme_override_constants/outline_size = 15
theme_override_constants/shadow_outline_size = 20
theme_override_font_sizes/font_size = 50
text = "🎮 休闲小游戏 🕹️"
horizontal_alignment = 1
vertical_alignment = 1
[node name="ScrollContainer" type="ScrollContainer" parent="."]
layout_mode = 0
offset_left = 48.0
offset_top = 116.0
offset_right = 1352.0
offset_bottom = 674.0
theme_override_styles/panel = SubResource("StyleBoxFlat_ScrollContainer")
horizontal_scroll_mode = 0
[node name="Grid" type="GridContainer" parent="ScrollContainer"]
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 3
columns = 5
[node name="2048Game" type="VBoxContainer" parent="ScrollContainer/Grid"]
layout_mode = 2
alignment = 1
[node name="GameTitle" type="Label" parent="ScrollContainer/Grid/2048Game"]
layout_mode = 2
theme_override_colors/font_color = Color(1, 0.8, 0.6, 1)
theme_override_colors/font_shadow_color = Color(0, 0, 0, 1)
theme_override_colors/font_outline_color = Color(0.180392, 0.121569, 0.0745098, 1)
theme_override_constants/shadow_offset_x = 3
theme_override_constants/shadow_offset_y = 3
theme_override_constants/outline_size = 15
theme_override_constants/shadow_outline_size = 15
theme_override_font_sizes/font_size = 35
text = "🧮 2048 🔢"
horizontal_alignment = 1
vertical_alignment = 1
[node name="TextureRect" type="TextureRect" parent="ScrollContainer/Grid/2048Game"]
layout_mode = 2
texture = ExtResource("2_wlugc")
[node name="2048GameButton" type="Button" parent="ScrollContainer/Grid/2048Game"]
layout_mode = 2
theme_override_colors/font_color = Color(1, 1, 1, 1)
theme_override_font_sizes/font_size = 30
theme_override_styles/hover = SubResource("StyleBoxFlat_Button_Hover")
theme_override_styles/pressed = SubResource("StyleBoxFlat_Button_Pressed")
theme_override_styles/normal = SubResource("StyleBoxFlat_Button_Normal")
text = "🎯 开始挑战"
[node name="PushBox" type="VBoxContainer" parent="ScrollContainer/Grid"]
layout_mode = 2
alignment = 1
[node name="GameTitle" type="Label" parent="ScrollContainer/Grid/PushBox"]
layout_mode = 2
theme_override_colors/font_color = Color(1, 0.8, 0.6, 1)
theme_override_colors/font_shadow_color = Color(0, 0, 0, 1)
theme_override_colors/font_outline_color = Color(0.180392, 0.121569, 0.0745098, 1)
theme_override_constants/shadow_offset_x = 3
theme_override_constants/shadow_offset_y = 3
theme_override_constants/outline_size = 15
theme_override_constants/shadow_outline_size = 15
theme_override_font_sizes/font_size = 35
text = "📦 推箱子 🚚"
horizontal_alignment = 1
vertical_alignment = 1
[node name="TextureRect" type="TextureRect" parent="ScrollContainer/Grid/PushBox"]
layout_mode = 2
texture = ExtResource("2_wlugc")
[node name="PushBoxButton" type="Button" parent="ScrollContainer/Grid/PushBox"]
layout_mode = 2
theme_override_colors/font_color = Color(1, 1, 1, 1)
theme_override_font_sizes/font_size = 30
theme_override_styles/hover = SubResource("StyleBoxFlat_Button_Hover")
theme_override_styles/pressed = SubResource("StyleBoxFlat_Button_Pressed")
theme_override_styles/normal = SubResource("StyleBoxFlat_Button_Normal")
text = "💪 智力考验"
[node name="SnakeGame" type="VBoxContainer" parent="ScrollContainer/Grid"]
layout_mode = 2
alignment = 1
[node name="GameTitle" type="Label" parent="ScrollContainer/Grid/SnakeGame"]
layout_mode = 2
theme_override_colors/font_color = Color(1, 0.8, 0.6, 1)
theme_override_colors/font_shadow_color = Color(0, 0, 0, 1)
theme_override_colors/font_outline_color = Color(0.180392, 0.121569, 0.0745098, 1)
theme_override_constants/shadow_offset_x = 3
theme_override_constants/shadow_offset_y = 3
theme_override_constants/outline_size = 15
theme_override_constants/shadow_outline_size = 15
theme_override_font_sizes/font_size = 35
text = "🐍 贪吃蛇 🍎"
horizontal_alignment = 1
vertical_alignment = 1
[node name="TextureRect" type="TextureRect" parent="ScrollContainer/Grid/SnakeGame"]
layout_mode = 2
texture = ExtResource("2_wlugc")
[node name="SnakeGameButton" type="Button" parent="ScrollContainer/Grid/SnakeGame"]
layout_mode = 2
theme_override_colors/font_color = Color(1, 1, 1, 1)
theme_override_font_sizes/font_size = 30
theme_override_styles/hover = SubResource("StyleBoxFlat_Button_Hover")
theme_override_styles/pressed = SubResource("StyleBoxFlat_Button_Pressed")
theme_override_styles/normal = SubResource("StyleBoxFlat_Button_Normal")
text = "🏃 反应游戏"
[node name="Tetris" type="VBoxContainer" parent="ScrollContainer/Grid"]
layout_mode = 2
alignment = 1
[node name="GameTitle" type="Label" parent="ScrollContainer/Grid/Tetris"]
layout_mode = 2
theme_override_colors/font_color = Color(1, 0.8, 0.6, 1)
theme_override_colors/font_shadow_color = Color(0, 0, 0, 1)
theme_override_colors/font_outline_color = Color(0.180392, 0.121569, 0.0745098, 1)
theme_override_constants/shadow_offset_x = 3
theme_override_constants/shadow_offset_y = 3
theme_override_constants/outline_size = 15
theme_override_constants/shadow_outline_size = 15
theme_override_font_sizes/font_size = 35
text = "🧩 俄罗斯方块 🟦"
horizontal_alignment = 1
vertical_alignment = 1
[node name="TextureRect" type="TextureRect" parent="ScrollContainer/Grid/Tetris"]
layout_mode = 2
texture = ExtResource("2_wlugc")
[node name="TetrisButton" type="Button" parent="ScrollContainer/Grid/Tetris"]
layout_mode = 2
theme_override_colors/font_color = Color(1, 1, 1, 1)
theme_override_font_sizes/font_size = 30
theme_override_styles/hover = SubResource("StyleBoxFlat_Button_Hover")
theme_override_styles/pressed = SubResource("StyleBoxFlat_Button_Pressed")
theme_override_styles/normal = SubResource("StyleBoxFlat_Button_Normal")
text = "🎮 经典游戏"
[node name="VBox5" type="VBoxContainer" parent="ScrollContainer/Grid"]
visible = false
layout_mode = 2
alignment = 1
[node name="GameTitle" type="Label" parent="ScrollContainer/Grid/VBox5"]
layout_mode = 2
theme_override_colors/font_color = Color(1, 0.8, 0.6, 1)
theme_override_colors/font_shadow_color = Color(0, 0, 0, 1)
theme_override_colors/font_outline_color = Color(0.180392, 0.121569, 0.0745098, 1)
theme_override_constants/shadow_offset_x = 3
theme_override_constants/shadow_offset_y = 3
theme_override_constants/outline_size = 15
theme_override_constants/shadow_outline_size = 15
theme_override_font_sizes/font_size = 35
text = "🔮 神秘游戏 ✨"
horizontal_alignment = 1
vertical_alignment = 1
[node name="TextureRect" type="TextureRect" parent="ScrollContainer/Grid/VBox5"]
layout_mode = 2
texture = ExtResource("2_wlugc")
[node name="Button" type="Button" parent="ScrollContainer/Grid/VBox5"]
layout_mode = 2
theme_override_colors/font_color = Color(1, 1, 1, 1)
theme_override_font_sizes/font_size = 30
theme_override_styles/hover = SubResource("StyleBoxFlat_Button_Hover")
theme_override_styles/pressed = SubResource("StyleBoxFlat_Button_Pressed")
theme_override_styles/normal = SubResource("StyleBoxFlat_Button_Normal")
text = "🚧 敬请期待"
[node name="VBox6" type="VBoxContainer" parent="ScrollContainer/Grid"]
visible = false
layout_mode = 2
alignment = 1
[node name="GameTitle" type="Label" parent="ScrollContainer/Grid/VBox6"]
layout_mode = 2
theme_override_colors/font_color = Color(1, 0.8, 0.6, 1)
theme_override_colors/font_shadow_color = Color(0, 0, 0, 1)
theme_override_colors/font_outline_color = Color(0.180392, 0.121569, 0.0745098, 1)
theme_override_constants/shadow_offset_x = 3
theme_override_constants/shadow_offset_y = 3
theme_override_constants/outline_size = 15
theme_override_constants/shadow_outline_size = 15
theme_override_font_sizes/font_size = 35
text = "🎲 桌游世界 🃏"
horizontal_alignment = 1
vertical_alignment = 1
[node name="TextureRect" type="TextureRect" parent="ScrollContainer/Grid/VBox6"]
layout_mode = 2
texture = ExtResource("2_wlugc")
[node name="Button" type="Button" parent="ScrollContainer/Grid/VBox6"]
layout_mode = 2
theme_override_colors/font_color = Color(1, 1, 1, 1)
theme_override_font_sizes/font_size = 30
theme_override_styles/hover = SubResource("StyleBoxFlat_Button_Hover")
theme_override_styles/pressed = SubResource("StyleBoxFlat_Button_Pressed")
theme_override_styles/normal = SubResource("StyleBoxFlat_Button_Normal")
text = "🚧 敬请期待"
[node name="VBox7" type="VBoxContainer" parent="ScrollContainer/Grid"]
visible = false
layout_mode = 2
alignment = 1
[node name="GameTitle" type="Label" parent="ScrollContainer/Grid/VBox7"]
layout_mode = 2
theme_override_colors/font_color = Color(1, 0.8, 0.6, 1)
theme_override_colors/font_shadow_color = Color(0, 0, 0, 1)
theme_override_colors/font_outline_color = Color(0.180392, 0.121569, 0.0745098, 1)
theme_override_constants/shadow_offset_x = 3
theme_override_constants/shadow_offset_y = 3
theme_override_constants/outline_size = 15
theme_override_constants/shadow_outline_size = 15
theme_override_font_sizes/font_size = 35
text = "🎯 射击游戏 🏹"
horizontal_alignment = 1
vertical_alignment = 1
[node name="TextureRect" type="TextureRect" parent="ScrollContainer/Grid/VBox7"]
layout_mode = 2
texture = ExtResource("2_wlugc")
[node name="Button" type="Button" parent="ScrollContainer/Grid/VBox7"]
layout_mode = 2
theme_override_colors/font_color = Color(1, 1, 1, 1)
theme_override_font_sizes/font_size = 30
theme_override_styles/hover = SubResource("StyleBoxFlat_Button_Hover")
theme_override_styles/pressed = SubResource("StyleBoxFlat_Button_Pressed")
theme_override_styles/normal = SubResource("StyleBoxFlat_Button_Normal")
text = "🚧 敬请期待"
[node name="VBox8" type="VBoxContainer" parent="ScrollContainer/Grid"]
visible = false
layout_mode = 2
alignment = 1
[node name="GameTitle" type="Label" parent="ScrollContainer/Grid/VBox8"]
layout_mode = 2
theme_override_colors/font_color = Color(1, 0.8, 0.6, 1)
theme_override_colors/font_shadow_color = Color(0, 0, 0, 1)
theme_override_colors/font_outline_color = Color(0.180392, 0.121569, 0.0745098, 1)
theme_override_constants/shadow_offset_x = 3
theme_override_constants/shadow_offset_y = 3
theme_override_constants/outline_size = 15
theme_override_constants/shadow_outline_size = 15
theme_override_font_sizes/font_size = 35
text = "🧠 益智游戏 💡"
horizontal_alignment = 1
vertical_alignment = 1
[node name="TextureRect" type="TextureRect" parent="ScrollContainer/Grid/VBox8"]
layout_mode = 2
texture = ExtResource("2_wlugc")
[node name="Button" type="Button" parent="ScrollContainer/Grid/VBox8"]
layout_mode = 2
theme_override_colors/font_color = Color(1, 1, 1, 1)
theme_override_font_sizes/font_size = 30
theme_override_styles/hover = SubResource("StyleBoxFlat_Button_Hover")
theme_override_styles/pressed = SubResource("StyleBoxFlat_Button_Pressed")
theme_override_styles/normal = SubResource("StyleBoxFlat_Button_Normal")
text = "🚧 敬请期待"
[node name="VBox9" type="VBoxContainer" parent="ScrollContainer/Grid"]
visible = false
layout_mode = 2
alignment = 1
[node name="GameTitle" type="Label" parent="ScrollContainer/Grid/VBox9"]
layout_mode = 2
theme_override_colors/font_color = Color(1, 0.8, 0.6, 1)
theme_override_colors/font_shadow_color = Color(0, 0, 0, 1)
theme_override_colors/font_outline_color = Color(0.180392, 0.121569, 0.0745098, 1)
theme_override_constants/shadow_offset_x = 3
theme_override_constants/shadow_offset_y = 3
theme_override_constants/outline_size = 15
theme_override_constants/shadow_outline_size = 15
theme_override_font_sizes/font_size = 35
text = "🏆 竞技游戏 ⚔️"
horizontal_alignment = 1
vertical_alignment = 1
[node name="TextureRect" type="TextureRect" parent="ScrollContainer/Grid/VBox9"]
layout_mode = 2
texture = ExtResource("2_wlugc")
[node name="Button" type="Button" parent="ScrollContainer/Grid/VBox9"]
layout_mode = 2
theme_override_colors/font_color = Color(1, 1, 1, 1)
theme_override_font_sizes/font_size = 30
theme_override_styles/hover = SubResource("StyleBoxFlat_Button_Hover")
theme_override_styles/pressed = SubResource("StyleBoxFlat_Button_Pressed")
theme_override_styles/normal = SubResource("StyleBoxFlat_Button_Normal")
text = "🚧 敬请期待"
[node name="VBox10" type="VBoxContainer" parent="ScrollContainer/Grid"]
visible = false
layout_mode = 2
alignment = 1
[node name="GameTitle" type="Label" parent="ScrollContainer/Grid/VBox10"]
layout_mode = 2
theme_override_colors/font_color = Color(1, 0.8, 0.6, 1)
theme_override_colors/font_shadow_color = Color(0, 0, 0, 1)
theme_override_colors/font_outline_color = Color(0.180392, 0.121569, 0.0745098, 1)
theme_override_constants/shadow_offset_x = 3
theme_override_constants/shadow_offset_y = 3
theme_override_constants/outline_size = 15
theme_override_constants/shadow_outline_size = 15
theme_override_font_sizes/font_size = 35
text = "🎨 创意游戏 ✨"
horizontal_alignment = 1
vertical_alignment = 1
[node name="TextureRect" type="TextureRect" parent="ScrollContainer/Grid/VBox10"]
layout_mode = 2
texture = ExtResource("2_wlugc")
[node name="Button" type="Button" parent="ScrollContainer/Grid/VBox10"]
layout_mode = 2
theme_override_colors/font_color = Color(1, 1, 1, 1)
theme_override_font_sizes/font_size = 30
theme_override_styles/hover = SubResource("StyleBoxFlat_Button_Hover")
theme_override_styles/pressed = SubResource("StyleBoxFlat_Button_Pressed")
theme_override_styles/normal = SubResource("StyleBoxFlat_Button_Normal")
text = "🚧 敬请期待"
[node name="QuitButton" type="Button" parent="."]
custom_minimum_size = Vector2(80, 80)
layout_mode = 0
offset_left = 1297.0
offset_top = 20.0
offset_right = 1377.0
offset_bottom = 100.0
theme_override_colors/font_color = Color(1, 1, 1, 1)
theme_override_font_sizes/font_size = 40
theme_override_styles/hover = SubResource("StyleBoxFlat_CloseButton")
theme_override_styles/pressed = SubResource("StyleBoxFlat_CloseButton")
theme_override_styles/normal = SubResource("StyleBoxFlat_CloseButton")
text = "X"
[connection signal="pressed" from="ScrollContainer/Grid/2048Game/2048GameButton" to="." method="_on_game_button_pressed"]
[connection signal="pressed" from="ScrollContainer/Grid/PushBox/PushBoxButton" to="." method="_on_push_box_button_pressed"]
[connection signal="pressed" from="ScrollContainer/Grid/SnakeGame/SnakeGameButton" to="." method="_on_snake_game_button_pressed"]
[connection signal="pressed" from="ScrollContainer/Grid/Tetris/TetrisButton" to="." method="_on_tetris_button_pressed"]

View File

@@ -0,0 +1,261 @@
[gd_scene load_steps=7 format=3 uid="uid://bseuwniienrqy"]
[ext_resource type="Script" uid="uid://cgr332wsx63a8" path="res://Script/BigPanel/PlayerBagPanel.gd" id="1_srags"]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_n03md"]
bg_color = Color(0.9, 0.85, 0.75, 0.95)
border_width_left = 8
border_width_top = 8
border_width_right = 8
border_width_bottom = 8
border_color = Color(0.5, 0.3, 0.1, 1)
corner_radius_top_left = 25
corner_radius_top_right = 25
corner_radius_bottom_right = 25
corner_radius_bottom_left = 25
shadow_color = Color(0.3, 0.2, 0.1, 0.4)
shadow_size = 15
shadow_offset = Vector2(3, 3)
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_button_hover"]
bg_color = Color(0.85, 0.7, 0.5, 1)
border_width_left = 2
border_width_top = 2
border_width_right = 2
border_width_bottom = 2
border_color = Color(0.5, 0.4, 0.2, 1)
corner_radius_top_left = 12
corner_radius_top_right = 12
corner_radius_bottom_right = 12
corner_radius_bottom_left = 12
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_button_pressed"]
bg_color = Color(0.65, 0.5, 0.3, 1)
border_width_left = 2
border_width_top = 2
border_width_right = 2
border_width_bottom = 2
border_color = Color(0.3, 0.2, 0.05, 1)
corner_radius_top_left = 12
corner_radius_top_right = 12
corner_radius_bottom_right = 12
corner_radius_bottom_left = 12
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_button"]
bg_color = Color(0.75, 0.6, 0.4, 1)
border_width_left = 2
border_width_top = 2
border_width_right = 2
border_width_bottom = 2
border_color = Color(0.4, 0.3, 0.1, 1)
corner_radius_top_left = 12
corner_radius_top_right = 12
corner_radius_bottom_right = 12
corner_radius_bottom_left = 12
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_srags"]
bg_color = Color(0.95, 0.92, 0.85, 0.9)
border_width_left = 3
border_width_top = 3
border_width_right = 3
border_width_bottom = 3
border_color = Color(0.6, 0.4, 0.2, 0.8)
corner_radius_top_left = 15
corner_radius_top_right = 15
corner_radius_bottom_right = 15
corner_radius_bottom_left = 15
corner_detail = 20
[node name="PlayerBagPanel" type="Panel"]
offset_left = 63.0
offset_top = 79.0
offset_right = 1620.0
offset_bottom = 799.0
scale = Vector2(0.8, 0.8)
size_flags_horizontal = 3
size_flags_vertical = 3
theme_override_styles/panel = SubResource("StyleBoxFlat_n03md")
script = ExtResource("1_srags")
[node name="TMBackGround" type="ColorRect" parent="."]
layout_mode = 0
offset_left = -81.0
offset_top = -96.0
offset_right = 1677.0
offset_bottom = 802.0
color = Color(0.901961, 0.8, 0.6, 0.262745)
[node name="SortContainer" type="HBoxContainer" parent="."]
layout_mode = 0
offset_left = 13.75
offset_top = 83.75
offset_right = 1570.75
offset_bottom = 146.75
alignment = 1
[node name="FilterLabel" type="Label" parent="SortContainer"]
modulate = Color(0.439216, 0.560784, 1, 1)
layout_mode = 2
theme_override_font_sizes/font_size = 30
text = "🔍 筛选:"
[node name="Sort_All" type="Button" parent="SortContainer"]
layout_mode = 2
theme_override_colors/font_color = Color(0.2, 0.4, 0.6, 1)
theme_override_font_sizes/font_size = 28
theme_override_styles/hover = SubResource("StyleBoxFlat_button_hover")
theme_override_styles/pressed = SubResource("StyleBoxFlat_button_pressed")
theme_override_styles/normal = SubResource("StyleBoxFlat_button")
text = "🌾全部"
[node name="Sort_Common" type="Button" parent="SortContainer"]
layout_mode = 2
theme_override_colors/font_color = Color(1, 1, 1, 1)
theme_override_font_sizes/font_size = 28
theme_override_styles/hover = SubResource("StyleBoxFlat_button_hover")
theme_override_styles/pressed = SubResource("StyleBoxFlat_button_pressed")
theme_override_styles/normal = SubResource("StyleBoxFlat_button")
text = "⚪普通"
[node name="Sort_Superior" type="Button" parent="SortContainer"]
layout_mode = 2
theme_override_colors/font_color = Color(0, 0.823529, 0.415686, 1)
theme_override_font_sizes/font_size = 28
theme_override_styles/hover = SubResource("StyleBoxFlat_button_hover")
theme_override_styles/pressed = SubResource("StyleBoxFlat_button_pressed")
theme_override_styles/normal = SubResource("StyleBoxFlat_button")
text = "🟢优良"
[node name="Sort_Rare" type="Button" parent="SortContainer"]
layout_mode = 2
theme_override_colors/font_color = Color(0, 0.454902, 0.729412, 1)
theme_override_font_sizes/font_size = 28
theme_override_styles/hover = SubResource("StyleBoxFlat_button_hover")
theme_override_styles/pressed = SubResource("StyleBoxFlat_button_pressed")
theme_override_styles/normal = SubResource("StyleBoxFlat_button")
text = "🔵稀有"
[node name="Sort_Epic" type="Button" parent="SortContainer"]
layout_mode = 2
theme_override_colors/font_color = Color(0.552941, 0.396078, 0.772549, 1)
theme_override_font_sizes/font_size = 28
theme_override_styles/hover = SubResource("StyleBoxFlat_button_hover")
theme_override_styles/pressed = SubResource("StyleBoxFlat_button_pressed")
theme_override_styles/normal = SubResource("StyleBoxFlat_button")
text = "🟣史诗"
[node name="Sort_Legendary" type="Button" parent="SortContainer"]
layout_mode = 2
theme_override_colors/font_color = Color(0.988235, 0.835294, 0.247059, 1)
theme_override_font_sizes/font_size = 28
theme_override_styles/hover = SubResource("StyleBoxFlat_button_hover")
theme_override_styles/pressed = SubResource("StyleBoxFlat_button_pressed")
theme_override_styles/normal = SubResource("StyleBoxFlat_button")
text = "🟡传奇"
[node name="SortLabel" type="Label" parent="SortContainer"]
modulate = Color(0.439216, 0.560784, 1, 1)
layout_mode = 2
theme_override_font_sizes/font_size = 30
text = "📊 排序:"
[node name="Sort_Price" type="Button" parent="SortContainer"]
layout_mode = 2
theme_override_colors/font_color = Color(0.2, 0.4, 0.6, 1)
theme_override_font_sizes/font_size = 28
theme_override_styles/hover = SubResource("StyleBoxFlat_button_hover")
theme_override_styles/pressed = SubResource("StyleBoxFlat_button_pressed")
theme_override_styles/normal = SubResource("StyleBoxFlat_button")
text = "💰按价格"
[node name="Sort_GrowTime" type="Button" parent="SortContainer"]
layout_mode = 2
theme_override_colors/font_color = Color(0.2, 0.4, 0.6, 1)
theme_override_font_sizes/font_size = 28
theme_override_styles/hover = SubResource("StyleBoxFlat_button_hover")
theme_override_styles/pressed = SubResource("StyleBoxFlat_button_pressed")
theme_override_styles/normal = SubResource("StyleBoxFlat_button")
text = "⏰按生长时间"
[node name="Sort_Profit" type="Button" parent="SortContainer"]
layout_mode = 2
theme_override_colors/font_color = Color(0.2, 0.4, 0.6, 1)
theme_override_font_sizes/font_size = 28
theme_override_styles/hover = SubResource("StyleBoxFlat_button_hover")
theme_override_styles/pressed = SubResource("StyleBoxFlat_button_pressed")
theme_override_styles/normal = SubResource("StyleBoxFlat_button")
text = "📈按收益"
[node name="Sort_Level" type="Button" parent="SortContainer"]
layout_mode = 2
theme_override_colors/font_color = Color(0.2, 0.4, 0.6, 1)
theme_override_font_sizes/font_size = 28
theme_override_styles/hover = SubResource("StyleBoxFlat_button_hover")
theme_override_styles/pressed = SubResource("StyleBoxFlat_button_pressed")
theme_override_styles/normal = SubResource("StyleBoxFlat_button")
text = "🏆按等级"
[node name="Title" type="Label" parent="."]
layout_mode = 2
offset_top = 14.0
offset_right = 1557.0
offset_bottom = 76.0
size_flags_horizontal = 3
theme_override_colors/font_color = Color(0.4, 0.2, 0.0980392, 1)
theme_override_colors/font_shadow_color = Color(1, 0.901961, 0.701961, 0.8)
theme_override_colors/font_outline_color = Color(0.701961, 0.501961, 0.301961, 1)
theme_override_constants/shadow_offset_x = 2
theme_override_constants/shadow_offset_y = 2
theme_override_constants/outline_size = 3
theme_override_constants/shadow_outline_size = 8
theme_override_font_sizes/font_size = 40
text = "🌱 种子仓库 🌱"
horizontal_alignment = 1
[node name="QuitButton" type="Button" parent="."]
custom_minimum_size = Vector2(60, 60)
layout_mode = 2
offset_left = 1478.75
offset_top = 13.75
offset_right = 1538.75
offset_bottom = 76.75
theme_override_colors/font_color = Color(0.2, 0.4, 0.6, 1)
theme_override_font_sizes/font_size = 40
theme_override_styles/hover = SubResource("StyleBoxFlat_button_hover")
theme_override_styles/pressed = SubResource("StyleBoxFlat_button_pressed")
theme_override_styles/normal = SubResource("StyleBoxFlat_button")
text = "❌"
[node name="RefreshButton" type="Button" parent="."]
custom_minimum_size = Vector2(60, 60)
layout_mode = 2
offset_left = 15.0001
offset_top = 13.75
offset_right = 75.0001
offset_bottom = 76.75
theme_override_colors/font_color = Color(0.2, 0.4, 0.6, 1)
theme_override_font_sizes/font_size = 40
theme_override_styles/hover = SubResource("StyleBoxFlat_button_hover")
theme_override_styles/pressed = SubResource("StyleBoxFlat_button_pressed")
theme_override_styles/normal = SubResource("StyleBoxFlat_button")
text = "🔄刷新"
[node name="ScrollContainer" type="ScrollContainer" parent="."]
offset_left = 19.0
offset_top = 151.0
offset_right = 3810.0
offset_bottom = 1540.0
scale = Vector2(0.4, 0.4)
size_flags_vertical = 3
theme_override_styles/panel = SubResource("StyleBoxFlat_srags")
horizontal_scroll_mode = 0
vertical_scroll_mode = 2
scroll_deadzone = -10
[node name="Bag_Grid" type="GridContainer" parent="ScrollContainer"]
layout_mode = 2
size_flags_horizontal = 6
size_flags_vertical = 3
columns = 8
[connection signal="pressed" from="RefreshButton" to="." method="_on_refresh_button_pressed"]

View File

@@ -0,0 +1,296 @@
[gd_scene load_steps=8 format=3 uid="uid://dbfqu87627yg6"]
[ext_resource type="Script" uid="uid://fk4q3x6uqydd" path="res://Script/BigPanel/PlayerRankingPanel.gd" id="1_efhd6"]
[ext_resource type="PackedScene" uid="uid://crd28qnymob7" path="res://GUI/PlayerRankingItem.tscn" id="1_xwp76"]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_efhd6"]
bg_color = Color(0.12, 0.15, 0.25, 0.95)
border_width_left = 3
border_width_top = 3
border_width_right = 3
border_width_bottom = 3
border_color = Color(0.8, 0.6, 0.2, 1)
corner_radius_top_left = 25
corner_radius_top_right = 25
corner_radius_bottom_right = 25
corner_radius_bottom_left = 25
corner_detail = 20
shadow_color = Color(0.8, 0.6, 0.2, 0.4)
shadow_size = 30
shadow_offset = Vector2(5, 5)
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_ButtonHover"]
bg_color = Color(0.3, 0.35, 0.55, 1)
border_width_left = 2
border_width_top = 2
border_width_right = 2
border_width_bottom = 2
border_color = Color(0.9, 0.7, 0.3, 1)
corner_radius_top_left = 15
corner_radius_top_right = 15
corner_radius_bottom_right = 15
corner_radius_bottom_left = 15
shadow_color = Color(0.9, 0.7, 0.3, 0.5)
shadow_size = 12
shadow_offset = Vector2(4, 4)
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_Button"]
bg_color = Color(0.2, 0.25, 0.4, 0.9)
border_width_left = 2
border_width_top = 2
border_width_right = 2
border_width_bottom = 2
border_color = Color(0.6, 0.45, 0.15, 0.8)
corner_radius_top_left = 15
corner_radius_top_right = 15
corner_radius_bottom_right = 15
corner_radius_bottom_left = 15
shadow_color = Color(0.8, 0.6, 0.2, 0.3)
shadow_size = 8
shadow_offset = Vector2(3, 3)
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_ButtonPressed"]
bg_color = Color(0.15, 0.2, 0.35, 1)
border_width_left = 2
border_width_top = 2
border_width_right = 2
border_width_bottom = 2
border_color = Color(0.7, 0.5, 0.1, 1)
corner_radius_top_left = 15
corner_radius_top_right = 15
corner_radius_bottom_right = 15
corner_radius_bottom_left = 15
shadow_color = Color(0.7, 0.5, 0.1, 0.3)
shadow_size = 6
shadow_offset = Vector2(2, 2)
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_ScrollBar"]
bg_color = Color(0.18, 0.22, 0.35, 0.8)
border_width_left = 1
border_width_top = 1
border_width_right = 1
border_width_bottom = 1
border_color = Color(0.6, 0.45, 0.15, 0.6)
corner_radius_top_left = 12
corner_radius_top_right = 12
corner_radius_bottom_right = 12
corner_radius_bottom_left = 12
[node name="PlayerRankingPanel" type="Panel"]
offset_left = 59.0
offset_top = 37.0
offset_right = 1459.0
offset_bottom = 757.0
scale = Vector2(0.9, 0.9)
theme_override_styles/panel = SubResource("StyleBoxFlat_efhd6")
script = ExtResource("1_efhd6")
[node name="Background" type="ColorRect" parent="."]
layout_mode = 0
offset_left = -171.0
offset_top = -109.0
offset_right = 1582.0
offset_bottom = 792.0
color = Color(0.839723, 0.846103, 0.999009, 0.298039)
[node name="RegisterPlayerNum" type="Label" parent="."]
self_modulate = Color(0.9, 0.7, 0.3, 1)
layout_mode = 0
offset_left = 841.111
offset_top = 32.2222
offset_right = 991.111
offset_bottom = 74.2222
theme_override_colors/font_shadow_color = Color(0.8, 0.6, 0.2, 0.6)
theme_override_colors/font_outline_color = Color(0.1, 0.1, 0.2, 1)
theme_override_constants/shadow_offset_x = 2
theme_override_constants/shadow_offset_y = 2
theme_override_constants/outline_size = 8
theme_override_font_sizes/font_size = 30
text = "注册人数:"
[node name="Title" type="RichTextLabel" parent="."]
layout_mode = 2
offset_left = 7.49999
offset_top = 18.75
offset_right = 1400.5
offset_bottom = 74.75
size_flags_vertical = 3
theme_override_colors/default_color = Color(1, 0.85, 0.4, 1)
theme_override_colors/font_outline_color = Color(0.1, 0.1, 0.2, 1)
theme_override_colors/font_shadow_color = Color(0.8, 0.6, 0.2, 0.8)
theme_override_constants/outline_size = 10
theme_override_constants/shadow_offset_y = 3
theme_override_constants/shadow_offset_x = 3
theme_override_constants/shadow_outline_size = 10
theme_override_font_sizes/normal_font_size = 44
bbcode_enabled = true
text = "玩家排行榜"
horizontal_alignment = 1
[node name="SearchLineEdit" type="LineEdit" parent="."]
layout_mode = 0
offset_left = 95.0
offset_top = 21.25
offset_right = 378.0
offset_bottom = 78.25
theme_override_colors/font_placeholder_color = Color(0.6, 0.5, 0.3, 0.8)
theme_override_colors/font_color = Color(0.9, 0.8, 0.5, 1)
theme_override_font_sizes/font_size = 32
theme_override_styles/focus = SubResource("StyleBoxFlat_ButtonHover")
theme_override_styles/normal = SubResource("StyleBoxFlat_Button")
placeholder_text = "输入要搜索的人"
[node name="RefreshButton" type="Button" parent="."]
custom_minimum_size = Vector2(55, 55)
layout_mode = 0
offset_left = 16.25
offset_top = 21.25
offset_right = 94.25
offset_bottom = 78.25
theme_override_colors/font_color = Color(0.95, 0.8, 0.4, 1)
theme_override_font_sizes/font_size = 32
theme_override_styles/hover = SubResource("StyleBoxFlat_ButtonHover")
theme_override_styles/pressed = SubResource("StyleBoxFlat_ButtonPressed")
theme_override_styles/normal = SubResource("StyleBoxFlat_Button")
text = "刷新"
[node name="SearchButton" type="Button" parent="."]
custom_minimum_size = Vector2(55, 55)
layout_mode = 0
offset_left = 377.5
offset_top = 21.25
offset_right = 455.5
offset_bottom = 78.25
theme_override_colors/font_color = Color(0.95, 0.8, 0.4, 1)
theme_override_font_sizes/font_size = 32
theme_override_styles/hover = SubResource("StyleBoxFlat_ButtonHover")
theme_override_styles/pressed = SubResource("StyleBoxFlat_ButtonPressed")
theme_override_styles/normal = SubResource("StyleBoxFlat_Button")
text = "搜索"
[node name="QuitButton" type="Button" parent="."]
custom_minimum_size = Vector2(55, 55)
layout_mode = 0
offset_left = 1326.25
offset_top = 16.25
offset_right = 1383.25
offset_bottom = 73.25
theme_override_colors/font_color = Color(1, 0, 0.301961, 1)
theme_override_font_sizes/font_size = 35
theme_override_styles/hover = SubResource("StyleBoxFlat_ButtonHover")
theme_override_styles/pressed = SubResource("StyleBoxFlat_ButtonPressed")
theme_override_styles/normal = SubResource("StyleBoxFlat_Button")
text = "X"
[node name="FiterAndSortHBox" type="HBoxContainer" parent="."]
layout_mode = 0
offset_left = 7.50001
offset_top = 105.0
offset_right = 1388.5
offset_bottom = 162.0
[node name="SortLabel" type="Label" parent="FiterAndSortHBox"]
layout_mode = 2
size_flags_vertical = 1
theme_override_colors/font_color = Color(1, 0.85, 0.4, 1)
theme_override_colors/font_shadow_color = Color(0.1, 0.1, 0.2, 0.8)
theme_override_constants/shadow_offset_x = 2
theme_override_constants/shadow_offset_y = 2
theme_override_font_sizes/font_size = 30
text = "排序:"
horizontal_alignment = 1
vertical_alignment = 1
[node name="MoneySortBtn" type="Button" parent="FiterAndSortHBox"]
self_modulate = Color(1, 0.9, 0.3, 1)
custom_minimum_size = Vector2(158, 57)
layout_mode = 2
theme_override_colors/font_color = Color(1, 0.823529, 0.0627451, 1)
theme_override_font_sizes/font_size = 28
theme_override_styles/hover = SubResource("StyleBoxFlat_ButtonHover")
theme_override_styles/pressed = SubResource("StyleBoxFlat_ButtonPressed")
theme_override_styles/normal = SubResource("StyleBoxFlat_Button")
text = "钱币"
[node name="SeedSortBtn" type="Button" parent="FiterAndSortHBox"]
self_modulate = Color(0.4, 0.8, 0.5, 1)
custom_minimum_size = Vector2(158, 57)
layout_mode = 2
theme_override_colors/font_color = Color(0.9, 0.8, 0.4, 1)
theme_override_font_sizes/font_size = 28
theme_override_styles/hover = SubResource("StyleBoxFlat_ButtonHover")
theme_override_styles/pressed = SubResource("StyleBoxFlat_ButtonPressed")
theme_override_styles/normal = SubResource("StyleBoxFlat_Button")
text = "种子数"
[node name="LevelSortBtn" type="Button" parent="FiterAndSortHBox"]
self_modulate = Color(0.3, 0.7, 0.9, 1)
custom_minimum_size = Vector2(158, 57)
layout_mode = 2
theme_override_colors/font_color = Color(0.211765, 0.713726, 1, 1)
theme_override_font_sizes/font_size = 28
theme_override_styles/hover = SubResource("StyleBoxFlat_ButtonHover")
theme_override_styles/pressed = SubResource("StyleBoxFlat_ButtonPressed")
theme_override_styles/normal = SubResource("StyleBoxFlat_Button")
text = "等级"
[node name="OnlineTimeSortBtn" type="Button" parent="FiterAndSortHBox"]
self_modulate = Color(0.8, 0.5, 0.3, 1)
custom_minimum_size = Vector2(158, 57)
layout_mode = 2
theme_override_colors/font_color = Color(0.9, 0.8, 0.4, 1)
theme_override_font_sizes/font_size = 26
theme_override_styles/hover = SubResource("StyleBoxFlat_ButtonHover")
theme_override_styles/pressed = SubResource("StyleBoxFlat_ButtonPressed")
theme_override_styles/normal = SubResource("StyleBoxFlat_Button")
text = "在线时长"
[node name="LoginTimeSortBtn" type="Button" parent="FiterAndSortHBox"]
self_modulate = Color(0.5, 0.8, 0.4, 1)
custom_minimum_size = Vector2(158, 57)
layout_mode = 2
theme_override_colors/font_color = Color(0.340704, 0.882235, 1, 1)
theme_override_font_sizes/font_size = 26
theme_override_styles/hover = SubResource("StyleBoxFlat_ButtonHover")
theme_override_styles/pressed = SubResource("StyleBoxFlat_ButtonPressed")
theme_override_styles/normal = SubResource("StyleBoxFlat_Button")
text = "登录时间"
[node name="LikeNumSortBtn" type="Button" parent="FiterAndSortHBox"]
self_modulate = Color(0.9, 0.4, 0.7, 1)
custom_minimum_size = Vector2(158, 57)
layout_mode = 2
theme_override_colors/font_color = Color(0.9, 0.8, 0.4, 1)
theme_override_font_sizes/font_size = 28
theme_override_styles/hover = SubResource("StyleBoxFlat_ButtonHover")
theme_override_styles/pressed = SubResource("StyleBoxFlat_ButtonPressed")
theme_override_styles/normal = SubResource("StyleBoxFlat_Button")
text = "点赞数"
[node name="IsOnlineSortBtn" type="Button" parent="FiterAndSortHBox"]
self_modulate = Color(0.6, 0.6, 0.6, 1)
custom_minimum_size = Vector2(158, 57)
layout_mode = 2
theme_override_colors/font_color = Color(0.961312, 0.707781, 0.906286, 1)
theme_override_font_sizes/font_size = 26
theme_override_styles/hover = SubResource("StyleBoxFlat_ButtonHover")
theme_override_styles/pressed = SubResource("StyleBoxFlat_ButtonPressed")
theme_override_styles/normal = SubResource("StyleBoxFlat_Button")
text = "在线情况"
[node name="Scroll" type="ScrollContainer" parent="."]
layout_mode = 2
offset_left = 14.0
offset_top = 171.0
offset_right = 1389.0
offset_bottom = 707.0
size_flags_vertical = 3
theme_override_styles/panel = SubResource("StyleBoxFlat_ScrollBar")
[node name="PlayerList" type="VBoxContainer" parent="Scroll"]
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 3
[node name="PlayerRankingItem" parent="Scroll/PlayerList" instance=ExtResource("1_xwp76")]
layout_mode = 2

View File

@@ -0,0 +1,323 @@
[gd_scene load_steps=9 format=3 uid="uid://byxhjyyaahs6q"]
[ext_resource type="Texture2D" uid="uid://ywdg7xgq7hm8" path="res://assets/装饰物图片/道具背包.webp" id="1_mv0g4"]
[ext_resource type="Script" uid="uid://btm2je8pg7rgk" path="res://Script/BigPanel/SpecialFarmPanel.gd" id="1_n2mxy"]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_7i23t"]
bg_color = Color(0.752836, 0.587098, 0.400951, 0.9)
border_width_left = 8
border_width_top = 8
border_width_right = 8
border_width_bottom = 8
border_color = Color(0.364706, 0.254902, 0.156863, 1)
corner_radius_top_left = 25
corner_radius_top_right = 25
corner_radius_bottom_right = 25
corner_radius_bottom_left = 25
corner_detail = 20
shadow_color = Color(0.2, 0.15, 0.1, 0.5)
shadow_size = 25
shadow_offset = Vector2(5, 5)
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_CloseButton"]
bg_color = Color(0.8, 0.2, 0.2, 0.9)
border_width_left = 2
border_width_top = 2
border_width_right = 2
border_width_bottom = 2
border_color = Color(0.6, 0.15, 0.15, 1)
corner_radius_top_left = 10
corner_radius_top_right = 10
corner_radius_bottom_right = 10
corner_radius_bottom_left = 10
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_n2mxy"]
bg_color = Color(0.945056, 0.846293, 0.608526, 1)
corner_radius_top_left = 10
corner_radius_top_right = 10
corner_radius_bottom_right = 10
corner_radius_bottom_left = 10
corner_detail = 20
shadow_color = Color(0.0823529, 0.0823529, 0.0823529, 1)
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_Button_Hover"]
bg_color = Color(0.8, 0.65098, 0.470588, 1)
border_width_left = 3
border_width_top = 3
border_width_right = 3
border_width_bottom = 3
border_color = Color(0.45098, 0.364706, 0.254902, 1)
corner_radius_top_left = 15
corner_radius_top_right = 15
corner_radius_bottom_right = 15
corner_radius_bottom_left = 15
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_Button_Pressed"]
bg_color = Color(0.564706, 0.45098, 0.317647, 1)
border_width_left = 3
border_width_top = 3
border_width_right = 3
border_width_bottom = 3
border_color = Color(0.364706, 0.294118, 0.203922, 1)
corner_radius_top_left = 15
corner_radius_top_right = 15
corner_radius_bottom_right = 15
corner_radius_bottom_left = 15
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_Button_Normal"]
bg_color = Color(0.678431, 0.54902, 0.392157, 1)
border_width_left = 3
border_width_top = 3
border_width_right = 3
border_width_bottom = 3
border_color = Color(0.45098, 0.364706, 0.254902, 1)
corner_radius_top_left = 15
corner_radius_top_right = 15
corner_radius_bottom_right = 15
corner_radius_bottom_left = 15
[node name="SpecialFarmPanel" type="Panel"]
offset_right = 1399.0
offset_bottom = 720.0
theme_override_styles/panel = SubResource("StyleBoxFlat_7i23t")
script = ExtResource("1_n2mxy")
[node name="Title" type="Label" parent="."]
layout_mode = 0
offset_top = 17.0
offset_right = 1401.0
offset_bottom = 86.0
theme_override_colors/font_color = Color(1, 0.901961, 0.498039, 1)
theme_override_colors/font_shadow_color = Color(0, 0, 0, 1)
theme_override_colors/font_outline_color = Color(0.180392, 0.121569, 0.0745098, 1)
theme_override_constants/shadow_offset_x = 3
theme_override_constants/shadow_offset_y = 3
theme_override_constants/outline_size = 15
theme_override_constants/shadow_outline_size = 20
theme_override_font_sizes/font_size = 50
text = "🌾 神秘农场探索 🏞️"
horizontal_alignment = 1
vertical_alignment = 1
[node name="QuitButton" type="Button" parent="."]
custom_minimum_size = Vector2(80, 80)
layout_mode = 0
offset_left = 1297.0
offset_top = 20.0
offset_right = 1377.0
offset_bottom = 100.0
theme_override_colors/font_color = Color(1, 1, 1, 1)
theme_override_font_sizes/font_size = 50
theme_override_styles/hover = SubResource("StyleBoxFlat_CloseButton")
theme_override_styles/pressed = SubResource("StyleBoxFlat_CloseButton")
theme_override_styles/normal = SubResource("StyleBoxFlat_CloseButton")
text = "X"
[node name="ScrollContainer" type="ScrollContainer" parent="."]
layout_mode = 0
offset_left = 48.0
offset_top = 116.0
offset_right = 1352.0
offset_bottom = 674.0
theme_override_styles/panel = SubResource("StyleBoxFlat_n2mxy")
horizontal_scroll_mode = 0
[node name="Grid" type="GridContainer" parent="ScrollContainer"]
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 3
columns = 5
[node name="FlowerFarm" type="VBoxContainer" parent="ScrollContainer/Grid"]
layout_mode = 2
alignment = 1
[node name="GameTitle" type="Label" parent="ScrollContainer/Grid/FlowerFarm"]
layout_mode = 2
theme_override_colors/font_color = Color(1, 0.8, 0.6, 1)
theme_override_colors/font_shadow_color = Color(0, 0, 0, 1)
theme_override_colors/font_outline_color = Color(0.180392, 0.121569, 0.0745098, 1)
theme_override_constants/shadow_offset_x = 3
theme_override_constants/shadow_offset_y = 3
theme_override_constants/outline_size = 15
theme_override_constants/shadow_outline_size = 15
theme_override_font_sizes/font_size = 35
text = "🌸 花卉农场 🌺"
horizontal_alignment = 1
vertical_alignment = 1
[node name="TextureRect" type="TextureRect" parent="ScrollContainer/Grid/FlowerFarm"]
layout_mode = 2
texture = ExtResource("1_mv0g4")
[node name="FlowerFarmButton" type="Button" parent="ScrollContainer/Grid/FlowerFarm"]
layout_mode = 2
theme_override_colors/font_color = Color(1, 1, 1, 1)
theme_override_font_sizes/font_size = 30
theme_override_styles/hover = SubResource("StyleBoxFlat_Button_Hover")
theme_override_styles/pressed = SubResource("StyleBoxFlat_Button_Pressed")
theme_override_styles/normal = SubResource("StyleBoxFlat_Button_Normal")
text = "🌻欣赏花园"
[node name="FruitFarm" type="VBoxContainer" parent="ScrollContainer/Grid"]
layout_mode = 2
alignment = 1
[node name="GameTitle" type="Label" parent="ScrollContainer/Grid/FruitFarm"]
layout_mode = 2
theme_override_colors/font_color = Color(1, 0.8, 0.6, 1)
theme_override_colors/font_shadow_color = Color(0, 0, 0, 1)
theme_override_colors/font_outline_color = Color(0.180392, 0.121569, 0.0745098, 1)
theme_override_constants/shadow_offset_x = 3
theme_override_constants/shadow_offset_y = 3
theme_override_constants/outline_size = 15
theme_override_constants/shadow_outline_size = 15
theme_override_font_sizes/font_size = 35
text = "🍎 瓜果飘香 🍓"
horizontal_alignment = 1
vertical_alignment = 1
[node name="TextureRect" type="TextureRect" parent="ScrollContainer/Grid/FruitFarm"]
layout_mode = 2
texture = ExtResource("1_mv0g4")
[node name="FruitFarmButton" type="Button" parent="ScrollContainer/Grid/FruitFarm"]
layout_mode = 2
theme_override_colors/font_color = Color(1, 1, 1, 1)
theme_override_font_sizes/font_size = 30
theme_override_styles/hover = SubResource("StyleBoxFlat_Button_Hover")
theme_override_styles/pressed = SubResource("StyleBoxFlat_Button_Pressed")
theme_override_styles/normal = SubResource("StyleBoxFlat_Button_Normal")
text = "🥕采摘果实"
[node name="HybridFarm" type="VBoxContainer" parent="ScrollContainer/Grid"]
layout_mode = 2
alignment = 1
[node name="GameTitle" type="Label" parent="ScrollContainer/Grid/HybridFarm"]
layout_mode = 2
theme_override_colors/font_color = Color(1, 0.8, 0.6, 1)
theme_override_colors/font_shadow_color = Color(0, 0, 0, 1)
theme_override_colors/font_outline_color = Color(0.180392, 0.121569, 0.0745098, 1)
theme_override_constants/shadow_offset_x = 3
theme_override_constants/shadow_offset_y = 3
theme_override_constants/outline_size = 15
theme_override_constants/shadow_outline_size = 15
theme_override_font_sizes/font_size = 35
text = "🧬 杂交基地 🌱"
horizontal_alignment = 1
vertical_alignment = 1
[node name="TextureRect" type="TextureRect" parent="ScrollContainer/Grid/HybridFarm"]
layout_mode = 2
texture = ExtResource("1_mv0g4")
[node name="HybridFarmButton" type="Button" parent="ScrollContainer/Grid/HybridFarm"]
layout_mode = 2
theme_override_colors/font_color = Color(1, 1, 1, 1)
theme_override_font_sizes/font_size = 30
theme_override_styles/hover = SubResource("StyleBoxFlat_Button_Hover")
theme_override_styles/pressed = SubResource("StyleBoxFlat_Button_Pressed")
theme_override_styles/normal = SubResource("StyleBoxFlat_Button_Normal")
text = "🔬研究培育"
[node name="LuckyFarm" type="VBoxContainer" parent="ScrollContainer/Grid"]
layout_mode = 2
alignment = 1
[node name="GameTitle" type="Label" parent="ScrollContainer/Grid/LuckyFarm"]
layout_mode = 2
theme_override_colors/font_color = Color(1, 0.8, 0.6, 1)
theme_override_colors/font_shadow_color = Color(0, 0, 0, 1)
theme_override_colors/font_outline_color = Color(0.180392, 0.121569, 0.0745098, 1)
theme_override_constants/shadow_offset_x = 3
theme_override_constants/shadow_offset_y = 3
theme_override_constants/outline_size = 15
theme_override_constants/shadow_outline_size = 15
theme_override_font_sizes/font_size = 35
text = "🍀 幸运农场 ✨"
horizontal_alignment = 1
vertical_alignment = 1
[node name="TextureRect" type="TextureRect" parent="ScrollContainer/Grid/LuckyFarm"]
layout_mode = 2
texture = ExtResource("1_mv0g4")
[node name="LuckyFarmButton" type="Button" parent="ScrollContainer/Grid/LuckyFarm"]
layout_mode = 2
theme_override_colors/font_color = Color(1, 1, 1, 1)
theme_override_font_sizes/font_size = 30
theme_override_styles/hover = SubResource("StyleBoxFlat_Button_Hover")
theme_override_styles/pressed = SubResource("StyleBoxFlat_Button_Pressed")
theme_override_styles/normal = SubResource("StyleBoxFlat_Button_Normal")
text = "🎲试试运气"
[node name="RiceFarm" type="VBoxContainer" parent="ScrollContainer/Grid"]
layout_mode = 2
alignment = 1
[node name="GameTitle" type="Label" parent="ScrollContainer/Grid/RiceFarm"]
layout_mode = 2
theme_override_colors/font_color = Color(1, 0.8, 0.6, 1)
theme_override_colors/font_shadow_color = Color(0, 0, 0, 1)
theme_override_colors/font_outline_color = Color(0.180392, 0.121569, 0.0745098, 1)
theme_override_constants/shadow_offset_x = 3
theme_override_constants/shadow_offset_y = 3
theme_override_constants/outline_size = 15
theme_override_constants/shadow_outline_size = 15
theme_override_font_sizes/font_size = 35
text = "🌾 稻香田园 🍚"
horizontal_alignment = 1
vertical_alignment = 1
[node name="TextureRect" type="TextureRect" parent="ScrollContainer/Grid/RiceFarm"]
layout_mode = 2
texture = ExtResource("1_mv0g4")
[node name="RiceFarmButton" type="Button" parent="ScrollContainer/Grid/RiceFarm"]
layout_mode = 2
theme_override_colors/font_color = Color(1, 1, 1, 1)
theme_override_font_sizes/font_size = 30
theme_override_styles/hover = SubResource("StyleBoxFlat_Button_Hover")
theme_override_styles/pressed = SubResource("StyleBoxFlat_Button_Pressed")
theme_override_styles/normal = SubResource("StyleBoxFlat_Button_Normal")
text = "🌾收割稻谷"
[node name="WheatFarm" type="VBoxContainer" parent="ScrollContainer/Grid"]
layout_mode = 2
alignment = 1
[node name="GameTitle" type="Label" parent="ScrollContainer/Grid/WheatFarm"]
layout_mode = 2
theme_override_colors/font_color = Color(1, 0.8, 0.6, 1)
theme_override_colors/font_shadow_color = Color(0, 0, 0, 1)
theme_override_colors/font_outline_color = Color(0.180392, 0.121569, 0.0745098, 1)
theme_override_constants/shadow_offset_x = 3
theme_override_constants/shadow_offset_y = 3
theme_override_constants/outline_size = 15
theme_override_constants/shadow_outline_size = 15
theme_override_font_sizes/font_size = 35
text = "🌾 小麦谷 🥖"
horizontal_alignment = 1
vertical_alignment = 1
[node name="TextureRect" type="TextureRect" parent="ScrollContainer/Grid/WheatFarm"]
layout_mode = 2
texture = ExtResource("1_mv0g4")
[node name="WheatFarmButton" type="Button" parent="ScrollContainer/Grid/WheatFarm"]
layout_mode = 2
theme_override_colors/font_color = Color(1, 1, 1, 1)
theme_override_font_sizes/font_size = 30
theme_override_styles/hover = SubResource("StyleBoxFlat_Button_Hover")
theme_override_styles/pressed = SubResource("StyleBoxFlat_Button_Pressed")
theme_override_styles/normal = SubResource("StyleBoxFlat_Button_Normal")
text = "🌾收割麦子"
[connection signal="pressed" from="QuitButton" to="." method="_on_quit_button_pressed"]
[connection signal="pressed" from="ScrollContainer/Grid/FlowerFarm/FlowerFarmButton" to="." method="_on_flower_farm_button_pressed"]
[connection signal="pressed" from="ScrollContainer/Grid/FruitFarm/FruitFarmButton" to="." method="_on_fruit_farm_button_pressed"]
[connection signal="pressed" from="ScrollContainer/Grid/HybridFarm/HybridFarmButton" to="." method="_on_hybrid_farm_button_pressed"]
[connection signal="pressed" from="ScrollContainer/Grid/LuckyFarm/LuckyFarmButton" to="." method="_on_lucky_farm_button_pressed"]
[connection signal="pressed" from="ScrollContainer/Grid/RiceFarm/RiceFarmButton" to="." method="_on_rice_farm_button_pressed"]
[connection signal="pressed" from="ScrollContainer/Grid/WheatFarm/WheatFarmButton" to="." method="_on_wheat_farm_button_pressed"]

View File

@@ -0,0 +1,15 @@
[gd_scene load_steps=2 format=3 uid="uid://btp1h6hic2sin"]
[ext_resource type="Script" uid="uid://ce8xcp770tolo" path="res://Script/Dialog/AcceptDialog.gd" id="1_yc5jp"]
[node name="AcceptDialog" type="AcceptDialog"]
auto_translate_mode = 1
title = "是否购买"
initial_position = 1
size = Vector2i(300, 200)
visible = true
ok_button_text = "确定"
script = ExtResource("1_yc5jp")
[connection signal="canceled" from="." to="." method="_on_canceled"]
[connection signal="confirmed" from="." to="." method="_on_confirmed"]

View File

@@ -0,0 +1,368 @@
extends Area2D
class_name BulletBase
# 简化子弹系统 - 辅助攻击用
# 基础功能:移动、碰撞检测、伤害
signal bullet_hit(bullet: BulletBase, target: NewPetBase)
@onready var sprite: Sprite2D = $Sprite
@onready var collision_shape: CollisionShape2D = $CollisionShape2D
const bullet = {
"小蓝弹":{
"图片":"res://assets/子弹图片/01.png",
"函数":"create_blue_bullet"
},
"小红弹":{
"图片":"res://assets/子弹图片/02.png",
"函数":"create_red_bullet"
},
"小粉弹":{
"图片":"res://assets/子弹图片/03.png",
"函数":"create_pink_bullet"
},
"小紫弹":{
"图片":"res://assets/子弹图片/04.png",
"函数":"create_purple_bullet"
},
"长橙弹":{
"图片":"res://assets/子弹图片/21.png",
"函数":"create_long_orange_bullet"
},
"长紫弹":{
"图片":"res://assets/子弹图片/22.png",
"函数":"create_long_purple_bullet"
},
"长绿弹":{
"图片":"res://assets/子弹图片/25.png",
"函数":"create_long_green_bullet"
},
"黄色闪电":{
"图片":"res://assets/子弹图片/36.png",
"函数":"create_yellow_lightning_bullet"
},
"绿色闪电":{
"图片":"res://assets/子弹图片/35.png",
"函数":"create_green_lightning_bullet"
},
"红色闪电":{
"图片":"res://assets/子弹图片/33.png",
"函数":"create_red_lightning_bullet"
},
"紫色闪电":{
"图片":"res://assets/子弹图片/32.png",
"函数":"create_purple_lightning_bullet"
},
}
# 基础子弹属性
var direction: Vector2 = Vector2.RIGHT
var speed: float = 300.0
var damage: float = 25.0
var owner_pet: NewPetBase = null
var max_distance: float = 800.0
var traveled_distance: float = 0.0
var is_active: bool = true
# 生存时间
var lifetime: float = 3.0
var current_lifetime: float = 0.0
#==================基础函数=========================
func _ready():
# 连接碰撞信号
area_entered.connect(_on_area_entered)
# 设置碰撞层
collision_layer = 4 # 子弹层
collision_mask = 1 # 只检测宠物层
# 添加到子弹组
add_to_group("bullets")
func _physics_process(delta):
if not is_active:
return
# 更新生存时间
current_lifetime += delta
if current_lifetime >= lifetime:
call_deferred("destroy_bullet")
return
# 检查长紫弹分裂计时
if has_meta("bullet_type") and get_meta("bullet_type") == "长紫弹":
var current_split_time = get_meta("current_split_time", 0.0)
var split_timer = get_meta("split_timer", 2.0)
current_split_time += delta
set_meta("current_split_time", current_split_time)
if current_split_time >= split_timer:
# 时间到了,分裂并销毁
call_deferred("create_split_bullets", global_position)
call_deferred("destroy_bullet")
return
# 移动子弹
var movement = direction * speed * delta
position += movement
traveled_distance += movement.length()
# 检查最大距离
if traveled_distance >= max_distance:
call_deferred("destroy_bullet")
return
# 检查是否超出屏幕边界
var viewport_rect = get_viewport().get_visible_rect()
if not viewport_rect.has_point(global_position):
call_deferred("destroy_bullet")
#==================基础函数=========================
#=============================每个子弹单独效果============================
# 小蓝弹
func create_blue_bullet():
sprite.texture = load(bullet["小蓝弹"]["图片"])
speed = 250.0
damage = 20.0
lifetime = 2.5
sprite.modulate = Color(0.5, 0.8, 1.0, 1.0) # 蓝色调
# 小红弹
func create_red_bullet():
sprite.texture = load(bullet["小红弹"]["图片"])
speed = 300.0
damage = 25.0
lifetime = 3.0
sprite.modulate = Color(1.0, 0.5, 0.5, 1.0) # 红色调
# 小粉弹
func create_pink_bullet():
sprite.texture = load(bullet["小粉弹"]["图片"])
speed = 280.0
damage = 22.0
lifetime = 2.8
sprite.modulate = Color(1.0, 0.7, 0.9, 1.0) # 粉色调
# 小紫弹
func create_purple_bullet():
sprite.texture = load(bullet["小紫弹"]["图片"])
speed = 320.0
damage = 28.0
lifetime = 3.2
sprite.modulate = Color(0.8, 0.5, 1.0, 1.0) # 紫色调
# 长橙弹
func create_long_orange_bullet():
sprite.texture = load(bullet["长橙弹"]["图片"])
speed = 350.0
damage = 35.0
lifetime = 4.0
max_distance = 1000.0
sprite.modulate = Color(1.0, 0.7, 0.3, 1.0) # 橙色调
# 长紫弹
func create_long_purple_bullet():
sprite.texture = load(bullet["长紫弹"]["图片"])
speed = 330.0
damage = 32.0
lifetime = 3.8
max_distance = 950.0
sprite.modulate = Color(0.9, 0.4, 1.0, 1.0) # 深紫色调
# 标记为长紫弹2秒后自动分裂
set_meta("bullet_type", "长紫弹")
set_meta("split_timer", 2.0) # 2秒后分裂
set_meta("current_split_time", 0.0) # 当前计时
# 创建分裂子弹长紫弹2秒后的效果
func create_split_bullets(hit_position: Vector2):
"""在指定位置生成4个小弹向四周发射"""
var bullet_types = ["小蓝弹", "小红弹", "小粉弹", "小紫弹"]
var bullet_scene = preload("res://Scene/NewPet/BulletBase.tscn")
# 生成4个方向的子弹
for i in range(4):
# 计算方向角度每90度一个方向
var angle = i * PI / 2.0
var direction_vector = Vector2(cos(angle), sin(angle))
# 选择子弹类型每种类型1个
var bullet_type = bullet_types[i]
# 创建子弹实例
var new_bullet = bullet_scene.instantiate()
get_parent().add_child(new_bullet)
# 设置子弹位置
new_bullet.global_position = hit_position
# 设置子弹属性5个参数方向、速度、伤害、所有者、子弹类型
new_bullet.setup(direction_vector, 200.0, 15.0, owner_pet, bullet_type)
# 分裂子弹生成完成
# 长绿弹
func create_long_green_bullet():
sprite.texture = load(bullet["长绿弹"]["图片"])
speed = 310.0
damage = 30.0
lifetime = 3.5
max_distance = 900.0
sprite.modulate = Color(0.4, 1.0, 0.5, 1.0) # 绿色调
# 黄色闪电
func create_yellow_lightning_bullet():
sprite.texture = load(bullet["黄色闪电"]["图片"])
speed = 400.0
damage = 40.0
lifetime = 2.0
max_distance = 600.0
sprite.modulate = Color(1.0, 1.0, 0.3, 1.0) # 黄色闪电
# 绿色闪电
func create_green_lightning_bullet():
sprite.texture = load(bullet["绿色闪电"]["图片"])
speed = 380.0
damage = 38.0
lifetime = 2.2
max_distance = 650.0
sprite.modulate = Color(0.3, 1.0, 0.3, 1.0) # 绿色闪电
# 红色闪电
func create_red_lightning_bullet():
sprite.texture = load(bullet["红色闪电"]["图片"])
speed = 420.0
damage = 45.0
lifetime = 1.8
max_distance = 550.0
sprite.modulate = Color(1.0, 0.3, 0.3, 1.0) # 红色闪电
# 紫色闪电
func create_purple_lightning_bullet():
sprite.texture = load(bullet["紫色闪电"]["图片"])
speed = 450.0
damage = 50.0
lifetime = 1.5
max_distance = 500.0
sprite.modulate = Color(0.8, 0.3, 1.0, 1.0) # 紫色闪电
#=============================每个子弹单独效果============================
#=========================通用子弹函数==============================
# 通用子弹创建函数
func create_bullet_by_name(bullet_name: String):
"""根据子弹名称创建对应类型的子弹"""
if not bullet.has(bullet_name):
return
var bullet_data = bullet[bullet_name]
var function_name = bullet_data.get("函数", "")
if function_name != "":
call(function_name)
# 获取子弹图标
func get_bullet_icon(bullet_name: String) -> Texture2D:
if bullet.has(bullet_name) and bullet[bullet_name].has("图片"):
return load(bullet[bullet_name]["图片"])
else:
return null
# 获取所有子弹名称列表
func get_all_bullet_names() -> Array:
return bullet.keys()
# 创建击中特效
func create_hit_effect(pos: Vector2):
pass
#销毁子弹
func destroy_bullet():
"""销毁子弹"""
is_active = false
remove_from_group("bullets")
queue_free()
#初始化子弹
func setup(dir: Vector2, spd: float, dmg: float, owner: NewPetBase, bullet_type: String = ""):
"""初始化子弹"""
direction = dir.normalized()
owner_pet = owner
# 如果指定了子弹类型,使用对应的创建函数
if bullet_type != "" and bullet.has(bullet_type):
create_bullet_by_name(bullet_type)
else:
# 使用传入的参数作为默认值
speed = spd
damage = dmg
# 简单的视觉效果
sprite.modulate = Color.YELLOW
# 设置子弹旋转
rotation = direction.angle()
#碰撞检测
func _on_area_entered(area: Area2D):
"""碰撞检测"""
if not is_active:
return
# 检查是否是宠物
if not area is NewPetBase:
return
var pet_target = area as NewPetBase
# 检查是否是有效目标
if not is_valid_target(pet_target):
return
# 造成伤害并延迟销毁子弹(避免在物理查询期间修改状态)
hit_target(pet_target)
call_deferred("destroy_bullet")
#检查是否是有效攻击目标
func is_valid_target(target: NewPetBase) -> bool:
"""检查是否是有效攻击目标"""
# 检查owner_pet是否有效
if not is_instance_valid(owner_pet):
owner_pet = null
# 不能攻击自己的主人
if target == owner_pet:
return false
# 不能攻击同队伍
if owner_pet != null and target.pet_team == owner_pet.pet_team:
return false
# 不能攻击已死亡的宠物
if not target.is_alive:
return false
return true
#击中目标
func hit_target(target: NewPetBase):
"""击中目标"""
# 检查owner_pet是否有效防止已释放对象错误
if not is_instance_valid(owner_pet):
owner_pet = null
# 造成伤害
target.take_damage(damage, owner_pet)
# 发射信号
bullet_hit.emit(self, target)
# 创建击中特效
create_hit_effect(target.global_position)
#=========================通用子弹函数==============================

View File

@@ -0,0 +1 @@
uid://bt57qac8hmg1u

View File

@@ -0,0 +1,29 @@
[gd_scene load_steps=4 format=3 uid="uid://cqtv1dob3dm8b"]
[ext_resource type="Script" uid="uid://bt57qac8hmg1u" path="res://Scene/NewPet/BulletBase.gd" id="1_guena"]
[ext_resource type="Texture2D" uid="uid://by01joyt7e4qh" path="res://assets/子弹图片/01.png" id="2_2q4gn"]
[sub_resource type="CircleShape2D" id="CircleShape2D_1"]
radius = 8.0
[node name="BulletBase" type="Area2D"]
script = ExtResource("1_guena")
[node name="Sprite" type="Sprite2D" parent="."]
modulate = Color(1, 1, 0, 0.8)
scale = Vector2(0.5, 0.5)
texture = ExtResource("2_2q4gn")
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource("CircleShape2D_1")
[node name="Trail" type="Line2D" parent="."]
width = 2.0
default_color = Color(1, 1, 0, 0.5)
[node name="HitEffect" type="Node2D" parent="."]
[node name="LifeTimer" type="Timer" parent="."]
wait_time = 5.0
one_shot = true
autostart = true

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1 @@
uid://cn6a0803t1bmu

View File

@@ -0,0 +1,146 @@
[gd_scene load_steps=8 format=3 uid="uid://cfwj8rnm2j8s3"]
[ext_resource type="Script" uid="uid://cn6a0803t1bmu" path="res://Scene/NewPet/NewPetBase.gd" id="1_bfbjx"]
[ext_resource type="Texture2D" uid="uid://lx0l12qrituk" path="res://assets/宠物图片/一堆小怪.png" id="2_gnd2w"]
[ext_resource type="Texture2D" uid="uid://dciakkwnchcga" path="res://assets/我的世界图片/武器工具/木剑.png" id="3_bfbjx"]
[sub_resource type="AtlasTexture" id="AtlasTexture_h4hw6"]
atlas = ExtResource("2_gnd2w")
region = Rect2(0, 0, 24, 24)
[sub_resource type="AtlasTexture" id="AtlasTexture_51c25"]
atlas = ExtResource("2_gnd2w")
region = Rect2(24, 0, 24, 24)
[sub_resource type="SpriteFrames" id="SpriteFrames_wmdx5"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_h4hw6")
}],
"loop": true,
"name": &"idle",
"speed": 5.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_h4hw6")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_51c25")
}],
"loop": true,
"name": &"walk",
"speed": 8.0
}]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_h4hw6"]
size = Vector2(79, 92)
[node name="PetBase" type="Area2D"]
script = ExtResource("1_bfbjx")
[node name="PetImage" type="AnimatedSprite2D" parent="."]
scale = Vector2(4, 4)
sprite_frames = SubResource("SpriteFrames_wmdx5")
animation = &"walk"
autoplay = "walk"
[node name="LeftToolImage" type="Sprite2D" parent="PetImage"]
z_index = 5
position = Vector2(-10.5, 3)
texture = ExtResource("3_bfbjx")
flip_h = true
[node name="RightToolImage" type="Sprite2D" parent="PetImage"]
show_behind_parent = true
position = Vector2(-7.5, -6.25)
texture = ExtResource("3_bfbjx")
flip_h = true
[node name="VolumeCollision" type="CollisionShape2D" parent="."]
position = Vector2(0.5, 2)
shape = SubResource("RectangleShape2D_h4hw6")
[node name="PetInformVBox" type="VBoxContainer" parent="."]
offset_left = -72.0
offset_top = -261.0
offset_right = 430.0
offset_bottom = 453.0
scale = Vector2(0.3, 0.3)
alignment = 2
[node name="PetNameRichText" type="RichTextLabel" parent="PetInformVBox"]
layout_mode = 2
size_flags_vertical = 3
theme_override_font_sizes/normal_font_size = 40
bbcode_enabled = true
text = "萌芽小绿人"
horizontal_alignment = 1
vertical_alignment = 2
[node name="ArmorBar" type="ProgressBar" parent="PetInformVBox"]
modulate = Color(0.758192, 0.758192, 0.758192, 1)
custom_minimum_size = Vector2(0, 60)
layout_mode = 2
show_percentage = false
[node name="ArmorLabel" type="Label" parent="PetInformVBox/ArmorBar"]
layout_mode = 0
offset_right = 502.0
offset_bottom = 60.0
theme_override_font_sizes/font_size = 30
text = "盔甲值:100/100"
horizontal_alignment = 1
vertical_alignment = 1
[node name="ShieldBar" type="ProgressBar" parent="PetInformVBox"]
modulate = Color(0, 1, 1, 1)
custom_minimum_size = Vector2(0, 60)
layout_mode = 2
show_percentage = false
[node name="ShieldLabel" type="Label" parent="PetInformVBox/ShieldBar"]
layout_mode = 0
offset_right = 502.0
offset_bottom = 60.0
theme_override_font_sizes/font_size = 30
text = "护盾值:100/100"
horizontal_alignment = 1
vertical_alignment = 1
[node name="HealthBar" type="ProgressBar" parent="PetInformVBox"]
modulate = Color(0, 1, 0, 1)
custom_minimum_size = Vector2(0, 60)
layout_mode = 2
show_percentage = false
[node name="HealthLabel" type="Label" parent="PetInformVBox/HealthBar"]
layout_mode = 0
offset_right = 502.0
offset_bottom = 60.0
theme_override_font_sizes/font_size = 30
text = "生命值:100/100"
horizontal_alignment = 1
vertical_alignment = 1
[node name="StatusEffects" type="HBoxContainer" parent="."]
offset_left = -30.0
offset_top = -65.0
offset_right = 30.0
offset_bottom = -55.0
[node name="AttackTimer" type="Timer" parent="."]
[node name="MoveTimer" type="Timer" parent="."]
wait_time = 0.1
autostart = true
[node name="StatusTimer" type="Timer" parent="."]
autostart = true
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
[node name="HitEffect" type="Node2D" parent="."]
[node name="DeathEffect" type="Node2D" parent="."]

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1 @@
uid://bt06n5cxip4kr

View File

@@ -0,0 +1,318 @@
[gd_scene load_steps=3 format=3 uid="uid://diwbnwhnq026"]
[ext_resource type="Script" uid="uid://bt06n5cxip4kr" path="res://Scene/NewPet/PetBattlePanel.gd" id="1_0uw4q"]
[ext_resource type="Texture2D" uid="uid://dh0dsw3jr0gra" path="res://assets/宠物对战背景图片/背景2.webp" id="2_c80tv"]
[node name="PetBattlePanel" type="Panel"]
offset_right = 1400.0
offset_bottom = 720.0
script = ExtResource("1_0uw4q")
[node name="MapBackGround" type="TextureRect" parent="."]
layout_mode = 0
offset_right = 1557.0
offset_bottom = 867.0
scale = Vector2(0.9, 0.9)
texture = ExtResource("2_c80tv")
[node name="TeamB" type="Node2D" parent="."]
position = Vector2(1239, 421)
[node name="Pos1" type="Marker2D" parent="TeamB"]
position = Vector2(17, -166)
[node name="Pos2" type="Marker2D" parent="TeamB"]
position = Vector2(42, 160)
[node name="Pos3" type="Marker2D" parent="TeamB"]
position = Vector2(42, -38)
[node name="Pos4" type="Marker2D" parent="TeamB"]
position = Vector2(21, -315)
[node name="Pos5" type="Marker2D" parent="TeamB"]
position = Vector2(42, -102)
[node name="Pos6" type="Marker2D" parent="TeamB"]
position = Vector2(42, 96)
[node name="Pos7" type="Marker2D" parent="TeamB"]
position = Vector2(42, 32)
[node name="Pos8" type="Marker2D" parent="TeamB"]
position = Vector2(21, -251)
[node name="Pos9" type="Marker2D" parent="TeamB"]
position = Vector2(42, -230)
[node name="Pos10" type="Marker2D" parent="TeamB"]
position = Vector2(42, 224)
[node name="TeamA" type="Node2D" parent="."]
position = Vector2(138, 134)
[node name="Pos1" type="Marker2D" parent="TeamA"]
position = Vector2(-37, 408)
[node name="Pos2" type="Marker2D" parent="TeamA"]
position = Vector2(-41, 93)
[node name="Pos3" type="Marker2D" parent="TeamA"]
position = Vector2(-38, 313)
[node name="Pos4" type="Marker2D" parent="TeamA"]
position = Vector2(-38, 223)
[node name="Pos5" type="Marker2D" parent="TeamA"]
position = Vector2(-38, 133)
[node name="Pos6" type="Marker2D" parent="TeamA"]
position = Vector2(-38, 43)
[node name="Pos7" type="Marker2D" parent="TeamA"]
position = Vector2(-38, 358)
[node name="Pos8" type="Marker2D" parent="TeamA"]
position = Vector2(-38, 268)
[node name="Pos9" type="Marker2D" parent="TeamA"]
position = Vector2(-38, 178)
[node name="Pos10" type="Marker2D" parent="TeamA"]
position = Vector2(-38, 453)
[node name="PlayerSkillPanel" type="Panel" parent="."]
layout_mode = 0
offset_left = 1143.0
offset_right = 1400.0
offset_bottom = 720.0
[node name="Title" type="Label" parent="PlayerSkillPanel"]
self_modulate = Color(0, 1, 0, 1)
layout_mode = 0
offset_right = 257.0
offset_bottom = 40.0
theme_override_font_sizes/font_size = 25
text = "辅助功能"
horizontal_alignment = 1
vertical_alignment = 1
[node name="TeamASkills" type="VBoxContainer" parent="PlayerSkillPanel"]
layout_mode = 0
offset_top = 50.0
offset_right = 257.0
offset_bottom = 578.0
[node name="TeamAHeal" type="Button" parent="PlayerSkillPanel/TeamASkills"]
layout_mode = 2
theme_override_font_sizes/font_size = 18
text = "团队治疗"
[node name="TeamARage" type="Button" parent="PlayerSkillPanel/TeamASkills"]
layout_mode = 2
theme_override_font_sizes/font_size = 18
text = "团队狂暴"
[node name="TeamAShield" type="Button" parent="PlayerSkillPanel/TeamASkills"]
layout_mode = 2
theme_override_font_sizes/font_size = 18
text = "团队护盾"
[node name="test" type="Button" parent="PlayerSkillPanel/TeamASkills"]
layout_mode = 2
theme_override_font_sizes/font_size = 18
disabled = true
text = "暂无"
[node name="test2" type="Button" parent="PlayerSkillPanel/TeamASkills"]
layout_mode = 2
theme_override_font_sizes/font_size = 18
disabled = true
text = "暂无"
[node name="test3" type="Button" parent="PlayerSkillPanel/TeamASkills"]
layout_mode = 2
theme_override_font_sizes/font_size = 18
disabled = true
text = "暂无"
[node name="test4" type="Button" parent="PlayerSkillPanel/TeamASkills"]
layout_mode = 2
theme_override_font_sizes/font_size = 18
disabled = true
text = "暂无"
[node name="test5" type="Button" parent="PlayerSkillPanel/TeamASkills"]
layout_mode = 2
theme_override_font_sizes/font_size = 18
disabled = true
text = "暂无"
[node name="test6" type="Button" parent="PlayerSkillPanel/TeamASkills"]
layout_mode = 2
theme_override_font_sizes/font_size = 18
disabled = true
text = "暂无"
[node name="test7" type="Button" parent="PlayerSkillPanel/TeamASkills"]
layout_mode = 2
theme_override_font_sizes/font_size = 18
disabled = true
text = "暂无"
[node name="test8" type="Button" parent="PlayerSkillPanel/TeamASkills"]
layout_mode = 2
theme_override_font_sizes/font_size = 18
disabled = true
text = "暂无"
[node name="test9" type="Button" parent="PlayerSkillPanel/TeamASkills"]
layout_mode = 2
theme_override_font_sizes/font_size = 18
disabled = true
text = "暂无"
[node name="test10" type="Button" parent="PlayerSkillPanel/TeamASkills"]
layout_mode = 2
theme_override_font_sizes/font_size = 18
disabled = true
text = "暂无"
[node name="test11" type="Button" parent="PlayerSkillPanel/TeamASkills"]
layout_mode = 2
theme_override_font_sizes/font_size = 18
disabled = true
text = "暂无"
[node name="BattleControls" type="VBoxContainer" parent="PlayerSkillPanel"]
layout_mode = 0
offset_top = 580.0
offset_right = 257.0
offset_bottom = 720.0
[node name="StartBattleButton" type="Button" parent="PlayerSkillPanel/BattleControls"]
visible = false
layout_mode = 2
theme_override_colors/font_color = Color(0, 1, 0, 1)
theme_override_font_sizes/font_size = 20
text = "开始战斗"
[node name="StopBattleButton" type="Button" parent="PlayerSkillPanel/BattleControls"]
layout_mode = 2
theme_override_colors/font_color = Color(1, 0, 0, 1)
theme_override_font_sizes/font_size = 20
text = "逃跑"
[node name="BattleEndPanel" type="Panel" parent="."]
visible = false
top_level = true
layout_mode = 0
offset_left = 294.0
offset_right = 1071.0
offset_bottom = 720.0
[node name="Title" type="Label" parent="BattleEndPanel"]
layout_mode = 0
offset_right = 777.0
offset_bottom = 104.0
theme_override_colors/font_color = Color(0.991435, 0.798103, 0.357309, 1)
theme_override_colors/font_shadow_color = Color(0, 0, 0, 1)
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
theme_override_constants/shadow_offset_x = 5
theme_override_constants/shadow_offset_y = 5
theme_override_constants/outline_size = 20
theme_override_constants/shadow_outline_size = 20
theme_override_font_sizes/font_size = 60
text = "战斗结束"
horizontal_alignment = 1
vertical_alignment = 1
[node name="Contents" type="RichTextLabel" parent="BattleEndPanel"]
layout_mode = 0
offset_top = 104.0
offset_right = 777.0
offset_bottom = 567.0
theme_override_font_sizes/normal_font_size = 30
bbcode_enabled = true
text = "[宠物名字]获得300经验
增加200亲密度"
horizontal_alignment = 1
[node name="ReturnFarmButton" type="Button" parent="BattleEndPanel"]
layout_mode = 0
offset_left = 294.0
offset_top = 567.0
offset_right = 502.0
offset_bottom = 644.0
theme_override_font_sizes/font_size = 50
text = "返回农场"
[node name="Title" type="Label" parent="."]
layout_mode = 0
offset_right = 1400.0
offset_bottom = 55.0
theme_override_colors/font_color = Color(0.623819, 1, 0.593898, 1)
theme_override_colors/font_shadow_color = Color(0, 0, 0, 1)
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
theme_override_constants/shadow_offset_x = 5
theme_override_constants/shadow_offset_y = 5
theme_override_constants/outline_size = 20
theme_override_constants/shadow_outline_size = 10
theme_override_font_sizes/font_size = 50
text = "宠物对战"
horizontal_alignment = 1
vertical_alignment = 1
[node name="Time" type="Label" parent="."]
layout_mode = 0
offset_left = 574.0
offset_top = 60.0
offset_right = 813.0
offset_bottom = 129.0
theme_override_colors/font_color = Color(0.623529, 1, 1, 1)
theme_override_colors/font_shadow_color = Color(0, 0, 0, 1)
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
theme_override_constants/shadow_offset_x = 5
theme_override_constants/shadow_offset_y = 5
theme_override_constants/outline_size = 20
theme_override_constants/shadow_outline_size = 10
theme_override_font_sizes/font_size = 35
text = "[05:00]"
horizontal_alignment = 1
vertical_alignment = 1
[node name="PetBattleDetailsPanel" type="Panel" parent="."]
layout_mode = 0
offset_right = 257.0
offset_bottom = 720.0
[node name="Title" type="Label" parent="PetBattleDetailsPanel"]
layout_mode = 0
offset_right = 257.0
offset_bottom = 23.0
theme_override_font_sizes/font_size = 30
text = "战斗细节"
horizontal_alignment = 1
vertical_alignment = 1
[node name="BattleDetails" type="RichTextLabel" parent="PetBattleDetailsPanel"]
layout_mode = 0
offset_top = 42.0
offset_right = 257.0
offset_bottom = 720.0
bbcode_enabled = true
[node name="ConfirmDialog" type="ConfirmationDialog" parent="."]
title = "弹窗标题"
initial_position = 1
size = Vector2i(400, 300)
unresizable = true
ok_button_text = "确认"
dialog_text = "弹窗内容"
dialog_autowrap = true
cancel_button_text = "取消"
[connection signal="pressed" from="PlayerSkillPanel/TeamASkills/TeamAHeal" to="." method="_on_team_a_heal_pressed"]
[connection signal="pressed" from="PlayerSkillPanel/TeamASkills/TeamARage" to="." method="_on_team_a_rage_pressed"]
[connection signal="pressed" from="PlayerSkillPanel/TeamASkills/TeamAShield" to="." method="_on_team_a_shield_pressed"]
[connection signal="pressed" from="PlayerSkillPanel/BattleControls/StopBattleButton" to="." method="_on_stop_battle_button_pressed"]

View File

@@ -0,0 +1,416 @@
extends Node
class_name PetConfig
# 每一种宠物的配置数据 方便导出JSON数据放到MongoDB数据库上
# 攻击类型枚举(简化为仅近战)
enum AttackType {
MELEE # 近战攻击
}
enum ElementType {
NONE, METAL, WOOD, WATER, FIRE, EARTH, THUNDER
}
enum PetState {
IDLE, # 待机
MOVING, # 移动
ATTACKING, # 攻击中
SKILL_CASTING, # 释放技能
DEAD # 死亡
}
#==========================以下是导出数据可以被修改的=========================================
# 基本属性
var pet_name: String = "萌芽小绿" # 宠物名称
var pet_id: String = "0001" # 宠物唯一编号
var pet_type: String = "小绿" # 宠物种类
var pet_level: int = 1 # 宠物等级
var pet_experience: int = 0 # 宠物经验值
#性格 出生日期 爱好 个人介绍
var pet_temperament: String = "温顺" # 性格
var pet_birthday: String = "2023-01-01" # 出生日期
var pet_hobby: String = "喜欢吃pet" # 爱好
var pet_introduction: String = "我是一个小绿" # 个人介绍
# 生命与防御
var max_health: float = 200.0 # 最大生命值
var enable_health_regen: bool = true # 是否开启生命恢复
var health_regen: float = 1.0 # 每秒生命恢复大小
var enable_shield_regen: bool = true # 是否开启护盾恢复
var max_shield: float = 100.0 # 最大护盾值
var shield_regen: float = 1.0 # 每秒护盾恢复大小
var max_armor: float = 100.0 # 最大护甲值
# 攻击属性
var base_attack_damage: float = 25.0 # 基础攻击力
var crit_rate: float = 0.1 # 暴击几率0~1
var crit_damage: float = 1.5 # 暴击伤害倍率1.5 = 150%伤害)
var armor_penetration: float = 0.0 # 护甲穿透值(直接减少对方护甲值)
#======================以后有新技能在这里添加==============================
# 技能-多发射击
var enable_multi_projectile_skill: bool = false
var multi_projectile_delay: float = 2.0 # 多发射击延迟时间(秒)
# 技能-狂暴模式
var enable_berserker_skill: bool = false
var berserker_bonus: float = 1.5 # 狂暴伤害加成
var berserker_duration: float = 5.0 # 狂暴持续时间(秒)
#技能-自爆
var enable_self_destruct_skill: bool = false
var self_destruct_damage: float = 50.0 # 自爆伤害值
#技能-召唤小弟
var enable_summon_pet_skill: bool = false
var summon_count: int = 1 # 召唤小弟数量
var summon_scale: float = 0.1 # 召唤小弟属性缩放比例10%
#技能-死亡重生
var enable_death_respawn_skill: bool = false
var respawn_health_percentage: float = 0.3 # 重生时恢复的血量百分比30%
#技能-反弹伤害
var enable_damage_reflection_skill: bool = false
var damage_reflection_cooldown: float = 10.0 # 反弹伤害冷却时间(秒)
var damage_reflection_percentage: float = 0.5 # 反弹伤害百分比50%
#======================以后有新技能在这里添加==============================
# 移动属性
var move_speed: float = 150.0 # 移动速度(像素/秒)
var dodge_rate: float = 0.05 # 闪避概率0~1
# 元素属性
var element_type: ElementType = ElementType.NONE # 元素类型(例如火、水、雷等)
var element_damage_bonus: float = 50.0 # 元素伤害加成(额外元素伤害)
# 武器系统
var left_weapon: String = "" # 左手武器名称
var right_weapon: String = "" # 右手武器名称
# 宠物配置字典 - 用于导出到MongoDB数据库
var pet_configs: Dictionary = {
"烈焰鸟": {
"pet_name": "树萌芽の烈焰鸟",
"can_purchase": true,
"cost": 1000,
"pet_image": "res://Scene/NewPet/PetType/flying_bird.tscn",
"pet_id": "0001",
"pet_type": "烈焰鸟",
"pet_level": 1,
"pet_experience": 500,
"pet_temperament": "勇猛",
"pet_birthday": "2023-03-15",
"pet_hobby": "喜欢战斗和烈火",
"pet_introduction": "我爱吃虫子",
"max_health": 300,
"enable_health_regen": true,
"health_regen": 2,
"enable_shield_regen": true,
"max_shield": 150,
"shield_regen": 1.5,
"max_armor": 120,
"base_attack_damage": 40,
"crit_rate": 0.15,
"crit_damage": 2,
"armor_penetration": 10,
"enable_multi_projectile_skill": true,
"multi_projectile_delay": 2,
"enable_berserker_skill": true,
"berserker_bonus": 1.8,
"berserker_duration": 6,
"enable_self_destruct_skill": false,
"enable_summon_pet_skill": false,
"enable_death_respawn_skill": true,
"respawn_health_percentage": 0.4,
"enable_damage_reflection_skill": true,
"damage_reflection_cooldown": 8.0,
"damage_reflection_percentage": 0.6,
"move_speed": 180,
"dodge_rate": 0.08,
"element_type": "FIRE",
"element_damage_bonus": 75,
"left_weapon": "钻石剑",
"right_weapon": "钻石剑"
},
"大蓝虫": {
"pet_name": "树萌芽の大蓝虫",
"can_purchase": true,
"cost": 1000,
"pet_image": "res://Scene/NewPet/PetType/big_beetle.tscn",
"pet_id": "0002",
"pet_type": "大蓝虫",
"pet_level": 8,
"pet_experience": 320,
"pet_temperament": "冷静",
"pet_birthday": "2023-06-20",
"pet_hobby": "喜欢和小甲壳虫玩",
"pet_introduction": "我是大蓝虫,不是大懒虫!",
"max_health": 180,
"enable_health_regen": true,
"health_regen": 1.2,
"enable_shield_regen": true,
"max_shield": 200,
"shield_regen": 2.5,
"max_armor": 80,
"base_attack_damage": 35,
"crit_rate": 0.12,
"crit_damage": 1.8,
"armor_penetration": 15,
"enable_multi_projectile_skill": true,
"multi_projectile_delay": 1.5,
"enable_berserker_skill": false,
"enable_self_destruct_skill": false,
"enable_summon_pet_skill": true,
"summon_count": 2,
"summon_scale": 0.15,
"enable_death_respawn_skill": false,
"enable_damage_reflection_skill": true,
"damage_reflection_cooldown": 12.0,
"damage_reflection_percentage": 0.4,
"move_speed": 120,
"dodge_rate": 0.12,
"element_type": "WATER",
"element_damage_bonus": 100,
"left_weapon": "钻石剑",
"right_weapon": "钻石剑"
},
"小蓝虫": {
"pet_name": "树萌芽の小蓝虫",
"can_purchase": true,
"cost": 1000,
"pet_image": "res://Scene/NewPet/PetType/small_beetle.tscn",
"pet_id": "0002",
"pet_type": "小蓝虫",
"pet_level": 1,
"pet_experience": 0,
"pet_temperament": "冷静",
"pet_birthday": "2023-06-20",
"pet_hobby": "喜欢和大蓝虫玩",
"pet_introduction": "我是小蓝虫,不是小懒虫!",
"max_health": 90,
"enable_health_regen": true,
"health_regen": 1.2,
"enable_shield_regen": true,
"max_shield": 200,
"shield_regen": 2.5,
"max_armor": 80,
"base_attack_damage": 35,
"crit_rate": 0.12,
"crit_damage": 1.8,
"armor_penetration": 15,
"enable_multi_projectile_skill": true,
"multi_projectile_delay": 1.5,
"enable_berserker_skill": false,
"enable_self_destruct_skill": false,
"enable_summon_pet_skill": true,
"summon_count": 2,
"summon_scale": 0.15,
"enable_death_respawn_skill": false,
"enable_damage_reflection_skill": false,
"damage_reflection_cooldown": 10.0,
"damage_reflection_percentage": 0.5,
"move_speed": 120,
"dodge_rate": 0.12,
"element_type": "WATER",
"element_damage_bonus": 100,
"left_weapon": "钻石剑",
"right_weapon": "钻石剑"
},
"小蓝": {
"pet_name": "树萌芽の小蓝",
"can_purchase": true,
"cost": 1000,
"pet_image": "res://Scene/NewPet/PetType/small_blue.tscn",
"pet_id": "0002",
"pet_type": "小蓝",
"pet_level": 1,
"pet_experience": 0,
"pet_temperament": "冷静",
"pet_birthday": "2023-06-20",
"pet_hobby": "喜欢和小黄一起玩",
"pet_introduction": "我是小黄!",
"max_health": 120,
"enable_health_regen": true,
"health_regen": 1.2,
"enable_shield_regen": true,
"max_shield": 200,
"shield_regen": 2.5,
"max_armor": 80,
"base_attack_damage": 35,
"crit_rate": 0.12,
"crit_damage": 1.8,
"armor_penetration": 15,
"enable_multi_projectile_skill": true,
"multi_projectile_delay": 1.5,
"enable_berserker_skill": false,
"enable_self_destruct_skill": false,
"enable_summon_pet_skill": true,
"summon_count": 2,
"summon_scale": 0.15,
"enable_death_respawn_skill": false,
"enable_damage_reflection_skill": false,
"damage_reflection_cooldown": 10.0,
"damage_reflection_percentage": 0.5,
"move_speed": 120,
"dodge_rate": 0.12,
"element_type": "WATER",
"element_damage_bonus": 100,
"left_weapon": "钻石剑",
"right_weapon": "钻石剑"
}
}
# 初始化函数
func _ready():
"""节点准备就绪时自动加载JSON配置"""
load_configs_from_json()
# 手动初始化配置的函数
func initialize_configs():
"""手动初始化宠物配置优先从JSON加载"""
if not load_configs_from_json():
print("JSON加载失败使用默认配置")
# 如果JSON加载失败保持使用代码中的默认配置
# 获取宠物配置的函数
func get_pet_config(pet_key: String) -> Dictionary:
"""根据宠物键值获取配置"""
if pet_configs.has(pet_key):
return pet_configs[pet_key]
else:
print("未找到宠物配置: ", pet_key, ",使用默认配置")
return get_default_config()
# 获取所有宠物配置键值的函数
func get_all_pet_keys() -> Array:
"""获取所有可用的宠物配置键值"""
return pet_configs.keys()
# 检查宠物配置是否存在的函数
func has_pet_config(pet_key: String) -> bool:
"""检查指定的宠物配置是否存在"""
return pet_configs.has(pet_key)
# 获取默认配置的函数
func get_default_config() -> Dictionary:
"""获取默认宠物配置"""
return {
"pet_name": pet_name,
"pet_id": pet_id,
"pet_type": pet_type,
"pet_level": pet_level,
"pet_experience": pet_experience,
"pet_temperament": pet_temperament,
"pet_birthday": pet_birthday,
"pet_hobby": pet_hobby,
"pet_introduction": pet_introduction,
"max_health": max_health,
"enable_health_regen": enable_health_regen,
"health_regen": health_regen,
"enable_shield_regen": enable_shield_regen,
"max_shield": max_shield,
"shield_regen": shield_regen,
"max_armor": max_armor,
"base_attack_damage": base_attack_damage,
"crit_rate": crit_rate,
"crit_damage": crit_damage,
"armor_penetration": armor_penetration,
"enable_multi_projectile_skill": enable_multi_projectile_skill,
"multi_projectile_delay": multi_projectile_delay,
"enable_berserker_skill": enable_berserker_skill,
"berserker_bonus": berserker_bonus,
"berserker_duration": berserker_duration,
"enable_self_destruct_skill": enable_self_destruct_skill,
"self_destruct_damage": self_destruct_damage,
"enable_summon_pet_skill": enable_summon_pet_skill,
"summon_count": summon_count,
"summon_scale": summon_scale,
"enable_death_respawn_skill": enable_death_respawn_skill,
"respawn_health_percentage": respawn_health_percentage,
"enable_damage_reflection_skill": enable_damage_reflection_skill,
"damage_reflection_cooldown": damage_reflection_cooldown,
"damage_reflection_percentage": damage_reflection_percentage,
"move_speed": move_speed,
"dodge_rate": dodge_rate,
"element_type": element_type,
"element_damage_bonus": element_damage_bonus,
"left_weapon": left_weapon,
"right_weapon": right_weapon
}
# 字符串转换为ElementType枚举的函数
func string_to_element_type(element_str: String) -> ElementType:
"""将字符串转换为ElementType枚举"""
match element_str.to_upper():
"NONE":#没有元素类型
return ElementType.NONE
"METAL":#金元素
return ElementType.METAL
"WOOD":#木元素
return ElementType.WOOD
"WATER":#水元素
return ElementType.WATER
"FIRE": #火元素
return ElementType.FIRE
"EARTH":#土元素
return ElementType.EARTH
"THUNDER":#雷元素
return ElementType.THUNDER
_:
return ElementType.NONE
# 从JSON文件加载宠物配置的函数
func load_configs_from_json(file_path: String = "res://Scene/NewPet/Pet_data.json") -> bool:
"""从JSON文件加载宠物配置"""
if not FileAccess.file_exists(file_path):
print("宠物配置文件不存在: ", file_path)
return false
var file = FileAccess.open(file_path, FileAccess.READ)
if file == null:
print("无法打开宠物配置文件: ", file_path)
return false
var json_string = file.get_as_text()
file.close()
var json = JSON.new()
var parse_result = json.parse(json_string)
if parse_result != OK:
print("JSON解析失败: ", json.error_string)
return false
var loaded_configs = json.data
if typeof(loaded_configs) != TYPE_DICTIONARY:
print("JSON格式错误期望字典类型")
return false
# 清空现有配置并加载新配置
pet_configs.clear()
# 遍历加载的配置
for pet_key in loaded_configs.keys():
var config = loaded_configs[pet_key]
if typeof(config) != TYPE_DICTIONARY:
print("跳过无效的宠物配置: ", pet_key)
continue
# 处理element_type字符串转换为枚举
if config.has("element_type") and typeof(config["element_type"]) == TYPE_STRING:
config["element_type"] = string_to_element_type(config["element_type"])
# 添加到配置字典
pet_configs[pet_key] = config
print("成功从JSON加载了 ", pet_configs.size(), " 个宠物配置")
return true
# 导出配置到JSON的函数
func export_configs_to_json() -> String:
"""将宠物配置导出为JSON字符串用于保存到MongoDB"""
return JSON.stringify(pet_configs)

View File

@@ -0,0 +1 @@
uid://l31ap5jcuyfl

View File

@@ -0,0 +1,68 @@
[gd_scene load_steps=8 format=3 uid="uid://ba85asiwug57i"]
[ext_resource type="Texture2D" uid="uid://lx0l12qrituk" path="res://assets/宠物图片/一堆小怪.png" id="1_4f76q"]
[ext_resource type="Texture2D" uid="uid://dciakkwnchcga" path="res://assets/我的世界图片/武器工具/木剑.png" id="2_vbyii"]
[sub_resource type="AtlasTexture" id="AtlasTexture_op7i3"]
atlas = ExtResource("1_4f76q")
region = Rect2(72, 48, 24, 24)
[sub_resource type="AtlasTexture" id="AtlasTexture_c36rm"]
atlas = ExtResource("1_4f76q")
region = Rect2(120, 48, 24, 24)
[sub_resource type="AtlasTexture" id="AtlasTexture_mjdfm"]
atlas = ExtResource("1_4f76q")
region = Rect2(72, 48, 24, 24)
[sub_resource type="AtlasTexture" id="AtlasTexture_q454c"]
atlas = ExtResource("1_4f76q")
region = Rect2(96, 48, 24, 24)
[sub_resource type="SpriteFrames" id="SpriteFrames_b73qu"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_op7i3")
}],
"loop": true,
"name": &"idle",
"speed": 5.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_c36rm")
}],
"loop": true,
"name": &"sleep",
"speed": 5.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_mjdfm")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_q454c")
}],
"loop": true,
"name": &"walk",
"speed": 5.0
}]
[node name="PetImage" type="AnimatedSprite2D"]
scale = Vector2(4, 4)
sprite_frames = SubResource("SpriteFrames_b73qu")
animation = &"walk"
autoplay = "walk"
[node name="LeftToolImage" type="Sprite2D" parent="."]
z_index = 5
position = Vector2(-10.5, 3)
texture = ExtResource("2_vbyii")
flip_h = true
[node name="RightToolImage" type="Sprite2D" parent="."]
show_behind_parent = true
position = Vector2(-7.5, -6.25)
texture = ExtResource("2_vbyii")
flip_h = true

View File

@@ -0,0 +1,64 @@
[gd_scene load_steps=8 format=3 uid="uid://bpkq40vvq3cxy"]
[ext_resource type="Texture2D" uid="uid://lx0l12qrituk" path="res://assets/宠物图片/一堆小怪.png" id="1_lxn61"]
[ext_resource type="Texture2D" uid="uid://dciakkwnchcga" path="res://assets/我的世界图片/武器工具/木剑.png" id="2_wrr70"]
[sub_resource type="AtlasTexture" id="AtlasTexture_lgi35"]
atlas = ExtResource("1_lxn61")
region = Rect2(192, 48, 24, 24)
[sub_resource type="AtlasTexture" id="AtlasTexture_wn6km"]
atlas = ExtResource("1_lxn61")
region = Rect2(144, 48, 24, 24)
[sub_resource type="AtlasTexture" id="AtlasTexture_qmpjj"]
atlas = ExtResource("1_lxn61")
region = Rect2(168, 48, 24, 24)
[sub_resource type="AtlasTexture" id="AtlasTexture_1mpkc"]
atlas = ExtResource("1_lxn61")
region = Rect2(192, 48, 24, 24)
[sub_resource type="SpriteFrames" id="SpriteFrames_b73qu"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_lgi35")
}],
"loop": true,
"name": &"idle",
"speed": 5.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_wn6km")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_qmpjj")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_1mpkc")
}],
"loop": true,
"name": &"walk",
"speed": 10.0
}]
[node name="PetImage" type="AnimatedSprite2D"]
scale = Vector2(4, 4)
sprite_frames = SubResource("SpriteFrames_b73qu")
animation = &"walk"
autoplay = "walk"
frame_progress = 0.111287
[node name="LeftToolImage" type="Sprite2D" parent="."]
z_index = 5
position = Vector2(-10.5, 3)
texture = ExtResource("2_wrr70")
flip_h = true
[node name="RightToolImage" type="Sprite2D" parent="."]
show_behind_parent = true
position = Vector2(-7.5, -6.25)
texture = ExtResource("2_wrr70")
flip_h = true

View File

@@ -0,0 +1,103 @@
[gd_scene load_steps=13 format=3 uid="uid://dvkix032ikul3"]
[ext_resource type="Texture2D" uid="uid://b75oytao5cgjo" path="res://assets/宠物图片/绿色史莱姆.png" id="1_m1ura"]
[ext_resource type="Texture2D" uid="uid://dciakkwnchcga" path="res://assets/我的世界图片/武器工具/木剑.png" id="2_58kah"]
[sub_resource type="AtlasTexture" id="AtlasTexture_ou315"]
atlas = ExtResource("1_m1ura")
region = Rect2(0, 24, 24, 24)
[sub_resource type="AtlasTexture" id="AtlasTexture_saxlb"]
atlas = ExtResource("1_m1ura")
region = Rect2(72, 0, 24, 24)
[sub_resource type="AtlasTexture" id="AtlasTexture_bxslx"]
atlas = ExtResource("1_m1ura")
region = Rect2(48, 0, 24, 24)
[sub_resource type="AtlasTexture" id="AtlasTexture_dvhl1"]
atlas = ExtResource("1_m1ura")
region = Rect2(24, 0, 24, 24)
[sub_resource type="AtlasTexture" id="AtlasTexture_0t1ns"]
atlas = ExtResource("1_m1ura")
region = Rect2(0, 0, 24, 24)
[sub_resource type="AtlasTexture" id="AtlasTexture_sbjn0"]
atlas = ExtResource("1_m1ura")
region = Rect2(72, 24, 24, 24)
[sub_resource type="AtlasTexture" id="AtlasTexture_qvnbx"]
atlas = ExtResource("1_m1ura")
region = Rect2(48, 24, 24, 24)
[sub_resource type="AtlasTexture" id="AtlasTexture_n0kjo"]
atlas = ExtResource("1_m1ura")
region = Rect2(24, 24, 24, 24)
[sub_resource type="AtlasTexture" id="AtlasTexture_obu0n"]
atlas = ExtResource("1_m1ura")
region = Rect2(0, 24, 24, 24)
[sub_resource type="SpriteFrames" id="SpriteFrames_yhcbw"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_ou315")
}],
"loop": true,
"name": &"idle",
"speed": 8.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_saxlb")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_bxslx")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_dvhl1")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_0t1ns")
}],
"loop": false,
"name": &"wake",
"speed": 5.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_sbjn0")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_qvnbx")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_n0kjo")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_obu0n")
}],
"loop": true,
"name": &"walk",
"speed": 8.0
}]
[node name="PetImage" type="AnimatedSprite2D"]
scale = Vector2(4, 4)
sprite_frames = SubResource("SpriteFrames_yhcbw")
animation = &"idle"
autoplay = "walk"
[node name="LeftToolImage" type="Sprite2D" parent="."]
z_index = 5
position = Vector2(-10.5, 3)
texture = ExtResource("2_58kah")
flip_h = true
[node name="RightToolImage" type="Sprite2D" parent="."]
show_behind_parent = true
position = Vector2(-7.5, -6.25)
texture = ExtResource("2_58kah")
flip_h = true

View File

@@ -0,0 +1,176 @@
[gd_scene load_steps=24 format=3 uid="uid://dwdoine3llw30"]
[ext_resource type="Texture2D" uid="uid://bal78ts2eq4yu" path="res://assets/宠物图片/护卫.png" id="1_4imwo"]
[ext_resource type="Texture2D" uid="uid://dciakkwnchcga" path="res://assets/我的世界图片/武器工具/木剑.png" id="2_ywvjf"]
[sub_resource type="AtlasTexture" id="AtlasTexture_rjt8u"]
atlas = ExtResource("1_4imwo")
region = Rect2(224, 0, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_81r1q"]
atlas = ExtResource("1_4imwo")
region = Rect2(192, 0, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_nliwy"]
atlas = ExtResource("1_4imwo")
region = Rect2(160, 0, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_kbr5d"]
atlas = ExtResource("1_4imwo")
region = Rect2(128, 0, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_yhrjc"]
atlas = ExtResource("1_4imwo")
region = Rect2(224, 64, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_2dbgw"]
atlas = ExtResource("1_4imwo")
region = Rect2(192, 64, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_h0n46"]
atlas = ExtResource("1_4imwo")
region = Rect2(160, 64, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_1tk7r"]
atlas = ExtResource("1_4imwo")
region = Rect2(128, 64, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_ogy1e"]
atlas = ExtResource("1_4imwo")
region = Rect2(96, 64, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_mygjj"]
atlas = ExtResource("1_4imwo")
region = Rect2(64, 64, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_rkj0j"]
atlas = ExtResource("1_4imwo")
region = Rect2(32, 64, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_j7anc"]
atlas = ExtResource("1_4imwo")
region = Rect2(0, 64, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_cxgnv"]
atlas = ExtResource("1_4imwo")
region = Rect2(224, 96, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_2itrd"]
atlas = ExtResource("1_4imwo")
region = Rect2(192, 96, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_c7ofb"]
atlas = ExtResource("1_4imwo")
region = Rect2(160, 96, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_aa4e4"]
atlas = ExtResource("1_4imwo")
region = Rect2(128, 96, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_jx5oo"]
atlas = ExtResource("1_4imwo")
region = Rect2(96, 96, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_umo24"]
atlas = ExtResource("1_4imwo")
region = Rect2(64, 96, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_853s8"]
atlas = ExtResource("1_4imwo")
region = Rect2(32, 96, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_6x5xm"]
atlas = ExtResource("1_4imwo")
region = Rect2(0, 96, 32, 32)
[sub_resource type="SpriteFrames" id="SpriteFrames_yhcbw"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_rjt8u")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_81r1q")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_nliwy")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_kbr5d")
}],
"loop": true,
"name": &"idle",
"speed": 8.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_yhrjc")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_2dbgw")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_h0n46")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_1tk7r")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_ogy1e")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_mygjj")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_rkj0j")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_j7anc")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_cxgnv")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_2itrd")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_c7ofb")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_aa4e4")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_jx5oo")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_umo24")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_853s8")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_6x5xm")
}],
"loop": true,
"name": &"walk",
"speed": 8.0
}]
[node name="PetImage" type="AnimatedSprite2D"]
scale = Vector2(4, 4)
sprite_frames = SubResource("SpriteFrames_yhcbw")
animation = &"walk"
autoplay = "walk"
frame_progress = 0.272604
[node name="LeftToolImage" type="Sprite2D" parent="."]
z_index = 5
position = Vector2(-10.5, 3)
texture = ExtResource("2_ywvjf")
flip_h = true
[node name="RightToolImage" type="Sprite2D" parent="."]
show_behind_parent = true
position = Vector2(-7.5, -6.25)
texture = ExtResource("2_ywvjf")
flip_h = true

View File

@@ -0,0 +1,104 @@
[gd_scene load_steps=13 format=3 uid="uid://c8siga6au2vqh"]
[ext_resource type="Texture2D" uid="uid://cvpsjlje7q3to" path="res://assets/宠物图片/红色史莱姆.png" id="1_2d2gf"]
[ext_resource type="Texture2D" uid="uid://dciakkwnchcga" path="res://assets/我的世界图片/武器工具/木剑.png" id="2_ni2i3"]
[sub_resource type="AtlasTexture" id="AtlasTexture_s7ip1"]
atlas = ExtResource("1_2d2gf")
region = Rect2(0, 24, 24, 24)
[sub_resource type="AtlasTexture" id="AtlasTexture_ff7pm"]
atlas = ExtResource("1_2d2gf")
region = Rect2(72, 0, 24, 24)
[sub_resource type="AtlasTexture" id="AtlasTexture_53j2r"]
atlas = ExtResource("1_2d2gf")
region = Rect2(48, 0, 24, 24)
[sub_resource type="AtlasTexture" id="AtlasTexture_0ij01"]
atlas = ExtResource("1_2d2gf")
region = Rect2(24, 0, 24, 24)
[sub_resource type="AtlasTexture" id="AtlasTexture_20513"]
atlas = ExtResource("1_2d2gf")
region = Rect2(0, 0, 24, 24)
[sub_resource type="AtlasTexture" id="AtlasTexture_3f8fr"]
atlas = ExtResource("1_2d2gf")
region = Rect2(72, 24, 24, 24)
[sub_resource type="AtlasTexture" id="AtlasTexture_kbexh"]
atlas = ExtResource("1_2d2gf")
region = Rect2(48, 24, 24, 24)
[sub_resource type="AtlasTexture" id="AtlasTexture_njkpw"]
atlas = ExtResource("1_2d2gf")
region = Rect2(24, 24, 24, 24)
[sub_resource type="AtlasTexture" id="AtlasTexture_xbspe"]
atlas = ExtResource("1_2d2gf")
region = Rect2(0, 24, 24, 24)
[sub_resource type="SpriteFrames" id="SpriteFrames_yhcbw"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_s7ip1")
}],
"loop": true,
"name": &"idle",
"speed": 8.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_ff7pm")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_53j2r")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_0ij01")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_20513")
}],
"loop": false,
"name": &"wake",
"speed": 5.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_3f8fr")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_kbexh")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_njkpw")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_xbspe")
}],
"loop": true,
"name": &"walk",
"speed": 8.0
}]
[node name="PetImage" type="AnimatedSprite2D"]
scale = Vector2(4, 4)
sprite_frames = SubResource("SpriteFrames_yhcbw")
animation = &"walk"
autoplay = "walk"
frame_progress = 0.528863
[node name="LeftToolImage" type="Sprite2D" parent="."]
z_index = 5
position = Vector2(-10.5, 3)
texture = ExtResource("2_ni2i3")
flip_h = true
[node name="RightToolImage" type="Sprite2D" parent="."]
show_behind_parent = true
position = Vector2(-7.5, -6.25)
texture = ExtResource("2_ni2i3")
flip_h = true

View File

@@ -0,0 +1,64 @@
[gd_scene load_steps=7 format=3 uid="uid://bk5di5uq6bo04"]
[ext_resource type="Texture2D" uid="uid://lx0l12qrituk" path="res://assets/宠物图片/一堆小怪.png" id="1_rph6q"]
[ext_resource type="Texture2D" uid="uid://dciakkwnchcga" path="res://assets/我的世界图片/武器工具/木剑.png" id="2_bks4n"]
[sub_resource type="AtlasTexture" id="AtlasTexture_nswws"]
atlas = ExtResource("1_rph6q")
region = Rect2(0, 48, 24, 24)
[sub_resource type="AtlasTexture" id="AtlasTexture_mjdfm"]
atlas = ExtResource("1_rph6q")
region = Rect2(48, 48, 24, 24)
[sub_resource type="AtlasTexture" id="AtlasTexture_1eo38"]
atlas = ExtResource("1_rph6q")
region = Rect2(24, 48, 24, 24)
[sub_resource type="SpriteFrames" id="SpriteFrames_b73qu"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_nswws")
}],
"loop": true,
"name": &"idle",
"speed": 5.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_mjdfm")
}],
"loop": true,
"name": &"sleep",
"speed": 5.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_nswws")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_1eo38")
}],
"loop": true,
"name": &"walk",
"speed": 5.0
}]
[node name="PetImage" type="AnimatedSprite2D"]
scale = Vector2(4, 4)
sprite_frames = SubResource("SpriteFrames_b73qu")
animation = &"walk"
autoplay = "walk"
[node name="LeftToolImage" type="Sprite2D" parent="."]
z_index = 5
position = Vector2(-10.5, 3)
texture = ExtResource("2_bks4n")
flip_h = true
[node name="RightToolImage" type="Sprite2D" parent="."]
show_behind_parent = true
position = Vector2(-7.5, -6.25)
texture = ExtResource("2_bks4n")
flip_h = true

View File

@@ -0,0 +1,52 @@
[gd_scene load_steps=6 format=3 uid="uid://d1sj6wl3mfpo3"]
[ext_resource type="Texture2D" uid="uid://lx0l12qrituk" path="res://assets/宠物图片/一堆小怪.png" id="1_6fty5"]
[ext_resource type="Texture2D" uid="uid://dciakkwnchcga" path="res://assets/我的世界图片/武器工具/木剑.png" id="2_4lqxb"]
[sub_resource type="AtlasTexture" id="AtlasTexture_stamd"]
atlas = ExtResource("1_6fty5")
region = Rect2(48, 0, 24, 24)
[sub_resource type="AtlasTexture" id="AtlasTexture_v0b4v"]
atlas = ExtResource("1_6fty5")
region = Rect2(72, 0, 24, 24)
[sub_resource type="SpriteFrames" id="SpriteFrames_b2ss3"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_stamd")
}],
"loop": true,
"name": &"idle",
"speed": 8.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_stamd")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_v0b4v")
}],
"loop": true,
"name": &"walk",
"speed": 8.0
}]
[node name="PetImage" type="AnimatedSprite2D"]
scale = Vector2(4, 4)
sprite_frames = SubResource("SpriteFrames_b2ss3")
animation = &"walk"
autoplay = "walk"
[node name="LeftToolImage" type="Sprite2D" parent="."]
z_index = 5
position = Vector2(-10.5, 3)
texture = ExtResource("2_4lqxb")
flip_h = true
[node name="RightToolImage" type="Sprite2D" parent="."]
show_behind_parent = true
position = Vector2(-7.5, -6.25)
texture = ExtResource("2_4lqxb")
flip_h = true

View File

@@ -0,0 +1,64 @@
[gd_scene load_steps=7 format=3 uid="uid://dkvo63yforem7"]
[ext_resource type="Texture2D" uid="uid://lx0l12qrituk" path="res://assets/宠物图片/一堆小怪.png" id="1_x37sh"]
[ext_resource type="Texture2D" uid="uid://dciakkwnchcga" path="res://assets/我的世界图片/武器工具/木剑.png" id="2_w6fwq"]
[sub_resource type="AtlasTexture" id="AtlasTexture_j2fq3"]
atlas = ExtResource("1_x37sh")
region = Rect2(144, 24, 24, 24)
[sub_resource type="AtlasTexture" id="AtlasTexture_6q1oc"]
atlas = ExtResource("1_x37sh")
region = Rect2(192, 24, 24, 24)
[sub_resource type="AtlasTexture" id="AtlasTexture_xvdwk"]
atlas = ExtResource("1_x37sh")
region = Rect2(168, 24, 24, 24)
[sub_resource type="SpriteFrames" id="SpriteFrames_6q1oc"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_j2fq3")
}],
"loop": true,
"name": &"idle",
"speed": 8.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_6q1oc")
}],
"loop": true,
"name": &"sleep",
"speed": 8.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_j2fq3")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_xvdwk")
}],
"loop": true,
"name": &"walk",
"speed": 8.0
}]
[node name="PetImage" type="AnimatedSprite2D"]
scale = Vector2(4, 4)
sprite_frames = SubResource("SpriteFrames_6q1oc")
animation = &"walk"
autoplay = "walk"
[node name="LeftToolImage" type="Sprite2D" parent="."]
z_index = 5
position = Vector2(-10.5, 3)
texture = ExtResource("2_w6fwq")
flip_h = true
[node name="RightToolImage" type="Sprite2D" parent="."]
show_behind_parent = true
position = Vector2(-7.5, -6.25)
texture = ExtResource("2_w6fwq")
flip_h = true

View File

@@ -0,0 +1,56 @@
[gd_scene load_steps=7 format=3 uid="uid://bpsoc04xlvhqa"]
[ext_resource type="Texture2D" uid="uid://lx0l12qrituk" path="res://assets/宠物图片/一堆小怪.png" id="1_i7yg5"]
[ext_resource type="Texture2D" uid="uid://dciakkwnchcga" path="res://assets/我的世界图片/武器工具/木剑.png" id="2_wo7be"]
[sub_resource type="AtlasTexture" id="AtlasTexture_5gxwu"]
atlas = ExtResource("1_i7yg5")
region = Rect2(0, 0, 24, 24)
[sub_resource type="AtlasTexture" id="AtlasTexture_pxsqn"]
atlas = ExtResource("1_i7yg5")
region = Rect2(0, 0, 24, 24)
[sub_resource type="AtlasTexture" id="AtlasTexture_xxlll"]
atlas = ExtResource("1_i7yg5")
region = Rect2(24, 0, 24, 24)
[sub_resource type="SpriteFrames" id="SpriteFrames_k25pl"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_5gxwu")
}],
"loop": true,
"name": &"idle",
"speed": 8.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_pxsqn")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_xxlll")
}],
"loop": true,
"name": &"walk",
"speed": 8.0
}]
[node name="PetImage" type="AnimatedSprite2D"]
scale = Vector2(4, 4)
sprite_frames = SubResource("SpriteFrames_k25pl")
animation = &"idle"
autoplay = "walk"
[node name="LeftToolImage" type="Sprite2D" parent="."]
z_index = 5
position = Vector2(-10.5, 3)
texture = ExtResource("2_wo7be")
flip_h = true
[node name="RightToolImage" type="Sprite2D" parent="."]
show_behind_parent = true
position = Vector2(-7.5, -6.25)
texture = ExtResource("2_wo7be")
flip_h = true

View File

@@ -0,0 +1,52 @@
[gd_scene load_steps=6 format=3 uid="uid://bk7wkksxa7150"]
[ext_resource type="Texture2D" uid="uid://lx0l12qrituk" path="res://assets/宠物图片/一堆小怪.png" id="1_4x5tv"]
[ext_resource type="Texture2D" uid="uid://dciakkwnchcga" path="res://assets/我的世界图片/武器工具/木剑.png" id="2_iom1h"]
[sub_resource type="AtlasTexture" id="AtlasTexture_tdtxh"]
atlas = ExtResource("1_4x5tv")
region = Rect2(0, 24, 24, 24)
[sub_resource type="AtlasTexture" id="AtlasTexture_5rxf3"]
atlas = ExtResource("1_4x5tv")
region = Rect2(24, 24, 24, 24)
[sub_resource type="SpriteFrames" id="SpriteFrames_ujsmd"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_tdtxh")
}],
"loop": true,
"name": &"idle",
"speed": 8.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_tdtxh")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_5rxf3")
}],
"loop": true,
"name": &"walk",
"speed": 8.0
}]
[node name="PetImage" type="AnimatedSprite2D"]
scale = Vector2(4, 4)
sprite_frames = SubResource("SpriteFrames_ujsmd")
animation = &"walk"
autoplay = "walk"
[node name="LeftToolImage" type="Sprite2D" parent="."]
z_index = 5
position = Vector2(-10.5, 3)
texture = ExtResource("2_iom1h")
flip_h = true
[node name="RightToolImage" type="Sprite2D" parent="."]
show_behind_parent = true
position = Vector2(-7.5, -6.25)
texture = ExtResource("2_iom1h")
flip_h = true

View File

@@ -0,0 +1,56 @@
[gd_scene load_steps=7 format=3 uid="uid://cxj61dijvapdt"]
[ext_resource type="Texture2D" uid="uid://lx0l12qrituk" path="res://assets/宠物图片/一堆小怪.png" id="1_wkxhn"]
[ext_resource type="Texture2D" uid="uid://dciakkwnchcga" path="res://assets/我的世界图片/武器工具/木剑.png" id="2_xic1v"]
[sub_resource type="AtlasTexture" id="AtlasTexture_cxnqb"]
atlas = ExtResource("1_wkxhn")
region = Rect2(96, 0, 24, 24)
[sub_resource type="AtlasTexture" id="AtlasTexture_auciw"]
atlas = ExtResource("1_wkxhn")
region = Rect2(96, 0, 24, 24)
[sub_resource type="AtlasTexture" id="AtlasTexture_nrp4g"]
atlas = ExtResource("1_wkxhn")
region = Rect2(120, 0, 24, 24)
[sub_resource type="SpriteFrames" id="SpriteFrames_b2ss3"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_cxnqb")
}],
"loop": true,
"name": &"idle",
"speed": 8.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_auciw")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_nrp4g")
}],
"loop": true,
"name": &"walk",
"speed": 8.0
}]
[node name="PetImage" type="AnimatedSprite2D"]
scale = Vector2(4, 4)
sprite_frames = SubResource("SpriteFrames_b2ss3")
animation = &"idle"
autoplay = "walk"
[node name="LeftToolImage" type="Sprite2D" parent="."]
z_index = 5
position = Vector2(-10.5, 3)
texture = ExtResource("2_xic1v")
flip_h = true
[node name="RightToolImage" type="Sprite2D" parent="."]
show_behind_parent = true
position = Vector2(-7.5, -6.25)
texture = ExtResource("2_xic1v")
flip_h = true

View File

@@ -0,0 +1,52 @@
[gd_scene load_steps=6 format=3 uid="uid://is5klrhiktg4"]
[ext_resource type="Texture2D" uid="uid://lx0l12qrituk" path="res://assets/宠物图片/一堆小怪.png" id="1_qrx6w"]
[ext_resource type="Texture2D" uid="uid://dciakkwnchcga" path="res://assets/我的世界图片/武器工具/木剑.png" id="2_dkex0"]
[sub_resource type="AtlasTexture" id="AtlasTexture_trhvc"]
atlas = ExtResource("1_qrx6w")
region = Rect2(144, 0, 24, 24)
[sub_resource type="AtlasTexture" id="AtlasTexture_k5jn7"]
atlas = ExtResource("1_qrx6w")
region = Rect2(168, 0, 24, 24)
[sub_resource type="SpriteFrames" id="SpriteFrames_yhcbw"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_trhvc")
}],
"loop": true,
"name": &"idle",
"speed": 5.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_trhvc")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_k5jn7")
}],
"loop": true,
"name": &"walk",
"speed": 8.0
}]
[node name="PetImage" type="AnimatedSprite2D"]
scale = Vector2(4, 4)
sprite_frames = SubResource("SpriteFrames_yhcbw")
animation = &"walk"
autoplay = "walk"
[node name="LeftToolImage" type="Sprite2D" parent="."]
z_index = 5
position = Vector2(-10.5, 3)
texture = ExtResource("2_dkex0")
flip_h = true
[node name="RightToolImage" type="Sprite2D" parent="."]
show_behind_parent = true
position = Vector2(-7.5, -6.25)
texture = ExtResource("2_dkex0")
flip_h = true

View File

@@ -0,0 +1,81 @@
{
"宠物仓库":{
"烈焰鸟": {
"pet_name": "树萌芽の烈焰鸟",
"pet_image":"res://Scene/NewPet/PetType/flying_bird.tscn",
"pet_id": "wea1212w12",
"pet_type": "烈焰鸟",
"pet_level": 1,
"pet_experience": 500,
"pet_temperament": "勇猛",
"pet_birthday": "2025-07-25",
"pet_hobby": "喜欢战斗和烈火",
"pet_introduction": "我爱吃虫子",
"max_health": 300.0,
"enable_health_regen": true,
"health_regen": 2.0,
"enable_shield_regen": true,
"max_shield": 150.0,
"shield_regen": 1.5,
"max_armor": 120.0,
"base_attack_damage": 40.0,
"crit_rate": 0.15,
"crit_damage": 2.0,
"armor_penetration": 10.0,
"enable_multi_projectile_skill": true,
"multi_projectile_delay": 2.0,
"enable_berserker_skill": true,
"berserker_bonus": 1.8,
"berserker_duration": 6.0,
"enable_self_destruct_skill": false,
"enable_summon_pet_skill": false,
"enable_death_respawn_skill": true,
"respawn_health_percentage": 0.4,
"move_speed": 180.0,
"dodge_rate": 0.08,
"element_type": "FIRE",
"element_damage_bonus": 75.0,
"left_weapon": "钻石剑",
"right_weapon": "钻石剑"
},
"大蓝虫": {
"pet_name": "树萌芽の大蓝虫",
"pet_image":"res://Scene/NewPet/PetType/big_beetle.tscn",
"pet_id": "dlc123123",
"pet_type": "大甲壳虫",
"pet_level": 8,
"pet_experience": 320,
"pet_temperament": "冷静",
"pet_birthday": "2023-06-20",
"pet_hobby": "喜欢和小甲壳虫玩",
"pet_introduction": "我是大蓝虫,不是大懒虫!",
"max_health": 180.0,
"enable_health_regen": true,
"health_regen": 1.2,
"enable_shield_regen": true,
"max_shield": 200.0,
"shield_regen": 2.5,
"max_armor": 80.0,
"base_attack_damage": 35.0,
"crit_rate": 0.12,
"crit_damage": 1.8,
"armor_penetration": 15.0,
"enable_multi_projectile_skill": true,
"multi_projectile_delay": 1.5,
"enable_berserker_skill": false,
"enable_self_destruct_skill": false,
"enable_summon_pet_skill": true,
"summon_count": 2,
"summon_scale": 0.15,
"enable_death_respawn_skill": false,
"move_speed": 120.0,
"dodge_rate": 0.12,
"element_type": "WATER",
"element_damage_bonus": 100.0,
"left_weapon": "钻石剑",
"right_weapon": "钻石剑"
}
},
"巡逻宠物":["wea1212w12"],
"出战宠物":["dlc123123"]
}

View File

@@ -0,0 +1,165 @@
{
"_id": {
"$oid": "687cf59b8e77ba00a7414bab"
},
"updated_at": {
"$date": "2025-07-20T22:13:38.521Z"
},
"烈焰鸟": {
"pet_name": "树萌芽の烈焰鸟",
"can_purchase": true,
"cost": 1000,
"pet_image": "res://Scene/NewPet/PetType/flying_bird.tscn",
"pet_id": "0001",
"pet_type": "烈焰鸟",
"pet_level": 1,
"pet_experience": 500,
"pet_temperament": "勇猛",
"pet_birthday": "2023-03-15",
"pet_hobby": "喜欢战斗和烈火",
"pet_introduction": "我爱吃虫子",
"max_health": 300,
"enable_health_regen": true,
"health_regen": 2,
"enable_shield_regen": true,
"max_shield": 150,
"shield_regen": 1.5,
"max_armor": 120,
"base_attack_damage": 40,
"crit_rate": 0.15,
"crit_damage": 2,
"armor_penetration": 10,
"enable_multi_projectile_skill": true,
"multi_projectile_delay": 2,
"enable_berserker_skill": true,
"berserker_bonus": 1.8,
"berserker_duration": 6,
"enable_self_destruct_skill": false,
"enable_summon_pet_skill": false,
"enable_death_respawn_skill": true,
"respawn_health_percentage": 0.4,
"move_speed": 180,
"dodge_rate": 0.08,
"element_type": "FIRE",
"element_damage_bonus": 75,
"left_weapon": "钻石剑",
"right_weapon": "钻石剑"
},
"大蓝虫": {
"pet_name": "树萌芽の大蓝虫",
"can_purchase": true,
"cost": 1000,
"pet_image": "res://Scene/NewPet/PetType/big_beetle.tscn",
"pet_id": "0002",
"pet_type": "大蓝虫",
"pet_level": 8,
"pet_experience": 320,
"pet_temperament": "冷静",
"pet_birthday": "2023-06-20",
"pet_hobby": "喜欢和小甲壳虫玩",
"pet_introduction": "我是大蓝虫,不是大懒虫!",
"max_health": 180,
"enable_health_regen": true,
"health_regen": 1.2,
"enable_shield_regen": true,
"max_shield": 200,
"shield_regen": 2.5,
"max_armor": 80,
"base_attack_damage": 35,
"crit_rate": 0.12,
"crit_damage": 1.8,
"armor_penetration": 15,
"enable_multi_projectile_skill": true,
"multi_projectile_delay": 1.5,
"enable_berserker_skill": false,
"enable_self_destruct_skill": false,
"enable_summon_pet_skill": true,
"summon_count": 2,
"summon_scale": 0.15,
"enable_death_respawn_skill": false,
"move_speed": 120,
"dodge_rate": 0.12,
"element_type": "WATER",
"element_damage_bonus": 100,
"left_weapon": "钻石剑",
"right_weapon": "钻石剑"
},
"小蓝虫": {
"pet_name": "树萌芽の小蓝虫",
"can_purchase": true,
"cost": 1000,
"pet_image": "res://Scene/NewPet/PetType/small_beetle.tscn",
"pet_id": "0002",
"pet_type": "小蓝虫",
"pet_level": 1,
"pet_experience": 0,
"pet_temperament": "冷静",
"pet_birthday": "2023-06-20",
"pet_hobby": "喜欢和大蓝虫玩",
"pet_introduction": "我是小蓝虫,不是小懒虫!",
"max_health": 90,
"enable_health_regen": true,
"health_regen": 1.2,
"enable_shield_regen": true,
"max_shield": 200,
"shield_regen": 2.5,
"max_armor": 80,
"base_attack_damage": 35,
"crit_rate": 0.12,
"crit_damage": 1.8,
"armor_penetration": 15,
"enable_multi_projectile_skill": true,
"multi_projectile_delay": 1.5,
"enable_berserker_skill": false,
"enable_self_destruct_skill": false,
"enable_summon_pet_skill": true,
"summon_count": 2,
"summon_scale": 0.15,
"enable_death_respawn_skill": false,
"move_speed": 120,
"dodge_rate": 0.12,
"element_type": "WATER",
"element_damage_bonus": 100,
"left_weapon": "钻石剑",
"right_weapon": "钻石剑"
},
"小蓝": {
"pet_name": "树萌芽の小蓝",
"can_purchase": true,
"cost": 1000,
"pet_image": "res://Scene/NewPet/PetType/small_blue.tscn",
"pet_id": "0002",
"pet_type": "小蓝",
"pet_level": 1,
"pet_experience": 0,
"pet_temperament": "冷静",
"pet_birthday": "2023-06-20",
"pet_hobby": "喜欢和小黄一起玩",
"pet_introduction": "我是小黄!",
"max_health": 120,
"enable_health_regen": true,
"health_regen": 1.2,
"enable_shield_regen": true,
"max_shield": 200,
"shield_regen": 2.5,
"max_armor": 80,
"base_attack_damage": 35,
"crit_rate": 0.12,
"crit_damage": 1.8,
"armor_penetration": 15,
"enable_multi_projectile_skill": true,
"multi_projectile_delay": 1.5,
"enable_berserker_skill": false,
"enable_self_destruct_skill": false,
"enable_summon_pet_skill": true,
"summon_count": 2,
"summon_scale": 0.15,
"enable_death_respawn_skill": false,
"move_speed": 120,
"dodge_rate": 0.12,
"element_type": "WATER",
"element_damage_bonus": 100,
"left_weapon": "钻石剑",
"right_weapon": "钻石剑"
}
}

View File

@@ -0,0 +1,128 @@
extends Node
class_name WeaponBase
#武器系统
var weapon_data = {
"钻石剑": {
"icon": 'res://assets/我的世界图片/武器工具/钻石剑.png',
"function": "apply_diamond_sword_effect"
},
"铁剑": {
"icon": 'res://assets/我的世界图片/武器工具/铁剑.png',
"function": "apply_iron_sword_effect"
},
"钻石斧": {
"icon": 'res://assets/我的世界图片/武器工具/钻石斧.png',
"function": "apply_diamond_axe_effect"
},
"铁镐": {
"icon": 'res://assets/我的世界图片/武器工具/铁镐.png',
"function": "apply_iron_pickaxe_effect"
}
}
# 武器效果函数 - 每种武器单独一个函数
#================钻石剑效果========================
# 钻石剑效果
func apply_diamond_sword_effect(pet):
pet.base_attack_damage += 15.0
pet.crit_rate += 0.1
pet.attack_speed += 0.2
# 钻石剑效果已应用
# 移除钻石剑效果
func remove_diamond_sword_effect(pet):
pet.base_attack_damage -= 15.0
pet.crit_rate -= 0.1
pet.attack_speed -= 0.2
# 钻石剑效果已移除
#================钻石剑效果========================
#================铁剑效果========================
# 铁剑效果
func apply_iron_sword_effect(pet):
pet.base_attack_damage += 10.0
pet.crit_rate += 0.05
pet.attack_speed += 0.1
# 铁剑效果已应用
# 移除铁剑效果
func remove_iron_sword_effect(pet):
pet.base_attack_damage -= 10.0
pet.crit_rate -= 0.05
pet.attack_speed -= 0.1
# 铁剑效果已移除
#================铁剑效果========================
#================钻石斧效果========================
# 钻石斧效果
func apply_diamond_axe_effect(pet):
pet.base_attack_damage += 20.0
pet.armor_penetration += 0.2
pet.knockback_force += 100.0
# 钻石斧效果已应用
# 移除钻石斧效果
func remove_diamond_axe_effect(pet):
pet.base_attack_damage -= 20.0
pet.armor_penetration -= 0.2
pet.knockback_force -= 100.0
# 钻石斧效果已移除
#================钻石斧效果========================
#================铁镐效果========================
# 铁镐效果
func apply_iron_pickaxe_effect(pet):
pet.base_attack_damage += 8.0
pet.armor_penetration += 0.3
pet.attack_range += 20.0
# 铁镐效果已应用
# 移除铁镐效果
func remove_iron_pickaxe_effect(pet):
pet.base_attack_damage -= 8.0
pet.armor_penetration -= 0.3
pet.attack_range -= 20.0
# 铁镐效果已移除
#================铁镐效果========================
#======================武器系统通用函数==========================
# 应用武器效果的主函数
func apply_weapon_effect(pet, weapon_name: String):
if not weapon_data.has(weapon_name):
return
var weapon = weapon_data[weapon_name]
var function_name = weapon.get("function", "")
if function_name != "":
call(function_name, pet)
# 移除武器效果的函数
func remove_weapon_effect(pet, weapon_name: String):
if not weapon_data.has(weapon_name):
return
var weapon = weapon_data[weapon_name]
var function_name = weapon.get("function", "")
if function_name != "":
# 将apply替换为remove来调用移除函数
var remove_function_name = function_name.replace("apply_", "remove_")
call(remove_function_name, pet)
# 获取武器图标路径
func get_weapon_icon(weapon_name: String) -> String:
if weapon_data.has(weapon_name):
return weapon_data[weapon_name].get("icon", "")
return ""
# 获取所有武器名称列表
func get_all_weapon_names() -> Array:
return weapon_data.keys()
#======================武器系统通用函数==========================

View File

@@ -0,0 +1 @@
uid://bpa6hp1mm6sj1

View File

@@ -0,0 +1,28 @@
[gd_scene load_steps=2 format=3 uid="uid://3cr6q4he2y0x"]
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_jiccn"]
lifetime_randomness = 0.6
particle_flag_disable_z = true
emission_shape = 3
emission_box_extents = Vector3(1000, 1, 1)
direction = Vector3(0, 1, 0)
spread = 0.0
initial_velocity_min = 100.0
initial_velocity_max = 400.0
gravity = Vector3(0, 98, 0)
scale_min = 4.0
scale_max = 6.0
color = Color(0, 0.380392, 1, 1)
turbulence_influence_min = 0.02
turbulence_influence_max = 0.08
[node name="Rain" type="GPUParticles2D"]
visible = false
z_index = 10
amount = 450
lifetime = 10.0
preprocess = 20.0
speed_scale = 1.5
visibility_rect = Rect2(-900, 0, 2000, 2000)
trail_lifetime = 0.01
process_material = SubResource("ParticleProcessMaterial_jiccn")

View File

@@ -0,0 +1,39 @@
[gd_scene load_steps=7 format=3 uid="uid://dx7rtwu53mgxh"]
[ext_resource type="Texture2D" uid="uid://dk4yl4ghmxaa2" path="res://assets/天气系统图片/雪花.webp" id="1_yj638"]
[sub_resource type="Curve" id="Curve_4ka7t"]
_data = [Vector2(0, 0.951807), 0.0, 0.0, 0, 0, Vector2(1e-05, 0.963855), 0.0, 0.0, 0, 0, Vector2(0.0153846, 1), 0.0, 0.0, 0, 0, Vector2(0.0461538, 1), 0.0, 0.0, 0, 0, Vector2(0.561538, 0.819277), 0.0, 0.0, 0, 0, Vector2(1, 0), 0.0, 0.0, 0, 0]
point_count = 6
[sub_resource type="CurveTexture" id="CurveTexture_nf3jg"]
curve = SubResource("Curve_4ka7t")
[sub_resource type="Gradient" id="Gradient_adtqp"]
offsets = PackedFloat32Array(0.52, 0.697143)
colors = PackedColorArray(1, 1, 1, 0.352941, 1, 1, 1, 1)
[sub_resource type="GradientTexture1D" id="GradientTexture1D_5dq3w"]
gradient = SubResource("Gradient_adtqp")
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_4ka7t"]
particle_flag_disable_z = true
emission_shape = 3
emission_box_extents = Vector3(1000, 1, 1)
gravity = Vector3(45, 98, 0)
scale_min = 0.4
scale_max = 0.8
color_initial_ramp = SubResource("GradientTexture1D_5dq3w")
alpha_curve = SubResource("CurveTexture_nf3jg")
turbulence_enabled = true
turbulence_influence_min = 0.02
turbulence_influence_max = 0.08
[node name="Snow" type="GPUParticles2D"]
visible = false
amount = 300
texture = ExtResource("1_yj638")
lifetime = 18.0
preprocess = 30.0
visibility_rect = Rect2(-900, 0, 2300, 2000)
process_material = SubResource("ParticleProcessMaterial_4ka7t")

View File

@@ -0,0 +1,25 @@
[gd_scene load_steps=3 format=3 uid="uid://cvg38nsrm77jy"]
[ext_resource type="Texture2D" uid="uid://bnv6wb0k443fv" path="res://assets/天气系统图片/柳叶2.webp" id="1_tq8cs"]
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_tdq2s"]
particle_flag_disable_z = true
emission_shape = 3
emission_box_extents = Vector3(1000, 1, 1)
gravity = Vector3(-30, 80, 0)
scale_min = 0.4
scale_max = 0.5
turbulence_enabled = true
turbulence_noise_speed = Vector3(10, 0, 0)
turbulence_influence_min = 0.02
turbulence_influence_max = 0.07
[node name="WillowLeafRain1" type="GPUParticles2D"]
self_modulate = Color(0.7, 0.7, 0.7, 1)
z_index = 10
amount = 50
texture = ExtResource("1_tq8cs")
lifetime = 20.0
preprocess = 10.0
visibility_rect = Rect2(-900, 0, 2300, 2000)
process_material = SubResource("ParticleProcessMaterial_tdq2s")

View File

@@ -0,0 +1,477 @@
extends Panel
# 游戏常量
const GRID_SIZE = 4
const CELL_SIZE = 90
const CELL_MARGIN = 10
const SWIPE_THRESHOLD = 50
const DATA_FILE_PATH = "user://playergamedata.json"
# 数字颜色配置
const NUMBER_COLORS = {
0: Color.TRANSPARENT,
2: Color(0.93, 0.89, 0.85),
4: Color(0.93, 0.88, 0.78),
8: Color(0.95, 0.69, 0.47),
16: Color(0.96, 0.58, 0.39),
32: Color(0.96, 0.49, 0.37),
64: Color(0.96, 0.37, 0.23),
128: Color(0.93, 0.81, 0.45),
256: Color(0.93, 0.80, 0.38),
512: Color(0.93, 0.78, 0.31),
1024: Color(0.93, 0.77, 0.25),
2048: Color(0.93, 0.76, 0.18),
4096: Color(0.93, 0.70, 0.15),
8192: Color(0.93, 0.65, 0.12),
16384: Color(0.93, 0.60, 0.10),
32768: Color(0.93, 0.55, 0.08)
}
const TEXT_COLORS = {
2: Color.BLACK,
4: Color.BLACK,
8: Color.WHITE,
16: Color.WHITE,
32: Color.WHITE,
64: Color.WHITE,
128: Color.WHITE,
256: Color.WHITE,
512: Color.WHITE,
1024: Color.WHITE,
2048: Color.WHITE,
4096: Color.WHITE,
8192: Color.WHITE,
16384: Color.WHITE,
32768: Color.WHITE
}
# 游戏变量
var grid = []
var score = 0
var best_score = 0
var game_over = false
var won = false
var can_continue = true
var highest_tile = 0
var games_played = 0
var total_moves = 0
var player_data = {}
# 触摸控制变量
var touch_start_pos = Vector2.ZERO
var is_touching = false
# 节点引用
@onready var game_board = $GameBoard
@onready var score_label = $ScoreLabel
@onready var best_label = $BestLabel
@onready var game_over_label = $GameOverLabel
@onready var win_label = $WinLabel
@onready var stats_label = $StatsLabel
func _ready():
# 设置游戏板样式
game_board.modulate = Color(0.7, 0.6, 0.5)
# 加载玩家数据
load_player_data()
# 初始化游戏
init_game()
func init_game():
# 重置游戏状态
game_over = false
won = false
can_continue = true
score = 0
games_played += 1
# 初始化网格
grid.clear()
for y in range(GRID_SIZE):
var row = []
for x in range(GRID_SIZE):
row.append(0)
grid.append(row)
# 添加两个初始数字
add_random_number()
add_random_number()
# 更新UI
update_ui()
hide_labels()
queue_redraw()
func _input(event):
# 键盘输入
if event is InputEventKey and event.pressed:
if game_over:
if event.keycode == KEY_R:
init_game()
return
if won and not can_continue:
if event.keycode == KEY_C:
can_continue = true
win_label.visible = false
return
# 移动控制
var moved = false
match event.keycode:
KEY_UP, KEY_W:
moved = move_up()
KEY_DOWN, KEY_S:
moved = move_down()
KEY_LEFT, KEY_A:
moved = move_left()
KEY_RIGHT, KEY_D:
moved = move_right()
KEY_R:
init_game()
return
if moved:
handle_successful_move()
# 触摸输入
elif event is InputEventScreenTouch:
if event.pressed:
touch_start_pos = event.position
is_touching = true
else:
if is_touching:
handle_swipe(event.position)
is_touching = false
# 鼠标输入(用于桌面测试)
elif event is InputEventMouseButton:
if event.button_index == MOUSE_BUTTON_LEFT:
if event.pressed:
touch_start_pos = event.position
is_touching = true
else:
if is_touching:
handle_swipe(event.position)
is_touching = false
func move_left() -> bool:
var moved = false
for y in range(GRID_SIZE):
var row = grid[y].duplicate()
var new_row = merge_line(row)
if new_row != grid[y]:
moved = true
grid[y] = new_row
return moved
func move_right() -> bool:
var moved = false
for y in range(GRID_SIZE):
var row = grid[y].duplicate()
row.reverse()
var new_row = merge_line(row)
new_row.reverse()
if new_row != grid[y]:
moved = true
grid[y] = new_row
return moved
func move_up() -> bool:
var moved = false
for x in range(GRID_SIZE):
var column = []
for y in range(GRID_SIZE):
column.append(grid[y][x])
var new_column = merge_line(column)
var changed = false
for y in range(GRID_SIZE):
if grid[y][x] != new_column[y]:
changed = true
grid[y][x] = new_column[y]
if changed:
moved = true
return moved
func move_down() -> bool:
var moved = false
for x in range(GRID_SIZE):
var column = []
for y in range(GRID_SIZE):
column.append(grid[y][x])
column.reverse()
var new_column = merge_line(column)
new_column.reverse()
var changed = false
for y in range(GRID_SIZE):
if grid[y][x] != new_column[y]:
changed = true
grid[y][x] = new_column[y]
if changed:
moved = true
return moved
func merge_line(line: Array) -> Array:
# 移除零
var filtered = []
for num in line:
if num != 0:
filtered.append(num)
# 合并相同数字
var merged = []
var i = 0
while i < filtered.size():
if i < filtered.size() - 1 and filtered[i] == filtered[i + 1]:
# 合并
var new_value = filtered[i] * 2
merged.append(new_value)
score += new_value
i += 2
else:
merged.append(filtered[i])
i += 1
# 填充零到指定长度
while merged.size() < GRID_SIZE:
merged.append(0)
return merged
func add_random_number():
var empty_cells = []
for y in range(GRID_SIZE):
for x in range(GRID_SIZE):
if grid[y][x] == 0:
empty_cells.append(Vector2(x, y))
if empty_cells.size() > 0:
var random_cell = empty_cells[randi() % empty_cells.size()]
var value = 2 if randf() < 0.9 else 4
grid[random_cell.y][random_cell.x] = value
func handle_successful_move():
total_moves += 1
add_random_number()
update_ui()
check_game_state()
save_player_data()
queue_redraw()
func handle_swipe(end_pos: Vector2):
if game_over or (won and not can_continue):
return
var delta = end_pos - touch_start_pos
var moved = false
if abs(delta.x) > SWIPE_THRESHOLD or abs(delta.y) > SWIPE_THRESHOLD:
if abs(delta.x) > abs(delta.y):
# 水平滑动
if delta.x > 0:
moved = move_right()
else:
moved = move_left()
else:
# 垂直滑动
if delta.y > 0:
moved = move_down()
else:
moved = move_up()
if moved:
handle_successful_move()
func check_game_state():
# 更新最高数字
for y in range(GRID_SIZE):
for x in range(GRID_SIZE):
if grid[y][x] > highest_tile:
highest_tile = grid[y][x]
# 检查是否达到2048或更高目标
if not won:
for y in range(GRID_SIZE):
for x in range(GRID_SIZE):
if grid[y][x] == 2048:
won = true
can_continue = false
win_label.text = "恭喜达到2048\n按C继续挑战更高目标"
win_label.visible = true
return
# 检查是否游戏结束
if not can_move():
game_over = true
if score > best_score:
best_score = score
game_over_label.visible = true
func can_move() -> bool:
# 检查是否有空格
for y in range(GRID_SIZE):
for x in range(GRID_SIZE):
if grid[y][x] == 0:
return true
# 检查是否可以合并
for y in range(GRID_SIZE):
for x in range(GRID_SIZE):
var current = grid[y][x]
# 检查右边
if x < GRID_SIZE - 1 and grid[y][x + 1] == current:
return true
# 检查下面
if y < GRID_SIZE - 1 and grid[y + 1][x] == current:
return true
return false
func update_ui():
score_label.text = "分数: " + str(score)
best_label.text = "最高分: " + str(best_score)
if stats_label:
stats_label.text = "游戏次数: " + str(games_played) + " | 总步数: " + str(total_moves)
func hide_labels():
game_over_label.visible = false
win_label.visible = false
func load_player_data():
if FileAccess.file_exists(DATA_FILE_PATH):
var file = FileAccess.open(DATA_FILE_PATH, FileAccess.READ)
if file:
var json_string = file.get_as_text()
file.close()
var json = JSON.new()
var parse_result = json.parse(json_string)
if parse_result == OK:
player_data = json.data
if player_data.has("2048"):
var game_data = player_data["2048"]
best_score = game_data.get("best_score", 0)
games_played = game_data.get("games_played", 0)
highest_tile = game_data.get("highest_tile", 0)
total_moves = game_data.get("total_moves", 0)
func save_player_data():
if not player_data.has("2048"):
player_data["2048"] = {}
player_data["2048"]["best_score"] = best_score
player_data["2048"]["current_score"] = score
player_data["2048"]["games_played"] = games_played
player_data["2048"]["highest_tile"] = highest_tile
player_data["2048"]["total_moves"] = total_moves
# 更新全局数据
if not player_data.has("global"):
player_data["global"] = {}
player_data["global"]["last_played"] = Time.get_datetime_string_from_system()
var file = FileAccess.open(DATA_FILE_PATH, FileAccess.WRITE)
if file:
var json_string = JSON.stringify(player_data)
file.store_string(json_string)
file.close()
func _draw():
if not game_board:
return
# 绘制背景渐变
var gradient = Gradient.new()
gradient.add_point(0.0, Color(0.2, 0.3, 0.5, 0.8))
gradient.add_point(1.0, Color(0.1, 0.2, 0.4, 0.9))
draw_rect(Rect2(Vector2.ZERO, size), gradient.sample(0.5), true)
# 获取游戏板位置
var board_pos = game_board.position
# 绘制游戏板阴影
var shadow_offset = Vector2(4, 4)
var board_rect = Rect2(board_pos + shadow_offset, game_board.size)
draw_rect(board_rect, Color(0, 0, 0, 0.3), true, 8)
# 绘制游戏板背景
board_rect = Rect2(board_pos, game_board.size)
draw_rect(board_rect, Color(0.7, 0.6, 0.5, 0.9), true, 8)
# 绘制网格
for y in range(GRID_SIZE):
for x in range(GRID_SIZE):
var cell_x = board_pos.x + x * (CELL_SIZE + CELL_MARGIN) + CELL_MARGIN
var cell_y = board_pos.y + y * (CELL_SIZE + CELL_MARGIN) + CELL_MARGIN
var rect = Rect2(cell_x, cell_y, CELL_SIZE, CELL_SIZE)
# 绘制单元格阴影
draw_rect(rect.grow(2), Color(0, 0, 0, 0.2), true)
# 绘制单元格背景
draw_rect(rect, Color(0.8, 0.7, 0.6, 0.8), true)
# 绘制数字
var value = grid[y][x]
if value > 0:
# 绘制数字背景(带渐变效果)
var bg_color = NUMBER_COLORS.get(value, Color.GOLD)
draw_rect(rect, bg_color, true)
# 绘制高光效果
var highlight_rect = Rect2(rect.position, Vector2(rect.size.x, rect.size.y * 0.3))
var highlight_color = Color(1, 1, 1, 0.3)
draw_rect(highlight_rect, highlight_color, true)
# 绘制数字文本
var text = str(value)
var font_size = 24 if value < 100 else (20 if value < 1000 else (16 if value < 10000 else 14))
var text_color = TEXT_COLORS.get(value, Color.WHITE)
# 获取默认字体
var font = ThemeDB.fallback_font
# 计算文本尺寸
var text_size = font.get_string_size(text, HORIZONTAL_ALIGNMENT_CENTER, -1, font_size)
# 计算文本位置(居中)
var text_pos = Vector2(
cell_x + (CELL_SIZE - text_size.x) / 2,
cell_y + (CELL_SIZE - text_size.y) / 2 + text_size.y
)
# 绘制文本阴影
draw_string(font, text_pos + Vector2(1, 1), text, HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, Color(0, 0, 0, 0.5))
# 绘制文本
draw_string(font, text_pos, text, HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, text_color)
#退出2048游戏界面
func _on_quit_button_pressed() -> void:
self.hide()
get_parent().remove_child(self)
queue_free()
pass
#手机端继续游戏按钮
func _on_continue_button_pressed() -> void:
if won and not can_continue:
can_continue = true
win_label.visible = false
return
pass
#手机端重置游戏按钮
func _on_reast_button_pressed() -> void:
if game_over:
init_game()
return
pass

View File

@@ -0,0 +1 @@
uid://5dkxyuiuuhxk

View File

@@ -0,0 +1,153 @@
[gd_scene load_steps=2 format=3 uid="uid://dn0f1hjolxori"]
[ext_resource type="Script" uid="uid://5dkxyuiuuhxk" path="res://Scene/SmallGame/2048Game.gd" id="1_4d5vb"]
[node name="2048Game" type="Panel"]
offset_right = 1400.0
offset_bottom = 720.0
script = ExtResource("1_4d5vb")
[node name="GameBoard" type="Panel" parent="."]
layout_mode = 1
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -217.0
offset_top = -250.0
offset_right = 183.0
offset_bottom = 150.0
grow_horizontal = 2
grow_vertical = 2
[node name="ScoreLabel" type="Label" parent="."]
layout_mode = 1
anchors_preset = 2
anchor_top = 1.0
anchor_bottom = 1.0
offset_left = 50.0
offset_top = -100.0
offset_right = 250.0
offset_bottom = -70.0
grow_vertical = 0
text = "分数: 0"
[node name="BestLabel" type="Label" parent="."]
layout_mode = 1
anchors_preset = 2
anchor_top = 1.0
anchor_bottom = 1.0
offset_left = 50.0
offset_top = -70.0
offset_right = 250.0
offset_bottom = -40.0
grow_vertical = 0
text = "最高分: 0"
[node name="GameOverLabel" type="Label" parent="."]
visible = false
layout_mode = 1
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -150.0
offset_top = -50.0
offset_right = 150.0
offset_bottom = 50.0
grow_horizontal = 2
grow_vertical = 2
text = "游戏结束
按R重新开始"
horizontal_alignment = 1
vertical_alignment = 1
[node name="WinLabel" type="Label" parent="."]
visible = false
layout_mode = 1
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -150.0
offset_top = -100.0
offset_right = 150.0
offset_bottom = -50.0
grow_horizontal = 2
grow_vertical = 2
text = "恭喜达到2048
按C继续游戏"
horizontal_alignment = 1
vertical_alignment = 1
[node name="ControlsLabel" 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 = -350.0
offset_top = -180.0
offset_right = -50.0
offset_bottom = -50.0
grow_horizontal = 0
grow_vertical = 0
text = "操作说明:
WASD或方向键 - 移动
滑动屏幕 - 移动(手机)
R - 重新开始
C - 继续游戏(达到2048后)
目标: 合并数字达到2048或更高!"
[node name="StatsLabel" type="Label" parent="."]
layout_mode = 1
anchors_preset = 2
anchor_top = 1.0
anchor_bottom = 1.0
offset_left = 50.0
offset_top = -40.0
offset_right = 300.0
offset_bottom = -10.0
grow_vertical = 0
text = "游戏次数: 0 | 总步数: 0"
[node name="ReastButton" type="Button" parent="."]
layout_mode = 0
offset_left = 19.0
offset_top = 19.0
offset_right = 97.0
offset_bottom = 76.0
theme_override_font_sizes/font_size = 35
text = "重置"
[node name="ContinueButton" type="Button" parent="."]
layout_mode = 0
offset_left = 97.0
offset_top = 19.0
offset_right = 175.0
offset_bottom = 76.0
theme_override_font_sizes/font_size = 35
text = "继续"
[node name="QuitButton" type="Button" parent="."]
self_modulate = Color(1, 0.247059, 0, 1)
layout_mode = 1
anchors_preset = 1
anchor_left = 1.0
anchor_right = 1.0
offset_left = -129.0
offset_right = -46.0
offset_bottom = 57.0
grow_horizontal = 0
scale = Vector2(1.54345, 1.50915)
theme_override_font_sizes/font_size = 25
text = "关闭"
[connection signal="pressed" from="ReastButton" to="." method="_on_reast_button_pressed"]
[connection signal="pressed" from="ContinueButton" to="." method="_on_continue_button_pressed"]
[connection signal="pressed" from="QuitButton" to="." method="_on_quit_button_pressed"]

View File

@@ -0,0 +1,811 @@
extends Panel
# 游戏常量
const CELL_SIZE = 40
const DATA_FILE_PATH = "user://playergamedata.json"
# 地图元素
enum CellType {
EMPTY, # 空地
WALL, # 墙壁
TARGET, # 目标点
BOX, # 箱子
PLAYER, # 玩家
BOX_ON_TARGET # 箱子在目标点上
}
# 颜色配置
const CELL_COLORS = {
CellType.EMPTY: Color.WHITE,
CellType.WALL: Color.DARK_GRAY,
CellType.TARGET: Color.LIGHT_BLUE,
CellType.BOX: Color.SADDLE_BROWN,
CellType.PLAYER: Color.GREEN,
CellType.BOX_ON_TARGET: Color.DARK_GREEN
}
# 关卡数据
const LEVELS = [
# 关卡1 - 简单入门
[
"########",
"#......#",
"#..##..#",
"#..#*..#",
"#..#$..#",
"#..@...#",
"#......#",
"########"
],
# 关卡2 - 两个箱子
[
"########",
"#......#",
"#.*$*..#",
"#......#",
"#..$...#",
"#..@...#",
"#......#",
"########"
],
# 关卡3 - 稍微复杂
[
"##########",
"#........#",
"#..####..#",
"#..*##*..#",
"#..$$....#",
"#........#",
"#...@....#",
"#........#",
"##########"
],
# 关卡4 - 更复杂的布局
[
"############",
"#..........#",
"#..######..#",
"#..*....#..#",
"#..$....#..#",
"#.......#..#",
"#..#....#..#",
"#..*....#..#",
"#..$......@#",
"#..........#",
"############"
],
# 关卡5 - 角落挑战
[
"#########",
"#*......#",
"#.##....#",
"#.#$....#",
"#.#.....#",
"#.#.....#",
"#.......#",
"#......@#",
"#########"
],
# 关卡6 - 多箱子排列
[
"##########",
"#........#",
"#.*.*.*..#",
"#........#",
"#.$.$.$..#",
"#........#",
"#....@...#",
"#........#",
"##########"
],
# 关卡7 - 迷宫式
[
"############",
"#..........#",
"#.##.##.##.#",
"#.*#.#*.#*.#",
"#..#.#..#..#",
"#.$#.#$.#$.#",
"#..#.#..#..#",
"#..#.#..#..#",
"#..........#",
"#....@.....#",
"############"
],
# 关卡8 - 紧密配合
[
"#########",
"#.......#",
"#.##*##.#",
"#.#$.$#.#",
"#.#*.*#.#",
"#.#$.$#.#",
"#.##*##.#",
"#...@...#",
"#########"
],
# 关卡9 - 长廊挑战
[
"##############",
"#............#",
"#.##########.#",
"#.*........*.#",
"#.$.......$.#",
"#............#",
"#............#",
"#.$.......$.#",
"#.*........*.#",
"#.##########.#",
"#......@.....#",
"##############"
],
# 关卡10 - 螺旋结构
[
"###########",
"#.........#",
"#.#######.#",
"#.#*...#.#",
"#.#.#$.#.#",
"#.#.#*.#.#",
"#.#.#$.#.#",
"#.#...#.#",
"#.#####.#",
"#...@...#",
"###########"
],
# 关卡11 - 对称美学
[
"############",
"#..........#",
"#.*#....#*.#",
"#.$#....#$.#",
"#..#....#..#",
"#..........#",
"#..........#",
"#..#....#..#",
"#.$#....#$.#",
"#.*#....#*.#",
"#.....@....#",
"############"
],
# 关卡12 - 十字路口
[
"###########",
"#.........#",
"#....#....#",
"#.*..#..*#",
"#.$.###.$.#",
"#...#@#...#",
"#.$.###.$.#",
"#.*..#..*#",
"#....#....#",
"#.........#",
"###########"
],
# 关卡13 - 复杂迷宫
[
"##############",
"#............#",
"#.##.####.##.#",
"#.*#......#*.#",
"#.$#.####.#$.#",
"#..#.#..#.#..#",
"#....#..#....#",
"#..#.#..#.#..#",
"#.$#.####.#$.#",
"#.*#......#*.#",
"#.##.####.##.#",
"#......@.....#",
"##############"
],
# 关卡14 - 精密操作
[
"##########",
"#........#",
"#.######.#",
"#.#*..*.#",
"#.#$..$.#",
"#.#....#.#",
"#.#$..$.#",
"#.#*..*.#",
"#.######.#",
"#...@....#",
"##########"
],
# 关卡15 - 终极挑战
[
"###############",
"#.............#",
"#.###.###.###.#",
"#.*#*.*#*.*#*.#",
"#.$#$.$#$.$#$.#",
"#.###.###.###.#",
"#.............#",
"#.###.###.###.#",
"#.$#$.$#$.$#$.#",
"#.*#*.*#*.*#*.#",
"#.###.###.###.#",
"#.......@.....#",
"###############"
],
# 关卡16 - 狭窄通道
[
"#############",
"#...........#",
"#.#.#.#.#.#.#",
"#*#*#*#*#*#*#",
"#$#$#$#$#$#$#",
"#.#.#.#.#.#.#",
"#...........#",
"#.#.#.#.#.#.#",
"#$#$#$#$#$#$#",
"#*#*#*#*#*#*#",
"#.#.#.#.#.#.#",
"#.....@.....#",
"#############"
],
# 关卡17 - 环形结构
[
"##############",
"#............#",
"#.##########.#",
"#.#........#.#",
"#.#.######.#.#",
"#.#.#*..*.#.#.#",
"#.#.#$..$.#.#.#",
"#.#.#....#.#.#",
"#.#.######.#.#",
"#.#........#.#",
"#.##########.#",
"#......@.....#",
"##############"
],
# 关卡18 - 多层迷宫
[
"################",
"#..............#",
"#.############.#",
"#.#*........*.#.#",
"#.#$........$.#.#",
"#.#..########..#.#",
"#.#..#*....*.#..#.#",
"#.#..#$....$.#..#.#",
"#.#..########..#.#",
"#.#$........$.#.#",
"#.#*........*.#.#",
"#.############.#",
"#........@.....#",
"################"
],
# 关卡19 - 钻石形状
[
"#########",
"#.......#",
"#...*...#",
"#..*$*..#",
"#.*$@$*.#",
"#..*$*..#",
"#...*...#",
"#.......#",
"#########"
],
# 关卡20 - 复杂交叉
[
"###############",
"#.............#",
"#.#.#.#.#.#.#.#",
"#*#*#*#*#*#*#*#",
"#$#$#$#$#$#$#$#",
"#.#.#.#.#.#.#.#",
"#.............#",
"#.#.#.#.#.#.#.#",
"#$#$#$#$#$#$#$#",
"#*#*#*#*#*#*#*#",
"#.#.#.#.#.#.#.#",
"#.............#",
"#.#.#.#@#.#.#.#",
"#.............#",
"###############"
],
# 关卡21 - 螺旋深渊
[
"#############",
"#...........#",
"#.#########.#",
"#.#.......#.#",
"#.#.#####.#.#",
"#.#.#*..#.#.#",
"#.#.#$#.#.#.#",
"#.#.#*#.#.#.#",
"#.#.#$#.#.#.#",
"#.#.###.#.#.#",
"#.#.....#.#.#",
"#.#######.#.#",
"#.........#.#",
"#.....@...#.#",
"#############"
],
# 关卡22 - 双重挑战
[
"##############",
"#............#",
"#.####..####.#",
"#.#*.#..#.*#.#",
"#.#$.#..#.$#.#",
"#.#..####..#.#",
"#.#........#.#",
"#.#........#.#",
"#.#..####..#.#",
"#.#$.#..#.$#.#",
"#.#*.#..#.*#.#",
"#.####..####.#",
"#......@.....#",
"##############"
],
# 关卡23 - 星形布局
[
"###########",
"#.........#",
"#....#....#",
"#.#.*#*.#.#",
"#.#$###$#.#",
"#.*#.@.#*.#",
"#.#$###$#.#",
"#.#.*#*.#.#",
"#....#....#",
"#.........#",
"###########"
],
# 关卡24 - 终极迷宫
[
"################",
"#..............#",
"#.############.#",
"#.#*.........*.#",
"#.#$#########$#.#",
"#.#.#*......*.#.#",
"#.#.#$######$#.#.#",
"#.#.#.#*..*.#.#.#.#",
"#.#.#.#$..$.#.#.#.#",
"#.#.#.######.#.#.#",
"#.#.#........#.#.#",
"#.#.##########.#.#",
"#.#............#.#",
"#.##############.#",
"#........@.......#",
"################"
],
# 关卡25 - 大师级挑战
[
"#################",
"#...............#",
"#.#############.#",
"#.#*.*.*.*.*.*#.#",
"#.#$.$.$.$.$.$#.#",
"#.#.###########.#",
"#.#.#*.*.*.*.*#.#",
"#.#.#$.$.$.$.$#.#",
"#.#.#.#######.#.#",
"#.#.#.#*.*.*#.#.#",
"#.#.#.#$.$.$#.#.#",
"#.#.#.#####.#.#.#",
"#.#.#.......#.#.#",
"#.#.#########.#.#",
"#.#...........#.#",
"#.#############.#",
"#.........@.....#",
"#################"
]
]
# 游戏变量
var current_level = 0
var level_data = []
var player_pos = Vector2()
var moves = 0
var level_completed = false
var map_width = 0
var map_height = 0
var total_moves = 0
var levels_completed = 0
var best_moves_per_level = {}
var player_data = {}
# 节点引用
@onready var game_area = $GameArea
@onready var level_label = $LevelLabel
@onready var moves_label = $MovesLabel
@onready var win_label = $WinLabel
@onready var stats_label = $StatsLabel
@onready var virtual_controls = $VirtualControls
func _ready():
# 设置游戏区域样式
game_area.modulate = Color(0.9, 0.9, 0.9)
# 加载玩家数据
load_player_data()
# 初始化游戏
init_level()
# 设置虚拟按键
setup_virtual_controls()
func init_level():
# 重置游戏状态
level_completed = false
moves = 0
# 加载当前关卡
load_level(current_level)
# 更新UI
update_ui()
win_label.visible = false
queue_redraw()
func load_level(level_index: int):
if level_index >= LEVELS.size():
level_index = LEVELS.size() - 1
var level_strings = LEVELS[level_index]
map_height = level_strings.size()
map_width = level_strings[0].length()
# 初始化关卡数据
level_data.clear()
for y in range(map_height):
var row = []
for x in range(map_width):
row.append(CellType.EMPTY)
level_data.append(row)
# 解析关卡字符串
for y in range(map_height):
var line = level_strings[y]
for x in range(line.length()):
var char = line[x]
match char:
'#': # 墙壁
level_data[y][x] = CellType.WALL
'*': # 目标点
level_data[y][x] = CellType.TARGET
'$': # 箱子
level_data[y][x] = CellType.BOX
'@': # 玩家
level_data[y][x] = CellType.PLAYER
player_pos = Vector2(x, y)
'+': # 箱子在目标点上
level_data[y][x] = CellType.BOX_ON_TARGET
'.': # 空地
level_data[y][x] = CellType.EMPTY
func _input(event):
if event is InputEventKey and event.pressed:
if level_completed:
match event.keycode:
KEY_N:
next_level()
KEY_R:
init_level()
return
# 移动控制
var direction = Vector2.ZERO
match event.keycode:
KEY_UP, KEY_W:
direction = Vector2(0, -1)
KEY_DOWN, KEY_S:
direction = Vector2(0, 1)
KEY_LEFT, KEY_A:
direction = Vector2(-1, 0)
KEY_RIGHT, KEY_D:
direction = Vector2(1, 0)
KEY_R:
init_level()
return
KEY_P:
prev_level()
return
KEY_N:
next_level()
return
if direction != Vector2.ZERO:
move_player(direction)
func move_player(direction: Vector2):
var new_pos = player_pos + direction
# 检查边界
if new_pos.x < 0 or new_pos.x >= map_width or new_pos.y < 0 or new_pos.y >= map_height:
return
var target_cell = level_data[new_pos.y][new_pos.x]
# 检查是否撞墙
if target_cell == CellType.WALL:
return
# 检查是否推箱子
if target_cell == CellType.BOX or target_cell == CellType.BOX_ON_TARGET:
var box_new_pos = new_pos + direction
# 检查箱子新位置是否有效
if box_new_pos.x < 0 or box_new_pos.x >= map_width or box_new_pos.y < 0 or box_new_pos.y >= map_height:
return
var box_target_cell = level_data[box_new_pos.y][box_new_pos.x]
# 箱子不能推到墙上或其他箱子上
if box_target_cell == CellType.WALL or box_target_cell == CellType.BOX or box_target_cell == CellType.BOX_ON_TARGET:
return
# 移动箱子
var was_on_target = (target_cell == CellType.BOX_ON_TARGET)
var moving_to_target = (box_target_cell == CellType.TARGET)
# 更新箱子原位置
if was_on_target:
level_data[new_pos.y][new_pos.x] = CellType.TARGET
else:
level_data[new_pos.y][new_pos.x] = CellType.EMPTY
# 更新箱子新位置
if moving_to_target:
level_data[box_new_pos.y][box_new_pos.x] = CellType.BOX_ON_TARGET
else:
level_data[box_new_pos.y][box_new_pos.x] = CellType.BOX
# 移动玩家
# 恢复玩家原位置(检查是否在目标点上)
var level_strings = LEVELS[current_level]
if player_pos.y < level_strings.size() and player_pos.x < level_strings[player_pos.y].length():
var original_char = level_strings[player_pos.y][player_pos.x]
if original_char == '*': # 玩家原来在目标点上
level_data[player_pos.y][player_pos.x] = CellType.TARGET
else:
level_data[player_pos.y][player_pos.x] = CellType.EMPTY
else:
level_data[player_pos.y][player_pos.x] = CellType.EMPTY
# 更新玩家位置
player_pos = new_pos
level_data[player_pos.y][player_pos.x] = CellType.PLAYER
# 增加步数
moves += 1
total_moves += 1
# 检查是否过关
check_win_condition()
# 更新UI和重绘
update_ui()
save_player_data()
queue_redraw()
func check_win_condition():
# 检查是否所有箱子都在目标点上
for y in range(map_height):
for x in range(map_width):
if level_data[y][x] == CellType.BOX:
return # 还有箱子不在目标点上
# 所有箱子都在目标点上,过关!
level_completed = true
levels_completed += 1
# 记录最佳步数
var level_key = str(current_level + 1)
if not best_moves_per_level.has(level_key) or moves < best_moves_per_level[level_key]:
best_moves_per_level[level_key] = moves
win_label.text = "恭喜过关!\n步数: " + str(moves) + "\n最佳: " + str(best_moves_per_level.get(level_key, moves)) + "\n按N进入下一关\n按R重新开始"
win_label.visible = true
func next_level():
if current_level < LEVELS.size() - 1:
current_level += 1
init_level()
else:
win_label.text = "恭喜!你已完成所有关卡!\n总步数: " + str(total_moves) + "\n按R重新开始第一关"
func prev_level():
if current_level > 0:
current_level -= 1
init_level()
func update_ui():
level_label.text = "关卡: " + str(current_level + 1) + "/" + str(LEVELS.size())
moves_label.text = "步数: " + str(moves)
if stats_label:
stats_label.text = "已完成: " + str(levels_completed) + " | 总步数: " + str(total_moves)
func setup_virtual_controls():
if not virtual_controls:
return
# 连接虚拟按键信号
var up_btn = virtual_controls.get_node("UpButton")
var down_btn = virtual_controls.get_node("DownButton")
var left_btn = virtual_controls.get_node("LeftButton")
var right_btn = virtual_controls.get_node("RightButton")
var reset_btn = virtual_controls.get_node("ResetButton")
if up_btn:
up_btn.pressed.connect(_on_virtual_button_pressed.bind(Vector2(0, -1)))
if down_btn:
down_btn.pressed.connect(_on_virtual_button_pressed.bind(Vector2(0, 1)))
if left_btn:
left_btn.pressed.connect(_on_virtual_button_pressed.bind(Vector2(-1, 0)))
if right_btn:
right_btn.pressed.connect(_on_virtual_button_pressed.bind(Vector2(1, 0)))
if reset_btn:
reset_btn.pressed.connect(init_level)
func _on_virtual_button_pressed(direction: Vector2):
if not level_completed:
move_player(direction)
func load_player_data():
if FileAccess.file_exists(DATA_FILE_PATH):
var file = FileAccess.open(DATA_FILE_PATH, FileAccess.READ)
if file:
var json_string = file.get_as_text()
file.close()
var json = JSON.new()
var parse_result = json.parse(json_string)
if parse_result == OK:
player_data = json.data
if player_data.has("pushbox"):
var game_data = player_data["pushbox"]
current_level = game_data.get("current_level", 0)
total_moves = game_data.get("total_moves", 0)
levels_completed = game_data.get("levels_completed", 0)
best_moves_per_level = game_data.get("best_moves_per_level", {})
func save_player_data():
if not player_data.has("pushbox"):
player_data["pushbox"] = {}
player_data["pushbox"]["current_level"] = current_level
player_data["pushbox"]["max_level_reached"] = max(current_level, player_data.get("pushbox", {}).get("max_level_reached", 0))
player_data["pushbox"]["total_moves"] = total_moves
player_data["pushbox"]["levels_completed"] = levels_completed
player_data["pushbox"]["best_moves_per_level"] = best_moves_per_level
# 更新全局数据
if not player_data.has("global"):
player_data["global"] = {}
player_data["global"]["last_played"] = Time.get_datetime_string_from_system()
var file = FileAccess.open(DATA_FILE_PATH, FileAccess.WRITE)
if file:
var json_string = JSON.stringify(player_data)
file.store_string(json_string)
file.close()
func _draw():
if not game_area:
return
# 绘制背景渐变
var gradient = Gradient.new()
gradient.add_point(0.0, Color(0.15, 0.25, 0.35, 0.9))
gradient.add_point(1.0, Color(0.1, 0.15, 0.25, 0.95))
draw_rect(Rect2(Vector2.ZERO, size), gradient.sample(0.5), true)
# 获取游戏区域位置
var area_pos = game_area.position
# 绘制游戏区域阴影
var shadow_offset = Vector2(6, 6)
var area_rect = Rect2(area_pos + shadow_offset, game_area.size)
draw_rect(area_rect, Color(0, 0, 0, 0.4), true)
# 绘制游戏区域背景
area_rect = Rect2(area_pos, game_area.size)
draw_rect(area_rect, Color(0.8, 0.75, 0.7, 0.95), true)
# 计算起始绘制位置(居中)
var start_x = area_pos.x + (game_area.size.x - map_width * CELL_SIZE) / 2
var start_y = area_pos.y + (game_area.size.y - map_height * CELL_SIZE) / 2
# 绘制地图
for y in range(map_height):
for x in range(map_width):
var cell_x = start_x + x * CELL_SIZE
var cell_y = start_y + y * CELL_SIZE
var rect = Rect2(cell_x, cell_y, CELL_SIZE, CELL_SIZE)
var cell_type = level_data[y][x]
# 绘制单元格阴影
draw_rect(rect.grow(1), Color(0, 0, 0, 0.2), true)
# 根据类型绘制不同效果
match cell_type:
CellType.EMPTY:
draw_rect(rect, Color(0.9, 0.85, 0.8, 0.7), true)
CellType.WALL:
# 绘制立体墙壁效果
draw_rect(rect, Color(0.3, 0.3, 0.3), true)
# 高光
var highlight_rect = Rect2(rect.position, Vector2(rect.size.x, rect.size.y * 0.3))
draw_rect(highlight_rect, Color(0.5, 0.5, 0.5, 0.8), true)
CellType.TARGET:
# 绘制目标点(带光晕效果)
draw_rect(rect, Color(0.6, 0.8, 1.0, 0.8), true)
# 内圈
var inner_rect = rect.grow(-8)
draw_rect(inner_rect, Color(0.4, 0.6, 0.9, 0.9), true)
CellType.BOX:
# 绘制立体箱子
draw_rect(rect, Color(0.7, 0.5, 0.3), true)
# 高光
var box_highlight = Rect2(rect.position + Vector2(2, 2), Vector2(rect.size.x - 4, rect.size.y * 0.3))
draw_rect(box_highlight, Color(0.9, 0.7, 0.5, 0.8), true)
# 边框
draw_rect(rect, Color(0.5, 0.3, 0.1), false, 2)
CellType.PLAYER:
# 检查玩家下面是否有目标点
var level_strings = LEVELS[current_level]
if y < level_strings.size() and x < level_strings[y].length():
var original_char = level_strings[y][x]
if original_char == '*': # 玩家在目标点上
# 先绘制目标点
draw_rect(rect, Color(0.6, 0.8, 1.0, 0.8), true)
var inner_rect = rect.grow(-8)
draw_rect(inner_rect, Color(0.4, 0.6, 0.9, 0.9), true)
else:
draw_rect(rect, Color(0.9, 0.85, 0.8, 0.7), true)
else:
draw_rect(rect, Color(0.9, 0.85, 0.8, 0.7), true)
# 绘制玩家(圆形)
var center = rect.get_center()
var radius = min(rect.size.x, rect.size.y) * 0.3
# 阴影
draw_circle(center + Vector2(1, 1), radius, Color(0, 0, 0, 0.3))
# 玩家主体
draw_circle(center, radius, Color(0.2, 0.8, 0.2))
# 高光
draw_circle(center - Vector2(2, 2), radius * 0.5, Color(0.6, 1.0, 0.6, 0.7))
CellType.BOX_ON_TARGET:
# 绘制目标点背景
draw_rect(rect, Color(0.6, 0.8, 1.0, 0.8), true)
var inner_rect = rect.grow(-8)
draw_rect(inner_rect, Color(0.4, 0.6, 0.9, 0.9), true)
# 绘制完成的箱子(绿色)
var box_rect = rect.grow(-4)
draw_rect(box_rect, Color(0.2, 0.7, 0.2), true)
# 高光
var box_highlight = Rect2(box_rect.position + Vector2(2, 2), Vector2(box_rect.size.x - 4, box_rect.size.y * 0.3))
draw_rect(box_highlight, Color(0.4, 0.9, 0.4, 0.8), true)
# 边框
draw_rect(box_rect, Color(0.1, 0.5, 0.1), false, 2)
# 绘制网格线(淡色)
draw_rect(rect, Color(0.6, 0.6, 0.6, 0.3), false, 1)
#手机端下一关
func _on_next_button_pressed() -> void:
next_level()
pass
#手机端上一关
func _on_last_button_pressed() -> void:
prev_level()
pass
#关闭推箱子游戏界面
func _on_quit_button_pressed() -> void:
self.hide()
get_parent().remove_child(self)
queue_free()
pass

View File

@@ -0,0 +1 @@
uid://b1t5fxyg0jjx5

View File

@@ -0,0 +1,242 @@
[gd_scene load_steps=2 format=3 uid="uid://cq14axh7bovu6"]
[ext_resource type="Script" uid="uid://b1t5fxyg0jjx5" path="res://Scene/SmallGame/PushBox.gd" id="1_qdfdf"]
[node name="PushBox" type="Panel"]
offset_right = 1402.0
offset_bottom = 720.0
script = ExtResource("1_qdfdf")
[node name="GameArea" type="Panel" parent="."]
layout_mode = 1
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -300.0
offset_top = -250.0
offset_right = 300.0
offset_bottom = 250.0
grow_horizontal = 2
grow_vertical = 2
[node name="LevelLabel" type="Label" parent="."]
layout_mode = 1
anchors_preset = 2
anchor_top = 1.0
anchor_bottom = 1.0
offset_left = 50.0
offset_top = -100.0
offset_right = 200.0
offset_bottom = -70.0
grow_vertical = 0
text = "关卡: 1"
[node name="MovesLabel" type="Label" parent="."]
layout_mode = 1
anchors_preset = 2
anchor_top = 1.0
anchor_bottom = 1.0
offset_left = 50.0
offset_top = -70.0
offset_right = 200.0
offset_bottom = -40.0
grow_vertical = 0
text = "步数: 0"
[node name="WinLabel" type="Label" parent="."]
visible = false
layout_mode = 1
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -150.0
offset_top = -50.0
offset_right = 150.0
offset_bottom = 50.0
grow_horizontal = 2
grow_vertical = 2
text = "恭喜过关!
按N进入下一关
按R重新开始"
horizontal_alignment = 1
vertical_alignment = 1
[node name="ControlsLabel" 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 = -300.0
offset_top = -180.0
offset_right = -50.0
offset_bottom = -50.0
grow_horizontal = 0
grow_vertical = 0
text = "操作说明:
WASD或方向键 - 移动
虚拟按钮 - 移动(手机)
R - 重新开始当前关卡
N - 下一关(过关后)
P - 上一关"
[node name="ObjectiveLabel" type="Label" parent="."]
layout_mode = 1
anchors_preset = 1
anchor_left = 1.0
anchor_right = 1.0
offset_left = -1402.0
offset_right = -1051.0
offset_bottom = 35.0
grow_horizontal = 0
theme_override_font_sizes/font_size = 25
text = "目标: 将所有箱子推到目标位置!"
horizontal_alignment = 1
[node name="StatsLabel" type="Label" parent="."]
layout_mode = 1
anchors_preset = 2
anchor_top = 1.0
anchor_bottom = 1.0
offset_left = 50.0
offset_top = -40.0
offset_right = 400.0
offset_bottom = -10.0
grow_vertical = 0
text = "完成关卡: 0 | 总步数: 0"
[node name="VirtualControls" type="Control" 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 = -1289.0
offset_top = -472.0
offset_right = -1089.0
offset_bottom = -272.0
grow_horizontal = 0
grow_vertical = 0
[node name="UpButton" type="Button" parent="VirtualControls"]
custom_minimum_size = Vector2(90, 90)
layout_mode = 1
anchors_preset = 1
anchor_left = 1.0
anchor_right = 1.0
offset_left = -144.0
offset_top = -72.0
offset_right = -54.0
offset_bottom = 18.0
grow_horizontal = 0
theme_override_font_sizes/font_size = 35
text = "W"
[node name="DownButton" type="Button" parent="VirtualControls"]
custom_minimum_size = Vector2(90, 90)
layout_mode = 1
anchors_preset = 1
anchor_left = 1.0
anchor_right = 1.0
offset_left = -144.0
offset_top = 108.0
offset_right = -54.0
offset_bottom = 198.0
grow_horizontal = 0
theme_override_font_sizes/font_size = 35
text = "S"
[node name="LeftButton" type="Button" parent="VirtualControls"]
custom_minimum_size = Vector2(90, 90)
layout_mode = 1
anchors_preset = 1
anchor_left = 1.0
anchor_right = 1.0
offset_left = -236.0
offset_top = 18.0
offset_right = -146.0
offset_bottom = 108.0
grow_horizontal = 0
theme_override_font_sizes/font_size = 35
text = "A"
[node name="RightButton" type="Button" parent="VirtualControls"]
custom_minimum_size = Vector2(90, 90)
layout_mode = 1
anchors_preset = 1
anchor_left = 1.0
anchor_right = 1.0
offset_left = -54.0
offset_top = 18.0
offset_right = 36.0
offset_bottom = 108.0
grow_horizontal = 0
theme_override_font_sizes/font_size = 35
text = "D"
[node name="ResetButton" type="Button" parent="VirtualControls"]
layout_mode = 1
anchors_preset = 1
anchor_left = 1.0
anchor_right = 1.0
offset_left = 819.0
offset_top = 62.0
offset_right = 902.0
offset_bottom = 119.0
grow_horizontal = 0
scale = Vector2(1.54345, 1.50915)
theme_override_font_sizes/font_size = 25
text = "重置"
[node name="NextButton" type="Button" parent="VirtualControls"]
layout_mode = 1
anchors_preset = 1
anchor_left = 1.0
anchor_right = 1.0
offset_left = 819.0
offset_top = -110.0
offset_right = 902.0
offset_bottom = -53.0
grow_horizontal = 0
scale = Vector2(1.54345, 1.50915)
theme_override_font_sizes/font_size = 25
text = "下一关"
[node name="LastButton" type="Button" parent="VirtualControls"]
layout_mode = 1
anchors_preset = 1
anchor_left = 1.0
anchor_right = 1.0
offset_left = 819.0
offset_top = -24.0
offset_right = 902.0
offset_bottom = 33.0
grow_horizontal = 0
scale = Vector2(1.54345, 1.50915)
theme_override_font_sizes/font_size = 25
text = "上一关"
[node name="QuitButton" type="Button" parent="VirtualControls"]
self_modulate = Color(1, 0.247059, 0, 1)
layout_mode = 1
anchors_preset = 1
anchor_left = 1.0
anchor_right = 1.0
offset_left = 947.0
offset_top = -248.0
offset_right = 1030.0
offset_bottom = -191.0
grow_horizontal = 0
scale = Vector2(1.54345, 1.50915)
theme_override_font_sizes/font_size = 25
text = "关闭"
[connection signal="pressed" from="VirtualControls/NextButton" to="." method="_on_next_button_pressed"]
[connection signal="pressed" from="VirtualControls/LastButton" to="." method="_on_last_button_pressed"]
[connection signal="pressed" from="VirtualControls/QuitButton" to="." method="_on_quit_button_pressed"]

View File

@@ -0,0 +1,561 @@
extends Panel
# 游戏常量
const GRID_SIZE = 20
const GRID_WIDTH = 30
const GRID_HEIGHT = 30
const DATA_FILE_PATH = "user://playergamedata.json"
# 方向枚举
enum Direction {
UP,
DOWN,
LEFT,
RIGHT
}
# 食物类型枚举
enum FoodType {
NORMAL, # 普通食物 +10分
GOLDEN, # 金色食物 +50分
SPEED, # 加速食物 +20分临时加速
SLOW, # 减速食物 +30分临时减速
BONUS # 奖励食物 +100分
}
# 游戏变量
var snake_body = []
var snake_direction = Direction.RIGHT
var next_direction = Direction.RIGHT
var food_position = Vector2()
var food_type = FoodType.NORMAL
var score = 0
var best_score = 0
var level = 1
var speed_multiplier = 1.0
var speed_effect_timer = 0.0
var game_over = false
var game_started = false # 添加游戏开始状态
var obstacles = []
var games_played = 0
var total_food_eaten = 0
var player_data = {}
# 节点引用
@onready var game_area = $GameArea
@onready var score_label = $ScoreLabel
@onready var game_over_label = $GameOverLabel
@onready var game_timer = $GameTimer
@onready var virtual_controls = $VirtualControls
func _ready():
# 连接定时器信号
game_timer.timeout.connect(_on_game_timer_timeout)
# 设置游戏区域样式
game_area.modulate = Color(0.1, 0.1, 0.15, 0.9)
# 连接虚拟按键信号
setup_virtual_controls()
# 加载玩家数据
load_player_data()
# 显示游戏开始界面
show_start_screen()
func init_game():
# 重置游戏状态
game_over = false
game_started = true
score = 0
level = 1
speed_multiplier = 1.0
speed_effect_timer = 0.0
snake_direction = Direction.RIGHT
next_direction = Direction.RIGHT
games_played += 1
# 初始化蛇身
snake_body.clear()
snake_body.append(Vector2(5, 5))
snake_body.append(Vector2(4, 5))
snake_body.append(Vector2(3, 5))
# 清空障碍物
obstacles.clear()
# 生成食物和障碍物
generate_food()
generate_obstacles()
# 更新UI
update_score()
game_over_label.visible = false
# 设置定时器速度
game_timer.wait_time = 0.2 / speed_multiplier
game_timer.start()
func _input(event):
if event is InputEventKey and event.pressed:
# 游戏未开始时按Q键开始游戏
if not game_started:
if event.keycode == KEY_Q:
init_game()
return
if game_over:
if event.keycode == KEY_SPACE:
init_game()
elif event.keycode == KEY_Q:
init_game()
return
# 控制蛇的方向
match event.keycode:
KEY_UP, KEY_W:
change_direction(Direction.UP)
KEY_DOWN, KEY_S:
change_direction(Direction.DOWN)
KEY_LEFT, KEY_A:
change_direction(Direction.LEFT)
KEY_RIGHT, KEY_D:
change_direction(Direction.RIGHT)
func change_direction(new_direction: Direction):
# 防止蛇反向移动
match new_direction:
Direction.UP:
if snake_direction != Direction.DOWN:
next_direction = Direction.UP
Direction.DOWN:
if snake_direction != Direction.UP:
next_direction = Direction.DOWN
Direction.LEFT:
if snake_direction != Direction.RIGHT:
next_direction = Direction.LEFT
Direction.RIGHT:
if snake_direction != Direction.LEFT:
next_direction = Direction.RIGHT
func _on_game_timer_timeout():
if not game_started or game_over:
return
# 处理速度效果
if speed_effect_timer > 0:
speed_effect_timer -= game_timer.wait_time
if speed_effect_timer <= 0:
speed_multiplier = 1.0
game_timer.wait_time = 0.2 / speed_multiplier
# 更新方向
snake_direction = next_direction
# 移动蛇
move_snake()
# 检查碰撞
check_collisions()
# 重绘游戏
queue_redraw()
func move_snake():
var head = snake_body[0]
var new_head = head
# 根据方向计算新的头部位置
match snake_direction:
Direction.UP:
new_head = Vector2(head.x, head.y - 1)
Direction.DOWN:
new_head = Vector2(head.x, head.y + 1)
Direction.LEFT:
new_head = Vector2(head.x - 1, head.y)
Direction.RIGHT:
new_head = Vector2(head.x + 1, head.y)
# 添加新头部
snake_body.insert(0, new_head)
# 检查是否吃到食物
if new_head == food_position:
# 根据食物类型增加分数和效果
eat_food()
# 生成新食物
generate_food()
# 检查等级提升
check_level_up()
else:
# 移除尾部
snake_body.pop_back()
func check_collisions():
var head = snake_body[0]
# 检查边界碰撞
if head.x < 0 or head.x >= GRID_WIDTH or head.y < 0 or head.y >= GRID_HEIGHT:
game_over = true
show_game_over()
return
# 检查自身碰撞
for i in range(1, snake_body.size()):
if head == snake_body[i]:
game_over = true
show_game_over()
return
# 检查障碍物碰撞
for obstacle in obstacles:
if head == obstacle:
game_over = true
show_game_over()
return
func generate_food():
var attempts = 0
while attempts < 100: # 防止无限循环
food_position = Vector2(
randi() % GRID_WIDTH,
randi() % GRID_HEIGHT
)
# 确保食物不在蛇身上和障碍物上
var food_blocked = false
for segment in snake_body:
if segment == food_position:
food_blocked = true
break
if not food_blocked:
for obstacle in obstacles:
if obstacle == food_position:
food_blocked = true
break
if not food_blocked:
break
attempts += 1
# 随机生成食物类型
var rand = randf()
if rand < 0.6: # 60% 普通食物
food_type = FoodType.NORMAL
elif rand < 0.75: # 15% 金色食物
food_type = FoodType.GOLDEN
elif rand < 0.85: # 10% 加速食物
food_type = FoodType.SPEED
elif rand < 0.95: # 10% 减速食物
food_type = FoodType.SLOW
else: # 5% 奖励食物
food_type = FoodType.BONUS
func update_score():
score_label.text = "🐍 分数: " + str(score) + "\n🏆 最高分: " + str(best_score) + "\n⭐ 等级: " + str(level) + "\n🎮 游戏次数: " + str(games_played)
func show_game_over():
game_timer.stop()
game_started = false
if score > best_score:
best_score = score
update_score()
save_player_data()
game_over_label.text = "🎮 游戏结束\n🏆 分数: " + str(score) + "\n⭐ 等级: " + str(level) + "\n\n🔄 按Q键或空格重新开始"
game_over_label.visible = true
func eat_food():
total_food_eaten += 1
match food_type:
FoodType.NORMAL:
score += 10
FoodType.GOLDEN:
score += 50
FoodType.SPEED:
score += 20
speed_multiplier = 1.5
speed_effect_timer = 5.0
game_timer.wait_time = 0.2 / speed_multiplier
FoodType.SLOW:
score += 30
speed_multiplier = 0.7
speed_effect_timer = 5.0
game_timer.wait_time = 0.2 / speed_multiplier
FoodType.BONUS:
score += 100
update_score()
func check_level_up():
var new_level = (total_food_eaten / 10) + 1
if new_level > level:
level = new_level
generate_obstacles() # 每升级增加障碍物
func generate_obstacles():
# 根据等级生成障碍物
var obstacle_count = min(level - 1, 10) # 最多10个障碍物
obstacles.clear()
for i in range(obstacle_count):
var attempts = 0
while attempts < 50:
var obstacle_pos = Vector2(
randi() % GRID_WIDTH,
randi() % GRID_HEIGHT
)
# 确保障碍物不在蛇身、食物或其他障碍物上
var blocked = false
for segment in snake_body:
if segment == obstacle_pos:
blocked = true
break
if not blocked and obstacle_pos == food_position:
blocked = true
if not blocked:
for existing_obstacle in obstacles:
if existing_obstacle == obstacle_pos:
blocked = true
break
if not blocked:
obstacles.append(obstacle_pos)
break
attempts += 1
func setup_virtual_controls():
if not virtual_controls:
return
var up_btn = virtual_controls.get_node("UpButton")
var down_btn = virtual_controls.get_node("DownButton")
var left_btn = virtual_controls.get_node("LeftButton")
var right_btn = virtual_controls.get_node("RightButton")
var restart_btn = virtual_controls.get_node("RestartButton")
if up_btn:
up_btn.pressed.connect(_on_virtual_button_pressed.bind(Direction.UP))
if down_btn:
down_btn.pressed.connect(_on_virtual_button_pressed.bind(Direction.DOWN))
if left_btn:
left_btn.pressed.connect(_on_virtual_button_pressed.bind(Direction.LEFT))
if right_btn:
right_btn.pressed.connect(_on_virtual_button_pressed.bind(Direction.RIGHT))
if restart_btn:
restart_btn.pressed.connect(_on_restart_button_pressed)
func _on_virtual_button_pressed(direction: Direction):
if game_started and not game_over:
change_direction(direction)
func _on_restart_button_pressed():
if not game_started or game_over:
init_game()
func load_player_data():
if FileAccess.file_exists(DATA_FILE_PATH):
var file = FileAccess.open(DATA_FILE_PATH, FileAccess.READ)
if file:
var json_string = file.get_as_text()
file.close()
var json = JSON.new()
var parse_result = json.parse(json_string)
if parse_result == OK:
player_data = json.data
if player_data.has("snake"):
var game_data = player_data["snake"]
best_score = game_data.get("best_score", 0)
games_played = game_data.get("games_played", 0)
total_food_eaten = game_data.get("total_food_eaten", 0)
func show_start_screen():
# 重置状态
game_started = false
game_over = false
# 初始化蛇身用于显示
snake_body.clear()
snake_body.append(Vector2(5, 5))
snake_body.append(Vector2(4, 5))
snake_body.append(Vector2(3, 5))
# 清空障碍物
obstacles.clear()
# 生成初始食物
food_position = Vector2(10, 10)
food_type = FoodType.NORMAL
# 显示开始提示
game_over_label.text = "🐍 贪吃蛇游戏 🐍\n\n🏆 最高分数: " + str(best_score) + "\n🎯 游戏次数: " + str(games_played) + "\n\n🎮 按Q键开始游戏\n\n🎯 操作说明:\n方向键/WASD - 控制方向\n\n🍎 食物类型:\n🔴 普通食物 +10分\n🟡 金色食物 +50分\n🔵 加速食物 +20分\n🟣 减速食物 +30分\n🌈 奖励食物 +100分"
game_over_label.visible = true
# 停止定时器
game_timer.stop()
update_score()
queue_redraw()
func save_player_data():
if not player_data.has("snake"):
player_data["snake"] = {}
player_data["snake"]["best_score"] = best_score
player_data["snake"]["current_score"] = score
player_data["snake"]["games_played"] = games_played
player_data["snake"]["total_food_eaten"] = total_food_eaten
player_data["snake"]["max_level_reached"] = level
# 更新全局数据
if not player_data.has("global"):
player_data["global"] = {}
player_data["global"]["last_played"] = Time.get_datetime_string_from_system()
var file = FileAccess.open(DATA_FILE_PATH, FileAccess.WRITE)
if file:
var json_string = JSON.stringify(player_data)
file.store_string(json_string)
file.close()
func _draw():
if not game_area:
return
# 绘制背景渐变
var gradient = Gradient.new()
gradient.add_point(0.0, Color(0.05, 0.1, 0.2, 0.95))
gradient.add_point(0.5, Color(0.1, 0.15, 0.25, 0.9))
gradient.add_point(1.0, Color(0.15, 0.2, 0.3, 0.95))
draw_rect(Rect2(Vector2.ZERO, size), gradient.sample(0.5), true)
# 获取游戏区域的位置和大小
var area_pos = game_area.position
var area_size = game_area.size
# 绘制游戏区域阴影
var shadow_offset = Vector2(4, 4)
var area_rect = Rect2(area_pos + shadow_offset, area_size)
draw_rect(area_rect, Color(0, 0, 0, 0.3), true)
# 绘制游戏区域背景
area_rect = Rect2(area_pos, area_size)
draw_rect(area_rect, Color(0.08, 0.12, 0.18, 0.9), true)
# 计算网格大小
var cell_width = area_size.x / GRID_WIDTH
var cell_height = area_size.y / GRID_HEIGHT
# 绘制网格线(淡色)
for x in range(GRID_WIDTH + 1):
var start_pos = Vector2(area_pos.x + x * cell_width, area_pos.y)
var end_pos = Vector2(area_pos.x + x * cell_width, area_pos.y + area_size.y)
draw_line(start_pos, end_pos, Color(0.3, 0.3, 0.4, 0.3), 1)
for y in range(GRID_HEIGHT + 1):
var start_pos = Vector2(area_pos.x, area_pos.y + y * cell_height)
var end_pos = Vector2(area_pos.x + area_size.x, area_pos.y + y * cell_height)
draw_line(start_pos, end_pos, Color(0.3, 0.3, 0.4, 0.3), 1)
# 绘制障碍物
for obstacle in obstacles:
var rect = Rect2(
area_pos.x + obstacle.x * cell_width,
area_pos.y + obstacle.y * cell_height,
cell_width - 2,
cell_height - 2
)
# 绘制立体障碍物效果
draw_rect(rect, Color(0.4, 0.2, 0.1), true)
# 高光
var highlight_rect = Rect2(rect.position + Vector2(1, 1), Vector2(rect.size.x - 2, rect.size.y * 0.3))
draw_rect(highlight_rect, Color(0.6, 0.4, 0.2, 0.8), true)
# 绘制蛇身
for i in range(snake_body.size()):
var segment = snake_body[i]
var rect = Rect2(
area_pos.x + segment.x * cell_width,
area_pos.y + segment.y * cell_height,
cell_width - 2,
cell_height - 2
)
if i == 0: # 头部
# 绘制蛇头(圆形,带渐变)
var center = rect.get_center()
var radius = min(rect.size.x, rect.size.y) * 0.4
# 阴影
draw_circle(center + Vector2(1, 1), radius, Color(0, 0, 0, 0.3))
# 主体
draw_circle(center, radius, Color(0.2, 0.8, 0.2))
# 高光
draw_circle(center - Vector2(2, 2), radius * 0.6, Color(0.4, 1.0, 0.4, 0.7))
# 眼睛
var eye_size = radius * 0.2
draw_circle(center + Vector2(-eye_size, -eye_size), eye_size * 0.5, Color.BLACK)
draw_circle(center + Vector2(eye_size, -eye_size), eye_size * 0.5, Color.BLACK)
else: # 身体
# 绘制蛇身(渐变色)
var body_color = Color.LIME_GREEN.lerp(Color.DARK_GREEN, float(i) / snake_body.size())
draw_rect(rect, body_color, true)
# 高光
var highlight_rect = Rect2(rect.position + Vector2(1, 1), Vector2(rect.size.x - 2, rect.size.y * 0.3))
draw_rect(highlight_rect, Color(1, 1, 1, 0.3), true)
# 绘制食物
var food_rect = Rect2(
area_pos.x + food_position.x * cell_width,
area_pos.y + food_position.y * cell_height,
cell_width - 2,
cell_height - 2
)
# 根据食物类型绘制不同效果
var food_center = food_rect.get_center()
var food_radius = min(food_rect.size.x, food_rect.size.y) * 0.4
match food_type:
FoodType.NORMAL:
# 普通红色食物
draw_circle(food_center + Vector2(1, 1), food_radius, Color(0, 0, 0, 0.3)) # 阴影
draw_circle(food_center, food_radius, Color.RED)
draw_circle(food_center - Vector2(1, 1), food_radius * 0.6, Color(1, 0.5, 0.5, 0.8)) # 高光
FoodType.GOLDEN:
# 金色食物(闪烁效果)
var pulse = sin(Time.get_ticks_msec() * 0.008) * 0.2 + 0.8
draw_circle(food_center + Vector2(1, 1), food_radius, Color(0, 0, 0, 0.3)) # 阴影
draw_circle(food_center, food_radius, Color.GOLD * pulse)
draw_circle(food_center - Vector2(1, 1), food_radius * 0.6, Color.YELLOW) # 高光
FoodType.SPEED:
# 蓝色加速食物
draw_circle(food_center + Vector2(1, 1), food_radius, Color(0, 0, 0, 0.3)) # 阴影
draw_circle(food_center, food_radius, Color.CYAN)
draw_circle(food_center - Vector2(1, 1), food_radius * 0.6, Color.LIGHT_BLUE) # 高光
FoodType.SLOW:
# 紫色减速食物
draw_circle(food_center + Vector2(1, 1), food_radius, Color(0, 0, 0, 0.3)) # 阴影
draw_circle(food_center, food_radius, Color.PURPLE)
draw_circle(food_center - Vector2(1, 1), food_radius * 0.6, Color.MAGENTA) # 高光
FoodType.BONUS:
# 彩虹奖励食物(旋转彩虹效果)
var rainbow_time = Time.get_ticks_msec() * 0.003
var rainbow_color = Color.from_hsv(fmod(rainbow_time, 1.0), 1.0, 1.0)
draw_circle(food_center + Vector2(1, 1), food_radius, Color(0, 0, 0, 0.3)) # 阴影
draw_circle(food_center, food_radius, rainbow_color)
draw_circle(food_center - Vector2(1, 1), food_radius * 0.6, Color.WHITE) # 高光
func _on_quit_button_pressed() -> void:
self.hide()
get_parent().remove_child(self)
queue_free()
pass

View File

@@ -0,0 +1 @@
uid://rut5cdp1l3nh

View File

@@ -0,0 +1,174 @@
[gd_scene load_steps=2 format=3 uid="uid://grpkpy4duwac"]
[ext_resource type="Script" uid="uid://rut5cdp1l3nh" path="res://Scene/SmallGame/SnakeGame.gd" id="1_o070e"]
[node name="SnakeGame" type="Panel"]
offset_right = 1403.0
offset_bottom = 726.0
script = ExtResource("1_o070e")
[node name="GameArea" type="Panel" parent="."]
layout_mode = 1
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -300.0
offset_top = -300.0
offset_right = 300.0
offset_bottom = 300.0
grow_horizontal = 2
grow_vertical = 2
[node name="ScoreLabel" type="Label" parent="."]
layout_mode = 1
anchors_preset = 2
anchor_top = 1.0
anchor_bottom = 1.0
offset_top = -726.0
offset_right = 180.0
offset_bottom = -684.0
grow_vertical = 0
theme_override_font_sizes/font_size = 30
text = "分数: 0"
[node name="GameOverLabel" type="Label" parent="."]
visible = false
layout_mode = 1
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -100.0
offset_top = -50.0
offset_right = 100.0
offset_bottom = 50.0
grow_horizontal = 2
grow_vertical = 2
text = "游戏结束
按空格重新开始"
horizontal_alignment = 1
vertical_alignment = 1
[node name="GameTimer" type="Timer" parent="."]
wait_time = 0.2
autostart = true
[node name="VirtualControls" type="Control" parent="."]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
offset_top = 160.0
offset_bottom = 160.0
grow_horizontal = 2
grow_vertical = 2
[node name="UpButton" type="Button" parent="VirtualControls"]
custom_minimum_size = Vector2(80, 80)
layout_mode = 1
anchors_preset = 5
anchor_left = 0.5
anchor_right = 0.5
offset_left = -529.5
offset_top = 114.0
offset_right = -449.5
offset_bottom = 194.0
grow_horizontal = 2
theme_override_font_sizes/font_size = 35
text = "W"
[node name="TestButton" type="Button" parent="VirtualControls"]
custom_minimum_size = Vector2(80, 80)
layout_mode = 1
anchors_preset = 5
anchor_left = 0.5
anchor_right = 0.5
offset_left = -529.5
offset_top = 194.0
offset_right = -449.5
offset_bottom = 274.0
grow_horizontal = 2
theme_override_font_sizes/font_size = 35
disabled = true
[node name="DownButton" type="Button" parent="VirtualControls"]
custom_minimum_size = Vector2(80, 80)
layout_mode = 1
anchors_preset = 5
anchor_left = 0.5
anchor_right = 0.5
offset_left = -529.5
offset_top = 274.0
offset_right = -449.5
offset_bottom = 354.0
grow_horizontal = 2
theme_override_font_sizes/font_size = 35
text = "S"
[node name="LeftButton" type="Button" parent="VirtualControls"]
custom_minimum_size = Vector2(80, 80)
layout_mode = 1
anchors_preset = 4
anchor_top = 0.5
anchor_bottom = 0.5
offset_left = 94.0
offset_top = -169.0
offset_right = 174.0
offset_bottom = -89.0
grow_vertical = 2
theme_override_font_sizes/font_size = 35
text = "A"
[node name="RightButton" type="Button" parent="VirtualControls"]
custom_minimum_size = Vector2(80, 80)
layout_mode = 1
anchors_preset = 6
anchor_left = 1.0
anchor_top = 0.5
anchor_right = 1.0
anchor_bottom = 0.5
offset_left = -1151.0
offset_top = -169.0
offset_right = -1071.0
offset_bottom = -89.0
grow_horizontal = 0
grow_vertical = 2
theme_override_font_sizes/font_size = 35
text = "D"
[node name="RestartButton" type="Button" parent="VirtualControls"]
custom_minimum_size = Vector2(80, 80)
layout_mode = 1
anchors_preset = 3
anchor_left = 1.0
anchor_top = 1.0
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = -1291.0
offset_top = -276.0
offset_right = -1086.0
offset_bottom = -196.0
grow_horizontal = 0
grow_vertical = 0
theme_override_font_sizes/font_size = 35
text = "🔄 重新开始"
[node name="QuitButton" type="Button" parent="."]
self_modulate = Color(1, 0.247059, 0, 1)
layout_mode = 1
anchors_preset = 1
anchor_left = 1.0
anchor_right = 1.0
offset_left = -137.0
offset_top = -1.52588e-05
offset_right = -54.0
offset_bottom = 57.0
grow_horizontal = 0
scale = Vector2(1.54345, 1.50915)
theme_override_font_sizes/font_size = 25
text = "关闭"
[connection signal="pressed" from="QuitButton" to="." method="_on_quit_button_pressed"]

View File

@@ -0,0 +1,657 @@
extends Panel
# 游戏常量
const BOARD_WIDTH = 10
const BOARD_HEIGHT = 20
const CELL_SIZE = 30
const DATA_FILE_PATH = "user://playergamedata.json"
# 特殊方块类型
enum SpecialType {
NORMAL,
BOMB, # 炸弹方块,消除周围方块
LINE, # 直线方块,消除整行
RAINBOW # 彩虹方块,消除同色方块
}
# 方块类型
enum PieceType {
I, O, T, S, Z, J, L
}
# 方块形状定义
const PIECE_SHAPES = {
PieceType.I: [
[[1, 1, 1, 1]],
[[1], [1], [1], [1]]
],
PieceType.O: [
[[1, 1], [1, 1]]
],
PieceType.T: [
[[0, 1, 0], [1, 1, 1]],
[[1, 0], [1, 1], [1, 0]],
[[1, 1, 1], [0, 1, 0]],
[[0, 1], [1, 1], [0, 1]]
],
PieceType.S: [
[[0, 1, 1], [1, 1, 0]],
[[1, 0], [1, 1], [0, 1]]
],
PieceType.Z: [
[[1, 1, 0], [0, 1, 1]],
[[0, 1], [1, 1], [1, 0]]
],
PieceType.J: [
[[1, 0, 0], [1, 1, 1]],
[[1, 1], [1, 0], [1, 0]],
[[1, 1, 1], [0, 0, 1]],
[[0, 1], [0, 1], [1, 1]]
],
PieceType.L: [
[[0, 0, 1], [1, 1, 1]],
[[1, 0], [1, 0], [1, 1]],
[[1, 1, 1], [1, 0, 0]],
[[1, 1], [0, 1], [0, 1]]
]
}
# 方块颜色
const PIECE_COLORS = {
PieceType.I: Color.CYAN,
PieceType.O: Color.YELLOW,
PieceType.T: Color.MAGENTA,
PieceType.S: Color.GREEN,
PieceType.Z: Color.RED,
PieceType.J: Color.BLUE,
PieceType.L: Color.ORANGE
}
# 游戏变量
var board = []
var current_piece = null
var current_piece_pos = Vector2()
var current_piece_rotation = 0
var next_piece_type = PieceType.I
var score = 0
var level = 1
var lines_cleared = 0
var game_over = false
var game_started = false # 添加游戏开始状态
var drop_time = 1.0
var best_score = 0
var games_played = 0
var total_lines_cleared = 0
var combo_count = 0
var special_pieces = [] # 存储特殊方块位置和类型
var player_data = {}
# 节点引用
@onready var game_area = $GameArea
@onready var next_piece_area = $NextPieceArea
@onready var score_label = $ScoreLabel
@onready var level_label = $LevelLabel
@onready var lines_label = $LinesLabel
@onready var game_over_label = $GameOverLabel
@onready var drop_timer = $DropTimer
@onready var virtual_controls = $VirtualControls
func _ready():
# 连接定时器信号
drop_timer.timeout.connect(_on_drop_timer_timeout)
# 设置游戏区域样式
game_area.modulate = Color(0.08, 0.12, 0.18, 0.9)
next_piece_area.modulate = Color(0.1, 0.15, 0.25, 0.9)
# 设置虚拟控制
setup_virtual_controls()
# 加载玩家数据
load_player_data()
# 显示游戏开始界面
show_start_screen()
func init_game():
# 重置游戏状态
game_over = false
game_started = true
score = 0
level = 1
lines_cleared = 0
drop_time = 1.0
combo_count = 0
games_played += 1
# 初始化游戏板
board.clear()
special_pieces.clear()
for y in range(BOARD_HEIGHT):
var row = []
for x in range(BOARD_WIDTH):
row.append(0)
board.append(row)
# 生成第一个方块
next_piece_type = randi() % PieceType.size()
spawn_new_piece()
# 更新UI
update_ui()
game_over_label.visible = false
# 启动定时器
drop_timer.wait_time = drop_time
drop_timer.start()
func _input(event):
if event is InputEventKey and event.pressed:
# 游戏未开始时按Q键开始游戏
if not game_started:
if event.keycode == KEY_Q:
init_game()
return
if game_over:
if event.keycode == KEY_SPACE:
init_game()
elif event.keycode == KEY_Q:
init_game()
return
if not current_piece:
return
# 控制方块
match event.keycode:
KEY_A:
handle_move_left()
KEY_D:
handle_move_right()
KEY_S:
handle_move_down()
KEY_W:
handle_rotate()
KEY_SPACE:
handle_drop()
# 控制函数
func handle_move_left():
move_piece(-1, 0)
func handle_move_right():
move_piece(1, 0)
func handle_move_down():
move_piece(0, 1)
func handle_rotate():
rotate_piece()
func handle_drop():
drop_piece()
func handle_restart():
init_game()
func spawn_new_piece():
current_piece = {
"type": next_piece_type,
"rotation": 0
}
current_piece_pos = Vector2(BOARD_WIDTH / 2 - 1, 0)
current_piece_rotation = 0
# 生成下一个方块
next_piece_type = randi() % PieceType.size()
# 检查游戏是否结束
if not can_place_piece(current_piece_pos, current_piece_rotation):
game_over = true
show_game_over()
func move_piece(dx: int, dy: int):
var new_pos = current_piece_pos + Vector2(dx, dy)
if can_place_piece(new_pos, current_piece_rotation):
current_piece_pos = new_pos
queue_redraw()
func rotate_piece():
var new_rotation = (current_piece_rotation + 1) % get_piece_rotations(current_piece.type)
if can_place_piece(current_piece_pos, new_rotation):
current_piece_rotation = new_rotation
queue_redraw()
func drop_piece():
while can_place_piece(current_piece_pos + Vector2(0, 1), current_piece_rotation):
current_piece_pos.y += 1
place_piece()
func can_place_piece(pos: Vector2, rotation: int) -> bool:
var shape = get_piece_shape(current_piece.type, rotation)
for y in range(shape.size()):
for x in range(shape[y].size()):
if shape[y][x] == 1:
var board_x = pos.x + x
var board_y = pos.y + y
# 检查边界
if board_x < 0 or board_x >= BOARD_WIDTH or board_y >= BOARD_HEIGHT:
return false
# 检查碰撞
if board_y >= 0 and board[board_y][board_x] != 0:
return false
return true
func place_piece():
var shape = get_piece_shape(current_piece.type, current_piece_rotation)
for y in range(shape.size()):
for x in range(shape[y].size()):
if shape[y][x] == 1:
var board_x = current_piece_pos.x + x
var board_y = current_piece_pos.y + y
if board_y >= 0:
board[board_y][board_x] = current_piece.type + 1
# 检查并清除完整的行
clear_lines()
# 生成新方块
spawn_new_piece()
queue_redraw()
func clear_lines():
var lines_to_clear = []
# 找到完整的行
for y in range(BOARD_HEIGHT):
var is_full = true
for x in range(BOARD_WIDTH):
if board[y][x] == 0:
is_full = false
break
if is_full:
lines_to_clear.append(y)
# 处理特殊方块效果
process_special_pieces(lines_to_clear)
# 清除行并下移
for line_y in lines_to_clear:
board.erase(board[line_y])
var new_row = []
for x in range(BOARD_WIDTH):
new_row.append(0)
board.insert(0, new_row)
# 更新分数和等级
if lines_to_clear.size() > 0:
# 连击系统
combo_count += 1
var combo_bonus = combo_count * 50
lines_cleared += lines_to_clear.size()
total_lines_cleared += lines_to_clear.size()
# 计算分数(包含连击奖励)
var base_score = lines_to_clear.size() * 100 * level
var line_bonus = 0
match lines_to_clear.size():
1: line_bonus = 0
2: line_bonus = 300
3: line_bonus = 500
4: line_bonus = 800 # 俄罗斯方块
score += base_score + line_bonus + combo_bonus
# 每10行提升一个等级速度递增
level = lines_cleared / 10 + 1
drop_time = max(0.05, 1.0 - (level - 1) * 0.08)
drop_timer.wait_time = drop_time
# 随机生成特殊方块
if randf() < 0.1 + level * 0.02: # 等级越高,特殊方块概率越大
generate_special_piece()
else:
# 重置连击
combo_count = 0
update_ui()
func get_piece_shape(type: PieceType, rotation: int) -> Array:
return PIECE_SHAPES[type][rotation]
func get_piece_rotations(type: PieceType) -> int:
return PIECE_SHAPES[type].size()
func update_ui():
score_label.text = "🏆 分数: " + str(score) + "\n💎 最高: " + str(best_score)
level_label.text = "⚡ 等级: " + str(level) + "\n🎮 游戏: " + str(games_played)
lines_label.text = "📊 消除: " + str(lines_cleared) + "\n🔥 连击: " + str(combo_count)
func show_game_over():
drop_timer.stop()
game_started = false
# 检查并更新最高分
if score > best_score:
best_score = score
# 保存玩家数据
save_player_data()
# 显示游戏结束信息
game_over_label.text = "🎮 游戏结束 🎮\n\n🏆 本次分数: " + str(score) + "\n💎 最高分数: " + str(best_score) + "\n📊 消除行数: " + str(lines_cleared) + "\n⚡ 达到等级: " + str(level) + "\n\n🔄 按Q键或空格重新开始"
game_over_label.visible = true
func _on_drop_timer_timeout():
if not game_started or game_over or not current_piece:
return
if can_place_piece(current_piece_pos + Vector2(0, 1), current_piece_rotation):
current_piece_pos.y += 1
queue_redraw()
else:
place_piece()
# 虚拟控制设置
func setup_virtual_controls():
if virtual_controls:
virtual_controls.get_node("LeftButton").pressed.connect(_on_virtual_button_pressed.bind("left"))
virtual_controls.get_node("RightButton").pressed.connect(_on_virtual_button_pressed.bind("right"))
virtual_controls.get_node("DownButton").pressed.connect(_on_virtual_button_pressed.bind("down"))
virtual_controls.get_node("RotateButton").pressed.connect(_on_virtual_button_pressed.bind("rotate"))
virtual_controls.get_node("DropButton").pressed.connect(_on_virtual_button_pressed.bind("drop"))
virtual_controls.get_node("RestartButton").pressed.connect(_on_virtual_button_pressed.bind("restart"))
func _on_virtual_button_pressed(action: String):
if not game_started:
if action == "restart":
init_game()
return
if game_over and action == "restart":
handle_restart()
return
if game_over or not current_piece:
return
match action:
"left":
handle_move_left()
"right":
handle_move_right()
"down":
handle_move_down()
"rotate":
handle_rotate()
"drop":
handle_drop()
# 特殊方块处理
func process_special_pieces(lines_to_clear: Array):
# 处理特殊方块效果
for special in special_pieces:
var pos = special.position
var type = special.type
match type:
SpecialType.BOMB:
# 炸弹方块清除周围3x3区域
for dy in range(-1, 2):
for dx in range(-1, 2):
var x = pos.x + dx
var y = pos.y + dy
if x >= 0 and x < BOARD_WIDTH and y >= 0 and y < BOARD_HEIGHT:
board[y][x] = 0
SpecialType.LINE:
# 直线方块:清除整行
for x in range(BOARD_WIDTH):
board[pos.y][x] = 0
SpecialType.RAINBOW:
# 彩虹方块:清除同色方块
var target_color = board[pos.y][pos.x]
if target_color > 0:
for y in range(BOARD_HEIGHT):
for x in range(BOARD_WIDTH):
if board[y][x] == target_color:
board[y][x] = 0
# 清空特殊方块列表
special_pieces.clear()
func generate_special_piece():
# 在随机位置生成特殊方块
var x = randi() % BOARD_WIDTH
var y = randi() % (BOARD_HEIGHT - 5) + 5 # 在下半部分生成
if board[y][x] != 0: # 只在有方块的位置生成特殊效果
var special_type = randi() % 3 + 1 # 随机选择特殊类型
special_pieces.append({
"position": Vector2(x, y),
"type": special_type
})
# 数据存储功能
func load_player_data():
if FileAccess.file_exists(DATA_FILE_PATH):
var file = FileAccess.open(DATA_FILE_PATH, FileAccess.READ)
if file:
var json_string = file.get_as_text()
file.close()
var json = JSON.new()
var parse_result = json.parse(json_string)
if parse_result == OK:
player_data = json.data
if player_data.has("tetris"):
var tetris_data = player_data["tetris"]
best_score = tetris_data.get("best_score", 0)
games_played = tetris_data.get("games_played", 0)
total_lines_cleared = tetris_data.get("total_lines_cleared", 0)
func show_start_screen():
# 重置状态
game_started = false
game_over = false
current_piece = null
# 显示开始提示
game_over_label.text = "🎮 俄罗斯方块 🎮\n\n🏆 最高分数: " + str(best_score) + "\n🎯 游戏次数: " + str(games_played) + "\n\n🎮 按Q键开始游戏\n\n🎯 操作说明:\nA/D - 左右移动\nW - 旋转\nS - 快速下落\n空格 - 直接落下"
game_over_label.visible = true
# 停止定时器
drop_timer.stop()
# 清空游戏板
board.clear()
special_pieces.clear()
for y in range(BOARD_HEIGHT):
var row = []
for x in range(BOARD_WIDTH):
row.append(0)
board.append(row)
update_ui()
queue_redraw()
func save_player_data():
if not player_data.has("tetris"):
player_data["tetris"] = {}
player_data["tetris"]["best_score"] = best_score
player_data["tetris"]["games_played"] = games_played
player_data["tetris"]["total_lines_cleared"] = total_lines_cleared
player_data["tetris"]["last_played"] = Time.get_datetime_string_from_system()
var file = FileAccess.open(DATA_FILE_PATH, FileAccess.WRITE)
if file:
var json_string = JSON.stringify(player_data)
file.store_string(json_string)
file.close()
func _draw():
if not game_area:
return
# 绘制背景渐变
var gradient = Gradient.new()
gradient.add_point(0.0, Color(0.05, 0.1, 0.2, 0.95))
gradient.add_point(0.5, Color(0.1, 0.15, 0.25, 0.9))
gradient.add_point(1.0, Color(0.15, 0.2, 0.3, 0.95))
draw_rect(Rect2(Vector2.ZERO, size), gradient.sample(0.5), true)
# 获取游戏区域的位置
var area_pos = game_area.position
var area_size = Vector2(BOARD_WIDTH * CELL_SIZE, BOARD_HEIGHT * CELL_SIZE)
# 绘制游戏区域阴影
var shadow_offset = Vector2(4, 4)
var area_rect = Rect2(area_pos + shadow_offset, area_size)
draw_rect(area_rect, Color(0, 0, 0, 0.4), true)
# 绘制游戏区域背景
area_rect = Rect2(area_pos, area_size)
draw_rect(area_rect, Color(0.08, 0.12, 0.18, 0.9), true)
# 绘制网格线(淡色)
for x in range(BOARD_WIDTH + 1):
var start_pos = Vector2(area_pos.x + x * CELL_SIZE, area_pos.y)
var end_pos = Vector2(area_pos.x + x * CELL_SIZE, area_pos.y + BOARD_HEIGHT * CELL_SIZE)
draw_line(start_pos, end_pos, Color(0.3, 0.3, 0.4, 0.3), 1)
for y in range(BOARD_HEIGHT + 1):
var start_pos = Vector2(area_pos.x, area_pos.y + y * CELL_SIZE)
var end_pos = Vector2(area_pos.x + BOARD_WIDTH * CELL_SIZE, area_pos.y + y * CELL_SIZE)
draw_line(start_pos, end_pos, Color(0.3, 0.3, 0.4, 0.3), 1)
# 绘制游戏板
for y in range(BOARD_HEIGHT):
for x in range(BOARD_WIDTH):
var cell_value = board[y][x]
if cell_value > 0:
var rect = Rect2(
area_pos.x + x * CELL_SIZE,
area_pos.y + y * CELL_SIZE,
CELL_SIZE - 2,
CELL_SIZE - 2
)
var color = PIECE_COLORS[cell_value - 1]
# 检查是否为特殊方块
var is_special = false
var special_type = SpecialType.NORMAL
for special in special_pieces:
if special.position == Vector2(x, y):
is_special = true
special_type = special.type
break
if is_special:
# 绘制特殊方块效果
match special_type:
SpecialType.BOMB:
# 炸弹方块(红色闪烁)
var pulse = sin(Time.get_ticks_msec() * 0.01) * 0.3 + 0.7
draw_rect(rect, Color.RED * pulse, true)
draw_rect(Rect2(rect.position + Vector2(2, 2), rect.size - Vector2(4, 4)), Color.ORANGE, true)
SpecialType.LINE:
# 直线方块(蓝色闪烁)
var pulse = sin(Time.get_ticks_msec() * 0.008) * 0.3 + 0.7
draw_rect(rect, Color.CYAN * pulse, true)
draw_rect(Rect2(rect.position + Vector2(2, 2), rect.size - Vector2(4, 4)), Color.LIGHT_BLUE, true)
SpecialType.RAINBOW:
# 彩虹方块(彩虹色)
var rainbow_time = Time.get_ticks_msec() * 0.003
var rainbow_color = Color.from_hsv(fmod(rainbow_time, 1.0), 1.0, 1.0)
draw_rect(rect, rainbow_color, true)
draw_rect(Rect2(rect.position + Vector2(2, 2), rect.size - Vector2(4, 4)), Color.WHITE, true)
else:
# 普通方块(立体效果)
draw_rect(rect, color, true)
# 高光
var highlight_rect = Rect2(rect.position + Vector2(1, 1), Vector2(rect.size.x - 2, rect.size.y * 0.3))
draw_rect(highlight_rect, Color(1, 1, 1, 0.3), true)
# 阴影
var shadow_rect = Rect2(rect.position + Vector2(1, rect.size.y * 0.7), Vector2(rect.size.x - 2, rect.size.y * 0.3))
draw_rect(shadow_rect, Color(0, 0, 0, 0.2), true)
# 绘制当前方块(带透明度预览)
if current_piece:
var shape = get_piece_shape(current_piece.type, current_piece_rotation)
# 绘制投影(显示方块会落在哪里)
var shadow_pos = current_piece_pos
while can_place_piece(shadow_pos + Vector2(0, 1), current_piece_rotation):
shadow_pos.y += 1
for y in range(shape.size()):
for x in range(shape[y].size()):
if shape[y][x] == 1:
var board_x = shadow_pos.x + x
var board_y = shadow_pos.y + y
if board_y >= 0 and board_x >= 0 and board_x < BOARD_WIDTH and board_y < BOARD_HEIGHT:
var rect = Rect2(
area_pos.x + board_x * CELL_SIZE,
area_pos.y + board_y * CELL_SIZE,
CELL_SIZE - 2,
CELL_SIZE - 2
)
var shadow_color = PIECE_COLORS[current_piece.type]
shadow_color.a = 0.3
draw_rect(rect, shadow_color, false, 2)
# 绘制当前方块
for y in range(shape.size()):
for x in range(shape[y].size()):
if shape[y][x] == 1:
var board_x = current_piece_pos.x + x
var board_y = current_piece_pos.y + y
if board_y >= 0:
var rect = Rect2(
area_pos.x + board_x * CELL_SIZE,
area_pos.y + board_y * CELL_SIZE,
CELL_SIZE - 2,
CELL_SIZE - 2
)
var color = PIECE_COLORS[current_piece.type]
# 立体效果
draw_rect(rect, color, true)
# 高光
var highlight_rect = Rect2(rect.position + Vector2(1, 1), Vector2(rect.size.x - 2, rect.size.y * 0.3))
draw_rect(highlight_rect, Color(1, 1, 1, 0.4), true)
# 绘制下一个方块预览区域背景
var next_area_pos = next_piece_area.position
var next_area_size = next_piece_area.size
draw_rect(Rect2(next_area_pos + Vector2(2, 2), next_area_size), Color(0, 0, 0, 0.3), true)
draw_rect(Rect2(next_area_pos, next_area_size), Color(0.1, 0.15, 0.25, 0.9), true)
# 绘制下一个方块预览
var next_shape = get_piece_shape(next_piece_type, 0)
for y in range(next_shape.size()):
for x in range(next_shape[y].size()):
if next_shape[y][x] == 1:
var rect = Rect2(
next_area_pos.x + 20 + x * 20,
next_area_pos.y + 50 + y * 20,
18,
18
)
var color = PIECE_COLORS[next_piece_type]
# 立体效果
draw_rect(rect, color, true)
# 高光
var highlight_rect = Rect2(rect.position + Vector2(1, 1), Vector2(rect.size.x - 2, rect.size.y * 0.3))
draw_rect(highlight_rect, Color(1, 1, 1, 0.3), true)
func _on_quit_button_pressed() -> void:
self.hide()
get_parent().remove_child(self)
queue_free()
pass

View File

@@ -0,0 +1 @@
uid://yhljjw1pbovq

View File

@@ -0,0 +1,254 @@
[gd_scene load_steps=2 format=3 uid="uid://c3nuuwu5te3bu"]
[ext_resource type="Script" uid="uid://yhljjw1pbovq" path="res://Scene/SmallGame/Tetris.gd" id="1_s1q1g"]
[node name="Tetris" type="Panel"]
offset_right = 1403.0
offset_bottom = 721.0
script = ExtResource("1_s1q1g")
[node name="GameArea" type="Panel" parent="."]
layout_mode = 1
anchors_preset = 4
anchor_top = 0.5
anchor_bottom = 0.5
offset_left = 542.0
offset_top = -300.5
offset_right = 842.0
offset_bottom = 299.5
grow_vertical = 2
[node name="NextPieceArea" type="Panel" parent="."]
layout_mode = 1
anchors_preset = 1
anchor_left = 1.0
anchor_right = 1.0
offset_left = -469.0
offset_top = 50.0
offset_right = -319.0
offset_bottom = 200.0
grow_horizontal = 0
[node name="NextPieceLabel" type="Label" parent="NextPieceArea"]
layout_mode = 1
anchors_preset = 5
anchor_left = 0.5
anchor_right = 0.5
offset_left = -50.0
offset_right = 50.0
offset_bottom = 42.0
grow_horizontal = 2
theme_override_font_sizes/font_size = 30
text = "下一个"
horizontal_alignment = 1
[node name="ScoreLabel" type="Label" parent="."]
layout_mode = 1
anchors_preset = 1
anchor_left = 1.0
anchor_right = 1.0
offset_left = -255.0
offset_top = 92.0
offset_right = -105.0
offset_bottom = 134.0
grow_horizontal = 0
theme_override_font_sizes/font_size = 30
text = "分数: 0"
horizontal_alignment = 1
[node name="LevelLabel" type="Label" parent="."]
layout_mode = 1
anchors_preset = 1
anchor_left = 1.0
anchor_right = 1.0
offset_left = -252.0
offset_top = 201.0
offset_right = -102.0
offset_bottom = 243.0
grow_horizontal = 0
theme_override_font_sizes/font_size = 30
text = "等级: 1"
horizontal_alignment = 1
[node name="LinesLabel" type="Label" parent="."]
layout_mode = 1
anchors_preset = 1
anchor_left = 1.0
anchor_right = 1.0
offset_left = -255.0
offset_top = 312.0
offset_right = -102.0
offset_bottom = 354.0
grow_horizontal = 0
theme_override_font_sizes/font_size = 30
text = "消除行数: 0"
horizontal_alignment = 1
[node name="GameOverLabel" type="Label" parent="."]
layout_mode = 1
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -116.5
offset_top = -48.5
offset_right = 93.5
offset_bottom = 51.5
grow_horizontal = 2
grow_vertical = 2
theme_override_font_sizes/font_size = 30
text = "游戏结束
按空格重新开始"
horizontal_alignment = 1
vertical_alignment = 1
[node name="DropTimer" type="Timer" parent="."]
autostart = true
[node name="ControlsLabel" type="Label" parent="."]
layout_mode = 1
anchors_preset = 1
anchor_left = 1.0
anchor_right = 1.0
offset_left = -214.0
offset_top = 494.0
offset_right = -9.0
offset_bottom = 716.0
grow_horizontal = 0
theme_override_font_sizes/font_size = 30
text = "操作说明:
A/D - 左右移动
S - 快速下降
W - 旋转
空格 - 瞬间下降"
[node name="VirtualControls" type="Control" parent="."]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
[node name="LeftButton" type="Button" parent="VirtualControls"]
custom_minimum_size = Vector2(80, 80)
layout_mode = 1
anchors_preset = 2
anchor_top = 1.0
anchor_bottom = 1.0
offset_left = 96.0
offset_top = -351.0
offset_right = 176.0
offset_bottom = -271.0
grow_vertical = 0
theme_override_font_sizes/font_size = 40
text = "A"
[node name="RightButton" type="Button" parent="VirtualControls"]
custom_minimum_size = Vector2(80, 80)
layout_mode = 1
anchors_preset = 2
anchor_top = 1.0
anchor_bottom = 1.0
offset_left = 260.0
offset_top = -350.0
offset_right = 340.0
offset_bottom = -270.0
grow_vertical = 0
theme_override_font_sizes/font_size = 40
text = "D"
[node name="DownButton" type="Button" parent="VirtualControls"]
custom_minimum_size = Vector2(80, 80)
layout_mode = 1
anchors_preset = 2
anchor_top = 1.0
anchor_bottom = 1.0
offset_left = 180.0
offset_top = -270.0
offset_right = 260.0
offset_bottom = -190.0
grow_vertical = 0
theme_override_font_sizes/font_size = 40
text = "S"
[node name="TestButton" type="Button" parent="VirtualControls"]
custom_minimum_size = Vector2(80, 80)
layout_mode = 1
anchors_preset = 2
anchor_top = 1.0
anchor_bottom = 1.0
offset_left = 178.0
offset_top = -334.0
offset_right = 238.0
offset_bottom = -271.0
grow_vertical = 0
theme_override_font_sizes/font_size = 40
disabled = true
[node name="RotateButton" type="Button" parent="VirtualControls"]
custom_minimum_size = Vector2(80, 80)
layout_mode = 1
anchors_preset = 3
anchor_left = 1.0
anchor_top = 1.0
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = -1225.0
offset_top = -431.0
offset_right = -1145.0
offset_bottom = -351.0
grow_horizontal = 0
grow_vertical = 0
theme_override_font_sizes/font_size = 40
text = "W"
[node name="DropButton" type="Button" parent="VirtualControls"]
layout_mode = 1
anchors_preset = 3
anchor_left = 1.0
anchor_top = 1.0
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = -1284.0
offset_top = -583.0
offset_right = -1061.0
offset_bottom = -520.0
grow_horizontal = 0
grow_vertical = 0
theme_override_font_sizes/font_size = 40
text = "🚀瞬间下降"
[node name="RestartButton" type="Button" parent="VirtualControls"]
layout_mode = 1
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -582.5
offset_top = 248.5
offset_right = -377.5
offset_bottom = 305.5
grow_horizontal = 2
grow_vertical = 2
theme_override_font_sizes/font_size = 35
text = "🔄 重新开始"
[node name="QuitButton" type="Button" parent="."]
self_modulate = Color(1, 0.247059, 0, 1)
layout_mode = 1
anchors_preset = 1
anchor_left = 1.0
anchor_right = 1.0
offset_left = -137.0
offset_top = -1.52588e-05
offset_right = -54.0
offset_bottom = 57.0
grow_horizontal = 0
scale = Vector2(1.54345, 1.50915)
theme_override_font_sizes/font_size = 25
text = "关闭"
[connection signal="pressed" from="QuitButton" to="." method="_on_quit_button_pressed"]

View File

@@ -0,0 +1,157 @@
[gd_scene load_steps=5 format=3 uid="uid://d3i0l6ysrde6o"]
[ext_resource type="Script" uid="uid://dinrduqwsf5k5" path="res://Script/SmallPanel/AccountSettingPanel.gd" id="1_xfiot"]
[ext_resource type="Texture2D" uid="uid://dsln1w1aqgf1k" path="res://assets/游戏UI/玩家默认头像.webp" id="2_a2cah"]
[ext_resource type="Script" uid="uid://0d2j5m6j2ema" path="res://Components/HTTPTextureRect.gd" id="3_wibl7"]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_y1hsh"]
border_color = Color(2.98411e-06, 0.95982, 0.386903, 1)
border_blend = true
corner_radius_top_left = 10
corner_radius_top_right = 10
corner_radius_bottom_right = 10
corner_radius_bottom_left = 10
corner_detail = 20
shadow_size = 20
shadow_offset = Vector2(10, 10)
anti_aliasing = false
anti_aliasing_size = 5.0
[node name="AccountSettingPanel" type="Panel"]
visible = false
offset_left = 243.0
offset_top = 42.0
offset_right = 1154.0
offset_bottom = 689.0
theme_override_styles/panel = SubResource("StyleBoxFlat_y1hsh")
script = ExtResource("1_xfiot")
[node name="Title" type="RichTextLabel" parent="."]
modulate = Color(1, 0.745098, 0.54902, 1)
layout_mode = 0
offset_left = 2.0
offset_right = 911.0
offset_bottom = 56.0
size_flags_vertical = 3
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
theme_override_colors/font_shadow_color = Color(0, 0, 0, 1)
theme_override_constants/outline_size = 10
theme_override_constants/shadow_offset_y = 3
theme_override_constants/shadow_offset_x = 3
theme_override_constants/shadow_outline_size = 10
theme_override_font_sizes/normal_font_size = 40
bbcode_enabled = true
text = "玩家信息设置"
horizontal_alignment = 1
threaded = true
[node name="QuitButton" type="Button" parent="."]
custom_minimum_size = Vector2(55, 55)
layout_mode = 0
offset_left = 854.0
offset_right = 911.0
offset_bottom = 57.0
theme_override_font_sizes/font_size = 35
text = "X"
[node name="RefreshButton" type="Button" parent="."]
custom_minimum_size = Vector2(55, 55)
layout_mode = 0
offset_left = 2.0
offset_right = 80.0
offset_bottom = 57.0
theme_override_font_sizes/font_size = 35
text = "刷新"
[node name="VBox1" type="VBoxContainer" parent="."]
layout_mode = 0
offset_top = 58.0
offset_right = 911.0
offset_bottom = 647.0
[node name="HBox1" type="HBoxContainer" parent="VBox1"]
layout_mode = 2
alignment = 1
[node name="HTTPTextureRect" type="TextureRect" parent="VBox1/HBox1"]
layout_mode = 2
texture = ExtResource("2_a2cah")
script = ExtResource("3_wibl7")
metadata/_custom_type_script = "uid://0d2j5m6j2ema"
[node name="Grid" type="GridContainer" parent="VBox1"]
layout_mode = 2
columns = 2
[node name="User_Name" type="Label" parent="VBox1/Grid"]
layout_mode = 2
theme_override_font_sizes/font_size = 30
text = "账户:"
horizontal_alignment = 1
vertical_alignment = 1
[node name="User_Name_Input" type="Label" parent="VBox1/Grid"]
layout_mode = 2
theme_override_font_sizes/font_size = 30
text = "74074091740"
vertical_alignment = 1
[node name="User_Password" type="Label" parent="VBox1/Grid"]
layout_mode = 2
theme_override_font_sizes/font_size = 30
text = "密码:"
horizontal_alignment = 1
vertical_alignment = 1
[node name="User_Password_Input" type="LineEdit" parent="VBox1/Grid"]
layout_mode = 2
size_flags_horizontal = 3
theme_override_font_sizes/font_size = 30
placeholder_text = "请输入密码"
[node name="Player_Name" type="Label" parent="VBox1/Grid"]
layout_mode = 2
theme_override_font_sizes/font_size = 30
text = "玩家昵称:"
[node name="Player_Name_Input" type="LineEdit" parent="VBox1/Grid"]
layout_mode = 2
size_flags_horizontal = 3
theme_override_font_sizes/font_size = 30
placeholder_text = "请输入玩家昵称"
[node name="Farm_Name" type="Label" parent="VBox1/Grid"]
layout_mode = 2
theme_override_font_sizes/font_size = 30
text = "农场名称:"
[node name="Farm_Name_Input" type="LineEdit" parent="VBox1/Grid"]
layout_mode = 2
size_flags_horizontal = 3
theme_override_font_sizes/font_size = 30
placeholder_text = "请输入农场名称"
[node name="Personal_Profile" type="Label" parent="VBox1/Grid"]
layout_mode = 2
theme_override_font_sizes/font_size = 30
text = "个人简介:"
[node name="Personal_Profile_Input" type="LineEdit" parent="VBox1/Grid"]
layout_mode = 2
size_flags_horizontal = 3
theme_override_font_sizes/font_size = 30
placeholder_text = "请输入个人简介"
[node name="HBox2" type="HBoxContainer" parent="VBox1"]
layout_mode = 2
alignment = 1
[node name="Remove_Account_Btn" type="Button" parent="VBox1/HBox2"]
layout_mode = 2
theme_override_font_sizes/font_size = 30
text = "删除账号"
[node name="Confirm_Btn" type="Button" parent="VBox1/HBox2"]
layout_mode = 2
theme_override_font_sizes/font_size = 30
text = "确认修改"

View File

@@ -0,0 +1,250 @@
[gd_scene load_steps=4 format=3 uid="uid://dckc8nrn7p425"]
[ext_resource type="Script" uid="uid://bljtkxil64h14" path="res://Script/SmallPanel/LandPanel.gd" id="1_nmy5p"]
[ext_resource type="Texture2D" uid="uid://2sdfbvf1isif" path="res://icon.svg" id="2_07q41"]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_03j44"]
border_width_left = 10
border_width_top = 10
border_width_right = 10
border_width_bottom = 10
corner_detail = 20
[node name="LandPanel" type="Panel"]
offset_left = 385.0
offset_top = 69.0
offset_right = 901.0
offset_bottom = 540.0
theme_override_styles/panel = SubResource("StyleBoxFlat_03j44")
script = ExtResource("1_nmy5p")
[node name="Quit_Button" type="Button" parent="."]
layout_mode = 0
offset_left = 466.0
offset_top = 10.0
offset_right = 506.0
offset_bottom = 53.0
theme_override_font_sizes/font_size = 25
text = "X"
[node name="Refresh_Button" type="Button" parent="."]
layout_mode = 0
offset_left = 9.0
offset_top = 10.0
offset_right = 67.0
offset_bottom = 53.0
theme_override_font_sizes/font_size = 25
text = "刷新"
[node name="Title" type="Label" parent="."]
self_modulate = Color(0, 0.87451, 1, 1)
layout_mode = 2
offset_right = 516.0
offset_bottom = 42.0
theme_override_colors/font_shadow_color = Color(0, 0, 0, 1)
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
theme_override_constants/shadow_offset_x = 4
theme_override_constants/shadow_offset_y = 4
theme_override_constants/outline_size = 15
theme_override_constants/shadow_outline_size = 15
theme_override_font_sizes/font_size = 30
text = "土地面板"
horizontal_alignment = 1
vertical_alignment = 1
[node name="GroundFunctionGrid" type="HBoxContainer" parent="."]
layout_mode = 0
offset_left = 9.0
offset_top = 84.0
offset_right = 505.0
offset_bottom = 184.0
[node name="Dig_Button" type="Button" parent="GroundFunctionGrid"]
custom_minimum_size = Vector2(100, 100)
layout_mode = 2
size_flags_horizontal = 3
theme_override_colors/font_disabled_color = Color(0, 0, 0, 1)
theme_override_colors/font_hover_pressed_color = Color(0, 0, 0, 1)
theme_override_colors/font_hover_color = Color(0, 0, 0, 1)
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
theme_override_colors/font_color = Color(1, 0, 0, 1)
theme_override_colors/font_focus_color = Color(0, 0, 0, 1)
theme_override_colors/font_pressed_color = Color(0, 0, 0, 1)
theme_override_font_sizes/font_size = 20
text = "开垦"
icon_alignment = 1
expand_icon = true
[node name="Plant_Button" type="Button" parent="GroundFunctionGrid"]
custom_minimum_size = Vector2(100, 100)
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 4
theme_override_colors/font_disabled_color = Color(0, 0, 0, 1)
theme_override_colors/font_hover_pressed_color = Color(0, 0, 0, 1)
theme_override_colors/font_hover_color = Color(0, 0, 0, 1)
theme_override_colors/font_color = Color(0.760784, 0.533333, 0.160784, 1)
theme_override_colors/font_focus_color = Color(0, 0, 0, 1)
theme_override_colors/font_pressed_color = Color(0, 0, 0, 1)
theme_override_font_sizes/font_size = 20
text = "种植"
icon_alignment = 1
expand_icon = true
[node name="Harvest_Button" type="Button" parent="GroundFunctionGrid"]
custom_minimum_size = Vector2(100, 100)
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 4
theme_override_colors/font_disabled_color = Color(0, 0, 0, 1)
theme_override_colors/font_hover_pressed_color = Color(0, 0, 0, 1)
theme_override_colors/font_hover_color = Color(0, 0, 0, 1)
theme_override_colors/font_color = Color(0.188235, 0.839216, 0.243137, 1)
theme_override_colors/font_focus_color = Color(0, 0, 0, 1)
theme_override_colors/font_pressed_color = Color(0, 0, 0, 1)
theme_override_font_sizes/font_size = 20
text = "收获"
icon_alignment = 1
expand_icon = true
[node name="Upgrade_Button" type="Button" parent="GroundFunctionGrid"]
custom_minimum_size = Vector2(100, 100)
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 4
theme_override_colors/font_color = Color(0.0705882, 0.411765, 0.87451, 1)
theme_override_colors/font_focus_color = Color(0, 0, 0, 1)
theme_override_colors/font_pressed_color = Color(0, 0, 0, 1)
theme_override_font_sizes/font_size = 20
text = "升级"
icon_alignment = 1
expand_icon = true
[node name="CropImageVBox" type="VBoxContainer" parent="."]
layout_mode = 2
offset_left = 9.0
offset_top = 330.0
offset_right = 503.0
offset_bottom = 458.0
alignment = 1
[node name="CropTextureRect" type="TextureRect" parent="CropImageVBox"]
layout_mode = 2
size_flags_horizontal = 4
size_flags_vertical = 3
texture = ExtResource("2_07q41")
expand_mode = 2
stretch_mode = 5
[node name="InformVBox" type="VBoxContainer" parent="."]
layout_mode = 0
offset_left = 9.0
offset_top = 197.0
offset_right = 1249.0
offset_bottom = 479.0
scale = Vector2(0.4, 0.4)
[node name="GroundInformVBox" type="HBoxContainer" parent="InformVBox"]
layout_mode = 2
[node name="GroundLevel" type="Label" parent="InformVBox/GroundInformVBox"]
layout_mode = 2
size_flags_horizontal = 3
theme_override_font_sizes/font_size = 40
text = "土地等级:"
horizontal_alignment = 1
vertical_alignment = 1
[node name="GroundFunction" type="Label" parent="InformVBox/GroundInformVBox"]
layout_mode = 2
size_flags_horizontal = 3
theme_override_font_sizes/font_size = 40
text = "土地功能:"
horizontal_alignment = 1
vertical_alignment = 1
[node name="CropInformVBox" type="VBoxContainer" parent="InformVBox"]
layout_mode = 2
[node name="ProgressBar" type="ProgressBar" parent="InformVBox/CropInformVBox"]
modulate = Color(0, 1, 0, 1)
layout_mode = 2
theme_override_font_sizes/font_size = 30
[node name="HBox1" type="HBoxContainer" parent="InformVBox/CropInformVBox"]
layout_mode = 2
size_flags_vertical = 3
[node name="cost" type="Label" parent="InformVBox/CropInformVBox/HBox1"]
modulate = Color(1, 1, 0, 1)
layout_mode = 2
size_flags_horizontal = 3
theme_override_font_sizes/font_size = 40
text = "花费:999"
[node name="earn" type="Label" parent="InformVBox/CropInformVBox/HBox1"]
modulate = Color(1, 1, 0, 1)
layout_mode = 2
size_flags_horizontal = 3
theme_override_font_sizes/font_size = 40
text = "收益:999"
[node name="growthtime" type="Label" parent="InformVBox/CropInformVBox/HBox1"]
modulate = Color(1, 0.635294, 1, 1)
layout_mode = 2
size_flags_horizontal = 3
theme_override_font_sizes/font_size = 40
text = "生长时间:999"
[node name="experience" type="Label" parent="InformVBox/CropInformVBox/HBox1"]
modulate = Color(0.164706, 1, 0.341176, 1)
layout_mode = 2
size_flags_horizontal = 3
theme_override_font_sizes/font_size = 40
text = "收获经验:999"
[node name="HBox2" type="HBoxContainer" parent="InformVBox/CropInformVBox"]
layout_mode = 2
size_flags_vertical = 3
[node name="canbuy" type="Label" parent="InformVBox/CropInformVBox/HBox2"]
modulate = Color(0.466667, 1, 1, 1)
layout_mode = 2
size_flags_horizontal = 3
theme_override_font_sizes/font_size = 40
text = "能否购买:是"
[node name="quality" type="Label" parent="InformVBox/CropInformVBox/HBox2"]
modulate = Color(1, 0.607843, 0.239216, 1)
layout_mode = 2
size_flags_horizontal = 3
theme_override_font_sizes/font_size = 40
text = "品质:传奇"
[node name="weatherability" type="Label" parent="InformVBox/CropInformVBox/HBox2"]
modulate = Color(0.784314, 0.647059, 0.498039, 1)
layout_mode = 2
size_flags_horizontal = 3
theme_override_font_sizes/font_size = 40
text = "耐候性:999"
[node name="level" type="Label" parent="InformVBox/CropInformVBox/HBox2"]
modulate = Color(0.394367, 0.644385, 0.816557, 1)
layout_mode = 2
size_flags_horizontal = 3
theme_override_font_sizes/font_size = 40
text = "种植等级:999"
[node name="HBox3" type="HBoxContainer" parent="InformVBox/CropInformVBox"]
layout_mode = 2
size_flags_vertical = 3
[node name="description" type="Label" parent="InformVBox/CropInformVBox/HBox3"]
modulate = Color(0.988235, 0.831373, 1, 1)
layout_mode = 2
size_flags_horizontal = 3
theme_override_font_sizes/font_size = 40
text = "描述:啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊"
[connection signal="pressed" from="Quit_Button" to="." method="_on_quit_button_pressed"]
[connection signal="pressed" from="Refresh_Button" to="." method="_on_refresh_button_pressed"]

View File

@@ -0,0 +1,40 @@
[gd_scene load_steps=2 format=3 uid="uid://d1lu2yg4xl382"]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_uhubb"]
border_width_left = 10
border_width_top = 10
border_width_right = 10
border_width_bottom = 10
[node name="LoadProgressPanel" type="Panel"]
visible = false
offset_right = 1402.0
offset_bottom = 719.0
theme_override_styles/panel = SubResource("StyleBoxFlat_uhubb")
[node name="Title" type="Label" parent="."]
layout_mode = 0
offset_right = 1402.0
offset_bottom = 550.0
theme_override_colors/font_color = Color(0.966397, 0.970739, 0.632937, 1)
theme_override_colors/font_shadow_color = Color(0, 0, 0, 1)
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
theme_override_constants/shadow_offset_x = 5
theme_override_constants/shadow_offset_y = 5
theme_override_constants/outline_size = 10
theme_override_constants/shadow_outline_size = 10
theme_override_font_sizes/font_size = 40
text = "正在加载资源中,请稍后..."
horizontal_alignment = 1
vertical_alignment = 1
[node name="LoadProgressBar" type="ProgressBar" parent="."]
layout_mode = 0
offset_left = 8.0
offset_top = 430.0
offset_right = 1396.0
offset_bottom = 489.0
theme_override_colors/font_color = Color(0, 1, 0, 1)
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
theme_override_constants/outline_size = 7
theme_override_font_sizes/font_size = 40

View File

@@ -0,0 +1,114 @@
[gd_scene load_steps=3 format=3 uid="uid://4rwitowdt4h"]
[ext_resource type="Script" uid="uid://rlk8e51pibtm" path="res://Script/SmallPanel/OneClickPlantPanel.gd" id="1_cvoer"]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_cvoer"]
border_width_left = 15
border_width_top = 15
border_width_right = 15
border_width_bottom = 15
corner_radius_top_left = 20
corner_radius_top_right = 20
corner_radius_bottom_right = 20
corner_radius_bottom_left = 20
corner_detail = 20
shadow_size = 20
[node name="OneClickPlantPanel" type="Panel"]
offset_left = 467.0
offset_top = 125.0
offset_right = 1075.0
offset_bottom = 441.0
theme_override_styles/panel = SubResource("StyleBoxFlat_cvoer")
script = ExtResource("1_cvoer")
[node name="Quit_Button" type="Button" parent="."]
layout_mode = 0
offset_left = 535.0
offset_top = 21.0
offset_right = 585.0
offset_bottom = 71.0
theme_override_font_sizes/font_size = 30
text = "X"
[node name="Title" type="Label" parent="."]
self_modulate = Color(0.431373, 0.498039, 1, 1)
layout_mode = 2
offset_right = 608.0
offset_bottom = 71.0
theme_override_colors/font_shadow_color = Color(0, 0, 0, 1)
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
theme_override_constants/shadow_offset_x = 3
theme_override_constants/shadow_offset_y = 3
theme_override_constants/outline_size = 10
theme_override_constants/shadow_outline_size = 10
theme_override_font_sizes/font_size = 30
text = "一键种植面板"
horizontal_alignment = 1
vertical_alignment = 1
[node name="Grid" type="GridContainer" parent="."]
layout_mode = 2
offset_left = 47.0
offset_top = 87.0
offset_right = 563.0
offset_bottom = 291.0
columns = 5
[node name="FullScreenPlantBtn" type="Button" parent="Grid"]
custom_minimum_size = Vector2(100, 100)
layout_mode = 2
theme_override_colors/font_color = Color(1, 0, 0, 1)
theme_override_font_sizes/font_size = 20
text = "全屏种植"
icon_alignment = 1
expand_icon = true
[node name="OneRowPlantBtn" type="Button" parent="Grid"]
custom_minimum_size = Vector2(100, 100)
layout_mode = 2
theme_override_colors/font_color = Color(1, 0.972549, 0, 1)
theme_override_font_sizes/font_size = 20
text = "行种植"
icon_alignment = 1
expand_icon = true
[node name="OneColumnPlantBtn" type="Button" parent="Grid"]
custom_minimum_size = Vector2(100, 100)
layout_mode = 2
theme_override_colors/font_color = Color(0, 1, 0, 1)
theme_override_font_sizes/font_size = 20
text = "列种植"
icon_alignment = 1
expand_icon = true
[node name="NineSquarePlantBtn" type="Button" parent="Grid"]
custom_minimum_size = Vector2(100, 100)
layout_mode = 2
theme_override_colors/font_color = Color(0, 1, 1, 1)
theme_override_font_sizes/font_size = 20
text = "九宫格
种植"
icon_alignment = 1
expand_icon = true
[node name="CrossPlantBtn" type="Button" parent="Grid"]
custom_minimum_size = Vector2(100, 100)
layout_mode = 2
theme_override_colors/font_color = Color(1, 0.54902, 0, 1)
theme_override_font_sizes/font_size = 20
text = "十字法
种植"
icon_alignment = 1
expand_icon = true
[node name="RandomPlantBtn" type="Button" parent="Grid"]
custom_minimum_size = Vector2(100, 100)
layout_mode = 2
theme_override_colors/font_color = Color(1, 0.49586, 0.63552, 1)
theme_override_font_sizes/font_size = 20
text = "随机种植"
icon_alignment = 1
expand_icon = true
[connection signal="pressed" from="Quit_Button" to="." method="_on_quit_button_pressed"]

View File

@@ -0,0 +1,163 @@
[gd_scene load_steps=3 format=3 uid="uid://dpiy0aim20n2h"]
[ext_resource type="Script" uid="uid://ccaqrb6sdwbux" path="res://Script/SmallPanel/OnlineGiftPanel.gd" id="1_i0ga4"]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_i0ga4"]
border_width_left = 15
border_width_top = 15
border_width_right = 15
border_width_bottom = 15
corner_radius_top_left = 20
corner_radius_top_right = 20
corner_radius_bottom_right = 20
corner_radius_bottom_left = 20
corner_detail = 20
shadow_size = 20
[node name="OnlineGiftPanel" type="Panel"]
offset_left = 395.0
offset_top = 140.0
offset_right = 1008.0
offset_bottom = 474.0
theme_override_styles/panel = SubResource("StyleBoxFlat_i0ga4")
script = ExtResource("1_i0ga4")
[node name="Quit_Button" type="Button" parent="."]
layout_mode = 0
offset_left = 543.0
offset_top = 21.0
offset_right = 593.0
offset_bottom = 71.0
theme_override_font_sizes/font_size = 30
text = "X"
[node name="HBox" type="HBoxContainer" parent="."]
layout_mode = 0
offset_right = 40.0
offset_bottom = 40.0
[node name="Title" type="Label" parent="."]
modulate = Color(0.996846, 0.629335, 1, 1)
layout_mode = 2
offset_right = 613.0
offset_bottom = 65.0
theme_override_colors/font_shadow_color = Color(0, 0, 0, 1)
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
theme_override_constants/shadow_offset_x = 3
theme_override_constants/shadow_offset_y = 3
theme_override_constants/outline_size = 10
theme_override_constants/shadow_outline_size = 10
theme_override_font_sizes/font_size = 30
text = "在线礼包"
horizontal_alignment = 1
vertical_alignment = 1
[node name="Grid" type="GridContainer" parent="."]
layout_mode = 2
offset_left = 49.0
offset_top = 93.0
offset_right = 565.0
offset_bottom = 297.0
columns = 5
[node name="OneMinute" type="Button" parent="Grid"]
custom_minimum_size = Vector2(100, 100)
layout_mode = 2
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
theme_override_colors/font_color = Color(1, 0, 0, 1)
theme_override_colors/font_focus_color = Color(0, 0, 0, 1)
theme_override_colors/font_pressed_color = Color(0, 0, 0, 1)
theme_override_font_sizes/font_size = 20
text = "在线
1分钟"
icon_alignment = 1
expand_icon = true
[node name="ThreeMinutes" type="Button" parent="Grid"]
custom_minimum_size = Vector2(100, 100)
layout_mode = 2
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
theme_override_colors/font_color = Color(0.995313, 0.515623, 0.748044, 1)
theme_override_colors/font_focus_color = Color(0, 0, 0, 1)
theme_override_colors/font_pressed_color = Color(0, 0, 0, 1)
theme_override_font_sizes/font_size = 20
text = "在线
3分钟"
icon_alignment = 1
expand_icon = true
[node name="FiveMinutes" type="Button" parent="Grid"]
custom_minimum_size = Vector2(100, 100)
layout_mode = 2
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
theme_override_colors/font_color = Color(0.635294, 0.827451, 0.537255, 1)
theme_override_colors/font_focus_color = Color(0, 0, 0, 1)
theme_override_colors/font_pressed_color = Color(0, 0, 0, 1)
theme_override_font_sizes/font_size = 20
text = "在线
5分钟"
icon_alignment = 1
expand_icon = true
[node name="TenMinutes" type="Button" parent="Grid"]
custom_minimum_size = Vector2(100, 100)
layout_mode = 2
theme_override_colors/font_color = Color(0.760784, 0.533333, 0.160784, 1)
theme_override_colors/font_focus_color = Color(0, 0, 0, 1)
theme_override_colors/font_pressed_color = Color(0, 0, 0, 1)
theme_override_font_sizes/font_size = 20
text = "在线
10分钟"
icon_alignment = 1
expand_icon = true
[node name="ThirtyMinutes" type="Button" parent="Grid"]
custom_minimum_size = Vector2(100, 100)
layout_mode = 2
theme_override_colors/font_color = Color(0.870588, 0.870588, 0, 1)
theme_override_colors/font_focus_color = Color(0, 0, 0, 1)
theme_override_colors/font_pressed_color = Color(0, 0, 0, 1)
theme_override_font_sizes/font_size = 20
text = "在线
30分钟"
icon_alignment = 1
expand_icon = true
[node name="OneHour" type="Button" parent="Grid"]
custom_minimum_size = Vector2(100, 100)
layout_mode = 2
theme_override_colors/font_color = Color(0.188235, 0.839216, 0.243137, 1)
theme_override_colors/font_focus_color = Color(0, 0, 0, 1)
theme_override_colors/font_pressed_color = Color(0, 0, 0, 1)
theme_override_font_sizes/font_size = 20
text = "在线
1小时"
icon_alignment = 1
expand_icon = true
[node name="ThreeHours" type="Button" parent="Grid"]
custom_minimum_size = Vector2(100, 100)
layout_mode = 2
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
theme_override_colors/font_color = Color(0, 0.87451, 0.87451, 1)
theme_override_colors/font_focus_color = Color(0, 0, 0, 1)
theme_override_colors/font_pressed_color = Color(0, 0, 0, 1)
theme_override_font_sizes/font_size = 20
text = "在线
3小时"
icon_alignment = 1
expand_icon = true
[node name="FiveHours" type="Button" parent="Grid"]
custom_minimum_size = Vector2(100, 100)
layout_mode = 2
theme_override_colors/font_color = Color(0.509804, 0.301961, 0.85098, 1)
theme_override_colors/font_focus_color = Color(0, 0, 0, 1)
theme_override_colors/font_pressed_color = Color(0, 0, 0, 1)
theme_override_font_sizes/font_size = 20
text = "在线
5小时"
icon_alignment = 1
expand_icon = true
[connection signal="pressed" from="Quit_Button" to="." method="_on_quit_button_pressed"]