Playing individual scenes for testing, (locked door part 2, currently lesson 77)

I admire Yann’s persistance to test the lock panel in game. I quickly gave that up and added popup_centered() to _ready() to test the scene in isolation. After finishing the lesson I tried to find a way to automatically determine if the scene was played in isolation, and if so, have the panel show up automatically. Eventually, I came up with this:
onready var testing = get_tree().get_root().get_children().find(self) >= 0
I added an if statement to _ready() for popup_centered() and will do the same for the door opening code later.
Are there better ways to do this?

Privacy & Terms