Skip to content
This repository has been archived by the owner on Mar 3, 2020. It is now read-only.

Make game start countdown timer count down #630

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

JasonTarka
Copy link
Contributor

Rather than being a static number updated on page refresh, the
countdown clock will not update itself. This makes for a more
interesting display.

Using time remaining rather than an absolute time to prevent
jittery behaviour at the start, though at the expense of accuracy.

Rather than being a static number updated on page refresh, the
countdown clock will not update itself. This makes for a more
interesting display.

Using time remaining rather than an absolute time to prevent
jittery behaviour at the start, though at the expense of accuracy.
The 1000ms timeout doesn't always fire at exactly 1000ms, and over
time there's enough drift to make it off by half a minute or more.

Given a display running for several days, it could become off by a
couple of hours.
There's no guarantee that a timeout will finish on time, and after
a short period the clock becomes inaccurate.
With the periodic refresh this isn't a big deal, but the countdown
doesn't look as smooth as it could.
By keeping track of the actual end date there will be no jumps,
and it looks smoother overall.

This also makes the code much easier to understand & maintain.
@JasonTarka
Copy link
Contributor Author

This should fix #113

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants