About setting custom "dt"

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
User avatar
misterspok
Prole
Posts: 20
Joined: Fri Apr 19, 2013 12:40 pm

Re: About setting custom "dt"

Post by misterspok »

I must admit that I am rather new to programming, all the more so to game development (this is my first project). So I really appreciate for all your solutions and advices, and hope that this thread will help someone like me someday :)

But, Micha, I probably put something, or understood something, incorrectly due to my rather inferior english language skills :)

Let me put it simple. If you look at the code, you'll see the "q" variable. It holds thee "maximum kilograms per second" value. Later on, I use the "maxFt" variable, which represent "maximum kilograms per time step" value. And I was really unable to see the flaw in "ft" variable, which holds "current kilograms per second" value, and used it in my calculations! Instead of converting it to "current kilograms per time step", like I did with "maxFt". You noticed it:
And right before you put ft into the equation you calculate

Code: Select all

ft = ftpers * dt
and now I am amazed how didn't I noticed it :) Thank you! And may this help someone someday :)

Edit: I tested it right away, though I am at work :) This solution works perfect, and indeed it solves both problems. Thanks to Micha I optimized my code.

P.S. BTW how do I attach a file to the post?
User avatar
misterspok
Prole
Posts: 20
Joined: Fri Apr 19, 2013 12:40 pm

Re: About setting custom "dt"

Post by misterspok »

I think this can be marked [Solved].
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 6 guests