Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Pixelbox

Create 2D games in JavaScript, made easier · By Cedric Stoquer

Is there delta time?

A topic by Futura created Apr 15, 2020 Views: 351 Replies: 2
Viewing posts 1 to 3

Is there an alternative to Unity’s Time.deltaTime or Godots delta?

(+1)

There is no delta-time by default. Here is how you can implement it:

var previousTime = Date.now();
module.exports = function () {
    var now = Date.now();
    var deltaTime = now - previousTime;
    previousTime = now;
    // ...
}

Thank you!