I want my gun and animated sprites to be the right speed according to the framerate. If I don’t limit the fps, the game is too fast and I want the m16 to shoot slower and the reload should be a bit longer. How would i synch the 2 things together?
By using the TPF in the update function. It contains a value that tells you the time difference the current and previous frame. If you start reloading, set a float to for instance 2, and subtract the TPF on every update. After 2 seconds, your value will become >= 0 and reloading is “over”.