I wanted the timer to reset on player death so I added
time_left = level_time
hud.set_time_label(time_left)
to the reset_player function and called reset_player() on timeout or on hitting a trap.
It works ok, sometimes on reset the first second changes immediately (e.g. 5 to 4), I guess because the timer is still running, even when I’ve reset time_left? If that makes sense.