Code:
https://github.com/JooooosephY/Recitation-10/tree/master/animation
Introduction:
For recitation 10, we attended the workshop for map() function and we could choose another workshop based on our interest. Since my group decides to make a game for the final project, the way to organize the code is really important. Thus, I attended the Object-Oriented Programming workshop. In the workshop, Tristan taught us something about class. Basically, he showed us how to code as well as why we should do it in this way. In this sense, we can directly see the structure of the code so that we can understand OOP well. As for the exercise, we were required to use OOP to write an animation with some interaction at some level. Besides, we also need to use the map() function when we wrote the code. Here are the videos about how my exercise looks like.
Basically, when you press the space on the keyboard, it will generate several crying faces with different colors and sizes from random positions. And the speed of each face depends on where the mouse is when you press the space. And I map the position of the mouse to the speed of the faces. Thus, when you interact with it, it seems all the new faces are moving towards the mouse.