Commit 1b9462e5 by BellCodeEditor

save project

parent a8eecd4d
Showing with 5 additions and 2 deletions
...@@ -18,6 +18,8 @@ up = pygame.image.load('up.png') # 头 朝上 ...@@ -18,6 +18,8 @@ up = pygame.image.load('up.png') # 头 朝上
down = pygame.image.load('down.png') # 头 朝下 down = pygame.image.load('down.png') # 头 朝下
x, y = 240, 120 x, y = 240, 120
appale_x=360
appale_y=300
position = [(180, 90), (180, 120), (210, 120), (x, y)] position = [(180, 90), (180, 120), (210, 120), (x, y)]
setheading = "right" setheading = "right"
...@@ -54,7 +56,7 @@ while True: ...@@ -54,7 +56,7 @@ while True:
position.append((x, y)) position.append((x, y))
position.pop(0) position.pop(0)
if(x==appale and y==apple_y): if(x==appale_x and y==appale_y):
appale_x=random.randint(0,660) appale_x=random.randint(0,660)
appale_x=random.randint(0,480) appale_x=random.randint(0,480)
# 将背景图画上去 # 将背景图画上去
...@@ -66,7 +68,7 @@ while True: ...@@ -66,7 +68,7 @@ while True:
screen.blit(body, position[i]) screen.blit(body, position[i])
# 将果实画上去 # 将果实画上去
screen.blit(food, (appale_x, apple_y)) screen.blit(food, (appale_x, appale_y))
# 刷新画面 # 刷新画面
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