godot-webrtc-mplayer-testing/global.gd

24 lines
444 B
GDScript3
Raw Normal View History

2021-11-15 15:43:33 -06:00
extends Node
2021-11-15 16:25:13 -06:00
const MultiplayerClient = preload("multiplayer_client.gd")
2021-11-15 15:43:33 -06:00
2021-11-15 16:25:13 -06:00
onready var client = MultiplayerClient.new()
2021-11-15 15:43:33 -06:00
func _ready():
2021-11-15 16:25:13 -06:00
add_child(client)
2021-11-15 15:43:33 -06:00
2021-11-17 08:18:12 -06:00
func goto_scene(scene_resource_name):
var _result = get_tree().change_scene("res://%s.tscn" % scene_resource_name)
2021-11-15 16:25:13 -06:00
2021-11-17 08:18:12 -06:00
func main_menu():
goto_scene("main")
2021-11-15 16:25:13 -06:00
2021-11-17 08:18:12 -06:00
func start_singleplayer_game():
goto_scene("game")
2021-11-15 15:43:33 -06:00
2021-11-17 08:18:12 -06:00
func multiplayer():
goto_scene("multiplayer")
2021-11-15 16:25:13 -06:00
2021-11-17 08:18:12 -06:00
func quit():
get_tree().quit()