added multiplayer connection. TODO: Sync Inventory values. Disable moving of other color tiles
This commit is contained in:
parent
e8cd148bc7
commit
3de181134d
13 changed files with 360 additions and 67 deletions
21
UI/join_menu.gd
Normal file
21
UI/join_menu.gd
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
extends Control
|
||||
|
||||
@onready var lobby_code_input = $PanelContainer/MarginContainer/VBoxContainer/HBoxContainer/LobbyCodeInput
|
||||
|
||||
func _ready():
|
||||
WSClient.lobby_joined.connect(_on_lobby_joined)
|
||||
|
||||
func _on_lobby_joined(lobby: String) -> void:
|
||||
GameData.lobby_code = lobby
|
||||
|
||||
get_tree().change_scene_to_file("res://Multiplayer/Multiplayer.tscn")
|
||||
|
||||
func _process(delta):
|
||||
pass
|
||||
|
||||
func _on_back_button_pressed():
|
||||
get_tree().change_scene_to_file("res://main_menu.tscn")
|
||||
|
||||
func _on_connect_button_pressed():
|
||||
GameData.is_player_black = true
|
||||
WSClient.start(GameData.WEBSOCKET_ENDPOINT, lobby_code_input.text)
|
||||
Loading…
Add table
Add a link
Reference in a new issue