Commit 77eae022 by BellCodeEditor

auto save

parent 686c5f10
Showing with 15 additions and 3 deletions
File added
......@@ -39,8 +39,9 @@ hero = [pygame.image.load('hero1.png'),
pygame.image.load('hero2.png'),
pygame.image.load('hero3.png'),
pygame.image.load('hero4.png'),
pygame.image.load('hero5.png')]
basic_font = pygame.font.Font('STKAITI.TTF',32)
pygame.image.load('hero5.PNG')]
score_audio = pygame.mixer.Sound('score.wav')
basic_font = pygame.font.Font('STKAIF.TTF',18)
index = 0
y = 400
jumpState = "runing"
......@@ -84,7 +85,7 @@ while True:
t += 2
else:
jumpState = "runing"
t =30
t = 30
# 将背景图画上去
bg_x -= 1
......@@ -115,6 +116,11 @@ while True:
gameover = pygame.image.load('gameover.png') # 游戏结束
screen.blit(gameover, (400, 200))
gamestate = False
else:
if (sprite.rect.x + sprite.rect.width) < wukong.rect.x:
score += sprite.score
sprite.score = 0
scoreSurf = basic_font.render("分数:"+str(score),True,(255,0,0))
screen.blit(scoreSurf,(850,20))
......
class Hero:
def_init_(salf,name,hp,attack):
safe.level=1
self.name=name
self.hp
\ 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