@nostranger/gameloop

1.0.1 • Public • Published

GameLoop

NPM Version

A super simple implementation of a game loop.

Usage

import { GameLoop } from '@nostranger/gameloop';

const gameLoop = new GameLoop({
  update(delta) {
    // Update data here
  },
  render() {
    // Draw graphics here
  },
});

// Start the game loop
gameLoop.start();

// Stop the game loop
gameLoop.stop();

// Check if the game loop is running
gameLoop.isActive; // bool

Package Sidebar

Install

npm i @nostranger/gameloop

Weekly Downloads

1

Version

1.0.1

License

MIT

Unpacked Size

3.94 kB

Total Files

4

Last publish

Collaborators

  • nostranger