Skip to content
Snippets Groups Projects
Commit 711083f6 authored by Hameed Andy's avatar Hameed Andy
Browse files

cleaning code

parent c03656ab
No related branches found
No related tags found
No related merge requests found
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
# @author Usman Irfan # @author Usman Irfan
# @brief implements an abstract data type for a snake's food # @brief implements an abstract data type for a snake's food
# @date 11/09/2018 # @date 11/09/2018
from random import randint from random import randint
from init import * from init import *
......
...@@ -8,6 +8,7 @@ from random import randint ...@@ -8,6 +8,7 @@ from random import randint
from Snake import * from Snake import *
from Food import * from Food import *
import ScoreDisplay import ScoreDisplay
import GUI
def game(speed, colour,food_colour, backgroundColour): def game(speed, colour,food_colour, backgroundColour):
pygame.event.clear() pygame.event.clear()
...@@ -128,10 +129,10 @@ def game(speed, colour,food_colour, backgroundColour): ...@@ -128,10 +129,10 @@ def game(speed, colour,food_colour, backgroundColour):
if speed == 71: if speed == 71:
win.blit(image,(100,100)) win.blit(image,(100,100))
win.blit(image,(380,100)) win.blit(image,(380,100))
sc_color = [0,0,0] if backgroundColour[0] == 255 else [255,255,255]
font = pygame.font.Font("Roboto-Light.ttf",30) #Display Score
text = font.render(" " + str(score),True,sc_color) sc_color = [0,0,0] if backgroundColour[0] == 255 else [255,255,255]
win.blit(text,(0,0)) GUI.text(" " + str(score),"Roboto-Light.ttf",30,sc_color,(0,0),win)
if ([x,y] in snake_loc) and snake_length > 1: if ([x,y] in snake_loc) and snake_length > 1:
ScoreDisplay.display(score,speed, colour,food_colour, backgroundColour) ScoreDisplay.display(score,speed, colour,food_colour, backgroundColour)
......
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