Open onceadrog opened 6 years ago
Proposed solutions.
Ignore this problem for now, don't render a shadow. Heck, Earth can just be a blue-green circle. Early development is about getting to the minimum viable product. You don't want to burn out fixing cosmetic issues before you know the core gameplay is engaging.
Have a (completely lit) earth sprite. On top of that, place a different semicirculular 'shadow' sprite. Rotate the shadow sprite with the sun.
Have one sprite of the earth completely in daytime. Have another of the earth completely at nighttime. For each point on the sprite, calculate a "Percent illuminated" value. Generate a third composite sprite, with a pixel value of (Percent Illuminated Day Sprite) + (1-Percent Illuminated) Night Sprite.
My plan is to take it out for now, (and go back to the fully illuminated globe (90KB) but come back to it later with a proper solution.
Currently the Earth sprite has 360 frames (for each degree rotation). There must be a better way to apply shadow.