I am creating a game in allegro5 and I have come across a problem. I have a character that fires a shotgun and there needs to be a delay before he can shoot again. The code for shooting his gun is in a function called
fire_shotgun();
and I cant find a way to create a pause before he shoots again without stopping the whole game by using
al_rest();
I am wondering if there is any way to do this.
P.S. my game is running on a 60FPS timer if that is of any use.
al_rest()just pauses the entire thread it currently runs till the time inside it runs out. It usually should not be used for gameplay but to pause threads for whatever reason you would need to do that (sync/delay action/initialize something/etc) \$\endgroup\$