Commit ef29b7b0 by BellCodeEditor

auto save

parent 136e0c51
Showing with 13 additions and 0 deletions
......@@ -3,6 +3,7 @@ from pygame import locals
pygame.init()
time=pygame.time.Clock()
x,y=240,120
setheading = "right"
# 创建一个窗口
......@@ -26,6 +27,18 @@ while True:
if event.type == locals.QUIT:
# 接收到退出事件后退出程序
exit()
if event.type == locals.KIYDOWN:
if event.key == locals.K_RIGHT and setheading != "left":
setheading = "right"
if event.type == locals.KIYDOWN:
if event.key == locals.K_RIGHT and setheading != "right":
setheading = "left"
if event.type == locals.KIYDOWN:
if event.key == locals.K_RIGHT and setheading != "up":
setheading = "do"
if event.type == locals.KIYDOWN:
if event.key == locals.K_RIGHT and setheading != "dowp":
setheading = ""
x+=30
shenti.append((x,y))
shenti.pop(0)
......
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