In my game, the rate of fire for the akm changes with the framerate.
I have a variable called auti. When you fire, it sets it to 5 and every frame reduces it by one. when it is equal to 0 then you can fire again. at 60 the fire rate is what I like.
Is there any way to remove the dependence of the frame rate? Playground lines 350-357 have two different methods of increasing a variable. line 350 should increase the variable si by one every frame, it runs every 1000/60 milliseconds. line 351 increase sf by one every frame. lines 352-355 stop the two functions when si hits 1000, and 356 and 357 show the variables in the onscreen '“console.”
why does si increase faster than sf?
Any help would be nice.
TLDR: The gun fires faster the higher the framerate.