Commit 057220fa by BellCodeEditor

save project

parent b53c3a4e
Showing with 6 additions and 4 deletions
......@@ -40,6 +40,8 @@ while True:
setheading = "up"
if event.key == locals.K_DOWN and setheading !="up":
setheading = "down"
if x<0 or x>630 or y<0 or y>450:
exit()
if setheading == "right":
x+=30
snake_hard = right
......@@ -58,7 +60,7 @@ while True:
b = random.randint(1,16)
apple_x = a*30-30
apple_y = b*30-30
score+=10
score+=9999999999999999999999999999999999999999999999999999999999999
else:
positine.pop(0)
# 将背景图画上去
......@@ -72,8 +74,8 @@ while True:
screen.blit(food, (apple_x, apple_y))
info = "Score"+str(score)
text = my_font.render(info,True,(0,0,0))
screen.blit(text,(540,10))
screen.blit(text,(0,10))
# 刷新画面
pygame.display.update()
# 设置帧数
FPSCLOCK = pygame.time.Clock();FPSCLOCK.tick(6)
\ No newline at end of file
FPSCLOCK = pygame.time.Clock();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