hexland/Scripts/Lobby.gd

15 lines
353 B
GDScript3
Raw Normal View History

extends Control
func _init():
WebsocketController.connect("hostjoin", self, "_on_hostjoin")
func _ready():
WebsocketController.connect_websocket()
func _on_hostjoin():
var location = JavaScript.get_interface("location")
if location and location.hash != "":
WebsocketController.join_game(location.hash)
else:
WebsocketController.host_game()