Commit d10bfd8f by BellCodeEditor

auto save

parent 1970230f
Showing with 9 additions and 3 deletions
...@@ -15,16 +15,22 @@ food = pygame.image.load('apple.png') ...@@ -15,16 +15,22 @@ food = pygame.image.load('apple.png')
body = pygame.image.load('body.png') body = pygame.image.load('body.png')
x, y = 240, 120 x, y = 240, 120
try = [(180, 90), (180, 120),(210, 120),(x, y)] o = [(180, 90), (180, 120),(210, 120),(x, y)]
o="right"
while True: while True:
for event in pygame.event.get(): for event in pygame.event.get():
if event.type == locals.QUIT: if event.type == locals.QUIT:
# 接收到退出事件后退出程序 # 接收到退出事件后退出程序
exit() exit()
if event.type == locals.ACTIVEEVENT
if event.Key == locals.K_RIGHT and setheading ="left":
setheading ="left"
x += 30 x += 30
try.append((x, y)) o.append((x, y))
try.pop(0) o.pop(0)
pass pass
except expression as identifier: except expression as identifier:
pass pass
......
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