Continued from [part one](/2010/07/summer-project-weeks-1-3/), more details about my quest to make a fun game about shooting things into space.
### Week 4
Took the week off.
### Week 5
I only got a little bit done this week, but it makes things look better. Each astronomical body has a rotational rate that controls how it is drawn, and projectiles always rotate to face the direction of their movement. I know that you actually need an aerodynamic projectile which is inside an atmosphere to have this happen, but it’s aesthetically pleasing, so I’m keeping it for now. I’ll revisit it if I have any clever ideas when I’m making self-propelled projectiles.
### Weeks 6 & 7
These two weeks got eaten up preparing for and recovering from Otakon.
### Week 8
This week I rejiggered a bunch of the numbers for the solar system I was using so that my planets were actually close enough to one another and large enough that you can actually see them all. Previously I was using values from our real solar system, which gave me a set of stable orbits, but everything was so far apart that I had to assign the planets pixel-based sizes to make them even be visible. I now have a much smaller set of numbers, where everything is in much closer together. I then made a random map generator based on these new numbers. I also added a whole mess of asteroids to the maps so that I can have them swinging around. So that I can get the same random numbers and thus the same map on any platform, I grabbed a Mersenne Twister library to use in the project. No more crappy libc rand() implementations for me.
After that, I started on something a lot cooler – collisions between objects. Objects now bounce off of each other like pool balls, which can result in a fun mess if I send a planet careening through a mass of asteroids. I also had a bit of fun bouncing two planets in the same orbit off of each other, although slight imprecisions in the math resulted in their orbits eventually degenerating into an unusual arrangement, as you can see in these screenshots:
Finally, as you may have noticed if you were playing a lot of attention to those screenshots, I ported my work over to the Mac. Now that I have a laptop again, it only makes sense to keep this project cross-platform. Since all the tools and libraries I’m using are cross platform, it was only a minor inconveniece to set everything up.
### Week 9
Didn’t get anything done again. I’m rapidly running out of summer.