JESSIE ZHAI

Digital artist

A documentation page of rambling and experimenting.

@jessiehaseyes
jessiejiranzhai@gmail.com
03 FORCES
NOC WEEK2



For the Oscillation assignment, I made a mini game where Ege is freefalling into the waves, and the user would need to use mouseclick to save him.



PROCESS




This week we’re refreshing our memories on sin and cos waves. I thought of the idea of having a little person escaping the waves as it passes by, so I could combine gravity which we learned last week. 

I first created a sin wave using the formula to get the y values at any point in the sin wave, and used five different sin waves to create one single line. I then adjusted the canvas opacity to 10 so I could get some motion blur from the waves. 

To create an ocean effect, I used another array to store all the waves parameters.

I referenced the force example code from the Nature of Code, but instead of the wind force, I used a upward force to influence the freefalling object. So the player can save Ege from falling by clicking on the mouse.

To check if Ege hits the waves on the axis, I used the y value to check if Ege’s body is intersecting with it. Once they intersect, Ege’s body turns 90 degrees.


REFERENCES

Additive Waves - The Nature of Code

Creating a Force - The Nature of Code

 


JESSIEZHAI