Had an idea for a quick game to toss up this week. Tanks, but on a spherical planet. This means you will be able to shoot around the planet, and possibly even shoot yourself. It seems pretty gimmicky, but won’t take too long to make so it shouldn’t interfere with the Project2 roguelike.
a basic planetoid
I’m using a basic midpoint offset algorithm to generate the terrain, and then using some trig and primitives to make it into a planetoid shape.
From here I began to implement the tanks.
For the simplicity of collisions, I’m treating everything as if the game is flat, and then just drawing it in the relevant position around the circle. To do the wrapping, I simply ‘teleport’ the tank to the other side of the flat representation of the world, so it appears as if they’re seamlessly orbiting the planet.
The code looks something like this:
I set the tank’s y-coordinate to the current height of the planet underneath it.
some “tanks” added around the planet
And with the tanks rotated to the correct normals, it’s starting to look fairly decent.
That’s all I’ve got for tonight. I’ll continue to work on this and keep you guys updated over the next few days. I’m also fairly busy trying to get some database stuff to work with the site, and also fixing that front page, so I can’t guarantee the tank game will have priority. I will try to keep working on it though.
And because I feel like it, a tiny little moon: