You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
because FlxG.elapsed is just a constant, not the actual elapsed time.
This doesn't produce the same speed either in my test:
sprite.x += Gdx.graphics.getDeltaTime()*60;
Box2D physics
When I'm using Box2D and have a state extending B2FlxState, in the update method I call super.update() and the physics also slows down when framerate drops. B2FlxState's update method has the same problem:
_frameTime = FlxG.elapsed;
Side question: how to measure actual FPS?
The text was updated successfully, but these errors were encountered:
Thank you, your suggestion works. Now only the following things remain:
a) B2FlxState.update() shall use this delta time calculated above instead of FlxG.elapsed:
Because FlxG.elapsed is just a constant not the actual delta time. (I can write some workaround code when calling B2FlxState.update() for now but it should be fixed.)
b) I think it would be good to have this delta time available in FlxG.
edit: I've tried sprite.velocity.x = 30; and it is also not framerate independent.
This doesn't work:
because FlxG.elapsed is just a constant, not the actual elapsed time.
This doesn't produce the same speed either in my test:
When I'm using Box2D and have a state extending B2FlxState, in the update method I call super.update() and the physics also slows down when framerate drops. B2FlxState's update method has the same problem:
The text was updated successfully, but these errors were encountered: