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

Try to stay close to the topic of this episode. Use the Processing forums for help with unrelated Processing projects (or hire me for help ;-)

To indicate that a word in your comment is code, use the `backtick`. Example
  Do `float` and `int` smell similar?
To highlight code blocks, use ```processing and ``` like this:
  void setup() {
    size(600, 600);