title: Why won't the bullets fire in the direction the player is facing and stay visible in PyGame?
body: <p>I'm trying to make a top down shooter in Python using PyGame and I want the bullets to be drawn to the screen based on the player's orientation. I can get the bullets to draw but only when the player is in that specific direction (There is a direction variable but the bullets only show when the variable matches the state that the bullet was shot in).</p>
  
  <p>Here is what I believe to be the relevant code</p>
  
  <pre><code>    global direction
      global bullets
      global bullet_speed
      direction = None
      bullets = []
      bullet_speed = []
  
      player_x = 100
      player_y = 100
  
      for event in pygame.event.get():
          if event.type == pygame.KEYDOWN:
             if event.key == pygame.K_LEFT:
                direction = 'left'
             if event.key == pygame.K_SPACE:
                bullets.append([player_x,player_y])
  
      gameDisplay.fill(BLACK)
  
      for draw_bullets in bullets:
          if direction = 'up':
             pygame.draw.rect(gameDisplay,WHITE,(draw_bullet[0] + (player_x / 2), draw_bullet[1] + 5, bullet_width, bullet_height))
             bullet_speed.append(speed)
          if direction = 'down':
             pygame.draw.rect(gameDisplay,WHITE,(draw_bullet[0] + (player_x / 2),draw_bullet[1] + (player_height + 5), bullet_width, bullet_height))
  
      pygame.display.update()
  </code></pre>
  
  <p>I don't want to fire the bullet where the mouse is pointing which is what all other questions have an answer for. I just want each bullet to fire in the direction that the player was pointing (either up, down, left, right) and keep going in whatever direction it started off it. If anyone could help me out I'd really appreciate it. I'm also not using OOP.</p>