I've looked at other threads but they said to use pygame.time.set_timer(x, y) but this doesn't seem to work for me, it still shoots super fast with zero delay and I have no idea why. What i want is for the enemy to shoot randomly but with at least a half second delay. (nme_game is the rect of the enemy and nme_game_bullet is supposed to be the bullets coming from the enemy)
Here's the code:
def nme_shooting(nme_game, nme_game_bullet):
bullet = pygame.Rect(nme_game.x + nme_game.width / 2.2 + 1, nme_game.y, 5, 25)
nme_game_bullet.append(bullet)
nme_game_bullet = USEREVENT + 1
pygame.time.set_timer(nme_game_bullet, 500)