NOC Week 6: Midterm Proposal and Forces Practice – Andrew Joslyn

Midterm Proposal Slides

Sketch: https://editor.p5js.org/adj311/sketches/kCSfl4ZjN

For this week’s sketch, I wanted to focus on figuring out collision between walls/rectangles and ball objects, since that will be a large part of my midterm project. I also wanted to toy with the idea of taking a seemingly simple game and making it complex and frustrating. So for this week’s sketch I decided to make a simple game where you have to keep a ball bouncing, but made the coefficient of restitution slightly below 0, forcing the player to move their paddle upwards in order to keep the ball in the air. I didn’t add a  point or health system, but doing so would have been quite easy, something like:

function decreaseHealth() {

health -= healthDown;

if (health <= 0) { gameOver(); }

}

I think the game is pretty challenging. The more you try to push the ball up, the more it moves and snakes around your paddle. I had fun with this little game.

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

Documented by: Candy Bi

Project name: Table Tennis

Professor: Moon

Date: 3/26/2019

Link: https://editor.p5js.org/candy/present/Fa4vDtNzZ

Video: w6

Since we have learned about collision. I really want to imitate such effect as I encounter in real life. I think of table tennis.

I place the 15 balls each by each to form the triangle. Collision fuction is add to each ball by checking the distance between one with other.

To fake the balls going down into the hole. I check the position of each ball and make its size 0 if it is in the black area.

Then I try to  make the balls bouncing on the edges. Two vectors(vx,vy) are created to imitate the bouncing on a solid edge in real life:  vector1.x and vector.y do not change at same time.

Then I add the cue so that the game would be more complete.

By pressing, user add a force to the white ball and thus white ball get a velocity just like in real life when we play table tennis.

NOC WEEK 6

code: https://editor.p5js.org/DianaXu/sketches/ynjS3zcAC

I replaced circles with lines and created two “creatures”. I set GRAVITY to 800 to make the points stay closed to each other. I restricted the attraction range to 100 so the attraction force wouldn’t go crazy. I also added force between the red and white creature, so the red creature will stay away from the white creature all the time. 

NOC – Week 6: Forces pt. 2 – Katie Pellegrino

Assignment 6

Link to Assignment
Inspiration:

For this assignment, I created what might be the foundation for my midterm constellation project. This project is inspired, and based heavily on, Dynamic Constellations, by Diego Garcia. Following his code, along with referencing our code from class and from Nature of Code examples, was extremely helpful to better understanding gravitational attraction along with how to draw lines between different particles.

constellation

Concept:

Essentially, this sketch draws a particle whenever the user clicks on the screen. Each particle uses gravitational attraction to attract each other and has various randomized masses. Once the particles are within a certain distance of each other, a line is drawn between them. 

Additionally, I added a collision detection function which highlights the particles when they overlap, or ‘collide.’ 

Ideas:

For my midterm project, I really hope to work with building a constellation-like atmosphere and visual. This first step really helped me to understand some of the fundamental methods that will need to be implemented in my midterm project, however, further concepts that I’d like to explore include expansion into the 3D, not only providing collision detection but also preventing collisions, and possibly using oscillations to manipulate a smooth size change in the particles.

NOC – Week 6: Collision and Infection – Susan Xu

Sketch

I continued the code from class with balls attracting to and colliding with each other. I changed checkEdge() to make balls bounce off the wall with restitution (it can also cope with some crazy velocity scenarios). I extends a class Electron that is constructed with pos and vel, depending on mouse position and movement.

Newly created small red balls hitting yellow balls

Besides, I played the collision with the color of the ball in this sketch. The electrons will “infect” the yellow balls as the number of collision accumulates. In the end, all balls in the screen will turn red.

Yellow balls turning orange then to red.