forked from interstellar_development/freettrpg
18 lines
263 B
GDScript3
18 lines
263 B
GDScript3
|
extends Node2D
|
||
|
|
||
|
var playerAmount=2
|
||
|
var playerIndex=0
|
||
|
var objectName
|
||
|
|
||
|
func _ready():
|
||
|
next()
|
||
|
|
||
|
func next():
|
||
|
if playerIndex >= playerAmount:
|
||
|
playerIndex = 0
|
||
|
objectName= "player%d" % playerIndex
|
||
|
print(objectName)
|
||
|
get_node(objectName).start()
|
||
|
playerIndex += 1
|
||
|
|