Learn creative coding writing simple programs

9. Change screen size, animate colorful lines

We modify the last program we did (animated white vertical lines on black background) to make it more colorful. We see how to use the random function with two parameters instead of one. This way we get a random nomber that is between a minimum and a maximum value.
We also show how to change the screen size using the size() function to make it larger. When we don't use the size() function, the screen is by default 100 pixels wide and 100 pixels tall.

Tags: size, animation, random

Code editor

You can make changes to the code below. Then
Questions and comments are welcome! :) But please try to stay close to the topic of this episode. Use the Processing forums for help with your Processing projects (or hire me for help ;-)