Skip to content

Instantly share code, notes, and snippets.

@RuyiLi
Last active August 7, 2019 14:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RuyiLi/80baeafd7f70ed2a146d705670c058ac to your computer and use it in GitHub Desktop.
Save RuyiLi/80baeafd7f70ed2a146d705670c058ac to your computer and use it in GitHub Desktop.
Big Assignments

Make sure to use styles!

Choice 1 - Rock Paper Scissors Poker

Rules of the game:

Each player draws five cards (either rock, paper, or scissors) from an unlimited deck. Both players will pick one card, and if one player's cards beat the other (rock beats scissors, paper beats rock, scissors beats paper) then that player wins. If there is a tie (e.g. both play rock) then whoever has more of the chosen card in the hand wins. If they both have the same amount, it is counted as a tie.

As an extra challenge, modify the game so that there are 5 rounds, with a point being awarded each time a player wins. At the end of the five rounds, print the status of the game (either a win, tie, or a loss).

Choice 2 - Music Player

Create a music player using JavaScript's audio capabilities. Use Google and official documentation to obtain relevant methods and events. Add at least 3 mp3 files to your project and put them in a folder, and add three buttons - previous, pause, next, and random. Do not use built-in audio controls; hide the audio element using CSS instead. Pressing the "previous" button should go to the previous song or the last song if the first song has been reached; "next" should go to the next song or the first song if the last song has been reached; "pause" should pause the song and replace the text of the pause button with "play"; "play" should resume the song and replace the text of the play button with "pause"; "random" should start playing a random song out of all of them. Display the name of the song that is currently being played.

For an additional challenge, add a bar that indicates how far into the song you currently are (<progress> element).

Choice 3 - Complete Cookie Clicker

Create a cookie clicker game - similar to the one from one of the previous classes, but this time with items added. You should have at least 3 items, each with certain attributes:

CPS - Each item should give a certain number of cookies per second. The more expensive items should give more cookies per second.
Cost Increment - The increase in price each time an item is bought.
Cost - Each item costs a certain amount of cookies. This price increases by costIncrement each time the item is bought.

The items should be saved in your browser and nothing should be lost upon reloading the page.

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