Spielerando

Make shadows get longer toward evening and swing from one side to the other

A farm or garden game with a day cycle feels dead when the shadows stay the same. If you stretch them with a simple factor, they become absurdly long at sunrise and sunset, or flip when the sun goes down. Here is how to tie the shadow to the sun's height and keep it tame at the edges of the day.

Why this works

A shadow is just the sun's position seen from the object: low sun, long shadow; sun on the left, shadow on the right. If the sun follows an arch through the day, length and direction come out together without any extra rules.

When not to use it

Not for a flat game with a fixed light or when a shadow is part of a puzzle. Then the light source should stay where the level designer put it, so players can rely on where the shadow falls.

In the full entry

  • What to build, step by step
  • Starting values and the reason for each
  • 3 common mistakes and the fix
  • 34 lines of example code with 4 checks that pass
  • How your AI shows you that it works

Say this to your AI

Use the Spielerando entry "Make shadows get longer toward evening and swing from one side to the other" (read_entry shadows-grow-and-swing-with-the-sun-through-the-day) in my game. Build it step by step, and show me how you checked that it works.

Or skip this and connect the MCP: your AI then finds all of this by itself.Connect the MCP