Click here to view this code in the p5 editor.
Click here to view the result by itself.
This sketch shows lines that loop around the screen.
I created this for the 20th day of Genuary which had a prompt of “No loops.” I decided to completely disobey the prompt and go in the opposite direction: yes loops!
- Change the number of loops, the chances that a line goes into a loop, or how each line moves.
- These lines all move to the right when they aren’t looping. Make them follow the mouse instead.
- Let the user add new loopers by dragging the mouse.