Commit b0b44c4c by BellCodeEditor

save project

parent 09116466
Showing with 5 additions and 4 deletions
......@@ -18,7 +18,7 @@ hero = [pygame.image.load('hero1.png'),
pygame.image.load('hero4.png'),
pygame.image.load('hero5.png')]
index = 0
jumpstate = "running"
jumpstate = "runing"
y=400
t=30
while True:
......@@ -27,8 +27,9 @@ while True:
# 接收到退出事件后退出程序
exit()
if event.type == locals.KEYDOWN:
if event.key == locals.K_SPACE:
jumpstate = "up"
if jumpstate=="runing":
if event.key == locals.K_SPACE:
jumpstate = "up"
if jumpstate == "up":
if t>0:
y-=t
......@@ -40,7 +41,7 @@ while True:
y+=t
t+=2
else:
jumpstate = "running"
jumpstate = "runing"
t=30
wukong = hero[index]
......
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