create
@zylem/game-lib / entity / create
Function: create()
create(
options?):GameEntity<GameEntityOptions>
Defined in: packages/game-lib/src/lib/entities/entity.ts:1136
Create a bare entity with no mesh or collision.
Use .add(boxMesh(), boxCollision()) to compose its shape.
Parameters
options?
Partial<GameEntityOptions>
Returns
Example
const box = create({ position: { x: 0, y: 5, z: 0 } })
.add(boxMesh({ size: { x: 2, y: 2, z: 2 } }))
.add(boxCollision({ size: { x: 2, y: 2, z: 2 } }));