binarez Posted March 2, 2014 Share Posted March 2, 2014 Hi, I'm using game.time.elapsed to update my game entities. They are expecting frame delta time in milliseconds (ms). It seems to work. On all platforms, will elapsed be in milliseconds? Am I using game.time.elapsed correctly? Thanks for the awesome engine. Link to comment Share on other sites More sharing options...
binarez Posted March 2, 2014 Author Share Posted March 2, 2014 I am using version 1.1.5 right now. Link to comment Share on other sites More sharing options...
binarez Posted March 3, 2014 Author Share Posted March 3, 2014 Ok, I guess no one else is using game.time.elapsed? What are you using to get time per frame? I'm looking to get a value in milliseconds (number) so I can pass that to update my entities. Thanks for any info! Link to comment Share on other sites More sharing options...
Magnifisite Posted March 3, 2014 Share Posted March 3, 2014 You could use game.time.fps and if you want to know the time per frame it is 1000 / game.time.fps. Link to comment Share on other sites More sharing options...
binarez Posted March 3, 2014 Author Share Posted March 3, 2014 I went and did some digging : http://gametest.mobi/phaser/docs/Time.js.html#sunlight-1-line-107 So elapsed seems to be the difference between last frame's milliseconds timestamp vs this frame's... exactly what I need. Extra references:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/nowhttps://developer.mozilla.org/en-US/docs/Web/API/Performance.now%28%29 Link to comment Share on other sites More sharing options...
Zaidar Posted March 4, 2014 Share Posted March 4, 2014 You can look into the documentation : http://docs.phaser.io/Phaser.Time.html#toc4 It is written "Elapsed time since the last frame (in ms)" .So, yes, it will always be in milliseconds Link to comment Share on other sites More sharing options...
lordkryss Posted July 31, 2014 Share Posted July 31, 2014 edit: i read it wrong... Link to comment Share on other sites More sharing options...
Recommended Posts