Dice Coding

Create a Scratch account if you don’t already have one. It requires an email so ask an instructor for help if you don’t have an email.

Visit this Scratch Creation and hit the green Remix button.

This is your default game pieces. Player markers, dice, and a score keeper. Player markers should let you click them and assign a name. Dice should roll a random number. You should be able to add and subtract from any player score.

Coding the Parts

Dice

Every dice needs to have this code. It picks a random number and then cycles through that many sides of the dice.

Player Dot

When you click it, the game will ask your name. You then have to place a block that assigns the answer to the My Name variable. It then says My Name.

Score Change Buttons

When you click it, the game will ask how many points to change your score. The first image is for the Plus symbol. The second is for the Minus symbol

You can change or add to this as needed!