host client can now start round and send out shuffled cards, server can spread them to all connected clients
This commit is contained in:
+11
-3
@@ -2,14 +2,22 @@ class_name GameClient
|
||||
extends Node
|
||||
|
||||
@export var web_client: WebClientTCP
|
||||
@export var start_game_button: Button
|
||||
|
||||
var is_host: bool = false
|
||||
var _is_host: bool = false
|
||||
|
||||
func _set_host(is_host: bool) -> void:
|
||||
_is_host = is_host
|
||||
if is_host:
|
||||
start_game_button.show()
|
||||
else:
|
||||
start_game_button.hide()
|
||||
|
||||
func _on_start_game_button_pressed() -> void:
|
||||
web_client.start_game()
|
||||
|
||||
func _on_create_lobby_button_pressed() -> void:
|
||||
is_host = true
|
||||
_set_host(true)
|
||||
|
||||
func _on_join_lobby_button_pressed() -> void:
|
||||
is_host = false
|
||||
_set_host(false)
|
||||
|
||||
Reference in New Issue
Block a user