Posted April 17, 2025 by lex
I decided to make a little Isopod
I looked up “funky bugs” and saw this little guy. It reminded me of when I was younger, playing in the backyard with these with my friend K. We called them “rolly pollies” because they roll up into a little ball when spooked. We had so much fun rolling them around. Unfortunately, they were of the woodlice family–their family was deteriorating the structure of the wooden base of the house. Luckily, that was Not Our Problem! Look at this little cutie. (imgcred)
Sitting at 91 lines of code I was extremely uncomfortable with how redundant and long the code got–but for the sake of the code looking like the bug I persevered.
The code will go through some sort of shortening, quite like the bug itself rolling up into a ball. That realization alone gave me the motivation to finish the form in this way.
Here I am next day to work on it. leg time!
wow i hate that the code looks like this. makes it extremely difficult to classify. SO, off I went to get the relationship of every point to the center of the canvas so I can make this thing draw anywhere.
that took an hour but now I we get a random family every time you load the canvas
My only issues with this is it’s inconsistencies generating on the canvas, I’d add legs, a little function to make them move around randomly, and I’d set a timer to randomly make them roll into balls.
Integrating vectors should do the trick. plus a little ball class. https://natureofcode.com/vectors/