I decided to use function draw() to create automatically updated colorful bubbles using p5.
- I first used the random() function to create bubbles that appear in random positions on the screen with random colors.
- I also want to make the bubbles appear randomly in different sizes within a certain range.
- I found that the bubbles would be circles or ellipses randomly. But I want them to be circles in different sizes. So I used “let” to assign x with a certain range of numbers and put x in ellipse().
- I also want the bubbles to be a little bit transparent. I looked up in p5 and learned about alpha that controls the opacity of colors.
- I adjusted the size of the bubbles to make them smaller like little dots and used “windowWidth” and “WindowHeight”so that the effect looks better.