Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

custom board 5x5 issue #431

Open
memon07 opened this issue May 8, 2019 · 4 comments
Open

custom board 5x5 issue #431

memon07 opened this issue May 8, 2019 · 4 comments
Labels
bug Something isn't working

Comments

@memon07
Copy link

memon07 commented May 8, 2019

Debug info
proxx

PROXXagame

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:

  1. Go to 'proxx.app'
  2. Click on 'custom title 5 width 5 height'
  3. Scroll down to 'start'
  4. Click on the above mentioned cells mentioned above.
  5. See error

Expected behavior
On clicking the cell it should show a mine , empty field or a bomb.

@GifCo
Copy link

GifCo commented May 8, 2019

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

@jakearchibald
Copy link
Contributor

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.

@GifCo
Copy link

GifCo commented May 8, 2019

@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.

@jakearchibald
Copy link
Contributor

This is really useful info, thanks for taking a look!

@kosamari kosamari added the bug Something isn't working label May 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants