Commit 91a78c00 by BellCodeEditor

save project

parent 1fe18244
Showing with 6 additions and 0 deletions
......@@ -26,6 +26,7 @@ class Block(pygame.sprite.Sprite):
self.rect = self.image.get_rect()
self.rect.x = 1000
self.rect.y = 500 - self.rect.height
self.score = 1
class Player(pygame.sprite.Sprite):
def __init__(self,image):
......@@ -44,6 +45,7 @@ road_x = 0
bg_x = 0
time = 0
start = True
score=0
while True:
for event in pygame.event.get():
......@@ -105,6 +107,10 @@ while True:
game = pygame.image.load('gameover.png')
screen.blit(game,(400,200))
start = False
else:
if sprite.rect.x+sprite.rect.width < wukong.rect.x:
score += sprite.score
sprite.score = 0
# 刷新画面
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