Commit d52473aa by BellCodeEditor

save project

parent 2ac71c40
Showing with 9 additions and 8 deletions
......@@ -45,7 +45,7 @@ time=0
gamestate=True
while gamestate==True:
while True:
for event in pygame.event.get():
if event.type == locals.QUIT:
# 接收到退出事件后退出程序
......@@ -54,7 +54,13 @@ while gamestate==True:
if jumpState == "runing":
if event.key == locals.K_SPACE:
jumpState = "up"
wukong = Player(hero[index])
# 悟空造型
if jumpState == "runing": # 跑步状态下
index += 1
if index >= 5:
index = 0
if gamestate==True:
if jumpState == "up": # 起跳状态
if t > 0:
y -= t
......@@ -64,17 +70,12 @@ while gamestate==True:
if jumpState == "down": # 降落状态
if t <= 30:
y += t
wukong.rect.y=y
t += 2
else:
jumpState = "runing"
t =30
# 悟空造型
wukong = Player(hero[index])
if jumpState == "runing": # 跑步状态下
index += 1
if index >= 5:
index = 0
# 将背景图画上去
screen_x-=1
if screen_x<-1000:
......
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