feat: 创建了游戏循环管理器

This commit is contained in:
2026-04-05 14:31:16 +08:00
parent c0c92fb2c4
commit 61ce331a00
6 changed files with 36 additions and 4 deletions
+22
View File
@@ -0,0 +1,22 @@
extends Node
var game_round: int = -1
signal end_game
func _ready() -> void:
end_game.connect(_on_end_game)
func start_game() -> void:
game_round = 1
func settle_round() -> void:
game_round += 1
if check_game_end():
end_game.emit()
func check_game_end() -> bool:
return false
func _on_end_game() -> void:
game_round = -1
+1
View File
@@ -0,0 +1 @@
uid://qxowgxfp4iwm
+1 -2
View File
@@ -2,7 +2,7 @@ extends Node
const PORT: int = 8989
const MAX_HAND_SIZE: int = 8
const INITIAL_HP: int = 100
const INITIAL_HP: int = 4
const DEFAULT_DRAW_COUNT: int = 4
const FIRST_ROUND_DRAW_COUNT: int = 3
@@ -19,7 +19,6 @@ var cards: Array[String] = []
var my_card: Array[String] = []
var server_round: int = 0
var client_round: int = 0
var game_started: bool = false
func add_player(id: int) -> void: