Commit 20a7bbe2 by BellCodeEditor

save project

parent 0bae3088
Showing with 6 additions and 0 deletions
......@@ -23,9 +23,11 @@ left = pygame.image.load('left.png')
down = pygame.image.load('down.png')
food = pygame.image.load('apple.png')
body = pygame.image.load('body.png')
my_font = pygame.font.Font("neuropol.ttf",18)
fps = pygame.time.Clock()
setheading = "right"
snake_head = right
score = 0
while True:
for event in pygame.event.get():
if event.type == locals.QUIT:
......@@ -78,6 +80,9 @@ while True:
#screen.blit(body, (180, 90))
# 将果实画上去
screen.blit(food, (apple_x, apple_y))
info = "score" + str(score)
text = my_font.render(info, True, (25,25,25))
screen.blit(text,(540,10))
# 刷新画面
pygame.display.update()
fps.tick(3)
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment