Skip to content

mrjordantanner/throw-six

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

'Throw Six' 🎲

a Dice Game by Jordan T Smith

In 'Throw Six', six dice are thrown and the player and computer alternate turns. Points are gained for every 1 or 5 thrown, for three or more of a kind, and for straights. The first player to earn 5000 points is the winner.

Throw-Six-GIF-2

How to Play 🎲

A player's turn always begins by throwing all six dice. The player then must set aside scoring dice, and at least one scoring die must always be set aside. Then the player can throw the remaining dice again and the situation repeats. Scoring combinations are counted only for the current throw.

Click the 'Throw 6' button to throw six dice. If you rolled any scoring dice, they'll have colored borders around them. Click at least one scoring die to move it to your scoring area, then choose to either 'Stand' and collect your earnings for the round or take your chances and roll the remaining dice to attempt to earn more points. Repeat until all dice have been scored or the player 'Busts' by not rolling any scoring dice, thus losing all their points for that round.

Screen Shot 2021-02-25 at 9 11 25 AM

'Busting' means rolling no scoring dice and losing any points earned that round.

Scoring 🧮

  • Single 1 = 100 points
  • Single 5 = 50 points
  • Three of a kind = 100 points multiplied by the face value of the dice
  • Four or more of a kind = double the points of three of a kind, and so on
  • Three 1's = 1,000 points
  • Full Straight 1-6 = 1500 points
  • Partial Straight 1-5 = 500 points
  • Partial Straight 2-6 = 750 points

Screen Shot 2021-02-25 at 8 31 51 AM

Under the Hood ⚙️

After creating and rolling the dice objects, the game checks for any straights, three or more of a kind, or single 1's or 5's. If it finds any, it assigns each group of dice to a 'Scoring Group' and gives it the appropriate point value. Single scoring dice are given their own group and are treated the same way as a group.

As the player clicks dice groups to move them to the scoring area, their point values are added to the running total for the round until they decide to 'Stand' and collect, or keep rolling and bust.


Screenshots & Wireframes

dice-sketch-1

Screen Shot 2021-02-20 at 6 28 06 PM

Screen Shot 2021-02-22 at 2 13 36 PM

Screen Shot 2021-02-23 at 1 51 51 PM

Screen Shot 2021-02-23 at 4 21 04 PM

Screen Shot 2021-02-25 at 8 30 20 AM


Technologies Used 🧩

HTML | CSS | JavasScript

Hurdles

This game was built entirely from scratch for the General Assembly Software Engineering Immersive Unit 1 Project. One of the main challenges in designing the logic for this game was properly identifying the scoring dice in all situations and to be able to treat the dice as groups, not individual dice. The randomized motion of the dice presented a challenge as well.

User Stories 🙋‍♀️

  • As someone who enjoys tabletop games, I want to play a digital version of a dice game that automatically keeps track of dice point values for me.
  • As a gambler, I want to enjoy the risk vs. reward that comes along with games of chance.

Planned Features ▶️

If this project is expanded upon further, I plan to add:

  • Title screen and menu
  • Full sound effects and music
  • Custom color schemes and dice colors
  • All dice in scoring group are highlighted when one member of the group is hovered over
  • A more detailed tooltip appears on mouseover over certain key items to provide more information to the user.

Known Issues 🦠

  • Sometimes clicking on dice doesn't register

Credits ✅

  • This application was written entirely by me, Jordan Smith, unless otherwise cited in the code.

  • The game concept and rules come from a mini-game in the video game "Kingdom Come."

Installation Instructions

  • Simply fork and clone this repository.