Commit 8550da51 by BellCodeEditor

auto save

parent 4318235f
Showing with 13 additions and 2 deletions
......@@ -19,7 +19,8 @@ hero3 = pygame.image.load('hero4.png')
hero4 = pygame.image.load('hero5.png')
modeList = [hero,hero1,hero2,hero3,hero4]
index = 0
y = 400
jumpState = "runing"
while True:
wukong=modeList[index]
index+=1
......@@ -30,7 +31,17 @@ while True:
# 接收到退出事件后退出程序
exit()
if event.type == locals.KEYDOWN:
if event.key == locals.
if event.key == locals.K_SPACE:
jumpState = "up"
if jumpState == "up":
if y > 150:
y -= 5
else jumpState == "down"
if jumpState == "down":
if y < 150:
y += 5
else jumpState == "up"
# 将背景图画上去
screen.blit(background, (0, 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