In this lecture for the challenge I attached a script to my button and used the _pressed()
function directly, because I thought that seemed quite sensible.
The instructor, @Yann_Burrett used a signal to a script attached to the parent node, GameOver.
Could someone explain why this practice is the preferred method?
These are my thoughts leading up to this question:
Previously, @Yann_Burrett offloaded the animation code, specifically to isolate code that only dealt with animation, not player movement, to a separate script. In this situation we appear to be doing the reverse. So why do we want to signal GameOver that a button has been pressed, and not just script the TryAgain button functionality directly?
Thanks!
John