This repository has been archived on 2026-05-26. You can view files and clone it. You cannot open issues or pull requests or push a commit.
2025-07-04 14:24:28 +02:00
|
|
|
class_name GameClient
|
|
|
|
|
extends Node
|
|
|
|
|
|
|
|
|
|
@export var web_client: WebClientTCP
|
2025-07-07 22:40:46 +02:00
|
|
|
@export var start_game_button: Button
|
2025-07-04 14:24:28 +02:00
|
|
|
|
2025-07-07 22:40:46 +02:00
|
|
|
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()
|
2025-07-04 14:24:28 +02:00
|
|
|
|
2025-07-06 19:49:08 +02:00
|
|
|
func _on_start_game_button_pressed() -> void:
|
2025-07-04 14:24:28 +02:00
|
|
|
web_client.start_game()
|
2025-07-06 19:49:08 +02:00
|
|
|
|
|
|
|
|
func _on_create_lobby_button_pressed() -> void:
|
2025-07-07 22:40:46 +02:00
|
|
|
_set_host(true)
|
2025-07-06 19:49:08 +02:00
|
|
|
|
|
|
|
|
func _on_join_lobby_button_pressed() -> void:
|
2025-07-07 22:40:46 +02:00
|
|
|
_set_host(false)
|