Commit c0c18b4e by BellCodeEditor

save project

parent 5acb47b8
Showing with 4 additions and 4 deletions
......@@ -25,19 +25,19 @@ while True:
# 接收到退出事件后退出程序
exit()
if event.type==locals.KEYDOWN:
if event.key==locals.K_RIGHT and setheading!=right:
if event.key==locals.K_RIGHT and setheading!=left:
setheading='right'
snakehead=right
if event.key==locals.K_LEFT and setheading!=left:
if event.key==locals.K_LEFT and setheading!=right:
setheding='left'
snakehead=left
if event.key==locals.K_DOWN and setheading!=down:
if event.key==locals.K_DOWN and setheading!=up:
setheading='down'
snakehead=down
if event.key==locals.K_UP and setheading!=up:
if event.key==locals.K_UP and setheading!=down:
setheading='up'
snakehead=up
......
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