NOC – Week 2: OOP – Keyin Wu(Quoey)

Here is the link for my week 2 assignment.

Based on work in week 1, I added more elements and properties to my balls. The changes doesn’t have certain exact meanings because at first I just wanted to explore functions as many as possible.  Firstly, I created an object array to add more balls instead of having only one. And to make them more colorful, I changed the color but still kept certain color style. Instead of the red flicking rectangles, I made balls bounce on all of the sides. But since I made too many changes to their x speed, it was a little mess. So, later I still made them disappear on the boundary and reappear in the middle. 

Since balls are all like falling by gravity, I added the function that the balls will float along the x-axis when the user presses the mouse. Since I changed background in the class method, I also control the number of balls under 100 to make the frames run normally.

Moreover, I added some shaking effect when the balls go up with sin function. And here is a brief demo video:

NOC – Week 2: OOP Balls – Susan Xu

Link: https://editor.p5js.org/Susan_Xu/sketches/7uuXIgW9m

My assignment is based on the snow animation created in class. As I watched the softy, pinky snow falling down the sky, I wanted to add more energy into this sketch. Instead of being light and gentle, these particles can also be rigid and bouncy. They should fall with gravitation, and bouncing back into broken, but also elastic pieces when they crash the ground. On thinking of this, I added gravitation in less than a minute.

The crashing pieces, though, took me more time. They should share some properties with the falling ball, but not exact. Isn’t it an great example for subclass? So I build the class SmallerParticle, inherent from Particle. In this way, I save the time and space for rewriting functions of SmallerParticle.

Keeping the interaction from the class practice, the assignment remind me of popping candy (in a more friendly way) — and it’s strawberry/grape flavor! A little animation is shown below.
Animation: Pinky balls crashing into pieces.

NOC-Week 2: OOP Firefly (Lily)

For this sketch, I used particles to simulate fireflies.

In the class of Particle, there is a constructor that generates objects based on the mouse position, a display method to display all the objects, a move function to move them, and a wind function to make them shake a bit when the mouse is pressed.

I used the model of the snow but changed the larger ellipse to yellow and the smaller ellipse to green. Also, in the display function, I used a random function to make the fireflies twinkle. 

Everything begins with a single click. Then there will be fireflies generated as the mouse moves. And if the mouse is pressed, all of the fireflies will begin to shake.

Nature of Code: Week 1 assignment–Moon(Candy)

Documented by: Candy Bi

Project name: Drawing Board

Professor: Moon

Date: 2/19/2019

final(video version)

For this assignment, I started without an idea of what I want to do, rather I choose to experiment to see what I could get.

I start with a red background with some moving rectangles. I make the background transparent so that the three reactangles could leave trails.

I then draw a white ellipse that would move according to mouse:

1

For some improvments I use the “mouseIsPressed” to create the effect that only when user clicked there would be the white circle:

2

I suddenly came up with the idea to make th white circle a bouncing ball that would bounce whenever it touches the three rectangles. It turned out a failure.

I then shift to the idea of playing around with lines and this is what I got:

3

For better visual effect, I made the other side of the lines ramdom in a certain range ( inside the big rectangle the three black moving rectangles formed). It somehow gives the feeling of modern arts:

final