Very nice, Steve. Next version: with curved sides for that perfect hour-glass shape!
As it’s designed, it should work with any design you want, already. Change the values on DrawHourGlass, and you’ll see how it resizes and reshapes itself already.
The trick is in the FillWithSand routine, which works as a directional PAINT and only paints up, left, and right. As it’s painting, it counts the pixels (grains of sand) and saves the x/y information in RemoveSand... As time elapses, it simply removes the “sand” in the opposite order it drew them.
All you need for this to work with ANY shape “filled timepiece” is a center point where the program can “fill” upwards with sand/liquid/lava, and then “drip” down from that center point until it fills the bottom.
If you have a nice hourglass image, just plug it in with _PUTIMAGE where DrawHourGlass is called, and center it’s middle at the proper point, and you can customize it to whatever aesthetic you desire. ;)