Making things too difficult
I seem to make things too hard to do when I''m thinking of solutions to a problem. I''m trying to make a minesweeper-type game, I have the algorithm worked out to create the board, you know, the numbers and bombs underneath the squares, and I got some help about another algorithm. Well, I''m trying to figure out how to get this going with the graphical end of it. What''s the best way to set up the squares on the board? Also, I was thinking about using matrices, if I do use this idea, how would I hook up the info in the matrices with the clicking of the squares? Any kind of help would be highly appreciated.
Bill
Well, you could create a 2 dimensional array defining the info for each square. A mouse position can be converted to a square by dividing x by the width of each square and dividing y by the height of each square. Given the x y index of the square clicked on, you can then run your algorithm (whatever that is and whatever you want it to do) through the matrix to see what the effects are. Once you know what squares will be affected, call a draw routine for the squares which will be visibly altered, once again using an x y index for each square to redraw each square which requires redrawing.
![](http://www.bryan.1-sh.com/gallery/images/banner2.JPG)
Edited by - bishop_pass on May 5, 2001 12:05:08 PM
Edited by - bishop_pass on May 5, 2001 12:05:08 PM
_______________________________
"To understand the horse you'll find that you're going to be working on yourself. The horse will give you the answers and he will question you to see if you are sure or not."
- Ray Hunt, in Think Harmony With Horses
ALU - SHRDLU - WORDNET - CYC - SWALE - AM - CD - J.M. - K.S. | CAA - BCHA - AQHA - APHA - R.H. - T.D. | 395 - SPS - GORDIE - SCMA - R.M. - G.R. - V.C. - C.F.
"To understand the horse you'll find that you're going to be working on yourself. The horse will give you the answers and he will question you to see if you are sure or not."
- Ray Hunt, in Think Harmony With Horses
ALU - SHRDLU - WORDNET - CYC - SWALE - AM - CD - J.M. - K.S. | CAA - BCHA - AQHA - APHA - R.H. - T.D. | 395 - SPS - GORDIE - SCMA - R.M. - G.R. - V.C. - C.F.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement