kt3k / gameloop

Simple game loop

Home Page:https://jsr.io/@kt3k/gameloop

Repository from Github https://github.comkt3k/gameloopRepository from Github https://github.comkt3k/gameloop

@kt3k/gameloop v2.0.0

ci codecov

Simple game loop

Install

npx jsr add @kt3k/gameloop

or, in Deno:

deno add @kt3k/gameloop

Usage

import { Gameloop } from "@kt3k/gameloopjs";

const loop = new Gameloop(30, () => {
  console.loog("step");
});

loop.start();

setTimeout(() => {
  loop.stop();
}, 5000);

func is called 30 times per second and is stopped after 5 seconds.

API

See API doc

License

MIT

About

Simple game loop

https://jsr.io/@kt3k/gameloop

License:MIT License


Languages

Language:TypeScript 100.0%