Commit aa62918f by BellCodeEditor

save project

parent c70b4955
Showing with 5 additions and 17 deletions
......@@ -17,25 +17,13 @@ x=240
y=120
positon=[(180,90),(180,120),(210,120),(x,y)]
FPS=pygame.time.Clock()
setheading="right"
while True:
while True:
x += 30
for event in pygame.event.get():
if event.type == locals.QUIT:
exit()
elif event.type == locals.KEYDOWN: # 接收到退出事件后退出程序
if event.key==locals.K_RIGHT and setheading!="left":
setheading="right"
X += 30
if event.key==locals.K_LEFT and setheading!="right":
setheading="left"
X-=30
if event.key==locals.K_UP and setheading!="down":
setheading="up"
y += 30
if event.key==locals.K_DOWN and setheading!="up":
setheading="down"
Y -=30
# 接收到退出事件后退出程序
exit()
# 将背景图画上去
......
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