My first cart release. Ever. Just a little tool I built for myself, because I thought all of the desktop clocks and stopwatches I found for Windows were ugly. Therefore, meet Retro Clock, a nixie-inspired desktop clock and stopwatch for the PICO-8 fantasy console:
It shows the time in a pleasant, retro-futuristic way. It shows your current system time and the corresponding offset to UTC, as well as the current date. If you press the UP
button, you can toggle between daylight saving time (DST) or normal time.
Pressing X
will bring up stopwatch mode. You can start and stop the stopwatch by pressing X
. Pressing X
again will resume where the stopwatch left off. Pressing O
resets the stopwatch. You can return to the simpler clock-only view by pressing LEFT
.
The visuals are based on a nixie clock I own that uses old Soviet IN-16 tubes.
Special thanks go out to @Krystman! I learned a lot from watching his tutorials and none of the horrible code in this mess is his fault.
Clock Mode:
Stopwatch Mode:
A web version of this program is available here: https://fab.industries/pico-8-tools/clock/
To Do List
As you can tell by the version number, the thing isn't finished yet. I would appreciate some testing. You can follow the development (and see the full source code) here: https://github.com/fab-industries/retro-clock
- FIXME: Currently the app only works for about 9 hours, before PICO-8's
time()
function loops around into the negative and blows everything to hell - TODO: Make buttons light up when pressed
- TODO: Sounds?
Credits
Idea, art & code: Fabian A. Scherschel
Release Notes
v0.02 (25/02/2024): Stopwatch and clock displays now synchronised
v0.01 (22/02/2024): Initial release
Published a small update following a request by a user who pointed out that the clock and stopwatch should update their displays at the same time. Looks much smoother now.
Also, there's now another web version of this cart available at my website: https://fab.industries/pico-8-tools/clock/
Nice looking nixie tubes.
I feel you're a bit severe with the poor time() function : it's doing it's very best and even when it loops around, you still get meaningful results when doing end_time-start_time, as long as the interval does not go over the 9 hours. The real culprit is the 16.16 bits format of pico numbers. Safest is to just use stat() and not time(), but an alternative way to avoid the problem could be to have the stopwatch be MM:SS:XX and max out and stop at 99:59:99
If you go this route, for things to look more realistic, you could add a random +0, +0.01 or +0.02 to the real timer so that the last digit cycles between all 10 digits instead of being 0 3 7 0 3 7...
@RealShadowCaster Yeah, I've been thinking about how to do this. Thanks for giving me a few ideas! I will tackle this at some point... I am quite new at Lua and PICO-8, so please forgive my crowbar approach... :D
[Please log in to post a comment]