SFML community forums
Help => Window => Topic started by: vasyaslife on March 21, 2014, 12:45:16 pm
-
Hello!
I work on my project and there is one question.
I have action-game where the man shoots at the target. If i use
if((event.type == Event::KeyPressed) && (event.key.code == Keyboard::E)) Shot();
then my man shot a lot of! How can I slow down the process?
Maybe with clock help? Or should be used for the addition of one variable that stores reloading?
-
Yes, you can utilize a clock and some time variables, that way you can check whether the clock has already reached the cool down time or not. ;)