drawMoon method
Draws the Moon
Most tweakable params should be accessible in the constants at the top
We draw the moon, offset the earth, around it's rotation The shadow is calculated by looking at the suns position And figuring out the opposite angle.
Implementation
void drawMoon(
Canvas canvas, Size size, SpaceViewModel viewModel, SpaceConfig config) {
_imageMap["moon"]?.drawRotatedSquare(
canvas: canvas,
size: viewModel.moonSize,
offset: viewModel.moonOffset,
rotation: viewModel.moonRotation,
paint: standardPaint);
_imageMap["shadow"]?.drawRotatedSquare(
canvas: canvas,
size: viewModel.moonSize,
offset: viewModel.moonOffset,
rotation: viewModel.sunRotation,
paint: standardPaint);
}