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

View File

@ -35,6 +35,7 @@ public partial class ChessPiece : Sprite2D {
if (isSelected) {
return;
}
GD.Print($"{arrPos} is selected");
this.Transform *= transToSeleted;
this.isSelected = true;
}
@ -43,6 +44,7 @@ public partial class ChessPiece : Sprite2D {
if (!isSelected) {
return;
}
GD.Print($"{arrPos} is deselected");
this.Transform *= transToSeleted.AffineInverse();
this.isSelected = false;
}
@ -54,7 +56,7 @@ public partial class ChessPiece : Sprite2D {
private void InitLabel() {
// this.Texture.ResourcePath = "res://Asserts/ChesspieceBase.tres";
this.Texture = (Texture2D)ResourceLoader.Load("res://Asserts/ChesspieceBase.tres");
this.Texture ??= (Texture2D)ResourceLoader.Load("res://Asserts/ChesspieceBase.tres");
textureSize = this.Texture.GetSize();
Vector2 labalPosition = new(
-textureSize.X / 2,