NOC – Week3: Vectors – Skye Gao

Link for assignment 3:  https://editor.p5js.org/Skye/present/pOTCz1Dow

For this assignment, I first played around with vectors.sub(), vector.normalize() and vector. must(). Based on the class example which measures the vector length, I tried to make a click-shooting effect.  For this part, I first tried to draw a moving ellipse simply by adding an If (mouseIsPressed) function and attached the vector of line to the ellipse. However, I can make the shooting happened only when mouse is pressed. I also tried to use the function mouseClicked(), but I cannot transfer the value from one function to another. To modify that I further added a object class to separate the balls, which made the effect happen successfully.

From the shooting effect, I then tried to make a Buzzle Bobble style interaction, thus I added another class to create several rectangles as obstacles moving above the gun. However, I got stuck again when trying to compare the exposition of each ellipse and rectangle. I did not figure it out till the end so I just kept the sketch as what it was, and hopefully I will figure this out soon.

Leave a Reply