Open ghost opened 9 years ago
Yeah currently I'm referencing the level scene for everything that can't be done via global.gd, e.g.:
func _ready():
global = get_node("/root/global")
level = get_node("/root").get_node("Level")
I guess you could add a script for the world yes, and move part of the level variables in there.
Off-topic, but if you like hanging around on IRC, you'll find me idling on Freenode's #kobuge channel together with the other Godot and FLOSS aficionados of @KOBUGE-Games :)
Good stuff! Thanks for that :)
Will jump in to that some time.
One thing I was hoping to do (but had trouble with) was put references to sub-scenes of World in global.gd. For example:
global.gd
var level = get_tree().get_root().get_node("World/Level")
level.gd
var level = get_node("/root/global").level
The problem is that because global.gd is instantiated before the scene tree, global.gd can't find the tree and so it throws a fit.
Any ideas for the best way to implement these references? Perhaps it would be easiest to create a script for World and store them in there.