Skip to content
Snippets Groups Projects
Commit 823af635 authored by Usman Irfan's avatar Usman Irfan
Browse files

Added score display

parent 53155954
No related branches found
No related tags found
No related merge requests found
...@@ -107,11 +107,15 @@ while run: ...@@ -107,11 +107,15 @@ while run:
win.fill(white) 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 #consumption of food block
food.redraw_food(x, y, food_location, screenSize) 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.time.delay(1000)
pygame.quit() #quit for now, but should return to main menu pygame.quit() #quit for now, but should return to main menu
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment