perennialAutodidact / memory-snap

0 stars 0 forks source link

68 set max of two tiles flipped #75

Closed russfraze closed 11 months ago

russfraze commented 1 year ago

## Description of changes The Tile component now uses the useGameContext to access the flipped array in game state. If the tile's faceUp value is true or if there are two tiles already flipped, the tile's onClick should be disabled.

Two tests added to Tile.tests.

Test steps

Click a tile to flip it. Once it is flipped, it should not be able to be clicked again to flip it back to face down.

Click a second tile. Quickly before the timeout either resets or removes ( depending on if its a match ), try to click on any of the other face down tiles. They should not be able to be flipped.

russfraze commented 11 months ago

@perennialAutodidact I think this PR has all the changes we talked about. Let me know what you think.