Skip to main content

Function: addSpeedComponent()

addSpeedComponent(world, entity, options?): SpeedEcsComponent

Defined in: common/components/speed-component.ts:24

Attaches a SpeedEcsComponent to entity.

Parameters​

world​

EcsWorld

The ECS world entity belongs to.

entity​

number

The entity to attach the component to.

options?​

Partial<SpeedEcsComponent> = {}

Options for configuring the speed.

Returns​

SpeedEcsComponent

The attached component, for further tuning or runtime changes.