August 15, 2025

Tiny Code Christmas - Day 5

Link to the fifth day

On day 5, we built a animated tunnel effect in 128 bytes.

We addressed each pixel using a coordinates system shifted to the center of the screen.
Using the `math.atan2` we converted the coordinates into a angle and normalized into the range of (0, 15) to get all possible colors.

There is another term for movement inside the tunnel.
For this we have a scaled distance from the origin to the center `999/(x^2 + y^2)`.
Finally we add a time-dependent term for animation.

Link to my solutions

Here is the resulting image: 


 

No comments:

Post a Comment