Permalink
Browse files

The game now displays the score on the screen

  • Loading branch information...
1 parent 79ea903 commit 2a1870af93ea899a6e1717a671ffb1df5642e1fb Carter Sande committed Sep 30, 2012
Showing with 8 additions and 1 deletion.
  1. +1 −1 README.md
  2. +7 −0 TypingGame.py
  3. BIN score_font.TTF
View
@@ -1,4 +1,4 @@
# About TypingGame
TypingGame is a simple typing game written in Python. It's not finished, but it's currently in working order. Please feel free to fork it and send us a pull request.
-We use SV Basic Manual as the font for the words.
+We use SV Basic Manual as the font for the words, and Digit as the font for the score.
View
@@ -67,6 +67,9 @@ def update(self):
wordfile.close()
score = 0
+score_font = pygame.font.Font("score_font.ttf",60)
+
+
background = pygame.image.load("background.png").convert()
clock = pygame.time.Clock()
@@ -94,8 +97,12 @@ def update(self):
currentword.update()
for i in extra_words:
i.update()
+
+ score_surf = score_font.render("SCORE:"+str(score), True, (0,255,0))
+
screen.fill((0,0,0)) #clears the screen
screen.blit(background,(0,0))
+ screen.blit(score_surf,(0,530))
for i in extra_words:
screen.blit(i.image, i.rect)
pygame.draw.line(screen,(0,255,0),(width/2, height),(currentword.rect.left+7, currentword.rect.bottom),14)
View
Binary file not shown.

0 comments on commit 2a1870a

Please sign in to comment.