Commit eb56baaf by BellCodeEditor

auto save

parent 0fd8c024
Showing with 4 additions and 5 deletions
......@@ -10,7 +10,7 @@ class Block(pygame.sprite.Sprite):
self.rect.x=1000
self.rect.y=500-self.rect.height
class player(pygame.sprite.Sprite):
def__init__(self,image):
def __init__(self,image):
super().__init__()
self.image = image
self.rect = self.image.get_rect()
......@@ -49,10 +49,9 @@ while True:
if jumpState == "runing":
if event.key == locals.K_SPACE:
jumpState = "up"
if
if jumpState == "up": # 起跳状态
if t > 0:
wukong.y = y
y-= t
t -= 2
else:
jumpState = "down"
......@@ -65,7 +64,7 @@ while True:
t =30
# 悟空造型
wukong = player([index])
wukong = player(hero[index])
if jumpState == "runing": # 跑步状态下
index += 1
if index >= 5:
......@@ -79,7 +78,7 @@ while True:
if lu_x <-1000:
lu_x=0
screen.blit(road, (lu_x, 500)) # 路
screen.blit(wukong, (150, y)) # 悟空
screen.blit(wukong.image, (150, y)) # 悟空
if obstacle.rect.x <= 0-obstacle.rect.width: # 障碍物消失
# 创建障碍物对象
......
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