Added comments

This commit is contained in:
2025-07-06 20:16:33 +01:00
parent 3cd2ddbd46
commit afd1fcd6be

View File

@ -204,12 +204,14 @@ class Game(gameUtils.Game):
self.surf.blit(gameUtils.centre(self.currentCaptchaImg, self.size)) #draws the text to center of the screen
#TODO: actually scale the text, however, more work needs to be done on the actual function of the game first
# Draw the captcha progerss if there is a captcha
if self.currentCaptcha is not None:
x1 = self.size[0] / 2 - self.currentCaptchaImg.size[0] / 2
y = self.size[1] / 2 + self.currentCaptchaImg.size[1] / 2
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)
# Draw the timer if there's any time left
timeLeft = self.timerLength - (time.perf_counter() - self.timerStart)
if timeLeft > 0:
normalisedTimeLeft = max(timeLeft / self.timerLength, 0)