Commit 72ba58eb by BellCodeEditor

save project

parent 6fa258e4
Showing with 5 additions and 5 deletions
......@@ -20,7 +20,7 @@ my_font = pygame.font.Font('neuropol.ttf',10)
x, y = 240, 120
position = [(180, 90), (180, 120), (210, 120), (x, y)]
apple_x = 360
apple_y =300
apple_y = 300
setheading = "right"
snake_head = right
score = 0
......@@ -64,11 +64,11 @@ while True:
score +=10
else:
position.pop(0)
if x < 0 or x >630 or y <0 or y > 450:
if x < 0 or x > 630 or y < 0 or y > 450:
exit()
# 将背景图画上去
screen.blit(background, (0, 0))
info = 'score' + str(score)
info = 'score' + str(score)
text = my_font.render(info,True,(0,0,0))
screen.blit(text,(540,10))
# 将贪吃蛇的头画上去
......@@ -81,4 +81,4 @@ while True:
screen.blit(food,(apple_x,apple_y))
# 刷新画面
pygame.display.update()
FPSCLOCK.tick(5)
\ No newline at end of file
FPSCLOCK.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