This line is wrong:
oldms = millisecs()
It should read:
oldms=oldms+50
This is the main reason why your timing is out.
You also should use While instead of If. This avoids slowdown if the players framerate drops below 20fps. Also, remember to initialise oldms to millisecs() or you will skip an absurd number of frames
oldms = millisecs()
It should read:
oldms=oldms+50
This is the main reason why your timing is out.
You also should use While instead of If. This avoids slowdown if the players framerate drops below 20fps. Also, remember to initialise oldms to millisecs() or you will skip an absurd number of frames