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 trial


Problems with instantiating order and referencing in JavaFX Snake game


I'm working on this Snake game, but i have some problems.

My Game class is a singleton, which is given a reference to the view controller, so the game has access to data about window size and so. But I'm not able to control whether the controller class is instantiated before I'm reaching in for some data.

The project is on my github. Run the program, and you will be led straight to the problem. https://github.com/danielbjorkholm/dB_SnakeGame_FX

Maybe I've missed something ? Feel free to contribute to the project or give a guess to have I can solve this challenging and exciting problem :)