Commit 07e19884 by BellCodeEditor

save project

parent d1ae57ce
Showing with 5 additions and 5 deletions
...@@ -25,16 +25,16 @@ while True: ...@@ -25,16 +25,16 @@ while True:
# 接收到退出事件后退出程序 # 接收到退出事件后退出程序
exit() exit()
if event.type == locals.KEYDOWN: if event.type == locals.KEYDOWN:
if event.type == locals.K_RIGHT and u!='left': if event.key == locals.K_RIGHT and u!='left':
u='right' u='right'
sk=right sk=right
if events.type == locals.LEFT and u!='right': if events.key == locals.LEFT and u!='right':
u='left' u='left'
sk=left sk=left
if event.type == locals.DOWN and u!='up': if event.key == locals.DOWN and u!='up':
u='down' u='down'
sk=down sk=down
if event.type == locals.UP and u!='down': if event.key == locals.UP and u!='down':
u='up' u='up'
sk=up sk=up
if u=="sk": if u=="sk":
...@@ -51,7 +51,7 @@ while True: ...@@ -51,7 +51,7 @@ while True:
# 将背景图画上去 # 将背景图画上去
screen.blit(background, (0, 0)) screen.blit(background, (0, 0))
# 将贪吃蛇画上去 # 将贪吃蛇画上去
screen.blit(right, dog[-1]) screen.blit(sk, dog[-1])
# 将贪吃蛇的身体画上去 # 将贪吃蛇的身体画上去
for i in range(len(dog)-1): for i in range(len(dog)-1):
screen.blit(body,dog[i]) screen.blit(body,dog[i])
......
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