Answer the question
In order to leave comments, you need to log in
How to open cells where there are no bombs for the Minesweeper game?
I'm writing a sapper game in JavaFX, I can't figure it out.
There is a field of squares. Any square can be accessed through the grid along the x and y axes:
grid.get(0, 3);
grid.get(0, Y_TILES);
Each square has an int variable, this is the number of bombs around;
grid.get(0,0).bombsAround.
When clicking on a square that has bombsAround==0, I want all neighboring squares that also have 0 to open. The game is already working, but you just have to poke many times where there are no bombs.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question