Commit 03e9ba2c by BellCodeEditor

save project

parent 344a2b27
Showing with 6 additions and 0 deletions
......@@ -13,6 +13,7 @@ screen = pygame.display.set_mode((1000, 600))
FPS = pygame.time.Clock() # pygame时钟,控制游戏速度(帧数)
# 载入图片
background = pygame.image.load('bg.png') # 背景
print(rect)
road = pygame.image.load('road.png') # 路
stone = pygame.image.load('stone.png') # 石头
cacti = pygame.image.load('cacti.png') # 仙人掌
......@@ -53,10 +54,14 @@ while True:
index+=1
if index==5:
index=0
if 障碍物_x<0-new_stone.get_rect()[2]:
new_stone=random.choice([stone,cacti,apple])
障碍物_x=1000
# 将背景图画上去
screen.blit(background, (0, 0))
screen.blit(road, (0, 500))
screen.blit(wukong, (150, y))
screen.blit(new_stone,(障碍物_x,障碍物_y)
# 刷新画面
pygame.display.update()
FPS.tick(30)
\ 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