Nikow Posted July 8, 2015 Share Posted July 8, 2015 Hi, I've to create a miliseconds timer. It will have this format : SS:mSmS (02:52 for exemple) S : seconds, mS : milliSeconds. How can i create it ? (i need to have real milliseconds and seconds) ... Link to comment Share on other sites More sharing options...
Langerz82 Posted July 8, 2015 Share Posted July 8, 2015 function create(){checktime = game.time.now;}function update(){ // AI Timer if (game.time.now - checktime > 100) // 100ms { // do stuff }}Hope this helps, cheers. Link to comment Share on other sites More sharing options...
Abderrahmane TJ Posted July 8, 2015 Share Posted July 8, 2015 take a look at this example http://phaser.io/examples/v2/time/custom-timer it shows a timer that is updated every 2 seconds, you could tweak it to get what you want (theoretically).But since this is JavaScript, most browsers won't give you hand on the ticker every millisecond. some info could be found here http://stackoverflow.com/questions/9647215/what-is-minimum-millisecond-value-of-settimeout Link to comment Share on other sites More sharing options...
Recommended Posts