code

useLatency

Simulates latency with a promise that resolves at a specified amount of ms. Can be prematurely resolved or rejected.
Try replicating the code! Starting fires a latency that keeps game on.
Upon expiration, a life is lost and latency fires again. Scoring aborts and re-triggers. On no lives left or when tapping the button twice, latency releases, ending the game.
Tap button to start
Score
0
High
0
Lives
❤️❤️❤️
Level
1
Penalty

0ms

Mode

Normal