intervals and timeouts using a delta tick. Useful for timing things with games.
npm install ticintervals and timeouts using a delta tick. Useful for timing things with games.
!tic
``js
var tic = require('tic')();
var clearInterval = tic.interval(function(param1) {
console.log(param1 + ' 5 tick seconds!');
}, 5000, 'Every');
var clearTimeout = tic.timeout(function() {
console.log('Only once after 10 tick seconds!');
}, 10000);
game.on('tick', function(dt) {
tic.tick(dt);
});
`
at the given time interval.$3
Runs the function fn only once at the given time.$3
Use to advance the timer.install
With npm do:`
npm install tic
``