so I'm trying to make a loop so that when my fire button is held down, it shoots every 1/2 second.
I've tried the time.wait(0.5), but it freezes my entire game fore 1/2 a second.
here's some code i tried
if event.type == KEYDOWN and event.key == K_SPACE:
fighter.fire()
time.wait(0.5)
if event.type == KEYDOWN and event.key == K_SPACE:
fighter.fire()
what i expect is fore the code to wait 0.5 seconds, then shoot again, but I'm still working on getting it to loop. What happens now is my game freezes for the specified time, then resumes, but the projectile is two stacked ontop of each other. thanks for any help