Inspiration for the game:
I had the opportunity to live and work in Vegas for a few years. It was great fun! But one thing I soon learned was that most Casino games (slot machines etc.) favor the house, with the exception of a few. So, I wanted to create a game of chance between 2 or more players that truly is a game of chance, with no favoratism for the House. The game is designed to be completely random and illustrate the randomness of the outcomes. Dice outcomes get assigned completely random numbers. After multiple rounds have been played one should expect to see a completely random pattern of winners.
How to play the game:
Players get prompted for their names and choose the number of rounds they wish to play. Each player starts with a wallet of $1,000. Players place bets for each round of play. The bets get reflected in the pot. Players simultaneousy roll a pair of dice, and the player with the highest roll for the round wins the round and the pot. In the event of a tie roll, the players roll again. The player with the most winnings at the end of the designated number of rounds wins the game. If a player goes broke before the designated number of rounds is met, then the game is over.
Game Controls:
-
Start New Game button - a new game is initiated by clicking this button. Players are then prompted for their names and the number of rounds they wish to play.
-
Place Bets for Round button - Players then click this button to be prompted for their bet for the round. The pot reflects the bets and players' wallets get adjusted.
-
Roll the Dice - players then click this button to simultsneously roll a pair of dice. The player with the highest roll wins the round and the pot. In the event of a tie roll the players roll again. The players' wallets get adjusted to reflect the outcome. Players then click on the "Place Bets for Round" button to begin the next round.
Technologies used to build the game: please note links to references/sources of code below are footnoted in the code comments.
- HTML
- Javascript
- CSS
- VS Code
- Github
- Chrome web browser
- Google Search Engine
Unfinished functionality/outststanding bugs:
- Total score and winner tracker.
- Tracking bets from round to round (same as above).
- Input parameters for bets (players must not be able to place bets for more than their current wallet).
- Start New Game Button - clear cache and values for new game. Currently the browser page must be refreshed to clear values of current game and start a new game.
- Styling - Players currently get displyed vertically and are to be shown horizontally. Layout also is being adjusted for easier viewing.
- Special effects - sound of dice rolling, other effects still needs to be installed.
- Dice need to be placed/referenced in the assets folder - correct path adjusted.
- Style.css needs to be cleaned up. Currently contains sandbox code that is not used.