Commit 4a7e1a11 by BellCodeEditor

auto save

parent 15dca0c4
Showing with 5 additions and 6 deletions
......@@ -2,8 +2,7 @@ import pygame
from pygame import locals
import random
# 初始化pygame,为使用硬件做准备
pygame.init()
pygame.init() # 初始化pygame,为使用硬件做准备
# 创建一个窗口
screen = pygame.display.set_mode((660, 480))
......@@ -47,7 +46,7 @@ while True:
# 设置贪吃蛇的头部坐标
if setheading == "right":
x += 30
x += 30
elif setheading == "left":
x -= 30
elif setheading == "up":
......@@ -74,11 +73,11 @@ while True:
screen.blit(body, position[i])
info='SB:'+str(score)
test=my_font.render(info,True,(12,43,24))
test=my_font.render(info,True,(120,7 ,204))
screen.blit(test,(540,10))
# 将果实画上去
screen.blit(food, (apple_x,apple_y))
# 刷新画面
pygame.display.update()
FPSCLOCK.tick(3)
\ No newline at end of file
FPSCLOCK.tick(5)
\ 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