This week I had one main goal– to code my entire sketch from scratch and to make sure I understood all of the logic within the code. I was getting worried that I was making sketches and getting code to work, but not really understand how and why. This is very important to me, especially as we progress in P5 and then eventually into other programming languages. Rather than starting to code and seeing where it takes me, I decided to draw out what I wanted to make and try to create algorithms to make things happen the way I wanted.
It began with an idea to have a ball bounce up the left side of a triangle and have a ball roll down the right side. But after I got the ball to roll, I became uninspired and brainstorm a new idea.
I started thinking about moving balls on the bottom of the screen. In order to get a ball to move back and forth to a certain point, I knew I had to do some math and figure out how to do that.
Although this took all of my memory of geometry and most of my brain power, I was so happy with myself. From there I was able to get a few balls moving to a certain point and then back again. I used the triangle as a guide.
Once I had that, I decided to add more balls to the equation. Still using 4 triangles as my guide.
After this, I wanted to make the balls increase in size every time they are clicked. However, in order to do this, I need to understand how to do this. I created a separate sketch to make one single, un-animated ball enlarge when clicked. Soon enough, I changed my idea to have the balls disappear when clicked. In order to do this, I just made the balls change to the same color as the background.