1.0.2 • Published 5 years ago

gameupdate-loop v1.0.2

Weekly downloads
3
License
ISC
Repository
-
Last release
5 years ago

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();