Interactive City: Alien Solar System

image1

For my second project I chose to create an alien solar system. My solar system has eight planets rotating around the sun. I also integrated my sunspots code from earlier in the semester and used it to create both sunspots on the sun and twinkling stars in the background.

I ran into several difficulties with my code while creating this project. Originally I had a flawed understanding of multiple transforms and made the mistake of having each planet translate to a different place. Once I fixed that I ran into another issue; all of my planets were rotating around the sun in straight line. The solution for this was to have all of the planets rotate at different speeds. The code I used to create the sunspots and the stars uses multiple transforms and randomness to determine the size and location of the sunspots and stars as well as the color of the sunspots.

image3

By far the biggest problem that I ran into was the interaction that I wanted. My ambition was to use code to create a new planet of a random size and color every time the user clicked down. However, the mousePressed() and keyPressed() codes only work while the user holds down the key or mouse and would create a planet whose size and color fluctuated. I was unfortunately unable to fix this problem.

However, even without the interaction that I wanted to create, this code is extremely interesting to watch. Ever changing, it transfixes the audience and creates a magic circle.

image2

Author: Talila Tobias