Skip to content
Snippets Groups Projects
Commit bef95eea authored by 's avatar
Browse files

update

parent 7c6b1e34
No related branches found
No related tags found
No related merge requests found
......@@ -10,6 +10,7 @@ import ScoreDisplay
def game(speed, colour,food_colour, backgroundColour):
pygame.event.clear()
image = pygame.image.load("barrier.png")
black1 = (48,47,47)
x = randint(0, grid_length) * size
y = randint(0, grid_length) * size
......@@ -122,9 +123,9 @@ def game(speed, colour,food_colour, backgroundColour):
win.fill(backgroundColour)
if speed == 50:
if (backgroundColour == black1):
pygame.draw.rect(win, (0,0,255) , [100,100, 20, 300])
win.blit(image,(100,100))
else:
pygame.draw.rect(win, (0,255,0) , [100,100, 20, 300])
win.blit(image,(100,100))
sc_color = [0,0,0] if backgroundColour[0] == 255 else [255,255,255]
font = pygame.font.Font("Roboto-Light.ttf",30)
text = font.render(" " + str(score),True,sc_color)
......
No preview for this file type
No preview for this file type
BlankProjectTemplate/src/barrier.png

948 B

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