Commit cc2075b5 by BellCodeEditor

save project

parent 17296233
Showing with 6 additions and 6 deletions
...@@ -18,9 +18,9 @@ left = pygame.image.load('left.png') # 头 朝左 ...@@ -18,9 +18,9 @@ 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') # 头 朝下
x2=330
y2=330
x, y = 240, 120 x, y = 240, 120
i=random.randint(1,12)
a=random.randint(1,18)
position = [(180, 90), (180, 120), (210, 120), (x, y)] position = [(180, 90), (180, 120), (210, 120), (x, y)]
...@@ -58,8 +58,8 @@ while True: ...@@ -58,8 +58,8 @@ while True:
position.append((x, y)) position.append((x, y))
if x2==x and y2==y: if x2==x and y2==y:
x2=random.randint(1,12) x2=random.randint(0,21)
y2=random.randint(1,16) y2=random.randint(0,15)
x2=x2*30 x2=x2*30
y2=y2*30 y2=y2*30
...@@ -80,4 +80,4 @@ while True: ...@@ -80,4 +80,4 @@ while True:
screen.blit(food, (x2, y2)) screen.blit(food, (x2, y2))
# 刷新画面 # 刷新画面
pygame.display.update() pygame.display.update()
FPSCLOCK.tick(3) FPSCLOCK.tick(4)
\ No newline at end of file \ 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