Random Lines


Random Lines


January 10, 2021

example p5.js javascript random animation

This sketch uses the random() function to fill the screen with random lines.

random lines

Remix Ideas

  • Make it so every line starts on one half of the canvas and ends on the other half.
  • Instead of random colors, make every line a different shade of the same color.
  • Make the lines fade over time. Hint: Try adding background(50, 10); to the top of the draw() function!

Animation Examples

Comments

Happy Coding is a community of folks just like you learning about coding.
Do you have a comment or question? Post it here!

Comments are powered by the Happy Coding forum. This page has a corresponding forum post, and replies to that post show up as comments here. Click the button above to go to the forum to post a comment!