Open memon07 opened 5 years ago
This happens on any board size when you have the max number of black holes. You auto win with a very large score (which is actually a bad score as lower number is better)
Same as issue #428
I don't consider auto-win a bug. If you configure the game to be instantly winnable, then it'll be instantly winnable.
The score thing is worth fixing though.
@jakearchibald it looks like gameChange.playMode goes from Pending straight to Won and never sets newState.startTime = Date.now() in onGameChange() within /src/services/preact-canvas/components/game/index.tsx on line 255
if (gameChange.playMode === PlayMode.Playing) { newState.startTime = Date.now(); }
Then when the game ends since start time never got set and defaults to 0.
newState.completeTime
= Date.now() - this.state.startTime === something like 1557345844946
`
Which is what I am seeing in my IndexDB for my high score records.
On a side note it dosnt really make sense to be able to create a game with ( width X height - 9) black holes as you instantly win due to the fact that you dont allow the users first click to ever be a black hole. As the dude from issue #428 suggested maybe _maxMines should === (width X height - 10) to avoid this edge case all together.
This is really useful info, thanks for taking a look!
Debug info
Describe the bug While clicking on a default matrix say [4,2] ,[2,2] ,[2,3] ,[2,4] you win by default by an arbitrary number (high score is printed).It seems that the code misses the bomb displaying cells as it was expected.
To Reproduce Steps to reproduce the behavior:
Expected behavior On clicking the cell it should show a mine , empty field or a bomb.