Commit 84e48f6c by BellCodeEditor

save project

parent f59ce087
Showing with 15 additions and 4 deletions
......@@ -31,16 +31,14 @@ index = 0
y = 400
jumpState = "runing"
t = 30
bg_x=0
road_x=0
time=0
obstacle = random.choice([bush, stone, cacti])
rect = obstacle.get_rect()
rect.x = 1000
rect.y = 500 - rect.height
road_x=0
b_x=0
obstacle = Block(bush,stone,cacti)
time=0
# obstacle = Block(bush,stone,cacti)
while True:
for event in pygame.event.get():
if event.type == locals.QUIT:
......@@ -70,6 +68,19 @@ while True:
b_x-=6
if b_x<-1000:
b_x=0
time+=1
if time>=60:
r=random.randint(0,100)
if r>40:
obstacle=Block(bush,cacti,stone)
block_list.add(obstacle)
time=0
for prop in block_list:
prop.rect.x-=8
screen.blit(prop.image,(prop.rect.x,prop.rect.y))
if prop.rect.x<=0-prop.rect.width:
prop.kill()
# 悟空造型
......
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