From 6266d8896b37fd801727aaf5036e222a14600fb5 Mon Sep 17 00:00:00 2001 From: rlacroix Date: Wed, 29 Jul 2020 11:37:21 +0200 Subject: [PATCH] finished the missing features, waiting for assets --- tests.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/tests.py b/tests.py index eb1932e..7fa05f8 100644 --- a/tests.py +++ b/tests.py @@ -29,6 +29,7 @@ class Obstacle: # define all obstacles self.position = position self.width = width +#keeps the greatest score highscore = 0 # define all obstacles @@ -96,9 +97,11 @@ while program_Running: win.blit(ground, (groundCount, posGround)) # Displays the ground WILL NEED TO BE ADJUSTED WITH THE SPRITE AND TO BE LOOPED win.blit(walkSprite[(walkCount % 18)//3], (posPlayer, posy)) # Displays the caracter WILL NEED TO BE ADJUSTED WITH THE SPRITE + # Displays current score scoreText = smallFont.render(str(walkCount), False, (255, 0, 0)) win.blit(scoreText, (430, 0)) + # Displays highest score highScoreText = smallFont.render(str(highscore), False, (255, 0, 0)) win.blit(highScoreText, (30, 0)) @@ -155,7 +158,15 @@ while program_Running: # Print both texts win.blit(lostText, (150, 150)) - win.blit(lostText2, (75, 250)) + win.blit(lostText2, (75, 320)) + + # Displays current score + scoreText = smallFont.render("Score : " + str(walkCount), False, (255, 0, 0)) + win.blit(scoreText, (175, 210)) + + # Displays highest score + highScoreText = smallFont.render("highest Score : " + str(highscore), False, (255, 0, 0)) + win.blit(highScoreText, (100, 250)) # Update pygame.display.update()