From 823af63510e0faa51a1e53dbf9fdc30814048b99 Mon Sep 17 00:00:00 2001 From: Usman Irfan <usmanirfan@USERs-MacBook-Pro.local> Date: Tue, 13 Nov 2018 16:07:22 -0500 Subject: [PATCH] Added score display --- BlankProjectTemplate/src/Gameplay.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/BlankProjectTemplate/src/Gameplay.py b/BlankProjectTemplate/src/Gameplay.py index 11e90d2..04af693 100644 --- a/BlankProjectTemplate/src/Gameplay.py +++ b/BlankProjectTemplate/src/Gameplay.py @@ -107,11 +107,15 @@ while run: win.fill(white) - + + font = pygame.font.SysFont("times",30) + text = font.render("Score = " + str(score),True,[0,0,0]) + win.blit(text,(0,0)) + #function to print #consumption of food block food.redraw_food(x, y, food_location, screenSize) - if ([x,y] in snake_loc) and snake_length > 1: + if ([x,y] in snake_loc) and snake_length > 1: pygame.time.delay(1000) pygame.quit() #quit for now, but should return to main menu -- GitLab