Build a four-hand clock
On this page
WORKED EXAMPLE / CLOCK
Read the four hands#
Gold marks the hour, ivory marks the minute and red marks the second. Cyan marks the alarm at 17 on its 24-hour scale.
Four independent hands drawn by the runtime. The cyan hand is the added alarm.
Add a Dial and choose Clock. Use Start angle 0°, Sweep 360°, Wrap on and 12 1 scale divisions. Use Add hand once. Set every Step to 1. Enter these values into the four hand records.
| Handle ID | Range | Initial | Length¹ | Output variable |
|---|---|---|---|---|
| hour | 0–12 | 10 | 0.48 | hour |
| minute | 0–60 | 9 | 0.76 | minute |
| second | 0–60 | 33 | 0.88 | second |
| alarm | 0–24 | 17 | 0.62 | alarm |
¹ Length is a fraction of the face radius. Give the alarm a separate color. All four hands share the printed 12-division face, so a 24-hour alarm value of 18 points to the printed 9.
Create four number variables with those IDs. Give them the same starting 2 values as the hands. The built-in workbench starts its hand variables at zero and writes each one on a change. Matching the defaults lets a puzzle check an untouched hand correctly.
Grab the minute hand near its tip, or focus the clock and press Down once from 3 the first hand. Move 9 to 10. The hour should stay at 10. With wrapping enabled, the minute hand moves from 59 to 0.
For a time-setting puzzle#
Each hand moves independently. Turning the minute hand through noon leaves the hour alone. If your game needs a running clock or geared movement, supply the timekeeping logic separately.
