Fork me on GitHub
#quil
<
2022-04-05
>
mister_m23:04:06

Does anyone know how I could implement a sort of "countdown" in quil? I'd like to have something drawn on a sort of time delay, starting from some sort of state flag at the top of my update-state function

Eric13:05:32

I would think you could try something like having a timer in the sketch state like this:

{:timer (* 30 5) ...}
(That's 5 sec if your frame rate is 30.) And then in update-state you call a decrement function replacing that timer in state.
(defn countdown [state]
  (update state :timer dec))