Commit 8bfec646 by BellCodeEditor

save project

parent 4d7f8955
Showing with 5 additions and 0 deletions
...@@ -35,6 +35,7 @@ t = 30 ...@@ -35,6 +35,7 @@ t = 30
# rect.y = 500 - rect.height # rect.y = 500 - rect.height
roadx=0 roadx=0
bg_x=0 bg_x=0
time=0
obstacle=Block(bush,cacti,stone) obstacle=Block(bush,cacti,stone)
while True: while True:
for event in pygame.event.get(): for event in pygame.event.get():
...@@ -69,6 +70,10 @@ while True: ...@@ -69,6 +70,10 @@ while True:
screen.blit(background, (bg_x, 0)) # 远处背景 screen.blit(background, (bg_x, 0)) # 远处背景
screen.blit(road, (roadx, 500)) # 路 screen.blit(road, (roadx, 500)) # 路
screen.blit(wukong, (150, y)) # 悟空 screen.blit(wukong, (150, y)) # 悟空
time+=1
if time >=60:
time=0
num=random.randint(0,50)
# if rect.x <= 0-rect.width: # 障碍物消失 # if rect.x <= 0-rect.width: # 障碍物消失
# # 创建障碍物对象 # # 创建障碍物对象
......
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