Skip to content

feat(scoring): Implement penalty for 'Reveal 1 Pair' hint usage (#39)#66

Open
EDWIN-ADAMS-V wants to merge 3 commits into
avinash201199:mainfrom
EDWIN-ADAMS-V:feature/issue-39-penalty
Open

feat(scoring): Implement penalty for 'Reveal 1 Pair' hint usage (#39)#66
EDWIN-ADAMS-V wants to merge 3 commits into
avinash201199:mainfrom
EDWIN-ADAMS-V:feature/issue-39-penalty

Conversation

@EDWIN-ADAMS-V
Copy link
Copy Markdown

feat(scoring): Implement penalty for 'Reveal 1 Pair' hint usage (#39)

Summary

This Pull Request implements a scoring penalty for using the "Reveal 1 Pair" hint button in app.js. This is necessary to ensure fair scoring and accurate high score tracking, addressing Issue #39.

Why This Change is Needed

The hint provides a significant competitive advantage. Without a penalty, players could easily achieve the highest 3-star rating and top leaderboard spots by relying on the hint rather than pure memory. The penalty ensures that top scores are reserved for unassisted play.

What Has Changed (Penalty Logic)

  1. Move Penalty:
    • When the hint button is clicked, 10 moves are immediately added to the player's total moves count.
  2. Star Rating Cap:
    • A new state variable (hintUsed) is introduced to track if the hint was pressed during the game.
    • If hintUsed is true, the maximum achievable Star Rating is capped at 2 stars, regardless of the total move count. This prevents earning a perfect 3-star score while using assistance.
  3. UI Feedback:
    • The Win Modal now includes a specific message if the hint was used, informing the player that their score was capped at 2 stars.

Files Modified

  • src/js/app.js: Implementation of hintUsed state, penalty logic in the hint button's event listener, and updated star calculation/modal content.

@EDWIN-ADAMS-V
Copy link
Copy Markdown
Author

Hello @avinash201199 bro,
I have successfully implemented the solution for the issue that you have assigned me.
"Implement penalty for 'Reveal 1 Pair' hint usage".
So that user will play the game properly, without shortcuts!!
Thankyou !!

@avinash201199
Copy link
Copy Markdown
Owner

Please resolve the conflicts

@avinash201199
Copy link
Copy Markdown
Owner

and add the video of the changes

@EDWIN-ADAMS-V
Copy link
Copy Markdown
Author

Changes.in.Demo.1.mp4

Here is the visual Demo of the issue i have raised and the solution i have solved it!!

@avinash201199
Copy link
Copy Markdown
Owner

Please resolve the conflicts

@EDWIN-ADAMS-V
Copy link
Copy Markdown
Author

Hi bro !!
I have resolved the conflicts !!
Please check it out @avinash201199 bro!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants