Commit 1c53cc1a by BellCodeEditor

save project

parent 478bd4c4
Showing with 11 additions and 3 deletions
......@@ -2,6 +2,10 @@ import pygame
from pygame import locals
import random
# 初始化pygame,为使用硬件做准备
a=0
b=0
c=0
pygame.init()
myfot=pygame.font.Font('neuropol.ttf',18)
# 创建一个窗口
......@@ -58,10 +62,12 @@ while True:
newy=random.randint(1,16)
applex=newx*30-30
appley=newy*30-30
score+=10
else:
position.pop(0)
score+=5
a+=5
b+=5
c+=5
position.append((x, y))
......@@ -74,9 +80,10 @@ while True:
screen.blit(body, position[i])
infor='score'+str(score)
text=myfot.render(infor,True,(0,0,0))
text=myfot.render(infor,True,(a,b,c))
# 将果实画上去
screen.blit(food, (applex, appley))
# 刷新画面
screen.blit(text,(530,10))
pygame.display.update()
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