Dear GameDev.tv Team,
I have a question about what Ben means by the term ‘scoreboard’ in the section of the video noted in the attached screenshot.
At about 6:06 into the video, Ben says that all of the enemies (with the Enemy.cs script attached) are finding references to the ‘scoreboard’. I am confused as to specifically what does he mean by ‘scoreboard’ because we have a game object by that name, along with code-line 11 (ScoreBoard scoreBoard;), and a script named ScoreBoard.cs.
Line 17 sets our variable scoreBoard equal to FindObjectOfType. I think that this is setting our variable to the full value of the ScoreBoard class? But then in the screenshot that I’ve attached, Ben is drawing lines from the enemy ships down to the game object named Canvas>Text (which he will later rename). I think he is actually referring to the ScoreBoard class which is attached to the game object (named ScoreBoard.cs) - but this is confusing to a beginner.
I know it may be good practice for a seasoned programmer to reuse words - but for me it would be better, in terms of learning, if the class, the variable and the game object did not all have the same name (that is, same name when spoken b/c I can’t hear the capital letters in the voiceover instruction).
If possible, please clarify which ‘scoreboard’ is being referred to in the screenshot?
And I would also be curious to know why the practice is to name things in C# like this: ScoreBoard scoreBoard;
Thanks!