Commit d7de1414 by BellCodeEditor

save project

parent 5e1ac9b5
Showing with 9 additions and 5 deletions
......@@ -19,28 +19,32 @@ hero = [pygame.image.load('hero1.png'),
index = 0
zhuangtai = "running"
y = 400
nu = 30
while True:
for event in pygame.event.get():
if event.type == locals.QUIT:
# 接收到退出事件后退出程序
exit()
if event.type ==locals.KEYDOWN:
if event.key == locals.K_SPACE:
zhuangtai = "up"
if zhuangtai == "up":
if y > 150:
y-=5
if nu > 0:
y -= nu
nu -=2
else:
zhuangtai = "down"
if zhuangtai == "down":
if y < 400:
y += 5
if nu <= 30:
y += nu
nu += 2
else:
zhuangtai = "running"
nu = 30
wukong = hero[index]
index += 1
......
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