Skip to content

Applying constant gravity ends up tresspassing tile. (Video, code and all data provided) #1286

Closed Answered by DelinWorks
rudiHammad asked this question in Q&A
Discussion options

You must be logged in to vote

you're doing it incorrectly, you should divide the delta time into 4 substeps at minimum, or you can make the system run at a fixed delta time by decoupling it from the update method, first store the current time of the physics system and another time for the game itself and each update while the physics time is lower than the game time you step with a delta time of (1.0 / 60) until the condition in the while loop is no longer met, this way if your game runs at 4 fps the physics will run at 60 no matter what, back to 4 substeps at 60 fps it will yield 240 steps a second, if you find that you need more than 240 tps for your system to be stable then that's inefficient you'd need to fix the …

Replies: 6 comments 4 replies

Comment options

You must be logged in to vote
1 reply
@rh101
Comment options

rh101 Jul 30, 2023
Collaborator

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@DelinWorks
Comment options

Answer selected by rudiHammad
Comment options

You must be logged in to vote
2 replies
@DelinWorks
Comment options

@rudiHammad
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants