Commit ff2d12c1 by BellCodeEditor

save project

parent 37be269b
Showing with 4 additions and 3 deletions
......@@ -8,7 +8,7 @@ abc = 0
screen = pygame.display.set_mode((660, 480))
FPSCLOCK = pygame.time.Clock() # pygame时钟,控制游戏速度(帧数)
my_font = pygame.font.Font('neuropol.ttf',18)
text = my_font.render('Score:'+str(abc),True,(0,0,0))
# 背景
background = pygame.image.load('bg.png')
right = pygame.image.load('right.png') # 头 朝右
......@@ -26,6 +26,7 @@ setheading = "right"
snake_head = right
while True:
text = my_font.render('Score:'+str(abc),True,(0,0,0))
for event in pygame.event.get():
if event.type == locals.QUIT:
# 接收到退出事件后退出程序
......@@ -72,4 +73,4 @@ while True:
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