【发布时间】:2021-08-05 04:33:27
【问题描述】:
fps = 90
fpsclock = pygame.time.Clock()
while True:
for event in pygame.event.get():
if event.type == QUIT:
sys.exit()
a = False
keys = pygame.key.get_pressed()
if keys[pygame.K_SPACE]:
#pygame.key.set_repeat(10,50)
is_jump = True
if True and icony <=340:
icony -= jump_count**2*0.4*direction
jump_count -= 1
if jump_count == 0 :
direction = direction*-1
if jump_count == -10:
is_jump = False
jump_count = 10
direction = 1
icony = 340
pygame.time.delay(10)
fpsclock.tick(fps)
pygame.display.update()
我希望它跳起来,然后停一秒钟左右,然后再跳,而不是连续跳。请帮忙
【问题讨论】:
标签: python pygame game-physics