Learn Create Your Own Split Screen

Next Page

Like most things in programming, there's a bunch of different ways we could go about this -- each with their own pluses and minuses. Two alternatives that come to mind are: We'll take the second approach. Obviously that will lead to some funky fractional values in time_remaining, but we'll just round it as we display it:
time_remaining = time_remaining - 1/40; ctx.fillText("Time Remaining: " + Math.round(time_remaining), 0, 45);