Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bullets are not showing #20

Open
Deeptineeharika opened this issue Mar 30, 2024 · 2 comments
Open

bullets are not showing #20

Deeptineeharika opened this issue Mar 30, 2024 · 2 comments

Comments

@Deeptineeharika
Copy link

No description provided.

@Chirag1147933
Copy link

same

@Chirag1147933
Copy link

Chirag1147933 commented Apr 26, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants