add 新增远程连接,实现多人游戏

This commit is contained in:
ZZY
2024-06-27 15:02:57 +08:00
parent d892cd6c0e
commit 9a79bef410
23 changed files with 1167 additions and 211 deletions

26
Main.cs
View File

@ -28,15 +28,35 @@ public partial class Main : Node2D
// GetNode<Node2D>("Chessboard").Scale = new Vector2(scaleFactor, scaleFactor);
// }
// Called when the node enters the scene tree for the first time.
// Called when the node enters the scene tree for the first time.
Global global = null;
public override void _Ready() {
// GetTree().Connect("screen_resized", ResizeChessboardToFitScreen);
// Button undo = GetNode<Button>("Undo");
// undo.Connect("pressed", (event) => {
// });
// ChessBoard board = GetNodeAndResource("res://res/ChessBoard.tscn");
// ChessBoard board1 = GetChild<ChessBoard>(0);
// board.Visible = false;
// board.Can
global = GetNode<Global>("/root/Global");
}
// Called every frame. 'delta' is the elapsed time since the previous frame.
public override void _Process(double delta) {
// Called every frame. 'delta' is the elapsed time since the previous frame.
public override void _Process(double delta) {
}
private void GoToSignlePlayer() {
// global.GotoScene("res://Scenes/SinglePlayer.tscn");
global.GotoScene("res://Scenes/ChessGame.tscn");
}
private void GoToMultiPlayer() {
// global.GotoScene("res://Scenes/MultiPlayer.tscn");
global.GotoScene("res://Scenes/Menu.tscn");
}
private void goToMenu() {
}
}