Commit 96d87d41 by BellCodeEditor

auto save

parent 3c133458
Showing with 16 additions and 3 deletions
......@@ -31,17 +31,30 @@ index = 0
y = 400
jumpState = "runing"
t = 30
obstacle = random.choice([bush, stone, cacti])
rect = obstacle.get_rect()
obstacle_list = obstacle.gpygame.sprite.Sprite
rect.x = 1000
rect.y = 500 - rect.height
road_x=0
background_x=0
time=0
while True:
for event in pygame.event.get():
if event.type == locals.QUIT:
# 接收到退出事件后退出程序
exit()
time+=1
if time>=60:
time=0
num=random.randint(0,50)
if num>20:
obstacle = jinglin(stone,cacti,bush)
obstacle_list.add(obstacle)
for temp_sprite in obstacle_list:
temp_sprite.rect.x-=8
screen.blit(temp_sprite.image,(temp_sprite.rect.x,temp_sprite.rect.y))
if temp_sprite.rect.x<=0-temp_sprite.rect.x
temp_sprite.killl()
if pygame.sprite.collide_rect
if event.type == locals.KEYDOWN:
if jumpState == "runing":
if event.key == locals.K_SPACE:
......@@ -60,7 +73,7 @@ while True:
else:
jumpState = "runing"
t =30
# 悟空造型
wukong = hero[index]
if jumpState == "runing": # 跑步状态下
......
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