Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialPedro Passos
2,453 PointsCan't we just use the methods of the Prompter Class without passing in the game object and just use it's methods?
I am trying to figure out why the Prompter class needs to have the game object passed to it. Can't we just use it's methods without passing the game object in?
1 Answer
Anthony Albertorio
22,624 PointsBut then how would the Prompter know whats going on in the game?
What if we break up the files and change the file structure?
The code is written this way so that it "self documents" in a way. If there is an error, it will tell you, "Hey, you need a game to be going on here, pass one in."