Commit 898944f2 by BellCodeEditor

save project

parent d967cb62
Showing with 2 additions and 1 deletions
...@@ -10,6 +10,7 @@ class Block(pygame.sprite.Sprite): ...@@ -10,6 +10,7 @@ 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
self.score = 1
#obstacle=Block(importpygame) #obstacle=Block(importpygame)
# 创建一个窗口 # 创建一个窗口
screen = pygame.display.set_mode((1000, 600)) screen = pygame.display.set_mode((1000, 600))
...@@ -78,7 +79,7 @@ while True: ...@@ -78,7 +79,7 @@ while True:
num = random.randint(0,50) num = random.randint(0,50)
if num >20: if num >20:
obstacle=Block(bush,carti,stone) obstacle=Block(bush,carti,stone)
list.add(obstacle) block.list.add(obstacle)
for sprite in list: for sprite in list:
sprite.rect.x-=8 sprite.rect.x-=8
screen.blit(sprite.image(sprite.rcet.x.sprite.rect.y)) screen.blit(sprite.image(sprite.rcet.x.sprite.rect.y))
......
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