Compare commits
No commits in common. "6266d8896b37fd801727aaf5036e222a14600fb5" and "00c6b98355d22fe5721fa089d6b1d38405bbc7ba" have entirely different histories.
6266d8896b
...
00c6b98355
1 changed files with 2 additions and 24 deletions
26
tests.py
26
tests.py
|
|
@ -29,8 +29,6 @@ class Obstacle: # define all obstacles
|
||||||
self.position = position
|
self.position = position
|
||||||
self.width = width
|
self.width = width
|
||||||
|
|
||||||
#keeps the greatest score
|
|
||||||
highscore = 0
|
|
||||||
|
|
||||||
# define all obstacles
|
# define all obstacles
|
||||||
|
|
||||||
|
|
@ -97,14 +95,6 @@ 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(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
|
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))
|
|
||||||
|
|
||||||
for i in range(0, 6): # Checks across every Obstacle
|
for i in range(0, 6): # Checks across every Obstacle
|
||||||
if obstacles[i].position < 500: # if it is in the FOV
|
if obstacles[i].position < 500: # if it is in the FOV
|
||||||
|
|
||||||
|
|
@ -145,11 +135,7 @@ while program_Running:
|
||||||
if groundCount <= -641:
|
if groundCount <= -641:
|
||||||
groundCount = 0
|
groundCount = 0
|
||||||
|
|
||||||
if walkCount > highscore:
|
# THe two texts when you lose
|
||||||
highscore = walkCount
|
|
||||||
|
|
||||||
|
|
||||||
# The two texts when you lose
|
|
||||||
lostText = bigFont.render('YOU LOST', False, (255, 0, 0))
|
lostText = bigFont.render('YOU LOST', False, (255, 0, 0))
|
||||||
lostText2 = smallFont.render("Press Spacebar to replay", False, (255, 0, 0))
|
lostText2 = smallFont.render("Press Spacebar to replay", False, (255, 0, 0))
|
||||||
|
|
||||||
|
|
@ -158,15 +144,7 @@ while program_Running:
|
||||||
|
|
||||||
# Print both texts
|
# Print both texts
|
||||||
win.blit(lostText, (150, 150))
|
win.blit(lostText, (150, 150))
|
||||||
win.blit(lostText2, (75, 320))
|
win.blit(lostText2, (75, 250))
|
||||||
|
|
||||||
# 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
|
# Update
|
||||||
pygame.display.update()
|
pygame.display.update()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue