Skip to content

2b. Random Dots

Description

Use what we have learned about random() and variables to make a sketch similar to the one below. Your sketch should add dots with different levels of opacity in random positions across the canvas.

Hint: You'll need 3 variables for your x, y, and alpha value.

Challenge: Make the color of of the dots vary slightly (you'll need to make more variables for this functionality!)

Challenge: Make the program reset on mouse click.

Steps to begin:

  1. Consider how you can use the draw loop to draw a dot in a different position each time it is called.
  2. Consider what variables you'll need.
  3. Consider how you can assign random values to variables while your program is running.