Commit 248b217b by BellCodeEditor

save project

parent 9a808d62
Showing with 8 additions and 1 deletions
......@@ -16,7 +16,8 @@ body = pygame.image.load('body.png') # 身体
left = pygame.image.load('left.png') # 头 朝左
up = pygame.image.load('up.png') # 头 朝上
down = pygame.image.load('down.png') # 头 朝下
f=pygame.font.Font("neuropol.ttf",20)
s1=0
x, y = 240, 120
apple_x,apple_y=360,300
position = [(180, 90), (180, 120), (210, 120), (x, y)]
......@@ -55,6 +56,7 @@ while True:
position.append((x, y))
#position.pop(0)
if x==apple_x and y==apple_y:
s1+=1000000
n1=random.randint(1,22)
n2=random.randint(1,16)
apple_x=n1*30-30
......@@ -74,6 +76,10 @@ while True:
# 将果实画上去
screen.blit(food, (apple_x, apple_y))
info="score:"+str(s1)
t1=f.render(info,True,(0,0,0))
screen.blit(t1,(0,0))
# 刷新画面
pygame.display.update()
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