Commit 3cdcdf5a by BellCodeEditor

save project

parent 1bebffa2
Showing with 7 additions and 3 deletions
...@@ -57,10 +57,14 @@ while True: ...@@ -57,10 +57,14 @@ while True:
pos.append((x,y)) pos.append((x,y))
if apple_x == x and apple_y == y: if apple_x == x and apple_y == y:
apple_x=random.randint(0,660) a_x=random.randint(1,22)
apple_y=random.randint(0,480) a_y=random.randint(1,12)
apple_x = a_x*30-30
apple_y = a_y*30-30
else:
pos.pop(0) pos.pop(0)
# 将背景图画上去 # 将背景图画上去
screen.blit(background, (0, 0)) screen.blit(background, (0, 0))
# 将贪吃蛇画上去 # 将贪吃蛇画上去
......
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