Commit f83eb44f by BellCodeEditor

auto save

parent beffb0da
Showing with 13 additions and 2 deletions
...@@ -9,6 +9,15 @@ class Block(pygame.sprite.Sprite): ...@@ -9,6 +9,15 @@ 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 Wukong(pygame.sprite.Sprite):
def __init__(self,wk_image):
super().__init__()
self.=wk_image
self.rect=self.image[0].get_rect()
self.rect.x=150
self.rect.y=400
pygame.init() # 初始化 pygame.init() # 初始化
# 创建一个窗口 # 创建一个窗口
...@@ -41,6 +50,8 @@ obs.rect.y = 500 - obs.rect.height ...@@ -41,6 +50,8 @@ obs.rect.y = 500 - obs.rect.height
block_list=pygame.sprite.Group() block_list=pygame.sprite.Group()
block_list.add(obs) block_list.add(obs)
time=0 time=0
wuk=Wukong(hero)
while True: while True:
for event in pygame.event.get(): for event in pygame.event.get():
if event.type == locals.QUIT: if event.type == locals.QUIT:
...@@ -66,7 +77,7 @@ while True: ...@@ -66,7 +77,7 @@ while True:
t =30 t =30
# 悟空造型 # 悟空造型
wukong = hero[index]
if jumpState == "runing": # 跑步状态下 if jumpState == "runing": # 跑步状态下
index += 1 index += 1
if index >= 5: if index >= 5:
...@@ -82,7 +93,7 @@ while True: ...@@ -82,7 +93,7 @@ while True:
road_x=0 road_x=0
screen.blit(road, (road_x, 500)) # 路 screen.blit(road, (road_x, 500)) # 路
screen.blit(wukong, (150, y)) # 悟空 screen.blit(wuk.image[index], (150, y)) # 悟空
time+=1 time+=1
if time>=60: if time>=60:
time=0 time=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