IxLab(Young) – Robert (Haochen Xiong) – Recitation 7 – Processing Animation

Recitation Exercise

I chose to draw and animate something new from recitation 6.  I wanted to make a small model of the video game because “keyPressed” function kept giving me this feeling. So I decided to make my own processing plane game. 

Drawing my plane and making it move with “keyPressed” function was quite easy. However, it took me a long time to think about how it can fire bullets every time I press “space”? I first used the same method to draw a circle bullet. I wrote its keyPressed function as if I press the space, y (the ordinate of the bullet) will keep adding 3. My mistake was that I used the same ordinate for both my plane and the bullet so that my plane would also fly straight forward when I pressed space. So I added new parameters for the bullet but then I had problems attaching the bullet to the plane. After a long time struggle, I fixed the bullet problem by not giving it an exact location in the beginning and making it fire straight forward at the real-time point of the plane. After this recitation exercise, I get a better understanding of the “keyPressed” both in an “if” statement and its own function. Also, I am now clear about the parameter setting in processing. It is important to clarify when a couple of parameters should only work inside a single function or the whole code. After learning the “Array”, I added more random ellipses as planets so that each time you open this “game” you will see a new map. I did this because I think novelty plays an important role in games. New maps mean new challenges and this will allow players to keep playing the game.

Recitation Homework

When I first saw the gif, I thought that was made by the movement of two ellipses. However, I gave up this idea because I found it was almost impossible. Then I thought it might be the change of stroke and the reference page the “stroke” function confirmed it.  I first drew the circle and made it move by the method I used for my plane. Then I make it periodically expand and contract by giving “if’ statement to the radius. Finally, I made it color change by using the colorMode and stroke function. However, I didn’t figure out how to edge a border for it. 

Leave a Reply