Commit 670475a4 by BellCodeEditor

save project

parent d76ef692
Showing with 12 additions and 4 deletions
......@@ -22,6 +22,10 @@ index = 0
jumpState = "runing"
y = 400
t = 30
obstacle = random.choice([bush,stone,cacti])
rect = obstacle.get_rect()
rect.x = 10000
rect.y = 500 - rect.height
while True:
for event in pygame.event.get():
......@@ -46,15 +50,18 @@ while True:
else:
jumpState = "runing"
t = 30
wukong = hero[index]
index += 1
if index == 5:
index = 0
wukong = hero[index]
if jumpState == "runing":
index += 1
if index == 5:
index = 0
# 将背景图画上去
screen.blit(background, (0, 0))
screen.blit(road, (0, 500))
screen.blit(wukong, (150, y))
rect.x -=8
screen.blit(obstacle,(rect.x,rect.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