2020-03-01 23:18:15 +00:00
|
|
|
extends Spatial
|
|
|
|
|
|
|
|
|
|
|
|
var players = {} # keys are String, values are Players
|
|
|
|
const Player = preload("res://Scenes/Player.tscn")
|
|
|
|
|
|
|
|
remote func place_player(player_id : int, position : Vector3, rotation : Vector3) -> void:
|
|
|
|
get_parent().console_print('Placing player with id: ' + String(player_id))
|
|
|
|
var player = Player.instance()
|
|
|
|
player.translation = position
|
|
|
|
player.rotation = rotation
|
|
|
|
add_child(player)
|
|
|
|
players[player_id] = player
|
2020-04-18 17:26:09 +00:00
|
|
|
if player_id == get_tree().get_network_unique_id():
|
|
|
|
player.is_local = true
|
|
|
|
get_parent().console_print('Setting player with id (' + String(player_id) + ') as local')
|
|
|
|
player.init()
|
2020-03-01 23:18:15 +00:00
|
|
|
|
|
|
|
func init():
|
|
|
|
get_parent().arena_ready()
|