FINAL

Luke Siegert
2 min readMay 4, 2021

My first idea was to create an apple tree that incorporated a for loop that render a grid of apples and then drop them once a certain interaction was performed. It was inspired by the examples of falling object codes we had looked over before and had been something I wanted to make at the beginning of the class. The tree was a simple set of conditionals that I found online that let you customize your tree using a group of “if” and “Let” statements to be able to have the branch stem from a number of factors I chose like the amount of levels, branches and angles of the tree. After that, I first made the apples using a class, then turning it into an array to display a large number of them. The issue soon arose of how I would then nest that class in order for the apples to be able to stay stationary until they dropped. So I improvised and turned the apples into a nested for loop, but still wanted some sort of interaction that made them go away so I incorporated a task that made the apples smaller when the mouse was hovering over, or near the tree and they grow bigger when the mouse hovers further away. Still needing to incorporate a game class I redid my apple game object and turned it into an insect so it followed my mouse. The finished product is an interactive rendering of an apple tree that grows the apples larger when the insects are away, but shrinks them when they are on or near the tree. The only complications I had with the final product is that I wasn’t able to remove two apples from the for loop that aren’t connected to the tree so it appears like 2 floating apples, which I would’ve thought might have been easy but learned it was rather complicated to do without ruining my other stuff. Also, I learned that adding adding my game class to a pre written code should probably be the last thing I do in order to not damage any of the existing sketch.

Example of a fractal tree, similar to the one I used. Could not find the original.
My desired outcome for the interaction

Final Product Above

--

--