Commit fa5ad979 by BellCodeEditor

save project

parent ed98506d
Showing with 4 additions and 3 deletions
......@@ -13,6 +13,7 @@ cacti = pygame.image.load('cacti.png') # 仙人掌
apple = pygame.image.load('bush.png') # 灌木丛
hero = [pygame.image.load("hero1.png"),pygame.image.load("hero2.png"),pygame.image.load("hero3.png"),pygame.image.load("hero4.png"),pygame.image.load("hero5.png")]
index = 0
y = 400
junpingstate = "running"
pygame.display.set_caption("悟空酷跑")
while True:
......@@ -21,7 +22,7 @@ while True:
# 接收到退出事件后退出程序
exit()
if event.type == locals.KEYDOWN:
if event.type == K.SPACE:
if event.type == locals.K_SPACE:
junpingstate = "up"
if junpingstate == "up":
if y > 150:
......@@ -43,4 +44,4 @@ while True:
screen.blit(abc, (150, y))
# 刷新画面
pygame.display.update()
FPS.tick(60)
\ No newline at end of file
FPS.tick(10)
\ 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