Commit 877cc5aa by BellCodeEditor

auto save

parent 68e3c245
Showing with 12 additions and 3 deletions
...@@ -9,7 +9,8 @@ class Block(pygame.sprite.Sprite): ...@@ -9,7 +9,8 @@ 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
pygame.init() # 初始化 pygame.init()
Block=pygame.sprite.Group() # 初始化
# 创建一个窗口 # 创建一个窗口
screen = pygame.display.set_mode((1000, 600)) screen = pygame.display.set_mode((1000, 600))
FPS = pygame.time.Clock() # pygame时钟,控制游戏速度(帧数) FPS = pygame.time.Clock() # pygame时钟,控制游戏速度(帧数)
...@@ -56,7 +57,7 @@ while True: ...@@ -56,7 +57,7 @@ while True:
else: else:
jumpState = "runing" jumpState = "runing"
t =30 t =30
time=0
# 悟空造型 # 悟空造型
wukong = hero[index] wukong = hero[index]
if jumpState == "runing": # 跑步状态下 if jumpState == "runing": # 跑步状态下
...@@ -81,6 +82,13 @@ while True: ...@@ -81,6 +82,13 @@ while True:
screen.blit(aa.image, (aa.rect.x, aa.rect.y)) screen.blit(aa.image, (aa.rect.x, aa.rect.y))
# 刷新画面 time+=1
if time >60:
t=0
Block.random.randint(0,50)
else:
time>20
aa.add(pygame.sprite.Sprite)
aa.Sprite.kill(pygame.sprite.Sprite) # 刷新画面
pygame.display.update() pygame.display.update()
FPS.tick(60) FPS.tick(60)
\ No newline at end of file
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