mrjordantanner / throw-six

Dice game built with Vanilla JavaScript
https://mrjordantanner.github.io/throw-six/
1 stars 0 forks source link
css frontend game game-development javascript

'Throw Six' :game_die:

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

Play Here: https://mrjordantanner.github.io/throw-six/

How to Play :game_die:

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 🧮

Under the Hood :gear:

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 :jigsaw:

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 :raising_hand_woman:

Planned Features :arrow_forward:

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

Known Issues :microbe:

Credits :white_check_mark:

Installation Instructions