Commit 5c684a44 by BellCodeEditor

save project

parent ed5ade84
Showing with 17 additions and 2 deletions
...@@ -31,7 +31,9 @@ y = 400 ...@@ -31,7 +31,9 @@ y = 400
jumpState = "runing" jumpState = "runing"
t = 30 t = 30
block_list = pygame.sprite.Group() block_list = pygame.sprite.Group()
time=0 time=0.
while True: while True:
for event in pygame.event.get(): for event in pygame.event.get():
...@@ -42,6 +44,15 @@ while True: ...@@ -42,6 +44,15 @@ while True:
if jumpState == "runing": if jumpState == "runing":
if event.key == locals.K_SPACE: if event.key == locals.K_SPACE:
jumpState = "up" jumpState = "up"
wukong=player(here[index])
if jumpState="up"
if t>0:
if jumpState == "up": # 起跳状态 if jumpState == "up": # 起跳状态
if t > 0: if t > 0:
...@@ -81,7 +92,10 @@ while True: ...@@ -81,7 +92,10 @@ while True:
screen.blit(obstacle.image, (obstacle.rect.x, obstacle.rect.y)) screen.blit(obstacle.image, (obstacle.rect.x, obstacle.rect.y))
if obstacle.rect.x<=0-obstacle.rect.width: if obstacle.rect.x<=0-obstacle.rect.width:
obstacle.kill() obstacle.kill()
if pygame.sprite.collide_rect(wukong,obstacle):
# 刷新画面 # 刷新画面
pygame.display.update() pygame.display.update()
FPS.tick(60) FPS.tick(60)
\ 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