diff --git a/game.py b/game.py index 3790e1a..ee8cebd 100644 --- a/game.py +++ b/game.py @@ -210,8 +210,8 @@ class Game(gameUtils.Game): x2 = x1 + (self.currentCaptcha.charIdx / len(self.currentCaptcha.chars)) * self.currentCaptchaImg.size[0] pygame.draw.line(self.surf, (0, 255, 0), (x1, y), (x2, y), 5) - if self.timerLength != 0: - timeLeft = self.timerLength - (time.perf_counter() - self.timerStart) + timeLeft = self.timerLength - (time.perf_counter() - self.timerStart) + if timeLeft > 0: normalisedTimeLeft = max(timeLeft / self.timerLength, 0) x = round((1-normalisedTimeLeft) * (self.size[0] // 2)) w = normalisedTimeLeft * self.size[0]