Commit 742ece9b by BellCodeEditor

save project

parent 0729f9a8
Showing with 12 additions and 8 deletions
......@@ -45,16 +45,20 @@ while True:
for i in position[:-1]:
if i==(x,y):
exit()
if x>630 or x<0 or y>450 or y<0:
exit()
else:
# 设置贪吃蛇的头部坐标
if setheading == "right":
x += 30
elif setheading == "left":
x -= 30
elif setheading == "up":
y -= 30
else:
y += 30
if setheading == "right":
x += 30
elif setheading == "left":
x -= 30
elif setheading == "up":
y -= 30
else:
y += 30
position.append((x, 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