gameupdate-loop
v1.0.2
Published
This package allows you to create a game loop on node.js server with a specific fps.
Downloads
1
Maintainers
Readme
gameupdate-loop
This package allows you to run a game loop at fixed FPS
How To Use
Install
copy and paste this cammand on your terminal
$ npm install gameupdate-loop
Implimentation
import gameupdate-loop
var GameLoop=require("gameupdate-loop");
create an object of GameLoop like bellow, in the constructor you need to pass fps and the the callback function.
var FPS=60;
var worldLoop = new GameLoop(FPS,function (delta,frameNumber) {
// delta is the time for executing one frame ie 1/FPS
console.log("last frame time "+delta+" frame count "+frameNumber);
});
worldLoop.StartGameLoop();