gameupdate-loop

1.0.2 • Public • Published

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

Package Sidebar

Install

npm i gameupdate-loop

Weekly Downloads

0

Version

1.0.2

License

ISC

Unpacked Size

1.83 kB

Total Files

3

Last publish

Collaborators

  • impracticallabs