@vyke/torao
v0.1.2
Published
Small and type-friendly library for game development
Downloads
609
Maintainers
Readme
Installation
npm i @vyke/torao
API
defineComponent
Define a new component.
const Size = defineComponent('size', (value: number) => value)
const Position = defineComponent('position', (pos: { x?: number, y?: number }) => {
return { x: pos.x ?? 0, y: pos.y ?? 0 }
})
createResource
Creates a resource that can be shared between systems.
createGame
Create a new game.
const entity = {
// ...your components
}
const director = createDirector<{
home: never
// ...your scenes
}>()
const game = createGame({
director,
entity,
})