Commit a49e1ab1 by BellCodeEditor

auto save

parent 95c38dc0
Showing with 8 additions and 2 deletions
......@@ -32,6 +32,7 @@ hero = [pygame.image.load('hero1.png'),
pygame.image.load('hero3.png'),
pygame.image.load('hero4.png'),
pygame.image.load('hero5.png')]
lose = pygame.image.load('gameover.png')
lu_x=0
shan_x=0
index = 0
......@@ -40,6 +41,7 @@ jumpState = "runing"
t = 30
time = 0
s_list = pygame.sprite.Group()
game_state = True
while True:
for event in pygame.event.get():
if event.type == locals.QUIT:
......@@ -72,7 +74,7 @@ while True:
jumpState = "runing"
t =30
if game_state:
# 将背景图画上去
shan_x -=2
if shan_x <-1000:
......@@ -96,7 +98,10 @@ while True:
i.kill()
i.rect.x -= 8
screen.blit(i.image, (i.rect.x, i.rect.y))
if pygame
if pygame.sprite.collide_rect(wukong,i):
screen.blit(lose, (400, 300))
game_state = False
# 刷新画面
pygame.display.update()
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