Thinking about OO programming, an example/question

Soldato
Joined
10 Mar 2006
Posts
3,975
Thinking about how I would implement Minesweeper, when my skills are up to par.

Would a tile be a Class, that you would create instances of to create the area in which to play? You'd presumably have some methods within it to determine at random if it's a mine or a blank tile, to display it's contents when clicked, to determine how many mines are near?

I'm trying to get my head around how you'd practically use classes. What would beyour approach in this case?
 
Also, would you have some kind of class of display controller, that you'd create an instance of? So that would be a means of controlling where the tiles are and where they are created, etc.?
 
Thanks, that makes sense. How about my interpretation of a class of Tiles? Would you also have a Class of 'Score', say, that was an object to keep track of number of moves, score so far, time played, all that jazz?
 
Back
Top Bottom