add 新增远程连接,实现多人游戏
This commit is contained in:
38
Scenes/ChessGame.tscn
Normal file
38
Scenes/ChessGame.tscn
Normal file
@ -0,0 +1,38 @@
|
||||
[gd_scene load_steps=3 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"]
|
||||
|
||||
[node name="ChessGame" type="Node2D"]
|
||||
script = ExtResource("1_3x8ac")
|
||||
|
||||
[node name="Chessboard" parent="." instance=ExtResource("1_yheur")]
|
||||
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="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="Home" type="Button" parent="."]
|
||||
offset_left = 310.0
|
||||
offset_top = 1108.0
|
||||
offset_right = 412.0
|
||||
offset_bottom = 1226.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"]
|
@ -1,8 +0,0 @@
|
||||
[gd_scene load_steps=2 format=3 uid="uid://gkbtavjf2273"]
|
||||
|
||||
[ext_resource type="Script" path="res://Scripts/Entities/ChessPiece.cs" id="2_cj0n3"]
|
||||
|
||||
[node name="Chesspiece" type="Node2D"]
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="."]
|
||||
script = ExtResource("2_cj0n3")
|
10
Scenes/Entities/Chesspiece.tscn
Normal file
10
Scenes/Entities/Chesspiece.tscn
Normal file
@ -0,0 +1,10 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://gkbtavjf2273"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://bthav6cae4fni" path="res://Asserts/ChesspieceBase.tres" id="1_8v1j6"]
|
||||
[ext_resource type="Script" path="res://Scripts/Entities/ChessPiece.cs" id="2_y54gx"]
|
||||
|
||||
[node name="Chesspiece" type="Node2D"]
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="."]
|
||||
texture = ExtResource("1_8v1j6")
|
||||
script = ExtResource("2_y54gx")
|
125
Scenes/Menu.tscn
Normal file
125
Scenes/Menu.tscn
Normal file
@ -0,0 +1,125 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://cl8nkm6j8s8jh"]
|
||||
|
||||
[ext_resource type="Script" path="res://Scripts/Controllers/Menu.cs" id="1_chiyi"]
|
||||
[ext_resource type="Theme" uid="uid://c53fg2fg071yp" path="res://Asserts/defalutTheme.tres" id="1_sg40w"]
|
||||
|
||||
[node name="Menu" type="Control"]
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
theme = ExtResource("1_sg40w")
|
||||
script = ExtResource("1_chiyi")
|
||||
metadata/_edit_horizontal_guides_ = [141.0]
|
||||
|
||||
[node name="Home" type="Button" parent="."]
|
||||
layout_mode = 0
|
||||
offset_left = 49.0
|
||||
offset_top = 100.0
|
||||
offset_right = 171.0
|
||||
offset_bottom = 170.0
|
||||
text = "返回主页"
|
||||
|
||||
[node name="Name" type="Control" parent="."]
|
||||
anchors_preset = 0
|
||||
offset_left = 215.0
|
||||
offset_top = 109.0
|
||||
offset_right = 697.0
|
||||
offset_bottom = 168.0
|
||||
|
||||
[node name="Label" type="Label" parent="Name"]
|
||||
layout_mode = 2
|
||||
offset_left = 2.0
|
||||
offset_top = 1.0
|
||||
offset_right = 80.0
|
||||
offset_bottom = 47.0
|
||||
text = "名字"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="LineEdit" type="LineEdit" parent="Name"]
|
||||
layout_mode = 2
|
||||
offset_left = 93.0
|
||||
offset_right = 320.0
|
||||
offset_bottom = 50.0
|
||||
|
||||
[node name="Button" type="Button" parent="Name"]
|
||||
layout_mode = 0
|
||||
offset_left = 340.0
|
||||
offset_top = 3.0
|
||||
offset_right = 428.0
|
||||
offset_bottom = 55.0
|
||||
text = "确认修改
|
||||
"
|
||||
|
||||
[node name="Server" type="Control" parent="."]
|
||||
anchors_preset = 0
|
||||
offset_left = 19.0
|
||||
offset_top = 184.0
|
||||
offset_right = 705.0
|
||||
offset_bottom = 1198.0
|
||||
|
||||
[node name="ItemList" type="ItemList" parent="Server"]
|
||||
layout_mode = 0
|
||||
offset_top = 120.0
|
||||
offset_right = 663.0
|
||||
offset_bottom = 965.0
|
||||
|
||||
[node name="ConnectServer" type="Button" parent="Server"]
|
||||
layout_mode = 0
|
||||
offset_left = 297.0
|
||||
offset_top = 17.0
|
||||
offset_right = 517.0
|
||||
offset_bottom = 90.0
|
||||
text = "重连服务器"
|
||||
|
||||
[node name="Flush" type="Button" parent="Server"]
|
||||
layout_mode = 0
|
||||
offset_left = 535.0
|
||||
offset_top = 17.0
|
||||
offset_right = 652.0
|
||||
offset_bottom = 81.0
|
||||
text = "Flush"
|
||||
|
||||
[node name="ColorRect" type="ColorRect" parent="Server"]
|
||||
layout_mode = 0
|
||||
offset_left = 236.0
|
||||
offset_top = 35.0
|
||||
offset_right = 276.0
|
||||
offset_bottom = 75.0
|
||||
|
||||
[node name="Label" type="Label" parent="Server"]
|
||||
layout_mode = 0
|
||||
offset_left = 19.0
|
||||
offset_top = 37.0
|
||||
offset_right = 229.0
|
||||
offset_bottom = 79.0
|
||||
text = "服务器连接状态"
|
||||
|
||||
[node name="Dialogs" type="Control" parent="."]
|
||||
anchors_preset = 0
|
||||
|
||||
[node name="AcceptDialog" type="AcceptDialog" parent="Dialogs"]
|
||||
initial_position = 2
|
||||
size = Vector2i(100, 118)
|
||||
|
||||
[node name="PopupMenu" type="PopupMenu" parent="Dialogs"]
|
||||
|
||||
[node name="ConfirmationDialog" type="ConfirmationDialog" parent="Dialogs"]
|
||||
initial_position = 2
|
||||
size = Vector2i(200, 118)
|
||||
|
||||
[node name="URL" type="LineEdit" parent="."]
|
||||
layout_mode = 0
|
||||
offset_left = 22.0
|
||||
offset_top = 1166.0
|
||||
offset_right = 662.0
|
||||
offset_bottom = 1247.0
|
||||
|
||||
[connection signal="pressed" from="Home" to="." method="goToHome"]
|
||||
[connection signal="pressed" from="Name/Button" to="." method="EnterName"]
|
||||
[connection signal="item_activated" from="Server/ItemList" to="." method="OnItemSelected"]
|
||||
[connection signal="pressed" from="Server/ConnectServer" to="." method="Connect"]
|
||||
[connection signal="pressed" from="Server/Flush" to="." method="FlushData"]
|
3
Scenes/web.tscn
Normal file
3
Scenes/web.tscn
Normal file
@ -0,0 +1,3 @@
|
||||
[gd_scene format=3 uid="uid://dp044iptyvvh"]
|
||||
|
||||
[node name="Web" type="Node"]
|
Reference in New Issue
Block a user