PygameForBeginners
PygameForBeginners copied to clipboard
bullets are not showing
same
i got it i was checking for event.type in bullet keys. here is the fixed code -
Inside the event loop for detecting bullet firing keys
if event.type == pygame.KEYDOWN: `` if event.key == pygame.K_f and len(yellow_bullets) < MAX_BULLETS: bullet = pygame.Rect(yellow.x + yellow.width, yellow.y + yellow.height//2,10,5) yellow_bullets.append(bullet)
if event.key == pygame.K_e and len(red_bullets) < MAX_BULLETS:
bullet = pygame.Rect(red.x, red.y + red.height//2,10,5)
red_bullets.append(bullet)
notice i have replaced event.type to event.keys and sorry for wrong spaces, it is a git hub issue