Commit 199d041f by BellCodeEditor

save project

parent ac91ade9
Showing with 10 additions and 1 deletions
......@@ -18,9 +18,18 @@ x,y = 210,120
position=[(180,120),(180,90),(210,120),(x,y)]
while True:
for event in pygame.event.get():
if event.type == locals.QUIT:
if event.type == locals.KEYDOWN:
# 接收到退出事件后退出程序
exit()
if event.type == locals.QUIT:
if event.key == locals.K_RIGHT and setheading != "left":
setheading = "right"
if event.key == locals.K_LEFT and setheading != "right":
setheading = "left"
if event.key == locals.K_DOWN and setheading != "up":
setheading = "down"
if event.key == locals.K_UP and setheading != "down":
setheading = "up"
x+=30
s=(x,y)
position.append(s)
......
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