Imaginary Environment
Brief:
I did a little exploring in this code exercise, could I tell a story with code? Is it possible to have connections between different objects so that different movements happen one after the other? Let’s see ;-D.
(Although this story is soooo short and happens soooo quickly)
Inspiration:
(A random photo taken at school 👀)
(my sketch)
I love top view🥰. In this case, almost all objects can be abstracted by basic geometric figure centers!
Process:
Referring to the sample code, I first start to use circles to represent umbrellas and create the collision and flowing effect.
To make it more ideal, I adjusted the amount of force, the radius of the circle and the mass of the different circles.
Once the adjustments were pretty much made, I began to map out an exit route for our other protagonist🟨. I wanted to have a sense of going against the current to find the color purple, which emphasizes the power of friendship even more. So the target of 🟨 should be different from others. And once it is close to 🟪, 🟨’s speed shouldn’t change drastically again. So I detect their distance here.
After that, I start to design the appearance of the umbrella. code here
To mimic the normal dynamics of a person’s umbrella as they walk, I used vector.heading() to indicate the direction in which people are walking.
The most annoying part for me is to code their behavior after they encounter each other. I use a bunch of if statement to determine whether we should take next step😇.
And this is also the first time I called the array of objects within a class, so that the functions cold be applied to a certain object in the array.
combine those together, I get…
For the last part, I draw the crosswalk as the background, add “End” text when 🟨 and 🟪 move away to indicate the story ends. And add another class rain to mimic the rain and also the top view.
Okay, though it looks not very good, I’m still happy that I told a little story in code.
About the Story:
I put this part at last because I’m afraid that this story is not that obvious🙃, and I don want to let what I think limit what you can think.
For me, it has a sad start because our purple color was alone with an umbrella and didn’t know where to go. The purple umbrella is cold and dark, representing the character’s inner confusion. People who cross the road when they’re gray, for whom purple is just in the way.
Yellow appears! Yellow is warm and brings hope to our purple baby. Yellow “swims” upstream against the current and grabs purple’s hand. The moment they met, yellow’s warmth infected purple as well, and instead of purple’s umbrella being only a cold color, yellow was added to it!
And they stay together and continue their stories👀.
The end.
Reference:
NOC sample code https://editor.p5js.org/MOQN/sketches/hyxjIIdCe
Coding train about seeking behavior: https://www.youtube.com/watch?v=p1Ws1ZhG36g&list=PLRqwX-V7Uu6ZV4yEcW3uDwOgGXKUUsPOM&index=39
Special thanks to:
Lisa’s rambling, illogical, pleasure-seeking imagination😇.