1
1
mirror of https://github.com/Rundll86/Dog-Lynx-And-HCN.git synced 2026-06-01 00:41:54 +08:00

feat(多人游戏): 添加多人游戏功能及相关UI组件

- 在WorldManager中初始化ENetMultiplayerPeer
- 移除EntityBase中冗余的peer初始化
- 添加多人游戏面板及相关输入控件
- 更新难度显示格式为范围表示
- 为主题添加LineEdit字体大小设置
This commit is contained in:
2025-11-05 22:29:11 +08:00
parent e64a8b2f9f
commit 5efa92f5df
5 changed files with 90 additions and 13 deletions
+1 -1
View File
@@ -12,5 +12,5 @@ func _ready():
UIState.closeCurrentPanel()
)
func _physics_process(_delta):
levelShow.text = "%s/10" % diffEdit.value
levelShow.text = "%d ∈ [%d, %d]" % [diffEdit.value, diffEdit.min_value, diffEdit.max_value]
GameRule.difficulty = diffEdit.value
-1
View File
@@ -104,7 +104,6 @@ var currentStage: int = 0
var spawnTime: float = 0
func _ready():
var peer=ENetMultiplayerPeer.new()
spawnTime = WorldManager.getTime()
register()
var selfStatebar: EntityStateBar = $"%statebar"
+2
View File
@@ -4,11 +4,13 @@ class_name WorldManager
static var rootNode: Node2D
static var tree: SceneTree
static var runningTime: int = 0
static var peer: ENetMultiplayerPeer
func _ready():
tree = get_tree()
rootNode = self
ComponentManager.init()
peer = ENetMultiplayerPeer.new()
func _physics_process(delta):
runningTime += delta * 1000
if EntityBase.mobCount() == 0 and runningTime > 3000: