Why are there two "iHoldKeyPressLeft++;", the first one ebing conditional, and the second one occurring all the time?
at the moment I'm searching for a flaw in your timing design, but I can't put my finger on it: You seem to make both angle increments and timer increment rely on the frame being rendered, so it should be correct.
I do believe that when the framerate drops, AGS skips not only the rendering of the slow frame, but also the execution of the associated script. I hope I'm right.
EDIT: I think I might have an explanation :
- Consider that when the framerate drops to 35, a timer of 15 to 20 frames is equivalent to almost one half second (500ms).
- A half second is a rather huge time gap, and is more than enough to confuse the player (if he sees the car at a certain angle, and stops pressing the key, but the script still locks down the key for 500ms, and makes the car turn further).
You have 2 solutions :
- Either you reduce the timer's interval to check the car's state more often (but still update the sprite only once in a while, when needed)
- Or you should redesign the script in order to make it check that the car has reached the target angle rather than checking that the timer has expired. The timer expiration should be used only to match the current angle to the time elapsed, and THEN the sprite should be based on the actual angle. That second solution needs more thinking.