Ok, I’m probably just missing out on some obvious programming method, but I’ve been stuck on this for a bit and I need to ask for some help.
Basically, I’m creating a puzzle game. I have a class that I’ve defined that is the puzzle itself. From my main game, I can call initPuzzle(args) and have a puzzle start up.
My problem is figuring out how to either return success/failure from the puzzle object or in some other way notify the main game that the puzzle has completed.
The initPuzzle function simply sets up the puzzle with appropriate parameters – it is a void function and I don’t think there’s any way to return from it since I have other functions checking the puzzle constantly to see if it has been completed or not.
For this particular issue, I want to be able to call as series of puzzles in a row and time the performance across all of them. This requires my main game to know when the puzzle has finished so we can create a new one.
Does any of this make sense? Am I missing something obvious? Thanks in advance for the help!