Reorganizing the code

Screen Shot 2021-10-07 at 2.01.12 AM.png

This week’s goal is to reorganize the code and try to keep setup() and draw() as clean as possible. I picked the project I did last week. The whole point of it is trying to separate the old code into small pieces and put them into multiple functions and recall them in different functions.

One thing I am still confused about is the last question of the worksheet. I try to use the function I created (assigned with variable coordination multiple times) in draw(), but they always overlapped no matter how I change the location or the size of the ball. I wonder why that keeps happening.

↳Here is the link

Previous
Previous

Bouncing Faces

Next
Next

Create repetition :)