Physics, forces and dt
Posted: Wed Nov 16, 2022 3:05 pm
Hello, all you awesome people!
I am currently developing a fast-paced run-and-gun game, and I have run into a physics problem. (I might not implement physics later, this is still in a very early stage of development )
But onto the question at hand. I am using the windfield library, which I think is great atm. I also navigated many videos and forum posts to learn how to move my player using the physics library. The different methods I have found are applyForce, applyLinearImpulse, setLinearVelocity, and setX + some speed?. So I decided to try applyForce first, and when I tried it, it works. However, when I multiply my speed variable with dt, it slows to a crawl, and I have to use way bigger numbers to get it to move.
So this got me thinking, do physics calculations not need dt, or does it get multiplied with dt when the world gets updated (world:update(dt))? And is applyForce the best thing to use for this situation, or are there better ways?
I included my (kinda barebones) .love file if you wanna take a look. Also, this is my first post, so please tell me if I have done something wrong or if you need help understanding something!
I am currently developing a fast-paced run-and-gun game, and I have run into a physics problem. (I might not implement physics later, this is still in a very early stage of development )
But onto the question at hand. I am using the windfield library, which I think is great atm. I also navigated many videos and forum posts to learn how to move my player using the physics library. The different methods I have found are applyForce, applyLinearImpulse, setLinearVelocity, and setX + some speed?. So I decided to try applyForce first, and when I tried it, it works. However, when I multiply my speed variable with dt, it slows to a crawl, and I have to use way bigger numbers to get it to move.
So this got me thinking, do physics calculations not need dt, or does it get multiplied with dt when the world gets updated (world:update(dt))? And is applyForce the best thing to use for this situation, or are there better ways?
I included my (kinda barebones) .love file if you wanna take a look. Also, this is my first post, so please tell me if I have done something wrong or if you need help understanding something!