Commit cee7b20f by BellCodeEditor

save project

parent ef2ba32d
Showing with 5 additions and 5 deletions
......@@ -24,16 +24,16 @@ while True:
# 接收到退出事件后退出程序
exit()
if event.type==locals.KEYDOWN:
if event.key==k_RIGHT and setheading!='left':
if event.key==locals.K_RIGHT and setheading!='left':
setheading='right'
shead=right
if event.key==k_LEFT and setheading!='right':
if event.key==locals.K_LEFT and setheading!='right':
setheading='left'
shead=left
if event.key==k_DOWN and setheading!='up':
if event.key==locals.K_DOWN and setheading!='up':
setheading='down'
shead=down
if event.key==k_UP and setheading!='down':
if event.key==locals.K_UP and setheading!='down':
setheading='up'
shead=up
if setheading=="right":
......@@ -49,7 +49,7 @@ while True:
# 将背景图画上去
screen.blit(background, (0, 0))
# 将贪吃蛇画上去
screen.blit(right,w[-1])
screen.blit(shead,w[-1])
# 将贪吃蛇的身体画上去
for i in range(len(w)-1):
screen.blit(body, w[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