GoogleChromeLabs / proxx

A game of proximity
https://proxx.app
Apache License 2.0
1.31k stars 124 forks source link

custom board 5x5 issue #431

Open memon07 opened 5 years ago

memon07 commented 5 years ago

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 commented 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

jakearchibald commented 5 years ago

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 commented 5 years ago

@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 commented 5 years ago

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