extends MultiplayerSpawner


var spawn_points : Array = []

func _enter_tree() -> void:
	spawn_points = $SpawnPoints.get_children()

func add_player(player : MultiplayerPC) -> void:
	add_child(player)
	if player.player_id == 1:
		player.global_position = spawn_points[0].global_position
		if Multiplayer.multiplayer.is_server():
			Game.player = player
	else:
		player.global_position = spawn_points[1].global_position
		if !Multiplayer.multiplayer.is_server():
			Game.player = player
