That’s not right. You’re doing a delta-frame calculation which is not what you want.
You don’t need to incorporate anything for FPS.
Delta time calcs do not care about the FPS setting in config.lua
Time is time regardless of how your config.lua file is set up.
This is what you want:
local runtime = system.getTimer() local getDeltaTime=function () local temp = system.getTimer() local dt = (temp - runtime) / 1000 runtime = temp return dt end
To be ABSOLUTELY clear, all rates should be in terms of pixels-per-second when using delta-time calculations.
Thus 100 is 100 pixels-per-second in my example towards the top.
Those ‘pixels’ are design pixels. So, if your config.lua file specifies 320x480, then moving 100 pixels horizontally per second means moving approximatly 1/3 of the way across the screen per second, regardless of the actual pixel density of the screen. (Assuming you’re using letterbox scaling).
PS - Delta-frame calculations will result in rate variations which I believe is what you are seeing. You’ve added a dependency in your calculation that should not be there.