Commit 42af696d by BellCodeEditor

save project

parent 3167d864
Showing with 4 additions and 0 deletions
...@@ -59,6 +59,7 @@ while True: ...@@ -59,6 +59,7 @@ while True:
num2=random.randint(1,16) num2=random.randint(1,16)
apple_x=30*num1-30 apple_x=30*num1-30
apple_y=30*num2-30 apple_y=30*num2-30
score+=10
else: else:
position.pop(0) position.pop(0)
# 将背景图画上去 # 将背景图画上去
...@@ -74,6 +75,8 @@ while True: ...@@ -74,6 +75,8 @@ while True:
info='Score:'+str(score) info='Score:'+str(score)
text=my_font.render(info,True,(0,255,0)) text=my_font.render(info,True,(0,255,0))
screen.blit(text,(540,10)) screen.blit(text,(540,10))
# 刷新画面 # 刷新画面
pygame.display.update() pygame.display.update()
FPSCLOCK.tick(3) 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