Hey smart & beautiful people of juce!
I’m learning c++ and juce and I just love it!
I thought I should try to build a little 2d game but I’m not sure what the best practice/approach would be.
I would like my game to have a few “scenes”. A menu and highscores and a couple of in-game scenes. The smartest way I can think of is to create the scenes as child components to my MainContentComponent where I use switches with a "game-state" integer to update and repaint the relevant scene. Would this be a good way to approach things?
If so, what would be the most elegant way of jumping between the scenes? Going with game data from the in-game scene to highscores scene for example?
It makes a lot of sense to me to create methods in MainContentComponent that I then would call from the child components but I'm too newb to pull that syntax off, I understand how to recieve stuff in the constructor of the child component but how do I create a pointer to the MainContentComponent so that I can send it as an argument?
I obviosly need to learn more c++ and become a better programmer in general but I like hands-on learning and juce is so much fun, I thought I should just throw this out here and hope for some compassionate soul:)