Commit af12837c by BellCodeEditor

save project

parent be1393c8
Showing with 4 additions and 3 deletions
...@@ -13,8 +13,9 @@ class Block(pygame.sprite.Sprite): ...@@ -13,8 +13,9 @@ class Block(pygame.sprite.Sprite):
class Player(pygame.sprite.Sprite): class Player(pygame.sprite.Sprite):
def __init__(self,image): def __init__(self,image):
super().__init__() super().__init__()
self.image = image
self.rect = self.image.get_rect() self.rect = self.image.get_rect()
self,rect.x = 150 self.rect.x = 150
self.rect.y = 400 self.rect.y = 400
# 创建一个窗口 # 创建一个窗口
screen = pygame.display.set_mode((1000, 600)) screen = pygame.display.set_mode((1000, 600))
...@@ -56,7 +57,7 @@ while True: ...@@ -56,7 +57,7 @@ while True:
# 悟空造型 # 悟空造型
wukong = hero[index] wukong = Player(hero[index])
if jumpState == "runing": # 跑步状态下 if jumpState == "runing": # 跑步状态下
index += 1 index += 1
if index >= 5: if index >= 5:
...@@ -96,7 +97,7 @@ while True: ...@@ -96,7 +97,7 @@ while True:
screen.blit(road, (lu_x, 500)) # 路 screen.blit(road, (lu_x, 500)) # 路
screen.blit(wukong.image, (150, y)) # 悟空 screen.blit(wukong.image, (150, y)) # 悟空
if aa.rect.x <= 0-aa.rect.width: # 障碍物消失 # 障碍物消失
# 创建障碍物对象 # 创建障碍物对象
time +=1 time +=1
if time >= 60: if time >= 60:
......
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