Commit dd3f2557 by BellCodeEditor

save project

parent 282fdf13
Showing with 9 additions and 2 deletions
...@@ -9,6 +9,13 @@ class Block(pygame.sprite.Sprite): ...@@ -9,6 +9,13 @@ class Block(pygame.sprite.Sprite):
self.rect=self.image.get_rect() self.rect=self.image.get_rect()
self.rect.x=1000 self.rect.x=1000
self.rect.y=500-self.rect.height self.rect.y=500-self.rect.height
class wu(pygame.sprite.Sprite):
def __init__(self,image):
super().__init__()
self.image=image
self.rect=self.image.get_rect()
self.rect.x=150
self.rect.y=400
pygame.init() # 初始化 pygame.init() # 初始化
# 创建一个窗口 # 创建一个窗口
screen = pygame.display.set_mode((1000, 600)) screen = pygame.display.set_mode((1000, 600))
...@@ -60,7 +67,7 @@ while True: ...@@ -60,7 +67,7 @@ while True:
t =30 t =30
# 悟空造型 # 悟空造型
wukong = hero[index] wukong = wu(hero[index])
if jumpState == "runing": # 跑步状态下 if jumpState == "runing": # 跑步状态下
index += 1 index += 1
if index >= 5: if index >= 5:
...@@ -94,7 +101,7 @@ while True: ...@@ -94,7 +101,7 @@ while True:
screen.blit(background, (shan_x,0)) screen.blit(background, (shan_x,0))
screen.blit(road, (lu_x, 500)) # 路 screen.blit(road, (lu_x, 500)) # 路
screen.blit(wukong, (150, y)) # 悟空 screen.blit(wukong.image, (wukong.rect.x,y)) # 悟空
for c in Block_list: for c in Block_list:
c.rect.x-=8 c.rect.x-=8
screen.blit(c.image, (c.rect.x, c.rect.y)) screen.blit(c.image, (c.rect.x, c.rect.y))
......
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