Simulating planetary rotation
I am working on a pixel art game where I will be displaying planets in a solar system view. These planets are procedurally generated and then "condensed" into sprites to make planets for this view. I am trying to think of the most efficient way to animate the rotation of these planets.
Since I cant generate an animation at runtime (I dont think I can at least, feel free to correct me) so the only option I can think of is to pre-make an animation with the appropriate number of sprites (in this case, 128!) and then replace those sprites at runtime with the sprites of my planet.
Is there a better way to do this? the planet will 128x64 pixel textures, so I think I need 128 different sprites to animate it rotating pixel by pixel. Is there some cool way to simply draw my entire 128x64 sprite but only show a circles worth of it and move that sprite behind this circular "view port" or sorts?
Im sure Ive worded this horribly as coffee still kicking in, but I am curious what yall think
Posted Sep 20, 2017, 2:15 PM UTC
Is it a true top down view? Do you show the top or side view of the planet? If you show the planet from the top you could just have a single top view and rotate it.
no sorry im showing the "side of the planet", though you bring up a good point that in a lot of ways the perspective doesnt make any sense. We see the ship from a top down view.
I think gameplay wise though it makes sense to see it from the side, so you can get an idea of the terrain of the planet before landing on it.
Hmm, makes sense. I don't know of any good method off the top of my head. I guess you can rotate the sides in quarters or eighths. Using some fading to make it flow a little better.
Im gonna just rotate it pixel by pixel, so for a 128 pixel wide texture Ill have 128 different sprites just plugged into a premade 128 piece animation.
seems tedious though :/
It does.. Hopefully, someone can post a better solution.