It fits in with OOP because the game object should be global - it's the only one that can (and should) be accessed by every class.
🎉 Celebrating 25 Years of GameDev.net! 🎉
Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!
A little help with oop
The next thing I would do is use the standard windows menu classes for implementing a menu for this type of game. It will place your menu object in the windows framework which will allow easier access to Game->Board.
Once the Game is running and you have setup a Board you primarily should work within the Board class and its members to perform the individual user functions. A array of tiles(or tile objects) would work nicely here with member functions corresponding to selecting and matching the tiles up.
The Game class should track things that are needed to setup a board, and maybe the time the user has spent playing. Anything that is actually on the board surface should be tracked and manipulated using the board object and possibly a tile object.
These are just my thoughts on the whole subject. I hope they help.
Kressilac
------------------
Derek Licciardi
But thanks anyway.
The game itself is actually finished, but I need a way for Board to tell Game if it is finished and in what way(no more moves left or really finished) and also how long it took.
Each class is defined in an other file to keep it readible. But now i want to be able to change variables in Game from within Board and Menu. I use return variables right now but that is not good enough. I want to be able to call a member funtions from Game from within Board. Should I use extern Game in my file with the board class or pass a pointer to my Game object to Board when I create Board?
Also would this be a correct way for making a game (using a game object that keeps track of the status of everything) or is this normaly done in a completely ohter way.
Hope anybody can understand what I mean
As for your menu situation since this is more a piece of the GUI then it is a piece of the game, you might want to try to make the menu global as well. This will allow you to access the menu function in the same manner you do the game functions. *shrug*
Kressilac
ps When your input/output routine finds that board is flagged completed it should then perform the cleanup necessary to finish the game.
[This message has been edited by kressilac (edited November 24, 1999).]