Build a simple clicker game. It should have the following requirements:
- Display the current score to the user, starting from a score of
0
- Use the exact text:
Current Score:
followed by the score.
- Use the exact text:
- Clicking a button increments the score by one
- The button text should have the exact text:
+1
- The button text should have the exact text:
- Have a button where the user can spend
10
points to increase the value of each click by1
- The button should have the exact text:
Pay 10 points to change from +1 to +2
- Display an
alert
with the exact textYou can't afford that!
if the user doesn't have enough points to spend - If the user has enough points, reduce the score by 10, and add
1
to points you add to your score each time you click the button. - The button text should change as well, for example from
+1
to+2
- The pay button text should also update, for example from
Pay 10 points to change from +1 to +2
toPay 10 points to change from +2 to +3
- The button should have the exact text:
- When the user has
100
or more points, display a victory screen- There should be an
<h2>
element with the exact textYou Win!
- There should be a button with the text
Play again?
(including the question mark)- Clicking on this button starts the game over again with a score of 0, a
+1
button, etc.
- Clicking on this button starts the game over again with a score of 0, a
- Keep the user's score on the screen
- Do not show the buttons to add to the score or pay points.
- There should be an
- Fork this repo
- Clone the forked repository
cd
to the directory where you cloned itnpm install
to install dependenciesnpm run cypress
to open the cypress testing windownpm test
to run jest / node tests
Note: Remember to
git add
,git commit
andgit push
regularly
- When finished, commit and push your work.
- Make a pull request on github.
- Submit the link to your pull request on Canvas.
[Additional instructions]