Added captcha progress bar
This commit is contained in:
6
game.py
6
game.py
@ -204,6 +204,12 @@ 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
|
||||
|
||||
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)
|
||||
|
||||
if self.timerLength != 0:
|
||||
timeLeft = self.timerLength - (time.perf_counter() - self.timerStart)
|
||||
normalisedTimeLeft = max(timeLeft / self.timerLength, 0)
|
||||
|
||||
Reference in New Issue
Block a user