The use of 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
micha
Inner party member
Posts: 1083
Joined: Wed Sep 26, 2012 5:13 pm

Re: The use of dt

Post by micha »

Bindie wrote:Hey, I haven't implemented dt to every equation yet. If I think I got a perfect timing for example a laser timer, without dt as a factor, do I have to recalibrate that perfect timing when I implement dt?
Yes you have to. Once you put in dt everywhere, the game will run at a different speed. However, things that happen synchronous without dt will also do so with dt. So all you have to do is adapt the overall speed.
In most cases you will have 60 frames per second. So if you insert (60*dt) everywhere, then the overall game speed should stay about the same.
User avatar
kikito
Inner party member
Posts: 3153
Joined: Sat Oct 03, 2009 5:22 pm
Location: Madrid, Spain
Contact:

Re: The use of dt

Post by kikito »

Bindie wrote:Hey, I haven't implemented dt to every equation yet. If I think I got a perfect timing for example a laser timer, without dt as a factor, do I have to recalibrate that perfect timing when I implement dt?
It might perfect in your computer, but without dt it will run faster or slower in others. Using dt is what makes it perfect everywhere.
When I write def I mean function.
User avatar
Jasoco
Inner party member
Posts: 3726
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

Re: The use of dt

Post by Jasoco »

It's not hard to use dt. I don't understand why so many people try to avoid it. It's a super simple concept.
User avatar
s-ol
Party member
Posts: 1077
Joined: Mon Sep 15, 2014 7:41 pm
Location: Cologne, Germany
Contact:

Re: The use of dt

Post by s-ol »

Jasoco wrote:It's not hard to use dt. I don't understand why so many people try to avoid it. It's a super simple concept.
plus, if you start with it right away, it's not even harder than not using it.

s-ol.nu /blog  -  p.s-ol.be /st8.lua  -  g.s-ol.be /gtglg /curcur

Code: Select all

print( type(love) )
if false then
  baby:hurt(me)
end
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 5 guests