Want to contribute? Fork me on Codeberg.org!
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
570 B

1 year ago
extends Node2D
@export var player_scene: PackedScene
# Called when the node enters the scene tree for the first time.
func _ready():
var spawn_points = get_tree().get_nodes_in_group("PlayerSpawnPoint")
for i in GameManager.players:
var current_player: Node2D = player_scene.instantiate()
current_player.name = str(GameManager.players[i].id)
current_player.global_position = spawn_points[i % len(spawn_points)].global_position
add_child(current_player)
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
pass