Commit 94160d9c by BellCodeEditor

save project

parent 68267944
Showing with 4 additions and 2 deletions
...@@ -14,7 +14,7 @@ class Block(pygame.sprite.Sprite): ...@@ -14,7 +14,7 @@ class Block(pygame.sprite.Sprite):
# 障碍物绘制坐标 # 障碍物绘制坐标
self.rect.x = 1000 self.rect.x = 1000
self.rect.y = 500 - self.rect.height self.rect.y = 500 - self.rect.height
self.score = 1 # self.score = 1
class player(pygame.sprite.Sprite): class player(pygame.sprite.Sprite):
def __init__(self,image): def __init__(self,image):
...@@ -41,6 +41,7 @@ hero = [pygame.image.load('hero1.png'), ...@@ -41,6 +41,7 @@ hero = [pygame.image.load('hero1.png'),
pygame.image.load('hero3.png'), pygame.image.load('hero3.png'),
pygame.image.load('hero4.png'), pygame.image.load('hero4.png'),
pygame.image.load('hero5.png')] pygame.image.load('hero5.png')]
# basic_font = pygame.font.Font('STKAITI.TTF',32)
index = 0 index = 0
y = 400 y = 400
jumpState = "runing" jumpState = "runing"
...@@ -120,7 +121,8 @@ while True: ...@@ -120,7 +121,8 @@ while True:
score += sprite.score score += sprite.score
sprite.score = 0 sprite.score = 0
print(score) print(score)
# scoreSurf = basic_font.render("分数:"+str(score),True,(255,0,0))
# screen.blit(scoreSurf,(850,20))
# print(len(block_list)) # print(len(block_list))
# 刷新画面 # 刷新画面
pygame.display.update() pygame.display.update()
......
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