Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/nostrangerdev/gameloop

A super simple implementation of a game loop
https://github.com/nostrangerdev/gameloop

Last synced: 6 days ago
JSON representation

A super simple implementation of a game loop

Awesome Lists containing this project

README

        

# GameLoop

![NPM Version](https://img.shields.io/npm/v/%40nostranger%2Fgameloop)

A super simple implementation of a game loop.

## Usage

```js
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
```