Commit f6debddd by BellCodeEditor

save project

parent 0c9433c8
Showing with 4 additions and 1 deletions
...@@ -57,9 +57,11 @@ while True: ...@@ -57,9 +57,11 @@ while True:
num2=random.randint(1,16) num2=random.randint(1,16)
apple_x=num1*30-30 apple_x=num1*30-30
apple_y=num2*30-30 apple_y=num2*30-30
Score+=1
else: else:
position.pop(0) position.pop(0)
if x>630 or x<0 or y<0 or y>630:
exit()
# apple_x=random.randint(0,660) # apple_x=random.randint(0,660)
# apple_y=random.randint(0,480) # apple_y=random.randint(0,480)
# 将背景图画上去 # 将背景图画上去
...@@ -72,6 +74,7 @@ while True: ...@@ -72,6 +74,7 @@ while True:
text='Score'+str(Score) text='Score'+str(Score)
asd=my_font.render(text,True,(0,0,0)) asd=my_font.render(text,True,(0,0,0))
screen.blit(asd,(540,10)) screen.blit(asd,(540,10))
# 将果实画上去 # 将果实画上去
screen.blit(food, (apple_x,apple_y )) screen.blit(food, (apple_x,apple_y ))
# 刷新画面 # 刷新画面
......
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