Pick Up Sticks

P5 Processing

I'm a paragraph. Click here to add your own text and edit me. It's easy.

P5 Editor: https://editor.p5js.org/izzy_rieken/sketches/2POEqq91O

P5 Present: https://editor.p5js.org/izzy_rieken/present/2POEqq91O


The Goal: create an object oriented program where the pieces each had a life of their own. I wanted to create a program where with each click of the mouse, a new line was drawn and would continually draw across the screen.





Before setup, I declared the Lines array so that the object could be inserted into the array. Declaring the "linecount" as 0 in the beginning declares that there are no lines when the program first begins. I also declared randomColor to be used later in the display function. In setup, I used "frameRate" to change the speed of the animation.




In this class, I only needed x, y and the directions of both x and y. Under display, i included the line objects and the random color generator.


Issues: Originally, I wanted the lines to draw across the screen in a random direction from a random position. However, in my code, I couldn't figure out how to make them stop redrawing with each frame rather than staying in one position.

Arduino Sensor

Screen Shot 2019-11-04 at 12.20.30 PM.pn
Screen Shot 2019-11-04 at 12.19.35 PM.pn