title: When I run my code it works but there are issues when I want to input a jump command. The computer jumps but then keeps dropping down out of my screen
body: <p>Hi I've been following Tech with Tim's pygame. However I have reached a point where we are coding jumping. I understand the code but Idon't understand why my computer won't consider the else statement once I have reached jumpCount = -10
  Here's the full code for comprehension but it's the part starting from "if not isJump:"</p>
  
  <pre><code>x = 50
  y = 50
  width = 40
  height = 60
  vel = 5
  
  isJump = False
  jumpCount = 10
  
  run = True
  
  while run:
      pygame.time.delay(100)
  
      for event in pygame.event.get():
          if event.type == pygame.QUIT:
              run = False
  
      keys = pygame.key.get_pressed()
      if keys[pygame.K_LEFT] and x &gt; vel:
          x -= vel
      if keys[pygame.K_RIGHT] and x &lt; 500 - (width + vel):
          x += vel
      if not isJump:
          if keys[pygame.K_UP] and y &gt; vel:
              y -= vel
          if keys[pygame.K_DOWN] and y &lt; 500 - (height + vel):
              y += vel
          if keys[pygame.K_SPACE]:
              isJump = True
  
      # So my problem is really here.
  
      else:
          if isJump &gt;= -10:
              neg = 1
              if jumpCount &lt; 0:
                  neg = -1
              y -= ((jumpCount ** 2) * neg) * 0.5
              jumpCount -= 1
  
          else:
              isJump = False
              jumpCount = 10
  
      window.fill((0, 0, 0))
      pygame.draw.rect(window, (255, 0, 0), (x, round(y), width, height))
      pygame.display.update()
  pygame.quit()
  </code></pre>