godot-webrtc-mplayer-testing/global.gd
2021-11-17 13:57:45 -06:00

31 lines
546 B
GDScript

extends Node
const MultiplayerClient = preload("multiplayer_client.gd")
onready var client = MultiplayerClient.new()
func _ready():
add_child(client)
func goto_scene(scene_resource_name):
var _result = get_tree().change_scene("res://%s.tscn" % scene_resource_name)
func main_menu():
client.close()
goto_scene("main")
func start_singleplayer_game():
client.close()
goto_scene("game")
func lobby_browser():
client.close()
goto_scene("multiplayer")
func lobby():
goto_scene("lobby")
func quit():
client.close()
get_tree().quit()