This package contains tick providers for use with Ash - an entity component system framework for game development.
npm i @ash.ts/tick
There are two tickProviders included by default:
IntervalTickProvider
RAFTickProvider
import { Engine } from '@ash.ts/core';import { RAFTickProvider } from '@ash.ts/tick';const engine = new Engine();const tickProvider = new RAFTickProvider();tickProvider.add(delta => engine.update(delta));tickProvider.start(); Copy
import { Engine } from '@ash.ts/core';import { RAFTickProvider } from '@ash.ts/tick';const engine = new Engine();const tickProvider = new RAFTickProvider();tickProvider.add(delta => engine.update(delta));tickProvider.start();
You can also build your own by creating a class that implements TickProvider interface.
TickProvider
Generated using TypeDoc
This package contains tick providers for use with Ash - an entity component system framework for game development.
Installation
npm i @ash.ts/tickUsage
There are two tickProviders included by default:
IntervalTickProviderwhich uses setTimeout under the hood and can be used with static FPS,RAFTickProviderwhich uses requestAnimationFrame and provide as many FPS as used browser and your environment can provide.Example
Custom TickProviders
You can also build your own by creating a class that implements
TickProviderinterface.