Commit a3b39152 by BellCodeEditor

save project

parent 79a12948
Showing with 7 additions and 5 deletions
...@@ -17,7 +17,7 @@ body = pygame.image.load('body.png') # 身体 ...@@ -17,7 +17,7 @@ body = pygame.image.load('body.png') # 身体
left = pygame.image.load('left.png') # 头 朝左 left = pygame.image.load('left.png') # 头 朝左
up = pygame.image.load('up.png') # 头 朝上 up = pygame.image.load('up.png') # 头 朝上
down = pygame.image.load('down.png') # 头 朝下 down = pygame.image.load('down.png') # 头 朝下
font = pygame.font.Font() font = pygame.font.Font('neuropol.ttf',18)
x, y = 240, 120 x, y = 240, 120
position = [(180, 90), (180, 120), (210, 120), (x, y)] position = [(180, 90), (180, 120), (210, 120), (x, y)]
apx = 360 apx = 360
...@@ -59,7 +59,8 @@ while True: ...@@ -59,7 +59,8 @@ while True:
c = random.randint(1,16) c = random.randint(1,16)
apx = q*30 apx = q*30
apy = c*30 apy = c*30
score score += 100
score -=99
else: else:
position.pop(0) position.pop(0)
# 将背景图画上去 # 将背景图画上去
...@@ -73,8 +74,8 @@ while True: ...@@ -73,8 +74,8 @@ while True:
# 将果实画上去 # 将果实画上去
screen.blit(food, (apx, apy)) screen.blit(food, (apx, apy))
# 刷新画面 # 刷新画面
score ='Score:'+str(score) score1 ='Score:'+str(score)
t=font.render(score,true,(12,0,12)) text=font.render(score1,True,(0,0,0))
screen.blit(text,(600,20)) screen.blit(text,(500,20))
pygame.display.update() pygame.display.update()
FPSCLOCK.tick(10) FPSCLOCK.tick(10)
\ 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