- Working Process
At first, I just played with the example code, modifying it from a scenario where a ball falls from the air into the water to one where raindrops fall into the water, creating ripples and bubbles upon impact.
Next, I made adjustments to the water level: when the first raindrop falls into the water, the water level begins to rise, and after reaching a certain height, it stabilizes.
Then, I added wind force: both the raindrops and the ripples (bubbles) are influenced by the wind, causing them to sway from side to side.
[This is how everything looks like so far.]
Time Machine Dududu!😬
—Hi, hi, hi! It’s Luna on Feb. 21. The code above can only cause the wind to change its angle with the wind. Yet, it’s going straight down (its Xpos doesn’t have any changes). That’s not how raindrops are alike in real life. Thus, Prof.Moon gave me the suggestion and hint in class to use the “this.angle=this.vel.heading()” function such that the Xpos of raindrops will also change along with the wind 😀
Time Machine: Back to February 19th!😎
Then, I wanted the bubbles to collide and burst after reaching a certain depth, but I didn’t know how to implement collision and bursting without causing all adjacent bubbles to burst when one bubble touches two others. So, I asked ChatGPT how to code it. Based on its code and annotations, I obtained the following code:
I changed the background color and added blendMode(add) to the rain. And the scene felt very much like snowfall on a dark night.
At this moment, I recalled a picture book from my childhood memories: “Les Petites Poules” (which tells the story of little chickens, often incorporating the element of ladders to connect spaces), as well as a series of monochromatic IPs like “Pingu.” An idea struck me.
“Les Petites Poules”
“Pingu”
It (the idea) is developing… (below are my sketches from Procreate.)
I decided to create two completely different worlds using similar functions:
On the surface, there’s a raging blizzard. (Mainly composed of Class Rain)
Underground, there’s a sheltered house blocking out the wind and snow. (Mainly composed of Class Fire)
There’s a layer of walls separating them. (Walls)
[ladders and walls]
What connects the two worlds is a rope ladder (string) on the surface and a ladder (ladder) underground. The ladder swings with the wind, and my intuition tells me that the direction of the swinging for the ladder on the surface and the ladder underground should be opposite (perhaps because I feel it’s like twisting a towel, where forces need to balance).
I placed some wood underground. The fires can be lit up there and fly into the sky when key “f” is pressed.
[woods]
[The fires are generated around the piles of wood.]
On the surface, rain and snow are falling, while underground, a campfire is lit, resembling fireflies.
Their functions and forces involved are quite similar, but with different vector values and calculations, they produce opposite effects.
[I have some confusion about the dragForce in water. I will discuss it in the reflections part.]
[The dist function in fire is set to prevent the fire from going into the cat’s eyes. The cat hasn’t shown up in this blog yet.]
I linked the brightness of the house with the number of activated fires. When the underground house is lit up, we can see a big cat inside that goes from looking grumpy to happy. Its level of happiness is also linked to the length of fires.
Its ears, eyes, and philtrum also change with the wind direction, displaying different postures of expansion and compression ( having to do with the direction of the ladder underground. It would be great if you take the ladder as the scarf of the cat.^^)
- Finished Work
- Photos
[You are an explorer. On this day, the sky started drizzling with sleet. You feel cold.]
[Aww! You find a ladder. Climbing down, you see a cave with several piles of wood inside. Thus, you try to drill wood for fire.]
[The room is gradually lit up. Wait! There’s something inside…]
[Ohh! It’s a cat.]
[Ah! The cat becomes happier with the room gradually lighting up!]
[“Miao” says the cat (which means thank you in human language).]
[Suddenly, the wind starts to blow~]
[But it’s okay. Whatever direction the wind comes, the cat can protect you, the house and of course, itself, with its magic body!]
- Video
- Reflections/Lessons Learned
1️⃣ Explored various forces, including the comical expansion and contraction force of the cat, lol.
2️⃣ Learned how forces should be applied to the movement of objects, especially regarding the use of vectors.
3️⃣ Although Prof. Moon helped me resolve an issue in one area, I still don’t understand why the console constantly shows that there’s a problem with my drag force in the water.
—- Hopefully, I can fully understand the function soon and write the cause of the problem here TT—-
- Link to the Sketch (Click it!) (It’s the revised ver with the function “this.angle=this.vel.heading()” Hahaha!)
Leave a Reply