🎲 Dice
Let’s say we throw two dice on the ground. What number did we roll?
Now it’s your turn. We need a 6 to win! Copy and modify the code to make these dice always show a 6.
The 🖱 Trick
When you start a new sketch, add this one line to your draw()
loop:
text(mouseX + " • " + mouseY,0,10);
It will let you know where your cursor is, which makes drawing a lot easier.
Roll the Die
- Change the color of your die
- Change the color of the background
- Move the die around the screen
- Add another die
Use line()
, rect()
, and ellipse()
to create your shapes, and fill()
to give them color.
Push yourself for a 4!
Write your name, using the shapes we’ve learned.