Skip to main content
Home

A simple game loop

This package works with Node.js, Deno, Bun, BrowsersIt is unknown whether this package works with Cloudflare Workers
It is unknown whether this package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
This package works with Bun
This package works with Browsers
JSR Score
100%
Published
3 months ago (2.0.1)

@kt3k/gameloop v2.0.1

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

New Ticket: Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

Add Package

deno add jsr:@kt3k/gameloop

Import symbol

import * as gameloop from "@kt3k/gameloop";
or

Import directly with a jsr specifier

import * as gameloop from "jsr:@kt3k/gameloop";

Add Package

pnpm i jsr:@kt3k/gameloop
or (using pnpm 10.8 or older)
pnpm dlx jsr add @kt3k/gameloop

Import symbol

import * as gameloop from "@kt3k/gameloop";

Add Package

yarn add jsr:@kt3k/gameloop
or (using Yarn 4.8 or older)
yarn dlx jsr add @kt3k/gameloop

Import symbol

import * as gameloop from "@kt3k/gameloop";

Add Package

vlt install jsr:@kt3k/gameloop

Import symbol

import * as gameloop from "@kt3k/gameloop";

Add Package

npx jsr add @kt3k/gameloop

Import symbol

import * as gameloop from "@kt3k/gameloop";

Add Package

bunx jsr add @kt3k/gameloop

Import symbol

import * as gameloop from "@kt3k/gameloop";