Continuing to my javascript learning road that I learn from Jonas Schmedtmann on Udemy. This is a small project that I build a game.
It's a game that you can roll the dice and compare the points for 2 players. This is the flowchart.
If a player rolls the dice and gets the value of 1 then it will switch to another player to roll and reset the current point without adding to total point. Also change the active player background. If you choose hold, it will do the same but adding the point to the player total point.
The screen at first when you access the website.
Click new game and the infomation is reset.
!Note: You need to click "new game" first to play. Once a player win, you cannot continue to roll the dice or hold points. I did that with flag variable. I did not command for each line so it's better to read the flowchart to understand what I wrote.
That's all! Have fun.