how to detect if the space button is pressed in pygame
state = pygame.key.get_pressed()
if state[pygame.K_SPACE]:
4.56
9
if event.key == pygame.K_SPACE:
#what ever you want to run
Thank you!
9
0
Are there any code examples left?
New code examples in category Python