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()
I want it to jump and then to stop for a second or so and then jump again instad of jumping continuously . please help