feat: 重构棋盘逻辑和游戏流程,将引擎版本提升至4.3
- 重构了 VirtualBoard 类,优化了棋盘操作和事件处理 - 重写了 ChessPiece 类,增加了事件处理和虚拟棋子逻辑 - 更新了 ChessGame 控制器,增加了结束回合功能和对话框 - 调整了场景布局和资源引用 - 清理了冗余代码和注释
This commit is contained in:
@ -1,7 +1,8 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://g40y10iaf7qb"]
|
||||
[gd_scene load_steps=4 format=3 uid="uid://g40y10iaf7qb"]
|
||||
|
||||
[ext_resource type="Script" path="res://Scripts/Controllers/ChessGame.cs" id="1_3x8ac"]
|
||||
[ext_resource type="PackedScene" uid="uid://b1tx7v3230wab" path="res://Scenes/Entities/Chessboard.tscn" id="1_yheur"]
|
||||
[ext_resource type="Theme" uid="uid://intlbeu8h82r" path="res://Asserts/defaultTheme.tres" id="3_rcfhx"]
|
||||
|
||||
[node name="ChessGame" type="Node2D"]
|
||||
script = ExtResource("1_3x8ac")
|
||||
@ -10,29 +11,47 @@ script = ExtResource("1_3x8ac")
|
||||
position = Vector2(360, 660)
|
||||
scale = Vector2(2.5, 2.5)
|
||||
|
||||
[node name="Undo" type="Button" parent="."]
|
||||
offset_left = 200.0
|
||||
offset_top = 50.0
|
||||
offset_right = 300.0
|
||||
offset_bottom = 150.0
|
||||
theme_override_font_sizes/font_size = 32
|
||||
text = "撤回"
|
||||
[node name="Control" type="Control" parent="."]
|
||||
layout_mode = 3
|
||||
anchors_preset = 0
|
||||
offset_right = 40.0
|
||||
offset_bottom = 40.0
|
||||
theme = ExtResource("3_rcfhx")
|
||||
|
||||
[node name="ReInit" type="Button" parent="."]
|
||||
offset_left = 450.0
|
||||
offset_top = 50.0
|
||||
offset_right = 550.0
|
||||
offset_bottom = 150.0
|
||||
theme_override_font_sizes/font_size = 32
|
||||
text = "重开"
|
||||
[node name="Over" type="Button" parent="Control"]
|
||||
layout_mode = 0
|
||||
offset_left = 270.0
|
||||
offset_top = 1105.0
|
||||
offset_right = 449.0
|
||||
offset_bottom = 1209.0
|
||||
text = "结束回合
|
||||
(提示对方结束)"
|
||||
|
||||
[node name="Home" type="Button" parent="."]
|
||||
offset_left = 310.0
|
||||
offset_top = 1108.0
|
||||
offset_right = 412.0
|
||||
offset_bottom = 1226.0
|
||||
[node name="Home" type="Button" parent="Control"]
|
||||
layout_mode = 0
|
||||
offset_left = 55.0
|
||||
offset_top = 56.0
|
||||
offset_right = 157.0
|
||||
offset_bottom = 164.0
|
||||
text = "返回主页"
|
||||
|
||||
[connection signal="pressed" from="Undo" to="." method="Undo"]
|
||||
[connection signal="pressed" from="ReInit" to="." method="ReInit"]
|
||||
[connection signal="pressed" from="Home" to="." method="GoHome"]
|
||||
[node name="Undo" type="Button" parent="Control"]
|
||||
layout_mode = 0
|
||||
offset_left = 319.0
|
||||
offset_top = 58.0
|
||||
offset_right = 419.0
|
||||
offset_bottom = 158.0
|
||||
text = "撤回"
|
||||
|
||||
[node name="ReInit" type="Button" parent="Control"]
|
||||
layout_mode = 0
|
||||
offset_left = 578.0
|
||||
offset_top = 55.0
|
||||
offset_right = 678.0
|
||||
offset_bottom = 155.0
|
||||
text = "重开"
|
||||
|
||||
[connection signal="pressed" from="Control/Over" to="." method="BtnOver"]
|
||||
[connection signal="pressed" from="Control/Home" to="." method="GoHome"]
|
||||
[connection signal="pressed" from="Control/Undo" to="." method="Undo"]
|
||||
[connection signal="pressed" from="Control/ReInit" to="." method="ReInit"]
|
||||
|
Reference in New Issue
Block a user