JavaScript: Drawing Ghosts

In this assignment, I had to use premade functions that create circles and rectangles to make these ghosts. I first created another function called drawGhost to create each ghost and have the code organized. Then I had input parameters for the information about the ghost we were given; foot radius, head radius, number of feet, etc 1. After that, I called the circle and rectangle function for the head while having the parameters decide where it is through x and y coordinates.

From this assignment, I learned to use every piece of information that I have. In functions, you can input anything through parameters and use that to change the outcome of your function. By using every piece of information I gain the ability to manipulate more data to get the outcome I want without using super long and difficult equations.

JavaScript: Wave of Divs

In this assignment I had to create a wave effect where one box would move down and when it hit the end, the next box moved down, and the current box would move up and repeats the whole way. To do this I made a giant hierarchy of animates where the function of the animate would contain the next animate and that would continue for all of the divs. After the function inside of the function is called I animate again to send it home/I did this so that after they call the next box it sends the box back to where it was and it follows in sync.

Through this assignment I learned to use hierarchy to my advantage when doing different things. This hierarchy is very important and complicated because it lets things run smoothly because of the way the code runs from top to bottom. The way it runs is very strict as well since after each and every function, another one is run right after leading to combined tri-functions.