freettrpg/scripts/mapscript.gd
Patrick_Pluto e5911fd155 Version: 0.0.1
First major release, refined the creator, added stats to the main game, added a menu to view stats.
2024-06-15 20:33:37 +02:00

18 lines
307 B
GDScript

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()
get_node(objectName).loadJSON(playerIndex)
playerIndex += 1