Commit 1598ba5a by BellCodeEditor

save project

parent 154f7057
Showing with 5 additions and 5 deletions
...@@ -61,8 +61,8 @@ while True: ...@@ -61,8 +61,8 @@ while True:
if x == apple_x and y == apple_y: if x == apple_x and y == apple_y:
num1= random.randint(1, 22) # 横排第几个格子 num1= random.randint(1, 22) # 横排第几个格子
num2 = random.randint(1, 16) # 竖排第几个格子 num2 = random.randint(1, 16) # 竖排第几个格子
apple_x = 30*num1-30 # 苹果的x坐标 apple_x = 30*num1 - 30 # 苹果的x坐标
apple_y = 30*num2-30 # 苹果的y坐标 apple_y = 30*num2 - 30 # 苹果的y坐标
else: else:
position.pop(0) position.pop(0)
# 贪吃蛇撞墙 # 贪吃蛇撞墙
...@@ -79,7 +79,7 @@ while True: ...@@ -79,7 +79,7 @@ while True:
screen.blit(food, (apple_x, apple_y)) screen.blit(food, (apple_x, apple_y))
# 绘制分数 # 绘制分数
info = "Score:"+ str(score)
# 刷新画面 # 刷新画面
pygame.display.update() pygame.display.update()
FPSCLOCK.tick(100) FPSCLOCK.tick(3)
\ No newline at end of file \ 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