I am looking at the Advanced Game Board Blox sample and would like to detect when there are no more possible moves. How could this be done?
Printable View
I am looking at the Advanced Game Board Blox sample and would like to detect when there are no more possible moves. How could this be done?
You would have to disable all other game mechanic tests and run a loop over the entire board trying out all possible moves. All this shouldn't be recorded or alter the board state. It no valid move was found you know that there was no possible move left.
As a speed optimization you can stop checking for any other valid moves when it finds the first one.
You would have to perform this check after each move for example or whenever it is relevant.